harnery 0.33.0 → 0.34.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/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +4 -0
- package/dist/commands/adapter.js +2 -2
- package/dist/commands/agents.d.ts +144 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +1220 -588
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +7 -6
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +29 -16
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +234 -12
- package/dist/commands/checkpoint.d.ts.map +1 -1
- package/dist/commands/checkpoint.js +3 -2
- package/dist/commands/claude-desktop.d.ts +1 -1
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +3 -74
- package/dist/commands/context.js +1 -6
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +22 -38
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +91 -28
- package/dist/commands/doctor.js +10 -1
- package/dist/commands/events.d.ts +5 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +189 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +13 -4
- package/dist/commands/init.d.ts +9 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +223 -51
- package/dist/commands/journal.d.ts.map +1 -1
- package/dist/commands/journal.js +4 -13
- package/dist/commands/ledger-v3.d.ts +5 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -0
- package/dist/commands/ledger-v3.js +91 -0
- package/dist/commands/presence.d.ts.map +1 -1
- package/dist/commands/presence.js +11 -5
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/web.d.ts +6 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +67 -7
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +22 -5
- package/dist/core/adapter.d.ts +5 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +1 -0
- package/dist/core/adapters/attest.d.ts +5 -2
- package/dist/core/adapters/attest.d.ts.map +1 -1
- package/dist/core/adapters/attest.js +8 -3
- package/dist/core/adapters/profiles.d.ts +6 -6
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +4 -4
- package/dist/core/agents/canonical-emit.d.ts +17 -15
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +22 -22
- package/dist/core/agents/cli.js +207 -234
- package/dist/core/agents/codex-archive-v3.d.ts +14 -0
- package/dist/core/agents/codex-archive-v3.d.ts.map +1 -0
- package/dist/core/agents/codex-archive-v3.js +110 -0
- package/dist/core/agents/coord-client.d.ts +19 -81
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +65 -155
- package/dist/core/agents/finalization.d.ts +4 -1
- package/dist/core/agents/finalization.d.ts.map +1 -1
- package/dist/core/agents/finalization.js +89 -32
- package/dist/core/agents/index.d.ts +4 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +4 -5
- package/dist/core/agents/live-authority-v3.d.ts +59 -0
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -0
- package/dist/core/agents/live-authority-v3.js +233 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts +20 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -0
- package/dist/core/agents/live-lifecycle-v3.js +91 -0
- package/dist/core/agents/live-observation-v3.d.ts +25 -0
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -0
- package/dist/core/agents/live-observation-v3.js +157 -0
- package/dist/core/agents/render/prompt-context.d.ts +4 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +23 -58
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +8 -32
- package/dist/core/agents/rules/claim-conflict.d.ts +3 -3
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +79 -127
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +3 -18
- package/dist/core/agents/rules/stop-hook.d.ts +9 -50
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +193 -236
- package/dist/core/agents/session-events.d.ts +5 -7
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +127 -95
- package/dist/core/agents/session-finalization-state-v3.d.ts +30 -0
- package/dist/core/agents/session-finalization-state-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalization-state-v3.js +40 -0
- package/dist/core/agents/session-finalizer-v3.d.ts +107 -0
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalizer-v3.js +734 -0
- package/dist/core/agents/session-name-display.d.ts +40 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -0
- package/dist/core/agents/session-name-display.js +119 -0
- package/dist/core/agents/state/activity-log.d.ts +3 -3
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +7 -16
- package/dist/core/agents/state/heartbeat-writer.d.ts +23 -55
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +56 -228
- package/dist/core/agents/state/live-coordination-view.d.ts +31 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-view.js +209 -0
- package/dist/core/agents/state/session-state.d.ts +4 -3
- package/dist/core/agents/state/session-state.d.ts.map +1 -1
- package/dist/core/agents/state/session-state.js +18 -9
- package/dist/core/agents/state/stale-sweep.d.ts +1 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +26 -15
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +5 -7
- package/dist/core/config.d.ts +33 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -2
- package/dist/core/context/index.d.ts +1 -4
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +9 -9
- package/dist/core/events/span-parent.d.ts +15 -0
- package/dist/core/events/span-parent.d.ts.map +1 -0
- package/dist/core/events/span-parent.js +34 -0
- package/dist/core/events/v3/advance.d.ts +14 -0
- package/dist/core/events/v3/advance.d.ts.map +1 -0
- package/dist/core/events/v3/advance.js +134 -0
- package/dist/core/events/v3/authority-outbox.d.ts +78 -0
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -0
- package/dist/core/events/v3/authority-outbox.js +399 -0
- package/dist/core/events/v3/base-builder.d.ts +20 -0
- package/dist/core/events/v3/base-builder.d.ts.map +1 -0
- package/dist/core/events/v3/base-builder.js +29 -0
- package/dist/core/events/v3/base-contract.d.ts +7576 -0
- package/dist/core/events/v3/base-contract.d.ts.map +1 -0
- package/dist/core/events/v3/base-contract.js +647 -0
- package/dist/core/events/v3/bootstrap.d.ts +34 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -0
- package/dist/core/events/v3/bootstrap.js +175 -0
- package/dist/core/events/v3/builder.d.ts +20 -0
- package/dist/core/events/v3/builder.d.ts.map +1 -0
- package/dist/core/events/v3/builder.js +28 -0
- package/dist/core/events/v3/canonical.d.ts +31 -0
- package/dist/core/events/v3/canonical.d.ts.map +1 -0
- package/dist/core/events/v3/canonical.js +100 -0
- package/dist/core/events/v3/capabilities.d.ts +31 -0
- package/dist/core/events/v3/capabilities.d.ts.map +1 -0
- package/dist/core/events/v3/capabilities.js +107 -0
- package/dist/core/events/v3/capability-drift.d.ts +22 -0
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -0
- package/dist/core/events/v3/capability-drift.js +134 -0
- package/dist/core/events/v3/catalog.d.ts +38 -0
- package/dist/core/events/v3/catalog.d.ts.map +1 -0
- package/dist/core/events/v3/catalog.js +135 -0
- package/dist/core/events/v3/clock-order.d.ts +34 -0
- package/dist/core/events/v3/clock-order.d.ts.map +1 -0
- package/dist/core/events/v3/clock-order.js +35 -0
- package/dist/core/events/v3/contract.d.ts +171 -0
- package/dist/core/events/v3/contract.d.ts.map +1 -0
- package/dist/core/events/v3/contract.js +180 -0
- package/dist/core/events/v3/control.d.ts +111 -0
- package/dist/core/events/v3/control.d.ts.map +1 -0
- package/dist/core/events/v3/control.js +419 -0
- package/dist/core/events/v3/coordination-view.d.ts +69 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-view.js +119 -0
- package/dist/core/events/v3/economics.d.ts +77 -0
- package/dist/core/events/v3/economics.d.ts.map +1 -0
- package/dist/core/events/v3/economics.js +274 -0
- package/dist/core/events/v3/finalization-view.d.ts +26 -0
- package/dist/core/events/v3/finalization-view.d.ts.map +1 -0
- package/dist/core/events/v3/finalization-view.js +37 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts +25 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts.map +1 -0
- package/dist/core/events/v3/fingerprint-keys.js +217 -0
- package/dist/core/events/v3/generated.d.ts +4 -0
- package/dist/core/events/v3/generated.d.ts.map +1 -0
- package/dist/core/events/v3/generated.js +47 -0
- package/dist/core/events/v3/ids.d.ts +9 -0
- package/dist/core/events/v3/ids.d.ts.map +1 -0
- package/dist/core/events/v3/ids.js +25 -0
- package/dist/core/events/v3/index.d.ts +35 -0
- package/dist/core/events/v3/index.d.ts.map +1 -0
- package/dist/core/events/v3/index.js +33 -0
- package/dist/core/events/v3/latency.d.ts +63 -0
- package/dist/core/events/v3/latency.d.ts.map +1 -0
- package/dist/core/events/v3/latency.js +412 -0
- package/dist/core/events/v3/live-feed.d.ts +45 -0
- package/dist/core/events/v3/live-feed.d.ts.map +1 -0
- package/dist/core/events/v3/live-feed.js +246 -0
- package/dist/core/events/v3/live-observation.d.ts +35 -0
- package/dist/core/events/v3/live-observation.d.ts.map +1 -0
- package/dist/core/events/v3/live-observation.js +1 -0
- package/dist/core/events/v3/live-routing.d.ts +57 -0
- package/dist/core/events/v3/live-routing.d.ts.map +1 -0
- package/dist/core/events/v3/live-routing.js +107 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts +67 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command-recorder.js +477 -0
- package/dist/core/events/v3/producers/command.d.ts +50 -0
- package/dist/core/events/v3/producers/command.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command.js +135 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +53 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination-recorder.js +376 -0
- package/dist/core/events/v3/producers/coordination.d.ts +90 -0
- package/dist/core/events/v3/producers/coordination.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination.js +229 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +54 -0
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook-base.js +424 -0
- package/dist/core/events/v3/producers/hook.d.ts +29 -0
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook.js +71 -0
- package/dist/core/events/v3/producers/intake.d.ts +65 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -0
- package/dist/core/events/v3/producers/intake.js +244 -0
- package/dist/core/events/v3/producers/recorder.d.ts +240 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/recorder.js +2176 -0
- package/dist/core/events/v3/projection.d.ts +101 -0
- package/dist/core/events/v3/projection.d.ts.map +1 -0
- package/dist/core/events/v3/projection.js +479 -0
- package/dist/core/events/v3/reader.d.ts +75 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -0
- package/dist/core/events/v3/reader.js +778 -0
- package/dist/core/events/v3/recovery-record.d.ts +47 -0
- package/dist/core/events/v3/recovery-record.d.ts.map +1 -0
- package/dist/core/events/v3/recovery-record.js +167 -0
- package/dist/core/events/v3/recovery.d.ts +22 -0
- package/dist/core/events/v3/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/recovery.js +227 -0
- package/dist/core/events/v3/span-state.d.ts +52 -0
- package/dist/core/events/v3/span-state.d.ts.map +1 -0
- package/dist/core/events/v3/span-state.js +142 -0
- package/dist/core/events/v3/targets.d.ts +23 -0
- package/dist/core/events/v3/targets.d.ts.map +1 -0
- package/dist/core/events/v3/targets.js +134 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +41 -0
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -0
- package/dist/core/events/v3/turn-telemetry.js +168 -0
- package/dist/core/events/v3/validate.d.ts +9 -0
- package/dist/core/events/v3/validate.d.ts.map +1 -0
- package/dist/core/events/v3/validate.js +281 -0
- package/dist/core/events/v3/writer.d.ts +56 -0
- package/dist/core/events/v3/writer.d.ts.map +1 -0
- package/dist/core/events/v3/writer.js +335 -0
- package/dist/core/governor/index.d.ts +1 -1
- package/dist/core/governor/index.d.ts.map +1 -1
- package/dist/core/governor/index.js +1 -1
- package/dist/core/governor/plan-api.d.ts +2 -1
- package/dist/core/governor/plan-api.d.ts.map +1 -1
- package/dist/core/governor/plan-api.js +6 -3
- package/dist/core/governor/read.d.ts +1 -1
- package/dist/core/governor/read.d.ts.map +1 -1
- package/dist/core/governor/read.js +1 -1
- package/dist/core/governor/state.d.ts +9 -0
- package/dist/core/governor/state.d.ts.map +1 -1
- package/dist/core/governor/state.js +40 -3
- package/dist/core/guard/config.d.ts +5 -0
- package/dist/core/guard/config.d.ts.map +1 -0
- package/dist/core/guard/config.js +157 -0
- package/dist/core/guard/coordinator.d.ts +14 -0
- package/dist/core/guard/coordinator.d.ts.map +1 -0
- package/dist/core/guard/coordinator.js +173 -0
- package/dist/core/guard/evaluator.d.ts +4 -0
- package/dist/core/guard/evaluator.d.ts.map +1 -0
- package/dist/core/guard/evaluator.js +242 -0
- package/dist/core/guard/evidence-v3.d.ts +15 -0
- package/dist/core/guard/evidence-v3.d.ts.map +1 -0
- package/dist/core/guard/evidence-v3.js +171 -0
- package/dist/core/guard/index.d.ts +10 -0
- package/dist/core/guard/index.d.ts.map +1 -0
- package/dist/core/guard/index.js +6 -0
- package/dist/core/guard/live-source-v3.d.ts +40 -0
- package/dist/core/guard/live-source-v3.d.ts.map +1 -0
- package/dist/core/guard/live-source-v3.js +128 -0
- package/dist/core/guard/storage.d.ts +27 -0
- package/dist/core/guard/storage.d.ts.map +1 -0
- package/dist/core/guard/storage.js +140 -0
- package/dist/core/guard/types.d.ts +119 -0
- package/dist/core/guard/types.d.ts.map +1 -0
- package/dist/core/guard/types.js +1 -0
- package/dist/core/hooks/adapter/detect.d.ts +18 -1
- package/dist/core/hooks/adapter/detect.d.ts.map +1 -1
- package/dist/core/hooks/adapter/detect.js +29 -0
- package/dist/core/hooks/adapter/events.d.ts +7 -4
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +12 -4
- package/dist/core/hooks/adapter/output.d.ts +2 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.d.ts +7 -4
- package/dist/core/hooks/adapter/parse.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.js +63 -25
- package/dist/core/hooks/adapter/wiring.d.ts +30 -4
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +89 -11
- package/dist/core/hooks/cli.d.ts +1 -1
- package/dist/core/hooks/cli.js +305 -444
- package/dist/core/hooks/effects/image-capture.d.ts +20 -34
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +212 -221
- package/dist/core/hooks/effects/index.d.ts +1 -9
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +1 -24
- package/dist/core/hooks/events/input-hash.d.ts +7 -0
- package/dist/core/hooks/events/input-hash.d.ts.map +1 -0
- package/dist/core/hooks/events/input-hash.js +43 -0
- package/dist/core/hooks/index.d.ts +4 -3
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +2 -3
- package/dist/core/hooks/resolve/coord-root.d.ts +1 -1
- package/dist/core/hooks/resolve/coord-root.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +16 -15
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +51 -42
- package/dist/core/hooks/resolve/transcript.d.ts +33 -3
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +155 -14
- package/dist/core/hooks/session-name-presence.d.ts +9 -10
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +15 -15
- package/dist/core/hooks/unsafe-cross-shell.d.ts +1 -1
- package/dist/core/hooks/unsafe-cross-shell.d.ts.map +1 -1
- package/dist/core/journal/index.d.ts +2 -2
- package/dist/core/journal/index.d.ts.map +1 -1
- package/dist/core/journal/index.js +9 -22
- package/dist/core/presence/blob.d.ts +4 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +45 -44
- package/dist/core/presence/codec-digest.d.ts +29 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -0
- package/dist/core/presence/codec-digest.js +170 -0
- package/dist/core/presence/relay-client.d.ts +1 -1
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +5 -5
- package/dist/core/work/index.d.ts +1 -1
- package/dist/core/work/index.d.ts.map +1 -1
- package/dist/core/work/index.js +1 -1
- package/dist/core/work/read.d.ts +1 -1
- package/dist/core/work/read.d.ts.map +1 -1
- package/dist/core/work/read.js +1 -1
- package/dist/core/work/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +6 -0
- package/dist/core/work/state.d.ts +9 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +17 -3
- package/dist/core/workflow/engine.js +24 -25
- package/dist/core/workflow/live-session-v3.d.ts +19 -0
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -0
- package/dist/core/workflow/live-session-v3.js +86 -0
- package/dist/core/workflow/scope-id.d.ts +3 -0
- package/dist/core/workflow/scope-id.d.ts.map +1 -0
- package/dist/core/workflow/scope-id.js +5 -0
- package/dist/core/workflow/workspaces/leases.d.ts +4 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +53 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/browser/client.d.ts +41 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +203 -0
- package/dist/lib/browser/critique.d.ts +28 -2
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +74 -18
- package/dist/lib/browser/geometry.d.ts +1 -1
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +130 -6
- package/dist/lib/browser/index.d.ts +3 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +3 -0
- package/dist/lib/browser/qa-plan.d.ts +174 -0
- package/dist/lib/browser/qa-plan.d.ts.map +1 -0
- package/dist/lib/browser/qa-plan.js +321 -0
- package/dist/lib/browser/qa-reuse.d.ts +99 -0
- package/dist/lib/browser/qa-reuse.d.ts.map +1 -0
- package/dist/lib/browser/qa-reuse.js +222 -0
- package/dist/lib/browser/qa-snapshot.d.ts +64 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -0
- package/dist/lib/browser/qa-snapshot.js +171 -0
- package/dist/lib/browser/runts.d.ts.map +1 -1
- package/dist/lib/browser/runts.js +22 -1
- package/dist/lib/browser/tiling.d.ts +71 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -0
- package/dist/lib/browser/tiling.js +118 -0
- package/dist/lib/claude-desktop.d.ts +0 -47
- package/dist/lib/claude-desktop.d.ts.map +1 -1
- package/dist/lib/claude-desktop.js +1 -169
- package/dist/lib/context/index.d.ts +0 -3
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/context/index.js +20 -42
- package/dist/lib/council/index.d.ts +2 -2
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +9 -20
- package/dist/lib/docs-frontmatter.d.ts +1 -6
- package/dist/lib/docs-frontmatter.d.ts.map +1 -1
- package/dist/lib/docs-frontmatter.js +12 -78
- package/dist/lib/docs-index.d.ts +9 -0
- package/dist/lib/docs-index.d.ts.map +1 -1
- package/dist/lib/docs-index.js +32 -3
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +14 -30
- package/dist/lib/docs-metadata-audit.d.ts +19 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -0
- package/dist/lib/docs-metadata-audit.js +132 -0
- package/dist/lib/docs-metadata-managed.d.ts +23 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -0
- package/dist/lib/docs-metadata-managed.js +78 -0
- package/dist/lib/docs-metadata-sync.d.ts +20 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -0
- package/dist/lib/docs-metadata-sync.js +222 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts +273 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2-schema.js +134 -0
- package/dist/lib/docs-metadata-v2.d.ts +21 -0
- package/dist/lib/docs-metadata-v2.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2.js +424 -0
- package/dist/lib/docs-new.d.ts +11 -0
- package/dist/lib/docs-new.d.ts.map +1 -0
- package/dist/lib/docs-new.js +52 -0
- package/dist/lib/docs-sweep.d.ts.map +1 -1
- package/dist/lib/docs-sweep.js +45 -29
- package/dist/lib/headless/index.d.ts +98 -0
- package/dist/lib/headless/index.d.ts.map +1 -0
- package/dist/lib/headless/index.js +211 -0
- package/dist/lib/identities/assume.d.ts +4 -4
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +52 -68
- package/dist/lib/instructions/apply.d.ts +5 -4
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +32 -20
- package/dist/lib/instructions/bundle.d.ts +1 -1
- package/dist/lib/instructions/bundle.d.ts.map +1 -1
- package/dist/lib/instructions/bundle.js +1 -1
- package/dist/lib/instructions/splice.d.ts +0 -1
- package/dist/lib/instructions/splice.d.ts.map +1 -1
- package/dist/lib/instructions/splice.js +22 -6
- package/dist/lib/instructions/templates.d.ts +7 -5
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +79 -9
- package/package.json +26 -5
- package/schemas/config.schema.json +120 -2
- package/schemas/docs-metadata-v2.schema.json +441 -0
- package/schemas/event-v3.schema.json +24472 -0
- package/src/commander.ts +4 -0
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1512 -592
- package/src/commands/artifacts.ts +7 -6
- package/src/commands/backup.ts +29 -21
- package/src/commands/browse.ts +349 -8
- package/src/commands/checkpoint.ts +4 -3
- package/src/commands/claude-desktop.ts +2 -101
- package/src/commands/context.ts +1 -6
- package/src/commands/decision.ts +27 -44
- package/src/commands/docs.ts +100 -33
- package/src/commands/doctor.ts +14 -1
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +253 -57
- package/src/commands/instructions.ts +1 -1
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +11 -10
- package/src/commands/sync.ts +1 -1
- package/src/commands/web.ts +67 -8
- package/src/commands/work.ts +28 -5
- package/src/core/adapter.ts +5 -0
- package/src/core/adapters/attest.ts +8 -3
- package/src/core/adapters/profiles.ts +4 -6
- package/src/core/agents/canonical-emit.ts +34 -25
- package/src/core/agents/cli.ts +236 -262
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -188
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +4 -5
- package/src/core/agents/live-authority-v3.ts +375 -0
- package/src/core/agents/live-lifecycle-v3.ts +140 -0
- package/src/core/agents/live-observation-v3.ts +216 -0
- package/src/core/agents/render/prompt-context.ts +29 -60
- package/src/core/agents/render/session-context.ts +10 -31
- package/src/core/agents/rules/claim-conflict.ts +85 -126
- package/src/core/agents/rules/commit-conflict.ts +3 -14
- package/src/core/agents/rules/stop-hook.ts +239 -293
- package/src/core/agents/session-events.ts +137 -104
- package/src/core/agents/session-finalization-state-v3.ts +90 -0
- package/src/core/agents/session-finalizer-v3.ts +953 -0
- package/src/core/agents/session-name-display.ts +149 -0
- package/src/core/agents/state/activity-log.ts +6 -14
- package/src/core/agents/state/heartbeat-writer.ts +82 -277
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +24 -12
- package/src/core/agents/state/stale-sweep.ts +40 -17
- package/src/core/artifacts/index.ts +4 -5
- package/src/core/config.ts +148 -3
- package/src/core/context/index.ts +9 -17
- package/src/core/events/span-parent.ts +46 -0
- package/src/core/events/v3/advance.ts +168 -0
- package/src/core/events/v3/authority-outbox.ts +548 -0
- package/src/core/events/v3/base-builder.ts +60 -0
- package/src/core/events/v3/base-contract.ts +882 -0
- package/src/core/events/v3/bootstrap.ts +226 -0
- package/src/core/events/v3/builder.ts +59 -0
- package/src/core/events/v3/canonical.ts +153 -0
- package/src/core/events/v3/capabilities.ts +171 -0
- package/src/core/events/v3/capability-drift.ts +177 -0
- package/src/core/events/v3/catalog.ts +202 -0
- package/src/core/events/v3/clock-order.ts +41 -0
- package/src/core/events/v3/contract.ts +365 -0
- package/src/core/events/v3/control.ts +576 -0
- package/src/core/events/v3/coordination-view.ts +193 -0
- package/src/core/events/v3/economics.ts +384 -0
- package/src/core/events/v3/finalization-view.ts +67 -0
- package/src/core/events/v3/fingerprint-keys.ts +260 -0
- package/src/core/events/v3/generated.ts +48 -0
- package/src/core/events/v3/ids.ts +33 -0
- package/src/core/events/v3/index.ts +322 -0
- package/src/core/events/v3/latency.ts +551 -0
- package/src/core/events/v3/live-feed.ts +319 -0
- package/src/core/events/v3/live-observation.ts +39 -0
- package/src/core/events/v3/live-routing.ts +135 -0
- package/src/core/events/v3/producers/command-recorder.ts +631 -0
- package/src/core/events/v3/producers/command.ts +201 -0
- package/src/core/events/v3/producers/coordination-recorder.ts +538 -0
- package/src/core/events/v3/producers/coordination.ts +355 -0
- package/src/core/events/v3/producers/hook-base.ts +578 -0
- package/src/core/events/v3/producers/hook.ts +119 -0
- package/src/core/events/v3/producers/intake.ts +319 -0
- package/src/core/events/v3/producers/recorder.ts +2805 -0
- package/src/core/events/v3/projection.ts +653 -0
- package/src/core/events/v3/reader.ts +1127 -0
- package/src/core/events/v3/recovery-record.ts +244 -0
- package/src/core/events/v3/recovery.ts +271 -0
- package/src/core/events/v3/span-state.ts +187 -0
- package/src/core/events/v3/targets.ts +182 -0
- package/src/core/events/v3/turn-telemetry.ts +259 -0
- package/src/core/events/v3/validate.ts +361 -0
- package/src/core/events/v3/writer.ts +419 -0
- package/src/core/governor/index.ts +3 -0
- package/src/core/governor/plan-api.ts +10 -2
- package/src/core/governor/read.ts +3 -0
- package/src/core/governor/state.ts +52 -5
- package/src/core/guard/config.ts +206 -0
- package/src/core/guard/coordinator.ts +227 -0
- package/src/core/guard/evaluator.ts +343 -0
- package/src/core/guard/evidence-v3.ts +227 -0
- package/src/core/guard/index.ts +35 -0
- package/src/core/guard/live-source-v3.ts +204 -0
- package/src/core/guard/storage.ts +188 -0
- package/src/core/guard/types.ts +152 -0
- package/src/core/hooks/adapter/detect.ts +28 -1
- package/src/core/hooks/adapter/events.ts +14 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +80 -38
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +351 -466
- package/src/core/hooks/effects/image-capture.ts +228 -238
- package/src/core/hooks/effects/index.ts +1 -36
- package/src/core/hooks/events/input-hash.ts +47 -0
- package/src/core/hooks/index.ts +4 -11
- package/src/core/hooks/resolve/coord-root.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +52 -45
- package/src/core/hooks/resolve/transcript.ts +165 -14
- package/src/core/hooks/session-name-presence.ts +14 -15
- package/src/core/hooks/unsafe-cross-shell.ts +1 -1
- package/src/core/journal/index.ts +15 -22
- package/src/core/presence/blob.ts +48 -41
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/relay-client.ts +5 -5
- package/src/core/work/index.ts +3 -0
- package/src/core/work/read.ts +3 -0
- package/src/core/work/runner.ts +6 -0
- package/src/core/work/state.ts +27 -3
- package/src/core/workflow/engine.ts +24 -24
- package/src/core/workflow/live-session-v3.ts +126 -0
- package/src/core/workflow/scope-id.ts +6 -0
- package/src/core/workflow/workspaces/leases.ts +56 -19
- package/src/index.ts +1 -1
- package/src/lib/browser/client.ts +230 -0
- package/src/lib/browser/critique.ts +104 -27
- package/src/lib/browser/geometry.ts +143 -14
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/browser/qa-plan.ts +501 -0
- package/src/lib/browser/qa-reuse.ts +306 -0
- package/src/lib/browser/qa-snapshot.ts +223 -0
- package/src/lib/browser/runts.ts +27 -2
- package/src/lib/browser/tiling.ts +164 -0
- package/src/lib/claude-desktop.ts +1 -232
- package/src/lib/context/index.ts +22 -46
- package/src/lib/council/index.ts +9 -21
- package/src/lib/docs-frontmatter.ts +8 -79
- package/src/lib/docs-index.ts +33 -3
- package/src/lib/docs-lint.ts +15 -29
- package/src/lib/docs-metadata-audit.ts +166 -0
- package/src/lib/docs-metadata-managed.ts +83 -0
- package/src/lib/docs-metadata-sync.ts +262 -0
- package/src/lib/docs-metadata-v2-schema.ts +138 -0
- package/src/lib/docs-metadata-v2.ts +646 -0
- package/src/lib/docs-new.ts +63 -0
- package/src/lib/docs-sweep.ts +42 -28
- package/src/lib/headless/index.ts +287 -0
- package/src/lib/identities/assume.ts +67 -86
- package/src/lib/instructions/apply.ts +33 -20
- package/src/lib/instructions/bundle.ts +2 -2
- package/src/lib/instructions/splice.ts +21 -7
- package/src/lib/instructions/templates.ts +85 -13
- package/dist/core/agents/cli-emit.d.ts +0 -27
- package/dist/core/agents/cli-emit.d.ts.map +0 -1
- package/dist/core/agents/cli-emit.js +0 -57
- package/dist/core/agents/codex-replay.d.ts +0 -29
- package/dist/core/agents/codex-replay.d.ts.map +0 -1
- package/dist/core/agents/codex-replay.js +0 -138
- package/dist/core/agents/events/consume.d.ts +0 -82
- package/dist/core/agents/events/consume.d.ts.map +0 -1
- package/dist/core/agents/events/consume.js +0 -195
- package/dist/core/agents/events/emit.d.ts +0 -42
- package/dist/core/agents/events/emit.d.ts.map +0 -1
- package/dist/core/agents/events/emit.js +0 -75
- package/dist/core/agents/events/ulid.d.ts +0 -11
- package/dist/core/agents/events/ulid.d.ts.map +0 -1
- package/dist/core/agents/events/ulid.js +0 -47
- package/dist/core/agents/state/heartbeat-projector.d.ts +0 -76
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -581
- package/dist/core/hooks/events/emit.d.ts +0 -31
- package/dist/core/hooks/events/emit.d.ts.map +0 -1
- package/dist/core/hooks/events/emit.js +0 -93
- package/dist/core/hooks/events/rotate.d.ts +0 -43
- package/dist/core/hooks/events/rotate.d.ts.map +0 -1
- package/dist/core/hooks/events/rotate.js +0 -142
- package/dist/core/hooks/events/schema.d.ts +0 -341
- package/dist/core/hooks/events/schema.d.ts.map +0 -1
- package/dist/core/hooks/events/schema.js +0 -12
- package/dist/core/hooks/events/ulid.d.ts +0 -10
- package/dist/core/hooks/events/ulid.d.ts.map +0 -1
- package/dist/core/hooks/events/ulid.js +0 -47
- package/dist/lib/docs-frontmatter-migrate.d.ts +0 -33
- package/dist/lib/docs-frontmatter-migrate.d.ts.map +0 -1
- package/dist/lib/docs-frontmatter-migrate.js +0 -364
- package/src/core/agents/cli-emit.ts +0 -64
- package/src/core/agents/codex-replay.ts +0 -163
- package/src/core/agents/events/consume.ts +0 -254
- package/src/core/agents/events/emit.ts +0 -115
- package/src/core/agents/events/ulid.ts +0 -51
- package/src/core/agents/state/heartbeat-projector.ts +0 -645
- package/src/core/hooks/events/emit.ts +0 -125
- package/src/core/hooks/events/rotate.ts +0 -151
- package/src/core/hooks/events/schema.ts +0 -582
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// orchestration live here; the model call lives in the host.
|
|
19
19
|
|
|
20
20
|
import { PNG } from "pngjs";
|
|
21
|
+
import { bandOversizedRect, snappedBandRects, type VisualAtom } from "./tiling.js";
|
|
21
22
|
|
|
22
23
|
export interface CritiqueTile {
|
|
23
24
|
index: number;
|
|
@@ -25,6 +26,9 @@ export interface CritiqueTile {
|
|
|
25
26
|
label: string;
|
|
26
27
|
/** Document-space Y offset of the tile's top, so findings map to a place. */
|
|
27
28
|
scrollY: number;
|
|
29
|
+
/** Document-space X offset (0 for full-width bands; element-relative for
|
|
30
|
+
* selector tiles). Optional for backward compatibility — treat absent as 0. */
|
|
31
|
+
x?: number;
|
|
28
32
|
width: number;
|
|
29
33
|
height: number;
|
|
30
34
|
/** Base64 PNG of the tile (no data: prefix). */
|
|
@@ -48,18 +52,32 @@ export interface CritiqueResult {
|
|
|
48
52
|
outcome: "pass" | "fail" | "skipped";
|
|
49
53
|
/** Set when skipped or a provider call failed. */
|
|
50
54
|
error?: string;
|
|
55
|
+
/** Host-reported provider provenance (route, attempts, fallbacks, usage). */
|
|
56
|
+
provider_meta?: Record<string, unknown>;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
/**
|
|
54
60
|
* The host-injected model call. Given one tile and the rubric, return the
|
|
55
61
|
* findings for that tile. Throwing is caught and surfaced as an error finding
|
|
56
62
|
* so one bad tile never sinks the run.
|
|
63
|
+
*
|
|
64
|
+
* Optional properties let the host shape execution without widening the call
|
|
65
|
+
* contract: `concurrency` caps how many tiles run at once (default 4 — tiles
|
|
66
|
+
* are independent, and the wall-clock win is roughly the cap factor), and
|
|
67
|
+
* `meta()` is read once after the run so route/usage provenance lands on the
|
|
68
|
+
* result envelope.
|
|
57
69
|
*/
|
|
58
|
-
export type CritiqueProvider = (input: {
|
|
70
|
+
export type CritiqueProvider = ((input: {
|
|
59
71
|
url: string;
|
|
60
72
|
rubric: string;
|
|
61
73
|
tile: CritiqueTile;
|
|
62
|
-
}) => Promise<CritiqueFinding[]
|
|
74
|
+
}) => Promise<CritiqueFinding[]>) & {
|
|
75
|
+
concurrency?: number;
|
|
76
|
+
meta?: () => Record<string, unknown> | undefined;
|
|
77
|
+
/** Long-edge pixel budget of the routed model's vision input. The tiler
|
|
78
|
+
* clamps band height to it so tiles are never downscaled by the provider. */
|
|
79
|
+
tileBudgetPx?: number;
|
|
80
|
+
};
|
|
63
81
|
|
|
64
82
|
export const DEFAULT_CRITIQUE_RUBRIC = [
|
|
65
83
|
"You are reviewing one vertical slice of a rendered web page for visual defects.",
|
|
@@ -70,6 +88,10 @@ export const DEFAULT_CRITIQUE_RUBRIC = [
|
|
|
70
88
|
"- broken, distorted, or missing images",
|
|
71
89
|
"- leaked template tokens, placeholder text, or obviously wrong values",
|
|
72
90
|
"- anything that looks broken, unfinished, or accidental",
|
|
91
|
+
"The slice's own top and bottom edges cut through the page at arbitrary points:",
|
|
92
|
+
"content cropped by the slice boundary itself (a heading, row, or paragraph",
|
|
93
|
+
"entering or leaving the frame) is a tiling artifact, NOT a defect - never report it.",
|
|
94
|
+
"Only report clipping that happens at an element's own container edge inside the slice.",
|
|
73
95
|
"Do NOT comment on content quality, wording, tone, or subjective taste.",
|
|
74
96
|
"If the slice looks fine, return an empty list. Be precise and terse.",
|
|
75
97
|
"Return JSON only: an array of objects",
|
|
@@ -108,6 +130,13 @@ export function bandRects(
|
|
|
108
130
|
* resolution. Pass `elementRects` for semantic (per-element) tiling; otherwise
|
|
109
131
|
* the page is banded from the actual image height. Rects are clamped to the
|
|
110
132
|
* image so an off-by-one never throws.
|
|
133
|
+
*
|
|
134
|
+
* When `atoms` are supplied (see tiling.ts), band seams snap into content
|
|
135
|
+
* gaps instead of cutting at fixed offsets, and element rects taller than the
|
|
136
|
+
* band budget are banded internally rather than shipped as one over-tall tile
|
|
137
|
+
* the provider would downscale. Atom coordinates must be in the same pixel
|
|
138
|
+
* space as the screenshot (identical at deviceScaleFactor 1; scale them if
|
|
139
|
+
* the capture DPR differs).
|
|
111
140
|
*/
|
|
112
141
|
export function tilesFromFullPage(
|
|
113
142
|
fullPageBuffer: Buffer,
|
|
@@ -116,20 +145,46 @@ export function tilesFromFullPage(
|
|
|
116
145
|
bandHeight?: number;
|
|
117
146
|
overlap?: number;
|
|
118
147
|
maxTiles: number;
|
|
148
|
+
atoms?: VisualAtom[];
|
|
119
149
|
},
|
|
120
150
|
): CritiqueTile[] {
|
|
121
151
|
const png = PNG.sync.read(fullPageBuffer);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
const snapOpts = {
|
|
153
|
+
bandHeight: opts.bandHeight ?? 1400,
|
|
154
|
+
overlap: opts.overlap ?? 120,
|
|
155
|
+
};
|
|
156
|
+
let rects: Array<{
|
|
157
|
+
index: number;
|
|
158
|
+
label: string;
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
width: number;
|
|
162
|
+
height: number;
|
|
163
|
+
}>;
|
|
164
|
+
if (opts.elementRects && opts.elementRects.length > 0) {
|
|
165
|
+
const expanded = opts.atoms
|
|
166
|
+
? opts.elementRects.flatMap((r) => bandOversizedRect(r, opts.atoms ?? [], snapOpts))
|
|
167
|
+
: opts.elementRects;
|
|
168
|
+
rects = expanded.map((r, index) => ({ index, ...r }));
|
|
169
|
+
} else if (opts.atoms && opts.atoms.length > 0) {
|
|
170
|
+
rects = snappedBandRects(0, png.height, 0, png.width, opts.atoms, snapOpts).rects.map((b) => ({
|
|
171
|
+
index: b.index,
|
|
172
|
+
label: `band ${b.index + 1}`,
|
|
173
|
+
x: b.x,
|
|
174
|
+
y: b.y,
|
|
175
|
+
width: b.width,
|
|
176
|
+
height: b.height,
|
|
177
|
+
}));
|
|
178
|
+
} else {
|
|
179
|
+
rects = bandRects(png.height, png.width, snapOpts.bandHeight, snapOpts.overlap).map((b) => ({
|
|
180
|
+
index: b.index,
|
|
181
|
+
label: `band ${b.index + 1}`,
|
|
182
|
+
x: b.x,
|
|
183
|
+
y: b.y,
|
|
184
|
+
width: b.width,
|
|
185
|
+
height: b.height,
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
133
188
|
const tiles: CritiqueTile[] = [];
|
|
134
189
|
for (const rect of rects.slice(0, opts.maxTiles)) {
|
|
135
190
|
const sx = Math.max(0, Math.min(Math.round(rect.x), png.width - 1));
|
|
@@ -148,6 +203,7 @@ export function tilesFromFullPage(
|
|
|
148
203
|
index: rect.index,
|
|
149
204
|
label: rect.label,
|
|
150
205
|
scrollY: sy,
|
|
206
|
+
x: sx,
|
|
151
207
|
width: w,
|
|
152
208
|
height: h,
|
|
153
209
|
pngBase64: PNG.sync.write(dst).toString("base64"),
|
|
@@ -212,20 +268,41 @@ export async function runCritique(args: {
|
|
|
212
268
|
"no critiqueProvider injected by the host (see HarneryProgramContext.critiqueProvider)",
|
|
213
269
|
};
|
|
214
270
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
271
|
+
// Tiles are judged independently, so run them concurrently (bounded) and
|
|
272
|
+
// reassemble findings in tile order so artifacts stay deterministic.
|
|
273
|
+
const concurrency = Math.max(1, Math.min(provider.concurrency ?? 4, tiles.length || 1));
|
|
274
|
+
const perTile: CritiqueFinding[][] = tiles.map(() => []);
|
|
275
|
+
let cursor = 0;
|
|
276
|
+
const worker = async (): Promise<void> => {
|
|
277
|
+
while (true) {
|
|
278
|
+
const i = cursor++;
|
|
279
|
+
if (i >= tiles.length) return;
|
|
280
|
+
const tile = tiles[i];
|
|
281
|
+
try {
|
|
282
|
+
const tileFindings = await provider({ url, rubric, tile });
|
|
283
|
+
perTile[i] = tileFindings.map((f) => ({ ...f, tile: tile.index }));
|
|
284
|
+
} catch (err: unknown) {
|
|
285
|
+
perTile[i] = [
|
|
286
|
+
{
|
|
287
|
+
tile: tile.index,
|
|
288
|
+
severity: "high",
|
|
289
|
+
category: "provider-error",
|
|
290
|
+
description: `critique provider failed on ${tile.label}: ${err instanceof Error ? err.message : String(err)}`,
|
|
291
|
+
},
|
|
292
|
+
];
|
|
293
|
+
}
|
|
227
294
|
}
|
|
228
|
-
}
|
|
295
|
+
};
|
|
296
|
+
await Promise.all(Array.from({ length: concurrency }, () => worker()));
|
|
297
|
+
const findings = perTile.flat();
|
|
229
298
|
const outcome = findings.some((f) => f.severity === "high") ? "fail" : "pass";
|
|
230
|
-
|
|
299
|
+
const meta = provider.meta?.();
|
|
300
|
+
return {
|
|
301
|
+
rule: "critique",
|
|
302
|
+
tiles: tiles.length,
|
|
303
|
+
provider: true,
|
|
304
|
+
findings,
|
|
305
|
+
outcome,
|
|
306
|
+
...(meta ? { provider_meta: meta } : {}),
|
|
307
|
+
};
|
|
231
308
|
}
|
|
@@ -24,7 +24,13 @@ export interface LayoutElementMeasurement {
|
|
|
24
24
|
export interface LayoutExclusion {
|
|
25
25
|
index: number;
|
|
26
26
|
tag: string;
|
|
27
|
-
reason:
|
|
27
|
+
reason:
|
|
28
|
+
| "hidden"
|
|
29
|
+
| "zero-area"
|
|
30
|
+
| "out-of-flow"
|
|
31
|
+
| "limit"
|
|
32
|
+
| "visually-hidden"
|
|
33
|
+
| "ellipsis-truncation";
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
export interface AlignChild extends LayoutElementMeasurement {
|
|
@@ -507,6 +513,53 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
507
513
|
return { x: clips.has(style.overflowX), y: clips.has(style.overflowY) };
|
|
508
514
|
};
|
|
509
515
|
|
|
516
|
+
// The visually-hidden idiom (Tailwind `sr-only`, Bootstrap
|
|
517
|
+
// `visually-hidden`): a ~1px absolutely-positioned box whose content is
|
|
518
|
+
// clipped ON PURPOSE so it exists for assistive tech only. Its box is 1x1
|
|
519
|
+
// (not zero-area, so the zero-area exclusion misses it) and the legacy
|
|
520
|
+
// `clip: rect(0,0,0,0)` it relies on is not an overflow style, so nothing
|
|
521
|
+
// above recognizes it. Reporting it would flag every accessible page.
|
|
522
|
+
const isVisuallyHidden = (element: Element): boolean => {
|
|
523
|
+
const style = getComputedStyle(element);
|
|
524
|
+
if (style.position !== "absolute" && style.position !== "fixed") return false;
|
|
525
|
+
if (style.clip && style.clip !== "auto") return true;
|
|
526
|
+
const rect = element.getBoundingClientRect();
|
|
527
|
+
return rect.width <= 1 && rect.height <= 1 && style.overflow === "hidden";
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
const hasVisuallyHiddenAncestor = (start: Element | null, scope: Element): boolean => {
|
|
531
|
+
let current = start;
|
|
532
|
+
while (current && scope.contains(current)) {
|
|
533
|
+
if (isVisuallyHidden(current)) return true;
|
|
534
|
+
if (current === scope) break;
|
|
535
|
+
current = current.parentElement;
|
|
536
|
+
}
|
|
537
|
+
return false;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
// Deliberate single-line truncation (`text-overflow: ellipsis` + nowrap +
|
|
541
|
+
// hidden overflow, the `truncate` utility): cutting the text is the
|
|
542
|
+
// design, and the dedicated truncation check owns auditing it. Only text
|
|
543
|
+
// under such an ancestor is exempt; element boxes still have to fit.
|
|
544
|
+
const ellipsizes = (element: Element): boolean => {
|
|
545
|
+
const style = getComputedStyle(element);
|
|
546
|
+
return (
|
|
547
|
+
style.textOverflow === "ellipsis" &&
|
|
548
|
+
style.whiteSpace === "nowrap" &&
|
|
549
|
+
(style.overflowX === "hidden" || style.overflowX === "clip")
|
|
550
|
+
);
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
const hasEllipsizingAncestor = (start: Element | null, scope: Element): boolean => {
|
|
554
|
+
let current = start;
|
|
555
|
+
while (current && scope.contains(current)) {
|
|
556
|
+
if (ellipsizes(current)) return true;
|
|
557
|
+
if (current === scope) break;
|
|
558
|
+
current = current.parentElement;
|
|
559
|
+
}
|
|
560
|
+
return false;
|
|
561
|
+
};
|
|
562
|
+
|
|
510
563
|
// A scroller hides content the same way a clip does, but the reader can
|
|
511
564
|
// reach it. Content below the fold of a capped table or right of a wide
|
|
512
565
|
// code block is not a layout defect, so an axis stops being checked at the
|
|
@@ -519,6 +572,20 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
519
572
|
return { x: scrolls.has(style.overflowX), y: scrolls.has(style.overflowY) };
|
|
520
573
|
};
|
|
521
574
|
|
|
575
|
+
const scrollsBeforeScope = (
|
|
576
|
+
start: Element | null,
|
|
577
|
+
scope: Element,
|
|
578
|
+
axis: "x" | "y",
|
|
579
|
+
): boolean => {
|
|
580
|
+
let current = start;
|
|
581
|
+
while (current && scope.contains(current)) {
|
|
582
|
+
if (scrollingStyle(current)[axis]) return true;
|
|
583
|
+
if (current === scope) break;
|
|
584
|
+
current = current.parentElement;
|
|
585
|
+
}
|
|
586
|
+
return false;
|
|
587
|
+
};
|
|
588
|
+
|
|
522
589
|
const unbounded = (): LayoutRect => ({
|
|
523
590
|
x: Number.NEGATIVE_INFINITY,
|
|
524
591
|
y: Number.NEGATIVE_INFINITY,
|
|
@@ -573,7 +640,7 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
573
640
|
const recordIssue = (
|
|
574
641
|
element: LayoutElementMeasurement,
|
|
575
642
|
allowed: LayoutRect,
|
|
576
|
-
clippedBy: string,
|
|
643
|
+
clippedBy: { x: string; y: string },
|
|
577
644
|
axes: { x: boolean; y: boolean } = { x: true, y: true },
|
|
578
645
|
): void => {
|
|
579
646
|
const rect = element.rect;
|
|
@@ -585,7 +652,14 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
585
652
|
};
|
|
586
653
|
const maxOverrunPx = Math.max(overrun.top, overrun.right, overrun.bottom, overrun.left);
|
|
587
654
|
if (maxOverrunPx > tolerancePx + SUBPIXEL_EPSILON && issues.length < ISSUE_LIMIT) {
|
|
588
|
-
|
|
655
|
+
const horizontalOverrun = Math.max(overrun.left, overrun.right);
|
|
656
|
+
const verticalOverrun = Math.max(overrun.top, overrun.bottom);
|
|
657
|
+
issues.push({
|
|
658
|
+
element,
|
|
659
|
+
clippedBy: horizontalOverrun >= verticalOverrun ? clippedBy.x : clippedBy.y,
|
|
660
|
+
overrun,
|
|
661
|
+
maxOverrunPx,
|
|
662
|
+
});
|
|
589
663
|
}
|
|
590
664
|
};
|
|
591
665
|
|
|
@@ -599,9 +673,9 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
599
673
|
container: Element,
|
|
600
674
|
seed: LayoutRect,
|
|
601
675
|
seedLabel: string,
|
|
602
|
-
): { allowed: LayoutRect; clippedBy: string } => {
|
|
676
|
+
): { allowed: LayoutRect; clippedBy: { x: string; y: string } } => {
|
|
603
677
|
let allowed = { ...seed };
|
|
604
|
-
|
|
678
|
+
const clippedBy = { x: seedLabel, y: seedLabel };
|
|
605
679
|
const free = { x: false, y: false };
|
|
606
680
|
let current: Element | null = start;
|
|
607
681
|
while (current && container.contains(current)) {
|
|
@@ -622,6 +696,14 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
622
696
|
};
|
|
623
697
|
if (clips.x || clips.y) {
|
|
624
698
|
const candidate = paddingRect(current);
|
|
699
|
+
const tightensX =
|
|
700
|
+
clips.x &&
|
|
701
|
+
(candidate.left > allowed.left + SUBPIXEL_EPSILON ||
|
|
702
|
+
candidate.right < allowed.right - SUBPIXEL_EPSILON);
|
|
703
|
+
const tightensY =
|
|
704
|
+
clips.y &&
|
|
705
|
+
(candidate.top > allowed.top + SUBPIXEL_EPSILON ||
|
|
706
|
+
candidate.bottom < allowed.bottom - SUBPIXEL_EPSILON);
|
|
625
707
|
allowed = {
|
|
626
708
|
x: clips.x ? Math.max(allowed.left, candidate.left) : allowed.left,
|
|
627
709
|
y: clips.y ? Math.max(allowed.top, candidate.top) : allowed.top,
|
|
@@ -634,7 +716,11 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
634
716
|
};
|
|
635
717
|
allowed.width = Math.max(0, allowed.right - allowed.left);
|
|
636
718
|
allowed.height = Math.max(0, allowed.bottom - allowed.top);
|
|
637
|
-
|
|
719
|
+
// Keep the label of the boundary that actually made each axis
|
|
720
|
+
// smaller. A wider outer scope should not hide the nearer parent
|
|
721
|
+
// responsible for a horizontal overrun.
|
|
722
|
+
if (tightensX) clippedBy.x = labelOf(current);
|
|
723
|
+
if (tightensY) clippedBy.y = labelOf(current);
|
|
638
724
|
}
|
|
639
725
|
if (scrolls.x) free.x = true;
|
|
640
726
|
if (scrolls.y) free.y = true;
|
|
@@ -644,7 +730,7 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
644
730
|
return { allowed, clippedBy };
|
|
645
731
|
};
|
|
646
732
|
|
|
647
|
-
const
|
|
733
|
+
const nearestBlockOwner = (node: Node, scope: Element): Element | null => {
|
|
648
734
|
let current = node.parentElement;
|
|
649
735
|
while (current && scope.contains(current)) {
|
|
650
736
|
if (current instanceof SVGElement) return null;
|
|
@@ -665,17 +751,38 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
665
751
|
excluded.push({ index, tag: element.tagName.toLowerCase(), reason: "hidden" });
|
|
666
752
|
return;
|
|
667
753
|
}
|
|
754
|
+
if (hasVisuallyHiddenAncestor(element, container)) {
|
|
755
|
+
excluded.push({ index, tag: element.tagName.toLowerCase(), reason: "visually-hidden" });
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
668
758
|
const rect = element.getBoundingClientRect();
|
|
669
759
|
if (rect.width <= 0 || rect.height <= 0) {
|
|
670
760
|
excluded.push({ index, tag: element.tagName.toLowerCase(), reason: "zero-area" });
|
|
671
761
|
return;
|
|
672
762
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
);
|
|
763
|
+
// CSS overflow defaults to visible, so a child can escape a grid or
|
|
764
|
+
// flex cell without any clipping ancestor noticing. Constrain
|
|
765
|
+
// in-flow boxes horizontally to their nearest block owner. Vertical
|
|
766
|
+
// parent containment is intentionally left to real CSS clips because
|
|
767
|
+
// normal margin collapse can paint outside a parent's vertical box.
|
|
768
|
+
const owner = nearestBlockOwner(element, container);
|
|
769
|
+
const seed = unbounded();
|
|
770
|
+
let seedLabel = labelOf(container);
|
|
771
|
+
const position = getComputedStyle(element).position;
|
|
772
|
+
if (
|
|
773
|
+
owner &&
|
|
774
|
+
position !== "absolute" &&
|
|
775
|
+
position !== "fixed" &&
|
|
776
|
+
!scrollsBeforeScope(owner, container, "x")
|
|
777
|
+
) {
|
|
778
|
+
const ownerRect = paddingRect(owner);
|
|
779
|
+
seed.left = ownerRect.left;
|
|
780
|
+
seed.right = ownerRect.right;
|
|
781
|
+
seed.x = seed.left;
|
|
782
|
+
seed.width = Math.max(0, seed.right - seed.left);
|
|
783
|
+
seedLabel = labelOf(owner);
|
|
784
|
+
}
|
|
785
|
+
const chain = clipChain(element.parentElement, container, seed, seedLabel);
|
|
679
786
|
recordIssue(measure(element, index, false), chain.allowed, chain.clippedBy);
|
|
680
787
|
});
|
|
681
788
|
|
|
@@ -696,8 +803,24 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
696
803
|
) {
|
|
697
804
|
continue;
|
|
698
805
|
}
|
|
699
|
-
const owner =
|
|
806
|
+
const owner = nearestBlockOwner(node, container);
|
|
700
807
|
if (!owner) continue;
|
|
808
|
+
if (hasVisuallyHiddenAncestor(parent, container)) {
|
|
809
|
+
excluded.push({
|
|
810
|
+
index: measurementIndex++,
|
|
811
|
+
tag: parent.tagName.toLowerCase(),
|
|
812
|
+
reason: "visually-hidden",
|
|
813
|
+
});
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
if (hasEllipsizingAncestor(parent, container)) {
|
|
817
|
+
excluded.push({
|
|
818
|
+
index: measurementIndex++,
|
|
819
|
+
tag: parent.tagName.toLowerCase(),
|
|
820
|
+
reason: "ellipsis-truncation",
|
|
821
|
+
});
|
|
822
|
+
continue;
|
|
823
|
+
}
|
|
701
824
|
let transformed = false;
|
|
702
825
|
let current: Element | null = owner;
|
|
703
826
|
while (current && container.contains(current)) {
|
|
@@ -856,6 +979,11 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
856
979
|
"COL",
|
|
857
980
|
"COLGROUP",
|
|
858
981
|
]);
|
|
982
|
+
// Code-family chips are inline controls, not layout cards, but the
|
|
983
|
+
// radius-vs-size pill test misses them (a code chip's radius is modest)
|
|
984
|
+
// and a flex/grid tag row blockifies their computed display, defeating
|
|
985
|
+
// the inline-display exclusion. Exclude them by tag.
|
|
986
|
+
const CONTROL_TAGS = new Set(["CODE", "KBD", "SAMP", "VAR", "OUTPUT"]);
|
|
859
987
|
|
|
860
988
|
const maxCornerRadiusPx = (style: CSSStyleDeclaration, minDim: number): number => {
|
|
861
989
|
const corners = [
|
|
@@ -877,6 +1005,7 @@ export function buildLayoutLintCheck(): (request: LayoutLintRequest) => LayoutLi
|
|
|
877
1005
|
|
|
878
1006
|
const isPanel = (element: Element): boolean => {
|
|
879
1007
|
if (STRUCTURAL_TAGS.has(element.tagName)) return false;
|
|
1008
|
+
if (CONTROL_TAGS.has(element.tagName)) return false;
|
|
880
1009
|
const style = getComputedStyle(element);
|
|
881
1010
|
if (style.display.startsWith("table") || style.display.startsWith("inline")) return false;
|
|
882
1011
|
if (style.boxShadow && style.boxShadow !== "none") return true;
|
package/src/lib/browser/index.ts
CHANGED
|
@@ -93,6 +93,32 @@ export {
|
|
|
93
93
|
extractObservedIp,
|
|
94
94
|
WEBRTC_PROXY_ONLY_ARG,
|
|
95
95
|
} from "./proxy.js";
|
|
96
|
+
export {
|
|
97
|
+
buildQaManifest,
|
|
98
|
+
type ChangeClass,
|
|
99
|
+
type ClassifyOptions,
|
|
100
|
+
classifySignatures,
|
|
101
|
+
fnv1a32,
|
|
102
|
+
type ManifestOptions,
|
|
103
|
+
type QaClassification,
|
|
104
|
+
type QaContext,
|
|
105
|
+
type QaManifest,
|
|
106
|
+
type QaNodeSignature,
|
|
107
|
+
type QaScope,
|
|
108
|
+
type QaSignature,
|
|
109
|
+
type QaStylesheetSignature,
|
|
110
|
+
} from "./qa-plan.js";
|
|
111
|
+
export {
|
|
112
|
+
listQaSnapshotTargets,
|
|
113
|
+
loadQaSnapshot,
|
|
114
|
+
QA_SNAPSHOT_DIR,
|
|
115
|
+
type QaSnapshotStoreOptions,
|
|
116
|
+
qaSnapshotKey,
|
|
117
|
+
type ResolvedQaBaseline,
|
|
118
|
+
resolveQaBaseline,
|
|
119
|
+
type StoredQaSnapshot,
|
|
120
|
+
saveQaSnapshot,
|
|
121
|
+
} from "./qa-snapshot.js";
|
|
96
122
|
export type {
|
|
97
123
|
RuntHit,
|
|
98
124
|
RuntsResult,
|
|
@@ -120,6 +146,14 @@ export type {
|
|
|
120
146
|
TargetSizeProfile,
|
|
121
147
|
TargetSizeResult,
|
|
122
148
|
} from "./target-size.js";
|
|
149
|
+
export {
|
|
150
|
+
bandOversizedRect,
|
|
151
|
+
cutCost,
|
|
152
|
+
type SnapOptions,
|
|
153
|
+
type SnapSeam,
|
|
154
|
+
snappedBandRects,
|
|
155
|
+
type VisualAtom,
|
|
156
|
+
} from "./tiling.js";
|
|
123
157
|
export type {
|
|
124
158
|
CheckVisibilityOptions,
|
|
125
159
|
VisibilityResult,
|