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/observer.js
DELETED
|
@@ -1,947 +0,0 @@
|
|
|
1
|
-
import { listenOnLoopback } from "./listen.js";
|
|
2
|
-
import { execSync, spawn } from "node:child_process";
|
|
3
|
-
import { constants as fsConstants, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
import { lstat, open, realpath } from "node:fs/promises";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
-
import { buildObserverData, recordedStreamEmbed, withObserverEndings } from "./observer-data.js";
|
|
9
|
-
import { listRuns, loadRunBundlePrepared, verifyRunPrepared } from "./run.js";
|
|
10
|
-
import { bindExistingRunArtifactPaths, isPathInside, isSafeRunIdSegment, resolveLatestRunDirectory, validatePreparedRunArtifactPaths } from "./run-paths.js";
|
|
11
|
-
import { writeContainedOutputFile } from "./selected-output-paths.js";
|
|
12
|
-
import { buildArtifactSecurityHeaders, buildServeSecurityHeaders, hostAllowed, parsePublicOrigin } from "./serve-http.js";
|
|
13
|
-
import { isRunStatusRecord, RUN_STATUS_FILE, RUN_STATUS_STALE_MS } from "./run-status.js";
|
|
14
|
-
import { loadStudyAnalysis } from "./study-analysis-store.js";
|
|
15
|
-
import { isStudyAnalysisRecordPath, projectShareCheckedAnalysis, studyAnalysisSharingProblems } from "./study-analysis-sharing.js";
|
|
16
|
-
export const OBSERVER_SCHEMA = "humanish.observer-result.v1";
|
|
17
|
-
const observerRuntimeStreamUrls = new WeakMap();
|
|
18
|
-
const observerPreparedRunPaths = new WeakMap();
|
|
19
|
-
export function attachObserverRuntimeStreamUrls(result, streams) {
|
|
20
|
-
observerRuntimeStreamUrls.set(result, streams.filter((stream) => stream.streamId && stream.url));
|
|
21
|
-
}
|
|
22
|
-
export async function renderObserver(cwdInput, runInput, options = {}) {
|
|
23
|
-
const cwd = path.resolve(cwdInput);
|
|
24
|
-
let selection;
|
|
25
|
-
try {
|
|
26
|
-
if (options.expectedRun) {
|
|
27
|
-
const prepared = options.expectedRun;
|
|
28
|
-
if (runInput !== path.basename(prepared.physicalRunRoot)
|
|
29
|
-
|| await realpath(cwd) !== path.dirname(path.dirname(prepared.physicalRunsRoot))) {
|
|
30
|
-
throw new Error("Observer source pin does not match the selected run.");
|
|
31
|
-
}
|
|
32
|
-
await validatePreparedRunArtifactPaths(prepared);
|
|
33
|
-
selection = { runId: runInput,
|
|
34
|
-
runRoot: { ...prepared.runRootIdentity, physicalPath: prepared.physicalRunRoot },
|
|
35
|
-
runsRoot: { ...prepared.runsRootIdentity, physicalPath: prepared.physicalRunsRoot } };
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
selection = await resolveObserverRunSelection(cwd, runInput);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
selection = null;
|
|
43
|
-
}
|
|
44
|
-
if (!selection) {
|
|
45
|
-
return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", `Run not found: ${runInput}`);
|
|
46
|
-
}
|
|
47
|
-
let preparedRunPaths;
|
|
48
|
-
try {
|
|
49
|
-
const selectedPhysicalCwd = path.dirname(path.dirname(selection.runsRoot.physicalPath));
|
|
50
|
-
preparedRunPaths = options.expectedRun ?? await bindExistingRunArtifactPaths(selectedPhysicalCwd, selection.runId);
|
|
51
|
-
if (preparedRunPaths.physicalRunsRoot !== selection.runsRoot.physicalPath
|
|
52
|
-
|| preparedRunPaths.physicalRunRoot !== selection.runRoot.physicalPath
|
|
53
|
-
|| preparedRunPaths.runsRootIdentity.birthtimeNs !== selection.runsRoot.birthtimeNs
|
|
54
|
-
|| preparedRunPaths.runsRootIdentity.dev !== selection.runsRoot.dev
|
|
55
|
-
|| preparedRunPaths.runsRootIdentity.ino !== selection.runsRoot.ino
|
|
56
|
-
|| preparedRunPaths.runRootIdentity.birthtimeNs !== selection.runRoot.birthtimeNs
|
|
57
|
-
|| preparedRunPaths.runRootIdentity.dev !== selection.runRoot.dev
|
|
58
|
-
|| preparedRunPaths.runRootIdentity.ino !== selection.runRoot.ino) {
|
|
59
|
-
throw new Error("Observer run selection changed physical identity.");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
return observerRunError(cwd, runInput, "HUMANISH_INVALID_RUN_BUNDLE", "Observer run storage is unavailable or unsafe.");
|
|
64
|
-
}
|
|
65
|
-
await validatePreparedRunArtifactPaths(preparedRunPaths);
|
|
66
|
-
const selectedPhysicalCwd = path.dirname(path.dirname(selection.runsRoot.physicalPath));
|
|
67
|
-
const verified = await verifyRunPrepared(selectedPhysicalCwd, selection.runId, preparedRunPaths);
|
|
68
|
-
await validatePreparedRunArtifactPaths(preparedRunPaths);
|
|
69
|
-
if (!verified.ok && verified.recordingOk !== true) {
|
|
70
|
-
return observerRunError(cwd, runInput, verified.error?.code === "HUMANISH_RUN_NOT_FOUND" ? "HUMANISH_RUN_NOT_FOUND" : "HUMANISH_INVALID_RUN_BUNDLE", verified.error?.message ?? "Run bundle failed verification.");
|
|
71
|
-
}
|
|
72
|
-
const loaded = await loadRunBundlePrepared(selectedPhysicalCwd, preparedRunPaths);
|
|
73
|
-
await validatePreparedRunArtifactPaths(preparedRunPaths);
|
|
74
|
-
if (!loaded) {
|
|
75
|
-
return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", `Run not found: ${runInput}`);
|
|
76
|
-
}
|
|
77
|
-
if (loaded.bundle.runId !== selection.runId
|
|
78
|
-
|| await realpath(loaded.runDir) !== preparedRunPaths.physicalRunRoot) {
|
|
79
|
-
throw new Error("Observer output directory does not match the selected run.");
|
|
80
|
-
}
|
|
81
|
-
const observerPath = path.join(preparedRunPaths.physicalRunRoot, "observer", "index.html");
|
|
82
|
-
const analysis = projectShareCheckedAnalysis(await loadStudyAnalysis(preparedRunPaths));
|
|
83
|
-
const observerData = buildObserverData(loaded.bundle);
|
|
84
|
-
observerData.publicSafety.share = {
|
|
85
|
-
status: verified.shareSafety.status,
|
|
86
|
-
verifiedAt: new Date().toISOString(),
|
|
87
|
-
reasons: verified.shareSafety.reasons.map((reason) => reason.code)
|
|
88
|
-
};
|
|
89
|
-
await writeContainedOutputFile(preparedRunPaths, path.join("observer", "observer-data.json"), `${JSON.stringify(observerData, null, 2)}\n`, "utf8");
|
|
90
|
-
await writeContainedOutputFile(preparedRunPaths, path.join("observer", "study-analysis.json"), `${JSON.stringify(analysis, null, 2)}\n`, "utf8");
|
|
91
|
-
await writeContainedOutputFile(preparedRunPaths, path.join("observer", "index.html"), renderObserverHtml(observerData, { analysis }), "utf8");
|
|
92
|
-
await validatePreparedRunArtifactPaths(preparedRunPaths);
|
|
93
|
-
const relativeObserverPath = path.join(preparedRunPaths.relativeRunRoot, "observer", "index.html");
|
|
94
|
-
const relativeObserverDataPath = path.join(preparedRunPaths.relativeRunRoot, "observer", "observer-data.json");
|
|
95
|
-
const relativeEventsPath = path.join(preparedRunPaths.relativeRunRoot, "events.ndjson");
|
|
96
|
-
const observerUrl = pathToFileURL(observerPath).href;
|
|
97
|
-
const openResult = options.open === true ? openTarget(observerPath) : { opened: false };
|
|
98
|
-
const result = {
|
|
99
|
-
schema: OBSERVER_SCHEMA,
|
|
100
|
-
ok: true,
|
|
101
|
-
cwd,
|
|
102
|
-
run: loaded.bundle.runId,
|
|
103
|
-
observerPath: relativeObserverPath,
|
|
104
|
-
observerDataPath: relativeObserverDataPath,
|
|
105
|
-
eventsPath: relativeEventsPath,
|
|
106
|
-
observerUrl,
|
|
107
|
-
bundlePath: loaded.bundlePath,
|
|
108
|
-
opened: openResult.opened,
|
|
109
|
-
...(openResult.command ? { openCommand: openResult.command } : {}),
|
|
110
|
-
warnings: [
|
|
111
|
-
loaded.bundle.mode === "live"
|
|
112
|
-
? "Observer renders verified local evidence artifacts; runtime stream auth URLs are not persisted."
|
|
113
|
-
: "Observer renders local contract evidence only; dry-run lanes do not claim product behavior proof.",
|
|
114
|
-
"Before filing public feedback, use `humanish feedback issue` so redaction and public-safety checks gate the payload.",
|
|
115
|
-
...(openResult.warning ? [openResult.warning] : [])
|
|
116
|
-
]
|
|
117
|
-
};
|
|
118
|
-
observerPreparedRunPaths.set(result, preparedRunPaths);
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
function observerRunError(cwd, run, code, message) {
|
|
122
|
-
return {
|
|
123
|
-
schema: OBSERVER_SCHEMA,
|
|
124
|
-
ok: false,
|
|
125
|
-
cwd,
|
|
126
|
-
run,
|
|
127
|
-
warnings: [],
|
|
128
|
-
error: { code, message }
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
async function resolveObserverRunSelection(cwd, runInput) {
|
|
132
|
-
const runsRoot = await pinDirectory(path.join(cwd, ".humanish", "runs"));
|
|
133
|
-
if (runInput !== "latest") {
|
|
134
|
-
const runRoot = isSafeRunIdSegment(runInput)
|
|
135
|
-
? await pinDirectChildDirectory(runsRoot, runInput)
|
|
136
|
-
: null;
|
|
137
|
-
return runRoot ? { runId: runInput, runRoot, runsRoot } : null;
|
|
138
|
-
}
|
|
139
|
-
const latestBytes = await readContainedFile(runsRoot, path.join(runsRoot.physicalPath, "latest.json"));
|
|
140
|
-
if (!latestBytes)
|
|
141
|
-
return null;
|
|
142
|
-
const pointer = JSON.parse(latestBytes.toString("utf8"));
|
|
143
|
-
if (typeof pointer.runId !== "string" || typeof pointer.path !== "string" || !isSafeRunIdSegment(pointer.runId)) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
const declared = resolveLatestRunDirectory(cwd, { path: pointer.path, runId: pointer.runId });
|
|
147
|
-
if (!declared)
|
|
148
|
-
return null;
|
|
149
|
-
const expected = path.join(runsRoot.physicalPath, pointer.runId);
|
|
150
|
-
const runRoot = await pinDirectChildDirectory(runsRoot, pointer.runId);
|
|
151
|
-
if (!runRoot || runRoot.physicalPath !== expected)
|
|
152
|
-
return null;
|
|
153
|
-
return { runId: pointer.runId, runRoot, runsRoot };
|
|
154
|
-
}
|
|
155
|
-
export async function serveObserver(result, options = {}) {
|
|
156
|
-
if (!result.ok || !result.observerPath) {
|
|
157
|
-
throw new Error("Cannot serve an observer result that did not render successfully.");
|
|
158
|
-
}
|
|
159
|
-
const cwd = path.resolve(result.cwd);
|
|
160
|
-
const retainedRunPaths = observerPreparedRunPaths.get(result);
|
|
161
|
-
const preparedRunPaths = retainedRunPaths
|
|
162
|
-
? await validatePreparedRunArtifactPaths(retainedRunPaths)
|
|
163
|
-
: await bindExistingRunArtifactPaths(cwd, result.run);
|
|
164
|
-
const runRoot = await pinDirectory(preparedRunPaths.physicalRunRoot);
|
|
165
|
-
const proofRoot = await pinDirectory(preparedRunPaths.physicalRunsRoot);
|
|
166
|
-
const expectedRelativeObserverPath = path.join(preparedRunPaths.relativeRunRoot, "observer", "index.html");
|
|
167
|
-
if (result.observerPath !== expectedRelativeObserverPath) {
|
|
168
|
-
throw new Error("Observer path does not match the selected run.");
|
|
169
|
-
}
|
|
170
|
-
// The live server renders observer/index.html from the pinned run bundle on
|
|
171
|
-
// each request, so an attached in-progress Observer legitimately has no
|
|
172
|
-
// static index file yet. The exact lexical result path was checked above;
|
|
173
|
-
// keep serving from the identity-bound physical run root.
|
|
174
|
-
const observerPath = path.join(preparedRunPaths.physicalRunRoot, "observer", "index.html");
|
|
175
|
-
if (observerPath !== path.join(runRoot.physicalPath, "observer", "index.html")) {
|
|
176
|
-
throw new Error("Observer path does not match the selected run.");
|
|
177
|
-
}
|
|
178
|
-
const runtimeStreamUrls = () => observerRuntimeStreamUrls.get(result) ?? [];
|
|
179
|
-
const exposed = options.exposed === true;
|
|
180
|
-
const scopedToRun = exposed || options.scope === "run";
|
|
181
|
-
// Host allowlist for exposed mode (DNS-rebinding defense, identical to the run-library surface).
|
|
182
|
-
// Seeded with the loopback names after bind; addPublicOrigin extends it with the tunnel/public-url
|
|
183
|
-
// host. Never consulted in loopback (non-exposed) mode.
|
|
184
|
-
const hostAllowlist = new Set();
|
|
185
|
-
const server = createServer(async (request, response) => {
|
|
186
|
-
try {
|
|
187
|
-
// Every response, including run HTML artifacts, must refuse framing. A provider iframe
|
|
188
|
-
// with its own origin intact must not navigate back here and gain the Observer's origin.
|
|
189
|
-
for (const [name, value] of Object.entries(buildServeSecurityHeaders())) {
|
|
190
|
-
response.setHeader(name, value);
|
|
191
|
-
}
|
|
192
|
-
if (exposed) {
|
|
193
|
-
if (!hostAllowed(request.headers.host, hostAllowlist)) {
|
|
194
|
-
writeResponse(response, 421, "Misdirected Request", "text/plain; charset=utf-8");
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
const url = new URL(request.url ?? "/", `http://${request.headers.host ?? "127.0.0.1"}`);
|
|
199
|
-
if (url.pathname === "/") {
|
|
200
|
-
response.writeHead(302, { location: "/observer/index.html" });
|
|
201
|
-
response.end();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
if (url.pathname === "/_humanish/history.json") {
|
|
205
|
-
const history = await buildHistoryIndex(proofRoot);
|
|
206
|
-
// Exposed watch and selected-run viewers cannot enumerate other runs. Full-library
|
|
207
|
-
// loopback viewers retain the complete project index.
|
|
208
|
-
if (scopedToRun) {
|
|
209
|
-
const attachedRuns = history.runs.filter((entry) => entry.runId === result.run);
|
|
210
|
-
writeResponse(response, 200, JSON.stringify({ latestRunId: attachedRuns.length > 0 ? result.run : null, runs: attachedRuns }, null, 2), "application/json; charset=utf-8");
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
writeResponse(response, 200, JSON.stringify(history, null, 2), "application/json; charset=utf-8");
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (url.pathname.startsWith("/_humanish/runs/")) {
|
|
217
|
-
const runRoute = matchRunRoute(url.pathname);
|
|
218
|
-
if (!runRoute) {
|
|
219
|
-
writeResponse(response, 404, "Run not found", "text/plain; charset=utf-8");
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
// Scoped viewers cannot distinguish another run from a nonexistent one.
|
|
223
|
-
if (scopedToRun && runRoute.runId !== result.run) {
|
|
224
|
-
writeResponse(response, 404, "Run not found", "text/plain; charset=utf-8");
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
const targetRoot = await pinDirectChildDirectory(proofRoot, runRoute.runId);
|
|
228
|
-
if (!targetRoot) {
|
|
229
|
-
writeResponse(response, 404, "Run not found", "text/plain; charset=utf-8");
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
await serveRunPath(targetRoot, runRoute.relativePath || "observer/index.html", response, runRoute.runId === result.run ? runtimeStreamUrls() : [], request);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
await serveRunPath(runRoot, decodeURIComponent(url.pathname.slice(1)), response, runtimeStreamUrls(), request);
|
|
236
|
-
}
|
|
237
|
-
catch {
|
|
238
|
-
writeResponse(response, 500, "Observer request failed", "text/plain; charset=utf-8");
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
const port = await listenOnLoopback(server, options.port ?? 0);
|
|
242
|
-
if (exposed) {
|
|
243
|
-
hostAllowlist.add(`127.0.0.1:${port}`);
|
|
244
|
-
hostAllowlist.add(`localhost:${port}`);
|
|
245
|
-
hostAllowlist.add(`[::1]:${port}`);
|
|
246
|
-
}
|
|
247
|
-
const url = `http://127.0.0.1:${port}/observer/index.html`;
|
|
248
|
-
const openResult = options.open === true ? openTarget(url) : { opened: false };
|
|
249
|
-
return {
|
|
250
|
-
url,
|
|
251
|
-
port,
|
|
252
|
-
opened: openResult.opened,
|
|
253
|
-
...(openResult.command ? { openCommand: openResult.command } : {}),
|
|
254
|
-
...(openResult.warning ? { warning: openResult.warning } : {}),
|
|
255
|
-
// A tunnel's public origin is only known after it starts (post bind). Declaring it here extends
|
|
256
|
-
// the Host allowlist so the authenticated edge is admitted; a no-op in loopback mode (the
|
|
257
|
-
// allowlist is never consulted) and for an unparseable origin.
|
|
258
|
-
addPublicOrigin(origin) {
|
|
259
|
-
if (!exposed) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const parsed = parsePublicOrigin(origin);
|
|
263
|
-
if (parsed) {
|
|
264
|
-
hostAllowlist.add(parsed.host);
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
close: () => closeServer(server)
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
// ---- The Observer (#426): a prebuilt self-contained single-file app (observer/ workspace) ----
|
|
271
|
-
// carrying one JSON slot; rendering a run = injecting its snapshot (observer/scripts/inject.ts
|
|
272
|
-
// is the reference implementation this mirrors). The seam lives here because every surface —
|
|
273
|
-
// observe, watch, serve, and the lab call sites — funnels through renderObserverHtml. The
|
|
274
|
-
// legacy string-concat renderer was deleted at cutover (2026-08-16); rollback is a version pin.
|
|
275
|
-
const OBSERVER_DATA_PLACEHOLDER = "__HUMANISH_OBSERVER_DATA__";
|
|
276
|
-
const OBSERVER_DATA_SLOT = `<script id="observer-data" type="application/json">${OBSERVER_DATA_PLACEHOLDER}</script>`;
|
|
277
|
-
let cachedObserverArtifact = null;
|
|
278
|
-
/**
|
|
279
|
-
* Resolve — and in a repo checkout, build — the Observer artifact BEFORE any run or
|
|
280
|
-
* lab work starts. A missing artifact must cost seconds at startup, never a completed
|
|
281
|
-
* session (a live lane spends real money before the render step would have noticed).
|
|
282
|
-
* Unconditional on purpose: the artifact is the only renderer now, so the fail-before-
|
|
283
|
-
* spend property this preflight bought under the flag matters more, not less.
|
|
284
|
-
*/
|
|
285
|
-
export function preflightObserverArtifact() {
|
|
286
|
-
loadObserverArtifact();
|
|
287
|
-
}
|
|
288
|
-
function loadObserverArtifact() {
|
|
289
|
-
if (cachedObserverArtifact !== null)
|
|
290
|
-
return cachedObserverArtifact;
|
|
291
|
-
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
292
|
-
// Published package: the root build ships the artifact beside this module. Never
|
|
293
|
-
// auto-built — an installed package either carries it or is broken; reinstall.
|
|
294
|
-
const packagedHtml = readObserverArtifact(path.join(moduleDir, "observer-app.html"));
|
|
295
|
-
if (packagedHtml !== null) {
|
|
296
|
-
cachedObserverArtifact = packagedHtml;
|
|
297
|
-
return packagedHtml;
|
|
298
|
-
}
|
|
299
|
-
// Repo checkout (src/ and dist/ both sit one level under the root): build the
|
|
300
|
-
// workspace on demand — missing after a fresh pull, stale after edits — so the
|
|
301
|
-
// flag just works in the dev loop instead of demanding a manual build step.
|
|
302
|
-
const repoRoot = path.join(moduleDir, "..");
|
|
303
|
-
const workspaceDir = path.join(repoRoot, "observer");
|
|
304
|
-
const artifactPath = path.join(workspaceDir, "dist", "index.html");
|
|
305
|
-
if (existsSync(path.join(workspaceDir, "package.json"))) {
|
|
306
|
-
if (observerArtifactNeedsBuild(workspaceDir, artifactPath)) {
|
|
307
|
-
// Concurrent cold starts (parallel test workers, two watch processes launched
|
|
308
|
-
// together) must not race one `vite build` output: a reader can catch the
|
|
309
|
-
// artifact half-written. A mkdir lock serializes builders across processes;
|
|
310
|
-
// whoever loses the race re-checks staleness and usually just reads.
|
|
311
|
-
// The lock lives OUTSIDE dist/ (vite empties dist mid-build) and inside an
|
|
312
|
-
// ignored path so a crashed builder cannot dirty the tree.
|
|
313
|
-
const lockDir = path.join(workspaceDir, "node_modules", ".observer-build-lock");
|
|
314
|
-
mkdirSync(path.dirname(lockDir), { recursive: true });
|
|
315
|
-
const deadline = Date.now() + 120_000;
|
|
316
|
-
for (;;) {
|
|
317
|
-
try {
|
|
318
|
-
mkdirSync(lockDir);
|
|
319
|
-
break; // lock acquired — this process builds
|
|
320
|
-
}
|
|
321
|
-
catch {
|
|
322
|
-
if (Date.now() > deadline)
|
|
323
|
-
break; // stale lock: build anyway, last writer wins
|
|
324
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 200);
|
|
325
|
-
if (!observerArtifactNeedsBuild(workspaceDir, artifactPath)) {
|
|
326
|
-
const built = readObserverArtifact(artifactPath);
|
|
327
|
-
if (built !== null) {
|
|
328
|
-
cachedObserverArtifact = built;
|
|
329
|
-
return built;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
try {
|
|
335
|
-
if (observerArtifactNeedsBuild(workspaceDir, artifactPath)) {
|
|
336
|
-
process.stderr.write("observer: building the Observer artifact (observer/ workspace)…\n");
|
|
337
|
-
try {
|
|
338
|
-
// NODE_ENV is forced: Vite respects a preset NODE_ENV (test, development),
|
|
339
|
-
// and a dev-flavored artifact embeds jsxDEV plus the builder's absolute
|
|
340
|
-
// filesystem paths — which the run's public-safety scan then rightly rejects.
|
|
341
|
-
execSync("pnpm --filter humanish-observer build", {
|
|
342
|
-
cwd: repoRoot,
|
|
343
|
-
stdio: ["ignore", "pipe", "inherit"],
|
|
344
|
-
env: { ...process.env, NODE_ENV: "production" }
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
catch {
|
|
348
|
-
throw new Error("observer workspace build failed — run `pnpm --filter humanish-observer build` for the full output.");
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
finally {
|
|
353
|
-
rmSync(lockDir, { force: true, recursive: true });
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
const html = readObserverArtifact(artifactPath);
|
|
357
|
-
if (html !== null) {
|
|
358
|
-
cachedObserverArtifact = html;
|
|
359
|
-
return html;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
throw new Error("the Observer needs its prebuilt artifact (dist/observer-app.html in the package, observer/dist/index.html in a repo checkout); run `pnpm --filter humanish-observer build`, or reinstall the package.");
|
|
363
|
-
}
|
|
364
|
-
function readObserverArtifact(candidate) {
|
|
365
|
-
let html;
|
|
366
|
-
try {
|
|
367
|
-
html = readFileSync(candidate, "utf8");
|
|
368
|
-
}
|
|
369
|
-
catch (error) {
|
|
370
|
-
if (error.code === "ENOENT")
|
|
371
|
-
return null;
|
|
372
|
-
throw error;
|
|
373
|
-
}
|
|
374
|
-
if (!html.includes(OBSERVER_DATA_SLOT)) {
|
|
375
|
-
throw new Error(`Observer artifact at ${candidate} has no observer-data slot.`);
|
|
376
|
-
}
|
|
377
|
-
return html;
|
|
378
|
-
}
|
|
379
|
-
/** internal: exported for tests. Missing artifact, or any workspace source newer than it. */
|
|
380
|
-
export function observerArtifactNeedsBuild(workspaceDir, artifactPath) {
|
|
381
|
-
let artifactMtime;
|
|
382
|
-
try {
|
|
383
|
-
artifactMtime = statSync(artifactPath).mtimeMs;
|
|
384
|
-
}
|
|
385
|
-
catch {
|
|
386
|
-
return true;
|
|
387
|
-
}
|
|
388
|
-
return newestSourceMtime(workspaceDir) > artifactMtime;
|
|
389
|
-
}
|
|
390
|
-
function newestSourceMtime(dir) {
|
|
391
|
-
let newest = 0;
|
|
392
|
-
let entries;
|
|
393
|
-
try {
|
|
394
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
395
|
-
}
|
|
396
|
-
catch {
|
|
397
|
-
return newest;
|
|
398
|
-
}
|
|
399
|
-
for (const entry of entries) {
|
|
400
|
-
if (entry.name === "node_modules" || entry.name === "dist")
|
|
401
|
-
continue;
|
|
402
|
-
const full = path.join(dir, entry.name);
|
|
403
|
-
if (entry.isDirectory()) {
|
|
404
|
-
newest = Math.max(newest, newestSourceMtime(full));
|
|
405
|
-
}
|
|
406
|
-
else if (entry.isFile()) {
|
|
407
|
-
try {
|
|
408
|
-
newest = Math.max(newest, statSync(full).mtimeMs);
|
|
409
|
-
}
|
|
410
|
-
catch {
|
|
411
|
-
// A file vanishing mid-scan (editor save) just doesn't advance the clock.
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
return newest;
|
|
416
|
-
}
|
|
417
|
-
function renderExportAssets(assets) {
|
|
418
|
-
return Object.entries(assets).map(([hash, image]) => {
|
|
419
|
-
if (!/^[a-f0-9]{64}$/.test(hash) || !/^image\/(png|jpeg|gif|webp)$/.test(image.mime)
|
|
420
|
-
|| !/^[A-Za-z0-9+/]+={0,2}$/.test(image.base64))
|
|
421
|
-
throw new Error("Invalid portable raster");
|
|
422
|
-
return `<script id="humanish-image-${hash}" type="application/octet-stream" data-mime="${image.mime}">${image.base64}</script>`;
|
|
423
|
-
}).join("");
|
|
424
|
-
}
|
|
425
|
-
function renderObserverAppHtml(data, snapshot, analysis, assets) {
|
|
426
|
-
const artifact = loadObserverArtifact();
|
|
427
|
-
// A renderer-owned boot marker, outside the untrusted run-data contract. Only
|
|
428
|
-
// portable HTML exports opt out of a live feed; ordinary served pages still poll.
|
|
429
|
-
return (snapshot ? artifact.replace("</head>", '<meta name="humanish-observer-mode" content="snapshot"></head>') : artifact)
|
|
430
|
-
.replace(OBSERVER_DATA_SLOT, () => `<script id="observer-data" type="application/json">${escapeJsonScript(data)}</script>`)
|
|
431
|
-
.replace(/<script id="study-analysis" type="application\/json">[\s\S]*?<\/script>/, () => `<script id="study-analysis" type="application/json">${escapeJsonScript(analysis)}</script>`)
|
|
432
|
-
.replace("</body>", () => `${renderExportAssets(assets)}</body>`)
|
|
433
|
-
.replace(/<title>[^<]*<\/title>/, () => `<title>Humanish Observer — ${escapeHtml(data.run.runId)}</title>`);
|
|
434
|
-
}
|
|
435
|
-
/** Render current packaged UI around a validated/projected Observer snapshot. */
|
|
436
|
-
export function renderObserverHtml(data, options = {}) {
|
|
437
|
-
let analysis = options.analysis ?? { state: "none", analysis: null, corrections: [], warnings: [] };
|
|
438
|
-
// A portable snapshot cannot claim that a writer on another machine is still active.
|
|
439
|
-
if (options.snapshot === true && analysis.automatic && ["queued", "running"].includes(analysis.automatic.state)) {
|
|
440
|
-
analysis = { ...analysis, automatic: { ...analysis.automatic, state: "unknown", reason: "AUTOMATIC_ANALYSIS_OUTCOME_UNKNOWN" } };
|
|
441
|
-
}
|
|
442
|
-
const sharing = studyAnalysisSharingProblems(analysis);
|
|
443
|
-
if (data.publicSafety && (sharing.sensitive || sharing.unverified)) {
|
|
444
|
-
const share = data.publicSafety.share;
|
|
445
|
-
data = { ...data, publicSafety: { ...data.publicSafety, share: {
|
|
446
|
-
status: sharing.sensitive || share?.status === "blocked" ? "blocked" : "local_only",
|
|
447
|
-
verifiedAt: share?.verifiedAt ?? new Date().toISOString(),
|
|
448
|
-
reasons: [...new Set([...(share?.reasons ?? []), "ANALYSIS_UNVERIFIED"])]
|
|
449
|
-
} } };
|
|
450
|
-
}
|
|
451
|
-
return renderObserverAppHtml(withObserverEndings(data), options.snapshot === true, projectShareCheckedAnalysis(analysis), options.assets ?? {});
|
|
452
|
-
}
|
|
453
|
-
/** Analysis cannot grant filesystem authority or make an otherwise readable recording disappear. */
|
|
454
|
-
async function readObserverAnalysis(runRoot) {
|
|
455
|
-
try {
|
|
456
|
-
const runId = path.basename(runRoot.physicalPath);
|
|
457
|
-
const cwd = path.dirname(path.dirname(path.dirname(runRoot.physicalPath)));
|
|
458
|
-
const prepared = await bindExistingRunArtifactPaths(cwd, runId);
|
|
459
|
-
if (prepared.physicalRunRoot !== runRoot.physicalPath
|
|
460
|
-
|| prepared.runRootIdentity.birthtimeNs !== runRoot.birthtimeNs
|
|
461
|
-
|| prepared.runRootIdentity.dev !== runRoot.dev || prepared.runRootIdentity.ino !== runRoot.ino) {
|
|
462
|
-
throw new Error("ANALYSIS_STORAGE_CHANGED");
|
|
463
|
-
}
|
|
464
|
-
return projectShareCheckedAnalysis(await loadStudyAnalysis(prepared));
|
|
465
|
-
}
|
|
466
|
-
catch {
|
|
467
|
-
return { state: "invalid", analysis: null, corrections: [], warnings: ["Analysis could not be validated against this recording."] };
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
/** internal: consumed by observer-serve */
|
|
471
|
-
export async function serveRunPath(runRoot, relativePath, response, runtimeStreamUrls = [], request) {
|
|
472
|
-
const root = runRoot.physicalPath;
|
|
473
|
-
const filePath = path.resolve(root, relativePath === "" ? "observer/index.html" : relativePath);
|
|
474
|
-
if (!isPathInside(root, filePath)) {
|
|
475
|
-
writeResponse(response, 403, "Forbidden", "text/plain; charset=utf-8");
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
// Alias spellings such as observer//observer-data.json must use the same projection,
|
|
479
|
-
// not fall through to a raw persisted file and inherit a forged runtime grant.
|
|
480
|
-
const cleanedRelativePath = path.relative(root, filePath).split(path.sep).join("/");
|
|
481
|
-
// Derived records have a validated projection endpoint below. Never let generic
|
|
482
|
-
// file serving bypass its current-content checks or a warmed source-only admission cache.
|
|
483
|
-
const derivedRoot = cleanedRelativePath.split("/")[0];
|
|
484
|
-
const derivedLeaf = path.posix.basename(cleanedRelativePath);
|
|
485
|
-
if (derivedRoot === ".analysis-lock"
|
|
486
|
-
|| derivedLeaf.startsWith(".humanish-write-")
|
|
487
|
-
|| isStudyAnalysisRecordPath(cleanedRelativePath)) {
|
|
488
|
-
writeResponse(response, 404, "Not found", "text/plain; charset=utf-8");
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
if (cleanedRelativePath === "observer/index.html") {
|
|
492
|
-
const observerData = await readObserverData(runRoot, runtimeStreamUrls);
|
|
493
|
-
if (!observerData) {
|
|
494
|
-
writeResponse(response, 404, "Observer data not found", "text/plain; charset=utf-8");
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
const analysis = await readObserverAnalysis(runRoot);
|
|
498
|
-
writeResponse(response, 200, renderObserverHtml(observerData, { analysis }), "text/html; charset=utf-8");
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
if (cleanedRelativePath === "observer/observer-data.json") {
|
|
502
|
-
const observerData = await readObserverData(runRoot, runtimeStreamUrls);
|
|
503
|
-
if (!observerData) {
|
|
504
|
-
writeResponse(response, 404, "Observer data not found", "text/plain; charset=utf-8");
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
writeResponse(response, 200, JSON.stringify(observerData, null, 2), "application/json; charset=utf-8");
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
if (cleanedRelativePath === "observer/study-analysis.json") {
|
|
511
|
-
writeResponse(response, 200, JSON.stringify(await readObserverAnalysis(runRoot)), "application/json; charset=utf-8");
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
if (path.extname(filePath).toLowerCase() === ".mp4") {
|
|
515
|
-
await serveContainedMedia(runRoot, filePath, response, request);
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
try {
|
|
519
|
-
const body = await readContainedFile(runRoot, filePath);
|
|
520
|
-
if (!body) {
|
|
521
|
-
writeResponse(response, 404, "Not found", "text/plain; charset=utf-8");
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
response.writeHead(200, {
|
|
525
|
-
...buildArtifactSecurityHeaders(),
|
|
526
|
-
"content-type": contentTypeForPath(filePath)
|
|
527
|
-
});
|
|
528
|
-
response.end(body);
|
|
529
|
-
}
|
|
530
|
-
catch {
|
|
531
|
-
writeResponse(response, 404, "Not found", "text/plain; charset=utf-8");
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
async function readObserverData(runRoot, runtimeStreamUrls = []) {
|
|
535
|
-
// Best-effort load from either source. Both reads swallow all errors on
|
|
536
|
-
// purpose: this runs on every browser poll of a live run, where run.json may
|
|
537
|
-
// be absent, still being written (a partial-JSON parse error), or superseded
|
|
538
|
-
// by observer-data.json. A transient failure just falls through to the next
|
|
539
|
-
// source, or to null -> a 404 the poller retries; it must not surface a 500.
|
|
540
|
-
try {
|
|
541
|
-
const bundleBytes = await readContainedFile(runRoot, path.join(runRoot.physicalPath, "run.json"));
|
|
542
|
-
if (!bundleBytes)
|
|
543
|
-
throw new Error("run.json unavailable");
|
|
544
|
-
const bundle = JSON.parse(bundleBytes.toString("utf8"));
|
|
545
|
-
return withRuntimeStreamUrls(await withLocalRunStatus(runRoot, buildObserverData(bundle)), runtimeStreamUrls);
|
|
546
|
-
}
|
|
547
|
-
catch { }
|
|
548
|
-
try {
|
|
549
|
-
const observerBytes = await readContainedFile(runRoot, path.join(runRoot.physicalPath, "observer", "observer-data.json"));
|
|
550
|
-
if (!observerBytes)
|
|
551
|
-
throw new Error("observer-data.json unavailable");
|
|
552
|
-
return withRuntimeStreamUrls(await withLocalRunStatus(runRoot, withObserverEndings(JSON.parse(observerBytes.toString("utf8")))), runtimeStreamUrls);
|
|
553
|
-
}
|
|
554
|
-
catch { }
|
|
555
|
-
return null;
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* Liveness is a current read of a contained local status record, separate from run evidence.
|
|
559
|
-
* A stale heartbeat means unknown: neither an old timestamp nor a persisted PID proves that a
|
|
560
|
-
* process died (the evidence may have been copied from another machine). No PID is served/probed.
|
|
561
|
-
*/
|
|
562
|
-
async function withLocalRunStatus(runRoot, input) {
|
|
563
|
-
// A served observation must never be inherited from a persisted projection or export.
|
|
564
|
-
const { runtime: _persistedRuntime, ...data } = input;
|
|
565
|
-
try {
|
|
566
|
-
const bytes = await readContainedFile(runRoot, path.join(runRoot.physicalPath, RUN_STATUS_FILE));
|
|
567
|
-
if (!bytes)
|
|
568
|
-
return data;
|
|
569
|
-
const record = JSON.parse(bytes.toString("utf8"));
|
|
570
|
-
if (!isRunStatusRecord(record) || record.runId !== data.run.runId || record.mode !== data.run.mode
|
|
571
|
-
|| record.runId !== path.basename(runRoot.physicalPath))
|
|
572
|
-
return data;
|
|
573
|
-
const now = Date.now();
|
|
574
|
-
const started = Date.parse(record.startedAt);
|
|
575
|
-
const updated = Date.parse(record.updatedAt);
|
|
576
|
-
const timestampsValid = Number.isFinite(started) && Number.isFinite(updated)
|
|
577
|
-
&& started <= updated && updated <= now;
|
|
578
|
-
let state = "unknown";
|
|
579
|
-
if (timestampsValid) {
|
|
580
|
-
if (record.state === "finished") {
|
|
581
|
-
state = "finished";
|
|
582
|
-
}
|
|
583
|
-
else if (now - updated <= RUN_STATUS_STALE_MS) {
|
|
584
|
-
state = "running";
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
return { ...data, runtime: { state, observedAt: new Date(now).toISOString(), source: "local-run-status" } };
|
|
588
|
-
}
|
|
589
|
-
catch {
|
|
590
|
-
return data;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
/** internal: exported for the #357 lifecycle tests (consumed by observer-serve). */
|
|
594
|
-
export function withRuntimeStreamUrls(data, runtimeStreamUrls) {
|
|
595
|
-
const byStream = new Map(runtimeStreamUrls.map((stream) => [stream.streamId, stream]));
|
|
596
|
-
return {
|
|
597
|
-
...data,
|
|
598
|
-
streams: data.streams.map((input) => {
|
|
599
|
-
// JSON projections are untrusted, including fallback observer-data.json. A marker saved in
|
|
600
|
-
// a bundle is never authority; only this process's attached runtime map grants it again.
|
|
601
|
-
const stream = input.embed === undefined ? input : { ...input, embed: recordedStreamEmbed(input.embed) };
|
|
602
|
-
const runtime = byStream.get(stream.id);
|
|
603
|
-
if (!runtime)
|
|
604
|
-
return stream;
|
|
605
|
-
if (runtime.ended)
|
|
606
|
-
return { ...stream, liveEnded: true };
|
|
607
|
-
const url = runtimeDesktopUrl(runtime.url);
|
|
608
|
-
if (!url)
|
|
609
|
-
return stream;
|
|
610
|
-
return {
|
|
611
|
-
...stream,
|
|
612
|
-
...(stream.liveEnded === true ? { liveEnded: false } : {}),
|
|
613
|
-
embed: {
|
|
614
|
-
...(stream.embed ?? { title: stream.label }),
|
|
615
|
-
kind: "iframe",
|
|
616
|
-
url,
|
|
617
|
-
runtimeDesktop: true
|
|
618
|
-
},
|
|
619
|
-
transport: "sse",
|
|
620
|
-
url
|
|
621
|
-
};
|
|
622
|
-
})
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
function runtimeDesktopUrl(value) {
|
|
626
|
-
if (!value || value.length > 16_384 || /[\u0000-\u0020\u007f\\]/.test(value))
|
|
627
|
-
return null;
|
|
628
|
-
try {
|
|
629
|
-
const url = new URL(value);
|
|
630
|
-
return (url.protocol === "http:" || url.protocol === "https:") && !url.username && !url.password ? url.href : null;
|
|
631
|
-
}
|
|
632
|
-
catch {
|
|
633
|
-
return null;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
/** internal: consumed by observer-serve */
|
|
637
|
-
export async function buildHistoryIndex(proofRoot) {
|
|
638
|
-
await assertPinnedDirectory(proofRoot);
|
|
639
|
-
const physicalCwd = path.dirname(path.dirname(proofRoot.physicalPath));
|
|
640
|
-
const listed = await listRuns(physicalCwd);
|
|
641
|
-
const runs = await Promise.all(listed.runs.slice(0, 80).map(async (run) => {
|
|
642
|
-
const root = await pinDirectChildDirectory(proofRoot, run.runId);
|
|
643
|
-
const data = root ? await readObserverData(root) : null;
|
|
644
|
-
return {
|
|
645
|
-
runId: run.runId,
|
|
646
|
-
createdAt: run.createdAt,
|
|
647
|
-
mode: run.mode,
|
|
648
|
-
href: `/_humanish/runs/${encodeURIComponent(run.runId)}/observer/index.html`,
|
|
649
|
-
status: data?.run.status ?? "unknown",
|
|
650
|
-
...(data?.runtime ? { runtimeState: data.runtime.state } : {}),
|
|
651
|
-
streamCount: data?.streams.length ?? 0,
|
|
652
|
-
// Labeled run-total cost estimate (advisory; null when the run carries no cost summary).
|
|
653
|
-
estimatedCostUsd: data?.cost?.estimatedTotalUsd ?? null,
|
|
654
|
-
costRatesAsOf: data?.cost?.ratesAsOf ?? null,
|
|
655
|
-
costPlaceholder: data?.cost?.placeholder ?? false
|
|
656
|
-
};
|
|
657
|
-
}));
|
|
658
|
-
await assertPinnedDirectory(proofRoot);
|
|
659
|
-
return {
|
|
660
|
-
latestRunId: listed.latest && isSafeRunIdSegment(listed.latest) ? listed.latest : null,
|
|
661
|
-
runs
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
/** internal: consumed by observer-serve */
|
|
665
|
-
export function matchRunRoute(pathname) {
|
|
666
|
-
const match = pathname.match(/^\/_humanish\/runs\/([^/]+)(?:\/(.*))?$/);
|
|
667
|
-
if (!match)
|
|
668
|
-
return null;
|
|
669
|
-
try {
|
|
670
|
-
const runId = decodeURIComponent(match[1] ?? "");
|
|
671
|
-
if (!isSafeRunIdSegment(runId))
|
|
672
|
-
return null;
|
|
673
|
-
return {
|
|
674
|
-
runId,
|
|
675
|
-
relativePath: decodeURIComponent(match[2] || "observer/index.html")
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
catch {
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
async function readContainedFile(root, filePathInput) {
|
|
683
|
-
const opened = await openContainedFile(root, filePathInput);
|
|
684
|
-
if (!opened)
|
|
685
|
-
return null;
|
|
686
|
-
try {
|
|
687
|
-
const body = await opened.handle.readFile();
|
|
688
|
-
await assertPinnedDirectory(root);
|
|
689
|
-
return body;
|
|
690
|
-
}
|
|
691
|
-
catch {
|
|
692
|
-
return null;
|
|
693
|
-
}
|
|
694
|
-
finally {
|
|
695
|
-
await opened.handle.close();
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
async function openContainedFile(root, filePathInput) {
|
|
699
|
-
const filePath = path.resolve(filePathInput);
|
|
700
|
-
if (!isPathInside(root.physicalPath, filePath))
|
|
701
|
-
return null;
|
|
702
|
-
let handle = null;
|
|
703
|
-
try {
|
|
704
|
-
await assertPinnedDirectory(root);
|
|
705
|
-
const expectedStats = await inspectContainedRegularFile(root, filePath);
|
|
706
|
-
if (!expectedStats)
|
|
707
|
-
return null;
|
|
708
|
-
handle = await open(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW);
|
|
709
|
-
const openedStats = await handle.stat({ bigint: true });
|
|
710
|
-
if (!openedStats.isFile() || openedStats.nlink !== 1n || openedStats.dev !== expectedStats.dev || openedStats.ino !== expectedStats.ino) {
|
|
711
|
-
await handle.close();
|
|
712
|
-
return null;
|
|
713
|
-
}
|
|
714
|
-
const recheckedStats = await inspectContainedRegularFile(root, filePath);
|
|
715
|
-
if (!recheckedStats || recheckedStats.dev !== expectedStats.dev || recheckedStats.ino !== expectedStats.ino) {
|
|
716
|
-
await handle.close();
|
|
717
|
-
return null;
|
|
718
|
-
}
|
|
719
|
-
await assertPinnedDirectory(root);
|
|
720
|
-
return { handle, size: Number(openedStats.size) };
|
|
721
|
-
}
|
|
722
|
-
catch {
|
|
723
|
-
if (handle)
|
|
724
|
-
await handle.close().catch(() => undefined);
|
|
725
|
-
return null;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
function byteRange(value, size) {
|
|
729
|
-
if (value === undefined)
|
|
730
|
-
return null;
|
|
731
|
-
if (Array.isArray(value) || value.includes(","))
|
|
732
|
-
return "invalid";
|
|
733
|
-
const match = /^bytes=(\d*)-(\d*)$/.exec(value.trim());
|
|
734
|
-
if (!match || (!match[1] && !match[2]) || size <= 0)
|
|
735
|
-
return "invalid";
|
|
736
|
-
if (!match[1]) {
|
|
737
|
-
const suffix = Number(match[2]);
|
|
738
|
-
if (!Number.isSafeInteger(suffix) || suffix <= 0)
|
|
739
|
-
return "invalid";
|
|
740
|
-
return { start: Math.max(0, size - suffix), end: size - 1 };
|
|
741
|
-
}
|
|
742
|
-
const start = Number(match[1]);
|
|
743
|
-
const requestedEnd = match[2] ? Number(match[2]) : size - 1;
|
|
744
|
-
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(requestedEnd) || start < 0 || requestedEnd < start || start >= size)
|
|
745
|
-
return "invalid";
|
|
746
|
-
return { start, end: Math.min(requestedEnd, size - 1) };
|
|
747
|
-
}
|
|
748
|
-
async function serveContainedMedia(root, filePath, response, request) {
|
|
749
|
-
const opened = await openContainedFile(root, filePath);
|
|
750
|
-
if (!opened) {
|
|
751
|
-
writeResponse(response, 404, "Not found", "text/plain; charset=utf-8");
|
|
752
|
-
return;
|
|
753
|
-
}
|
|
754
|
-
const range = byteRange(request?.headers.range, opened.size);
|
|
755
|
-
if (range === "invalid") {
|
|
756
|
-
await opened.handle.close();
|
|
757
|
-
response.writeHead(416, { ...buildArtifactSecurityHeaders(), "accept-ranges": "bytes", "content-range": `bytes */${opened.size}`, "content-length": "0" });
|
|
758
|
-
response.end();
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
const start = range?.start ?? 0;
|
|
762
|
-
const end = range?.end ?? Math.max(0, opened.size - 1);
|
|
763
|
-
const status = range ? 206 : 200;
|
|
764
|
-
response.writeHead(status, {
|
|
765
|
-
...buildArtifactSecurityHeaders(),
|
|
766
|
-
"accept-ranges": "bytes",
|
|
767
|
-
"content-type": "video/mp4",
|
|
768
|
-
"content-length": String(opened.size === 0 ? 0 : end - start + 1),
|
|
769
|
-
...(range ? { "content-range": `bytes ${start}-${end}/${opened.size}` } : {})
|
|
770
|
-
});
|
|
771
|
-
if (request?.method === "HEAD" || opened.size === 0) {
|
|
772
|
-
await opened.handle.close();
|
|
773
|
-
response.end();
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
let stream;
|
|
777
|
-
try {
|
|
778
|
-
stream = opened.handle.createReadStream({ start, end, autoClose: false });
|
|
779
|
-
await new Promise((resolve, reject) => {
|
|
780
|
-
stream.once("error", reject);
|
|
781
|
-
response.once("finish", resolve);
|
|
782
|
-
response.once("close", resolve);
|
|
783
|
-
stream.pipe(response);
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
catch {
|
|
787
|
-
// Headers already describe a fixed byte interval. A late disk/read failure
|
|
788
|
-
// cannot become a second HTTP response; terminate the incomplete body.
|
|
789
|
-
response.destroy();
|
|
790
|
-
}
|
|
791
|
-
finally {
|
|
792
|
-
stream?.destroy();
|
|
793
|
-
await opened.handle.close().catch(() => undefined);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
async function inspectContainedRegularFile(root, filePath) {
|
|
797
|
-
const relative = path.relative(root.physicalPath, filePath);
|
|
798
|
-
if (!relative || relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
799
|
-
return null;
|
|
800
|
-
}
|
|
801
|
-
const segments = relative.split(path.sep).filter(Boolean);
|
|
802
|
-
let current = root.physicalPath;
|
|
803
|
-
let fileIdentity = null;
|
|
804
|
-
for (const [index, segment] of segments.entries()) {
|
|
805
|
-
current = path.join(current, segment);
|
|
806
|
-
const stats = await lstat(current, { bigint: true });
|
|
807
|
-
if (stats.isSymbolicLink())
|
|
808
|
-
return null;
|
|
809
|
-
if (index < segments.length - 1) {
|
|
810
|
-
if (!stats.isDirectory())
|
|
811
|
-
return null;
|
|
812
|
-
}
|
|
813
|
-
else {
|
|
814
|
-
if (!stats.isFile() || stats.nlink !== 1n)
|
|
815
|
-
return null;
|
|
816
|
-
fileIdentity = { dev: stats.dev, ino: stats.ino };
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
if (await realpath(filePath) !== filePath)
|
|
820
|
-
return null;
|
|
821
|
-
return fileIdentity;
|
|
822
|
-
}
|
|
823
|
-
/** internal: consumed by observer-serve */
|
|
824
|
-
export async function pinDirectory(directoryInput) {
|
|
825
|
-
const physicalPath = await realpath(path.resolve(directoryInput));
|
|
826
|
-
const stats = await lstat(physicalPath, { bigint: true });
|
|
827
|
-
if (stats.isSymbolicLink() || !stats.isDirectory()) {
|
|
828
|
-
throw new Error("Observer roots must be physical directories.");
|
|
829
|
-
}
|
|
830
|
-
return Object.freeze({ birthtimeNs: stats.birthtimeNs, dev: stats.dev, ino: stats.ino, physicalPath });
|
|
831
|
-
}
|
|
832
|
-
/** internal: consumed by observer-serve */
|
|
833
|
-
export async function pinDirectChildDirectory(root, name) {
|
|
834
|
-
if (!isSafeRunIdSegment(name))
|
|
835
|
-
return null;
|
|
836
|
-
try {
|
|
837
|
-
await assertPinnedDirectory(root);
|
|
838
|
-
const candidate = path.join(root.physicalPath, name);
|
|
839
|
-
const pinned = await pinDirectory(candidate);
|
|
840
|
-
if (pinned.physicalPath !== candidate || path.dirname(pinned.physicalPath) !== root.physicalPath) {
|
|
841
|
-
return null;
|
|
842
|
-
}
|
|
843
|
-
await assertPinnedDirectory(root);
|
|
844
|
-
return pinned;
|
|
845
|
-
}
|
|
846
|
-
catch {
|
|
847
|
-
return null;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
async function assertPinnedDirectory(root) {
|
|
851
|
-
const stats = await lstat(root.physicalPath, { bigint: true });
|
|
852
|
-
if (stats.isSymbolicLink()
|
|
853
|
-
|| !stats.isDirectory()
|
|
854
|
-
|| stats.birthtimeNs !== root.birthtimeNs
|
|
855
|
-
|| stats.dev !== root.dev
|
|
856
|
-
|| stats.ino !== root.ino
|
|
857
|
-
|| await realpath(root.physicalPath) !== root.physicalPath) {
|
|
858
|
-
throw new Error("Observer root identity changed.");
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
function writeResponse(response, status, body, contentType) {
|
|
862
|
-
response.writeHead(status, {
|
|
863
|
-
"cache-control": "no-store",
|
|
864
|
-
"content-type": contentType
|
|
865
|
-
});
|
|
866
|
-
response.end(body);
|
|
867
|
-
}
|
|
868
|
-
function contentTypeForPath(filePath) {
|
|
869
|
-
switch (path.extname(filePath)) {
|
|
870
|
-
case ".html":
|
|
871
|
-
return "text/html; charset=utf-8";
|
|
872
|
-
case ".json":
|
|
873
|
-
return "application/json; charset=utf-8";
|
|
874
|
-
case ".md":
|
|
875
|
-
return "text/markdown; charset=utf-8";
|
|
876
|
-
case ".ndjson":
|
|
877
|
-
return "application/x-ndjson; charset=utf-8";
|
|
878
|
-
case ".png":
|
|
879
|
-
return "image/png";
|
|
880
|
-
case ".jpg":
|
|
881
|
-
case ".jpeg":
|
|
882
|
-
return "image/jpeg";
|
|
883
|
-
case ".webp":
|
|
884
|
-
return "image/webp";
|
|
885
|
-
default:
|
|
886
|
-
return "text/plain; charset=utf-8";
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
export function openTarget(target) {
|
|
890
|
-
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
891
|
-
const args = process.platform === "win32" ? ["/c", "start", "", target] : [target];
|
|
892
|
-
try {
|
|
893
|
-
const child = spawn(command, args, {
|
|
894
|
-
detached: true,
|
|
895
|
-
stdio: "ignore"
|
|
896
|
-
});
|
|
897
|
-
// Missing desktop openers fail asynchronously (ENOENT), especially over SSH or in a
|
|
898
|
-
// minimal container. The served URL remains usable; an opener must never crash its server.
|
|
899
|
-
child.on("error", () => { });
|
|
900
|
-
child.unref();
|
|
901
|
-
return { opened: true, command: [command, ...args].join(" ") };
|
|
902
|
-
}
|
|
903
|
-
catch (error) {
|
|
904
|
-
return {
|
|
905
|
-
opened: false,
|
|
906
|
-
command: [command, ...args].join(" "),
|
|
907
|
-
warning: `Could not open observer automatically: ${error instanceof Error ? error.message : String(error)}`
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
function closeServer(server) {
|
|
912
|
-
return new Promise((resolve, reject) => {
|
|
913
|
-
server.close((error) => {
|
|
914
|
-
if (error) {
|
|
915
|
-
reject(error);
|
|
916
|
-
}
|
|
917
|
-
else {
|
|
918
|
-
resolve();
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
function escapeHtml(value) {
|
|
924
|
-
return value.replace(/[&<>"']/g, (char) => {
|
|
925
|
-
switch (char) {
|
|
926
|
-
case "&":
|
|
927
|
-
return "&";
|
|
928
|
-
case "<":
|
|
929
|
-
return "<";
|
|
930
|
-
case ">":
|
|
931
|
-
return ">";
|
|
932
|
-
case "\"":
|
|
933
|
-
return """;
|
|
934
|
-
default:
|
|
935
|
-
return "'";
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
function escapeJsonScript(value) {
|
|
940
|
-
return JSON.stringify(value)
|
|
941
|
-
.replace(/</g, "\\u003c")
|
|
942
|
-
.replace(/>/g, "\\u003e")
|
|
943
|
-
.replace(/&/g, "\\u0026")
|
|
944
|
-
.replace(/\u2028/g, "\\u2028")
|
|
945
|
-
.replace(/\u2029/g, "\\u2029");
|
|
946
|
-
}
|
|
947
|
-
//# sourceMappingURL=observer.js.map
|