humanish 0.106.0 → 0.107.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 +4 -2
- package/ARCHITECTURE.md +17 -16
- package/CHANGELOG.md +24 -0
- package/CONTEXT.md +42 -39
- package/CONTRIBUTING.md +8 -6
- package/README.md +8 -3
- package/dist/actors/codex/app-server-client.js +2 -1
- package/dist/actors/codex/app-server-trace.d.ts +0 -1
- package/dist/actors/codex/app-server-trace.js +1 -3
- package/dist/actors/codex/app-server.js +2 -1
- package/dist/actors/codex/protocol-compat.d.ts +27 -0
- package/dist/actors/codex/protocol-compat.js +357 -0
- package/dist/actors/codex/protocol-contract.d.ts +61 -0
- package/dist/actors/codex/protocol-contract.js +471 -0
- package/dist/actors/codex/qualified-versions.d.ts +31 -4
- package/dist/actors/codex/qualified-versions.js +51 -6
- package/dist/actors/codex/restricted-executable.d.ts +24 -0
- package/dist/actors/codex/restricted-executable.js +97 -22
- package/dist/actors/codex/restricted-launch.d.ts +7 -1
- package/dist/actors/codex/restricted-launch.js +42 -3
- package/dist/actors/codex/restricted-notifications.d.ts +101 -0
- package/dist/actors/codex/restricted-notifications.js +277 -0
- package/dist/actors/codex/restricted-participant.d.ts +30 -0
- package/dist/actors/codex/restricted-participant.js +60 -2
- package/dist/actors/codex/restricted-policy.d.ts +9 -1
- package/dist/actors/codex/restricted-session.d.ts +14 -1
- package/dist/actors/codex/restricted-session.js +50 -17
- package/dist/actors/codex/restricted-transport.d.ts +29 -0
- package/dist/actors/codex/restricted-transport.js +139 -27
- package/dist/actors/codex/restricted-turn.d.ts +19 -4
- package/dist/actors/codex/restricted-turn.js +43 -30
- package/dist/actors/computer-use/actor.d.ts +1 -1
- package/dist/actors/computer-use/actor.js +4 -4
- package/dist/actors/computer-use/loop/backstop.js +1 -1
- package/dist/actors/computer-use/loop/ending.d.ts +2 -2
- package/dist/actors/computer-use/loop/ending.js +2 -2
- package/dist/actors/computer-use/loop/spend.d.ts +1 -1
- package/dist/actors/computer-use/loop/spend.js +3 -3
- package/dist/actors/computer-use/loop/trace.js +2 -2
- package/dist/actors/computer-use/loop/types.d.ts +14 -5
- package/dist/actors/computer-use/loop.js +4 -4
- package/dist/actors/computer-use/openai-provider.d.ts +1 -1
- package/dist/actors/computer-use/openai-provider.js +2 -2
- package/dist/actors/contract.d.ts +10 -8
- package/dist/actors/contract.js +7 -1
- package/dist/actors/local-agent/cli.js +1 -1
- package/dist/actors/scripted-browser/actor.d.ts +2 -2
- package/dist/actors/scripted-browser/journey.js +15 -4
- package/dist/actors/scripted-browser/steps.js +18 -0
- package/dist/actors/scripted-browser/types.d.ts +11 -1
- package/dist/actors/stop-conditions.js +1 -3
- package/dist/analysis/automatic-completion.d.ts +13 -8
- package/dist/analysis/automatic-completion.js +14 -8
- package/dist/analysis/automatic-config.d.ts +1 -1
- package/dist/analysis/automatic-config.js +2 -2
- package/dist/analysis/automatic.d.ts +10 -4
- package/dist/analysis/automatic.js +17 -13
- package/dist/analysis/diagnostics.d.ts +23 -0
- package/dist/analysis/diagnostics.js +112 -0
- package/dist/analysis/evidence-sources.js +2 -2
- package/dist/analysis/evidence.js +6 -6
- package/dist/analysis/execute.d.ts +7 -1
- package/dist/analysis/execute.js +39 -12
- package/dist/analysis/job.d.ts +8 -5
- package/dist/analysis/job.js +15 -14
- package/dist/analysis/load.d.ts +1 -1
- package/dist/analysis/load.js +5 -5
- package/dist/analysis/provider.d.ts +9 -1
- package/dist/analysis/restricted-codex.d.ts +2 -0
- package/dist/analysis/restricted-codex.js +10 -1
- package/dist/analysis/service.d.ts +2 -0
- package/dist/analysis/service.js +31 -12
- package/dist/analysis/sharing.d.ts +2 -2
- package/dist/analysis/sharing.js +5 -5
- package/dist/analysis/store-executions.d.ts +5 -5
- package/dist/analysis/store-executions.js +12 -12
- package/dist/analysis/store.d.ts +4 -4
- package/dist/analysis/store.js +13 -13
- package/dist/cli/commands/analysis-signals.d.ts +2 -1
- package/dist/cli/commands/analysis-signals.js +4 -1
- package/dist/cli/commands/analyze.js +4 -2
- package/dist/cli/commands/comms.js +8 -1
- package/dist/cli/commands/lab-route-computer-use.d.ts +0 -2
- package/dist/cli/commands/lab-route-computer-use.js +26 -14
- package/dist/cli/commands/lab-route-preview.d.ts +1 -3
- package/dist/cli/commands/lab-route-preview.js +3 -4
- package/dist/cli/commands/lab-route-run.d.ts +6 -4
- package/dist/cli/commands/lab-route-run.js +6 -2
- package/dist/cli/commands/lab-route-scripted.d.ts +0 -2
- package/dist/cli/commands/lab-route-scripted.js +0 -1
- package/dist/cli/commands/lab-route-shared-world.d.ts +0 -2
- package/dist/cli/commands/lab-route-shared-world.js +0 -1
- package/dist/cli/commands/lab-route-terminal.d.ts +0 -2
- package/dist/cli/commands/lab-route-terminal.js +0 -1
- package/dist/cli/commands/lab-run.js +76 -45
- package/dist/cli/commands/lab-scorer.d.ts +0 -2
- package/dist/cli/commands/lab.js +12 -6
- package/dist/cli/commands/observe.js +22 -0
- package/dist/cli/commands/run-signals.d.ts +30 -0
- package/dist/cli/commands/run-signals.js +146 -0
- package/dist/cli/commands/runs.js +10 -8
- package/dist/cli/commands/watch.js +12 -10
- package/dist/cli/doctor.d.ts +3 -0
- package/dist/cli/doctor.js +10 -2
- package/dist/cli/io.d.ts +5 -4
- package/dist/cli/io.js +12 -8
- package/dist/cli/program.js +3 -3
- package/dist/cli/renamed-options.d.ts +11 -0
- package/dist/cli/renamed-options.js +18 -0
- package/dist/cli/telemetry.d.ts +2 -2
- package/dist/cli/telemetry.js +1 -1
- package/dist/comms/capture-surface.d.ts +1 -1
- package/dist/comms/catch-host.d.ts +1 -1
- package/dist/comms/connections.js +4 -4
- package/dist/comms/external-evidence.d.ts +27 -0
- package/dist/comms/external-evidence.js +93 -0
- package/dist/comms/lease-store.js +7 -7
- package/dist/comms/types.js +1 -1
- package/dist/evidence/browser-hygiene.d.ts +1 -1
- package/dist/evidence/browser-hygiene.js +1 -1
- package/dist/evidence/redaction.js +1 -1
- package/dist/evidence/secret-scrub.d.ts +9 -0
- package/dist/evidence/secret-scrub.js +96 -0
- package/dist/feedback/draft.js +7 -9
- package/dist/feedback/export-bundle.js +4 -4
- package/dist/feedback/export.js +9 -9
- package/dist/feedback/feedback.d.ts +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.js +3 -6
- package/dist/keys/key-resolution.d.ts +3 -1
- package/dist/keys/key-resolution.js +18 -16
- package/dist/lab/adapter-extension.d.ts +28 -6
- package/dist/lab/adapter-extension.js +65 -126
- package/dist/lab/adapter-scorer-loader.d.ts +25 -5
- package/dist/lab/adapter-scorer-loader.js +24 -0
- package/dist/lab/composition-rules.d.ts +2 -0
- package/dist/lab/composition-rules.js +35 -26
- package/dist/lab/config.js +28 -26
- package/dist/lab/device-presets.d.ts +2 -2
- package/dist/lab/discover.js +1 -3
- package/dist/lab/doctor.d.ts +44 -9
- package/dist/lab/doctor.js +149 -41
- package/dist/lab/init-plan.js +1 -3
- package/dist/lab/keys.js +1 -1
- package/dist/lab/lab-deps.d.ts +85 -0
- package/dist/lab/lab-deps.js +4 -0
- package/dist/lab/parse/actors.js +8 -7
- package/dist/lab/parse/comms.js +3 -2
- package/dist/lab/parse/execution.js +3 -2
- package/dist/lab/parse/subject-state.js +2 -1
- package/dist/lab/parse/subject.js +2 -1
- package/dist/lab/parse/values.d.ts +0 -1
- package/dist/lab/parse/values.js +0 -3
- package/dist/lab/persona-resolve.d.ts +3 -3
- package/dist/lab/persona-resolve.js +4 -4
- package/dist/lab/persona.js +1 -3
- package/dist/lab/plan-base.d.ts +6 -2
- package/dist/lab/plan-base.js +22 -7
- package/dist/lab/plan-participants.d.ts +5 -5
- package/dist/lab/plan-participants.js +2 -2
- package/dist/lab/plan-types.d.ts +33 -7
- package/dist/lab/plan.d.ts +3 -11
- package/dist/lab/plan.js +18 -42
- package/dist/lab/preflight-result.js +0 -2
- package/dist/lab/preflight.d.ts +0 -3
- package/dist/lab/preflight.js +1 -1
- package/dist/lab/requirements.d.ts +20 -0
- package/dist/lab/requirements.js +54 -0
- package/dist/lab/route-inputs.d.ts +23 -12
- package/dist/lab/route-inputs.js +48 -51
- package/dist/lab/routing.d.ts +19 -24
- package/dist/lab/routing.js +14 -47
- package/dist/lab/run-lab-events.d.ts +6 -11
- package/dist/lab/run-lab-events.js +3 -11
- package/dist/lab/run-lab-homes.d.ts +64 -0
- package/dist/lab/run-lab-homes.js +3 -0
- package/dist/lab/run-lab-options.d.ts +12 -66
- package/dist/lab/run-lab-options.js +45 -275
- package/dist/lab/summary.d.ts +9 -4
- package/dist/lab/summary.js +15 -8
- package/dist/lab/types.d.ts +132 -132
- package/dist/lab/validation.d.ts +15 -15
- package/dist/lab/validation.js +28 -28
- package/dist/lab/warnings.js +20 -19
- package/dist/observer/artifact.d.ts +1 -1
- package/dist/observer/artifact.js +3 -3
- package/dist/observer/data.js +2 -2
- package/dist/observer/render.js +2 -2
- package/dist/observer/run-routes.d.ts +1 -1
- package/dist/observer/run-routes.js +5 -5
- package/dist/observer/serve.d.ts +17 -0
- package/dist/observer/serve.js +34 -3
- package/dist/observer-app.html +1 -1
- package/dist/routes/computer-use/bundle-parts.d.ts +1 -1
- package/dist/routes/computer-use/bundle-parts.js +10 -3
- package/dist/routes/computer-use/bundle.d.ts +4 -11
- package/dist/routes/computer-use/bundle.js +9 -15
- package/dist/routes/computer-use/diagnostics.d.ts +1 -1
- package/dist/routes/computer-use/diagnostics.js +1 -1
- package/dist/routes/computer-use/e2b-desktop/comms.d.ts +10 -10
- package/dist/routes/computer-use/e2b-desktop/comms.js +11 -14
- package/dist/routes/computer-use/e2b-desktop/desktop.d.ts +2 -2
- package/dist/routes/computer-use/e2b-desktop/desktop.js +4 -7
- package/dist/routes/computer-use/e2b-desktop/fidelity.d.ts +13 -13
- package/dist/routes/computer-use/e2b-desktop/fidelity.js +11 -11
- package/dist/routes/computer-use/e2b-desktop/prepare.d.ts +3 -3
- package/dist/routes/computer-use/e2b-desktop/prepare.js +33 -36
- package/dist/routes/computer-use/e2b-desktop/start.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/start.js +24 -23
- package/dist/routes/computer-use/e2b-desktop/state.d.ts +5 -4
- package/dist/routes/computer-use/e2b-desktop/state.js +5 -3
- package/dist/routes/computer-use/e2b-desktop/teardown.d.ts +1 -1
- package/dist/routes/computer-use/e2b-desktop/teardown.js +29 -17
- package/dist/routes/computer-use/external-comms.d.ts +4 -4
- package/dist/routes/computer-use/external-comms.js +19 -43
- package/dist/routes/computer-use/fanout-bundle.d.ts +3 -3
- package/dist/routes/computer-use/fanout-bundle.js +25 -29
- package/dist/routes/computer-use/{fanout-lanes.js → fanout-records.js} +25 -19
- package/dist/routes/computer-use/in-process-desktop.d.ts +3 -10
- package/dist/routes/computer-use/in-process-desktop.js +3 -9
- package/dist/routes/computer-use/live-flush.d.ts +7 -5
- package/dist/routes/computer-use/live-flush.js +19 -27
- package/dist/routes/computer-use/{run-lanes.js → live-phase.js} +14 -13
- package/dist/routes/computer-use/local-tree-pack.d.ts +3 -3
- package/dist/routes/computer-use/local-tree-pack.js +4 -5
- package/dist/routes/computer-use/local-vm.d.ts +11 -8
- package/dist/routes/computer-use/local-vm.js +39 -66
- package/dist/routes/computer-use/participant-desktop.d.ts +8 -23
- package/dist/routes/computer-use/participant-desktop.js +5 -25
- package/dist/routes/computer-use/{lanes.d.ts → participant-execution.d.ts} +10 -10
- package/dist/routes/computer-use/{lanes.js → participant-execution.js} +35 -22
- package/dist/routes/computer-use/participant-facts.d.ts +7 -1
- package/dist/routes/computer-use/participant-facts.js +12 -1
- package/dist/routes/computer-use/participant-model.d.ts +19 -11
- package/dist/routes/computer-use/participant-model.js +58 -33
- package/dist/routes/computer-use/participant-prompt.d.ts +3 -3
- package/dist/routes/computer-use/participant-prompt.js +4 -4
- package/dist/routes/computer-use/participant-runs.d.ts +6 -6
- package/dist/routes/computer-use/participant-runs.js +8 -8
- package/dist/routes/computer-use/plan.d.ts +21 -29
- package/dist/routes/computer-use/plan.js +59 -65
- package/dist/routes/computer-use/preflight.d.ts +6 -11
- package/dist/routes/computer-use/preflight.js +26 -18
- package/dist/routes/computer-use/rerun-selection.js +10 -6
- package/dist/routes/computer-use/result.d.ts +1 -1
- package/dist/routes/computer-use/result.js +40 -30
- package/dist/routes/computer-use/route.d.ts +3 -4
- package/dist/routes/computer-use/route.js +21 -19
- package/dist/routes/computer-use/self-report.d.ts +2 -2
- package/dist/routes/computer-use/self-report.js +4 -4
- package/dist/routes/computer-use/setup.d.ts +8 -17
- package/dist/routes/computer-use/setup.js +98 -86
- package/dist/routes/computer-use/single-bundle.d.ts +8 -11
- package/dist/routes/computer-use/single-bundle.js +20 -25
- package/dist/routes/computer-use/subject-projection.d.ts +5 -7
- package/dist/routes/computer-use/subject-projection.js +20 -19
- package/dist/routes/computer-use/types.d.ts +169 -211
- package/dist/routes/computer-use/types.js +13 -6
- package/dist/routes/preview.js +0 -1
- package/dist/routes/scripted/bundle.d.ts +3 -6
- package/dist/routes/scripted/bundle.js +11 -16
- package/dist/routes/scripted/plan.d.ts +5 -7
- package/dist/routes/scripted/plan.js +6 -4
- package/dist/routes/scripted/result.d.ts +4 -1
- package/dist/routes/scripted/result.js +10 -6
- package/dist/routes/scripted/route.js +10 -11
- package/dist/routes/scripted/scenario.d.ts +1 -1
- package/dist/routes/scripted/scenario.js +1 -1
- package/dist/routes/scripted/setup.d.ts +3 -2
- package/dist/routes/scripted/setup.js +22 -21
- package/dist/routes/scripted/subject.d.ts +8 -3
- package/dist/routes/scripted/subject.js +11 -6
- package/dist/routes/scripted/surface-records.js +1 -1
- package/dist/routes/scripted/surface-sessions.d.ts +2 -2
- package/dist/routes/scripted/surface-sessions.js +4 -4
- package/dist/routes/scripted/types.d.ts +19 -36
- package/dist/routes/scripted/types.js +1 -2
- package/dist/routes/shared-world/{seat-records.js → bundle-records.js} +8 -8
- package/dist/routes/shared-world/bundle.d.ts +2 -2
- package/dist/routes/shared-world/bundle.js +22 -26
- package/dist/routes/shared-world/checkpoints.d.ts +4 -4
- package/dist/routes/shared-world/checkpoints.js +4 -4
- package/dist/routes/shared-world/comms.d.ts +5 -4
- package/dist/routes/shared-world/comms.js +28 -41
- package/dist/routes/shared-world/external-public.d.ts +5 -5
- package/dist/routes/shared-world/external-public.js +19 -20
- package/dist/routes/shared-world/handoff.d.ts +4 -4
- package/dist/routes/shared-world/handoff.js +50 -50
- package/dist/routes/shared-world/lobby-code.d.ts +5 -5
- package/dist/routes/shared-world/lobby-code.js +13 -13
- package/dist/routes/shared-world/{seats.d.ts → participant-specs.d.ts} +8 -6
- package/dist/routes/shared-world/{seats.js → participant-specs.js} +46 -51
- package/dist/routes/shared-world/plan.d.ts +2 -6
- package/dist/routes/shared-world/plan.js +1 -2
- package/dist/routes/shared-world/provenance.d.ts +4 -4
- package/dist/routes/shared-world/provenance.js +4 -4
- package/dist/routes/shared-world/provisioned.d.ts +3 -2
- package/dist/routes/shared-world/provisioned.js +48 -41
- package/dist/routes/shared-world/result.js +31 -19
- package/dist/routes/shared-world/route.js +37 -41
- package/dist/routes/shared-world/setup.d.ts +5 -4
- package/dist/routes/shared-world/setup.js +12 -14
- package/dist/routes/shared-world/types.d.ts +53 -126
- package/dist/routes/shared-world/types.js +2 -2
- package/dist/routes/terminal/adapter.d.ts +8 -8
- package/dist/routes/terminal/adapter.js +28 -125
- package/dist/routes/terminal/bundle.d.ts +7 -12
- package/dist/routes/terminal/bundle.js +24 -34
- package/dist/routes/terminal/credentials.d.ts +2 -2
- package/dist/routes/terminal/credentials.js +16 -16
- package/dist/routes/terminal/dry-run.d.ts +1 -1
- package/dist/routes/terminal/dry-run.js +9 -11
- package/dist/routes/terminal/encoding.d.ts +1 -1
- package/dist/routes/terminal/encoding.js +2 -2
- package/dist/routes/terminal/ledger.d.ts +6 -6
- package/dist/routes/terminal/ledger.js +9 -9
- package/dist/routes/terminal/live-finish.d.ts +1 -2
- package/dist/routes/terminal/live-finish.js +21 -20
- package/dist/routes/terminal/live-sandbox.d.ts +4 -2
- package/dist/routes/terminal/live-sandbox.js +25 -21
- package/dist/routes/terminal/participant-text.d.ts +23 -0
- package/dist/routes/terminal/participant-text.js +165 -0
- package/dist/routes/terminal/plan.d.ts +2 -6
- package/dist/routes/terminal/plan.js +13 -9
- package/dist/routes/terminal/recorder.d.ts +6 -1
- package/dist/routes/terminal/recorder.js +12 -4
- package/dist/routes/terminal/result.js +4 -4
- package/dist/routes/terminal/route.js +26 -26
- package/dist/routes/terminal/runtime.d.ts +3 -2
- package/dist/routes/terminal/runtime.js +3 -3
- package/dist/routes/terminal/sandbox.d.ts +5 -3
- package/dist/routes/terminal/sandbox.js +13 -16
- package/dist/routes/terminal/session.js +16 -14
- package/dist/routes/terminal/token-usage.js +5 -5
- package/dist/routes/terminal/trace.d.ts +5 -8
- package/dist/routes/terminal/trace.js +9 -64
- package/dist/routes/terminal/types.d.ts +85 -93
- package/dist/routes/terminal/types.js +9 -4
- package/dist/run/active-runs.d.ts +13 -0
- package/dist/run/active-runs.js +12 -0
- package/dist/run/bundle-shape.d.ts +2 -1
- package/dist/run/bundle-shape.js +4 -4
- package/dist/run/bundle.d.ts +63 -56
- package/dist/run/bundle.js +9 -8
- package/dist/run/cost-summary.js +3 -2
- package/dist/run/costs.d.ts +6 -6
- package/dist/run/costs.js +10 -10
- package/dist/run/detail.d.ts +5 -5
- package/dist/run/detail.js +6 -6
- package/dist/run/dry-run.js +5 -12
- package/dist/run/{study-files.d.ts → evidence-files.d.ts} +4 -4
- package/dist/run/{study-files.js → evidence-files.js} +5 -5
- package/dist/run/feedback-shape.js +1 -1
- package/dist/run/judge.d.ts +16 -4
- package/dist/run/judge.js +24 -7
- package/dist/run/locate.d.ts +2 -0
- package/dist/run/locate.js +3 -1
- package/dist/run/outcomes.d.ts +3 -3
- package/dist/run/outcomes.js +3 -3
- package/dist/run/participant-records.d.ts +2 -2
- package/dist/run/participant-records.js +2 -2
- package/dist/run/paths.js +1 -1
- package/dist/run/pricing.d.ts +19 -9
- package/dist/run/pricing.js +30 -18
- package/dist/run/projection.d.ts +13 -13
- package/dist/run/projection.js +8 -8
- package/dist/run/reclaim.d.ts +7 -1
- package/dist/run/reclaim.js +24 -4
- package/dist/run/results.d.ts +1 -1
- package/dist/run/run-index.d.ts +1 -1
- package/dist/run/run-index.js +11 -11
- package/dist/run/run.d.ts +4 -2
- package/dist/run/run.js +9 -5
- package/dist/run/sandbox-receipts.d.ts +4 -4
- package/dist/run/sandbox-receipts.js +4 -4
- package/dist/run/shared-world-evidence.d.ts +47 -47
- package/dist/run/shared-world-shape.d.ts +3 -3
- package/dist/run/shared-world-shape.js +11 -11
- package/dist/run/stats.d.ts +5 -5
- package/dist/run/stats.js +8 -8
- package/dist/run/status.d.ts +16 -6
- package/dist/run/status.js +31 -8
- package/dist/run/streams.d.ts +26 -19
- package/dist/run/terminal-contract.d.ts +5 -5
- package/dist/run/terminal-contract.js +4 -4
- package/dist/run/transient-comms-secrets.d.ts +5 -0
- package/dist/run/transient-comms-secrets.js +12 -0
- package/dist/run-lab.d.ts +36 -34
- package/dist/run-lab.js +41 -37
- package/dist/subject/desktop-cli.d.ts +1 -1
- package/dist/subject/desktop-cli.js +1 -1
- package/dist/subject/local-tree-archive.d.ts +1 -1
- package/dist/subject/local-tree-archive.js +4 -4
- package/dist/subject/local-tree.d.ts +2 -2
- package/dist/subject/local-tree.js +1 -1
- package/dist/subject/node-bootstrap.d.ts +1 -1
- package/dist/subject/node-bootstrap.js +4 -4
- package/dist/subject/runtime.js +5 -5
- package/dist/subject/serve.js +1 -1
- package/dist/subject/steps.d.ts +4 -4
- package/dist/subject/steps.js +5 -5
- package/dist/substrates/desktop-session.d.ts +2 -0
- package/dist/substrates/e2b/cdp-probe.d.ts +2 -2
- package/dist/substrates/e2b/cdp-probe.js +1 -1
- package/dist/substrates/e2b/desktop-browser.d.ts +3 -3
- package/dist/substrates/e2b/desktop-browser.js +4 -4
- package/dist/substrates/e2b/desktop-cdp.d.ts +7 -7
- package/dist/substrates/e2b/desktop-cdp.js +4 -4
- package/dist/substrates/e2b/desktop-geometry.d.ts +4 -4
- package/dist/substrates/e2b/desktop-geometry.js +3 -3
- package/dist/substrates/e2b/desktop-media.js +2 -2
- package/dist/substrates/e2b/sandbox.d.ts +2 -0
- package/dist/substrates/e2b/sandbox.js +22 -8
- package/dist/substrates/e2b/sdk.d.ts +12 -1
- package/dist/substrates/e2b/sdk.js +30 -9
- package/dist/substrates/local/runtime-host.d.ts +2 -0
- package/dist/substrates/local/runtime-host.js +6 -0
- package/dist/tui/actions.d.ts +7 -5
- package/dist/tui/actions.js +18 -9
- package/dist/tui-app.js +42 -42
- package/dist/verify/actor.d.ts +10 -10
- package/dist/verify/actor.js +15 -15
- package/dist/verify/artifacts.d.ts +1 -1
- package/dist/verify/artifacts.js +3 -3
- package/dist/verify/costs.d.ts +2 -2
- package/dist/verify/costs.js +2 -2
- package/dist/verify/liveness.d.ts +1 -1
- package/dist/verify/liveness.js +4 -1
- package/dist/verify/rerun.d.ts +1 -1
- package/dist/verify/rerun.js +1 -1
- package/dist/verify/shared-world.js +2 -2
- package/dist/verify/verify.js +6 -6
- package/docs/README.md +1 -1
- package/docs/architecture/actor-contract.md +60 -22
- package/docs/architecture/desktop-sessions.md +9 -9
- package/docs/architecture/external-public-shared-world.md +5 -0
- package/docs/architecture/observer.md +4 -4
- package/docs/architecture/restricted-codex-analysis.md +40 -4
- package/docs/architecture/state-driven-executor.md +4 -5
- package/docs/architecture/task-protocol-support.md +3 -5
- package/docs/architecture/{terminal-product-lane.md → terminal-product-route.md} +24 -16
- package/docs/contracts/run-bundle.md +10 -8
- package/docs/contracts/schemas.md +109 -53
- package/docs/contracts/study-analysis.md +24 -0
- package/docs/decisions/0004-participant-desktops-stay-in-the-route.md +2 -1
- package/docs/product/automatic-analysis.md +1 -0
- package/docs/ramp/README.md +2 -1
- package/package.json +4 -4
- package/skills/humanish/SKILL.md +3 -2
- package/skills/humanish/agents/openai.yaml +1 -1
- package/dist/deprecated.d.ts +0 -90
- package/dist/deprecated.js +0 -106
- package/dist/lab/bag-overrides.d.ts +0 -18
- package/dist/lab/bag-overrides.js +0 -121
- package/dist/routes/computer-use/legacy-lane-spec.d.ts +0 -62
- package/dist/routes/computer-use/legacy-lane-spec.js +0 -39
- /package/dist/routes/computer-use/{fanout-lanes.d.ts → fanout-records.d.ts} +0 -0
- /package/dist/routes/computer-use/{run-lanes.d.ts → live-phase.d.ts} +0 -0
- /package/dist/routes/shared-world/{seat-records.d.ts → bundle-records.d.ts} +0 -0
package/dist/feedback/draft.js
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// participant's feedback candidate or from a reviewed analysis finding, and its markdown rendering.
|
|
3
3
|
// The commands that resolve the run and read or write drafts are in feedback.ts.
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { analysisSharingProblems } from "../analysis/sharing.js";
|
|
6
|
+
import { loadAnalysis } from "../analysis/load.js";
|
|
7
7
|
import { hashAnalysisValue } from "../analysis/validation.js";
|
|
8
|
-
import { formatParticipantOutcomes,
|
|
8
|
+
import { formatParticipantOutcomes, formatRunTaskFunnel, participantOutcomeDetails, withCuaReviewProvenance, } from "../run/outcomes.js";
|
|
9
9
|
import { loadRunBundlePrepared } from "../run/locate.js";
|
|
10
10
|
import { isFeedbackIdempotencyKey } from "../run/feedback-shape.js";
|
|
11
|
+
import { isRecord } from "../run/type-guards.js";
|
|
11
12
|
import { feedbackProofCommands, projectFeedbackAcceptanceProof } from "./proof.js";
|
|
12
13
|
export const FEEDBACK_SCHEMA = "humanish.feedback.v1";
|
|
13
14
|
export function buildDraft(bundle, bundlePath, candidateId) {
|
|
@@ -65,7 +66,7 @@ export function buildDraft(bundle, bundlePath, candidateId) {
|
|
|
65
66
|
]),
|
|
66
67
|
...(bundle.review.tasks === undefined
|
|
67
68
|
? []
|
|
68
|
-
: [`Tasks: ${
|
|
69
|
+
: [`Tasks: ${formatRunTaskFunnel(bundle.review.tasks)}.`]),
|
|
69
70
|
];
|
|
70
71
|
return {
|
|
71
72
|
schema: FEEDBACK_SCHEMA,
|
|
@@ -146,10 +147,10 @@ export function buildDraft(bundle, bundlePath, candidateId) {
|
|
|
146
147
|
export async function buildAnalysisDraft(context, options) {
|
|
147
148
|
if (!options.analysis || !options.finding || options.candidate !== undefined)
|
|
148
149
|
return null;
|
|
149
|
-
const loaded = await
|
|
150
|
+
const loaded = await loadAnalysis(context.preparedRunPaths, options.analysis);
|
|
150
151
|
const analysis = loaded.analysis;
|
|
151
152
|
const finding = analysis?.result?.findings.find((item) => item.id === options.finding);
|
|
152
|
-
const sharing =
|
|
153
|
+
const sharing = analysisSharingProblems(loaded);
|
|
153
154
|
if (loaded.state !== "ready" || sharing.sensitive || sharing.unverified || !analysis || !finding)
|
|
154
155
|
return null;
|
|
155
156
|
const correction = loaded.corrections.filter((item) => item.findingId === finding.id).at(-1);
|
|
@@ -253,9 +254,6 @@ export function isUsableFeedbackCandidate(candidate) {
|
|
|
253
254
|
!item.path.includes("://") &&
|
|
254
255
|
!item.path.includes(".."));
|
|
255
256
|
}
|
|
256
|
-
function isRecord(value) {
|
|
257
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
258
|
-
}
|
|
259
257
|
export function renderMarkdown(draft, repo) {
|
|
260
258
|
return `This issue was drafted by humanish from a verified humanish run bundle.
|
|
261
259
|
|
|
@@ -16,7 +16,7 @@ import { verifyRunPrepared } from "../verify/verify.js";
|
|
|
16
16
|
import { loadRunBundlePrepared, resolveRunPath } from "../run/locate.js";
|
|
17
17
|
import {} from "../run/bundle.js";
|
|
18
18
|
import { runIdOf, isPathInside, prepareRunArtifactPaths, validatePreparedRunArtifactPaths, } from "../run/paths.js";
|
|
19
|
-
import {
|
|
19
|
+
import { isAnalysisRecordPath } from "../analysis/sharing.js";
|
|
20
20
|
import { assertPreparedSelectedOutputDirectory, prepareManagedHumanishOutputDirectory, prepareSelectedOutputDirectory, readContainedRegularFile, writeContainedOutputFile, } from "../run/contained-output.js";
|
|
21
21
|
const DERIVATION_SCHEMA = "humanish.redacted-derivation.v1";
|
|
22
22
|
const MAX_FILES = 10_000;
|
|
@@ -46,9 +46,9 @@ function jsonBytes(value) {
|
|
|
46
46
|
return Buffer.from(`${JSON.stringify(value, null, 2)}\n`);
|
|
47
47
|
}
|
|
48
48
|
function omittedReason(relative) {
|
|
49
|
-
if (relative.startsWith("analysis-automatic/") &&
|
|
49
|
+
if (relative.startsWith("analysis-automatic/") && isAnalysisRecordPath(relative))
|
|
50
50
|
return "automatic execution intent and liveness do not transfer to a derivative";
|
|
51
|
-
if (
|
|
51
|
+
if (isAnalysisRecordPath(relative))
|
|
52
52
|
return "analysis records bind original evidence hashes; reanalyze the derivative";
|
|
53
53
|
if (relative.startsWith(".analysis-lock/"))
|
|
54
54
|
return "local analysis execution lock";
|
|
@@ -477,7 +477,7 @@ async function resolveDestination(cwd, runPaths, runId, options) {
|
|
|
477
477
|
* it. The raw snapshot is removed before the derivative is built.
|
|
478
478
|
*/
|
|
479
479
|
async function verifyFrozenSource(workspace, source, runId) {
|
|
480
|
-
// Verify the
|
|
480
|
+
// Verify the same frozen bytes that will be transformed. Verifying the live
|
|
481
481
|
// source and then rereading run.json permits an ABA edit to contaminate a
|
|
482
482
|
// derivative whose receipt still names the first inventory's hashes.
|
|
483
483
|
// Raw verification bytes stay in private OS temporary storage, even when
|
package/dist/feedback/export.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// A run is a directory. Sharing it meant a tunnel (`serve --expose`) or a hand-zipped bundle,
|
|
4
4
|
// neither of which is "send one thing". The Observer is already a single-file artifact with the
|
|
5
5
|
// run's data inlined; what keeps it from travelling is the screenshots it references by path.
|
|
6
|
-
// Export embeds each unique raster once and writes
|
|
6
|
+
// Export embeds each unique raster once and writes one .html that opens offline.
|
|
7
7
|
//
|
|
8
8
|
// Share safety is the point, not a step: export runs verify inside the flow and refuses a bundle
|
|
9
9
|
// that is not share_ready. A local_only bundle (raw screenshots) exports only with an explicit
|
|
@@ -18,10 +18,10 @@ import { resolveRunPath } from "../run/locate.js";
|
|
|
18
18
|
import { verifyRun } from "../verify/verify.js";
|
|
19
19
|
import {} from "../run/bundle.js";
|
|
20
20
|
import { exportRedactedBundle } from "./export-bundle.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
21
|
+
import { loadAnalysis } from "../analysis/load.js";
|
|
22
|
+
import { analysisSharingProblems } from "../analysis/sharing.js";
|
|
23
23
|
import { EVIDENCE_LIMITS, validateAnalysisEvidence } from "../analysis/evidence.js";
|
|
24
|
-
import {
|
|
24
|
+
import { readBoundedFile } from "../run/evidence-files.js";
|
|
25
25
|
import { shellQuote } from "../substrates/shell.js";
|
|
26
26
|
const EXPORT_SCHEMA = "humanish.export-result.v1";
|
|
27
27
|
/** Past this the file stops being a thing you attach to an email. Declared, never silent. */
|
|
@@ -73,7 +73,7 @@ export async function exportRun(cwdInput, runInput, options = {}, deps = {}) {
|
|
|
73
73
|
return slot;
|
|
74
74
|
// Every string in the data that names an image file inside the run becomes an asset reference. Paths are
|
|
75
75
|
// run-root-relative in the data; a path that resolves outside the run is left alone, never read.
|
|
76
|
-
const analysis = await
|
|
76
|
+
const analysis = await loadAnalysis(runPaths);
|
|
77
77
|
const data = await currentObserverData(runPaths, analysis, slot);
|
|
78
78
|
if (data === undefined)
|
|
79
79
|
return exportFailure(cwd, runInput, "HUMANISH_EXPORT_VERIFY_FAILED", "Source evidence changed while preparing the analysis export.");
|
|
@@ -175,7 +175,7 @@ async function currentObserverData(runPaths, analysis, slot) {
|
|
|
175
175
|
const saved = JSON.parse(slot);
|
|
176
176
|
if (analysis.state !== "ready" || !analysis.analysis)
|
|
177
177
|
return { value: saved };
|
|
178
|
-
const source = await
|
|
178
|
+
const source = await readBoundedFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
|
|
179
179
|
if (!source ||
|
|
180
180
|
createHash("sha256").update(source).digest("hex") !== analysis.analysis.sourceRunSha256)
|
|
181
181
|
return undefined;
|
|
@@ -211,7 +211,7 @@ async function inlineImages(runPaths, runRoot, data, analysis, options, warnings
|
|
|
211
211
|
for (const candidate of candidates) {
|
|
212
212
|
if (!(await isInside(runRoot, candidate)))
|
|
213
213
|
continue;
|
|
214
|
-
const bytes = await
|
|
214
|
+
const bytes = await readBoundedFile(runPaths, path.relative(runRoot, candidate), options.maxBytes ?? DEFAULT_EXPORT_MAX_BYTES);
|
|
215
215
|
if (bytes === null)
|
|
216
216
|
continue;
|
|
217
217
|
if (bytes.byteLength > MAX_PORTABLE_IMAGE_BYTES) {
|
|
@@ -302,7 +302,7 @@ async function recheckAnalysis(runPaths, analysis, verified, inlined, options) {
|
|
|
302
302
|
// Revalidate the independent interpretation against source evidence. Never trust a
|
|
303
303
|
// saved HTML slot or traverse model-provided strings as image paths.
|
|
304
304
|
if (analysis.state === "ready" && analysis.analysis) {
|
|
305
|
-
const source = await
|
|
305
|
+
const source = await readBoundedFile(runPaths, "run.json", EVIDENCE_LIMITS.sourceBytes);
|
|
306
306
|
try {
|
|
307
307
|
if (!source)
|
|
308
308
|
throw new Error("source unavailable");
|
|
@@ -312,7 +312,7 @@ async function recheckAnalysis(runPaths, analysis, verified, inlined, options) {
|
|
|
312
312
|
return "changed";
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
const analysisSharing =
|
|
315
|
+
const analysisSharing = analysisSharingProblems(analysis);
|
|
316
316
|
if (!analysisSharing.sensitive && !analysisSharing.unverified)
|
|
317
317
|
return "ok";
|
|
318
318
|
verified.shareSafety = {
|
|
@@ -12,7 +12,7 @@ export interface FeedbackResult {
|
|
|
12
12
|
issueMarkdown?: string;
|
|
13
13
|
issueUrl?: string;
|
|
14
14
|
draft?: FeedbackDraft;
|
|
15
|
-
/** Every usable candidate on the bundle, so a multi-
|
|
15
|
+
/** Every usable candidate on the bundle, so a multi-participant study's second and third findings can be
|
|
16
16
|
* chosen with `--candidate` instead of being invisible behind the first (#609). */
|
|
17
17
|
candidates?: FeedbackCandidateSummary[];
|
|
18
18
|
shareSafety?: VerifyResult["shareSafety"];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { runLab } from "./run-lab.js";
|
|
1
|
+
export { runPackageLab as runLab } from "./run-lab.js";
|
|
2
2
|
export type { LabOutcome, LabResult, RunLabOptions } from "./run-lab.js";
|
|
3
3
|
export type { LabEvent } from "./lab/run-lab-events.js";
|
|
4
|
-
export type { ProviderContext } from "./lab/run-lab-
|
|
4
|
+
export type { ProviderContext } from "./lab/run-lab-homes.js";
|
|
5
5
|
export { routeOf } from "./lab/plan.js";
|
|
6
6
|
export type { LabRoute } from "./lab/plan.js";
|
|
7
7
|
export { parseLabConfig } from "./lab/config.js";
|
|
@@ -22,11 +22,8 @@ export { CuaAdmissionLimitError } from "./actors/computer-use/admission-limit.js
|
|
|
22
22
|
export { defaultRedactionHooks } from "./evidence/redaction.js";
|
|
23
23
|
export type { RedactionHooks } from "./evidence/redaction.js";
|
|
24
24
|
export type { E2BDesktopSandbox } from "./substrates/e2b/sdk.js";
|
|
25
|
+
export { browserScorer, terminalScorer } from "./lab/adapter-scorer-loader.js";
|
|
25
26
|
export type { AdapterScorerModule, AdapterScoringContext } from "./lab/adapter-scorer-loader.js";
|
|
26
27
|
export type { BrowserLabScoringContext } from "./lab/adapter-extension.js";
|
|
27
28
|
export type { TerminalProductScoringContext } from "./routes/terminal/types.js";
|
|
28
29
|
export type { RunAdapterArtifact, RunAdapterScore } from "./run/bundle.js";
|
|
29
|
-
export { routesToComputerUse, routesToConcurrentSharedWorld, routesToExternalPublicSharedWorld, routesToProvisionedSharedWorld, routesToScriptedBrowser, routesToSharedWorld, routesToTerminalProduct, } from "./lab/routing.js";
|
|
30
|
-
export { selectLabBackend } from "./lab/plan.js";
|
|
31
|
-
export { actorResolvesToTerminal, concurrentSharedWorldValidationReason, cuaLaneCount, cuaLaneValidationReason, externalPublicSharedWorldValidationReason, MAX_CUA_LANES, resolveLabDryRun, resolveSeatUrl, runConcurrentSharedWorld, runCuaActorLab, runCuaActorSession, runDryRun, runScriptedBrowserLab, runTerminalProductLab, sharedWorldValidationReason, } from "./deprecated.js";
|
|
32
|
-
export type { AutomaticAnalysisHooks, BrowserLabAdapterHooks, ConcurrentSharedWorldLabResult, CuaActorLabHooks, CuaActorLabResult, LabBackend, RunConcurrentSharedWorldLabOptions, RunCuaActorLabOptions, RunOptions, RunResult, RunScriptedBrowserLabOptions, RunTerminalProductLabOptions, ScriptedBrowserLabHooks, ScriptedBrowserLabResult, SharedWorldLabHooks, SubjectPhaseEvent, TerminalProductLabHooks, TerminalProductLabResult, } from "./deprecated.js";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// score a run. Everything else is internal and reached through the `humanish` bin. See
|
|
3
3
|
// docs/contracts/schemas.md, "Library options", and the site's library page.
|
|
4
4
|
// Run a lab.
|
|
5
|
-
export { runLab } from "./run-lab.js";
|
|
5
|
+
export { runPackageLab as runLab } from "./run-lab.js";
|
|
6
6
|
export { routeOf } from "./lab/plan.js";
|
|
7
7
|
export { parseLabConfig } from "./lab/config.js";
|
|
8
8
|
export { LAB_CONFIG_SCHEMA } from "./lab/types.js";
|
|
@@ -14,8 +14,5 @@ export { runComputerUseLoop, stableProgressKey } from "./actors/computer-use/loo
|
|
|
14
14
|
export { createOpenAiResponsesProvider } from "./actors/computer-use/openai-provider.js";
|
|
15
15
|
export { CuaAdmissionLimitError } from "./actors/computer-use/admission-limit.js";
|
|
16
16
|
export { defaultRedactionHooks } from "./evidence/redaction.js";
|
|
17
|
-
//
|
|
18
|
-
export {
|
|
19
|
-
export { selectLabBackend } from "./lab/plan.js";
|
|
20
|
-
// Deprecated this minor, removed in the next.
|
|
21
|
-
export { actorResolvesToTerminal, concurrentSharedWorldValidationReason, cuaLaneCount, cuaLaneValidationReason, externalPublicSharedWorldValidationReason, MAX_CUA_LANES, resolveLabDryRun, resolveSeatUrl, runConcurrentSharedWorld, runCuaActorLab, runCuaActorSession, runDryRun, runScriptedBrowserLab, runTerminalProductLab, sharedWorldValidationReason, } from "./deprecated.js";
|
|
17
|
+
// Score a run.
|
|
18
|
+
export { browserScorer, terminalScorer } from "./lab/adapter-scorer-loader.js";
|
|
@@ -13,12 +13,14 @@ export declare function userKeyStorePath(env: NodeJS.ProcessEnv, deps?: KeyResol
|
|
|
13
13
|
/**
|
|
14
14
|
* Fill missing provider keys into `env` from the discovery chain, announcing each fill as
|
|
15
15
|
* `NAME from SOURCE`. Returns the fills. Opt-out: HUMANISH_STRICT_KEYS=1 returns [] untouched.
|
|
16
|
+
* With `announced`, every key is still filled, and only the fills it names are announced.
|
|
16
17
|
*/
|
|
17
18
|
export declare function discoverProviderKeys(args: {
|
|
18
19
|
cwd: string;
|
|
19
20
|
env: NodeJS.ProcessEnv;
|
|
20
21
|
announce: (line: string) => void;
|
|
21
22
|
deps?: KeyResolutionDeps;
|
|
23
|
+
announced?: ReadonlySet<string>;
|
|
22
24
|
}): Promise<ResolvedKeyFill[]>;
|
|
23
25
|
export interface KeySourceProbe {
|
|
24
26
|
name: string;
|
|
@@ -48,7 +50,7 @@ export declare function resolveKeyName(vendorOrName: string): string | null;
|
|
|
48
50
|
* are storable (the store feeds implicit discovery — an arbitrary-name store would be an env
|
|
49
51
|
* injection vector with extra steps). The value must be a single non-empty line that
|
|
50
52
|
* round-trips the store's own parser byte-identically, and the write refuses symlinks at the
|
|
51
|
-
* file
|
|
53
|
+
* file and its parent directory (red-team findings). */
|
|
52
54
|
export declare function setUserKey(name: string, value: string, env: NodeJS.ProcessEnv, deps?: KeyResolutionDeps): {
|
|
53
55
|
path: string;
|
|
54
56
|
};
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
// 1. process env — including whatever --env-file just loaded (explicit always wins);
|
|
6
6
|
// 2. `.humanish/local/provider.env` — the project-local overlay this CLI's own --help
|
|
7
7
|
// examples document;
|
|
8
|
-
// 3. the
|
|
8
|
+
// 3. the owning vendor's native store, where one exists:
|
|
9
9
|
// E2B_API_KEY <- ~/.e2b/config.json (written by `e2b auth login`);
|
|
10
10
|
// GH_TOKEN <- `gh auth token` (the gh CLI's credential chain);
|
|
11
11
|
// 4. the humanish user-level store `$XDG_CONFIG_HOME/humanish/keys.env`, written only by
|
|
12
12
|
// `humanish keys set` (0600, prompted or --stdin) — the fallback for vendors that ship
|
|
13
13
|
// no machine chain of their own (OpenAI, Anthropic).
|
|
14
14
|
//
|
|
15
|
-
// Every fill is
|
|
16
|
-
// `.env`/`.env.local` are
|
|
15
|
+
// Every fill is announced by key name + source, never by value. The subject app's own
|
|
16
|
+
// `.env`/`.env.local` are never read: those hold product credentials, a different class
|
|
17
17
|
// (#11); this module only reads humanish-owned files and vendor-owned stores.
|
|
18
18
|
// `HUMANISH_STRICT_KEYS=1` disables every rung below process env (the pre-#436 behavior).
|
|
19
19
|
import { spawn } from "node:child_process";
|
|
@@ -21,7 +21,7 @@ import { chmodSync, closeSync, constants as fsConstants, existsSync, ftruncateSy
|
|
|
21
21
|
import { homedir } from "node:os";
|
|
22
22
|
import path from "node:path";
|
|
23
23
|
import { loadEnvFile } from "./env-file.js";
|
|
24
|
-
/** The
|
|
24
|
+
/** The only names implicit discovery may fill (and `humanish keys set` may store). Everything
|
|
25
25
|
* else in an overlay/store file is ignored-and-named: a repo-planted NODE_OPTIONS/LD_PRELOAD
|
|
26
26
|
* must never enter process env off a file the operator did not explicitly pass (an explicit
|
|
27
27
|
* --env-file remains the operator's own full-file load). Red-team finding, #436. */
|
|
@@ -51,7 +51,7 @@ const PROJECT_OVERLAY_RELATIVE = path.join(".humanish", "local", "provider.env")
|
|
|
51
51
|
export function userKeyStorePath(env, deps = {}) {
|
|
52
52
|
const home = deps.homeDir ?? homedir();
|
|
53
53
|
const declared = env.XDG_CONFIG_HOME?.trim();
|
|
54
|
-
// The XDG spec: a relative XDG_CONFIG_HOME
|
|
54
|
+
// The XDG spec: a relative XDG_CONFIG_HOME must be ignored. Honoring one would make the
|
|
55
55
|
// key store cwd-relative — `humanish keys set` would write a secret into the current repo.
|
|
56
56
|
const configHome = declared !== undefined && declared !== "" && path.isAbsolute(declared)
|
|
57
57
|
? declared
|
|
@@ -61,7 +61,7 @@ export function userKeyStorePath(env, deps = {}) {
|
|
|
61
61
|
function e2bConfigPath(deps) {
|
|
62
62
|
return path.join(deps.homeDir ?? homedir(), ".e2b", "config.json");
|
|
63
63
|
}
|
|
64
|
-
/** Default exec: bounded, quiet, stdin closed; null on
|
|
64
|
+
/** Default exec: bounded, quiet, stdin closed; null on any failure. Never throws. */
|
|
65
65
|
function defaultExecText(command, args, timeoutMs, env) {
|
|
66
66
|
return new Promise((resolve) => {
|
|
67
67
|
let child;
|
|
@@ -128,7 +128,7 @@ function readE2bConfigKey(deps) {
|
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
/** Refuse to
|
|
131
|
+
/** Refuse to read a store through a symlink: a repo-local overlay that is secretly a link to
|
|
132
132
|
* an unrelated file is exactly the retargeting shape the artifact paths refuse elsewhere. */
|
|
133
133
|
function isRegularFile(filePath) {
|
|
134
134
|
try {
|
|
@@ -141,15 +141,16 @@ function isRegularFile(filePath) {
|
|
|
141
141
|
/**
|
|
142
142
|
* Fill missing provider keys into `env` from the discovery chain, announcing each fill as
|
|
143
143
|
* `NAME from SOURCE`. Returns the fills. Opt-out: HUMANISH_STRICT_KEYS=1 returns [] untouched.
|
|
144
|
+
* With `announced`, every key is still filled, and only the fills it names are announced.
|
|
144
145
|
*/
|
|
145
146
|
export async function discoverProviderKeys(args) {
|
|
146
|
-
const { cwd, env, announce } = args;
|
|
147
|
+
const { cwd, env, announce, announced } = args;
|
|
147
148
|
const deps = args.deps ?? {};
|
|
148
149
|
if (env.HUMANISH_STRICT_KEYS?.trim() === "1")
|
|
149
150
|
return [];
|
|
150
151
|
const fills = [];
|
|
151
152
|
const ignored = [];
|
|
152
|
-
// Fill-only means
|
|
153
|
+
// Fill-only means presence wins, including an explicitly-set empty value: an operator who
|
|
153
154
|
// exported OPENAI_API_KEY="" said "off", and a rung that "fixes" that has overridden them
|
|
154
155
|
// (red-team finding). Only a truly-unset name is fillable.
|
|
155
156
|
const fillable = (name) => env[name] === undefined;
|
|
@@ -157,7 +158,7 @@ export async function discoverProviderKeys(args) {
|
|
|
157
158
|
env[name] = value;
|
|
158
159
|
fills.push({ name, source });
|
|
159
160
|
};
|
|
160
|
-
// Rung 2: the documented project-local overlay. Parsed
|
|
161
|
+
// Rung 2: the documented project-local overlay. Parsed atomically against a scratch env so a
|
|
161
162
|
// file loadEnvFile rejects can never half-apply (red-team finding: earlier lines used to land
|
|
162
163
|
// in env unannounced before the parse error aborted). Only allowlisted provider names cross
|
|
163
164
|
// from the file into the real env.
|
|
@@ -184,7 +185,7 @@ export async function discoverProviderKeys(args) {
|
|
|
184
185
|
if (teamKey !== null)
|
|
185
186
|
fill("E2B_API_KEY", teamKey, "~/.e2b/config.json (e2b auth login)");
|
|
186
187
|
}
|
|
187
|
-
// Rung 3b: the gh CLI's credential chain. Only consulted when
|
|
188
|
+
// Rung 3b: the gh CLI's credential chain. Only consulted when neither GitHub env name is
|
|
188
189
|
// present; fills GH_TOKEN (the name humanish reads first). gh runs without any provider key in
|
|
189
190
|
// its environment, so the keys the rungs above just filled stay in this process.
|
|
190
191
|
if (fillable("GH_TOKEN") && fillable("GITHUB_TOKEN")) {
|
|
@@ -193,7 +194,7 @@ export async function discoverProviderKeys(args) {
|
|
|
193
194
|
if (token !== null)
|
|
194
195
|
fill("GH_TOKEN", token, "gh auth token");
|
|
195
196
|
}
|
|
196
|
-
// Rung 4: the humanish user-level store
|
|
197
|
+
// Rung 4: the humanish user-level store, read with the same lenient parser `keys set`/`list`
|
|
197
198
|
// use, so one hand-mangled line degrades to that line alone instead of silently voiding the
|
|
198
199
|
// whole store (red-team finding: the strict parser disagreed with the store's own reader).
|
|
199
200
|
const storePath = userKeyStorePath(env, deps);
|
|
@@ -209,12 +210,13 @@ export async function discoverProviderKeys(args) {
|
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
for (const fill_ of fills)
|
|
212
|
-
|
|
213
|
+
if (announced === undefined || announced.has(fill_.name))
|
|
214
|
+
announce(`humanish keys: ${fill_.name} from ${fill_.source}`);
|
|
213
215
|
for (const name of ignored)
|
|
214
216
|
announce(`humanish keys: ignored non-provider name ${name} — implicit discovery fills provider keys only; pass the file via --env-file to load everything in it`);
|
|
215
217
|
return fills;
|
|
216
218
|
}
|
|
217
|
-
/** True when the file's
|
|
219
|
+
/** True when the file's parent directory is (or traverses) a symlink at its last component:
|
|
218
220
|
* the dir-level retarget that defeats a file-level lstat check (red-team finding). */
|
|
219
221
|
function dirIsSymlink(filePath) {
|
|
220
222
|
try {
|
|
@@ -295,7 +297,7 @@ export function resolveKeyName(vendorOrName) {
|
|
|
295
297
|
* are storable (the store feeds implicit discovery — an arbitrary-name store would be an env
|
|
296
298
|
* injection vector with extra steps). The value must be a single non-empty line that
|
|
297
299
|
* round-trips the store's own parser byte-identically, and the write refuses symlinks at the
|
|
298
|
-
* file
|
|
300
|
+
* file and its parent directory (red-team findings). */
|
|
299
301
|
export function setUserKey(name, value, env, deps = {}) {
|
|
300
302
|
const trimmed = value.trim();
|
|
301
303
|
if (trimmed.length === 0 || /[\u0000-\u001f\u007f]/.test(trimmed)) {
|
|
@@ -320,7 +322,7 @@ export function setUserKey(name, value, env, deps = {}) {
|
|
|
320
322
|
entries.set(name, trimmed);
|
|
321
323
|
// The written line must read back byte-identically through the store's own parser: a value
|
|
322
324
|
// that parses differently (an embedded '#', a leading quote the env parser would strip)
|
|
323
|
-
// would silently resolve to a
|
|
325
|
+
// would silently resolve to a different secret on the next run.
|
|
324
326
|
const roundTrip = parseStoreLine(`${name}=${trimmed}`);
|
|
325
327
|
if (roundTrip === null || roundTrip[0] !== name || roundTrip[1] !== trimmed) {
|
|
326
328
|
throw new Error("The value does not round-trip the store format (avoid leading quotes and '#'); pass it via --env-file instead.");
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { RunAdapterArtifact, RunAdapterScore, RunBundle, RunFeedbackCandidate, RunScorerProvenance } from "../run/bundle.js";
|
|
2
2
|
type BrowserAdapterBackend = "cua" | "shared-world" | "concurrent-shared-world";
|
|
3
|
+
/** The routes that call a browser scorer. */
|
|
4
|
+
type BrowserScorerRoute = "computer-use" | "shared-world";
|
|
3
5
|
/**
|
|
4
|
-
* Product-agnostic scoring context for browser/computer-use
|
|
6
|
+
* Product-agnostic scoring context for browser/computer-use routes. Product-specific
|
|
5
7
|
* evidence/rubrics stay in the adopter's repo; core provides the assembled bundle
|
|
6
8
|
* plus stable run identifiers and never learns product nouns.
|
|
7
9
|
*/
|
|
@@ -16,11 +18,26 @@ export interface BrowserLabScoringContext {
|
|
|
16
18
|
labId: string;
|
|
17
19
|
runId: string;
|
|
18
20
|
actor: string;
|
|
21
|
+
/** The route that ran the participants. */
|
|
22
|
+
route: BrowserScorerRoute;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use `route`. `cua` is `computer-use` and `concurrent-shared-world` is
|
|
25
|
+
* `shared-world`. Reading it warns once per process; the next minor removes it.
|
|
26
|
+
*/
|
|
19
27
|
backend: BrowserAdapterBackend;
|
|
20
28
|
dryRun: boolean;
|
|
29
|
+
/** How many participants the run had. */
|
|
30
|
+
participantCount: number;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `participantCount`, which has the same value. Reading it warns once per
|
|
33
|
+
* process; the next minor removes it.
|
|
34
|
+
*/
|
|
21
35
|
laneCount: number;
|
|
22
36
|
}
|
|
23
|
-
|
|
37
|
+
/** The context a route passes to applyBrowserScorer; the deprecated fields derive from it. */
|
|
38
|
+
type BrowserScoringFacts = Omit<BrowserLabScoringContext, "backend" | "laneCount">;
|
|
39
|
+
/** The scorer functions a computer-use or shared-world run calls: `RunLabOptions.scorer`. */
|
|
40
|
+
export interface BrowserScorer {
|
|
24
41
|
/**
|
|
25
42
|
* Browser-route extension seam (#165): a thin adapter may score the assembled
|
|
26
43
|
* browser/shared-world evidence without forking core. The score is stored as
|
|
@@ -51,19 +68,24 @@ export interface ScorerOutcome {
|
|
|
51
68
|
export declare const DECLARED_SCORER_MALFORMED = "Declared product scorer returned a malformed value instead of a verdict; a declared gate that cannot render a pass is recorded as a fail, never a silent pass.";
|
|
52
69
|
/** A DECLARED scorer that threw never rendered a verdict. `detail` is already sanitized. */
|
|
53
70
|
export declare function declaredScorerThrew(detail: string): string;
|
|
54
|
-
export declare function
|
|
55
|
-
|
|
56
|
-
context:
|
|
71
|
+
export declare function applyBrowserScorer(args: {
|
|
72
|
+
scorer: BrowserScorer | undefined;
|
|
73
|
+
context: BrowserScoringFacts;
|
|
57
74
|
bundle: RunBundle;
|
|
58
75
|
sanitize: (text: string) => string;
|
|
59
76
|
warnings: string[];
|
|
60
|
-
hookLabel: string;
|
|
61
77
|
/** Present only when the scorer was CONFIG-DECLARED (#316); core-stamped onto the bundle as
|
|
62
78
|
* evidence of which out-of-tree module was loaded. Absent for library callers. Its presence also
|
|
63
79
|
* makes a THROWING or MALFORMED scorer a failure — a declared gate that cannot render a pass is
|
|
64
80
|
* a fail, never a silent green. */
|
|
65
81
|
scorerProvenance?: RunScorerProvenance;
|
|
66
82
|
}): Promise<ScorerOutcome>;
|
|
83
|
+
/**
|
|
84
|
+
* A feedback candidate a scorer returned, accepted at the seam: the bundle's candidate shape with a
|
|
85
|
+
* non-empty summary. The browser and terminal seams both use it, so a candidate either seam drops
|
|
86
|
+
* never reaches a bundle.
|
|
87
|
+
*/
|
|
88
|
+
export declare function isAdapterFeedbackCandidate(value: unknown): value is RunFeedbackCandidate;
|
|
67
89
|
export declare function adapterScoreFailureMessage(bundle: RunBundle): string | undefined;
|
|
68
90
|
/**
|
|
69
91
|
* Deep-freeze a structured clone so a loaded scorer sees a READ-ONLY bundle: it cannot mutate
|