humanish 0.104.3 → 0.106.0
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/AGENTS.md +89 -94
- package/ARCHITECTURE.md +146 -0
- package/CHANGELOG.md +502 -0
- package/CONTEXT.md +51 -0
- package/CONTRIBUTING.md +111 -9
- package/README.md +213 -124
- package/SECURITY.md +1 -1
- package/TELEMETRY.md +112 -0
- package/dist/actors/affordance.d.ts +56 -0
- package/dist/actors/affordance.js +155 -0
- package/dist/actors/agent-session.js +42 -0
- package/dist/actors/codex/app-server-actor-trace.d.ts +11 -0
- package/dist/actors/codex/app-server-actor-trace.js +211 -0
- package/dist/actors/codex/app-server-client.d.ts +39 -0
- package/dist/actors/codex/app-server-client.js +116 -0
- package/dist/actors/codex/app-server-trace.d.ts +154 -0
- package/dist/actors/codex/app-server-trace.js +424 -0
- package/dist/actors/codex/app-server-ui.d.ts +40 -0
- package/dist/actors/codex/app-server-ui.js +328 -0
- package/dist/actors/codex/app-server.d.ts +44 -0
- package/dist/actors/codex/app-server.js +268 -0
- package/dist/actors/codex/qualified-versions.d.ts +45 -0
- package/dist/actors/codex/qualified-versions.js +87 -0
- package/dist/actors/codex/restricted-executable.d.ts +17 -0
- package/dist/actors/codex/restricted-executable.js +147 -0
- package/dist/actors/codex/restricted-launch.d.ts +116 -0
- package/dist/actors/codex/restricted-launch.js +222 -0
- package/dist/actors/codex/restricted-participant-policy.d.ts +46 -0
- package/dist/actors/codex/restricted-participant-policy.js +82 -0
- package/dist/actors/codex/restricted-participant.d.ts +20 -0
- package/dist/actors/codex/restricted-participant.js +432 -0
- package/dist/actors/codex/restricted-policy.d.ts +70 -0
- package/dist/actors/codex/restricted-policy.js +326 -0
- package/dist/actors/codex/restricted-session.d.ts +65 -0
- package/dist/actors/codex/restricted-session.js +432 -0
- package/dist/actors/codex/restricted-transport.d.ts +73 -0
- package/dist/actors/codex/restricted-transport.js +335 -0
- package/dist/actors/codex/restricted-turn.d.ts +62 -0
- package/dist/actors/codex/restricted-turn.js +284 -0
- package/dist/actors/computer-use/actor.d.ts +77 -0
- package/dist/actors/computer-use/actor.js +78 -0
- package/dist/actors/computer-use/admission-limit.d.ts +12 -0
- package/dist/actors/computer-use/admission-limit.js +19 -0
- package/dist/actors/computer-use/executor-error.js +48 -0
- package/dist/actors/computer-use/loop/actions.d.ts +26 -0
- package/dist/actors/computer-use/loop/actions.js +245 -0
- package/dist/actors/computer-use/loop/backstop.d.ts +42 -0
- package/dist/actors/computer-use/loop/backstop.js +202 -0
- package/dist/actors/computer-use/loop/debrief.d.ts +19 -0
- package/dist/actors/computer-use/loop/debrief.js +164 -0
- package/dist/actors/computer-use/loop/ending.d.ts +86 -0
- package/dist/actors/computer-use/loop/ending.js +316 -0
- package/dist/actors/computer-use/loop/observation.d.ts +55 -0
- package/dist/actors/computer-use/loop/observation.js +246 -0
- package/dist/actors/computer-use/loop/output-limit.d.ts +11 -0
- package/dist/actors/computer-use/loop/output-limit.js +21 -0
- package/dist/actors/computer-use/loop/provider-call.d.ts +19 -0
- package/dist/actors/computer-use/loop/provider-call.js +208 -0
- package/dist/actors/computer-use/loop/race.d.ts +34 -0
- package/dist/actors/computer-use/loop/race.js +79 -0
- package/dist/actors/computer-use/loop/session.d.ts +77 -0
- package/dist/actors/computer-use/loop/session.js +135 -0
- package/dist/actors/computer-use/loop/spend.d.ts +30 -0
- package/dist/actors/computer-use/loop/spend.js +85 -0
- package/dist/actors/computer-use/loop/trace.d.ts +35 -0
- package/dist/actors/computer-use/loop/trace.js +140 -0
- package/dist/actors/computer-use/loop/types.d.ts +404 -0
- package/dist/actors/computer-use/loop/types.js +1 -0
- package/dist/actors/computer-use/loop/usage.d.ts +102 -0
- package/dist/actors/computer-use/loop/usage.js +355 -0
- package/dist/actors/computer-use/loop.d.ts +11 -0
- package/dist/actors/computer-use/loop.js +248 -0
- package/dist/actors/computer-use/openai-provider.d.ts +107 -0
- package/dist/actors/computer-use/openai-provider.js +472 -0
- package/dist/actors/computer-use/openai-requests.d.ts +35 -0
- package/dist/actors/computer-use/openai-requests.js +74 -0
- package/dist/actors/computer-use/openai-wire.d.ts +67 -0
- package/dist/actors/computer-use/openai-wire.js +365 -0
- package/dist/actors/computer-use/provider-error.d.ts +27 -0
- package/dist/actors/computer-use/provider-error.js +86 -0
- package/dist/actors/computer-use/speech.js +6 -0
- package/dist/actors/contract.d.ts +315 -0
- package/dist/actors/contract.js +201 -0
- package/dist/actors/goal-source.js +38 -0
- package/dist/actors/local-agent/claude-session.d.ts +43 -0
- package/dist/actors/local-agent/claude-session.js +370 -0
- package/dist/actors/local-agent/cli.d.ts +115 -0
- package/dist/actors/local-agent/cli.js +413 -0
- package/dist/actors/local-agent/readiness.d.ts +31 -0
- package/dist/actors/local-agent/readiness.js +45 -0
- package/dist/actors/openai-endpoint.d.ts +2 -0
- package/dist/actors/openai-endpoint.js +2 -0
- package/dist/actors/output-token-limit.js +4 -0
- package/dist/actors/reasoning-effort.js +33 -0
- package/dist/actors/registry.d.ts +59 -0
- package/dist/actors/registry.js +89 -0
- package/dist/actors/scripted-browser/actor.d.ts +49 -0
- package/dist/actors/scripted-browser/actor.js +428 -0
- package/dist/actors/scripted-browser/browser-command.d.ts +1 -0
- package/dist/actors/scripted-browser/browser-command.js +48 -0
- package/dist/actors/scripted-browser/journey.d.ts +9 -0
- package/dist/actors/scripted-browser/journey.js +171 -0
- package/dist/actors/scripted-browser/steps.d.ts +60 -0
- package/dist/actors/scripted-browser/steps.js +384 -0
- package/dist/actors/scripted-browser/types.d.ts +135 -0
- package/dist/actors/scripted-browser/types.js +26 -0
- package/dist/actors/stop-cause.d.ts +9 -0
- package/dist/actors/stop-cause.js +42 -0
- package/dist/actors/stop-conditions.d.ts +40 -0
- package/dist/actors/stop-conditions.js +65 -0
- package/dist/analysis/automatic-completion.d.ts +38 -0
- package/dist/analysis/automatic-completion.js +90 -0
- package/dist/analysis/automatic-config.d.ts +41 -0
- package/dist/analysis/automatic-config.js +135 -0
- package/dist/analysis/automatic.d.ts +17 -0
- package/dist/analysis/automatic.js +279 -0
- package/dist/analysis/codex-config.d.ts +8 -0
- package/dist/analysis/codex-config.js +69 -0
- package/dist/analysis/evidence-sources.d.ts +23 -0
- package/dist/analysis/evidence-sources.js +251 -0
- package/dist/analysis/evidence.d.ts +18 -0
- package/dist/analysis/evidence.js +482 -0
- package/dist/analysis/execute.d.ts +52 -0
- package/dist/analysis/execute.js +504 -0
- package/dist/analysis/image-tokens.d.ts +1 -0
- package/dist/analysis/image-tokens.js +41 -0
- package/dist/analysis/job.d.ts +97 -0
- package/dist/analysis/job.js +311 -0
- package/dist/analysis/load.d.ts +3 -0
- package/dist/analysis/load.js +11 -0
- package/dist/analysis/provider.d.ts +57 -0
- package/dist/analysis/provider.js +227 -0
- package/dist/analysis/restricted-codex.d.ts +19 -0
- package/dist/analysis/restricted-codex.js +23 -0
- package/dist/analysis/service.d.ts +72 -0
- package/dist/analysis/service.js +399 -0
- package/dist/analysis/sharing.d.ts +11 -0
- package/dist/analysis/sharing.js +44 -0
- package/dist/analysis/store-executions.d.ts +27 -0
- package/dist/analysis/store-executions.js +224 -0
- package/dist/analysis/store.d.ts +31 -0
- package/dist/analysis/store.js +315 -0
- package/dist/analysis/types.d.ts +217 -0
- package/dist/analysis/types.js +12 -0
- package/dist/analysis/validation.d.ts +225 -0
- package/dist/analysis/validation.js +562 -0
- package/dist/browser-control/client.d.ts +18 -0
- package/dist/browser-control/client.js +239 -0
- package/dist/browser-control/dispatcher.d.ts +19 -0
- package/dist/browser-control/dispatcher.js +221 -0
- package/dist/browser-control/protocol.d.ts +492 -0
- package/dist/browser-control/protocol.js +360 -0
- package/dist/browser-control/recording-transfer.d.ts +3 -0
- package/dist/browser-control/recording-transfer.js +48 -0
- package/dist/browser-control/transport.d.ts +27 -0
- package/dist/browser-control/transport.js +189 -0
- package/dist/cli/commands/analysis-signals.d.ts +7 -0
- package/dist/cli/commands/analysis-signals.js +25 -0
- package/dist/cli/commands/analyze.d.ts +3 -0
- package/dist/cli/commands/analyze.js +212 -0
- package/dist/cli/commands/codex.d.ts +3 -0
- package/dist/cli/commands/codex.js +145 -0
- package/dist/cli/commands/comms.d.ts +3 -0
- package/dist/cli/commands/comms.js +225 -0
- package/dist/cli/commands/feedback.d.ts +3 -0
- package/dist/cli/commands/feedback.js +138 -0
- package/dist/cli/commands/lab-format.d.ts +8 -0
- package/dist/cli/commands/lab-format.js +105 -0
- package/dist/cli/commands/lab-route-computer-use.d.ts +20 -0
- package/dist/cli/commands/lab-route-computer-use.js +251 -0
- package/dist/cli/commands/lab-route-open.d.ts +27 -0
- package/dist/cli/commands/lab-route-open.js +37 -0
- package/dist/cli/commands/lab-route-preview.d.ts +20 -0
- package/dist/cli/commands/lab-route-preview.js +74 -0
- package/dist/cli/commands/lab-route-run.d.ts +17 -0
- package/dist/cli/commands/lab-route-run.js +31 -0
- package/dist/cli/commands/lab-route-scripted.d.ts +19 -0
- package/dist/cli/commands/lab-route-scripted.js +50 -0
- package/dist/cli/commands/lab-route-shared-world.d.ts +20 -0
- package/dist/cli/commands/lab-route-shared-world.js +135 -0
- package/dist/cli/commands/lab-route-terminal.d.ts +19 -0
- package/dist/cli/commands/lab-route-terminal.js +49 -0
- package/dist/cli/commands/lab-run.d.ts +9 -0
- package/dist/cli/commands/lab-run.js +166 -0
- package/dist/cli/commands/lab-scorer.d.ts +30 -0
- package/dist/cli/commands/lab-scorer.js +17 -0
- package/dist/cli/commands/lab.d.ts +3 -0
- package/dist/cli/commands/lab.js +193 -0
- package/dist/cli/commands/observe.d.ts +4 -0
- package/dist/cli/commands/observe.js +345 -0
- package/dist/cli/commands/runs.d.ts +11 -0
- package/dist/cli/commands/runs.js +314 -0
- package/dist/cli/commands/setup.d.ts +11 -0
- package/dist/cli/commands/setup.js +325 -0
- package/dist/cli/commands/tui.d.ts +32 -0
- package/dist/cli/commands/tui.js +305 -0
- package/dist/cli/commands/watch.d.ts +3 -0
- package/dist/cli/commands/watch.js +245 -0
- package/dist/cli/doctor.d.ts +39 -0
- package/dist/cli/doctor.js +263 -0
- package/dist/cli/first-run-path.d.ts +67 -0
- package/dist/cli/first-run-path.js +150 -0
- package/dist/cli/io.d.ts +85 -0
- package/dist/cli/io.js +232 -0
- package/dist/cli/observer-follow.d.ts +56 -0
- package/dist/cli/observer-follow.js +160 -0
- package/dist/cli/orientation.d.ts +30 -0
- package/dist/cli/orientation.js +114 -0
- package/dist/cli/program.d.ts +15 -0
- package/dist/cli/program.js +338 -0
- package/dist/cli/secret-prompt.js +39 -0
- package/dist/cli/telemetry.js +351 -0
- package/dist/cli.js +2 -4
- package/dist/comms/agentmail.d.ts +29 -0
- package/dist/comms/agentmail.js +568 -0
- package/dist/comms/capture-surface.d.ts +54 -0
- package/dist/comms/capture-surface.js +468 -0
- package/dist/comms/catch-host.d.ts +52 -0
- package/dist/comms/catch-host.js +192 -0
- package/dist/comms/connections.d.ts +20 -0
- package/dist/comms/connections.js +116 -0
- package/dist/comms/email-catch.d.ts +49 -0
- package/dist/comms/email-catch.js +236 -0
- package/dist/comms/extract.d.ts +7 -0
- package/dist/comms/extract.js +65 -0
- package/dist/comms/fake-inbox.d.ts +39 -0
- package/dist/comms/fake-inbox.js +136 -0
- package/dist/comms/images.d.ts +7 -0
- package/dist/comms/images.js +53 -0
- package/dist/comms/lease-store.d.ts +91 -0
- package/dist/comms/lease-store.js +600 -0
- package/dist/comms/providers.d.ts +30 -0
- package/dist/comms/providers.js +24 -0
- package/dist/comms/receiving-common.d.ts +17 -0
- package/dist/comms/receiving-common.js +82 -0
- package/dist/comms/receiving-evidence.d.ts +4 -0
- package/dist/comms/receiving-evidence.js +59 -0
- package/dist/comms/receiving-recovery.d.ts +22 -0
- package/dist/comms/receiving-recovery.js +100 -0
- package/dist/comms/receiving-render.d.ts +16 -0
- package/dist/comms/receiving-render.js +409 -0
- package/dist/comms/receiving-runtime.d.ts +41 -0
- package/dist/comms/receiving-runtime.js +66 -0
- package/dist/comms/receiving-surface.d.ts +8 -0
- package/dist/comms/receiving-surface.js +156 -0
- package/dist/comms/receiving-types.d.ts +122 -0
- package/dist/comms/receiving-types.js +3 -0
- package/dist/comms/receiving.d.ts +33 -0
- package/dist/comms/receiving.js +508 -0
- package/dist/comms/sandbox-catch-script.d.ts +16 -0
- package/dist/comms/sandbox-catch-script.js +331 -0
- package/dist/comms/sandbox-catch.d.ts +214 -0
- package/dist/comms/sandbox-catch.js +451 -0
- package/dist/comms/setup.d.ts +65 -0
- package/dist/comms/setup.js +259 -0
- package/dist/comms/thread-evidence.d.ts +28 -0
- package/dist/comms/thread-evidence.js +30 -0
- package/dist/comms/types.d.ts +76 -0
- package/dist/comms/types.js +8 -0
- package/dist/deprecated.d.ts +90 -0
- package/dist/deprecated.js +106 -0
- package/dist/evidence/browser-hygiene.js +42 -0
- package/dist/evidence/desktop-recorder.d.ts +39 -0
- package/dist/evidence/desktop-recorder.js +340 -0
- package/dist/evidence/desktop-recording-artifact.d.ts +5 -0
- package/dist/evidence/desktop-recording-artifact.js +53 -0
- package/dist/evidence/desktop-recording-types.d.ts +27 -0
- package/dist/evidence/desktop-recording-types.js +16 -0
- package/dist/evidence/encoded-text.d.ts +27 -0
- package/dist/evidence/encoded-text.js +243 -0
- package/dist/evidence/frame-signature.d.ts +17 -0
- package/dist/evidence/frame-signature.js +111 -0
- package/dist/evidence/image.d.ts +24 -0
- package/dist/evidence/image.js +170 -0
- package/dist/evidence/plain-text.d.ts +8 -0
- package/dist/evidence/plain-text.js +16 -0
- package/dist/evidence/redaction.d.ts +110 -0
- package/dist/evidence/redaction.js +329 -0
- package/dist/feedback/draft.d.ts +58 -0
- package/dist/feedback/draft.js +309 -0
- package/dist/feedback/export-bundle.d.ts +6 -0
- package/dist/feedback/export-bundle.js +585 -0
- package/dist/feedback/export.d.ts +50 -0
- package/dist/feedback/export.js +392 -0
- package/dist/feedback/feedback.d.ts +37 -0
- package/dist/feedback/feedback.js +282 -0
- package/dist/feedback/proof.d.ts +8 -0
- package/dist/feedback/proof.js +56 -0
- package/dist/guest/bootstrap.d.ts +55 -0
- package/dist/guest/bootstrap.js +348 -0
- package/dist/guest/browser-tools.d.ts +8 -0
- package/dist/guest/browser-tools.js +72 -0
- package/dist/guest/chromium-text.d.ts +62 -0
- package/dist/guest/chromium-text.js +386 -0
- package/dist/guest/desktop-executor.d.ts +57 -0
- package/dist/guest/desktop-executor.js +256 -0
- package/dist/guest/desktop-keys.d.ts +8 -0
- package/dist/guest/desktop-keys.js +89 -0
- package/dist/guest/desktop-media.d.ts +70 -0
- package/dist/guest/desktop-media.js +385 -0
- package/dist/guest/desktop-native.d.ts +14 -0
- package/dist/guest/desktop-native.js +156 -0
- package/dist/guest/media-config.d.ts +15 -0
- package/dist/guest/media-config.js +16 -0
- package/dist/guest/runtime-desktop.d.ts +45 -0
- package/dist/guest/runtime-desktop.js +420 -0
- package/dist/guest/runtime-processes.d.ts +28 -0
- package/dist/guest/runtime-processes.js +94 -0
- package/dist/guest/runtime.d.ts +31 -0
- package/dist/guest/runtime.js +124 -0
- package/dist/guest-media-worker.js +184 -48
- package/dist/guest-runtime-main.js +23 -10
- package/dist/guest-runtime-revision.js +1 -1
- package/dist/index.d.ts +32 -83
- package/dist/index.js +21 -42
- package/dist/keys/env-file.d.ts +15 -0
- package/dist/keys/env-file.js +109 -0
- package/dist/keys/key-resolution.d.ts +58 -0
- package/dist/keys/key-resolution.js +389 -0
- package/dist/lab/adapter-extension.d.ts +75 -0
- package/dist/lab/adapter-extension.js +253 -0
- package/dist/lab/adapter-scorer-loader.d.ts +43 -0
- package/dist/lab/adapter-scorer-loader.js +130 -0
- package/dist/lab/bag-overrides.d.ts +18 -0
- package/dist/lab/bag-overrides.js +121 -0
- package/dist/lab/composition-rules.d.ts +5 -0
- package/dist/lab/composition-rules.js +283 -0
- package/dist/lab/config.d.ts +7 -0
- package/dist/lab/config.js +208 -0
- package/dist/lab/device-presets.d.ts +97 -0
- package/dist/lab/device-presets.js +87 -0
- package/dist/lab/discover.d.ts +65 -0
- package/dist/lab/discover.js +422 -0
- package/dist/lab/doctor.d.ts +39 -0
- package/dist/lab/doctor.js +233 -0
- package/dist/lab/init-paths.d.ts +5 -0
- package/dist/lab/init-paths.js +89 -0
- package/dist/lab/init-plan.d.ts +20 -0
- package/dist/lab/init-plan.js +163 -0
- package/dist/lab/init-templates.d.ts +28 -0
- package/dist/lab/init-templates.js +416 -0
- package/dist/lab/init.d.ts +39 -0
- package/dist/lab/init.js +287 -0
- package/dist/lab/keys.d.ts +2 -0
- package/dist/lab/keys.js +264 -0
- package/dist/lab/parse/actors.d.ts +14 -0
- package/dist/lab/parse/actors.js +453 -0
- package/dist/lab/parse/comms.d.ts +12 -0
- package/dist/lab/parse/comms.js +246 -0
- package/dist/lab/parse/execution.d.ts +19 -0
- package/dist/lab/parse/execution.js +356 -0
- package/dist/lab/parse/subject-state.d.ts +30 -0
- package/dist/lab/parse/subject-state.js +179 -0
- package/dist/lab/parse/subject.d.ts +9 -0
- package/dist/lab/parse/subject.js +420 -0
- package/dist/lab/parse/values.d.ts +17 -0
- package/dist/lab/parse/values.js +65 -0
- package/dist/lab/participant-assignment.d.ts +12 -0
- package/dist/lab/participant-assignment.js +19 -0
- package/dist/lab/persona-resolve.d.ts +39 -0
- package/dist/lab/persona-resolve.js +118 -0
- package/dist/lab/persona.d.ts +39 -0
- package/dist/lab/persona.js +192 -0
- package/dist/lab/plan-base.d.ts +24 -0
- package/dist/lab/plan-base.js +113 -0
- package/dist/lab/plan-participants.d.ts +81 -0
- package/dist/lab/plan-participants.js +92 -0
- package/dist/lab/plan-types.d.ts +269 -0
- package/dist/lab/plan-types.js +5 -0
- package/dist/lab/plan.d.ts +27 -0
- package/dist/lab/plan.js +156 -0
- package/dist/lab/preflight-probes.d.ts +3 -0
- package/dist/lab/preflight-probes.js +312 -0
- package/dist/lab/preflight-result.d.ts +7 -0
- package/dist/lab/preflight-result.js +43 -0
- package/dist/lab/preflight.d.ts +95 -0
- package/dist/lab/preflight.js +117 -0
- package/dist/lab/route-inputs.d.ts +17 -0
- package/dist/lab/route-inputs.js +95 -0
- package/dist/lab/routing.d.ts +81 -0
- package/dist/lab/routing.js +214 -0
- package/dist/lab/run-lab-events.d.ts +69 -0
- package/dist/lab/run-lab-events.js +95 -0
- package/dist/lab/run-lab-options.d.ts +82 -0
- package/dist/lab/run-lab-options.js +399 -0
- package/dist/lab/summary.d.ts +60 -0
- package/dist/lab/summary.js +168 -0
- package/dist/lab/tasks.d.ts +91 -0
- package/dist/lab/tasks.js +139 -0
- package/dist/lab/types.d.ts +813 -0
- package/dist/lab/types.js +6 -0
- package/dist/lab/validation.d.ts +67 -0
- package/dist/lab/validation.js +387 -0
- package/dist/lab/warnings.d.ts +2 -0
- package/dist/lab/warnings.js +338 -0
- package/dist/observer/artifact.d.ts +23 -0
- package/dist/observer/artifact.js +235 -0
- package/dist/observer/data.d.ts +115 -0
- package/dist/observer/data.js +258 -0
- package/dist/observer/exposure.d.ts +64 -0
- package/dist/observer/exposure.js +143 -0
- package/dist/observer/http.js +50 -0
- package/dist/observer/library.js +190 -0
- package/dist/observer/listen.js +85 -0
- package/dist/observer/live.d.ts +9 -0
- package/dist/observer/live.js +25 -0
- package/dist/observer/pinned-files.d.ts +30 -0
- package/dist/observer/pinned-files.js +160 -0
- package/dist/observer/render.d.ts +69 -0
- package/dist/observer/render.js +350 -0
- package/dist/observer/run-inventory.d.ts +35 -0
- package/dist/observer/run-inventory.js +95 -0
- package/dist/observer/run-routes.d.ts +37 -0
- package/dist/observer/run-routes.js +373 -0
- package/dist/observer/serve.d.ts +97 -0
- package/dist/observer/serve.js +305 -0
- package/dist/observer/static.js +369 -0
- package/dist/observer/tunnel.js +112 -0
- package/dist/observer-app.html +9 -20
- package/dist/routes/computer-use/bundle-parts.d.ts +50 -0
- package/dist/routes/computer-use/bundle-parts.js +177 -0
- package/dist/routes/computer-use/bundle.d.ts +56 -0
- package/dist/routes/computer-use/bundle.js +184 -0
- package/dist/routes/computer-use/diagnostics.d.ts +38 -0
- package/dist/routes/computer-use/diagnostics.js +94 -0
- package/dist/routes/computer-use/e2b-desktop/comms.d.ts +65 -0
- package/dist/routes/computer-use/e2b-desktop/comms.js +225 -0
- package/dist/routes/computer-use/e2b-desktop/desktop.d.ts +3 -0
- package/dist/routes/computer-use/e2b-desktop/desktop.js +91 -0
- package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +65 -0
- package/dist/routes/computer-use/e2b-desktop/fidelity.js +156 -0
- package/dist/routes/computer-use/e2b-desktop/prepare.d.ts +18 -0
- package/dist/routes/computer-use/e2b-desktop/prepare.js +198 -0
- package/dist/routes/computer-use/e2b-desktop/start.d.ts +14 -0
- package/dist/routes/computer-use/e2b-desktop/start.js +193 -0
- package/dist/routes/computer-use/e2b-desktop/state.d.ts +65 -0
- package/dist/routes/computer-use/e2b-desktop/state.js +69 -0
- package/dist/routes/computer-use/e2b-desktop/teardown.d.ts +6 -0
- package/dist/routes/computer-use/e2b-desktop/teardown.js +152 -0
- package/dist/routes/computer-use/external-comms.d.ts +20 -0
- package/dist/routes/computer-use/external-comms.js +55 -0
- package/dist/routes/computer-use/fanout-bundle.d.ts +11 -0
- package/dist/routes/computer-use/fanout-bundle.js +274 -0
- package/dist/routes/computer-use/fanout-lanes.d.ts +15 -0
- package/dist/routes/computer-use/fanout-lanes.js +302 -0
- package/dist/routes/computer-use/in-process-desktop.d.ts +17 -0
- package/dist/routes/computer-use/in-process-desktop.js +40 -0
- package/dist/routes/computer-use/lanes.d.ts +35 -0
- package/dist/routes/computer-use/lanes.js +321 -0
- package/dist/routes/computer-use/legacy-lane-spec.d.ts +62 -0
- package/dist/routes/computer-use/legacy-lane-spec.js +39 -0
- package/dist/routes/computer-use/live-flush.d.ts +42 -0
- package/dist/routes/computer-use/live-flush.js +154 -0
- package/dist/routes/computer-use/local-tree-pack.d.ts +27 -0
- package/dist/routes/computer-use/local-tree-pack.js +47 -0
- package/dist/routes/computer-use/local-vm.d.ts +20 -0
- package/dist/routes/computer-use/local-vm.js +218 -0
- package/dist/routes/computer-use/participant-desktop.d.ts +63 -0
- package/dist/routes/computer-use/participant-desktop.js +33 -0
- package/dist/routes/computer-use/participant-facts.d.ts +6 -0
- package/dist/routes/computer-use/participant-facts.js +22 -0
- package/dist/routes/computer-use/participant-model.d.ts +30 -0
- package/dist/routes/computer-use/participant-model.js +222 -0
- package/dist/routes/computer-use/participant-prompt.d.ts +53 -0
- package/dist/routes/computer-use/participant-prompt.js +87 -0
- package/dist/routes/computer-use/participant-runs.d.ts +67 -0
- package/dist/routes/computer-use/participant-runs.js +255 -0
- package/dist/routes/computer-use/plan.d.ts +56 -0
- package/dist/routes/computer-use/plan.js +308 -0
- package/dist/routes/computer-use/preflight.d.ts +26 -0
- package/dist/routes/computer-use/preflight.js +85 -0
- package/dist/routes/computer-use/rerun-selection.d.ts +19 -0
- package/dist/routes/computer-use/rerun-selection.js +121 -0
- package/dist/routes/computer-use/result.d.ts +7 -0
- package/dist/routes/computer-use/result.js +292 -0
- package/dist/routes/computer-use/route.d.ts +33 -0
- package/dist/routes/computer-use/route.js +145 -0
- package/dist/routes/computer-use/run-lanes.d.ts +59 -0
- package/dist/routes/computer-use/run-lanes.js +135 -0
- package/dist/routes/computer-use/self-report.d.ts +21 -0
- package/dist/routes/computer-use/self-report.js +231 -0
- package/dist/routes/computer-use/setup.d.ts +136 -0
- package/dist/routes/computer-use/setup.js +371 -0
- package/dist/routes/computer-use/single-bundle.d.ts +97 -0
- package/dist/routes/computer-use/single-bundle.js +393 -0
- package/dist/routes/computer-use/subject-projection.d.ts +51 -0
- package/dist/routes/computer-use/subject-projection.js +159 -0
- package/dist/routes/computer-use/types.d.ts +539 -0
- package/dist/routes/computer-use/types.js +37 -0
- package/dist/routes/preview.d.ts +13 -0
- package/dist/routes/preview.js +36 -0
- package/dist/routes/scripted/bundle.d.ts +47 -0
- package/dist/routes/scripted/bundle.js +195 -0
- package/dist/routes/scripted/plan.d.ts +30 -0
- package/dist/routes/scripted/plan.js +95 -0
- package/dist/routes/scripted/result.d.ts +48 -0
- package/dist/routes/scripted/result.js +176 -0
- package/dist/routes/scripted/route.d.ts +28 -0
- package/dist/routes/scripted/route.js +218 -0
- package/dist/routes/scripted/scenario.d.ts +21 -0
- package/dist/routes/scripted/scenario.js +102 -0
- package/dist/routes/scripted/session-result.d.ts +8 -0
- package/dist/routes/scripted/session-result.js +60 -0
- package/dist/routes/scripted/setup.d.ts +45 -0
- package/dist/routes/scripted/setup.js +126 -0
- package/dist/routes/scripted/subject.d.ts +49 -0
- package/dist/routes/scripted/subject.js +156 -0
- package/dist/routes/scripted/surface-records.d.ts +26 -0
- package/dist/routes/scripted/surface-records.js +88 -0
- package/dist/routes/scripted/surface-sessions.d.ts +13 -0
- package/dist/routes/scripted/surface-sessions.js +40 -0
- package/dist/routes/scripted/types.d.ts +88 -0
- package/dist/routes/scripted/types.js +3 -0
- package/dist/routes/shared-world/bundle.d.ts +20 -0
- package/dist/routes/shared-world/bundle.js +446 -0
- package/dist/routes/shared-world/checkpoints.d.ts +25 -0
- package/dist/routes/shared-world/checkpoints.js +46 -0
- package/dist/routes/shared-world/comms.d.ts +68 -0
- package/dist/routes/shared-world/comms.js +176 -0
- package/dist/routes/shared-world/external-public.d.ts +21 -0
- package/dist/routes/shared-world/external-public.js +130 -0
- package/dist/routes/shared-world/handoff.d.ts +62 -0
- package/dist/routes/shared-world/handoff.js +348 -0
- package/dist/routes/shared-world/lobby-code.d.ts +25 -0
- package/dist/routes/shared-world/lobby-code.js +152 -0
- package/dist/routes/shared-world/plan.d.ts +27 -0
- package/dist/routes/shared-world/plan.js +174 -0
- package/dist/routes/shared-world/provenance.d.ts +27 -0
- package/dist/routes/shared-world/provenance.js +65 -0
- package/dist/routes/shared-world/provisioned.d.ts +57 -0
- package/dist/routes/shared-world/provisioned.js +505 -0
- package/dist/routes/shared-world/result.d.ts +18 -0
- package/dist/routes/shared-world/result.js +327 -0
- package/dist/routes/shared-world/route.d.ts +21 -0
- package/dist/routes/shared-world/route.js +277 -0
- package/dist/routes/shared-world/seat-records.d.ts +20 -0
- package/dist/routes/shared-world/seat-records.js +213 -0
- package/dist/routes/shared-world/seats.d.ts +38 -0
- package/dist/routes/shared-world/seats.js +208 -0
- package/dist/routes/shared-world/setup.d.ts +48 -0
- package/dist/routes/shared-world/setup.js +200 -0
- package/dist/routes/shared-world/types.d.ts +354 -0
- package/dist/routes/shared-world/types.js +29 -0
- package/dist/routes/terminal/adapter.d.ts +37 -0
- package/dist/routes/terminal/adapter.js +201 -0
- package/dist/routes/terminal/bundle.d.ts +79 -0
- package/dist/routes/terminal/bundle.js +305 -0
- package/dist/routes/terminal/credentials.d.ts +34 -0
- package/dist/routes/terminal/credentials.js +102 -0
- package/dist/routes/terminal/dry-run.d.ts +24 -0
- package/dist/routes/terminal/dry-run.js +157 -0
- package/dist/routes/terminal/encoding.js +79 -0
- package/dist/routes/terminal/ledger.d.ts +49 -0
- package/dist/routes/terminal/ledger.js +170 -0
- package/dist/routes/terminal/lifetime.d.ts +10 -0
- package/dist/routes/terminal/lifetime.js +22 -0
- package/dist/routes/terminal/live-finish.d.ts +31 -0
- package/dist/routes/terminal/live-finish.js +215 -0
- package/dist/routes/terminal/live-sandbox.d.ts +69 -0
- package/dist/routes/terminal/live-sandbox.js +452 -0
- package/dist/routes/terminal/persona.d.ts +20 -0
- package/dist/routes/terminal/persona.js +34 -0
- package/dist/routes/terminal/plan.d.ts +21 -0
- package/dist/routes/terminal/plan.js +115 -0
- package/dist/routes/terminal/recorder.d.ts +23 -0
- package/dist/routes/terminal/recorder.js +77 -0
- package/dist/routes/terminal/result.d.ts +47 -0
- package/dist/routes/terminal/result.js +114 -0
- package/dist/routes/terminal/route.d.ts +23 -0
- package/dist/routes/terminal/route.js +170 -0
- package/dist/routes/terminal/runtime-auth.d.ts +12 -0
- package/dist/routes/terminal/runtime-auth.js +23 -0
- package/dist/routes/terminal/runtime.d.ts +14 -0
- package/dist/routes/terminal/runtime.js +47 -0
- package/dist/routes/terminal/sandbox.d.ts +35 -0
- package/dist/routes/terminal/sandbox.js +126 -0
- package/dist/routes/terminal/session.d.ts +25 -0
- package/dist/routes/terminal/session.js +199 -0
- package/dist/routes/terminal/token-usage.d.ts +15 -0
- package/dist/routes/terminal/token-usage.js +93 -0
- package/dist/routes/terminal/trace.d.ts +40 -0
- package/dist/routes/terminal/trace.js +172 -0
- package/dist/routes/terminal/types.d.ts +342 -0
- package/dist/routes/terminal/types.js +31 -0
- package/dist/run/bundle-shape.d.ts +7 -0
- package/dist/run/bundle-shape.js +369 -0
- package/dist/run/bundle.d.ts +547 -0
- package/dist/run/bundle.js +44 -0
- package/dist/run/concurrency.js +24 -0
- package/dist/run/contained-output.d.ts +50 -0
- package/dist/run/contained-output.js +351 -0
- package/dist/run/cost-summary.d.ts +28 -0
- package/dist/run/cost-summary.js +213 -0
- package/dist/run/costs.js +140 -0
- package/dist/run/detail.d.ts +62 -0
- package/dist/run/detail.js +139 -0
- package/dist/run/dry-run-inputs.d.ts +9 -0
- package/dist/run/dry-run-inputs.js +90 -0
- package/dist/run/dry-run.d.ts +6 -0
- package/dist/run/dry-run.js +362 -0
- package/dist/run/feedback-shape.d.ts +7 -0
- package/dist/run/feedback-shape.js +89 -0
- package/dist/run/git-state.d.ts +35 -0
- package/dist/run/git-state.js +316 -0
- package/dist/run/git-workspace.d.ts +32 -0
- package/dist/run/git-workspace.js +450 -0
- package/dist/run/judge.d.ts +210 -0
- package/dist/run/judge.js +240 -0
- package/dist/run/locate.d.ts +22 -0
- package/dist/run/locate.js +122 -0
- package/dist/run/outcomes.d.ts +31 -0
- package/dist/run/outcomes.js +210 -0
- package/dist/run/participant-records.d.ts +28 -0
- package/dist/run/participant-records.js +63 -0
- package/dist/run/participant.d.ts +29 -0
- package/dist/run/participant.js +12 -0
- package/dist/run/paths.d.ts +79 -0
- package/dist/run/paths.js +356 -0
- package/dist/run/preflight-receipts.d.ts +46 -0
- package/dist/run/preflight-receipts.js +173 -0
- package/dist/run/pricing.d.ts +124 -0
- package/dist/run/pricing.js +298 -0
- package/dist/run/project.d.ts +8 -0
- package/dist/run/project.js +103 -0
- package/dist/run/projection.d.ts +184 -0
- package/dist/run/projection.js +356 -0
- package/dist/run/reclaim.d.ts +41 -0
- package/dist/run/reclaim.js +183 -0
- package/dist/run/results.d.ts +88 -0
- package/dist/run/results.js +3 -0
- package/dist/run/run-index.d.ts +107 -0
- package/dist/run/run-index.js +243 -0
- package/dist/run/run.d.ts +103 -0
- package/dist/run/run.js +199 -0
- package/dist/run/sandbox-receipts.d.ts +31 -0
- package/dist/run/sandbox-receipts.js +49 -0
- package/dist/run/shared-world-evidence.d.ts +220 -0
- package/dist/run/shared-world-evidence.js +49 -0
- package/dist/run/shared-world-shape.d.ts +26 -0
- package/dist/run/shared-world-shape.js +181 -0
- package/dist/run/stats.d.ts +82 -0
- package/dist/run/stats.js +258 -0
- package/dist/run/status.d.ts +111 -0
- package/dist/run/status.js +176 -0
- package/dist/run/stored-runs.d.ts +38 -0
- package/dist/run/stored-runs.js +273 -0
- package/dist/run/stream-shape.d.ts +4 -0
- package/dist/run/stream-shape.js +160 -0
- package/dist/run/streams.d.ts +257 -0
- package/dist/run/streams.js +12 -0
- package/dist/run/study-files.d.ts +35 -0
- package/dist/run/study-files.js +164 -0
- package/dist/run/terminal-contract.d.ts +25 -0
- package/dist/run/terminal-contract.js +47 -0
- package/dist/run/text.d.ts +2 -0
- package/dist/run/text.js +4 -0
- package/dist/run/transient-comms-secrets.js +72 -0
- package/dist/run/type-guards.d.ts +6 -0
- package/dist/run/type-guards.js +18 -0
- package/dist/run-lab.d.ts +110 -0
- package/dist/run-lab.js +148 -0
- package/dist/subject/clone.d.ts +37 -0
- package/dist/subject/clone.js +62 -0
- package/dist/subject/desktop-cli.d.ts +17 -0
- package/dist/subject/desktop-cli.js +51 -0
- package/dist/subject/local-tree-archive.d.ts +82 -0
- package/dist/subject/local-tree-archive.js +431 -0
- package/dist/subject/local-tree.d.ts +28 -0
- package/dist/subject/local-tree.js +58 -0
- package/dist/subject/node-bootstrap.d.ts +12 -0
- package/dist/subject/node-bootstrap.js +66 -0
- package/dist/subject/runtime.d.ts +13 -0
- package/dist/subject/runtime.js +50 -0
- package/dist/subject/serve.d.ts +39 -0
- package/dist/subject/serve.js +249 -0
- package/dist/subject/state.d.ts +23 -0
- package/dist/subject/state.js +58 -0
- package/dist/subject/steps.d.ts +37 -0
- package/dist/subject/steps.js +39 -0
- package/dist/substrates/command-failure.d.ts +23 -0
- package/dist/substrates/command-failure.js +45 -0
- package/dist/substrates/desktop-session.d.ts +41 -0
- package/dist/substrates/desktop-session.js +59 -0
- package/dist/substrates/detached.d.ts +55 -0
- package/dist/substrates/detached.js +139 -0
- package/dist/substrates/e2b/cdp-probe.d.ts +99 -0
- package/dist/substrates/e2b/cdp-probe.js +556 -0
- package/dist/substrates/e2b/desktop-browser.d.ts +81 -0
- package/dist/substrates/e2b/desktop-browser.js +410 -0
- package/dist/substrates/e2b/desktop-cdp.d.ts +77 -0
- package/dist/substrates/e2b/desktop-cdp.js +211 -0
- package/dist/substrates/e2b/desktop-executor.d.ts +92 -0
- package/dist/substrates/e2b/desktop-executor.js +302 -0
- package/dist/substrates/e2b/desktop-geometry.d.ts +83 -0
- package/dist/substrates/e2b/desktop-geometry.js +331 -0
- package/dist/substrates/e2b/desktop-media.d.ts +29 -0
- package/dist/substrates/e2b/desktop-media.js +151 -0
- package/dist/substrates/e2b/desktop-recording.d.ts +18 -0
- package/dist/substrates/e2b/desktop-recording.js +238 -0
- package/dist/substrates/e2b/desktop-resources.d.ts +11 -0
- package/dist/substrates/e2b/desktop-resources.js +35 -0
- package/dist/substrates/e2b/desktop-screenshot-cleanup.d.ts +15 -0
- package/dist/substrates/e2b/desktop-screenshot-cleanup.js +66 -0
- package/dist/substrates/e2b/lifetime.d.ts +12 -0
- package/dist/substrates/e2b/lifetime.js +18 -0
- package/dist/substrates/e2b/sandbox.d.ts +102 -0
- package/dist/substrates/e2b/sandbox.js +202 -0
- package/dist/substrates/e2b/sdk.d.ts +194 -0
- package/dist/substrates/e2b/sdk.js +168 -0
- package/dist/substrates/e2b/shell.d.ts +10 -0
- package/dist/substrates/e2b/shell.js +61 -0
- package/dist/substrates/local/captured-inbox.d.ts +6 -0
- package/dist/substrates/local/captured-inbox.js +87 -0
- package/dist/substrates/local/firecracker-desktop.d.ts +25 -0
- package/dist/substrates/local/firecracker-desktop.js +315 -0
- package/dist/substrates/local/runtime-config.d.ts +6 -0
- package/dist/substrates/local/runtime-config.js +91 -0
- package/dist/substrates/local/runtime-host.d.ts +30 -0
- package/dist/substrates/local/runtime-host.js +143 -0
- package/dist/substrates/local/runtime-release.d.ts +5 -0
- package/dist/substrates/local/runtime-release.js +32 -0
- package/dist/substrates/local/runtime-ssh.d.ts +9 -0
- package/dist/substrates/local/runtime-ssh.js +129 -0
- package/dist/substrates/local/runtime.d.ts +25 -0
- package/dist/substrates/local/runtime.js +190 -0
- package/dist/substrates/shell.d.ts +44 -0
- package/dist/substrates/shell.js +22 -0
- package/dist/tui/actions.d.ts +39 -0
- package/dist/tui/actions.js +203 -0
- package/dist/tui/contract.d.ts +144 -0
- package/dist/tui/contract.js +52 -0
- package/dist/tui/launch.js +172 -0
- package/dist/tui/project.d.ts +10 -0
- package/dist/tui/project.js +17 -0
- package/dist/tui-app.js +125 -125
- package/dist/verify/actor.d.ts +27 -0
- package/dist/verify/actor.js +292 -0
- package/dist/verify/artifacts.d.ts +47 -0
- package/dist/verify/artifacts.js +373 -0
- package/dist/verify/costs.d.ts +30 -0
- package/dist/verify/costs.js +129 -0
- package/dist/verify/liveness.d.ts +7 -0
- package/dist/verify/liveness.js +72 -0
- package/dist/verify/rerun.d.ts +3 -0
- package/dist/verify/rerun.js +46 -0
- package/dist/verify/shared-world-concurrent.d.ts +11 -0
- package/dist/verify/shared-world-concurrent.js +346 -0
- package/dist/verify/shared-world.d.ts +8 -0
- package/dist/verify/shared-world.js +295 -0
- package/dist/verify/subject.d.ts +17 -0
- package/dist/verify/subject.js +123 -0
- package/dist/verify/verify.d.ts +34 -0
- package/dist/verify/verify.js +333 -0
- package/docs/README.md +67 -0
- package/docs/architecture/actor-contract.md +215 -174
- package/docs/architecture/browser-control.md +51 -37
- package/docs/architecture/comms-inbox.md +8 -8
- package/docs/architecture/desktop-recording.md +2 -2
- package/docs/architecture/desktop-sessions.md +33 -21
- package/docs/architecture/external-public-shared-world.md +80 -64
- package/docs/architecture/github-feedback-loop.md +40 -27
- package/docs/architecture/guest-desktop.md +22 -10
- package/docs/architecture/local-browser-runtime.md +30 -21
- package/docs/architecture/observer-review.md +9 -9
- package/docs/architecture/observer.md +53 -57
- package/docs/architecture/participant-media.md +3 -3
- package/docs/architecture/project-layout.md +33 -137
- package/docs/architecture/real-email-receiving.md +7 -6
- package/docs/architecture/restricted-codex-analysis.md +211 -25
- package/docs/architecture/serve.md +89 -87
- package/docs/architecture/state-driven-executor.md +79 -64
- package/docs/architecture/task-protocol-support.md +18 -18
- package/docs/architecture/terminal-product-lane.md +92 -86
- package/docs/contracts/adapter-admission.md +8 -4
- package/docs/contracts/adapter-fixtures.md +6 -6
- package/docs/contracts/core.md +22 -24
- package/docs/contracts/feedback.md +33 -23
- package/docs/contracts/policy.md +28 -31
- package/docs/contracts/run-bundle.md +168 -82
- package/docs/contracts/schemas.md +594 -379
- package/docs/contracts/study-analysis.md +2 -2
- package/docs/contracts/study-costs.md +12 -12
- package/docs/decisions/0001-run-bundle-is-the-source-of-truth.md +36 -0
- package/docs/decisions/0002-observer-is-one-self-contained-file.md +30 -0
- package/docs/decisions/0003-contained-paths-and-cleanup-authority.md +35 -0
- package/docs/decisions/0004-participant-desktops-stay-in-the-route.md +31 -0
- package/docs/decisions/README.md +16 -0
- package/docs/goals/current.md +22 -46
- package/docs/principles/actor-fidelity.md +51 -63
- package/docs/principles/engineering.md +81 -0
- package/docs/principles/invariants-and-defaults.md +48 -45
- package/docs/principles/self-driving-harness.md +11 -10
- package/docs/principles/three-roles.md +12 -13
- package/docs/product/automatic-analysis.md +39 -9
- package/docs/product/lobby-trivia-3player-external-public.md +14 -13
- package/docs/product/open-source-install-experience.md +34 -38
- package/docs/ramp/README.md +91 -213
- package/docs/release/open-source-readiness.md +5 -2
- package/docs/release/public-readiness-standard.md +1 -1
- package/examples/README.md +11 -0
- package/examples/participant/README.md +80 -0
- package/examples/participant/app.mjs +55 -0
- package/examples/participant/run.mjs +116 -0
- package/examples/scorer/README.md +29 -0
- package/examples/scorer/run.mjs +63 -0
- package/examples/scorer/scorer.mjs +20 -0
- package/package.json +61 -57
- package/skills/humanish/SKILL.md +112 -83
- package/skills/humanish/agents/openai.yaml +2 -2
- package/dist/actor-contract.d.ts +0 -288
- package/dist/actor-contract.js +0 -340
- package/dist/actor-contract.js.map +0 -1
- package/dist/actor-goal-source.js +0 -32
- package/dist/actor-goal-source.js.map +0 -1
- package/dist/actor-registry.d.ts +0 -77
- package/dist/actor-registry.js +0 -106
- package/dist/actor-registry.js.map +0 -1
- package/dist/actor-stop-cause.d.ts +0 -9
- package/dist/actor-stop-cause.js +0 -42
- package/dist/actor-stop-cause.js.map +0 -1
- package/dist/adapter-extension.d.ts +0 -76
- package/dist/adapter-extension.js +0 -273
- package/dist/adapter-extension.js.map +0 -1
- package/dist/adapter-scorer-loader.d.ts +0 -42
- package/dist/adapter-scorer-loader.js +0 -129
- package/dist/adapter-scorer-loader.js.map +0 -1
- package/dist/affordance.d.ts +0 -53
- package/dist/affordance.js +0 -145
- package/dist/affordance.js.map +0 -1
- package/dist/agent-session.js +0 -43
- package/dist/agent-session.js.map +0 -1
- package/dist/argv.d.ts +0 -1
- package/dist/argv.js +0 -8
- package/dist/argv.js.map +0 -1
- package/dist/artifact-reference.d.ts +0 -22
- package/dist/artifact-reference.js +0 -47
- package/dist/artifact-reference.js.map +0 -1
- package/dist/automatic-analysis-completion.d.ts +0 -25
- package/dist/automatic-analysis-completion.js +0 -56
- package/dist/automatic-analysis-completion.js.map +0 -1
- package/dist/automatic-analysis-config.d.ts +0 -38
- package/dist/automatic-analysis-config.js +0 -68
- package/dist/automatic-analysis-config.js.map +0 -1
- package/dist/automatic-study-analysis.d.ts +0 -17
- package/dist/automatic-study-analysis.js +0 -195
- package/dist/automatic-study-analysis.js.map +0 -1
- package/dist/browser-control-client.d.ts +0 -18
- package/dist/browser-control-client.js +0 -176
- package/dist/browser-control-client.js.map +0 -1
- package/dist/browser-control-dispatcher.d.ts +0 -19
- package/dist/browser-control-dispatcher.js +0 -147
- package/dist/browser-control-dispatcher.js.map +0 -1
- package/dist/browser-control-protocol.d.ts +0 -472
- package/dist/browser-control-protocol.js +0 -185
- package/dist/browser-control-protocol.js.map +0 -1
- package/dist/browser-control-recording-transfer.d.ts +0 -4
- package/dist/browser-control-recording-transfer.js +0 -42
- package/dist/browser-control-recording-transfer.js.map +0 -1
- package/dist/browser-control-transport.d.ts +0 -27
- package/dist/browser-control-transport.js +0 -177
- package/dist/browser-control-transport.js.map +0 -1
- package/dist/browser-evidence-hygiene.js +0 -43
- package/dist/browser-evidence-hygiene.js.map +0 -1
- package/dist/chrome-cdp-probe.d.ts +0 -97
- package/dist/chrome-cdp-probe.js +0 -536
- package/dist/chrome-cdp-probe.js.map +0 -1
- package/dist/claude-agent-sdk.d.ts +0 -94
- package/dist/claude-agent-sdk.js +0 -367
- package/dist/claude-agent-sdk.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/codex-app-server-ui.d.ts +0 -39
- package/dist/codex-app-server-ui.js +0 -357
- package/dist/codex-app-server-ui.js.map +0 -1
- package/dist/codex-app-server.d.ts +0 -144
- package/dist/codex-app-server.js +0 -754
- package/dist/codex-app-server.js.map +0 -1
- package/dist/command-failure.d.ts +0 -43
- package/dist/command-failure.js +0 -73
- package/dist/command-failure.js.map +0 -1
- package/dist/comms-agentmail.d.ts +0 -25
- package/dist/comms-agentmail.js +0 -418
- package/dist/comms-agentmail.js.map +0 -1
- package/dist/comms-catch-host.d.ts +0 -52
- package/dist/comms-catch-host.js +0 -178
- package/dist/comms-catch-host.js.map +0 -1
- package/dist/comms-connections.d.ts +0 -52
- package/dist/comms-connections.js +0 -123
- package/dist/comms-connections.js.map +0 -1
- package/dist/comms-email-catch.d.ts +0 -54
- package/dist/comms-email-catch.js +0 -212
- package/dist/comms-email-catch.js.map +0 -1
- package/dist/comms-evidence.d.ts +0 -27
- package/dist/comms-evidence.js +0 -31
- package/dist/comms-evidence.js.map +0 -1
- package/dist/comms-fake-inbox.d.ts +0 -45
- package/dist/comms-fake-inbox.js +0 -184
- package/dist/comms-fake-inbox.js.map +0 -1
- package/dist/comms-images.d.ts +0 -7
- package/dist/comms-images.js +0 -39
- package/dist/comms-images.js.map +0 -1
- package/dist/comms-inbox.d.ts +0 -66
- package/dist/comms-inbox.js +0 -389
- package/dist/comms-inbox.js.map +0 -1
- package/dist/comms-lease-store.d.ts +0 -91
- package/dist/comms-lease-store.js +0 -495
- package/dist/comms-lease-store.js.map +0 -1
- package/dist/comms-receiving-evidence.d.ts +0 -46
- package/dist/comms-receiving-evidence.js +0 -35
- package/dist/comms-receiving-evidence.js.map +0 -1
- package/dist/comms-receiving-inbox.d.ts +0 -16
- package/dist/comms-receiving-inbox.js +0 -410
- package/dist/comms-receiving-inbox.js.map +0 -1
- package/dist/comms-receiving-runtime.d.ts +0 -25
- package/dist/comms-receiving-runtime.js +0 -45
- package/dist/comms-receiving-runtime.js.map +0 -1
- package/dist/comms-receiving-types.d.ts +0 -98
- package/dist/comms-receiving-types.js +0 -2
- package/dist/comms-receiving-types.js.map +0 -1
- package/dist/comms-receiving.d.ts +0 -58
- package/dist/comms-receiving.js +0 -554
- package/dist/comms-receiving.js.map +0 -1
- package/dist/comms-sandbox-catch.d.ts +0 -229
- package/dist/comms-sandbox-catch.js +0 -737
- package/dist/comms-sandbox-catch.js.map +0 -1
- package/dist/comms-setup.d.ts +0 -40
- package/dist/comms-setup.js +0 -121
- package/dist/comms-setup.js.map +0 -1
- package/dist/comms-types.d.ts +0 -72
- package/dist/comms-types.js +0 -10
- package/dist/comms-types.js.map +0 -1
- package/dist/computer-use-actor.d.ts +0 -76
- package/dist/computer-use-actor.js +0 -68
- package/dist/computer-use-actor.js.map +0 -1
- package/dist/computer-use.d.ts +0 -429
- package/dist/computer-use.js +0 -1749
- package/dist/computer-use.js.map +0 -1
- package/dist/concurrency.js +0 -27
- package/dist/concurrency.js.map +0 -1
- package/dist/concurrent-shared-world-lab.d.ts +0 -186
- package/dist/concurrent-shared-world-lab.js +0 -2179
- package/dist/concurrent-shared-world-lab.js.map +0 -1
- package/dist/core/git-state.d.ts +0 -33
- package/dist/core/git-state.js +0 -277
- package/dist/core/git-state.js.map +0 -1
- package/dist/core/git-workspace.d.ts +0 -31
- package/dist/core/git-workspace.js +0 -447
- package/dist/core/git-workspace.js.map +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.js +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/core/run-primitives.d.ts +0 -66
- package/dist/core/run-primitives.js +0 -120
- package/dist/core/run-primitives.js.map +0 -1
- package/dist/cua-actor-lab.d.ts +0 -855
- package/dist/cua-actor-lab.js +0 -3545
- package/dist/cua-actor-lab.js.map +0 -1
- package/dist/cua-admission-limit.d.ts +0 -12
- package/dist/cua-admission-limit.js +0 -20
- package/dist/cua-admission-limit.js.map +0 -1
- package/dist/cua-desktop-lane.d.ts +0 -35
- package/dist/cua-desktop-lane.js +0 -13
- package/dist/cua-desktop-lane.js.map +0 -1
- package/dist/cua-diagnostics.d.ts +0 -38
- package/dist/cua-diagnostics.js +0 -68
- package/dist/cua-diagnostics.js.map +0 -1
- package/dist/cua-executor-error.js +0 -48
- package/dist/cua-executor-error.js.map +0 -1
- package/dist/cua-provider-error.d.ts +0 -16
- package/dist/cua-provider-error.js +0 -35
- package/dist/cua-provider-error.js.map +0 -1
- package/dist/cua-speech.js +0 -2
- package/dist/cua-speech.js.map +0 -1
- package/dist/desktop-recorder.d.ts +0 -39
- package/dist/desktop-recorder.js +0 -226
- package/dist/desktop-recorder.js.map +0 -1
- package/dist/desktop-recording-artifact.d.ts +0 -5
- package/dist/desktop-recording-artifact.js +0 -54
- package/dist/desktop-recording-artifact.js.map +0 -1
- package/dist/desktop-recording-types.d.ts +0 -24
- package/dist/desktop-recording-types.js +0 -14
- package/dist/desktop-recording-types.js.map +0 -1
- package/dist/desktop-session.d.ts +0 -41
- package/dist/desktop-session.js +0 -47
- package/dist/desktop-session.js.map +0 -1
- package/dist/device-presets.d.ts +0 -67
- package/dist/device-presets.js +0 -55
- package/dist/device-presets.js.map +0 -1
- package/dist/doctor-lab.d.ts +0 -38
- package/dist/doctor-lab.js +0 -126
- package/dist/doctor-lab.js.map +0 -1
- package/dist/e2b-cua-desktop.d.ts +0 -3
- package/dist/e2b-cua-desktop.js +0 -708
- package/dist/e2b-cua-desktop.js.map +0 -1
- package/dist/e2b-cua-provisioning.d.ts +0 -314
- package/dist/e2b-cua-provisioning.js +0 -1219
- package/dist/e2b-cua-provisioning.js.map +0 -1
- package/dist/e2b-desktop-executor.d.ts +0 -101
- package/dist/e2b-desktop-executor.js +0 -297
- package/dist/e2b-desktop-executor.js.map +0 -1
- package/dist/e2b-desktop-launch.d.ts +0 -243
- package/dist/e2b-desktop-launch.js +0 -234
- package/dist/e2b-desktop-launch.js.map +0 -1
- package/dist/e2b-desktop-media.d.ts +0 -14
- package/dist/e2b-desktop-media.js +0 -58
- package/dist/e2b-desktop-media.js.map +0 -1
- package/dist/e2b-desktop-recording.d.ts +0 -16
- package/dist/e2b-desktop-recording.js +0 -162
- package/dist/e2b-desktop-recording.js.map +0 -1
- package/dist/e2b-desktop-resources.d.ts +0 -11
- package/dist/e2b-desktop-resources.js +0 -33
- package/dist/e2b-desktop-resources.js.map +0 -1
- package/dist/e2b-desktop-screenshot-cleanup.d.ts +0 -15
- package/dist/e2b-desktop-screenshot-cleanup.js +0 -67
- package/dist/e2b-desktop-screenshot-cleanup.js.map +0 -1
- package/dist/e2b-desktop-session.d.ts +0 -7
- package/dist/e2b-desktop-session.js +0 -29
- package/dist/e2b-desktop-session.js.map +0 -1
- package/dist/e2b-detached.d.ts +0 -53
- package/dist/e2b-detached.js +0 -130
- package/dist/e2b-detached.js.map +0 -1
- package/dist/e2b-terminal-lab.d.ts +0 -395
- package/dist/e2b-terminal-lab.js +0 -2041
- package/dist/e2b-terminal-lab.js.map +0 -1
- package/dist/env-file.d.ts +0 -14
- package/dist/env-file.js +0 -108
- package/dist/env-file.js.map +0 -1
- package/dist/export-bundle.d.ts +0 -7
- package/dist/export-bundle.js +0 -441
- package/dist/export-bundle.js.map +0 -1
- package/dist/export.d.ts +0 -49
- package/dist/export.js +0 -308
- package/dist/export.js.map +0 -1
- package/dist/feedback-proof.d.ts +0 -8
- package/dist/feedback-proof.js +0 -44
- package/dist/feedback-proof.js.map +0 -1
- package/dist/feedback.d.ts +0 -76
- package/dist/feedback.js +0 -496
- package/dist/feedback.js.map +0 -1
- package/dist/first-run-path.d.ts +0 -55
- package/dist/first-run-path.js +0 -136
- package/dist/first-run-path.js.map +0 -1
- package/dist/frame-signature.d.ts +0 -24
- package/dist/frame-signature.js +0 -128
- package/dist/frame-signature.js.map +0 -1
- package/dist/guest-bootstrap.d.ts +0 -55
- package/dist/guest-bootstrap.js +0 -285
- package/dist/guest-bootstrap.js.map +0 -1
- package/dist/guest-browser-tools.d.ts +0 -8
- package/dist/guest-browser-tools.js +0 -66
- package/dist/guest-browser-tools.js.map +0 -1
- package/dist/guest-chromium-text.d.ts +0 -27
- package/dist/guest-chromium-text.js +0 -281
- package/dist/guest-chromium-text.js.map +0 -1
- package/dist/guest-desktop-executor.d.ts +0 -22
- package/dist/guest-desktop-executor.js +0 -178
- package/dist/guest-desktop-executor.js.map +0 -1
- package/dist/guest-desktop-media.d.ts +0 -33
- package/dist/guest-desktop-media.js +0 -281
- package/dist/guest-desktop-media.js.map +0 -1
- package/dist/guest-desktop-native.d.ts +0 -14
- package/dist/guest-desktop-native.js +0 -131
- package/dist/guest-desktop-native.js.map +0 -1
- package/dist/guest-media-config.d.ts +0 -15
- package/dist/guest-media-config.js +0 -8
- package/dist/guest-media-config.js.map +0 -1
- package/dist/guest-media-worker.js.map +0 -1
- package/dist/guest-runtime-desktop.d.ts +0 -42
- package/dist/guest-runtime-desktop.js +0 -314
- package/dist/guest-runtime-desktop.js.map +0 -1
- package/dist/guest-runtime-main.js.map +0 -1
- package/dist/guest-runtime-revision.js.map +0 -1
- package/dist/guest-runtime.d.ts +0 -31
- package/dist/guest-runtime.js +0 -99
- package/dist/guest-runtime.js.map +0 -1
- package/dist/image-evidence.d.ts +0 -2
- package/dist/image-evidence.js +0 -47
- package/dist/image-evidence.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-templates.d.ts +0 -25
- package/dist/init-templates.js +0 -542
- package/dist/init-templates.js.map +0 -1
- package/dist/init.d.ts +0 -38
- package/dist/init.js +0 -532
- package/dist/init.js.map +0 -1
- package/dist/key-resolution.d.ts +0 -67
- package/dist/key-resolution.js +0 -375
- package/dist/key-resolution.js.map +0 -1
- package/dist/lab-app-runner.d.ts +0 -78
- package/dist/lab-app-runner.js +0 -403
- package/dist/lab-app-runner.js.map +0 -1
- package/dist/lab-config.d.ts +0 -968
- package/dist/lab-config.js +0 -2714
- package/dist/lab-config.js.map +0 -1
- package/dist/lab-engine.d.ts +0 -97
- package/dist/lab-engine.js +0 -285
- package/dist/lab-engine.js.map +0 -1
- package/dist/lab-preflight.d.ts +0 -70
- package/dist/lab-preflight.js +0 -388
- package/dist/lab-preflight.js.map +0 -1
- package/dist/lab-summary.d.ts +0 -57
- package/dist/lab-summary.js +0 -126
- package/dist/lab-summary.js.map +0 -1
- package/dist/labs.d.ts +0 -59
- package/dist/labs.js +0 -385
- package/dist/labs.js.map +0 -1
- package/dist/listen.js +0 -84
- package/dist/listen.js.map +0 -1
- package/dist/local-agent-claude-session.d.ts +0 -45
- package/dist/local-agent-claude-session.js +0 -203
- package/dist/local-agent-claude-session.js.map +0 -1
- package/dist/local-agent-cli.d.ts +0 -121
- package/dist/local-agent-cli.js +0 -427
- package/dist/local-agent-cli.js.map +0 -1
- package/dist/local-captured-inbox.d.ts +0 -6
- package/dist/local-captured-inbox.js +0 -65
- package/dist/local-captured-inbox.js.map +0 -1
- package/dist/local-firecracker-desktop.d.ts +0 -23
- package/dist/local-firecracker-desktop.js +0 -191
- package/dist/local-firecracker-desktop.js.map +0 -1
- package/dist/local-firecracker-study.d.ts +0 -9
- package/dist/local-firecracker-study.js +0 -135
- package/dist/local-firecracker-study.js.map +0 -1
- package/dist/local-runtime-config.d.ts +0 -6
- package/dist/local-runtime-config.js +0 -60
- package/dist/local-runtime-config.js.map +0 -1
- package/dist/local-runtime-host.d.ts +0 -31
- package/dist/local-runtime-host.js +0 -128
- package/dist/local-runtime-host.js.map +0 -1
- package/dist/local-runtime-release.d.ts +0 -7
- package/dist/local-runtime-release.js +0 -33
- package/dist/local-runtime-release.js.map +0 -1
- package/dist/local-runtime-ssh.d.ts +0 -27
- package/dist/local-runtime-ssh.js +0 -91
- package/dist/local-runtime-ssh.js.map +0 -1
- package/dist/local-runtime.d.ts +0 -25
- package/dist/local-runtime.js +0 -133
- package/dist/local-runtime.js.map +0 -1
- package/dist/observer-data.d.ts +0 -114
- package/dist/observer-data.js +0 -224
- package/dist/observer-data.js.map +0 -1
- package/dist/observer-library.js +0 -191
- package/dist/observer-library.js.map +0 -1
- package/dist/observer-serve.d.ts +0 -99
- package/dist/observer-serve.js +0 -284
- package/dist/observer-serve.js.map +0 -1
- package/dist/observer-static.js +0 -357
- package/dist/observer-static.js.map +0 -1
- package/dist/observer.d.ts +0 -118
- package/dist/observer.js +0 -947
- package/dist/observer.js.map +0 -1
- package/dist/openai-responses-cu.d.ts +0 -158
- package/dist/openai-responses-cu.js +0 -714
- package/dist/openai-responses-cu.js.map +0 -1
- package/dist/orientation.d.ts +0 -29
- package/dist/orientation.js +0 -95
- package/dist/orientation.js.map +0 -1
- package/dist/oss-lab.d.ts +0 -55
- package/dist/oss-lab.js +0 -344
- package/dist/oss-lab.js.map +0 -1
- package/dist/oss-meta-lab-scoring.d.ts +0 -15
- package/dist/oss-meta-lab-scoring.js +0 -145
- package/dist/oss-meta-lab-scoring.js.map +0 -1
- package/dist/oss-meta-lab.d.ts +0 -287
- package/dist/oss-meta-lab.js +0 -4551
- package/dist/oss-meta-lab.js.map +0 -1
- package/dist/oss-remote-telemetry.d.ts +0 -77
- package/dist/oss-remote-telemetry.js +0 -403
- package/dist/oss-remote-telemetry.js.map +0 -1
- package/dist/output-token-limit.js +0 -5
- package/dist/output-token-limit.js.map +0 -1
- package/dist/participant-assignment.d.ts +0 -12
- package/dist/participant-assignment.js +0 -15
- package/dist/participant-assignment.js.map +0 -1
- package/dist/persona-resolve.d.ts +0 -44
- package/dist/persona-resolve.js +0 -109
- package/dist/persona-resolve.js.map +0 -1
- package/dist/persona.d.ts +0 -35
- package/dist/persona.js +0 -141
- package/dist/persona.js.map +0 -1
- package/dist/pi-agent-core.d.ts +0 -77
- package/dist/pi-agent-core.js +0 -207
- package/dist/pi-agent-core.js.map +0 -1
- package/dist/pricing.d.ts +0 -145
- package/dist/pricing.js +0 -277
- package/dist/pricing.js.map +0 -1
- package/dist/program.d.ts +0 -96
- package/dist/program.js +0 -4029
- package/dist/program.js.map +0 -1
- package/dist/reasoning-effort.js +0 -26
- package/dist/reasoning-effort.js.map +0 -1
- package/dist/reclaim.d.ts +0 -31
- package/dist/reclaim.js +0 -90
- package/dist/reclaim.js.map +0 -1
- package/dist/redaction.d.ts +0 -90
- package/dist/redaction.js +0 -294
- package/dist/redaction.js.map +0 -1
- package/dist/restricted-codex-analysis.d.ts +0 -15
- package/dist/restricted-codex-analysis.js +0 -13
- package/dist/restricted-codex-analysis.js.map +0 -1
- package/dist/restricted-codex-participant-policy.d.ts +0 -44
- package/dist/restricted-codex-participant-policy.js +0 -43
- package/dist/restricted-codex-participant-policy.js.map +0 -1
- package/dist/restricted-codex-participant-run.d.ts +0 -20
- package/dist/restricted-codex-participant-run.js +0 -79
- package/dist/restricted-codex-participant-run.js.map +0 -1
- package/dist/restricted-codex-participant.d.ts +0 -20
- package/dist/restricted-codex-participant.js +0 -250
- package/dist/restricted-codex-participant.js.map +0 -1
- package/dist/restricted-codex-policy.d.ts +0 -64
- package/dist/restricted-codex-policy.js +0 -176
- package/dist/restricted-codex-policy.js.map +0 -1
- package/dist/restricted-codex-session.d.ts +0 -44
- package/dist/restricted-codex-session.js +0 -657
- package/dist/restricted-codex-session.js.map +0 -1
- package/dist/restricted-codex-transport.d.ts +0 -69
- package/dist/restricted-codex-transport.js +0 -296
- package/dist/restricted-codex-transport.js.map +0 -1
- package/dist/run-detail.d.ts +0 -61
- package/dist/run-detail.js +0 -137
- package/dist/run-detail.js.map +0 -1
- package/dist/run-index.d.ts +0 -71
- package/dist/run-index.js +0 -206
- package/dist/run-index.js.map +0 -1
- package/dist/run-narration-secrets.js +0 -68
- package/dist/run-narration-secrets.js.map +0 -1
- package/dist/run-paths.d.ts +0 -56
- package/dist/run-paths.js +0 -355
- package/dist/run-paths.js.map +0 -1
- package/dist/run-projection.d.ts +0 -186
- package/dist/run-projection.js +0 -350
- package/dist/run-projection.js.map +0 -1
- package/dist/run-status.d.ts +0 -139
- package/dist/run-status.js +0 -218
- package/dist/run-status.js.map +0 -1
- package/dist/run.d.ts +0 -1255
- package/dist/run.js +0 -5947
- package/dist/run.js.map +0 -1
- package/dist/sandbox-receipts.d.ts +0 -19
- package/dist/sandbox-receipts.js +0 -51
- package/dist/sandbox-receipts.js.map +0 -1
- package/dist/screenshot-image.d.ts +0 -11
- package/dist/screenshot-image.js +0 -26
- package/dist/screenshot-image.js.map +0 -1
- package/dist/scripted-browser-actor.d.ts +0 -297
- package/dist/scripted-browser-actor.js +0 -1399
- package/dist/scripted-browser-actor.js.map +0 -1
- package/dist/scripted-browser-lab.d.ts +0 -121
- package/dist/scripted-browser-lab.js +0 -852
- package/dist/scripted-browser-lab.js.map +0 -1
- package/dist/secret-prompt.js +0 -36
- package/dist/secret-prompt.js.map +0 -1
- package/dist/selected-output-paths.d.ts +0 -52
- package/dist/selected-output-paths.js +0 -366
- package/dist/selected-output-paths.js.map +0 -1
- package/dist/serve-exposure.d.ts +0 -62
- package/dist/serve-exposure.js +0 -129
- package/dist/serve-exposure.js.map +0 -1
- package/dist/serve-http.js +0 -45
- package/dist/serve-http.js.map +0 -1
- package/dist/serve-tunnel.js +0 -113
- package/dist/serve-tunnel.js.map +0 -1
- package/dist/shared-world-lab.d.ts +0 -269
- package/dist/shared-world-lab.js +0 -1422
- package/dist/shared-world-lab.js.map +0 -1
- package/dist/source-archive.d.ts +0 -82
- package/dist/source-archive.js +0 -408
- package/dist/source-archive.js.map +0 -1
- package/dist/stats.d.ts +0 -82
- package/dist/stats.js +0 -219
- package/dist/stats.js.map +0 -1
- package/dist/stop-conditions.d.ts +0 -39
- package/dist/stop-conditions.js +0 -66
- package/dist/stop-conditions.js.map +0 -1
- package/dist/study-analysis-codex-config.d.ts +0 -11
- package/dist/study-analysis-codex-config.js +0 -34
- package/dist/study-analysis-codex-config.js.map +0 -1
- package/dist/study-analysis-engine.d.ts +0 -47
- package/dist/study-analysis-engine.js +0 -327
- package/dist/study-analysis-engine.js.map +0 -1
- package/dist/study-analysis-evidence.d.ts +0 -27
- package/dist/study-analysis-evidence.js +0 -660
- package/dist/study-analysis-evidence.js.map +0 -1
- package/dist/study-analysis-job.d.ts +0 -97
- package/dist/study-analysis-job.js +0 -214
- package/dist/study-analysis-job.js.map +0 -1
- package/dist/study-analysis-provider.d.ts +0 -40
- package/dist/study-analysis-provider.js +0 -170
- package/dist/study-analysis-provider.js.map +0 -1
- package/dist/study-analysis-service.d.ts +0 -59
- package/dist/study-analysis-service.js +0 -257
- package/dist/study-analysis-service.js.map +0 -1
- package/dist/study-analysis-sharing.d.ts +0 -11
- package/dist/study-analysis-sharing.js +0 -35
- package/dist/study-analysis-sharing.js.map +0 -1
- package/dist/study-analysis-store.d.ts +0 -47
- package/dist/study-analysis-store.js +0 -493
- package/dist/study-analysis-store.js.map +0 -1
- package/dist/study-analysis-validation.d.ts +0 -618
- package/dist/study-analysis-validation.js +0 -384
- package/dist/study-analysis-validation.js.map +0 -1
- package/dist/study-analysis.d.ts +0 -206
- package/dist/study-analysis.js +0 -4
- package/dist/study-analysis.js.map +0 -1
- package/dist/study-costs.js +0 -114
- package/dist/study-costs.js.map +0 -1
- package/dist/subject-runtime.d.ts +0 -23
- package/dist/subject-runtime.js +0 -70
- package/dist/subject-runtime.js.map +0 -1
- package/dist/tasks.d.ts +0 -90
- package/dist/tasks.js +0 -144
- package/dist/tasks.js.map +0 -1
- package/dist/telemetry.js +0 -324
- package/dist/telemetry.js.map +0 -1
- package/dist/terminal-agent-actor.d.ts +0 -41
- package/dist/terminal-agent-actor.js +0 -25
- package/dist/terminal-agent-actor.js.map +0 -1
- package/dist/terminal-encoding.js +0 -80
- package/dist/terminal-encoding.js.map +0 -1
- package/dist/terminal-node-bootstrap.d.ts +0 -4
- package/dist/terminal-node-bootstrap.js +0 -58
- package/dist/terminal-node-bootstrap.js.map +0 -1
- package/dist/terminal-participant-activity.d.ts +0 -6
- package/dist/terminal-participant-activity.js +0 -34
- package/dist/terminal-participant-activity.js.map +0 -1
- package/dist/terminal-runtime-auth.d.ts +0 -13
- package/dist/terminal-runtime-auth.js +0 -24
- package/dist/terminal-runtime-auth.js.map +0 -1
- package/dist/terminal-runtime.d.ts +0 -16
- package/dist/terminal-runtime.js +0 -42
- package/dist/terminal-runtime.js.map +0 -1
- package/dist/terminal-token-usage.d.ts +0 -15
- package/dist/terminal-token-usage.js +0 -94
- package/dist/terminal-token-usage.js.map +0 -1
- package/dist/tui-actions.d.ts +0 -39
- package/dist/tui-actions.js +0 -178
- package/dist/tui-actions.js.map +0 -1
- package/dist/tui-contract.d.ts +0 -141
- package/dist/tui-contract.js +0 -54
- package/dist/tui-contract.js.map +0 -1
- package/dist/tui-launch.js +0 -167
- package/dist/tui-launch.js.map +0 -1
- package/dist/tui-project.d.ts +0 -9
- package/dist/tui-project.js +0 -18
- package/dist/tui-project.js.map +0 -1
- package/docs/architecture/examples/state-driven-local-app/README.md +0 -80
- package/docs/architecture/examples/state-driven-local-app/app.mjs +0 -48
- package/docs/architecture/examples/state-driven-local-app/runner.mjs +0 -105
- package/docs/architecture/local-codex-tui-actor.md +0 -213
- package/docs/architecture/oss-lab-poc.md +0 -250
- package/docs/architecture/runtime-broker-core.md +0 -30
- package/docs/release/0.100.0-local-setup.md +0 -31
- package/docs/release/0.100.1-participant-continuity.md +0 -20
- package/docs/release/0.101.0-codex-ui-tools.md +0 -28
- package/docs/release/0.102.0-participant-media.md +0 -43
- package/docs/release/0.103.0-desktop-recording.md +0 -29
- package/docs/release/0.103.1-analysis-capture-allocation.md +0 -18
- package/docs/release/0.103.2-analysis-ending-context.md +0 -21
- package/docs/release/0.104.0-local-captured-inboxes.md +0 -29
- package/docs/release/0.104.1-recording-startup.md +0 -24
- package/docs/release/0.104.2-recording-timestamps.md +0 -32
- package/docs/release/0.104.3-local-smtp-catch.md +0 -15
- package/docs/release/0.20.0-external-public-shared-world.md +0 -43
- package/docs/release/0.84.0-redacted-evidence.md +0 -42
- package/docs/release/0.84.1-portable-feedback.md +0 -20
- package/docs/release/0.85.0-observer-review.md +0 -56
- package/docs/release/0.85.1-observer-continuity.md +0 -20
- package/docs/release/0.86.0-participant-evidence.md +0 -50
- package/docs/release/0.86.1-task-preflight-saved-recordings.md +0 -40
- package/docs/release/0.87.0-participant-endings-and-phone-review.md +0 -64
- package/docs/release/0.88.0-study-diagnostics.md +0 -43
- package/docs/release/0.88.1-completion-evidence-and-local-app.md +0 -79
- package/docs/release/0.88.2-sequential-study-budgets.md +0 -57
- package/docs/release/0.89.0-study-findings.md +0 -79
- package/docs/release/0.89.1-analysis-finished-notice.md +0 -24
- package/docs/release/0.90.0-automatic-analysis.md +0 -21
- package/docs/release/0.91.0-analysis-quality-and-defaults.md +0 -33
- package/docs/release/0.91.1-study-review-polish.md +0 -28
- package/docs/release/0.92.0-grid-playback.md +0 -22
- package/docs/release/0.93.0-global-playback.md +0 -26
- package/docs/release/0.93.1-observer-review-controls.md +0 -24
- package/docs/release/0.94.0-reliability.md +0 -48
- package/docs/release/0.95.0-connections-setup.md +0 -38
- package/docs/release/0.96.0-real-email-receiving.md +0 -47
- package/docs/release/0.96.1-browser-navigation.md +0 -22
- package/docs/release/0.97.0-codex-account-analysis.md +0 -45
- package/docs/release/0.98.0-local-browser-studies.md +0 -31
- package/docs/release/0.99.0-local-browser-mac.md +0 -34
- package/docs/release/0.99.1-action-recovery.md +0 -19
- /package/dist/{agent-session.d.ts → actors/agent-session.d.ts} +0 -0
- /package/dist/{cua-executor-error.d.ts → actors/computer-use/executor-error.d.ts} +0 -0
- /package/dist/{cua-speech.d.ts → actors/computer-use/speech.d.ts} +0 -0
- /package/dist/{actor-goal-source.d.ts → actors/goal-source.d.ts} +0 -0
- /package/dist/{output-token-limit.d.ts → actors/output-token-limit.d.ts} +0 -0
- /package/dist/{reasoning-effort.d.ts → actors/reasoning-effort.d.ts} +0 -0
- /package/dist/{secret-prompt.d.ts → cli/secret-prompt.d.ts} +0 -0
- /package/dist/{telemetry.d.ts → cli/telemetry.d.ts} +0 -0
- /package/dist/{browser-evidence-hygiene.d.ts → evidence/browser-hygiene.d.ts} +0 -0
- /package/dist/{serve-http.d.ts → observer/http.d.ts} +0 -0
- /package/dist/{observer-library.d.ts → observer/library.d.ts} +0 -0
- /package/dist/{listen.d.ts → observer/listen.d.ts} +0 -0
- /package/dist/{observer-static.d.ts → observer/static.d.ts} +0 -0
- /package/dist/{serve-tunnel.d.ts → observer/tunnel.d.ts} +0 -0
- /package/dist/{terminal-encoding.d.ts → routes/terminal/encoding.d.ts} +0 -0
- /package/dist/{concurrency.d.ts → run/concurrency.d.ts} +0 -0
- /package/dist/{study-costs.d.ts → run/costs.d.ts} +0 -0
- /package/dist/{run-narration-secrets.d.ts → run/transient-comms-secrets.d.ts} +0 -0
- /package/dist/{tui-launch.d.ts → tui/launch.d.ts} +0 -0
package/dist/shared-world-lab.js
DELETED
|
@@ -1,1422 +0,0 @@
|
|
|
1
|
-
// The shared-world lab backend (#164): the SEQUENTIAL deterministic proof-of-concept of the
|
|
2
|
-
// shared-world topology. ONE sandbox provisions a mutable service plane ONCE (clone or packed
|
|
3
|
-
// working tree + serve + seed), then N role SEATS take turns IN DECLARED ORDER (each an isolated browser
|
|
4
|
-
// profile + identity) against the shared loopback app. A read-only state
|
|
5
|
-
// CHECKPOINT (digest probe) runs at baseline + after each role's turn, producing a
|
|
6
|
-
// harness-clocked timeline that PROVES role B acted on a world already containing role A's
|
|
7
|
-
// mutation (the checkpoint after A strictly precedes B's turn in one clock).
|
|
8
|
-
//
|
|
9
|
-
// Doctrine (docs/goals/shared-world-topology/goal.md): the bundle declares a VERIFIED, weaker
|
|
10
|
-
// `attributionClass: shared-world` + a `humanish.shared-world.v1` block whose `attributionLimits`
|
|
11
|
-
// pin the attribution ceiling (sequential-only, no-concurrent-races,
|
|
12
|
-
// delta-attributed-to-turn-not-action). verifyRun fails closed on any overclaim.
|
|
13
|
-
//
|
|
14
|
-
// Safety rails (same as the fan-out packet + the 2026-06-16 prod incident): ONE Sandbox.create;
|
|
15
|
-
// ONE teardown BY exact sandboxId in a finally — NEVER Sandbox.list (account-wide ops are
|
|
16
|
-
// forbidden). Provisioned values are literal-scrubbed before any error/log persists; checkpoints
|
|
17
|
-
// persist DIGEST-ONLY. The concurrent (getHost) topology, a handoff/barrier grammar, an onTurn
|
|
18
|
-
// hook, and real per-role login are named NON-GOALS (PR2+).
|
|
19
|
-
//
|
|
20
|
-
// FIDELITY NOTE: one sandbox has ONE screen geometry, so a role's `device` is a PROMPT SIGNAL
|
|
21
|
-
// (composed into its persona context) — physical per-role screen geometry is the concurrent
|
|
22
|
-
// topology's job. Each role records its measured browser viewport separately from that screen.
|
|
23
|
-
import { resolveAutomaticAnalysis } from "./automatic-analysis-config.js";
|
|
24
|
-
import { completeAutomaticAnalysis, markFinalizedStudyResult } from "./automatic-analysis-completion.js";
|
|
25
|
-
import { desktopMediaValidationReason, taskProtocolValidationReason } from "./lab-config.js";
|
|
26
|
-
import { randomBytes } from "node:crypto";
|
|
27
|
-
import { describeMissingKeys } from "./key-resolution.js";
|
|
28
|
-
import { beginRunStatus, withRunStatusScope } from "./run-status.js";
|
|
29
|
-
import path from "node:path";
|
|
30
|
-
import { runDesktopCommandOrThrow, toErrorMessage } from "./command-failure.js";
|
|
31
|
-
import { adapterScoreFailureMessage, applyBrowserAdapterHooks } from "./adapter-extension.js";
|
|
32
|
-
import { actorRegistry, isCuaActorDescriptor } from "./actor-registry.js";
|
|
33
|
-
import { CHROMIUM_EVIDENCE_HYGIENE_FLAGS, chromiumEvidenceProfilePreferencesJson } from "./browser-evidence-hygiene.js";
|
|
34
|
-
import { labPersonaIds, resolveCommittedPersonasForCwd } from "./persona-resolve.js";
|
|
35
|
-
import { commandDigestOf, buildCuaCostSummary, makeCuaRunBudget, composeLaneInstructions, defaultPackLocalTree, makeChromeBrowserStateObserver, captureDesktopBrowserGeometry, inspectDesktopScreenGeometry, makeLaneWriteScreenshot, provisionCloneSubject, provisionLocalTreeSubject, resolveLaneDevice, resolveSubjectState, SUBJECT_DIR, desktopBrowserFamily } from "./cua-actor-lab.js";
|
|
36
|
-
import { createDesktopSandbox, loadE2BDesktopModule } from "./e2b-desktop-launch.js";
|
|
37
|
-
import { runDetachedStep } from "./e2b-detached.js";
|
|
38
|
-
import { resolveSeatUrl, sharedWorldValidationReason, outputTokenLimitValidationReason } from "./lab-config.js";
|
|
39
|
-
import { renderObserver } from "./observer.js";
|
|
40
|
-
import { redactText } from "./redaction.js";
|
|
41
|
-
import { participantAssignment } from "./participant-assignment.js";
|
|
42
|
-
import { prepareRunArtifactPaths, validatePreparedRunArtifactPaths } from "./run-paths.js";
|
|
43
|
-
import { writeContainedOutputFile, writePreparedRunLatestPointer } from "./selected-output-paths.js";
|
|
44
|
-
import { buildRunSource, PUBLIC_TARGET_CWD, REVIEW_SCHEMA, RUN_BUNDLE_SCHEMA, SHARED_WORLD_SCHEMA } from "./run.js";
|
|
45
|
-
import { appendSandboxReceipt } from "./sandbox-receipts.js";
|
|
46
|
-
import { estimateActorCost, estimateActorCostForExecution, MODEL_RATES, round6 } from "./pricing.js";
|
|
47
|
-
import { DEFAULT_OPENAI_CU_MODEL } from "./openai-responses-cu.js";
|
|
48
|
-
export const SHARED_WORLD_LAB_SCHEMA = "humanish.shared-world-lab-result.v1";
|
|
49
|
-
export const SHARED_WORLD_LAB_PROVIDER_METADATA = {
|
|
50
|
-
mode: "shared-world-lab",
|
|
51
|
-
tool: "humanish"
|
|
52
|
-
};
|
|
53
|
-
// The DEFAULT per-role session budget is DERIVED, not flat: every role's turn shares ONE sandbox
|
|
54
|
-
// on this route, so the sandbox deadline is timeoutMs x roleCount plus provisioning, seeding, and
|
|
55
|
-
// the teardown buffer — and E2B refuses a sandbox over one hour. A flat raise here would make the
|
|
56
|
-
// derived deadline overflow the cap and fail at create. The derivation hands each role the most
|
|
57
|
-
// the cap allows (capped at 15 minutes; floored at the historical 300s so a seed-heavy lab never
|
|
58
|
-
// gets LESS room than it always had). An explicit execution.timeoutMs is never adjusted.
|
|
59
|
-
const MAX_SANDBOX_MS = 60 * 60_000;
|
|
60
|
-
const MAX_DERIVED_ROLE_SESSION_MS = 15 * 60_000;
|
|
61
|
-
const MIN_DERIVED_ROLE_SESSION_MS = 300_000;
|
|
62
|
-
function defaultRoleSessionTimeoutMs(config, roleCount) {
|
|
63
|
-
const stateBudgetMs = (config.subject.state?.seed ?? []).reduce((sum, step) => sum + (step.timeoutMs ?? DEFAULT_STATE_STEP_TIMEOUT_MS), 0);
|
|
64
|
-
const room = Math.floor((MAX_SANDBOX_MS - SUBJECT_PROVISION_BUDGET_MS - stateBudgetMs - SANDBOX_TIMEOUT_BUFFER_MS)
|
|
65
|
-
/ Math.max(1, roleCount));
|
|
66
|
-
return Math.max(MIN_DERIVED_ROLE_SESSION_MS, Math.min(MAX_DERIVED_ROLE_SESSION_MS, room));
|
|
67
|
-
}
|
|
68
|
-
// Settle after opening a seat's browser, before the session's first screenshot.
|
|
69
|
-
const BROWSER_SETTLE_MS = 8_000;
|
|
70
|
-
// In-sandbox budget for ending one seat's browser at turn end (TERM, short wait, KILL).
|
|
71
|
-
const SEAT_BROWSER_TERMINATION_TIMEOUT_MS = 15_000;
|
|
72
|
-
// Server-side reclamation buffer past the loop's own wall-clock stop.
|
|
73
|
-
const SANDBOX_TIMEOUT_BUFFER_MS = 10 * 60_000;
|
|
74
|
-
// Room for the one-time clone/install/build/start/probe + the sequential per-role sessions.
|
|
75
|
-
const SUBJECT_PROVISION_BUDGET_MS = 30 * 60_000;
|
|
76
|
-
// Per-checkpoint probe budget (read-only aggregate probes are fast).
|
|
77
|
-
const CHECKPOINT_TIMEOUT_MS = 60_000;
|
|
78
|
-
const DEFAULT_STATE_STEP_TIMEOUT_MS = 5 * 60_000;
|
|
79
|
-
const DEFAULT_MISSION = "You are testing a shared web application other roles also use. The browser is already open at your entry URL. Accomplish what your role asks, then stop.";
|
|
80
|
-
function readPositiveInt(value, fallback) {
|
|
81
|
-
if (value === undefined)
|
|
82
|
-
return fallback;
|
|
83
|
-
const parsed = Number.parseInt(value, 10);
|
|
84
|
-
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : fallback;
|
|
85
|
-
}
|
|
86
|
-
function makeSharedWorldRunId() {
|
|
87
|
-
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
88
|
-
return `shared-world-${stamp}-${randomBytes(4).toString("hex")}`;
|
|
89
|
-
}
|
|
90
|
-
/** Single-quote a value for safe interpolation into the seat-launch shell command. */
|
|
91
|
-
function shellQuote(value) {
|
|
92
|
-
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Launch ONE seat's browser with its OWN isolated profile — the shared-world topology needs a
|
|
96
|
-
* fresh browser identity boundary per role (cookies/session isolated per seat). Absent/default
|
|
97
|
-
* preserves the historical shared-world opener (Chrome best-effort). A concrete preference is
|
|
98
|
-
* fail-closed and records the resolved in-sandbox command.
|
|
99
|
-
*/
|
|
100
|
-
async function launchSeatBrowser(desktop, args) {
|
|
101
|
-
const requested = args.browserPreference ?? "default";
|
|
102
|
-
const chromiumFlags = CHROMIUM_EVIDENCE_HYGIENE_FLAGS.map(shellQuote).join(" ");
|
|
103
|
-
const command = [
|
|
104
|
-
"set -euo pipefail",
|
|
105
|
-
`browser_preference=${shellQuote(requested)}`,
|
|
106
|
-
`profile_dir=${shellQuote(args.profileDir)}`,
|
|
107
|
-
`seat_url=${shellQuote(args.seatUrl)}`,
|
|
108
|
-
`chrome_preferences_json=${shellQuote(chromiumEvidenceProfilePreferencesJson())}`,
|
|
109
|
-
'mkdir -p "$profile_dir"',
|
|
110
|
-
"chrome_debug_flags=(" + chromiumFlags + ")",
|
|
111
|
-
"prepare_chrome_profile() {",
|
|
112
|
-
" mkdir -p \"$profile_dir/Default\"",
|
|
113
|
-
" printf '%s\\n' \"$chrome_preferences_json\" > \"$profile_dir/Default/Preferences\"",
|
|
114
|
-
"}",
|
|
115
|
-
"launch_chrome() {",
|
|
116
|
-
" local label=\"$1\"",
|
|
117
|
-
" local binary=\"$2\"",
|
|
118
|
-
" if ! command -v \"$binary\" >/dev/null 2>&1; then return 127; fi",
|
|
119
|
-
" prepare_chrome_profile",
|
|
120
|
-
" rm -f \"$profile_dir/DevToolsActivePort\"",
|
|
121
|
-
" setsid \"$binary\" --new-window --remote-debugging-address=127.0.0.1 --remote-debugging-port=0 --user-data-dir=\"$profile_dir\" \"${chrome_debug_flags[@]}\" \"$seat_url\" > /dev/null 2>&1 < /dev/null &",
|
|
122
|
-
" local launch_pid=$!",
|
|
123
|
-
" echo \"HUMANISH_BROWSER_RESOLVED=$label\"",
|
|
124
|
-
" echo \"HUMANISH_BROWSER_PID=$launch_pid\"",
|
|
125
|
-
" for _ in $(seq 1 30); do",
|
|
126
|
-
" if [ -s \"$profile_dir/DevToolsActivePort\" ]; then",
|
|
127
|
-
" head -n 1 \"$profile_dir/DevToolsActivePort\" | sed 's/^/HUMANISH_BROWSER_CDP_PORT=/'",
|
|
128
|
-
" break",
|
|
129
|
-
" fi",
|
|
130
|
-
" sleep 0.1",
|
|
131
|
-
" done",
|
|
132
|
-
"}",
|
|
133
|
-
"launch_firefox() {",
|
|
134
|
-
" if ! command -v firefox >/dev/null 2>&1; then return 127; fi",
|
|
135
|
-
" setsid firefox --new-instance --no-remote --new-window --profile \"$profile_dir\" \"$seat_url\" > /dev/null 2>&1 < /dev/null &",
|
|
136
|
-
" local launch_pid=$!",
|
|
137
|
-
" echo \"HUMANISH_BROWSER_RESOLVED=firefox\"",
|
|
138
|
-
" echo \"HUMANISH_BROWSER_PID=$launch_pid\"",
|
|
139
|
-
" echo \"HUMANISH_BROWSER_PROFILE_DIR=$profile_dir\"",
|
|
140
|
-
"}",
|
|
141
|
-
"case \"$browser_preference\" in",
|
|
142
|
-
" chrome)",
|
|
143
|
-
" launch_chrome google-chrome google-chrome || launch_chrome google-chrome-stable google-chrome-stable",
|
|
144
|
-
" ;;",
|
|
145
|
-
" chromium)",
|
|
146
|
-
" launch_chrome chromium chromium || launch_chrome chromium-browser chromium-browser",
|
|
147
|
-
" ;;",
|
|
148
|
-
" firefox)",
|
|
149
|
-
" launch_firefox",
|
|
150
|
-
" ;;",
|
|
151
|
-
" default)",
|
|
152
|
-
" launch_chrome google-chrome google-chrome || true",
|
|
153
|
-
" ;;",
|
|
154
|
-
"esac"
|
|
155
|
-
].join("\n");
|
|
156
|
-
const result = await runDesktopCommandOrThrow(() => desktop.commands.run(command, { requestTimeoutMs: args.requestTimeoutMs }), (_info, error) => args.browserPreference !== undefined && args.browserPreference !== "default"
|
|
157
|
-
? new Error(`requested desktop browser "${args.browserPreference}" could not be launched for shared-world seat`)
|
|
158
|
-
: error);
|
|
159
|
-
if (args.browserPreference !== undefined && args.browserPreference !== "default" && result.exitCode !== undefined && result.exitCode !== 0) {
|
|
160
|
-
throw new Error(`requested desktop browser "${args.browserPreference}" could not be launched for shared-world seat`);
|
|
161
|
-
}
|
|
162
|
-
const resolved = (result.stdout ?? "").match(/^HUMANISH_BROWSER_RESOLVED=(\S+)$/m)?.[1];
|
|
163
|
-
const processId = (result.stdout ?? "").match(/^HUMANISH_BROWSER_PID=(\d+)$/m)?.[1];
|
|
164
|
-
const profileDir = (result.stdout ?? "").match(/^HUMANISH_BROWSER_PROFILE_DIR=(\S+)$/m)?.[1] ?? args.profileDir;
|
|
165
|
-
const cdpPortRaw = (result.stdout ?? "").match(/^HUMANISH_BROWSER_CDP_PORT=(\d+)$/m)?.[1];
|
|
166
|
-
const cdpPort = cdpPortRaw === undefined ? undefined : Number(cdpPortRaw);
|
|
167
|
-
return {
|
|
168
|
-
family: desktopBrowserFamily(resolved ?? requested),
|
|
169
|
-
...(processId === undefined
|
|
170
|
-
? {}
|
|
171
|
-
: { identity: { processId, profileDir, targetUrl: args.seatUrl, ...(cdpPort === undefined ? {} : { cdpPort }) } }),
|
|
172
|
-
...(args.browserPreference === undefined
|
|
173
|
-
? {}
|
|
174
|
-
: { evidence: { requested, ...(resolved === undefined ? {} : { resolved }) } })
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Self-match-proof pkill/pgrep -f pattern for a seat's unique profile dir: bracket the first
|
|
179
|
-
* character so the in-sandbox shell running the termination script (whose own command line
|
|
180
|
-
* carries this pattern) can never match itself. Exported (pure) for contract tests.
|
|
181
|
-
*/
|
|
182
|
-
export function seatProfilePkillPattern(profileDir) {
|
|
183
|
-
const head = profileDir.slice(0, 1);
|
|
184
|
-
const tail = profileDir.slice(1).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
185
|
-
return `[${head}]${tail}`;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Build the in-sandbox command that ends ONE seat's browser when its turn ends (pure; exported
|
|
189
|
-
* for contract tests). All roles share the ONE desktop, so a prior seat's browser left alive
|
|
190
|
-
* could keep polling/holding websockets and mutating the shared plane during a later role's
|
|
191
|
-
* turn, with its authenticated window one Alt-Tab away from the current actor. The recorded
|
|
192
|
-
* launch PID (a setsid session leader) is the primary kill (its process group takes the whole
|
|
193
|
-
* browser tree); pkill -f on the seat's unique profile dir is the fallback; a short bounded
|
|
194
|
-
* wait escalates to SIGKILL. Exit is always 0: a termination failure degrades to the caller's
|
|
195
|
-
* warning, never a failed run.
|
|
196
|
-
*/
|
|
197
|
-
export function buildSeatBrowserTerminationCommand(processId, profileDir) {
|
|
198
|
-
return [
|
|
199
|
-
"set -u",
|
|
200
|
-
`launch_pid=${shellQuote(processId ?? "")}`,
|
|
201
|
-
`profile_pattern=${shellQuote(seatProfilePkillPattern(profileDir))}`,
|
|
202
|
-
'if [ -n "$launch_pid" ]; then',
|
|
203
|
-
' kill -TERM -- "-$launch_pid" 2>/dev/null || kill -TERM "$launch_pid" 2>/dev/null || true',
|
|
204
|
-
"fi",
|
|
205
|
-
'pkill -TERM -f "$profile_pattern" 2>/dev/null || true',
|
|
206
|
-
"for _ in $(seq 1 20); do",
|
|
207
|
-
' if ! pgrep -f "$profile_pattern" >/dev/null 2>&1; then',
|
|
208
|
-
" exit 0",
|
|
209
|
-
" fi",
|
|
210
|
-
" sleep 0.1",
|
|
211
|
-
"done",
|
|
212
|
-
'pkill -KILL -f "$profile_pattern" 2>/dev/null || true',
|
|
213
|
-
"exit 0"
|
|
214
|
-
].join("\n");
|
|
215
|
-
}
|
|
216
|
-
/** Combine a snapshot's per-probe digests into ONE sha256-16 (digest-only; no raw value). */
|
|
217
|
-
export function combineCheckpointDigest(parts) {
|
|
218
|
-
return commandDigestOf(parts.join("\n"));
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Run ONE checkpoint snapshot LIVE: each declared probe runs read-only via the detached
|
|
222
|
-
* primitive; its stdout is literal-scrubbed (provisioned values + the probe's declared redact
|
|
223
|
-
* literals, folded into `scrub`) then pattern-redacted, then digested. Only the COMBINED digest
|
|
224
|
-
* persists — never the raw value (the seed-step lockdown). Unique step names per snapshot prevent
|
|
225
|
-
* stale-status reuse across snapshots.
|
|
226
|
-
*/
|
|
227
|
-
export async function runCheckpointSnapshot(args) {
|
|
228
|
-
const parts = [];
|
|
229
|
-
for (const probe of args.checkpoints) {
|
|
230
|
-
const result = await runDetachedStep(args.desktop, {
|
|
231
|
-
name: `checkpoint-${args.snapshotIndex}-${probe.name}`,
|
|
232
|
-
command: probe.command,
|
|
233
|
-
cwd: SUBJECT_DIR,
|
|
234
|
-
timeoutMs: CHECKPOINT_TIMEOUT_MS,
|
|
235
|
-
requestTimeoutMs: args.requestTimeoutMs,
|
|
236
|
-
...args.timers
|
|
237
|
-
});
|
|
238
|
-
const scrubbed = redactText(args.scrub(result.logTail));
|
|
239
|
-
parts.push(`${probe.name}=${commandDigestOf(scrubbed)}`);
|
|
240
|
-
}
|
|
241
|
-
const digest = combineCheckpointDigest(parts);
|
|
242
|
-
return {
|
|
243
|
-
kind: "checkpoint",
|
|
244
|
-
name: args.name,
|
|
245
|
-
digest,
|
|
246
|
-
deltaFromPrev: args.prevDigest !== undefined && digest !== args.prevDigest
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
/** The DECLARED (dry-run) checkpoint snapshot: digest the probe RECIPE (command digests), no run. */
|
|
250
|
-
export function declaredCheckpointSnapshot(name, checkpoints) {
|
|
251
|
-
const parts = checkpoints.map((probe) => `${probe.name}=${commandDigestOf(probe.command)}`);
|
|
252
|
-
return { kind: "checkpoint", name, digest: combineCheckpointDigest(parts), deltaFromPrev: false };
|
|
253
|
-
}
|
|
254
|
-
/** sha256-16 over the ordered seed-step command digests — the seeded-state RECIPE identity. */
|
|
255
|
-
export function seedRecipeDigest(config) {
|
|
256
|
-
const seed = config.subject.state?.seed ?? [];
|
|
257
|
-
return commandDigestOf(seed.map((step) => `${step.name}:${commandDigestOf(step.command)}`).join("\n"));
|
|
258
|
-
}
|
|
259
|
-
/** Build the resolved role roster from actors[0].lanes (the role roster). */
|
|
260
|
-
function buildRoleSpecs(config, serveUrl, personas) {
|
|
261
|
-
const actor = config.actors[0];
|
|
262
|
-
const mission = actor?.mission ?? DEFAULT_MISSION;
|
|
263
|
-
const roster = actor?.lanes ?? [];
|
|
264
|
-
return roster.map((lane, i) => {
|
|
265
|
-
const roleId = lane.id ?? `role-${String(i + 1).padStart(2, "0")}`;
|
|
266
|
-
const device = resolveLaneDevice(config, lane);
|
|
267
|
-
const resolvedPersona = lane.persona === undefined ? undefined : personas.get(lane.persona);
|
|
268
|
-
const composed = composeLaneInstructions({
|
|
269
|
-
mission,
|
|
270
|
-
...(lane.persona === undefined ? {} : { persona: lane.persona }),
|
|
271
|
-
...(resolvedPersona === undefined ? {} : { resolvedPersona }),
|
|
272
|
-
...(lane.instruction === undefined ? {} : { instruction: lane.instruction }),
|
|
273
|
-
device: { name: device.name, preset: device.preset }
|
|
274
|
-
});
|
|
275
|
-
return {
|
|
276
|
-
roleId,
|
|
277
|
-
roleIndex: i,
|
|
278
|
-
simId: `sim-${String(i + 1).padStart(3, "0")}`,
|
|
279
|
-
streamId: `stream-${String(i + 1).padStart(3, "0")}`,
|
|
280
|
-
persona: composed.persona,
|
|
281
|
-
instructions: composed.instructions,
|
|
282
|
-
assignment: { mission, ...(lane.instruction === undefined ? {} : { focus: lane.instruction }) },
|
|
283
|
-
deviceName: device.name,
|
|
284
|
-
...((lane.reasoningEffort ?? actor?.reasoningEffort) === undefined
|
|
285
|
-
? {}
|
|
286
|
-
: { reasoningEffort: (lane.reasoningEffort ?? actor?.reasoningEffort) }),
|
|
287
|
-
...((lane.stopWhen ?? actor?.stopWhen) === undefined ? {} : { stopWhen: (lane.stopWhen ?? actor?.stopWhen) }),
|
|
288
|
-
...((lane.dwell ?? actor?.dwell) === undefined ? {} : { dwell: (lane.dwell ?? actor?.dwell) }),
|
|
289
|
-
...(lane.entry === undefined ? {} : { entry: lane.entry }),
|
|
290
|
-
seatUrl: resolveSeatUrl(serveUrl, lane.entry) ?? serveUrl,
|
|
291
|
-
screenshotDir: roleId,
|
|
292
|
-
traceArtifactPath: `actors/${`stream-${String(i + 1).padStart(3, "0")}`}.json`,
|
|
293
|
-
profileDir: `/tmp/seat-${roleId}`
|
|
294
|
-
};
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Wrapped so a DIRECT library caller gets the same status-record lifetime the CLI does: returning
|
|
299
|
-
* from this function finalizes any record the run opened, whichever of its fail-closed exits it
|
|
300
|
-
* took. `runLab` establishes a scope too and nesting is harmless — the inner scope owns what it
|
|
301
|
-
* opened. Without this a test or an adopter calling the backend directly leaves the 5s cadence
|
|
302
|
-
* ticking into a directory something else is deleting, which surfaces as an unrelated ENOTEMPTY.
|
|
303
|
-
*/
|
|
304
|
-
export async function runSharedWorldLab(options) {
|
|
305
|
-
const analysis = resolveAutomaticAnalysis(options.config.review?.analysis);
|
|
306
|
-
const result = await withRunStatusScope(() => runSharedWorldLabInScope(options));
|
|
307
|
-
return completeAutomaticAnalysis(result, analysis.ok ? analysis.config : undefined, options.automaticAnalysis, options.config.review?.analysis === undefined ? "default" : "explicit", analysis.ok && analysis.preferLargerOutput === true);
|
|
308
|
-
}
|
|
309
|
-
async function runSharedWorldLabInScope(options) {
|
|
310
|
-
const { config, dryRun } = options;
|
|
311
|
-
const cwd = path.resolve(options.cwd);
|
|
312
|
-
const hooks = options.hooks ?? {};
|
|
313
|
-
const env = hooks.env ?? process.env;
|
|
314
|
-
const render = hooks.renderObserverFn ?? renderObserver;
|
|
315
|
-
const actorType = config.actors[0]?.type ?? "";
|
|
316
|
-
const fail = (code, message, actorLabel) => ({
|
|
317
|
-
schema: SHARED_WORLD_LAB_SCHEMA,
|
|
318
|
-
ok: false,
|
|
319
|
-
cwd,
|
|
320
|
-
labId: config.id,
|
|
321
|
-
actor: actorLabel ?? actorType,
|
|
322
|
-
topology: "shared-world",
|
|
323
|
-
roleCount: config.actors[0]?.lanes?.length ?? 0,
|
|
324
|
-
sequence: [],
|
|
325
|
-
dryRun,
|
|
326
|
-
runId: options.runId ?? "not-created",
|
|
327
|
-
roles: [],
|
|
328
|
-
warnings: [],
|
|
329
|
-
error: { code, message }
|
|
330
|
-
});
|
|
331
|
-
// Direct library entrypoints must reject declarations this backend cannot execute.
|
|
332
|
-
if (String(config.comms?.email?.kind) === "real") {
|
|
333
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", "Real email receiving is unsupported on the sequential shared-world backend. Use a supported concurrent or independent hosted computer-use study.");
|
|
334
|
-
}
|
|
335
|
-
// Resolve the actor through the registry — the parser validated this, but the engine fails closed
|
|
336
|
-
// rather than trusting a config that arrived through the library door (this fn is npm surface).
|
|
337
|
-
const mediaReason = desktopMediaValidationReason(config, false);
|
|
338
|
-
if (mediaReason)
|
|
339
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", mediaReason);
|
|
340
|
-
const analysis = resolveAutomaticAnalysis(config.review?.analysis);
|
|
341
|
-
if (!analysis.ok)
|
|
342
|
-
return fail("HUMANISH_LAB_ANALYSIS_INVALID", analysis.message);
|
|
343
|
-
const tasksReason = taskProtocolValidationReason(config, false);
|
|
344
|
-
if (tasksReason)
|
|
345
|
-
return fail("HUMANISH_LAB_TASKS_UNSUPPORTED", tasksReason);
|
|
346
|
-
const descriptor = actorRegistry[actorType];
|
|
347
|
-
if (!descriptor || !isCuaActorDescriptor(descriptor)) {
|
|
348
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_ACTOR_UNSUPPORTED", `actors[0].type "${actorType}" is not a registered computer-use actor.`);
|
|
349
|
-
}
|
|
350
|
-
// Re-enforce the shared-world cross-validation (library API surface).
|
|
351
|
-
const invalidReason = outputTokenLimitValidationReason(config) ?? sharedWorldValidationReason(config);
|
|
352
|
-
if (invalidReason) {
|
|
353
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", invalidReason, descriptor.id);
|
|
354
|
-
}
|
|
355
|
-
if (config.actors[0]?.maxOutputTokens !== undefined && hooks.runSession) {
|
|
356
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", "maxOutputTokens cannot be enforced by a custom runSession.", descriptor.id);
|
|
357
|
-
}
|
|
358
|
-
const caps = config.execution?.caps;
|
|
359
|
-
const capModelId = config.actors[0]?.model ?? DEFAULT_OPENAI_CU_MODEL;
|
|
360
|
-
const invalidCap = ["maxUsd", "maxTotalUsd"].find(key => caps?.[key] !== undefined && (!Number.isFinite(caps[key]) || caps[key] < 0));
|
|
361
|
-
if (invalidCap)
|
|
362
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", `execution.caps.${invalidCap} must be a finite nonnegative number.`, descriptor.id);
|
|
363
|
-
if (!dryRun && (caps?.maxUsd !== undefined || caps?.maxTotalUsd !== undefined)
|
|
364
|
-
&& !Object.hasOwn(MODEL_RATES, capModelId.trim().toLowerCase())) {
|
|
365
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_INVALID", `The declared spend cap cannot be enforced for unpriced model "${capModelId}".`, descriptor.id);
|
|
366
|
-
}
|
|
367
|
-
const runBudget = !dryRun && caps?.maxTotalUsd !== undefined ? makeCuaRunBudget(caps.maxTotalUsd) : undefined;
|
|
368
|
-
let budgetBlockedReason;
|
|
369
|
-
const noteModelEstimate = (roleId, estimate) => {
|
|
370
|
-
if (!runBudget)
|
|
371
|
-
return undefined;
|
|
372
|
-
const total = runBudget.note(roleId, estimate);
|
|
373
|
-
return total > runBudget.maxTotalUsd
|
|
374
|
-
? `study budget reached: estimated model spend $${round6(total)} crossed execution.caps.maxTotalUsd=${runBudget.maxTotalUsd}; subsequent sequential participants will not start`
|
|
375
|
-
: undefined;
|
|
376
|
-
};
|
|
377
|
-
const serve = config.subject.serve;
|
|
378
|
-
const localTreeRoute = config.subject.source === "local-tree";
|
|
379
|
-
const subjectRepo = config.subject.repos?.[0] ?? "";
|
|
380
|
-
const subjectEnvNames = config.subject.env ?? [];
|
|
381
|
-
const checkpoints = config.subject.state?.checkpoint ?? [];
|
|
382
|
-
// Compile committed personas so each seat's prompt carries real behavioral directives (#381).
|
|
383
|
-
const personaResolution = await resolveCommittedPersonasForCwd(cwd, labPersonaIds(config));
|
|
384
|
-
const roleSpecs = buildRoleSpecs(config, serve.url, personaResolution.personas);
|
|
385
|
-
const roleCount = roleSpecs.length;
|
|
386
|
-
const runSession = hooks.runSession ?? descriptor.runSession;
|
|
387
|
-
// Read keys once into locals (names only; values never logged or persisted).
|
|
388
|
-
const openaiApiKey = env.OPENAI_API_KEY?.trim() ?? "";
|
|
389
|
-
const e2bApiKey = env.E2B_API_KEY?.trim() ?? "";
|
|
390
|
-
// Literal scrubber for every known provisioned value (no secret "shape" to pattern-match):
|
|
391
|
-
// provider/E2B keys, subject env values, AND each checkpoint's declared redact literals.
|
|
392
|
-
const knownSecretValues = [
|
|
393
|
-
openaiApiKey,
|
|
394
|
-
e2bApiKey,
|
|
395
|
-
...subjectEnvNames.map((name) => env[name] ?? ""),
|
|
396
|
-
...checkpoints.flatMap((probe) => probe.redact ?? [])
|
|
397
|
-
].filter((value) => value.length >= 4);
|
|
398
|
-
const scrubKnownValues = (text) => knownSecretValues.reduce((current, value) => current.split(value).join("[REDACTED_SECRET]"), text);
|
|
399
|
-
for (const spec of roleSpecs) {
|
|
400
|
-
if (spec.assignment)
|
|
401
|
-
spec.assignment = participantAssignment(spec.assignment, scrubKnownValues);
|
|
402
|
-
spec.evidenceInstructions = redactText(scrubKnownValues(spec.instructions));
|
|
403
|
-
}
|
|
404
|
-
const redactRepoLabel = config.policies?.redactRepos ?? subjectEnvNames.includes("GITHUB_TOKEN");
|
|
405
|
-
const publicRepo = redactRepoLabel ? "repo-01" : subjectRepo;
|
|
406
|
-
const hasGithubToken = subjectEnvNames.includes("GITHUB_TOKEN");
|
|
407
|
-
if (!dryRun) {
|
|
408
|
-
const missingKeys = [
|
|
409
|
-
...(openaiApiKey ? [] : ["OPENAI_API_KEY"]),
|
|
410
|
-
...(e2bApiKey ? [] : ["E2B_API_KEY"])
|
|
411
|
-
];
|
|
412
|
-
if (missingKeys.length > 0) {
|
|
413
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_KEYS_MISSING", `Live shared-world labs need ${missingKeys.join(" and ")} in the environment (values are never persisted). ${describeMissingKeys(missingKeys, env)}`, descriptor.id);
|
|
414
|
-
}
|
|
415
|
-
const missingSubjectEnv = subjectEnvNames.filter((name) => !env[name]?.trim());
|
|
416
|
-
if (missingSubjectEnv.length > 0) {
|
|
417
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_SUBJECT_ENV_MISSING", `subject.env declares ${missingSubjectEnv.join(", ")} but the environment does not provide ${missingSubjectEnv.length === 1 ? "it" : "them"} (pass via --env-file; values are never persisted).`, descriptor.id);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
const runId = options.runId ?? makeSharedWorldRunId();
|
|
421
|
-
const runPaths = await prepareRunArtifactPaths(cwd, runId);
|
|
422
|
-
// Identity + liveness on disk (#455): every backend writes this, so a watcher can classify any
|
|
423
|
-
// run without parsing bundles and without depending on the interactive-observer path.
|
|
424
|
-
const runStatus = beginRunStatus(runPaths, {
|
|
425
|
-
runId,
|
|
426
|
-
mode: dryRun ? "dry-run" : "live",
|
|
427
|
-
...(options.lab === undefined ? {} : { lab: options.lab })
|
|
428
|
-
});
|
|
429
|
-
const physicalArtifactRoot = runPaths.physicalRunRoot;
|
|
430
|
-
const createdAt = new Date().toISOString();
|
|
431
|
-
const timeoutMs = config.execution?.timeoutMs ?? defaultRoleSessionTimeoutMs(config, roleCount);
|
|
432
|
-
const requestTimeoutMs = readPositiveInt(env.HUMANISH_E2B_REQUEST_TIMEOUT_MS, 60_000);
|
|
433
|
-
const redactScreenshots = config.policies?.redactScreenshots === true;
|
|
434
|
-
const timers = hooks.detachedTimers ?? {};
|
|
435
|
-
// ONE sandbox geometry for the shared desktop (run-wide; per-role device is a prompt signal).
|
|
436
|
-
const sandboxDevice = resolveLaneDevice(config, undefined);
|
|
437
|
-
const sandboxResolution = sandboxDevice.resolution;
|
|
438
|
-
const sandboxPreset = sandboxDevice.preset;
|
|
439
|
-
const perRunSandboxMs = config.execution?.desktop?.sandboxTimeoutMs
|
|
440
|
-
?? timeoutMs * Math.max(1, roleCount)
|
|
441
|
-
+ SUBJECT_PROVISION_BUDGET_MS
|
|
442
|
-
+ (config.subject.state?.seed ?? []).reduce((sum, step) => sum + (step.timeoutMs ?? DEFAULT_STATE_STEP_TIMEOUT_MS), 0)
|
|
443
|
-
+ SANDBOX_TIMEOUT_BUFFER_MS;
|
|
444
|
-
// The provider caps a sandbox at MAX_SANDBOX_MS and refuses a longer request at create, after
|
|
445
|
-
// nothing but a paid API call; on 2026-09-04 an explicit 15-minute execution.timeoutMs for two
|
|
446
|
-
// seats did exactly that ("400: Timeout cannot be greater than 1 hours") and the refusal
|
|
447
|
-
// surfaced as a bundle that failed verification. Say the arithmetic here, before any call.
|
|
448
|
-
if (perRunSandboxMs > MAX_SANDBOX_MS) {
|
|
449
|
-
const perRoleCeilingMs = Math.floor((MAX_SANDBOX_MS - SUBJECT_PROVISION_BUDGET_MS - SANDBOX_TIMEOUT_BUFFER_MS
|
|
450
|
-
- (config.subject.state?.seed ?? []).reduce((sum, step) => sum + (step.timeoutMs ?? DEFAULT_STATE_STEP_TIMEOUT_MS), 0))
|
|
451
|
-
/ Math.max(1, roleCount));
|
|
452
|
-
throw new Error(`the sequential shared-world sandbox would need ${Math.round(perRunSandboxMs / 60_000)} minutes `
|
|
453
|
-
+ `(${roleCount} role(s) x ${Math.round(timeoutMs / 1000)} s of session budget, plus ${SUBJECT_PROVISION_BUDGET_MS / 60_000} minutes of provisioning `
|
|
454
|
-
+ `and a ${SANDBOX_TIMEOUT_BUFFER_MS / 60_000}-minute reclamation buffer), over the provider's ${MAX_SANDBOX_MS / 60_000}-minute sandbox cap; `
|
|
455
|
-
+ `set execution.timeoutMs to at most ${perRoleCeilingMs} ms per role, or execution.desktop.sandboxTimeoutMs explicitly`);
|
|
456
|
-
}
|
|
457
|
-
const source = await buildRunSource({ capturedAt: createdAt, cwd, humanishSource: "present", packageName: "humanish" });
|
|
458
|
-
const warnings = [];
|
|
459
|
-
const stateStepRecords = [];
|
|
460
|
-
const roleOutcomes = [];
|
|
461
|
-
const baselineDeclared = declaredCheckpointSnapshot("cp-baseline", checkpoints);
|
|
462
|
-
let baselineCheckpoint = baselineDeclared;
|
|
463
|
-
let subjectCommit;
|
|
464
|
-
let sandboxId;
|
|
465
|
-
let killed = false;
|
|
466
|
-
let failFastReason;
|
|
467
|
-
let sharedScreenGeometry = {
|
|
468
|
-
screen: { requested: { width: sandboxResolution[0], height: sandboxResolution[1] } }
|
|
469
|
-
};
|
|
470
|
-
// Pack the working tree ONCE per run, on the host, BEFORE any sandbox is created (mirrors the
|
|
471
|
-
// cua route's ordering): a packing failure fails the run closed here, never spending sandbox
|
|
472
|
-
// cost. Dry-run packs nothing (no fs side effects; the contract bundle carries no archiveSha256).
|
|
473
|
-
let localTreeArchive;
|
|
474
|
-
let localTreeArchiveBuffer;
|
|
475
|
-
if (localTreeRoute && !dryRun) {
|
|
476
|
-
const packLocalTree = hooks.packLocalTree ?? defaultPackLocalTree;
|
|
477
|
-
try {
|
|
478
|
-
const packed = await packLocalTree({
|
|
479
|
-
root: cwd,
|
|
480
|
-
...(config.subject.localTree?.exclude === undefined ? {} : { extraExclude: config.subject.localTree.exclude }),
|
|
481
|
-
...(config.subject.localTree?.maxArchiveBytes === undefined ? {} : { maxArchiveBytes: config.subject.localTree.maxArchiveBytes })
|
|
482
|
-
});
|
|
483
|
-
localTreeArchive = packed.archive;
|
|
484
|
-
localTreeArchiveBuffer = packed.buffer;
|
|
485
|
-
process.stderr.write(`humanish shared-world local-tree: packed ${packed.archive.fileCount} entries, ${packed.archive.totalBytes} bytes, archiveSha256 ${packed.archive.archiveSha256}`
|
|
486
|
-
+ `${packed.archive.git ? ` (commit ${packed.archive.git.commit.slice(0, 12)}, ${packed.archive.git.dirty ? "dirty" : "clean"} working tree)` : " (not a git work tree)"}\n`);
|
|
487
|
-
}
|
|
488
|
-
catch (error) {
|
|
489
|
-
return fail("HUMANISH_SHARED_WORLD_LAB_FAILED", `local-tree packing failed: ${redactText(scrubKnownValues(toErrorMessage(error)))}`, descriptor.id);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
if (!dryRun) {
|
|
493
|
-
let desktopModule;
|
|
494
|
-
let desktop;
|
|
495
|
-
let runFailed = false;
|
|
496
|
-
try {
|
|
497
|
-
desktopModule = await (hooks.loadDesktopModule ?? loadE2BDesktopModule)();
|
|
498
|
-
// ONE Sandbox.create for the whole run (metadata.topology + roleCount; the SUBJECT env is
|
|
499
|
-
// provisioned here on the clone route — the ACTOR key never enters the sandbox). An optional
|
|
500
|
-
// custom desktop template (image) selects Sandbox.create(template, opts); absent keeps the
|
|
501
|
-
// byte-stable Sandbox.create(opts) default.
|
|
502
|
-
desktop = await createDesktopSandbox(desktopModule, {
|
|
503
|
-
apiKey: e2bApiKey,
|
|
504
|
-
requestTimeoutMs,
|
|
505
|
-
timeoutMs: perRunSandboxMs,
|
|
506
|
-
metadata: {
|
|
507
|
-
...SHARED_WORLD_LAB_PROVIDER_METADATA,
|
|
508
|
-
labId: config.id,
|
|
509
|
-
topology: "shared-world",
|
|
510
|
-
roleCount: String(roleCount)
|
|
511
|
-
},
|
|
512
|
-
...(subjectEnvNames.length > 0
|
|
513
|
-
? { envs: Object.fromEntries(subjectEnvNames.map((name) => [name, env[name]])) }
|
|
514
|
-
: {}),
|
|
515
|
-
resolution: sandboxResolution,
|
|
516
|
-
dpi: 96,
|
|
517
|
-
lifecycle: { onTimeout: "kill" }
|
|
518
|
-
}, config.execution?.desktop?.template);
|
|
519
|
-
sandboxId = desktop.sandboxId;
|
|
520
|
-
// #358 salvage: durable id receipt the moment the plane sandbox exists.
|
|
521
|
-
await appendSandboxReceipt(runPaths, { at: new Date().toISOString(), laneId: "subject", sandboxId });
|
|
522
|
-
if (hooks.prepareDesktop) {
|
|
523
|
-
await hooks.prepareDesktop(desktop);
|
|
524
|
-
}
|
|
525
|
-
const screenGeometry = await inspectDesktopScreenGeometry({
|
|
526
|
-
desktop,
|
|
527
|
-
laneId: "shared-world",
|
|
528
|
-
requestedScreen: sandboxResolution,
|
|
529
|
-
requestTimeoutMs
|
|
530
|
-
});
|
|
531
|
-
if (screenGeometry.verified) {
|
|
532
|
-
sharedScreenGeometry = {
|
|
533
|
-
screen: { ...sharedScreenGeometry.screen, verified: screenGeometry.verified }
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
if (screenGeometry.warning) {
|
|
537
|
-
warnings.push(screenGeometry.warning);
|
|
538
|
-
sharedScreenGeometry = { ...sharedScreenGeometry, warnings: [screenGeometry.warning] };
|
|
539
|
-
}
|
|
540
|
-
if (screenGeometry.error)
|
|
541
|
-
throw new Error(screenGeometry.error);
|
|
542
|
-
// Provision the shared plane ONCE: clone + install/build + seed + serve + readiness probe
|
|
543
|
-
// (clone route), or upload/extract the once-per-run packed archive + the SAME shared serve
|
|
544
|
-
// pipeline (local-tree route). One stderr line per phase boundary by default; hooks.onPhase
|
|
545
|
-
// (DI seam, mirrors CuaActorLabHooks) overrides it so tests capture instead of writing to
|
|
546
|
-
// real stderr.
|
|
547
|
-
const onSubjectPhase = hooks.onPhase ?? ((event) => {
|
|
548
|
-
process.stderr.write(`humanish shared-world: ${event.message}${event.durationMs === undefined ? "" : ` (${event.durationMs}ms)`}\n`);
|
|
549
|
-
});
|
|
550
|
-
if (localTreeRoute) {
|
|
551
|
-
await provisionLocalTreeSubject(desktop, {
|
|
552
|
-
archiveBuffer: localTreeArchiveBuffer,
|
|
553
|
-
serve,
|
|
554
|
-
...(config.subject.state === undefined ? {} : { state: config.subject.state }),
|
|
555
|
-
requestTimeoutMs,
|
|
556
|
-
scrub: scrubKnownValues,
|
|
557
|
-
onStateStep: (record) => { stateStepRecords.push(record); },
|
|
558
|
-
onPhase: onSubjectPhase,
|
|
559
|
-
...timers
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
subjectCommit = await provisionCloneSubject(desktop, {
|
|
564
|
-
repo: subjectRepo,
|
|
565
|
-
depth: config.subject.clone?.depth ?? 1,
|
|
566
|
-
serve,
|
|
567
|
-
...(config.subject.state === undefined ? {} : { state: config.subject.state }),
|
|
568
|
-
hasGithubToken,
|
|
569
|
-
requestTimeoutMs,
|
|
570
|
-
scrub: scrubKnownValues,
|
|
571
|
-
onCommit: (commit) => { subjectCommit = commit; },
|
|
572
|
-
onStateStep: (record) => { stateStepRecords.push(record); },
|
|
573
|
-
onPhase: onSubjectPhase,
|
|
574
|
-
...timers
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
// Baseline checkpoint (before any role acts).
|
|
578
|
-
baselineCheckpoint = await runCheckpointSnapshot({
|
|
579
|
-
desktop,
|
|
580
|
-
snapshotIndex: 0,
|
|
581
|
-
name: "cp-baseline",
|
|
582
|
-
checkpoints,
|
|
583
|
-
prevDigest: undefined,
|
|
584
|
-
scrub: scrubKnownValues,
|
|
585
|
-
requestTimeoutMs,
|
|
586
|
-
timers
|
|
587
|
-
});
|
|
588
|
-
let prevDigest = baselineCheckpoint.digest;
|
|
589
|
-
// Sequential per-role loop (DECLARED order). A HARNESS error blocks the REMAINING roles
|
|
590
|
-
// (the shared-state premise is broken); a MISSION failure is data, never trips fail-fast.
|
|
591
|
-
for (const [index, spec] of roleSpecs.entries()) {
|
|
592
|
-
if (failFastReason || budgetBlockedReason) {
|
|
593
|
-
roleOutcomes.push({
|
|
594
|
-
spec,
|
|
595
|
-
screenshots: [],
|
|
596
|
-
skippedReason: `skipped: ${failFastReason ?? budgetBlockedReason}`,
|
|
597
|
-
noEngagement: false,
|
|
598
|
-
harnessError: false
|
|
599
|
-
});
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
602
|
-
const screenshots = [];
|
|
603
|
-
const writeScreenshot = makeLaneWriteScreenshot(runPaths, { screenshotDir: spec.screenshotDir }, screenshots);
|
|
604
|
-
let session;
|
|
605
|
-
let sessionError;
|
|
606
|
-
let desktopBrowser;
|
|
607
|
-
let launchedBrowserFamily = "unknown";
|
|
608
|
-
let browserLaunchIdentity;
|
|
609
|
-
let browserLaunched = false;
|
|
610
|
-
let initialBrowserGeometry;
|
|
611
|
-
let browserWindowId;
|
|
612
|
-
let browserTargetId;
|
|
613
|
-
let desktopGeometry = sharedScreenGeometry;
|
|
614
|
-
try {
|
|
615
|
-
// Fresh isolated browser profile per seat, opened at the role's same-origin loopback entry.
|
|
616
|
-
const browserLaunch = await launchSeatBrowser(desktop, {
|
|
617
|
-
...(config.execution?.desktop?.browser === undefined ? {} : { browserPreference: config.execution.desktop.browser }),
|
|
618
|
-
profileDir: spec.profileDir,
|
|
619
|
-
seatUrl: spec.seatUrl,
|
|
620
|
-
requestTimeoutMs
|
|
621
|
-
});
|
|
622
|
-
desktopBrowser = browserLaunch.evidence;
|
|
623
|
-
launchedBrowserFamily = browserLaunch.family;
|
|
624
|
-
browserLaunchIdentity = browserLaunch.identity;
|
|
625
|
-
browserLaunched = true;
|
|
626
|
-
await desktop.wait(BROWSER_SETTLE_MS).catch(() => undefined);
|
|
627
|
-
const browserGeometry = await captureDesktopBrowserGeometry({
|
|
628
|
-
desktop,
|
|
629
|
-
browserFamily: launchedBrowserFamily,
|
|
630
|
-
...(browserLaunchIdentity === undefined ? {} : { launchIdentity: browserLaunchIdentity }),
|
|
631
|
-
laneId: spec.roleId,
|
|
632
|
-
targetUrl: spec.seatUrl,
|
|
633
|
-
requestedScreen: sandboxResolution,
|
|
634
|
-
requestTimeoutMs
|
|
635
|
-
});
|
|
636
|
-
initialBrowserGeometry = browserGeometry;
|
|
637
|
-
browserWindowId = browserGeometry.browserWindowId;
|
|
638
|
-
browserTargetId = browserGeometry.browserTargetId;
|
|
639
|
-
if (browserGeometry.unusable !== undefined) {
|
|
640
|
-
throw new Error(`HUMANISH_CUA_LAB_DEVICE_GEOMETRY: ${browserGeometry.unusable} Participant actions were not started.`);
|
|
641
|
-
}
|
|
642
|
-
const sessionOptions = {
|
|
643
|
-
...(caps?.maxUsd === undefined ? {} : {
|
|
644
|
-
maxUsd: caps.maxUsd,
|
|
645
|
-
estimateTurnCostUsd: (usage) => estimateActorCost(usage, capModelId).estimatedCostUsd
|
|
646
|
-
}),
|
|
647
|
-
...(caps?.maxUsd === undefined && runBudget === undefined ? {} : { requireReportedUsageForSpendCap: true }),
|
|
648
|
-
...(runBudget === undefined ? {} : {
|
|
649
|
-
overRunBudget: (usage) => noteModelEstimate(spec.roleId, estimateActorCost(usage, capModelId).estimatedCostUsd) ?? null
|
|
650
|
-
}),
|
|
651
|
-
instructions: spec.instructions,
|
|
652
|
-
persona: spec.persona,
|
|
653
|
-
timeoutMs,
|
|
654
|
-
openai: {
|
|
655
|
-
apiKey: openaiApiKey,
|
|
656
|
-
...(config.actors[0]?.model ? { model: config.actors[0].model } : {}),
|
|
657
|
-
...(spec.reasoningEffort === undefined ? {} : { reasoningEffort: spec.reasoningEffort }),
|
|
658
|
-
...(config.actors[0]?.maxOutputTokens === undefined ? {} : { maxOutputTokens: config.actors[0].maxOutputTokens })
|
|
659
|
-
},
|
|
660
|
-
desktop: desktop,
|
|
661
|
-
...(launchedBrowserFamily === "chromium"
|
|
662
|
-
? {
|
|
663
|
-
executorOptions: {
|
|
664
|
-
observeBrowserState: makeChromeBrowserStateObserver(desktop, requestTimeoutMs, {
|
|
665
|
-
...(browserLaunchIdentity?.cdpPort === undefined ? {} : { cdpPort: browserLaunchIdentity.cdpPort }),
|
|
666
|
-
...(browserLaunchIdentity?.profileDir === undefined ? {} : { profileDir: browserLaunchIdentity.profileDir }),
|
|
667
|
-
targetUrl: spec.seatUrl
|
|
668
|
-
}, browserTargetId)
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
: {}),
|
|
672
|
-
redactScreenshots,
|
|
673
|
-
scrubText: scrubKnownValues,
|
|
674
|
-
writeScreenshot,
|
|
675
|
-
...(spec.stopWhen === undefined ? {} : { stopWhen: spec.stopWhen }),
|
|
676
|
-
...(spec.dwell === undefined ? {} : { dwell: spec.dwell })
|
|
677
|
-
};
|
|
678
|
-
session = await runSession(sessionOptions);
|
|
679
|
-
}
|
|
680
|
-
catch (error) {
|
|
681
|
-
sessionError = redactText(scrubKnownValues(toErrorMessage(error)));
|
|
682
|
-
}
|
|
683
|
-
if (browserLaunched) {
|
|
684
|
-
const finalGeometry = await captureDesktopBrowserGeometry({
|
|
685
|
-
desktop,
|
|
686
|
-
browserFamily: launchedBrowserFamily,
|
|
687
|
-
...(browserLaunchIdentity === undefined ? {} : { launchIdentity: browserLaunchIdentity }),
|
|
688
|
-
...(browserWindowId === undefined ? {} : { browserWindowId }),
|
|
689
|
-
...(browserTargetId === undefined ? {} : { browserTargetId }),
|
|
690
|
-
laneId: spec.roleId,
|
|
691
|
-
targetUrl: spec.seatUrl,
|
|
692
|
-
requestedScreen: sandboxResolution,
|
|
693
|
-
requestTimeoutMs,
|
|
694
|
-
pagePreference: "active",
|
|
695
|
-
resize: false
|
|
696
|
-
}).catch((error) => ({
|
|
697
|
-
warnings: [`Final browser geometry measurement failed for lane ${spec.roleId}: ${redactText(scrubKnownValues(toErrorMessage(error)))}`]
|
|
698
|
-
}));
|
|
699
|
-
// Chosen capture rule (mirrors runCuaLane): seat-end-if-it-measured-anything, else
|
|
700
|
-
// seat-open. A seat-end capture that measured EITHER field wins whole, so a partial
|
|
701
|
-
// seat-end capture omits fields the seat-open capture had (honest omission); only a
|
|
702
|
-
// seat-end capture that measured NOTHING falls back to the seat-open capture.
|
|
703
|
-
const chosenGeometry = finalGeometry.browserWindow !== undefined || finalGeometry.viewport !== undefined
|
|
704
|
-
? finalGeometry
|
|
705
|
-
: initialBrowserGeometry ?? finalGeometry;
|
|
706
|
-
const geometryWarnings = [...new Set([...(initialBrowserGeometry?.warnings ?? []), ...chosenGeometry.warnings].map((warning) => scrubKnownValues(warning)))];
|
|
707
|
-
warnings.push(...geometryWarnings);
|
|
708
|
-
desktopGeometry = {
|
|
709
|
-
...sharedScreenGeometry,
|
|
710
|
-
...(chosenGeometry.browserWindow === undefined ? {} : { browserWindow: chosenGeometry.browserWindow }),
|
|
711
|
-
...(chosenGeometry.viewport === undefined ? {} : { viewport: chosenGeometry.viewport }),
|
|
712
|
-
...((sharedScreenGeometry.warnings?.length ?? 0) + geometryWarnings.length === 0
|
|
713
|
-
? {}
|
|
714
|
-
: { warnings: [...(sharedScreenGeometry.warnings ?? []), ...geometryWarnings] })
|
|
715
|
-
};
|
|
716
|
-
// End THIS seat's browser now that its turn (and its final geometry capture) is done:
|
|
717
|
-
// every role shares the ONE desktop, so this is the per-seat identity boundary. Runs
|
|
718
|
-
// after the final seat too. Bounded + best-effort: a failure degrades to an explicit
|
|
719
|
-
// warning (the run continues), never a hang.
|
|
720
|
-
try {
|
|
721
|
-
await desktop.commands.run(buildSeatBrowserTerminationCommand(browserLaunchIdentity?.processId, spec.profileDir), { requestTimeoutMs, timeoutMs: SEAT_BROWSER_TERMINATION_TIMEOUT_MS });
|
|
722
|
-
}
|
|
723
|
-
catch (error) {
|
|
724
|
-
warnings.push(`Seat browser termination failed for role ${spec.roleId} (run continues; the seat's browser may remain open on the shared desktop): ${redactText(scrubKnownValues(toErrorMessage(error)))}`);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
if (session) {
|
|
728
|
-
session.trace.estimatedCost = estimateActorCostForExecution(session.trace.tokenUsage, session.trace.ids.model, session.trace.executionProfile);
|
|
729
|
-
// A per-seat stop can occur before the shared callback. Closing-report usage is also
|
|
730
|
-
// part of this participant's total, so reconcile the final trace before admitting a seat.
|
|
731
|
-
budgetBlockedReason = noteModelEstimate(spec.roleId, session.trace.estimatedCost.estimatedCostUsd);
|
|
732
|
-
if ((caps?.maxUsd !== undefined || runBudget !== undefined)
|
|
733
|
-
&& session.trace.ids.model?.trim().toLowerCase() !== capModelId.trim().toLowerCase()) {
|
|
734
|
-
// A custom session owns its provider. We cannot retrospectively enforce the declared
|
|
735
|
-
// rate against a different model, or rewrite its already-recorded participant outcome.
|
|
736
|
-
sessionError = `Role "${spec.roleId}" returned a model identity that differs from the declared cap model; model-spend enforcement cannot be established. The original participant trace and its returned-model estimate are retained; later participants will not start.`;
|
|
737
|
-
warnings.push(sessionError);
|
|
738
|
-
}
|
|
739
|
-
if (runBudget && (session.trace.estimatedCost.estimatedCostUsd === null
|
|
740
|
-
|| session.trace.interactionUsageIncomplete === true || session.trace.debrief?.usageReported === false)) {
|
|
741
|
-
budgetBlockedReason = `study model budget is unknown after role "${spec.roleId}" because provider usage was unavailable; subsequent sequential participants will not start`;
|
|
742
|
-
}
|
|
743
|
-
await writeContainedOutputFile(runPaths, spec.traceArtifactPath, `${JSON.stringify(session.trace, null, 2)}\n`, "utf8");
|
|
744
|
-
if (session.trace.redaction.screenshots === "raw") {
|
|
745
|
-
warnings.push("Screenshots are full-fidelity (raw) for local use — the bundle stays in gitignored .humanish and nothing scans these pixels; review them before sharing anywhere. Set policies.redactScreenshots: true to blur a share-as-is bundle.");
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
const noEngagement = session !== undefined
|
|
749
|
-
&& session.completionReason === "goal_satisfied"
|
|
750
|
-
&& (session.trace.counts.actions ?? 0) === 0
|
|
751
|
-
&& (session.trace.counts.messages ?? 0) === 0;
|
|
752
|
-
if (noEngagement) {
|
|
753
|
-
warnings.push(`Role ${spec.roleId} returned goal_satisfied with ZERO actions and ZERO messages — likely a blank/still-loading screen; NOT counted as a pass.`);
|
|
754
|
-
}
|
|
755
|
-
const harnessError = sessionError !== undefined || session?.completionReason === "harness_error";
|
|
756
|
-
// Checkpoint AFTER this role's turn (the interaction-proof snapshot). Runs even on a
|
|
757
|
-
// harness-errored turn (the probe is read-only state, independent of the browser seat).
|
|
758
|
-
const afterCheckpoint = await runCheckpointSnapshot({
|
|
759
|
-
desktop,
|
|
760
|
-
snapshotIndex: index + 1,
|
|
761
|
-
name: `cp-after-${spec.roleId}`,
|
|
762
|
-
checkpoints,
|
|
763
|
-
prevDigest,
|
|
764
|
-
scrub: scrubKnownValues,
|
|
765
|
-
requestTimeoutMs,
|
|
766
|
-
timers
|
|
767
|
-
});
|
|
768
|
-
prevDigest = afterCheckpoint.digest;
|
|
769
|
-
roleOutcomes.push({
|
|
770
|
-
spec,
|
|
771
|
-
...(session ? { session } : {}),
|
|
772
|
-
...(sessionError === undefined ? {} : { sessionError }),
|
|
773
|
-
screenshots,
|
|
774
|
-
...(desktopBrowser === undefined ? {} : { desktopBrowser }),
|
|
775
|
-
desktopGeometry,
|
|
776
|
-
noEngagement,
|
|
777
|
-
harnessError,
|
|
778
|
-
afterCheckpoint
|
|
779
|
-
});
|
|
780
|
-
if (harnessError && !failFastReason) {
|
|
781
|
-
failFastReason = sessionError ?? `role "${spec.roleId}" ended in a harness error — the shared-state premise is broken (fail-fast)`;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
catch (error) {
|
|
786
|
-
runFailed = true;
|
|
787
|
-
warnings.push(`Shared-world run failed before completion: ${redactText(scrubKnownValues(toErrorMessage(error)))}`);
|
|
788
|
-
}
|
|
789
|
-
finally {
|
|
790
|
-
// ONE teardown BY exact sandboxId — NEVER Sandbox.list (the 2026-06-16 prod-incident rail).
|
|
791
|
-
if (desktop && desktopModule) {
|
|
792
|
-
const anyRoleFailed = runFailed
|
|
793
|
-
|| failFastReason !== undefined
|
|
794
|
-
|| roleOutcomes.some((outcome) => outcome.harnessError || outcome.sessionError !== undefined);
|
|
795
|
-
// Each route's own keep flag gates its own run only: a clone.keep can never leak into a
|
|
796
|
-
// local-tree run's teardown decision, and vice versa (mirrors runCuaLane's keepReason).
|
|
797
|
-
const keepReason = config.subject.clone?.keep === true
|
|
798
|
-
? "subject.clone.keep"
|
|
799
|
-
: config.subject.localTree?.keep === true
|
|
800
|
-
? "subject.localTree.keep"
|
|
801
|
-
: undefined;
|
|
802
|
-
const keepForDebug = keepReason !== undefined && anyRoleFailed;
|
|
803
|
-
if (keepForDebug) {
|
|
804
|
-
warnings.push(`Sandbox ${desktop.sandboxId} kept for debugging (${keepReason} on failure); reclaim it via E2B or it will be killed on its server-side timeout.`);
|
|
805
|
-
}
|
|
806
|
-
else if (typeof desktopModule.Sandbox.kill === "function") {
|
|
807
|
-
try {
|
|
808
|
-
await desktopModule.Sandbox.kill(desktop.sandboxId, { requestTimeoutMs: 60_000 });
|
|
809
|
-
killed = true;
|
|
810
|
-
}
|
|
811
|
-
catch (error) {
|
|
812
|
-
warnings.push(`Sandbox teardown failed (server-side kill-on-timeout will reclaim it): ${redactText(scrubKnownValues(toErrorMessage(error)))}`);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
else {
|
|
816
|
-
warnings.push("Installed @e2b/desktop SDK does not expose Sandbox.kill; server-side kill-on-timeout will reclaim the sandbox.");
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
// Subject provenance (invariant 5): the ONE shared plane. Local-tree carries archiveSha256 (the
|
|
822
|
-
// pin - one archive, so no per-lane unanimity math is needed, unlike the cua fan-out route) plus
|
|
823
|
-
// the host-side commit/dirty when the packed root was a git work tree; clone carries repo/commit
|
|
824
|
-
// as before. Mirrors laneSubjectProjection's local-tree branch in cua-actor-lab.ts.
|
|
825
|
-
const subjectState = resolveSubjectState({
|
|
826
|
-
declared: config.subject.state,
|
|
827
|
-
dryRun,
|
|
828
|
-
executed: stateStepRecords
|
|
829
|
-
});
|
|
830
|
-
const planeCommit = localTreeRoute ? localTreeArchive?.git?.commit : subjectCommit;
|
|
831
|
-
const subject = localTreeRoute
|
|
832
|
-
? {
|
|
833
|
-
source: "local-tree",
|
|
834
|
-
...(localTreeArchive === undefined ? {} : { archiveSha256: localTreeArchive.archiveSha256 }),
|
|
835
|
-
...(planeCommit === undefined ? {} : { commit: planeCommit }),
|
|
836
|
-
...(localTreeArchive?.git === undefined ? {} : { dirty: localTreeArchive.git.dirty }),
|
|
837
|
-
envNames: subjectEnvNames,
|
|
838
|
-
state: subjectState
|
|
839
|
-
}
|
|
840
|
-
: {
|
|
841
|
-
source: "clone",
|
|
842
|
-
repo: publicRepo,
|
|
843
|
-
...(subjectCommit === undefined ? {} : { commit: subjectCommit }),
|
|
844
|
-
envNames: subjectEnvNames,
|
|
845
|
-
state: subjectState
|
|
846
|
-
};
|
|
847
|
-
const bundle = buildSharedWorldBundle({
|
|
848
|
-
...(options.lab === undefined ? {} : { lab: options.lab }),
|
|
849
|
-
config,
|
|
850
|
-
descriptor,
|
|
851
|
-
createdAt,
|
|
852
|
-
dryRun,
|
|
853
|
-
runId,
|
|
854
|
-
source,
|
|
855
|
-
roleSpecs,
|
|
856
|
-
roleOutcomes,
|
|
857
|
-
desktopAllocated: sandboxId !== undefined,
|
|
858
|
-
desktopLifetimeComplete: killed,
|
|
859
|
-
baselineCheckpoint,
|
|
860
|
-
subject,
|
|
861
|
-
sandboxResolution,
|
|
862
|
-
sandboxPreset,
|
|
863
|
-
desktopGeometry: sharedScreenGeometry,
|
|
864
|
-
seedDigest: seedRecipeDigest(config),
|
|
865
|
-
...(planeCommit === undefined ? {} : { subjectCommit: planeCommit }),
|
|
866
|
-
...(failFastReason === undefined ? {} : { failFastReason })
|
|
867
|
-
});
|
|
868
|
-
const adapterWarnings = [];
|
|
869
|
-
const scorerResult = await applyBrowserAdapterHooks({
|
|
870
|
-
hooks,
|
|
871
|
-
bundle,
|
|
872
|
-
context: {
|
|
873
|
-
bundle,
|
|
874
|
-
runDir: physicalArtifactRoot,
|
|
875
|
-
labId: config.id,
|
|
876
|
-
runId,
|
|
877
|
-
actor: descriptor.id,
|
|
878
|
-
backend: "shared-world",
|
|
879
|
-
dryRun,
|
|
880
|
-
laneCount: roleSpecs.length
|
|
881
|
-
},
|
|
882
|
-
sanitize: (text) => redactText(scrubKnownValues(text)),
|
|
883
|
-
warnings: adapterWarnings,
|
|
884
|
-
hookLabel: "sharedWorldHooks",
|
|
885
|
-
...(options.scorerProvenance === undefined ? {} : { scorerProvenance: options.scorerProvenance })
|
|
886
|
-
});
|
|
887
|
-
await validatePreparedRunArtifactPaths(runPaths);
|
|
888
|
-
await writeContainedOutputFile(runPaths, "run.json", `${JSON.stringify(bundle, null, 2)}\n`, "utf8");
|
|
889
|
-
// Finalize identity+liveness from the bundle just written; a throw before this leaves the record
|
|
890
|
-
// stale, which reads as interrupted rather than as a false outcome (#455).
|
|
891
|
-
await runStatus.finish({
|
|
892
|
-
...(bundle.review?.verdict === undefined ? {} : { verdict: bundle.review.verdict }),
|
|
893
|
-
...(bundle.review?.participants === undefined
|
|
894
|
-
? {}
|
|
895
|
-
: {
|
|
896
|
-
participants: {
|
|
897
|
-
total: bundle.review.participants.total,
|
|
898
|
-
reachedGoal: bundle.review.participants.reachedGoal,
|
|
899
|
-
...(bundle.review.participants.reportedFriction === undefined
|
|
900
|
-
? {}
|
|
901
|
-
: { reportedFriction: bundle.review.participants.reportedFriction })
|
|
902
|
-
}
|
|
903
|
-
}),
|
|
904
|
-
...(bundle.cost?.estimatedTotalUsd === undefined ? {} : { estimatedCostUsd: bundle.cost.estimatedTotalUsd })
|
|
905
|
-
});
|
|
906
|
-
await writeContainedOutputFile(runPaths, "review.json", `${JSON.stringify(bundle.review, null, 2)}\n`, "utf8");
|
|
907
|
-
await writeContainedOutputFile(runPaths, "review.md", renderSharedWorldReviewMarkdown(bundle), "utf8");
|
|
908
|
-
await writeContainedOutputFile(runPaths, "events.ndjson", `${bundle.events.map((event) => JSON.stringify(event)).join("\n")}\n`, "utf8");
|
|
909
|
-
await writePreparedRunLatestPointer(runPaths, `${JSON.stringify({ schema: "humanish.latest-run.v1", runId, path: runPaths.relativeRunRoot, updatedAt: createdAt }, null, 2)}\n`, "utf8");
|
|
910
|
-
const observer = await render(cwd, runId, { open: options.open === true });
|
|
911
|
-
const roleOk = (outcome) => {
|
|
912
|
-
return sharedWorldRoleOutcomeOk(outcome, dryRun);
|
|
913
|
-
};
|
|
914
|
-
const allRolesOk = roleSpecs.every((_, index) => roleOk(roleOutcomes[index]));
|
|
915
|
-
const adapterFailure = adapterScoreFailureMessage(bundle);
|
|
916
|
-
const ok = observer.ok && allRolesOk && failFastReason === undefined && adapterFailure === undefined && scorerResult.declaredVerdictFailure === undefined;
|
|
917
|
-
const allWarnings = [...warnings, ...adapterWarnings, ...observer.warnings];
|
|
918
|
-
const roles = roleSpecs.map((spec, index) => {
|
|
919
|
-
const outcome = roleOutcomes[index];
|
|
920
|
-
const base = { id: spec.roleId, index: spec.roleIndex + 1, persona: spec.persona.id, profileDir: spec.profileDir };
|
|
921
|
-
if (dryRun || !outcome) {
|
|
922
|
-
return { ...base, status: "contract_proof_only", ok: dryRun };
|
|
923
|
-
}
|
|
924
|
-
if (outcome.skippedReason !== undefined) {
|
|
925
|
-
return {
|
|
926
|
-
...base,
|
|
927
|
-
status: "blocked",
|
|
928
|
-
ok: false,
|
|
929
|
-
skippedReason: outcome.skippedReason,
|
|
930
|
-
error: { code: "HUMANISH_SHARED_WORLD_LAB_FAILED", message: outcome.skippedReason }
|
|
931
|
-
};
|
|
932
|
-
}
|
|
933
|
-
const session = outcome.session;
|
|
934
|
-
const thisOk = roleOk(outcome);
|
|
935
|
-
return {
|
|
936
|
-
...base,
|
|
937
|
-
status: session ? session.status : "failed",
|
|
938
|
-
ok: thisOk,
|
|
939
|
-
...(session
|
|
940
|
-
? { session: { status: session.status, completionReason: session.completionReason, reason: session.reason, screenshots: outcome.screenshots.length } }
|
|
941
|
-
: {}),
|
|
942
|
-
...(thisOk
|
|
943
|
-
? {}
|
|
944
|
-
: {
|
|
945
|
-
error: {
|
|
946
|
-
code: "HUMANISH_SHARED_WORLD_LAB_FAILED",
|
|
947
|
-
message: outcome.sessionError
|
|
948
|
-
?? (outcome.noEngagement
|
|
949
|
-
? "Role took no actions and produced no message (likely a blank/still-loading screen); not a credible goal_satisfied."
|
|
950
|
-
: session?.completionReason === "harness_error"
|
|
951
|
-
? `Role seat ended with a harness error: ${session.reason}`
|
|
952
|
-
: "Role did not produce a terminal session.")
|
|
953
|
-
}
|
|
954
|
-
})
|
|
955
|
-
};
|
|
956
|
-
});
|
|
957
|
-
const sequence = roleOutcomes
|
|
958
|
-
.filter((outcome) => outcome.skippedReason === undefined && outcome.afterCheckpoint !== undefined)
|
|
959
|
-
.map((outcome) => outcome.spec.roleId);
|
|
960
|
-
const errorResult = (() => {
|
|
961
|
-
if (ok)
|
|
962
|
-
return undefined;
|
|
963
|
-
if (!observer.ok) {
|
|
964
|
-
return { code: "HUMANISH_SHARED_WORLD_LAB_FAILED", message: observer.error?.message ?? "Observer failed for the shared-world run." };
|
|
965
|
-
}
|
|
966
|
-
if (adapterFailure !== undefined) {
|
|
967
|
-
return { code: "HUMANISH_SHARED_WORLD_LAB_FAILED", message: adapterFailure };
|
|
968
|
-
}
|
|
969
|
-
const passed = roles.filter((role) => role.ok).length;
|
|
970
|
-
return {
|
|
971
|
-
code: "HUMANISH_SHARED_WORLD_LAB_FAILED",
|
|
972
|
-
message: `Shared-world run failed: ${passed}/${roleCount} role(s) passed${failFastReason ? ` (fail-fast: ${failFastReason})` : ""}.`
|
|
973
|
-
};
|
|
974
|
-
})();
|
|
975
|
-
return markFinalizedStudyResult({
|
|
976
|
-
schema: SHARED_WORLD_LAB_SCHEMA,
|
|
977
|
-
ok,
|
|
978
|
-
cwd,
|
|
979
|
-
labId: config.id,
|
|
980
|
-
actor: descriptor.id,
|
|
981
|
-
topology: "shared-world",
|
|
982
|
-
roleCount,
|
|
983
|
-
sequence,
|
|
984
|
-
dryRun,
|
|
985
|
-
runId,
|
|
986
|
-
...(sandboxId === undefined ? {} : { sandbox: { sandboxId, killed } }),
|
|
987
|
-
subject,
|
|
988
|
-
roles,
|
|
989
|
-
observer,
|
|
990
|
-
warnings: allWarnings,
|
|
991
|
-
...(errorResult === undefined ? {} : { error: errorResult })
|
|
992
|
-
}, runPaths);
|
|
993
|
-
}
|
|
994
|
-
/** Project the shared-world run into a humanish.run-bundle.v1 with the sharedWorld evidence block. */
|
|
995
|
-
export function buildSharedWorldBundle(args) {
|
|
996
|
-
const { config, descriptor, createdAt, dryRun, roleSpecs, roleOutcomes } = args;
|
|
997
|
-
const simulations = [];
|
|
998
|
-
const streams = [];
|
|
999
|
-
const events = [];
|
|
1000
|
-
const appUrl = config.subject.serve?.url ?? "";
|
|
1001
|
-
events.push({
|
|
1002
|
-
id: "event-000-created",
|
|
1003
|
-
at: createdAt,
|
|
1004
|
-
level: "info",
|
|
1005
|
-
type: "shared-world.run.created",
|
|
1006
|
-
message: `Created shared-world run for ${config.id} (actor ${descriptor.id}, ${roleSpecs.length} role(s), ONE shared plane, sequential turns).`
|
|
1007
|
-
});
|
|
1008
|
-
// Human-readable plane label, byte-stable for the clone route: "clone of <repo>[@<commit>]".
|
|
1009
|
-
// The local-tree route has no repo slug, so it labels the packed archive instead (archiveSha256
|
|
1010
|
-
// + dirty/clean when the packed root was a git work tree).
|
|
1011
|
-
const dryRunPlaneLabel = args.subject.source === "local-tree"
|
|
1012
|
-
? "packed working tree"
|
|
1013
|
-
: `clone of ${args.subject.repo}`;
|
|
1014
|
-
const livePlaneLabel = args.subject.source === "local-tree"
|
|
1015
|
-
? (args.subject.archiveSha256
|
|
1016
|
-
? `packed working tree (archiveSha256 ${args.subject.archiveSha256}${args.subject.dirty === true ? ", dirty working tree" : args.subject.dirty === false ? ", clean working tree" : ""})`
|
|
1017
|
-
: "packed working tree (archive digest unresolved; provisioning failed before resolution)")
|
|
1018
|
-
: `clone of ${args.subject.repo}${args.subjectCommit ? `@${args.subjectCommit}` : ""}`;
|
|
1019
|
-
events.push({
|
|
1020
|
-
id: "event-001-plane",
|
|
1021
|
-
at: createdAt,
|
|
1022
|
-
level: "info",
|
|
1023
|
-
type: "shared-world.plane.provenance",
|
|
1024
|
-
message: dryRun
|
|
1025
|
-
? `Shared plane declared: ${dryRunPlaneLabel}, served at ${appUrl} in-sandbox (dry-run contract; nothing ${args.subject.source === "local-tree" ? "packed" : "cloned"}). Seed recipe ${args.seedDigest}; env names: ${args.subject.envNames?.join(", ") || "none"} (values never persisted).`
|
|
1026
|
-
: `Shared plane: ${livePlaneLabel}, served at ${appUrl} in-sandbox; seed recipe ${args.seedDigest}; env names: ${args.subject.envNames?.join(", ") || "none"} (values never persisted).`,
|
|
1027
|
-
simId: roleSpecs[0]?.simId ?? "sim-001",
|
|
1028
|
-
streamId: roleSpecs[0]?.streamId ?? "stream-001"
|
|
1029
|
-
});
|
|
1030
|
-
let eventSeq = 2;
|
|
1031
|
-
const nextEventId = (suffix) => `event-${String(eventSeq++).padStart(3, "0")}-${suffix}`;
|
|
1032
|
-
roleSpecs.forEach((spec, index) => {
|
|
1033
|
-
const outcome = roleOutcomes[index];
|
|
1034
|
-
const session = outcome?.session;
|
|
1035
|
-
const desktopGeometry = outcome?.desktopGeometry ?? args.desktopGeometry ?? {
|
|
1036
|
-
screen: { requested: { width: args.sandboxResolution[0], height: args.sandboxResolution[1] } }
|
|
1037
|
-
};
|
|
1038
|
-
const screenshots = outcome?.screenshots ?? [];
|
|
1039
|
-
const lastScreenshot = screenshots[screenshots.length - 1];
|
|
1040
|
-
const status = outcome?.skippedReason !== undefined
|
|
1041
|
-
? "blocked"
|
|
1042
|
-
: session
|
|
1043
|
-
? session.status
|
|
1044
|
-
: outcome?.sessionError
|
|
1045
|
-
? "failed"
|
|
1046
|
-
: "contract_proof_only";
|
|
1047
|
-
const reason = outcome?.skippedReason
|
|
1048
|
-
?? session?.reason
|
|
1049
|
-
?? outcome?.sessionError
|
|
1050
|
-
?? "Contract role only: dry-run produced the evidence shape without launching a desktop or spending provider tokens.";
|
|
1051
|
-
const traceScreenshotMode = session?.trace.redaction.screenshots;
|
|
1052
|
-
const screenshotMode = traceScreenshotMode === "raw" || traceScreenshotMode === "blurred"
|
|
1053
|
-
? traceScreenshotMode
|
|
1054
|
-
: config.policies?.redactScreenshots === true ? "blurred" : "raw";
|
|
1055
|
-
simulations.push({
|
|
1056
|
-
id: spec.simId,
|
|
1057
|
-
index: index + 1,
|
|
1058
|
-
personaId: spec.persona.id,
|
|
1059
|
-
scenarioId: `shared-world-${config.id}`,
|
|
1060
|
-
status,
|
|
1061
|
-
streamKind: "browser",
|
|
1062
|
-
mode: "browser-sim",
|
|
1063
|
-
progress: 100,
|
|
1064
|
-
currentStep: reason,
|
|
1065
|
-
summary: session
|
|
1066
|
-
? `Role ${spec.roleId} (${spec.persona.id}): session ended with ${session.completionReason}.`
|
|
1067
|
-
: outcome?.skippedReason !== undefined
|
|
1068
|
-
? `Role ${spec.roleId} ${outcome.skippedReason}.`
|
|
1069
|
-
: outcome?.sessionError
|
|
1070
|
-
? `Role ${spec.roleId} failed before a terminal session verdict: ${outcome.sessionError}`
|
|
1071
|
-
: `Contract role ${spec.roleId} (${spec.persona.id}) for ${descriptor.id} against the shared plane at ${appUrl}.`,
|
|
1072
|
-
streamIds: [spec.streamId],
|
|
1073
|
-
startedAt: createdAt,
|
|
1074
|
-
updatedAt: createdAt
|
|
1075
|
-
});
|
|
1076
|
-
streams.push({
|
|
1077
|
-
id: spec.streamId,
|
|
1078
|
-
simId: spec.simId,
|
|
1079
|
-
...(spec.assignment === undefined ? {} : { assignment: participantAssignment(spec.assignment) }),
|
|
1080
|
-
kind: "browser",
|
|
1081
|
-
label: `Shared-world role ${spec.roleId} — ${config.id}`,
|
|
1082
|
-
status,
|
|
1083
|
-
transport: "snapshot",
|
|
1084
|
-
updatedAt: createdAt,
|
|
1085
|
-
embed: lastScreenshot
|
|
1086
|
-
? { kind: "screenshot", url: lastScreenshot, title: `Shared desktop, role ${spec.roleId} (${screenshotMode})` }
|
|
1087
|
-
: { kind: "placeholder", title: `Shared desktop, role ${spec.roleId}` },
|
|
1088
|
-
...(desktopGeometry.viewport === undefined
|
|
1089
|
-
? {}
|
|
1090
|
-
: {
|
|
1091
|
-
viewport: {
|
|
1092
|
-
width: desktopGeometry.viewport.width,
|
|
1093
|
-
height: desktopGeometry.viewport.height,
|
|
1094
|
-
deviceScaleFactor: desktopGeometry.viewport.deviceScaleFactor,
|
|
1095
|
-
isMobile: args.sandboxPreset.isMobile
|
|
1096
|
-
}
|
|
1097
|
-
}),
|
|
1098
|
-
desktopGeometry,
|
|
1099
|
-
ui: {
|
|
1100
|
-
route: spec.seatUrl,
|
|
1101
|
-
intent: `Watch role ${spec.roleId} (${spec.persona.id}) drive the SHARED app (one plane; sequential turn).`,
|
|
1102
|
-
state: reason,
|
|
1103
|
-
...(session ? { actorStatus: session.status } : {}),
|
|
1104
|
-
...(lastScreenshot ? { screenshotUrl: lastScreenshot } : {})
|
|
1105
|
-
},
|
|
1106
|
-
...(session ? { actor: session.trace } : {}),
|
|
1107
|
-
artifacts: [
|
|
1108
|
-
{ label: "run bundle", path: "run.json", kind: "bundle" },
|
|
1109
|
-
{ label: "review", path: "review.md", kind: "review" },
|
|
1110
|
-
{ label: "events", path: "events.ndjson", kind: "events" },
|
|
1111
|
-
...(session
|
|
1112
|
-
? [{ label: `role ${spec.roleId} actor trace`, path: spec.traceArtifactPath, kind: "trace" }]
|
|
1113
|
-
: []),
|
|
1114
|
-
...screenshots.map((screenshot, screenshotIndex) => ({
|
|
1115
|
-
label: `role ${spec.roleId} screenshot ${String(screenshotIndex + 1).padStart(2, "0")} (${screenshotMode})`,
|
|
1116
|
-
path: screenshot,
|
|
1117
|
-
kind: "screenshot"
|
|
1118
|
-
}))
|
|
1119
|
-
]
|
|
1120
|
-
});
|
|
1121
|
-
// Per-role session event.
|
|
1122
|
-
if (session) {
|
|
1123
|
-
events.push({
|
|
1124
|
-
id: nextEventId(`session-${spec.roleId}`),
|
|
1125
|
-
at: createdAt,
|
|
1126
|
-
level: session.status === "passed" ? "info" : "warn",
|
|
1127
|
-
type: `shared-world.session.${session.completionReason}`,
|
|
1128
|
-
message: `Role ${spec.roleId}: ${session.status} — ${session.reason}`,
|
|
1129
|
-
simId: spec.simId,
|
|
1130
|
-
streamId: spec.streamId
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
else if (outcome?.skippedReason !== undefined) {
|
|
1134
|
-
events.push({
|
|
1135
|
-
id: nextEventId(`blocked-${spec.roleId}`),
|
|
1136
|
-
at: createdAt,
|
|
1137
|
-
level: "warn",
|
|
1138
|
-
type: "shared-world.session.blocked",
|
|
1139
|
-
message: `Role ${spec.roleId} ${outcome.skippedReason}.`,
|
|
1140
|
-
simId: spec.simId,
|
|
1141
|
-
streamId: spec.streamId
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
else if (outcome?.sessionError) {
|
|
1145
|
-
events.push({
|
|
1146
|
-
id: nextEventId(`session-error-${spec.roleId}`),
|
|
1147
|
-
at: createdAt,
|
|
1148
|
-
level: "error",
|
|
1149
|
-
type: "shared-world.session.error",
|
|
1150
|
-
message: `Role ${spec.roleId}: ${outcome.sessionError}`,
|
|
1151
|
-
simId: spec.simId,
|
|
1152
|
-
streamId: spec.streamId
|
|
1153
|
-
});
|
|
1154
|
-
}
|
|
1155
|
-
else {
|
|
1156
|
-
events.push({
|
|
1157
|
-
id: nextEventId(`contract-${spec.roleId}`),
|
|
1158
|
-
at: createdAt,
|
|
1159
|
-
level: "info",
|
|
1160
|
-
type: "shared-world.contract.ready",
|
|
1161
|
-
message: `Role ${spec.roleId}: dry-run contract role ready; switch scenario.mode to live for a real shared-world session.`,
|
|
1162
|
-
simId: spec.simId,
|
|
1163
|
-
streamId: spec.streamId
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
// A custom session can return a valid actor trace while orchestration fails (for example,
|
|
1167
|
-
// a capped model mismatch). Preserve the actor and record the wrapper failure separately.
|
|
1168
|
-
if (session && outcome?.sessionError) {
|
|
1169
|
-
events.push({
|
|
1170
|
-
id: nextEventId(`session-error-${spec.roleId}`), at: createdAt, level: "error",
|
|
1171
|
-
type: "shared-world.session.error", message: outcome.sessionError,
|
|
1172
|
-
simId: spec.simId, streamId: spec.streamId
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
|
-
for (const warning of desktopGeometry.warnings ?? []) {
|
|
1176
|
-
events.push({
|
|
1177
|
-
id: nextEventId(`geometry-warning-${spec.roleId}`),
|
|
1178
|
-
at: createdAt,
|
|
1179
|
-
level: "warn",
|
|
1180
|
-
type: "shared-world.geometry.warning",
|
|
1181
|
-
message: warning,
|
|
1182
|
-
simId: spec.simId,
|
|
1183
|
-
streamId: spec.streamId
|
|
1184
|
-
});
|
|
1185
|
-
}
|
|
1186
|
-
});
|
|
1187
|
-
// Build the shared-world evidence block (the timeline + plane + attribution ceiling).
|
|
1188
|
-
const seedDigest = args.seedDigest;
|
|
1189
|
-
const planeCommit = dryRun ? undefined : args.subjectCommit;
|
|
1190
|
-
const timeline = [args.baselineCheckpoint];
|
|
1191
|
-
const sequence = [];
|
|
1192
|
-
if (dryRun) {
|
|
1193
|
-
// Declared (contract) timeline: every role would take a turn; recipe-digest checkpoints, no delta.
|
|
1194
|
-
roleSpecs.forEach((spec) => {
|
|
1195
|
-
timeline.push({
|
|
1196
|
-
kind: "turn",
|
|
1197
|
-
roleId: spec.roleId,
|
|
1198
|
-
simId: spec.simId,
|
|
1199
|
-
streamId: spec.streamId,
|
|
1200
|
-
seedDigest
|
|
1201
|
-
});
|
|
1202
|
-
timeline.push(declaredCheckpointSnapshot(`cp-after-${spec.roleId}`, config.subject.state?.checkpoint ?? []));
|
|
1203
|
-
sequence.push(spec.roleId);
|
|
1204
|
-
});
|
|
1205
|
-
}
|
|
1206
|
-
else {
|
|
1207
|
-
// Executed timeline: only roles that took a turn (skipped roles contribute nothing).
|
|
1208
|
-
for (const outcome of roleOutcomes) {
|
|
1209
|
-
if (outcome.skippedReason !== undefined || outcome.afterCheckpoint === undefined) {
|
|
1210
|
-
continue;
|
|
1211
|
-
}
|
|
1212
|
-
timeline.push({
|
|
1213
|
-
kind: "turn",
|
|
1214
|
-
roleId: outcome.spec.roleId,
|
|
1215
|
-
simId: outcome.spec.simId,
|
|
1216
|
-
streamId: outcome.spec.streamId,
|
|
1217
|
-
...(planeCommit === undefined ? {} : { commit: planeCommit }),
|
|
1218
|
-
seedDigest
|
|
1219
|
-
});
|
|
1220
|
-
timeline.push(outcome.afterCheckpoint);
|
|
1221
|
-
sequence.push(outcome.spec.roleId);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
const sharedWorld = {
|
|
1225
|
-
schema: SHARED_WORLD_SCHEMA,
|
|
1226
|
-
topology: "shared-world",
|
|
1227
|
-
topologyMode: "sequential",
|
|
1228
|
-
roleCount: roleSpecs.length,
|
|
1229
|
-
plane: {
|
|
1230
|
-
...(planeCommit === undefined ? {} : { commit: planeCommit }),
|
|
1231
|
-
seedDigest,
|
|
1232
|
-
envNames: args.subject.envNames ?? []
|
|
1233
|
-
},
|
|
1234
|
-
sequence,
|
|
1235
|
-
timeline,
|
|
1236
|
-
attributionLimits: ["sequential-only", "no-concurrent-races", "delta-attributed-to-turn-not-action"]
|
|
1237
|
-
};
|
|
1238
|
-
const firstSkipped = roleOutcomes.findIndex(outcome => outcome.skippedReason !== undefined);
|
|
1239
|
-
const blocker = roleOutcomes[firstSkipped - 1];
|
|
1240
|
-
if (!dryRun && firstSkipped > 0 && blocker?.afterCheckpoint) {
|
|
1241
|
-
const actor = blocker.session?.trace;
|
|
1242
|
-
const cause = blocker.sessionError !== undefined ? "session_error"
|
|
1243
|
-
: actor?.interactionUsageIncomplete === true || actor?.debrief?.usageReported === false ? "usage_unreported"
|
|
1244
|
-
: blocker.harnessError ? "harness_error"
|
|
1245
|
-
: actor?.estimatedCost?.estimatedCostUsd === null ? "usage_unreported" : "study_spend_limit";
|
|
1246
|
-
sharedWorld.skippedTail = {
|
|
1247
|
-
afterRoleId: blocker.spec.roleId,
|
|
1248
|
-
roles: roleOutcomes.slice(firstSkipped).map(({ spec }) => ({
|
|
1249
|
-
roleId: spec.roleId, simId: spec.simId, streamId: spec.streamId
|
|
1250
|
-
})),
|
|
1251
|
-
cause,
|
|
1252
|
-
...(cause === "study_spend_limit" ? {
|
|
1253
|
-
maxTotalUsd: config.execution.caps.maxTotalUsd,
|
|
1254
|
-
estimatedTotalUsd: roleOutcomes.slice(0, firstSkipped)
|
|
1255
|
-
.reduce((total, outcome) => total + (outcome.session?.trace.estimatedCost?.estimatedCostUsd ?? 0), 0)
|
|
1256
|
-
} : {})
|
|
1257
|
-
};
|
|
1258
|
-
}
|
|
1259
|
-
events.push({
|
|
1260
|
-
id: nextEventId("timeline"),
|
|
1261
|
-
at: createdAt,
|
|
1262
|
-
level: "info",
|
|
1263
|
-
type: "shared-world.timeline",
|
|
1264
|
-
message: `Interaction timeline: ${timeline.length} entries (${sequence.length} turn(s) interleaved with checkpoints); deltas observed on ${timeline.filter((entry) => entry.kind === "checkpoint" && entry.deltaFromPrev).map((entry) => entry.name).join(", ") || "none"}. Attribution ceiling: ${sharedWorld.attributionLimits.join(", ")}.`
|
|
1265
|
-
});
|
|
1266
|
-
if (args.failFastReason) {
|
|
1267
|
-
events.push({
|
|
1268
|
-
id: nextEventId("fail-fast"),
|
|
1269
|
-
at: createdAt,
|
|
1270
|
-
level: "warn",
|
|
1271
|
-
type: "shared-world.fail-fast",
|
|
1272
|
-
message: `Fail-fast: ${args.failFastReason}. Remaining roles were blocked; completed evidence is retained.`
|
|
1273
|
-
});
|
|
1274
|
-
}
|
|
1275
|
-
// Worst-of review verdict across roles.
|
|
1276
|
-
const verdict = dryRun
|
|
1277
|
-
? "contract_proof_only"
|
|
1278
|
-
: (() => {
|
|
1279
|
-
const allPassed = roleOutcomes.length === roleSpecs.length
|
|
1280
|
-
&& roleOutcomes.every((outcome) => sharedWorldRoleOutcomeOk(outcome, false));
|
|
1281
|
-
if (allPassed)
|
|
1282
|
-
return "pass";
|
|
1283
|
-
const anyFail = roleOutcomes.some((outcome) => outcome.skippedReason !== undefined
|
|
1284
|
-
|| outcome.harnessError
|
|
1285
|
-
|| outcome.noEngagement
|
|
1286
|
-
|| outcome.sessionError !== undefined
|
|
1287
|
-
|| outcome.session === undefined
|
|
1288
|
-
|| outcome.session.status === "failed"
|
|
1289
|
-
|| outcome.session.status === "blocked");
|
|
1290
|
-
if (anyFail)
|
|
1291
|
-
return "fail";
|
|
1292
|
-
if (roleOutcomes.some((outcome) => outcome.session?.status === "timed_out"))
|
|
1293
|
-
return "timed_out";
|
|
1294
|
-
return "fail";
|
|
1295
|
-
})();
|
|
1296
|
-
const passedRoles = roleOutcomes.filter((outcome) => sharedWorldRoleOutcomeOk(outcome, dryRun)).length;
|
|
1297
|
-
const configuredBrowser = config.execution?.desktop?.browser;
|
|
1298
|
-
const resolvedBrowsers = roleOutcomes
|
|
1299
|
-
.map((outcome) => outcome.desktopBrowser?.resolved)
|
|
1300
|
-
.filter((value) => value !== undefined);
|
|
1301
|
-
const unanimousResolvedBrowser = resolvedBrowsers.length > 0 && new Set(resolvedBrowsers).size === 1
|
|
1302
|
-
? resolvedBrowsers[0]
|
|
1303
|
-
: undefined;
|
|
1304
|
-
const review = {
|
|
1305
|
-
schema: REVIEW_SCHEMA,
|
|
1306
|
-
verdict,
|
|
1307
|
-
summary: dryRun
|
|
1308
|
-
? `Dry-run shared-world contract: ${roleSpecs.length} role(s) declared against ONE plane (${descriptor.id}) at ${appUrl}; no desktop launched, $0 spend.`
|
|
1309
|
-
: `Shared-world run (ONE plane, sequential): ${passedRoles}/${roleSpecs.length} role(s) reached a terminal, engaged verdict; ${timeline.filter((entry) => entry.kind === "checkpoint" && entry.deltaFromPrev).length} checkpoint delta(s) observed.`,
|
|
1310
|
-
gaps: dryRun
|
|
1311
|
-
? ["Live shared-world session not yet run (dry-run contract only)."]
|
|
1312
|
-
: roleOutcomes
|
|
1313
|
-
.filter((outcome) => outcome.skippedReason !== undefined
|
|
1314
|
-
|| outcome.sessionError !== undefined
|
|
1315
|
-
|| outcome.noEngagement
|
|
1316
|
-
|| outcome.session === undefined
|
|
1317
|
-
|| outcome.session.status !== "passed")
|
|
1318
|
-
.map((outcome) => `${outcome.spec.roleId}: ${outcome.skippedReason ?? outcome.sessionError ?? outcome.session?.reason ?? "did not pass"}`)
|
|
1319
|
-
};
|
|
1320
|
-
const anyRaw = roleOutcomes.some((outcome) => outcome.session?.trace.redaction.screenshots === "raw");
|
|
1321
|
-
const ranLive = roleOutcomes.some((outcome) => outcome.session !== undefined || outcome.sessionError !== undefined);
|
|
1322
|
-
// Sequential studies now retain model estimates. Desktop resources/lifetime have no measured
|
|
1323
|
-
// cost on this route; include an unknown line so a model subtotal is never labeled a full total.
|
|
1324
|
-
const cost = buildCuaCostSummary({
|
|
1325
|
-
lanes: roleOutcomes.flatMap((outcome) => outcome.session
|
|
1326
|
-
? [{ laneId: outcome.spec.roleId, trace: outcome.session.trace }] : []),
|
|
1327
|
-
...(args.desktopAllocated ? { desktops: [{ minutes: undefined, observation: undefined,
|
|
1328
|
-
lifetimeComplete: args.desktopLifetimeComplete === true }] } : {})
|
|
1329
|
-
});
|
|
1330
|
-
return {
|
|
1331
|
-
schema: RUN_BUNDLE_SCHEMA,
|
|
1332
|
-
runId: args.runId,
|
|
1333
|
-
mode: dryRun ? "dry-run" : "live",
|
|
1334
|
-
simCount: roleSpecs.length,
|
|
1335
|
-
createdAt,
|
|
1336
|
-
cwd: PUBLIC_TARGET_CWD,
|
|
1337
|
-
...(args.lab === undefined ? {} : { lab: args.lab }),
|
|
1338
|
-
artifactRoot: path.join(".humanish", "runs", args.runId),
|
|
1339
|
-
source: args.source,
|
|
1340
|
-
persona: {
|
|
1341
|
-
id: roleSpecs[0]?.persona.id ?? "shared-world-role",
|
|
1342
|
-
name: `Shared-world roster (${roleSpecs.length} roles)`,
|
|
1343
|
-
source: `lab:${config.id}`,
|
|
1344
|
-
sourceDigest: roleSpecs[0]?.persona.promptDigest ?? seedDigest
|
|
1345
|
-
},
|
|
1346
|
-
scenario: {
|
|
1347
|
-
id: `shared-world-${config.id}`,
|
|
1348
|
-
title: config.title ?? `Shared-world: ${config.id}`,
|
|
1349
|
-
goal: redactText(roleSpecs[0]?.evidenceInstructions ?? roleSpecs[0]?.instructions ?? "Shared-world sequential interaction."),
|
|
1350
|
-
source: `lab:${config.id}`,
|
|
1351
|
-
sourceDigest: roleSpecs[0]?.persona.promptDigest ?? seedDigest
|
|
1352
|
-
},
|
|
1353
|
-
lifecycle: [
|
|
1354
|
-
{
|
|
1355
|
-
at: createdAt,
|
|
1356
|
-
event: "shared-world.run.created",
|
|
1357
|
-
message: `Created shared-world run with ONE shared plane and ${roleSpecs.length} sequential role seats (actor ${descriptor.id}).`
|
|
1358
|
-
}
|
|
1359
|
-
],
|
|
1360
|
-
simulations,
|
|
1361
|
-
streams,
|
|
1362
|
-
events,
|
|
1363
|
-
redaction: {
|
|
1364
|
-
status: "passed",
|
|
1365
|
-
notes: ranLive
|
|
1366
|
-
? anyRaw
|
|
1367
|
-
? "Typed text recorded as length only and reasoning/messages pass through text redaction. Some roles captured FULL-FIDELITY (raw) screenshots, retained for local use — NOT redacted for publishing; set policies.redactScreenshots: true to blur a share-as-is bundle. Checkpoints persist digest-only."
|
|
1368
|
-
: "Typed text recorded as length only and reasoning/messages pass through text redaction. Screenshots are blurred at capture (policies.redactScreenshots: true) for a share-as-is bundle. Checkpoints persist digest-only."
|
|
1369
|
-
: "Dry-run shared-world contract bundle: no desktop launched and no screenshots captured. Typed text is recorded as length only and reasoning/messages pass through text redaction whenever a session runs. Checkpoints persist digest-only."
|
|
1370
|
-
},
|
|
1371
|
-
artifacts: {
|
|
1372
|
-
run: "run.json",
|
|
1373
|
-
reviewJson: "review.json",
|
|
1374
|
-
reviewMarkdown: "review.md",
|
|
1375
|
-
observerData: "observer/observer-data.json",
|
|
1376
|
-
events: "events.ndjson"
|
|
1377
|
-
},
|
|
1378
|
-
review,
|
|
1379
|
-
...(cost === undefined ? {} : { cost }),
|
|
1380
|
-
feedbackCandidates: [],
|
|
1381
|
-
// Custom desktop image provenance (the ONE shared plane launched on it); omitted on the default.
|
|
1382
|
-
...(config.execution?.desktop?.template === undefined ? {} : { desktopTemplate: config.execution.desktop.template }),
|
|
1383
|
-
...(configuredBrowser === undefined
|
|
1384
|
-
? {}
|
|
1385
|
-
: { desktopBrowser: { requested: configuredBrowser, ...(unanimousResolvedBrowser === undefined ? {} : { resolved: unanimousResolvedBrowser }) } }),
|
|
1386
|
-
subject: args.subject,
|
|
1387
|
-
attributionClass: "shared-world",
|
|
1388
|
-
sharedWorld
|
|
1389
|
-
};
|
|
1390
|
-
}
|
|
1391
|
-
function sharedWorldRoleOutcomeOk(outcome, dryRun) {
|
|
1392
|
-
if (dryRun)
|
|
1393
|
-
return true;
|
|
1394
|
-
if (!outcome || outcome.skippedReason !== undefined)
|
|
1395
|
-
return false;
|
|
1396
|
-
return outcome.session !== undefined
|
|
1397
|
-
&& outcome.session.status === "passed"
|
|
1398
|
-
&& outcome.session.completionReason !== "harness_error"
|
|
1399
|
-
&& outcome.sessionError === undefined
|
|
1400
|
-
&& !outcome.noEngagement;
|
|
1401
|
-
}
|
|
1402
|
-
function renderSharedWorldReviewMarkdown(bundle) {
|
|
1403
|
-
const plane = bundle.events.find((event) => event.type === "shared-world.plane.provenance");
|
|
1404
|
-
const timeline = bundle.events.find((event) => event.type === "shared-world.timeline");
|
|
1405
|
-
return [
|
|
1406
|
-
`# ${bundle.scenario.title}`,
|
|
1407
|
-
"",
|
|
1408
|
-
`- run: ${bundle.runId}`,
|
|
1409
|
-
`- mode: ${bundle.mode}`,
|
|
1410
|
-
`- attribution class: ${bundle.attributionClass ?? "isolated"}`,
|
|
1411
|
-
`- topology: ${bundle.sharedWorld?.topology ?? "(none)"}`,
|
|
1412
|
-
`- roles: ${bundle.sharedWorld?.roleCount ?? 0}; sequence: ${(bundle.sharedWorld?.sequence ?? []).join(" → ") || "(none)"}`,
|
|
1413
|
-
`- verdict: ${bundle.review.verdict}`,
|
|
1414
|
-
`- summary: ${bundle.review.summary}`,
|
|
1415
|
-
...(plane ? [`- plane: ${plane.message}`] : []),
|
|
1416
|
-
...(timeline ? [`- timeline: ${timeline.message}`] : []),
|
|
1417
|
-
...(bundle.sharedWorld ? [`- attribution limits: ${bundle.sharedWorld.attributionLimits.join(", ")}`] : []),
|
|
1418
|
-
...(bundle.review.gaps.length > 0 ? ["", "## Gaps", ...bundle.review.gaps.map((gap) => `- ${gap}`)] : []),
|
|
1419
|
-
""
|
|
1420
|
-
].join("\n");
|
|
1421
|
-
}
|
|
1422
|
-
//# sourceMappingURL=shared-world-lab.js.map
|