humanish 0.107.0 → 0.108.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/ARCHITECTURE.md +22 -17
- package/CHANGELOG.md +14 -0
- package/CONTEXT.md +51 -44
- package/README.md +145 -172
- package/SECURITY.md +16 -26
- package/TELEMETRY.md +8 -6
- package/dist/actors/affordance.d.ts +4 -4
- package/dist/actors/affordance.js +12 -12
- package/dist/actors/agent-session.d.ts +2 -2
- package/dist/actors/agent-session.js +7 -7
- package/dist/actors/codex/app-server-actor-trace.d.ts +1 -1
- package/dist/actors/codex/app-server-actor-trace.js +1 -1
- package/dist/actors/codex/app-server-ui.js +1 -1
- package/dist/actors/codex/codex-admission.d.ts +91 -0
- package/dist/actors/codex/codex-admission.js +150 -0
- package/dist/actors/codex/restricted-executable.d.ts +4 -4
- package/dist/actors/codex/restricted-executable.js +8 -8
- package/dist/actors/codex/restricted-launch.d.ts +2 -1
- package/dist/actors/codex/restricted-launch.js +1 -1
- package/dist/actors/codex/restricted-participant.js +8 -6
- package/dist/actors/codex/restricted-policy.d.ts +2 -2
- package/dist/actors/codex/restricted-policy.js +2 -2
- package/dist/actors/codex/restricted-session.d.ts +2 -2
- package/dist/actors/codex/restricted-session.js +10 -5
- package/dist/actors/computer-use/actor.d.ts +16 -16
- package/dist/actors/computer-use/actor.js +2 -2
- package/dist/actors/computer-use/admission-limit.d.ts +1 -1
- package/dist/actors/computer-use/admission-limit.js +1 -1
- package/dist/actors/computer-use/loop/actions.d.ts +3 -3
- package/dist/actors/computer-use/loop/actions.js +10 -10
- package/dist/actors/computer-use/loop/backstop.d.ts +3 -3
- package/dist/actors/computer-use/loop/backstop.js +14 -12
- package/dist/actors/computer-use/loop/ending.d.ts +5 -5
- package/dist/actors/computer-use/loop/ending.js +7 -7
- package/dist/actors/computer-use/loop/observation.d.ts +2 -2
- package/dist/actors/computer-use/loop/observation.js +9 -9
- package/dist/actors/computer-use/loop/provider-call.d.ts +1 -1
- package/dist/actors/computer-use/loop/provider-call.js +1 -1
- package/dist/actors/computer-use/loop/session.js +3 -3
- package/dist/actors/computer-use/loop/spend.d.ts +1 -1
- package/dist/actors/computer-use/loop/spend.js +1 -1
- package/dist/actors/computer-use/loop/trace.js +9 -8
- package/dist/actors/computer-use/loop/types.d.ts +25 -23
- package/dist/actors/computer-use/loop/usage.js +2 -2
- package/dist/actors/computer-use/openai-context.d.ts +37 -0
- package/dist/actors/computer-use/openai-context.js +214 -0
- package/dist/actors/computer-use/openai-provider.d.ts +11 -8
- package/dist/actors/computer-use/openai-provider.js +45 -34
- package/dist/actors/computer-use/openai-requests.d.ts +36 -10
- package/dist/actors/computer-use/openai-requests.js +82 -15
- package/dist/actors/computer-use/openai-wire.d.ts +19 -7
- package/dist/actors/computer-use/openai-wire.js +36 -34
- package/dist/actors/contract.d.ts +78 -43
- package/dist/actors/contract.js +29 -23
- package/dist/actors/local-agent/claude-session.d.ts +1 -1
- package/dist/actors/local-agent/claude-session.js +10 -9
- package/dist/actors/local-agent/cli.d.ts +8 -6
- package/dist/actors/local-agent/cli.js +24 -28
- package/dist/actors/local-agent/readiness.d.ts +2 -2
- package/dist/actors/local-agent/readiness.js +4 -4
- package/dist/actors/reasoning-effort.js +6 -6
- package/dist/actors/registry.d.ts +10 -10
- package/dist/actors/registry.js +18 -17
- package/dist/actors/scripted-browser/actor.d.ts +8 -8
- package/dist/actors/scripted-browser/actor.js +16 -16
- package/dist/actors/scripted-browser/browser-command.js +1 -1
- package/dist/actors/scripted-browser/steps.js +1 -1
- package/dist/actors/scripted-browser/types.d.ts +1 -1
- package/dist/actors/stop-conditions.d.ts +1 -1
- package/dist/analysis/codex-config.d.ts +6 -2
- package/dist/analysis/codex-config.js +22 -14
- package/dist/analysis/service.js +5 -5
- package/dist/cli/commands/analyze.js +19 -16
- package/dist/cli/commands/codex.js +9 -9
- package/dist/cli/commands/comms.js +54 -33
- package/dist/cli/commands/feedback.js +20 -21
- package/dist/cli/commands/lab-format.d.ts +5 -4
- package/dist/cli/commands/lab-format.js +35 -23
- package/dist/cli/commands/lab-route-computer-use.js +6 -7
- package/dist/cli/commands/lab-route-preview.js +4 -3
- package/dist/cli/commands/lab-route-shared-world.js +3 -3
- package/dist/cli/commands/lab-run.js +10 -11
- package/dist/cli/commands/lab-scorer.d.ts +2 -2
- package/dist/cli/commands/lab-scorer.js +1 -1
- package/dist/cli/commands/migrate.d.ts +4 -0
- package/dist/cli/commands/migrate.js +65 -0
- package/dist/cli/commands/observe.js +147 -108
- package/dist/cli/commands/run-command.d.ts +10 -0
- package/dist/cli/commands/run-command.js +85 -0
- package/dist/cli/commands/runs.js +137 -138
- package/dist/cli/commands/setup.d.ts +2 -2
- package/dist/cli/commands/setup.js +26 -21
- package/dist/cli/commands/study.d.ts +3 -0
- package/dist/cli/commands/study.js +182 -0
- package/dist/cli/commands/tui.d.ts +4 -4
- package/dist/cli/commands/tui.js +21 -21
- package/dist/cli/commands/watch.js +60 -75
- package/dist/cli/deprecations.d.ts +18 -0
- package/dist/cli/deprecations.js +48 -0
- package/dist/cli/doctor.d.ts +15 -5
- package/dist/cli/doctor.js +103 -48
- package/dist/cli/first-run-path.d.ts +12 -10
- package/dist/cli/first-run-path.js +30 -28
- package/dist/cli/io.d.ts +41 -6
- package/dist/cli/io.js +97 -22
- package/dist/cli/observer-follow.d.ts +2 -2
- package/dist/cli/observer-follow.js +5 -6
- package/dist/cli/orientation.d.ts +6 -3
- package/dist/cli/orientation.js +43 -39
- package/dist/cli/product-sentence.d.ts +6 -0
- package/dist/cli/product-sentence.js +6 -0
- package/dist/cli/program.d.ts +6 -1
- package/dist/cli/program.js +109 -40
- package/dist/cli/telemetry.d.ts +15 -15
- package/dist/cli/telemetry.js +48 -40
- package/dist/cli.js +1 -1
- package/dist/comms/capture-surface.d.ts +13 -12
- package/dist/comms/capture-surface.js +23 -22
- package/dist/comms/catch-host.d.ts +7 -7
- package/dist/comms/catch-host.js +14 -14
- package/dist/comms/email-catch.d.ts +3 -3
- package/dist/comms/email-catch.js +8 -8
- package/dist/comms/external-evidence.js +2 -2
- package/dist/comms/extract.js +2 -2
- package/dist/comms/fake-inbox.d.ts +2 -2
- package/dist/comms/fake-inbox.js +2 -2
- package/dist/comms/receiving-render.d.ts +1 -1
- package/dist/comms/receiving-render.js +2 -2
- package/dist/comms/sandbox-catch-script.d.ts +6 -6
- package/dist/comms/sandbox-catch-script.js +6 -6
- package/dist/comms/sandbox-catch.d.ts +36 -37
- package/dist/comms/sandbox-catch.js +34 -35
- package/dist/comms/setup.js +42 -8
- package/dist/comms/thread-evidence.d.ts +1 -1
- package/dist/comms/thread-evidence.js +6 -6
- package/dist/comms/types.d.ts +6 -6
- package/dist/comms/types.js +3 -3
- package/dist/evidence/frame-signature.d.ts +1 -1
- package/dist/evidence/frame-signature.js +4 -4
- package/dist/evidence/redaction.d.ts +3 -3
- package/dist/evidence/redaction.js +4 -4
- package/dist/feedback/draft.js +36 -78
- package/dist/feedback/export-bundle.js +1 -1
- package/dist/feedback/export.d.ts +5 -1
- package/dist/feedback/export.js +7 -8
- package/dist/feedback/feedback.d.ts +2 -2
- package/dist/feedback/feedback.js +21 -3
- package/dist/guest/chromium-text.js +2 -2
- package/dist/guest/desktop-native.d.ts +1 -1
- package/dist/guest/runtime.js +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.js +8 -6
- package/dist/keys/key-resolution.d.ts +5 -5
- package/dist/keys/key-resolution.js +23 -23
- package/dist/lab/adapter-extension.d.ts +7 -7
- package/dist/lab/adapter-extension.js +13 -36
- package/dist/lab/adapter-scorer-loader.d.ts +7 -7
- package/dist/lab/adapter-scorer-loader.js +32 -32
- package/dist/lab/composition-rules.js +42 -42
- package/dist/lab/config.js +65 -25
- package/dist/lab/deprecated-fields.d.ts +10 -0
- package/dist/lab/deprecated-fields.js +24 -0
- package/dist/lab/device-presets.d.ts +8 -8
- package/dist/lab/device-presets.js +11 -11
- package/dist/lab/discover.d.ts +13 -9
- package/dist/lab/discover.js +117 -57
- package/dist/lab/doctor.d.ts +10 -3
- package/dist/lab/doctor.js +47 -9
- package/dist/lab/init-templates.js +147 -147
- package/dist/lab/init.d.ts +1 -1
- package/dist/lab/init.js +41 -9
- package/dist/lab/keys.d.ts +2 -0
- package/dist/lab/keys.js +42 -8
- package/dist/lab/lab-deps.d.ts +7 -12
- package/dist/lab/parse/actors.js +9 -9
- package/dist/lab/parse/comms.js +5 -5
- package/dist/lab/parse/execution.js +13 -13
- package/dist/lab/parse/study-v3.d.ts +23 -0
- package/dist/lab/parse/study-v3.js +259 -0
- package/dist/lab/parse/subject-state.d.ts +7 -7
- package/dist/lab/parse/subject-state.js +16 -16
- package/dist/lab/parse/subject.js +28 -28
- package/dist/lab/parse/values.d.ts +1 -1
- package/dist/lab/parse/values.js +3 -3
- package/dist/lab/persona-resolve.d.ts +4 -4
- package/dist/lab/persona-resolve.js +4 -4
- package/dist/lab/plan-participants.d.ts +2 -2
- package/dist/lab/plan-types.d.ts +4 -4
- package/dist/lab/plan.d.ts +1 -7
- package/dist/lab/plan.js +10 -41
- package/dist/lab/preflight-probes.js +11 -11
- package/dist/lab/preflight-result.d.ts +2 -1
- package/dist/lab/preflight-result.js +5 -4
- package/dist/lab/preflight.d.ts +7 -5
- package/dist/lab/preflight.js +5 -5
- package/dist/lab/routing.d.ts +31 -25
- package/dist/lab/routing.js +60 -29
- package/dist/lab/run-lab-events.d.ts +0 -3
- package/dist/lab/run-lab-events.js +0 -6
- package/dist/lab/run-lab-homes.d.ts +22 -10
- package/dist/lab/run-lab-homes.js +5 -1
- package/dist/lab/run-lab-options.d.ts +1 -1
- package/dist/lab/run-lab-options.js +16 -13
- package/dist/lab/summary.d.ts +7 -6
- package/dist/lab/summary.js +10 -10
- package/dist/lab/tasks.d.ts +15 -15
- package/dist/lab/tasks.js +14 -14
- package/dist/lab/types.d.ts +101 -95
- package/dist/lab/types.js +2 -0
- package/dist/lab/validation.d.ts +13 -13
- package/dist/lab/validation.js +44 -42
- package/dist/lab/warnings.d.ts +10 -0
- package/dist/lab/warnings.js +61 -33
- package/dist/library-aliases.d.ts +56 -0
- package/dist/library-aliases.js +22 -0
- package/dist/observer/artifact.d.ts +1 -1
- package/dist/observer/artifact.js +6 -6
- package/dist/observer/data.d.ts +6 -6
- package/dist/observer/data.js +5 -4
- package/dist/observer/exposure.d.ts +1 -1
- package/dist/observer/exposure.js +11 -11
- package/dist/observer/http.js +1 -1
- package/dist/observer/library.d.ts +1 -1
- package/dist/observer/library.js +4 -2
- package/dist/observer/listen.js +5 -4
- package/dist/observer/render.d.ts +1 -1
- package/dist/observer/render.js +10 -5
- package/dist/observer/run-routes.d.ts +3 -3
- package/dist/observer/run-routes.js +1 -1
- package/dist/observer/serve.js +7 -3
- package/dist/observer/tunnel.js +1 -1
- package/dist/observer-app.html +4 -4
- package/dist/routes/computer-use/bundle-parts.d.ts +9 -9
- package/dist/routes/computer-use/bundle-parts.js +15 -15
- package/dist/routes/computer-use/bundle.js +3 -3
- package/dist/routes/computer-use/e2b-desktop/comms.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/comms.js +14 -14
- package/dist/routes/computer-use/e2b-desktop/desktop.js +4 -4
- package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +4 -3
- package/dist/routes/computer-use/e2b-desktop/fidelity.js +11 -10
- package/dist/routes/computer-use/e2b-desktop/prepare.js +7 -7
- package/dist/routes/computer-use/e2b-desktop/start.js +9 -8
- package/dist/routes/computer-use/e2b-desktop/teardown.js +5 -4
- package/dist/routes/computer-use/external-comms.d.ts +1 -1
- package/dist/routes/computer-use/external-comms.js +1 -1
- package/dist/routes/computer-use/fanout-bundle.js +18 -18
- package/dist/routes/computer-use/fanout-records.js +10 -11
- package/dist/routes/computer-use/live-flush.d.ts +1 -1
- package/dist/routes/computer-use/live-flush.js +6 -6
- package/dist/routes/computer-use/live-phase.d.ts +4 -2
- package/dist/routes/computer-use/live-phase.js +6 -6
- package/dist/routes/computer-use/local-vm.js +1 -1
- package/dist/routes/computer-use/participant-desktop.d.ts +4 -4
- package/dist/routes/computer-use/participant-desktop.js +4 -4
- package/dist/routes/computer-use/participant-execution.d.ts +4 -4
- package/dist/routes/computer-use/participant-execution.js +9 -9
- package/dist/routes/computer-use/participant-model.d.ts +6 -0
- package/dist/routes/computer-use/participant-model.js +31 -13
- package/dist/routes/computer-use/participant-prompt.d.ts +11 -11
- package/dist/routes/computer-use/participant-prompt.js +6 -6
- package/dist/routes/computer-use/participant-runs.d.ts +7 -7
- package/dist/routes/computer-use/participant-runs.js +13 -13
- package/dist/routes/computer-use/plan.js +22 -22
- package/dist/routes/computer-use/preflight.js +21 -21
- package/dist/routes/computer-use/rerun-selection.js +1 -1
- package/dist/routes/computer-use/result.js +11 -11
- package/dist/routes/computer-use/route.d.ts +2 -1
- package/dist/routes/computer-use/route.js +15 -14
- package/dist/routes/computer-use/self-report.d.ts +7 -7
- package/dist/routes/computer-use/self-report.js +31 -31
- package/dist/routes/computer-use/setup.d.ts +1 -1
- package/dist/routes/computer-use/setup.js +17 -18
- package/dist/routes/computer-use/single-bundle.d.ts +7 -7
- package/dist/routes/computer-use/single-bundle.js +28 -30
- package/dist/routes/computer-use/subject-projection.d.ts +1 -1
- package/dist/routes/computer-use/subject-projection.js +6 -6
- package/dist/routes/computer-use/types.d.ts +40 -42
- package/dist/routes/computer-use/types.js +10 -10
- package/dist/routes/preview.d.ts +8 -2
- package/dist/routes/preview.js +8 -4
- package/dist/routes/scripted/bundle.d.ts +2 -2
- package/dist/routes/scripted/bundle.js +13 -12
- package/dist/routes/scripted/plan.d.ts +1 -1
- package/dist/routes/scripted/plan.js +9 -9
- package/dist/routes/scripted/result.js +5 -5
- package/dist/routes/scripted/route.js +5 -6
- package/dist/routes/scripted/scenario.js +2 -2
- package/dist/routes/scripted/setup.js +7 -7
- package/dist/routes/scripted/subject.js +1 -1
- package/dist/routes/scripted/surface-records.js +3 -3
- package/dist/routes/scripted/types.d.ts +3 -5
- package/dist/routes/scripted/types.js +1 -1
- package/dist/routes/shared-world/bundle-records.js +9 -8
- package/dist/routes/shared-world/bundle.d.ts +5 -5
- package/dist/routes/shared-world/bundle.js +40 -38
- package/dist/routes/shared-world/checkpoints.d.ts +1 -1
- package/dist/routes/shared-world/checkpoints.js +1 -1
- package/dist/routes/shared-world/comms.d.ts +5 -5
- package/dist/routes/shared-world/comms.js +14 -14
- package/dist/routes/shared-world/external-public.d.ts +4 -3
- package/dist/routes/shared-world/external-public.js +16 -12
- package/dist/routes/shared-world/handoff.d.ts +7 -6
- package/dist/routes/shared-world/handoff.js +65 -57
- package/dist/routes/shared-world/lobby-code.d.ts +2 -2
- package/dist/routes/shared-world/lobby-code.js +9 -9
- package/dist/routes/shared-world/participant-specs.d.ts +7 -6
- package/dist/routes/shared-world/participant-specs.js +31 -24
- package/dist/routes/shared-world/plan.js +7 -7
- package/dist/routes/shared-world/provenance.d.ts +2 -2
- package/dist/routes/shared-world/provenance.js +2 -2
- package/dist/routes/shared-world/provisioned.js +14 -13
- package/dist/routes/shared-world/result.js +20 -21
- package/dist/routes/shared-world/route.js +23 -22
- package/dist/routes/shared-world/setup.d.ts +3 -3
- package/dist/routes/shared-world/setup.js +4 -4
- package/dist/routes/shared-world/types.d.ts +30 -28
- package/dist/routes/shared-world/types.js +4 -4
- package/dist/routes/terminal/adapter.d.ts +3 -3
- package/dist/routes/terminal/adapter.js +5 -5
- package/dist/routes/terminal/bundle.d.ts +3 -3
- package/dist/routes/terminal/bundle.js +22 -21
- package/dist/routes/terminal/credentials.d.ts +4 -4
- package/dist/routes/terminal/credentials.js +7 -7
- package/dist/routes/terminal/dry-run.js +4 -4
- package/dist/routes/terminal/encoding.js +2 -2
- package/dist/routes/terminal/ledger.d.ts +3 -3
- package/dist/routes/terminal/ledger.js +14 -14
- package/dist/routes/terminal/live-finish.js +3 -3
- package/dist/routes/terminal/live-sandbox.js +12 -13
- package/dist/routes/terminal/persona.js +1 -1
- package/dist/routes/terminal/plan.js +11 -11
- package/dist/routes/terminal/recorder.js +2 -2
- package/dist/routes/terminal/result.js +8 -8
- package/dist/routes/terminal/route.js +6 -7
- package/dist/routes/terminal/sandbox.d.ts +1 -1
- package/dist/routes/terminal/sandbox.js +1 -1
- package/dist/routes/terminal/session.js +8 -7
- package/dist/routes/terminal/token-usage.d.ts +1 -1
- package/dist/routes/terminal/token-usage.js +7 -8
- package/dist/routes/terminal/trace.d.ts +2 -2
- package/dist/routes/terminal/trace.js +2 -2
- package/dist/routes/terminal/types.d.ts +26 -28
- package/dist/routes/terminal/types.js +3 -3
- package/dist/run/bundle-shape.js +3 -3
- package/dist/run/bundle.d.ts +46 -46
- package/dist/run/bundle.js +2 -1
- package/dist/run/cost-summary.js +3 -3
- package/dist/run/costs.js +7 -1
- package/dist/run/detail.d.ts +6 -6
- package/dist/run/detail.js +4 -4
- package/dist/run/dry-run-inputs.js +1 -1
- package/dist/run/dry-run.js +18 -18
- package/dist/run/judge.d.ts +19 -13
- package/dist/run/judge.js +18 -8
- package/dist/run/paths.d.ts +1 -1
- package/dist/run/paths.js +1 -1
- package/dist/run/pricing.d.ts +11 -6
- package/dist/run/pricing.js +20 -13
- package/dist/run/projection.d.ts +14 -14
- package/dist/run/projection.js +15 -15
- package/dist/run/reclaim.js +2 -2
- package/dist/run/results.d.ts +5 -5
- package/dist/run/run-index.d.ts +8 -6
- package/dist/run/run-index.js +15 -16
- package/dist/run/run-not-found.d.ts +5 -0
- package/dist/run/run-not-found.js +15 -0
- package/dist/run/run.d.ts +5 -4
- package/dist/run/run.js +1 -1
- package/dist/run/sandbox-receipts.d.ts +2 -2
- package/dist/run/sandbox-receipts.js +3 -3
- package/dist/run/shared-world-evidence.d.ts +36 -35
- package/dist/run/shared-world-evidence.js +4 -4
- package/dist/run/shared-world-shape.d.ts +1 -1
- package/dist/run/shared-world-shape.js +6 -6
- package/dist/run/stats.d.ts +12 -6
- package/dist/run/stats.js +116 -58
- package/dist/run/status.d.ts +8 -29
- package/dist/run/status.js +5 -27
- package/dist/run/stored-runs.js +2 -1
- package/dist/run/stream-shape.js +1 -1
- package/dist/run/streams.d.ts +6 -6
- package/dist/run/study-provenance.d.ts +47 -0
- package/dist/run/study-provenance.js +63 -0
- package/dist/run/study-result.d.ts +16 -0
- package/dist/run/study-result.js +9 -0
- package/dist/run/text.d.ts +2 -0
- package/dist/run/text.js +4 -0
- package/dist/run-lab.d.ts +7 -7
- package/dist/run-lab.js +1 -3
- package/dist/study/convert.d.ts +33 -0
- package/dist/study/convert.js +432 -0
- package/dist/study/field-paths.d.ts +12 -0
- package/dist/study/field-paths.js +126 -0
- package/dist/study/files.d.ts +26 -0
- package/dist/study/files.js +43 -0
- package/dist/study/migrate.d.ts +48 -0
- package/dist/study/migrate.js +408 -0
- package/dist/study/owned-files.d.ts +38 -0
- package/dist/study/owned-files.js +182 -0
- package/dist/subject/clone.d.ts +1 -1
- package/dist/subject/desktop-cli.d.ts +1 -1
- package/dist/subject/desktop-cli.js +2 -2
- package/dist/subject/local-tree-archive.js +1 -1
- package/dist/subject/local-tree.d.ts +1 -1
- package/dist/subject/node-bootstrap.js +1 -1
- package/dist/subject/runtime.js +8 -9
- package/dist/subject/serve.d.ts +1 -1
- package/dist/subject/serve.js +3 -3
- package/dist/subject/state.d.ts +1 -1
- package/dist/subject/steps.d.ts +5 -5
- package/dist/subject/steps.js +4 -4
- package/dist/substrates/command-failure.d.ts +3 -3
- package/dist/substrates/command-failure.js +3 -3
- package/dist/substrates/detached.d.ts +6 -6
- package/dist/substrates/detached.js +7 -7
- package/dist/substrates/e2b/cdp-probe.d.ts +9 -9
- package/dist/substrates/e2b/cdp-probe.js +14 -17
- package/dist/substrates/e2b/desktop-browser.d.ts +2 -2
- package/dist/substrates/e2b/desktop-browser.js +8 -8
- package/dist/substrates/e2b/desktop-cdp.d.ts +9 -9
- package/dist/substrates/e2b/desktop-cdp.js +8 -8
- package/dist/substrates/e2b/desktop-executor.d.ts +1 -1
- package/dist/substrates/e2b/desktop-executor.js +1 -1
- package/dist/substrates/e2b/desktop-geometry.d.ts +3 -3
- package/dist/substrates/e2b/desktop-geometry.js +7 -7
- package/dist/substrates/e2b/desktop-media.d.ts +1 -1
- package/dist/substrates/e2b/desktop-media.js +1 -1
- package/dist/substrates/e2b/desktop-screenshot-cleanup.d.ts +3 -3
- package/dist/substrates/e2b/desktop-screenshot-cleanup.js +3 -3
- package/dist/substrates/e2b/sandbox.d.ts +1 -1
- package/dist/substrates/e2b/sandbox.js +1 -1
- package/dist/substrates/e2b/sdk.d.ts +11 -11
- package/dist/substrates/e2b/sdk.js +6 -6
- package/dist/tui/actions.d.ts +1 -1
- package/dist/tui/actions.js +13 -13
- package/dist/tui/contract.d.ts +16 -16
- package/dist/tui/contract.js +10 -10
- package/dist/tui/launch.d.ts +4 -4
- package/dist/tui/launch.js +18 -19
- package/dist/tui/project.js +5 -5
- package/dist/tui-app.js +82 -82
- package/dist/verify/actor.d.ts +8 -8
- package/dist/verify/actor.js +36 -36
- package/dist/verify/artifacts.d.ts +2 -2
- package/dist/verify/artifacts.js +3 -3
- package/dist/verify/context-growth.d.ts +9 -0
- package/dist/verify/context-growth.js +62 -0
- package/dist/verify/costs.d.ts +6 -6
- package/dist/verify/costs.js +8 -8
- package/dist/verify/shared-world-concurrent.d.ts +2 -2
- package/dist/verify/shared-world-concurrent.js +79 -76
- package/dist/verify/shared-world.d.ts +2 -2
- package/dist/verify/shared-world.js +16 -16
- package/dist/verify/subject.d.ts +4 -4
- package/dist/verify/subject.js +18 -18
- package/dist/verify/verify.js +92 -43
- package/docs/README.md +25 -32
- package/docs/architecture/actor-contract.md +56 -87
- package/docs/architecture/desktop-sessions.md +7 -7
- package/docs/architecture/external-public-shared-world.md +61 -59
- package/docs/architecture/github-feedback-loop.md +1 -4
- package/docs/architecture/guest-desktop.md +2 -2
- package/docs/architecture/observer.md +34 -34
- package/docs/architecture/restricted-codex-analysis.md +34 -28
- package/docs/architecture/serve.md +34 -37
- package/docs/architecture/state-driven-executor.md +55 -58
- package/docs/architecture/task-protocol-support.md +5 -5
- package/docs/architecture/terminal-product-route.md +67 -107
- package/docs/contracts/README.md +24 -0
- package/docs/contracts/adapter-admission.md +3 -3
- package/docs/contracts/adapter-fixtures.md +2 -5
- package/docs/contracts/core.md +1 -3
- package/docs/contracts/errors.md +62 -0
- package/docs/contracts/feedback.md +8 -9
- package/docs/contracts/policy.md +7 -12
- package/docs/contracts/run-bundle.md +45 -44
- package/docs/contracts/schemas.md +421 -362
- package/docs/contracts/study-analysis.md +3 -3
- package/docs/contracts/study-costs.md +11 -7
- package/docs/decisions/0001-run-bundle-is-the-source-of-truth.md +1 -1
- package/docs/decisions/0002-observer-is-one-self-contained-file.md +2 -2
- package/docs/decisions/0003-contained-paths-and-cleanup-authority.md +3 -3
- package/docs/principles/actor-fidelity.md +4 -4
- package/docs/principles/engineering.md +3 -3
- package/docs/principles/invariants-and-defaults.md +38 -38
- package/docs/principles/self-driving-harness.md +1 -5
- package/docs/principles/three-roles.md +1 -1
- package/docs/product/automatic-analysis.md +7 -7
- package/examples/participant/README.md +5 -5
- package/examples/participant/run.mjs +11 -10
- package/examples/scorer/README.md +3 -3
- package/examples/scorer/run.mjs +11 -12
- package/package.json +16 -17
- package/skills/humanish/SKILL.md +60 -58
- package/skills/humanish/agents/openai.yaml +1 -1
- package/AGENTS.md +0 -99
- package/CONTRIBUTING.md +0 -148
- package/dist/actors/codex/qualified-versions.d.ts +0 -72
- package/dist/actors/codex/qualified-versions.js +0 -132
- package/dist/cli/commands/lab.d.ts +0 -3
- package/dist/cli/commands/lab.js +0 -199
- package/dist/cli/renamed-options.d.ts +0 -11
- package/dist/cli/renamed-options.js +0 -18
- package/dist/observer/static.d.ts +0 -39
- package/dist/observer/static.js +0 -369
- package/docs/architecture/comms-inbox.md +0 -122
- package/docs/architecture/desktop-recording.md +0 -80
- package/docs/architecture/local-browser-runtime.md +0 -178
- package/docs/architecture/observer-review.md +0 -144
- package/docs/architecture/participant-media.md +0 -90
- package/docs/architecture/project-layout.md +0 -62
- package/docs/architecture/real-email-receiving.md +0 -136
- package/docs/assets/humanish-drawdb-hero.png +0 -0
- package/docs/assets/humanish-observer-hero.png +0 -0
- package/docs/goals/current.md +0 -207
- package/docs/product/lobby-trivia-3player-external-public.md +0 -77
- package/docs/product/open-source-install-experience.md +0 -240
- package/docs/ramp/README.md +0 -295
- package/docs/release/open-source-readiness.md +0 -222
- package/docs/release/public-readiness-standard.md +0 -210
- package/docs/roadmap/world-class-open-source-v0.md +0 -311
|
@@ -11,7 +11,7 @@ const OBSERVER_DATA_PLACEHOLDER = "__HUMANISH_OBSERVER_DATA__";
|
|
|
11
11
|
const OBSERVER_DATA_SLOT = `<script id="observer-data" type="application/json">${OBSERVER_DATA_PLACEHOLDER}</script>`;
|
|
12
12
|
let cachedObserverArtifact = null;
|
|
13
13
|
/**
|
|
14
|
-
* Resolve
|
|
14
|
+
* Resolve (and in a repo checkout, build) the Observer artifact before any run or
|
|
15
15
|
* lab work starts. A missing artifact must cost seconds at startup, never a completed
|
|
16
16
|
* session (a live participant spends real money before the render step would have noticed).
|
|
17
17
|
* Unconditional on purpose: the artifact is the only renderer now, so the fail-before-
|
|
@@ -42,7 +42,7 @@ function loadObserverArtifact() {
|
|
|
42
42
|
// together) must not race one `vite build` output: a reader can catch the
|
|
43
43
|
// artifact half-written. A mkdir lock serializes builders across processes;
|
|
44
44
|
// whoever loses the race re-checks staleness and usually just reads.
|
|
45
|
-
// The lock lives
|
|
45
|
+
// The lock lives outside dist/ (vite empties dist mid-build) and inside an
|
|
46
46
|
// ignored path so a crashed builder cannot dirty the tree.
|
|
47
47
|
const lockDir = path.join(workspaceDir, "node_modules", ".observer-build-lock");
|
|
48
48
|
mkdirSync(path.dirname(lockDir), { recursive: true });
|
|
@@ -50,7 +50,7 @@ function loadObserverArtifact() {
|
|
|
50
50
|
for (;;) {
|
|
51
51
|
try {
|
|
52
52
|
mkdirSync(lockDir);
|
|
53
|
-
break; // lock acquired
|
|
53
|
+
break; // lock acquired: this process builds
|
|
54
54
|
}
|
|
55
55
|
catch {
|
|
56
56
|
if (Date.now() > deadline)
|
|
@@ -71,7 +71,7 @@ function loadObserverArtifact() {
|
|
|
71
71
|
try {
|
|
72
72
|
// NODE_ENV is forced: Vite respects a preset NODE_ENV (test, development),
|
|
73
73
|
// and a dev-flavored artifact embeds jsxDEV plus the builder's absolute
|
|
74
|
-
// filesystem paths
|
|
74
|
+
// filesystem paths, which the run's public-safety scan then rightly rejects.
|
|
75
75
|
execSync("pnpm --filter humanish-observer build", {
|
|
76
76
|
cwd: repoRoot,
|
|
77
77
|
stdio: ["ignore", "pipe", "inherit"],
|
|
@@ -79,7 +79,7 @@ function loadObserverArtifact() {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
catch {
|
|
82
|
-
throw new Error("observer workspace build failed
|
|
82
|
+
throw new Error("observer workspace build failed; run `pnpm --filter humanish-observer build` to see the full output.");
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -169,7 +169,7 @@ function renderObserverAppHtml(data, snapshot, analysis, assets) {
|
|
|
169
169
|
.replace(OBSERVER_DATA_SLOT, () => `<script id="observer-data" type="application/json">${escapeJsonScript(data)}</script>`)
|
|
170
170
|
.replace(/<script id="study-analysis" type="application\/json">[\s\S]*?<\/script>/, () => `<script id="study-analysis" type="application/json">${escapeJsonScript(analysis)}</script>`)
|
|
171
171
|
.replace("</body>", () => `${renderExportAssets(assets)}</body>`)
|
|
172
|
-
.replace(/<title>[^<]*<\/title>/, () => `<title>humanish Observer
|
|
172
|
+
.replace(/<title>[^<]*<\/title>/, () => `<title>humanish Observer · ${escapeHtml(data.run.runId)}</title>`);
|
|
173
173
|
}
|
|
174
174
|
/** Render current packaged UI around a validated/projected Observer snapshot. */
|
|
175
175
|
export function renderObserverHtml(data, options = {}) {
|
package/dist/observer/data.d.ts
CHANGED
|
@@ -31,18 +31,18 @@ export interface ObserverData {
|
|
|
31
31
|
lifecycle: RunBundle["lifecycle"];
|
|
32
32
|
knownGaps: string[];
|
|
33
33
|
/**
|
|
34
|
-
* What happened to the
|
|
34
|
+
* What happened to the participants, with the denominator attached. `status` above collapses the
|
|
35
35
|
* run to one word for a gate; this is the study result, and it is what the person watching
|
|
36
36
|
* through the glass actually wants to know. Absent on a bundle with no participants.
|
|
37
37
|
*
|
|
38
|
-
* A viewing room that shows only vivid moments manufactures certainty from n=1
|
|
38
|
+
* A viewing room that shows only vivid moments manufactures certainty from n=1, so the count
|
|
39
39
|
* travels with the outcome here, always (docs/principles/three-roles.md).
|
|
40
40
|
*/
|
|
41
41
|
participants?: RunBundle["review"]["participants"];
|
|
42
42
|
/** The same thing as one readable line, so a renderer cannot accidentally show a number
|
|
43
43
|
* without its denominator. */
|
|
44
44
|
participantsLine?: string;
|
|
45
|
-
/** The study's per-task completion rates
|
|
45
|
+
/** The study's per-task completion rates, when the lab declared a protocol. */
|
|
46
46
|
tasks?: RunBundle["review"]["tasks"];
|
|
47
47
|
/** Pre-formatted like participantsLine, denominator on every number. */
|
|
48
48
|
tasksLine?: string;
|
|
@@ -56,8 +56,8 @@ export interface ObserverData {
|
|
|
56
56
|
};
|
|
57
57
|
laneGroups: ObserverLaneGroup[];
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
* (humanish.run-cost-summary.v1). Absent when the bundle carries none. The Observer
|
|
59
|
+
* Optional run-level cost estimate projected straight through from the bundle
|
|
60
|
+
* (humanish.run-cost-summary.v1). Absent when the bundle carries none. The Observer labels every
|
|
61
61
|
* figure as estimated (rates as of <asOf>) and never presents it as an authoritative charge.
|
|
62
62
|
*/
|
|
63
63
|
cost?: RunCostSummary;
|
|
@@ -68,7 +68,7 @@ export interface ObserverData {
|
|
|
68
68
|
publishable: false;
|
|
69
69
|
note: string;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Additive + optional: the result of verification at static render or
|
|
72
72
|
* export time. Unverified projections omit this field. The timestamp records
|
|
73
73
|
* that check; it is not an assertion about subsequent file changes.
|
|
74
74
|
*/
|
package/dist/observer/data.js
CHANGED
|
@@ -33,7 +33,7 @@ export function buildObserverData(bundle, generatedAt = new Date().toISOString()
|
|
|
33
33
|
const sim = bundle.simulations.find((candidate) => candidate.id === stream.simId) ??
|
|
34
34
|
fallbackSimulation(bundle, stream);
|
|
35
35
|
// A natural session can finish its protocol while the participant explicitly reports a
|
|
36
|
-
// blocker
|
|
36
|
+
// blocker. Match the review's typed-outcome rule without rewriting the raw trace or
|
|
37
37
|
// guessing from prose. Never turn an active or failed harness into a participant outcome.
|
|
38
38
|
const status = (stream.status === "passed" || stream.status === "complete") &&
|
|
39
39
|
stream.actor?.completionReason === "goal_satisfied" &&
|
|
@@ -47,7 +47,7 @@ export function buildObserverData(bundle, generatedAt = new Date().toISOString()
|
|
|
47
47
|
status,
|
|
48
48
|
sim,
|
|
49
49
|
kindLabel: kindLabel(stream.kind),
|
|
50
|
-
statusLabel: statusLabel(status),
|
|
50
|
+
statusLabel: statusLabel(status, bundle.mode),
|
|
51
51
|
terminalPlain: stripAnsi(stream.terminal?.tail ?? ""),
|
|
52
52
|
timeline: [
|
|
53
53
|
...events.filter((event) => event.simId === sim.id || event.streamId === stream.id),
|
|
@@ -229,10 +229,11 @@ function kindLabel(kind) {
|
|
|
229
229
|
return "Summary";
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
/** `contract_proof_only` reads "Dry run" on a dry run; a live participant with it has no result. */
|
|
233
|
+
function statusLabel(status, mode) {
|
|
233
234
|
switch (status) {
|
|
234
235
|
case "contract_proof_only":
|
|
235
|
-
return "
|
|
236
|
+
return mode === "dry-run" ? "Dry run" : "No verdict";
|
|
236
237
|
case "preparing":
|
|
237
238
|
return "Preparing";
|
|
238
239
|
case "queued":
|
|
@@ -47,7 +47,7 @@ export type ExposureValidation = {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
/** Why `watch` refuses `--safe`, on every watch path. */
|
|
50
|
-
export declare const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready
|
|
50
|
+
export declare const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready, so --safe (a share_ready library filter for `observe --all`) cannot apply. Restrict viewers with edge auth: --allow-email / --allow-domain.";
|
|
51
51
|
export declare function validateExposure(surface: ExposureSurface, request: ExposureRequest, live?: WatchLiveContext): ExposureValidation;
|
|
52
52
|
export interface ExposableServer {
|
|
53
53
|
readonly port: number;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
// Shared fail-closed exposure validation + tunnel orchestration for
|
|
2
|
-
// finished runs) and `watch` (one live run). Exposure auth is
|
|
1
|
+
// Shared fail-closed exposure validation + tunnel orchestration for both `serve` (a library of
|
|
2
|
+
// finished runs) and `watch` (one live run). Exposure auth is tunnel-edge only: humanish carries no
|
|
3
3
|
// in-process auth. Exposure is admitted only behind edge auth (ngrok --oauth google, or an operator
|
|
4
|
-
// --public-url they secure)
|
|
5
|
-
// is never share_ready (raw, unverified screenshots), so watch --expose
|
|
4
|
+
// --public-url they secure) or, for serve, behind --safe (share_ready runs only). A live watch run
|
|
5
|
+
// is never share_ready (raw, unverified screenshots), so watch --expose always requires edge auth.
|
|
6
6
|
//
|
|
7
7
|
// This module is pure with respect to the fail-closed matrix (validateExposure) and thin over the
|
|
8
8
|
// tunnel launcher (startExposedObserver), so the CLI just maps flags in and results out.
|
|
9
9
|
import { parsePublicOrigin } from "./http.js";
|
|
10
10
|
import { startNgrokTunnel } from "./tunnel.js";
|
|
11
11
|
/** Why `watch` refuses `--safe`, on every watch path. */
|
|
12
|
-
export const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready
|
|
12
|
+
export const WATCH_SAFE_NOT_APPLICABLE_MESSAGE = "watch streams a single live run that is never share_ready, so --safe (a share_ready library filter for `observe --all`) cannot apply. Restrict viewers with edge auth: --allow-email / --allow-domain.";
|
|
13
13
|
function code(surface, suffix) {
|
|
14
14
|
return `HUMANISH_${surface.toUpperCase()}_${suffix}`;
|
|
15
15
|
}
|
|
@@ -70,12 +70,12 @@ export function validateExposure(surface, request, live) {
|
|
|
70
70
|
const warnings = [];
|
|
71
71
|
if (surface === "watch") {
|
|
72
72
|
// A live, in-progress run is never share_ready (raw screenshots, unverified), so --safe would
|
|
73
|
-
// admit nothing and expose nothing: watch --expose
|
|
73
|
+
// admit nothing and expose nothing: watch --expose always requires edge auth, and the live-follow
|
|
74
74
|
// preconditions are checked first so `--dry-run`/`--detach`/`--json` fail with the clearer reason.
|
|
75
75
|
if (live && (live.dryRun || live.detach || live.json)) {
|
|
76
76
|
return fail("EXPOSE_REQUIRES_LIVE_FOLLOW", "watch --expose streams a live desktop over an attached follow channel; it cannot combine with --dry-run, --detach, or --json.");
|
|
77
77
|
}
|
|
78
|
-
// --safe is a share_ready
|
|
78
|
+
// --safe is a share_ready library filter for `serve`; watch streams a single live run that is
|
|
79
79
|
// never share_ready, so --safe would silently do nothing here. Reject it rather than ignore it.
|
|
80
80
|
if (request.safe) {
|
|
81
81
|
return fail("SAFE_NOT_APPLICABLE", WATCH_SAFE_NOT_APPLICABLE_MESSAGE);
|
|
@@ -85,18 +85,18 @@ export function validateExposure(surface, request, live) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
// serve: --expose must
|
|
88
|
+
// serve: --expose must always resolve to a reachable public origin (a tunnel or a --public-url),
|
|
89
89
|
// even under --safe. Without one the exposed server is an unreachable loopback no-op, so fail
|
|
90
|
-
// closed before the origin-less bind. When an origin
|
|
90
|
+
// closed before the origin-less bind. When an origin is present, keep the edge-auth-or-safe gate.
|
|
91
91
|
if (!request.tunnel && !publicOrigin) {
|
|
92
92
|
return fail("EXPOSE_REQUIRES_ORIGIN", "--expose needs a declared public origin: pass --tunnel ngrok or --public-url <origin>.");
|
|
93
93
|
}
|
|
94
94
|
if (!edgeAuthed && !request.safe) {
|
|
95
|
-
return fail("EXPOSE_REQUIRES_EDGE_AUTH_OR_SAFE", "--expose opens a public URL to local run bundles
|
|
95
|
+
return fail("EXPOSE_REQUIRES_EDGE_AUTH_OR_SAFE", "--expose opens a public URL to local run bundles, so it needs edge auth (--oauth google with --tunnel, or a --public-url you secure) or --safe (share_ready runs only).");
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
if (request.oauth && request.allowEmails.length === 0 && request.allowDomains.length === 0) {
|
|
99
|
-
warnings.push("ngrok --oauth google
|
|
99
|
+
warnings.push("ngrok --oauth google without --allow-email or --allow-domain lets in any Google account that reaches the URL. Add at least one allow rule to choose who can watch.");
|
|
100
100
|
}
|
|
101
101
|
const mode = edgeAuthed ? "exposed" : "share-safe-open";
|
|
102
102
|
return {
|
package/dist/observer/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Shared HTTP hardening primitives for the serve surfaces. Extracted here so
|
|
1
|
+
// Shared HTTP hardening primitives for the serve surfaces. Extracted here so both the live
|
|
2
2
|
// Observer server (src/observer/render.ts) and the run-library server
|
|
3
3
|
// (src/observer/serve.ts) can enforce the identical Host allowlist + security-header posture
|
|
4
4
|
// without a module cycle. This file imports nothing from the serve modules.
|
|
@@ -9,7 +9,7 @@ export interface LibraryHistory {
|
|
|
9
9
|
/** Current contained status-record observation, separate from the evidence verdict. */
|
|
10
10
|
runtimeState?: "running" | "finished" | "interrupted" | "unknown";
|
|
11
11
|
streamCount: number;
|
|
12
|
-
/** Labeled run-total cost
|
|
12
|
+
/** Labeled run-total cost estimate (null when the run carries no cost summary). */
|
|
13
13
|
estimatedCostUsd: number | null;
|
|
14
14
|
costRatesAsOf: string | null;
|
|
15
15
|
costPlaceholder: boolean;
|
package/dist/observer/library.js
CHANGED
|
@@ -7,8 +7,8 @@ const STATUS_TONES = {
|
|
|
7
7
|
};
|
|
8
8
|
export function renderLibraryHtml(history, opts) {
|
|
9
9
|
const emptyState = opts.safe
|
|
10
|
-
? "No share_ready runs yet
|
|
11
|
-
: "No runs yet
|
|
10
|
+
? "No share_ready runs yet. Run `humanish verify` to see why."
|
|
11
|
+
: "No runs yet. Run `humanish watch` to create one.";
|
|
12
12
|
return `<!doctype html>
|
|
13
13
|
<html lang="en" data-theme="dark">
|
|
14
14
|
<head>
|
|
@@ -39,6 +39,7 @@ function modeLabel(opts) {
|
|
|
39
39
|
const auth = opts.mode === "exposed" ? "edge-authed" : opts.mode === "share-safe-open" ? "open" : "loopback";
|
|
40
40
|
return opts.safe ? `${auth} · share_ready only` : auth;
|
|
41
41
|
}
|
|
42
|
+
// prose-check: script (the library page's CSS)
|
|
42
43
|
function libraryCss() {
|
|
43
44
|
return `
|
|
44
45
|
:root { color-scheme: dark; }
|
|
@@ -80,6 +81,7 @@ main { padding: 1rem 1.1rem 3rem; max-width: 44rem; margin: 0 auto; }
|
|
|
80
81
|
.empty { color: #9aa3b2; font-size: 0.85rem; padding: 2rem 0; text-align: center; }
|
|
81
82
|
`;
|
|
82
83
|
}
|
|
84
|
+
// prose-check: script (the library page's JavaScript)
|
|
83
85
|
function libraryClientJs() {
|
|
84
86
|
const tones = JSON.stringify(STATUS_TONES);
|
|
85
87
|
return `
|
package/dist/observer/listen.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// One loopback bind for every humanish server, with the one failure people actually hit named.
|
|
2
2
|
//
|
|
3
|
-
// `listen EADDRINUSE`
|
|
4
|
-
// "a handler threw"
|
|
5
|
-
// a serve command has: a second session, a forgotten background one, someone's
|
|
6
|
-
// bites with an explicit --port, which is exactly when a person is asking for a
|
|
3
|
+
// `listen EADDRINUSE` becomes PortInUseError: HUMANISH_UNEXPECTED, the command-boundary catch-all
|
|
4
|
+
// for "a handler threw", would misname it. Something already serving on the port is the most
|
|
5
|
+
// expected condition a serve command has: a second session, a forgotten background one, someone's
|
|
6
|
+
// dev server. It only bites with an explicit --port, which is exactly when a person is asking for a
|
|
7
|
+
// stable address.
|
|
7
8
|
export class PortInUseError extends Error {
|
|
8
9
|
port;
|
|
9
10
|
holder;
|
|
@@ -48,7 +48,7 @@ export declare function serveObserver(result: ObserverResult, options?: Observer
|
|
|
48
48
|
export interface DesktopOpenerHost {
|
|
49
49
|
platform: NodeJS.Platform;
|
|
50
50
|
env: NodeJS.ProcessEnv;
|
|
51
|
-
/** Whether an executable with this name is on the host's PATH
|
|
51
|
+
/** Whether an executable with this name is on the host's `PATH`. */
|
|
52
52
|
onPath(name: string): boolean;
|
|
53
53
|
}
|
|
54
54
|
/**
|
package/dist/observer/render.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
+
import { runNotFoundMessage } from "../run/run-not-found.js";
|
|
2
3
|
import { accessSync, constants } from "node:fs";
|
|
3
4
|
import { realpath } from "node:fs/promises";
|
|
4
5
|
import { createServer } from "node:http";
|
|
@@ -22,6 +23,10 @@ const observerPreparedRunPaths = new WeakMap();
|
|
|
22
23
|
export function attachObserverRuntimeStreamUrls(result, streams) {
|
|
23
24
|
observerRuntimeStreamUrls.set(result, streams.filter((stream) => stream.streamId && stream.url));
|
|
24
25
|
}
|
|
26
|
+
async function runNotFound(cwd, runInput) {
|
|
27
|
+
const message = await runNotFoundMessage(cwd, runInput);
|
|
28
|
+
return observerRunError(cwd, runInput, "HUMANISH_RUN_NOT_FOUND", message);
|
|
29
|
+
}
|
|
25
30
|
export async function renderObserver(cwdInput, runInput, options = {}) {
|
|
26
31
|
const cwd = path.resolve(cwdInput);
|
|
27
32
|
let selection;
|
|
@@ -46,7 +51,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
|
|
|
46
51
|
selection = null;
|
|
47
52
|
}
|
|
48
53
|
if (!selection) {
|
|
49
|
-
return
|
|
54
|
+
return runNotFound(cwd, runInput);
|
|
50
55
|
}
|
|
51
56
|
let preparedRunPaths;
|
|
52
57
|
try {
|
|
@@ -80,7 +85,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
|
|
|
80
85
|
const loaded = await loadRunBundlePrepared(selectedPhysicalCwd, preparedRunPaths);
|
|
81
86
|
await validatePreparedRunArtifactPaths(preparedRunPaths);
|
|
82
87
|
if (!loaded) {
|
|
83
|
-
return
|
|
88
|
+
return runNotFound(cwd, runInput);
|
|
84
89
|
}
|
|
85
90
|
if (loaded.bundle.runId !== selection.runId ||
|
|
86
91
|
(await realpath(loaded.runDir)) !== preparedRunPaths.physicalRunRoot) {
|
|
@@ -118,7 +123,7 @@ export async function renderObserver(cwdInput, runInput, options = {}) {
|
|
|
118
123
|
warnings: [
|
|
119
124
|
loaded.bundle.mode === "live"
|
|
120
125
|
? "Observer renders verified local evidence artifacts; runtime stream auth URLs are not persisted."
|
|
121
|
-
: "
|
|
126
|
+
: "This is a dry run: its participants are synthetic and no product behavior was tested.",
|
|
122
127
|
"Before filing public feedback, use `humanish feedback issue` so redaction and public-safety checks gate the payload.",
|
|
123
128
|
...(openResult.warning ? [openResult.warning] : []),
|
|
124
129
|
],
|
|
@@ -290,7 +295,7 @@ export function desktopOpener(target, host) {
|
|
|
290
295
|
if (host.platform === "win32")
|
|
291
296
|
return { command: "cmd", args: ["/c", "start", "", target] };
|
|
292
297
|
if (!host.env.DISPLAY && !host.env.WAYLAND_DISPLAY)
|
|
293
|
-
return { reason: "no display is available (DISPLAY and WAYLAND_DISPLAY are unset)" };
|
|
298
|
+
return { reason: "no display is available (`DISPLAY` and `WAYLAND_DISPLAY` are unset)" };
|
|
294
299
|
if (!host.onPath("xdg-open"))
|
|
295
300
|
return { reason: "xdg-open is not installed" };
|
|
296
301
|
return { command: "xdg-open", args: [target] };
|
|
@@ -322,7 +327,7 @@ export function openTarget(target, host = { platform: process.platform, env: pro
|
|
|
322
327
|
detached: true,
|
|
323
328
|
stdio: "ignore",
|
|
324
329
|
});
|
|
325
|
-
// An opener that disappears after the PATH check still fails asynchronously (ENOENT). The
|
|
330
|
+
// An opener that disappears after the `PATH` check still fails asynchronously (ENOENT). The
|
|
326
331
|
// served URL remains usable; an opener must never crash its server.
|
|
327
332
|
child.on("error", () => { });
|
|
328
333
|
child.unref();
|
|
@@ -5,13 +5,13 @@ export interface ObserverRuntimeStreamUrl {
|
|
|
5
5
|
streamId: string;
|
|
6
6
|
url: string;
|
|
7
7
|
/** Set when the participant's sandbox is gone (finished or torn down). An ended stream's live URL is a
|
|
8
|
-
* dead noVNC page
|
|
9
|
-
* evidence (keyframe replay/screenshot) instead of rendering "sandbox not found"
|
|
8
|
+
* dead noVNC page; the overlay stops injecting it so the tile falls back to the recorded
|
|
9
|
+
* evidence (keyframe replay/screenshot) instead of rendering "sandbox not found". */
|
|
10
10
|
ended?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/** internal: consumed by src/observer/serve.ts */
|
|
13
13
|
export declare function serveRunPath(runRoot: PinnedDirectory, relativePath: string, response: ServerResponse, runtimeStreamUrls?: ObserverRuntimeStreamUrl[], request?: Pick<IncomingMessage, "method" | "headers">): Promise<void>;
|
|
14
|
-
/** internal: exported for the
|
|
14
|
+
/** internal: exported for the stream lifecycle tests. */
|
|
15
15
|
export declare function withRuntimeStreamUrls(data: ObserverData, runtimeStreamUrls: ObserverRuntimeStreamUrl[]): ObserverData;
|
|
16
16
|
/** internal: consumed by src/observer/serve.ts */
|
|
17
17
|
export declare function buildHistoryIndex(proofRoot: PinnedDirectory, admitRun?: (runId: string, pinned: PinnedDirectory) => Promise<PinnedDirectory | null>): Promise<{
|
|
@@ -161,7 +161,7 @@ async function withLocalRunStatus(runRoot, input) {
|
|
|
161
161
|
return data;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
/** internal: exported for the
|
|
164
|
+
/** internal: exported for the stream lifecycle tests. */
|
|
165
165
|
export function withRuntimeStreamUrls(data, runtimeStreamUrls) {
|
|
166
166
|
const byStream = new Map(runtimeStreamUrls.map((stream) => [stream.streamId, stream]));
|
|
167
167
|
return {
|
package/dist/observer/serve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { listenOnLoopback, PortInUseError } from "./listen.js";
|
|
2
|
+
import { runNotFoundMessage } from "../run/run-not-found.js";
|
|
2
3
|
import { createServer } from "node:http";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { pinDirectChildDirectory, pinDirectory } from "./pinned-files.js";
|
|
@@ -215,7 +216,10 @@ export async function serveObserverLibrary(cwdInput, options) {
|
|
|
215
216
|
if (!resolved || !pinned) {
|
|
216
217
|
return {
|
|
217
218
|
ok: false,
|
|
218
|
-
error: {
|
|
219
|
+
error: {
|
|
220
|
+
code: "HUMANISH_RUN_NOT_FOUND",
|
|
221
|
+
message: await runNotFoundMessage(cwd, options.entryRunId),
|
|
222
|
+
},
|
|
219
223
|
};
|
|
220
224
|
}
|
|
221
225
|
if (options.safe && (await admission.admit(resolved)) === null) {
|
|
@@ -232,7 +236,7 @@ export async function serveObserverLibrary(cwdInput, options) {
|
|
|
232
236
|
}
|
|
233
237
|
entryRunId = resolved;
|
|
234
238
|
}
|
|
235
|
-
// Counts are computed over the
|
|
239
|
+
// Counts are computed over the uncapped run list, not the 80-item history
|
|
236
240
|
// index: an edge-authed surface (non-safe) grants access to every run by direct
|
|
237
241
|
// URL, and share-safe modes admit every share_ready run per request, so a
|
|
238
242
|
// count capped at 80 would understate exactly what the exposure warning
|
|
@@ -277,7 +281,7 @@ export async function serveObserverLibrary(cwdInput, options) {
|
|
|
277
281
|
}
|
|
278
282
|
catch (error) {
|
|
279
283
|
if (error instanceof PortInUseError) {
|
|
280
|
-
// The most expected failure a serve command has, named instead of HUMANISH_UNEXPECTED
|
|
284
|
+
// The most expected failure a serve command has, named instead of HUMANISH_UNEXPECTED.
|
|
281
285
|
return { ok: false, error: { code: "HUMANISH_SERVE_PORT_IN_USE", message: error.message } };
|
|
282
286
|
}
|
|
283
287
|
throw error;
|
package/dist/observer/tunnel.js
CHANGED
|
@@ -54,7 +54,7 @@ export async function startNgrokTunnel(options) {
|
|
|
54
54
|
child.once("error", (error) => {
|
|
55
55
|
settle({
|
|
56
56
|
error: error.code === "ENOENT"
|
|
57
|
-
? new ServeTunnelError("HUMANISH_SERVE_TUNNEL_NOT_FOUND", "ngrok binary not found on PATH
|
|
57
|
+
? new ServeTunnelError("HUMANISH_SERVE_TUNNEL_NOT_FOUND", "ngrok binary not found on `PATH`. Install ngrok, or run your own tunnel and pass --public-url <origin>.")
|
|
58
58
|
: new ServeTunnelError("HUMANISH_SERVE_TUNNEL_START_FAILED", `ngrok failed to start: ${error.message}`),
|
|
59
59
|
});
|
|
60
60
|
});
|