humanish 0.106.1 → 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 -4
- package/ARCHITECTURE.md +17 -16
- package/CHANGELOG.md +14 -0
- package/CONTEXT.md +42 -39
- package/CONTRIBUTING.md +8 -8
- 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 +30 -3
- package/dist/actors/codex/qualified-versions.js +50 -5
- 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 +9 -7
- 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.js +20 -20
- 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 +0 -2
- package/dist/lab/plan-base.js +6 -4
- package/dist/lab/plan-participants.d.ts +5 -5
- package/dist/lab/plan-participants.js +2 -2
- package/dist/lab/plan-types.d.ts +22 -4
- 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/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} +12 -11
- 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 +49 -25
- 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 +52 -60
- package/dist/routes/computer-use/preflight.d.ts +3 -5
- package/dist/routes/computer-use/preflight.js +20 -16
- 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 -14
- package/dist/routes/computer-use/setup.js +96 -72
- 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 -210
- package/dist/routes/computer-use/types.js +13 -5
- 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 +9 -5
- 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} +43 -48
- 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 +46 -40
- 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 +3 -2
- package/dist/routes/terminal/live-sandbox.js +20 -20
- 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 +3 -3
- package/dist/routes/terminal/sandbox.js +9 -9
- 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 +6 -0
- package/dist/run/reclaim.js +13 -3
- 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/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.js +1 -1
- package/dist/substrates/e2b/sdk.js +2 -2
- 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 +36 -2
- 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
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
// The per-launch protocol check: the generated app-server schema against the fields humanish reads
|
|
2
|
+
// and sends (protocol-contract.ts). It checks only those fields. It does not guarantee the rest of
|
|
3
|
+
// the protocol, and it does not attest how the release behaves.
|
|
4
|
+
import { lstat, readFile } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
const MAX_SCHEMA_FILE_BYTES = 16 * 1024 * 1024;
|
|
7
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
8
|
+
? value
|
|
9
|
+
: {};
|
|
10
|
+
const list = (value) => (Array.isArray(value) ? value : []);
|
|
11
|
+
/** A regular file of at most 16 MiB, checked before it is opened: no pipe, device or link. */
|
|
12
|
+
async function readJson(file) {
|
|
13
|
+
const info = await lstat(file);
|
|
14
|
+
if (!info.isFile() || info.size > MAX_SCHEMA_FILE_BYTES)
|
|
15
|
+
throw new Error(`${file} is not a schema file`);
|
|
16
|
+
return record(JSON.parse(await readFile(file, "utf8")));
|
|
17
|
+
}
|
|
18
|
+
/** Each method of a ClientRequest or ServerNotification union, with its params definition. */
|
|
19
|
+
function methodParams(union) {
|
|
20
|
+
const result = new Map();
|
|
21
|
+
for (const branch of list(union.oneOf)) {
|
|
22
|
+
const properties = record(record(branch).properties);
|
|
23
|
+
const method = list(record(properties.method).enum)[0];
|
|
24
|
+
const ref = record(properties.params).$ref;
|
|
25
|
+
if (typeof method === "string" && typeof ref === "string")
|
|
26
|
+
result.set(method, ref.split("/").pop());
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reads the files `codex app-server generate-json-schema --experimental` writes: the v2 and full
|
|
32
|
+
* bundles for definitions, and the ClientRequest and ServerNotification unions for params.
|
|
33
|
+
*/
|
|
34
|
+
export async function loadProtocolSchema(directory) {
|
|
35
|
+
const definitions = new Map();
|
|
36
|
+
for (const name of [
|
|
37
|
+
"codex_app_server_protocol.v2.schemas.json",
|
|
38
|
+
"codex_app_server_protocol.schemas.json",
|
|
39
|
+
]) {
|
|
40
|
+
const bundle = await readJson(path.join(directory, name));
|
|
41
|
+
for (const [key, value] of Object.entries(record(bundle.definitions)))
|
|
42
|
+
if (!definitions.has(key))
|
|
43
|
+
definitions.set(key, value);
|
|
44
|
+
}
|
|
45
|
+
const requests = await readJson(path.join(directory, "ClientRequest.json"));
|
|
46
|
+
const notifications = await readJson(path.join(directory, "ServerNotification.json"));
|
|
47
|
+
return {
|
|
48
|
+
definitions,
|
|
49
|
+
requestParams: methodParams(requests),
|
|
50
|
+
notificationParams: methodParams(notifications),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Types both declarations allow; an integer is a number. */
|
|
54
|
+
function sharedTypes(a, b) {
|
|
55
|
+
const left = Array.isArray(a) ? a : [a], right = Array.isArray(b) ? b : [b];
|
|
56
|
+
const shared = new Set();
|
|
57
|
+
for (const type of left)
|
|
58
|
+
if (right.includes(type))
|
|
59
|
+
shared.add(String(type));
|
|
60
|
+
else if (type === "integer" && right.includes("number"))
|
|
61
|
+
shared.add("integer");
|
|
62
|
+
else if (type === "number" && right.includes("integer"))
|
|
63
|
+
shared.add("integer");
|
|
64
|
+
return [...shared];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Two schemas a value must both satisfy, as one: types and fixed values intersect, required fields
|
|
68
|
+
* add up, and a property, items or additionalProperties both constrain becomes their `allOf`.
|
|
69
|
+
* False when nothing satisfies both.
|
|
70
|
+
*/
|
|
71
|
+
function intersect(a, b) {
|
|
72
|
+
if (a === false || b === false)
|
|
73
|
+
return false;
|
|
74
|
+
if (a === true)
|
|
75
|
+
return b;
|
|
76
|
+
if (b === true)
|
|
77
|
+
return a;
|
|
78
|
+
const out = { ...a };
|
|
79
|
+
for (const [key, value] of Object.entries(b)) {
|
|
80
|
+
if (!(key in out))
|
|
81
|
+
out[key] = value;
|
|
82
|
+
else if (key === "properties") {
|
|
83
|
+
const merged = { ...record(out.properties) };
|
|
84
|
+
for (const [name, schema] of Object.entries(record(value)))
|
|
85
|
+
merged[name] = name in merged ? { allOf: [merged[name], schema] } : schema;
|
|
86
|
+
out.properties = merged;
|
|
87
|
+
}
|
|
88
|
+
else if (key === "required")
|
|
89
|
+
out.required = [...new Set([...list(out.required), ...list(value)])];
|
|
90
|
+
else if (key === "type")
|
|
91
|
+
out.type = sharedTypes(out.type, value);
|
|
92
|
+
else if (key === "enum")
|
|
93
|
+
out.enum = list(out.enum).filter((item) => list(value).includes(item));
|
|
94
|
+
else if (key === "const") {
|
|
95
|
+
if (out.const !== value)
|
|
96
|
+
out.enum = [];
|
|
97
|
+
}
|
|
98
|
+
else if (key === "items" || key === "additionalProperties")
|
|
99
|
+
out[key] = { allOf: [out[key], value] };
|
|
100
|
+
else
|
|
101
|
+
out[key] = value;
|
|
102
|
+
}
|
|
103
|
+
if ("const" in out && "enum" in out) {
|
|
104
|
+
out.enum = list(out.enum).filter((item) => item === out.const);
|
|
105
|
+
delete out.const;
|
|
106
|
+
}
|
|
107
|
+
const empty = (key) => Array.isArray(out[key]) && list(out[key]).length === 0;
|
|
108
|
+
return empty("type") || empty("enum") ? false : out;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A field's schema as the alternatives it may take: `$ref`s followed, `allOf` intersected, and
|
|
112
|
+
* `anyOf` and `oneOf` expanded, so that each alternative is one plain schema. `false` (no value)
|
|
113
|
+
* is dropped; `true` (any value) stays.
|
|
114
|
+
*/
|
|
115
|
+
function alternatives(schema, node, seen = new Set()) {
|
|
116
|
+
if (typeof node === "boolean")
|
|
117
|
+
return node ? [true] : [];
|
|
118
|
+
if (typeof node.$ref === "string") {
|
|
119
|
+
// The full bundle nests v2 definitions (`#/definitions/v2/Name`); the v2 bundle has each by name.
|
|
120
|
+
const name = node.$ref.split("/").pop();
|
|
121
|
+
const target = schema.definitions.get(name);
|
|
122
|
+
if (target === undefined || seen.has(name))
|
|
123
|
+
return [];
|
|
124
|
+
return alternatives(schema, target, new Set([...seen, name]));
|
|
125
|
+
}
|
|
126
|
+
const own = { ...node };
|
|
127
|
+
delete own.anyOf;
|
|
128
|
+
delete own.oneOf;
|
|
129
|
+
delete own.allOf;
|
|
130
|
+
let result = [own];
|
|
131
|
+
for (const member of list(node.allOf)) {
|
|
132
|
+
const parts = alternatives(schema, member, seen);
|
|
133
|
+
result = result.flatMap((base) => parts.map((part) => intersect(base, part)));
|
|
134
|
+
}
|
|
135
|
+
const union = [...list(node.anyOf), ...list(node.oneOf)];
|
|
136
|
+
if (union.length > 0)
|
|
137
|
+
result = result.flatMap((base) => union.flatMap((branch) => alternatives(schema, branch, seen).map((part) => intersect(base, part))));
|
|
138
|
+
return result.filter((part) => part !== false);
|
|
139
|
+
}
|
|
140
|
+
function kindOf(value) {
|
|
141
|
+
if (value === null)
|
|
142
|
+
return "null";
|
|
143
|
+
if (Array.isArray(value))
|
|
144
|
+
return "array";
|
|
145
|
+
if (typeof value === "number")
|
|
146
|
+
return Number.isInteger(value) ? "integer" : "number";
|
|
147
|
+
return typeof value;
|
|
148
|
+
}
|
|
149
|
+
/** The fixed values an alternative allows, or undefined when it does not fix them. */
|
|
150
|
+
const fixedValues = (node) => node.const !== undefined ? [node.const] : Array.isArray(node.enum) ? node.enum : undefined;
|
|
151
|
+
/** The JSON types an alternative allows; `any` when it constrains none. */
|
|
152
|
+
function typesOf(node) {
|
|
153
|
+
if (typeof node === "boolean")
|
|
154
|
+
return new Set(node ? ["any"] : []);
|
|
155
|
+
const declared = node.type;
|
|
156
|
+
if (typeof declared === "string")
|
|
157
|
+
return new Set([declared]);
|
|
158
|
+
if (Array.isArray(declared))
|
|
159
|
+
return new Set(declared);
|
|
160
|
+
const fixed = fixedValues(node);
|
|
161
|
+
if (fixed !== undefined)
|
|
162
|
+
return new Set(fixed.map(kindOf));
|
|
163
|
+
if (node.properties !== undefined)
|
|
164
|
+
return new Set(["object"]);
|
|
165
|
+
if (node.items !== undefined)
|
|
166
|
+
return new Set(["array"]);
|
|
167
|
+
return new Set(["any"]);
|
|
168
|
+
}
|
|
169
|
+
const accepts = (types, type) => types.has(type) || types.has("any") || (type === "integer" && types.has("number"));
|
|
170
|
+
/** Whether an alternative allows a value humanish compares against or sends. */
|
|
171
|
+
function allows(node, value) {
|
|
172
|
+
if (typeof node === "boolean")
|
|
173
|
+
return node;
|
|
174
|
+
if (!accepts(typesOf(node), kindOf(value)))
|
|
175
|
+
return false;
|
|
176
|
+
const fixed = fixedValues(node);
|
|
177
|
+
return fixed === undefined || fixed.includes(value);
|
|
178
|
+
}
|
|
179
|
+
function property(schema, node, name) {
|
|
180
|
+
if (typeof node !== "object")
|
|
181
|
+
return [];
|
|
182
|
+
const properties = record(node.properties);
|
|
183
|
+
if (Object.hasOwn(properties, name))
|
|
184
|
+
return alternatives(schema, properties[name]);
|
|
185
|
+
const extra = node.additionalProperties;
|
|
186
|
+
return extra === true || typeof extra === "object" ? alternatives(schema, extra) : [];
|
|
187
|
+
}
|
|
188
|
+
/** Whether a union branch's discriminator `field` is fixed to `value`. */
|
|
189
|
+
function selects(schema, node, field, value) {
|
|
190
|
+
return property(schema, node, field).some((part) => typeof part === "object" && (fixedValues(part) ?? []).includes(value));
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The alternatives at `path` under a definition, and each container on the way. A step is
|
|
194
|
+
* `name`, `name[]` (its array items) or `{field=value}` (the union branches with that value).
|
|
195
|
+
*/
|
|
196
|
+
function walk(schema, definition, fieldPath) {
|
|
197
|
+
const root = schema.definitions.get(definition);
|
|
198
|
+
let nodes = root === undefined ? [] : alternatives(schema, root);
|
|
199
|
+
const containers = [];
|
|
200
|
+
const done = [];
|
|
201
|
+
for (const segment of fieldPath === "" ? [] : fieldPath.split(".")) {
|
|
202
|
+
if (done.length > 0)
|
|
203
|
+
containers.push({ prefix: done.join("."), nodes, kind: "object" });
|
|
204
|
+
const branch = /^\{([A-Za-z_]+)=([A-Za-z0-9_/-]+)\}$/.exec(segment);
|
|
205
|
+
if (branch)
|
|
206
|
+
nodes = nodes.filter((node) => selects(schema, node, branch[1], branch[2]));
|
|
207
|
+
else {
|
|
208
|
+
const array = segment.endsWith("[]");
|
|
209
|
+
const name = array ? segment.slice(0, -2) : segment;
|
|
210
|
+
nodes = nodes.flatMap((node) => property(schema, node, name));
|
|
211
|
+
if (array) {
|
|
212
|
+
containers.push({ prefix: [...done, name].join("."), nodes, kind: "array" });
|
|
213
|
+
nodes = nodes.flatMap((node) => typeof node === "object" && node.items !== undefined
|
|
214
|
+
? alternatives(schema, node.items)
|
|
215
|
+
: []);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
done.push(segment);
|
|
219
|
+
}
|
|
220
|
+
return { nodes, containers };
|
|
221
|
+
}
|
|
222
|
+
/** A field's alternatives at `path` under a definition, or none when the field is gone. */
|
|
223
|
+
export function resolveField(schema, definition, fieldPath) {
|
|
224
|
+
return walk(schema, definition, fieldPath).nodes;
|
|
225
|
+
}
|
|
226
|
+
const show = (value) => (value === null ? "null" : String(value));
|
|
227
|
+
const typesIn = (nodes) => [
|
|
228
|
+
...new Set(nodes.flatMap((node) => [...typesOf(node)])),
|
|
229
|
+
];
|
|
230
|
+
/** String values offered at a field, or undefined when an alternative allows any string. */
|
|
231
|
+
function offeredStrings(nodes) {
|
|
232
|
+
const values = [];
|
|
233
|
+
for (const node of nodes.filter((entry) => accepts(typesOf(entry), "string"))) {
|
|
234
|
+
const fixed = typeof node === "object" ? fixedValues(node) : undefined;
|
|
235
|
+
if (fixed === undefined)
|
|
236
|
+
return undefined;
|
|
237
|
+
values.push(...fixed.filter((value) => typeof value === "string"));
|
|
238
|
+
}
|
|
239
|
+
return [...new Set(values)];
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* A read field: every type the release allows there, and in each container on the way, is one
|
|
243
|
+
* humanish handles; each compared value is still allowed; values beyond `known` are recorded.
|
|
244
|
+
* `listed` holds the paths with their own rule, whose types decide for that container.
|
|
245
|
+
*/
|
|
246
|
+
function checkRead(schema, owner, definition, rule, listed, found) {
|
|
247
|
+
const { nodes, containers } = walk(schema, definition, rule.path);
|
|
248
|
+
if (nodes.length === 0) {
|
|
249
|
+
if (!rule.optional)
|
|
250
|
+
found.incompatibilities.add(`${owner} ${rule.path} is no longer in the schema`);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
for (const container of containers.filter((entry) => !listed.has(entry.prefix))) {
|
|
254
|
+
const foreign = typesIn(container.nodes).filter((type) => type !== container.kind);
|
|
255
|
+
if (foreign.length > 0)
|
|
256
|
+
found.incompatibilities.add(`${owner} ${container.prefix} now allows ${foreign.join(", ")}; humanish reads ${container.kind}`);
|
|
257
|
+
}
|
|
258
|
+
if (rule.types !== undefined) {
|
|
259
|
+
const accepted = new Set(rule.types);
|
|
260
|
+
if (accepted.has("number"))
|
|
261
|
+
accepted.add("integer");
|
|
262
|
+
const foreign = typesIn(nodes).filter((type) => !accepted.has(type));
|
|
263
|
+
if (foreign.length > 0)
|
|
264
|
+
found.incompatibilities.add(`${owner} ${rule.path} now allows ${foreign.join(", ")}; humanish reads ${rule.types.join(" or ")}`);
|
|
265
|
+
}
|
|
266
|
+
const missing = (rule.expects ?? []).filter((value) => !nodes.some((node) => allows(node, value)));
|
|
267
|
+
if (missing.length > 0)
|
|
268
|
+
found.incompatibilities.add(`${owner} ${rule.path} no longer allows ${missing.map(show).join(", ")}`);
|
|
269
|
+
const offered = rule.known === undefined ? undefined : offeredStrings(nodes);
|
|
270
|
+
if (offered === undefined)
|
|
271
|
+
return;
|
|
272
|
+
const known = new Set([...rule.known, ...(rule.expects ?? [])]);
|
|
273
|
+
const added = offered.filter((value) => !known.has(value));
|
|
274
|
+
if (added.length > 0)
|
|
275
|
+
found.additions.add(`${owner} ${rule.path} now also allows ${added.join(", ")}`);
|
|
276
|
+
}
|
|
277
|
+
/** A sent field: some alternative still accepts each type and value humanish sends there. */
|
|
278
|
+
function checkSent(schema, owner, definition, rule, found) {
|
|
279
|
+
const nodes = resolveField(schema, definition, rule.path);
|
|
280
|
+
const where = rule.path === "" ? owner : `${owner} ${rule.path}`;
|
|
281
|
+
if (nodes.length === 0) {
|
|
282
|
+
found.incompatibilities.add(`${where} is no longer accepted`);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
for (const type of rule.sends)
|
|
286
|
+
if (!nodes.some((node) => accepts(typesOf(node), type)))
|
|
287
|
+
found.incompatibilities.add(`${where} no longer accepts ${type}`);
|
|
288
|
+
for (const value of rule.expects ?? [])
|
|
289
|
+
if (!nodes.some((node) => allows(node, value)))
|
|
290
|
+
found.incompatibilities.add(`${where} no longer accepts ${show(value)}`);
|
|
291
|
+
const fields = rule.fields;
|
|
292
|
+
if (fields === undefined)
|
|
293
|
+
return;
|
|
294
|
+
const required = nodes.flatMap((node) => (typeof node === "object" ? list(node.required) : []));
|
|
295
|
+
const unsent = [...new Set(required)].filter((field) => typeof field === "string" && !fields.includes(field));
|
|
296
|
+
if (unsent.length > 0)
|
|
297
|
+
found.incompatibilities.add(`${where} now requires ${unsent.join(", ")}, which humanish does not send`);
|
|
298
|
+
}
|
|
299
|
+
function checkReads(schema, owner, definition, rules, found) {
|
|
300
|
+
const listed = new Set(rules.map((rule) => rule.path));
|
|
301
|
+
for (const rule of rules)
|
|
302
|
+
checkRead(schema, owner, definition, rule, listed, found);
|
|
303
|
+
}
|
|
304
|
+
/** Checks a generated schema against the contract; any incompatibility refuses the launch. */
|
|
305
|
+
export function checkProtocol(schema, contract) {
|
|
306
|
+
const found = { incompatibilities: new Set(), additions: new Set() };
|
|
307
|
+
const present = (name, what) => {
|
|
308
|
+
if (schema.definitions.has(name))
|
|
309
|
+
return true;
|
|
310
|
+
found.incompatibilities.add(`${what} ${name} is no longer in the schema`);
|
|
311
|
+
return false;
|
|
312
|
+
};
|
|
313
|
+
for (const request of contract.requests) {
|
|
314
|
+
const params = schema.requestParams.get(request.method);
|
|
315
|
+
if (params === undefined) {
|
|
316
|
+
found.incompatibilities.add(`${request.method} is no longer a client request`);
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
for (const rule of request.params)
|
|
320
|
+
checkSent(schema, `${request.method} request`, params, rule, found);
|
|
321
|
+
const response = request.response;
|
|
322
|
+
if (response && present(response.definition, `${request.method}'s response`))
|
|
323
|
+
checkReads(schema, `${request.method} response`, response.definition, response.reads, found);
|
|
324
|
+
}
|
|
325
|
+
for (const message of contract.messages) {
|
|
326
|
+
if (present(message.definition, `${message.method}'s`))
|
|
327
|
+
checkReads(schema, message.method, message.definition, message.reads, found);
|
|
328
|
+
const reply = message.reply;
|
|
329
|
+
if (reply && present(reply.definition, `${message.method}'s reply`))
|
|
330
|
+
for (const rule of reply.sends)
|
|
331
|
+
checkSent(schema, `${message.method} reply`, reply.definition, rule, found);
|
|
332
|
+
}
|
|
333
|
+
// The carriers in every notification, including the consumed ones outside ServerNotification.
|
|
334
|
+
const notifications = new Map(schema.notificationParams);
|
|
335
|
+
for (const message of contract.messages)
|
|
336
|
+
if (message.reply === undefined && !notifications.has(message.method))
|
|
337
|
+
notifications.set(message.method, message.definition);
|
|
338
|
+
for (const [method, params] of notifications)
|
|
339
|
+
checkReads(schema, method, params, contract.itemCarriers, found);
|
|
340
|
+
return { incompatibilities: [...found.incompatibilities], additions: [...found.additions] };
|
|
341
|
+
}
|
|
342
|
+
const listed = (items) => items.length <= 5
|
|
343
|
+
? items.join("; ")
|
|
344
|
+
: `${items.slice(0, 5).join("; ")}; and ${items.length - 5} more`;
|
|
345
|
+
/** The refusal detail for an incompatible release. */
|
|
346
|
+
export function protocolIncompatibilityMessage(cliVersion, incompatibilities) {
|
|
347
|
+
const release = `Codex CLI${cliVersion === undefined ? "" : ` ${cliVersion}`}`;
|
|
348
|
+
return incompatibilities.length === 0
|
|
349
|
+
? `${release} changed the app-server protocol humanish uses.`
|
|
350
|
+
: `${release} changed the app-server protocol humanish uses: ${listed(incompatibilities)}.`;
|
|
351
|
+
}
|
|
352
|
+
/** The run warning for schema values beyond the baseline, or undefined when there were none. */
|
|
353
|
+
export function protocolAdditionsWarning(cliVersion, additions) {
|
|
354
|
+
if (additions === undefined || additions.length === 0)
|
|
355
|
+
return undefined;
|
|
356
|
+
return `Codex CLI${cliVersion === undefined ? "" : ` ${cliVersion}`}'s app-server schema has values humanish has not seen: ${listed(additions)}. humanish recorded them and continued.`;
|
|
357
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type ProtocolPrimitive = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
|
|
2
|
+
/** A value humanish compares against or sends. */
|
|
3
|
+
export type ProtocolValue = string | boolean | null;
|
|
4
|
+
/** One field humanish reads. */
|
|
5
|
+
export interface ProtocolFieldRule {
|
|
6
|
+
/** Dot path under the definition. `name[]` is its array items; `{field=value}` selects a branch. */
|
|
7
|
+
readonly path: string;
|
|
8
|
+
/** The types humanish accepts; a release that allows another refuses. Omitted: presence only. */
|
|
9
|
+
readonly types?: readonly ProtocolPrimitive[];
|
|
10
|
+
readonly expects?: readonly ProtocolValue[];
|
|
11
|
+
readonly known?: readonly string[];
|
|
12
|
+
/** humanish handles the field's absence; when present, its types are still checked. */
|
|
13
|
+
readonly optional?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** One field humanish sends: the schema must still accept each type and value it sends there. */
|
|
16
|
+
export interface ProtocolSentField {
|
|
17
|
+
readonly path: string;
|
|
18
|
+
readonly sends: readonly ProtocolPrimitive[];
|
|
19
|
+
readonly expects?: readonly ProtocolValue[];
|
|
20
|
+
/** For an object: every field humanish sends in it; a field the release newly requires refuses. */
|
|
21
|
+
readonly fields?: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
interface ProtocolRequest {
|
|
24
|
+
readonly method: string;
|
|
25
|
+
readonly params: readonly ProtocolSentField[];
|
|
26
|
+
/** The response definition, named here because the schema does not link it to its method. */
|
|
27
|
+
readonly response?: {
|
|
28
|
+
readonly definition: string;
|
|
29
|
+
readonly reads: readonly ProtocolFieldRule[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface ProtocolMessage {
|
|
33
|
+
/** The notification method, or the server request humanish answers. */
|
|
34
|
+
readonly method: string;
|
|
35
|
+
readonly definition: string;
|
|
36
|
+
readonly reads: readonly ProtocolFieldRule[];
|
|
37
|
+
/** The answer humanish sends to a server request. */
|
|
38
|
+
readonly reply?: {
|
|
39
|
+
readonly definition: string;
|
|
40
|
+
readonly sends: readonly ProtocolSentField[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface ProtocolContract {
|
|
44
|
+
readonly requests: readonly ProtocolRequest[];
|
|
45
|
+
readonly messages: readonly ProtocolMessage[];
|
|
46
|
+
/** Read in every server notification's params (restricted-notifications.ts, notificationItems). */
|
|
47
|
+
readonly itemCarriers: readonly ProtocolFieldRule[];
|
|
48
|
+
}
|
|
49
|
+
/** What a launch compares against that depends on the launch. */
|
|
50
|
+
export interface ProtocolContractHost {
|
|
51
|
+
/** The reasoning effort the launch configures and expects back. */
|
|
52
|
+
readonly reasoningEffort: string;
|
|
53
|
+
readonly platform: NodeJS.Platform;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The contract for one launch. config/read's `config` is typed only for some keys; the keys
|
|
57
|
+
* humanish pins that the schema leaves open are checked at launch by admitsRestrictedCodexConfig,
|
|
58
|
+
* which compares exact values, so they are not listed here.
|
|
59
|
+
*/
|
|
60
|
+
export declare function protocolContract(host: ProtocolContractHost): ProtocolContract;
|
|
61
|
+
export {};
|