@tangle-network/browser-agent-driver 0.33.3 → 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/README.md +42 -1
- package/discovery/llms.txt +27 -0
- package/discovery/tangle-agent.json +36 -0
- package/dist/brain/action-parse.d.ts +16 -0
- package/dist/brain/action-parse.d.ts.map +1 -0
- package/dist/brain/action-parse.js +191 -0
- package/dist/brain/action-parse.js.map +1 -0
- package/dist/brain/decide.d.ts +58 -0
- package/dist/brain/decide.d.ts.map +1 -0
- package/dist/brain/decide.js +418 -0
- package/dist/brain/decide.js.map +1 -0
- package/dist/brain/history-compact.d.ts +19 -0
- package/dist/brain/history-compact.d.ts.map +1 -0
- package/dist/brain/history-compact.js +153 -0
- package/dist/brain/history-compact.js.map +1 -0
- package/dist/brain/index.d.ts +78 -152
- package/dist/brain/index.d.ts.map +1 -1
- package/dist/brain/index.js +62 -2268
- package/dist/brain/index.js.map +1 -1
- package/dist/brain/model-client.d.ts +101 -0
- package/dist/brain/model-client.d.ts.map +1 -0
- package/dist/brain/model-client.js +391 -0
- package/dist/brain/model-client.js.map +1 -0
- package/dist/brain/plan.d.ts +57 -0
- package/dist/brain/plan.d.ts.map +1 -0
- package/dist/brain/plan.js +194 -0
- package/dist/brain/plan.js.map +1 -0
- package/dist/brain/prompts.d.ts +37 -0
- package/dist/brain/prompts.d.ts.map +1 -0
- package/dist/brain/prompts.js +455 -0
- package/dist/brain/prompts.js.map +1 -0
- package/dist/brain/provider-fetch.d.ts +26 -0
- package/dist/brain/provider-fetch.d.ts.map +1 -0
- package/dist/brain/provider-fetch.js +45 -0
- package/dist/brain/provider-fetch.js.map +1 -0
- package/dist/brain/snapshot-budget.d.ts +20 -0
- package/dist/brain/snapshot-budget.d.ts.map +1 -0
- package/dist/brain/snapshot-budget.js +202 -0
- package/dist/brain/snapshot-budget.js.map +1 -0
- package/dist/brain/system-prompt.d.ts +67 -0
- package/dist/brain/system-prompt.d.ts.map +1 -0
- package/dist/brain/system-prompt.js +128 -0
- package/dist/brain/system-prompt.js.map +1 -0
- package/dist/brain/tasks/design-audit.d.ts +33 -0
- package/dist/brain/tasks/design-audit.d.ts.map +1 -0
- package/dist/brain/tasks/design-audit.js +100 -0
- package/dist/brain/tasks/design-audit.js.map +1 -0
- package/dist/brain/tasks/evaluate.d.ts +25 -0
- package/dist/brain/tasks/evaluate.d.ts.map +1 -0
- package/dist/brain/tasks/evaluate.js +55 -0
- package/dist/brain/tasks/evaluate.js.map +1 -0
- package/dist/brain/tasks/goal-verification.d.ts +32 -0
- package/dist/brain/tasks/goal-verification.d.ts.map +1 -0
- package/dist/brain/tasks/goal-verification.js +68 -0
- package/dist/brain/tasks/goal-verification.js.map +1 -0
- package/dist/brain/tasks/knowledge.d.ts +26 -0
- package/dist/brain/tasks/knowledge.d.ts.map +1 -0
- package/dist/brain/tasks/knowledge.js +56 -0
- package/dist/brain/tasks/knowledge.js.map +1 -0
- package/dist/brain/tasks/link-scout.d.ts +37 -0
- package/dist/brain/tasks/link-scout.d.ts.map +1 -0
- package/dist/brain/tasks/link-scout.js +69 -0
- package/dist/brain/tasks/link-scout.js.map +1 -0
- package/dist/brain/types.d.ts +55 -0
- package/dist/brain/types.d.ts.map +1 -0
- package/dist/brain/types.js +7 -0
- package/dist/brain/types.js.map +1 -0
- package/dist/browser/stealth-init-script.d.ts +9 -0
- package/dist/browser/stealth-init-script.d.ts.map +1 -0
- package/dist/browser/stealth-init-script.js +128 -0
- package/dist/browser/stealth-init-script.js.map +1 -0
- package/dist/browser/storage-state.d.ts +29 -0
- package/dist/browser/storage-state.d.ts.map +1 -0
- package/dist/browser/storage-state.js +47 -0
- package/dist/browser/storage-state.js.map +1 -0
- package/dist/cli/args.d.ts +141 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +167 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/benchmark-sync.d.ts +9 -0
- package/dist/cli/benchmark-sync.d.ts.map +1 -0
- package/dist/cli/benchmark-sync.js +43 -0
- package/dist/cli/benchmark-sync.js.map +1 -0
- package/dist/cli/build-config.d.ts +11 -0
- package/dist/cli/build-config.d.ts.map +1 -0
- package/dist/cli/build-config.js +355 -0
- package/dist/cli/build-config.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +3 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +36 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/chrome-debug.d.ts +7 -0
- package/dist/cli/commands/chrome-debug.d.ts.map +1 -0
- package/dist/cli/commands/chrome-debug.js +11 -0
- package/dist/cli/commands/chrome-debug.js.map +1 -0
- package/dist/cli/commands/design-audit.d.ts +3 -0
- package/dist/cli/commands/design-audit.d.ts.map +1 -0
- package/dist/cli/commands/design-audit.js +68 -0
- package/dist/cli/commands/design-audit.js.map +1 -0
- package/dist/cli/commands/preview.d.ts +14 -0
- package/dist/cli/commands/preview.d.ts.map +1 -0
- package/dist/cli/commands/preview.js +31 -0
- package/dist/cli/commands/preview.js.map +1 -0
- package/dist/cli/commands/run.d.ts +3 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +728 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/runs.d.ts +8 -0
- package/dist/cli/commands/runs.d.ts.map +1 -0
- package/dist/cli/commands/runs.js +35 -0
- package/dist/cli/commands/runs.js.map +1 -0
- package/dist/cli/commands/share.d.ts +10 -0
- package/dist/cli/commands/share.d.ts.map +1 -0
- package/dist/cli/commands/share.js +32 -0
- package/dist/cli/commands/share.js.map +1 -0
- package/dist/cli/commands/showcase.d.ts +17 -0
- package/dist/cli/commands/showcase.d.ts.map +1 -0
- package/dist/cli/commands/showcase.js +20 -0
- package/dist/cli/commands/showcase.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +12 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +24 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/view.d.ts +7 -0
- package/dist/cli/commands/view.d.ts.map +1 -0
- package/dist/cli/commands/view.js +23 -0
- package/dist/cli/commands/view.js.map +1 -0
- package/dist/cli/constants.d.ts +6 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +3 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/version.d.ts +7 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +16 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli-design-audit.d.ts +44 -36
- package/dist/cli-design-audit.d.ts.map +1 -1
- package/dist/cli-design-audit.js +137 -1646
- package/dist/cli-design-audit.js.map +1 -1
- package/dist/cli-jobs.js +2 -1
- package/dist/cli-jobs.js.map +1 -1
- package/dist/cli.js +66 -1697
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/design/audit/evolve/agent.d.ts +23 -0
- package/dist/design/audit/evolve/agent.d.ts.map +1 -0
- package/dist/design/audit/evolve/agent.js +272 -0
- package/dist/design/audit/evolve/agent.js.map +1 -0
- package/dist/design/audit/evolve/css.d.ts +10 -0
- package/dist/design/audit/evolve/css.d.ts.map +1 -0
- package/dist/design/audit/evolve/css.js +206 -0
- package/dist/design/audit/evolve/css.js.map +1 -0
- package/dist/design/audit/evolve/index.d.ts +13 -0
- package/dist/design/audit/evolve/index.d.ts.map +1 -0
- package/dist/design/audit/evolve/index.js +12 -0
- package/dist/design/audit/evolve/index.js.map +1 -0
- package/dist/design/audit/evolve/report.d.ts +3 -0
- package/dist/design/audit/evolve/report.d.ts.map +1 -0
- package/dist/design/audit/evolve/report.js +45 -0
- package/dist/design/audit/evolve/report.js.map +1 -0
- package/dist/design/audit/evolve/types.d.ts +14 -0
- package/dist/design/audit/evolve/types.d.ts.map +1 -0
- package/dist/design/audit/evolve/types.js +2 -0
- package/dist/design/audit/evolve/types.js.map +1 -0
- package/dist/design/audit/pipeline.d.ts +12 -0
- package/dist/design/audit/pipeline.d.ts.map +1 -1
- package/dist/design/audit/pipeline.js +43 -27
- package/dist/design/audit/pipeline.js.map +1 -1
- package/dist/design/audit/reference/artifact/build.d.ts +33 -0
- package/dist/design/audit/reference/artifact/build.d.ts.map +1 -0
- package/dist/design/audit/reference/artifact/build.js +64 -0
- package/dist/design/audit/reference/artifact/build.js.map +1 -0
- package/dist/design/audit/reference/artifact/render.d.ts +39 -0
- package/dist/design/audit/reference/artifact/render.d.ts.map +1 -0
- package/dist/design/audit/reference/artifact/render.js +213 -0
- package/dist/design/audit/reference/artifact/render.js.map +1 -0
- package/dist/design/audit/reference/artifact/text.d.ts +11 -0
- package/dist/design/audit/reference/artifact/text.d.ts.map +1 -0
- package/dist/design/audit/reference/artifact/text.js +20 -0
- package/dist/design/audit/reference/artifact/text.js.map +1 -0
- package/dist/design/audit/reference/artifact/to-findings.d.ts +57 -0
- package/dist/design/audit/reference/artifact/to-findings.d.ts.map +1 -0
- package/dist/design/audit/reference/artifact/to-findings.js +314 -0
- package/dist/design/audit/reference/artifact/to-findings.js.map +1 -0
- package/dist/design/audit/reference/config.d.ts +50 -0
- package/dist/design/audit/reference/config.d.ts.map +1 -0
- package/dist/design/audit/reference/config.js +108 -0
- package/dist/design/audit/reference/config.js.map +1 -0
- package/dist/design/audit/reference/contracts.d.ts +1030 -0
- package/dist/design/audit/reference/contracts.d.ts.map +1 -0
- package/dist/design/audit/reference/contracts.js +28 -0
- package/dist/design/audit/reference/contracts.js.map +1 -0
- package/dist/design/audit/reference/corpus/build.d.ts +115 -0
- package/dist/design/audit/reference/corpus/build.d.ts.map +1 -0
- package/dist/design/audit/reference/corpus/build.js +152 -0
- package/dist/design/audit/reference/corpus/build.js.map +1 -0
- package/dist/design/audit/reference/corpus/schema.d.ts +33 -0
- package/dist/design/audit/reference/corpus/schema.d.ts.map +1 -0
- package/dist/design/audit/reference/corpus/schema.js +249 -0
- package/dist/design/audit/reference/corpus/schema.js.map +1 -0
- package/dist/design/audit/reference/corpus/store.d.ts +26 -0
- package/dist/design/audit/reference/corpus/store.d.ts.map +1 -0
- package/dist/design/audit/reference/corpus/store.js +104 -0
- package/dist/design/audit/reference/corpus/store.js.map +1 -0
- package/dist/design/audit/reference/dna/delta.d.ts +21 -0
- package/dist/design/audit/reference/dna/delta.d.ts.map +1 -0
- package/dist/design/audit/reference/dna/delta.js +126 -0
- package/dist/design/audit/reference/dna/delta.js.map +1 -0
- package/dist/design/audit/reference/dna/derive.d.ts +31 -0
- package/dist/design/audit/reference/dna/derive.d.ts.map +1 -0
- package/dist/design/audit/reference/dna/derive.js +381 -0
- package/dist/design/audit/reference/dna/derive.js.map +1 -0
- package/dist/design/audit/reference/dna/descriptor.d.ts +36 -0
- package/dist/design/audit/reference/dna/descriptor.d.ts.map +1 -0
- package/dist/design/audit/reference/dna/descriptor.js +209 -0
- package/dist/design/audit/reference/dna/descriptor.js.map +1 -0
- package/dist/design/audit/reference/dna/page-adapter.d.ts +17 -0
- package/dist/design/audit/reference/dna/page-adapter.d.ts.map +1 -0
- package/dist/design/audit/reference/dna/page-adapter.js +35 -0
- package/dist/design/audit/reference/dna/page-adapter.js.map +1 -0
- package/dist/design/audit/reference/dna/scroll-capture.d.ts +93 -0
- package/dist/design/audit/reference/dna/scroll-capture.d.ts.map +1 -0
- package/dist/design/audit/reference/dna/scroll-capture.js +374 -0
- package/dist/design/audit/reference/dna/scroll-capture.js.map +1 -0
- package/dist/design/audit/reference/engine/budget.d.ts +63 -0
- package/dist/design/audit/reference/engine/budget.d.ts.map +1 -0
- package/dist/design/audit/reference/engine/budget.js +110 -0
- package/dist/design/audit/reference/engine/budget.js.map +1 -0
- package/dist/design/audit/reference/engine/core.d.ts +32 -0
- package/dist/design/audit/reference/engine/core.d.ts.map +1 -0
- package/dist/design/audit/reference/engine/core.js +261 -0
- package/dist/design/audit/reference/engine/core.js.map +1 -0
- package/dist/design/audit/reference/engine/guard.d.ts +43 -0
- package/dist/design/audit/reference/engine/guard.d.ts.map +1 -0
- package/dist/design/audit/reference/engine/guard.js +43 -0
- package/dist/design/audit/reference/engine/guard.js.map +1 -0
- package/dist/design/audit/reference/engine/score-core.d.ts +48 -0
- package/dist/design/audit/reference/engine/score-core.d.ts.map +1 -0
- package/dist/design/audit/reference/engine/score-core.js +134 -0
- package/dist/design/audit/reference/engine/score-core.js.map +1 -0
- package/dist/design/audit/reference/engine/wiring.d.ts +35 -0
- package/dist/design/audit/reference/engine/wiring.d.ts.map +1 -0
- package/dist/design/audit/reference/engine/wiring.js +80 -0
- package/dist/design/audit/reference/engine/wiring.js.map +1 -0
- package/dist/design/audit/reference/eval/taste-core.d.ts +77 -0
- package/dist/design/audit/reference/eval/taste-core.d.ts.map +1 -0
- package/dist/design/audit/reference/eval/taste-core.js +95 -0
- package/dist/design/audit/reference/eval/taste-core.js.map +1 -0
- package/dist/design/audit/reference/generate/generator.d.ts +49 -0
- package/dist/design/audit/reference/generate/generator.d.ts.map +1 -0
- package/dist/design/audit/reference/generate/generator.js +94 -0
- package/dist/design/audit/reference/generate/generator.js.map +1 -0
- package/dist/design/audit/reference/generate/parse.d.ts +28 -0
- package/dist/design/audit/reference/generate/parse.d.ts.map +1 -0
- package/dist/design/audit/reference/generate/parse.js +180 -0
- package/dist/design/audit/reference/generate/parse.js.map +1 -0
- package/dist/design/audit/reference/generate/prompt.d.ts +36 -0
- package/dist/design/audit/reference/generate/prompt.d.ts.map +1 -0
- package/dist/design/audit/reference/generate/prompt.js +124 -0
- package/dist/design/audit/reference/generate/prompt.js.map +1 -0
- package/dist/design/audit/reference/index.d.ts +26 -0
- package/dist/design/audit/reference/index.d.ts.map +1 -0
- package/dist/design/audit/reference/index.js +31 -0
- package/dist/design/audit/reference/index.js.map +1 -0
- package/dist/design/audit/reference/judge/image-clamp.d.ts +34 -0
- package/dist/design/audit/reference/judge/image-clamp.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/image-clamp.js +88 -0
- package/dist/design/audit/reference/judge/image-clamp.js.map +1 -0
- package/dist/design/audit/reference/judge/pairwise.d.ts +34 -0
- package/dist/design/audit/reference/judge/pairwise.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/pairwise.js +105 -0
- package/dist/design/audit/reference/judge/pairwise.js.map +1 -0
- package/dist/design/audit/reference/judge/parse.d.ts +31 -0
- package/dist/design/audit/reference/judge/parse.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/parse.js +113 -0
- package/dist/design/audit/reference/judge/parse.js.map +1 -0
- package/dist/design/audit/reference/judge/prompt.d.ts +38 -0
- package/dist/design/audit/reference/judge/prompt.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/prompt.js +111 -0
- package/dist/design/audit/reference/judge/prompt.js.map +1 -0
- package/dist/design/audit/reference/judge/quality.d.ts +28 -0
- package/dist/design/audit/reference/judge/quality.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/quality.js +62 -0
- package/dist/design/audit/reference/judge/quality.js.map +1 -0
- package/dist/design/audit/reference/judge/rank.d.ts +41 -0
- package/dist/design/audit/reference/judge/rank.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/rank.js +196 -0
- package/dist/design/audit/reference/judge/rank.js.map +1 -0
- package/dist/design/audit/reference/judge/text-judge.d.ts +31 -0
- package/dist/design/audit/reference/judge/text-judge.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/text-judge.js +43 -0
- package/dist/design/audit/reference/judge/text-judge.js.map +1 -0
- package/dist/design/audit/reference/judge/vision-judge.d.ts +59 -0
- package/dist/design/audit/reference/judge/vision-judge.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/vision-judge.js +150 -0
- package/dist/design/audit/reference/judge/vision-judge.js.map +1 -0
- package/dist/design/audit/reference/judge/vision-model.d.ts +65 -0
- package/dist/design/audit/reference/judge/vision-model.d.ts.map +1 -0
- package/dist/design/audit/reference/judge/vision-model.js +110 -0
- package/dist/design/audit/reference/judge/vision-model.js.map +1 -0
- package/dist/design/audit/reference/pipeline/evaluate-reference.d.ts +68 -0
- package/dist/design/audit/reference/pipeline/evaluate-reference.d.ts.map +1 -0
- package/dist/design/audit/reference/pipeline/evaluate-reference.js +52 -0
- package/dist/design/audit/reference/pipeline/evaluate-reference.js.map +1 -0
- package/dist/design/audit/reference/reference-context.d.ts +31 -0
- package/dist/design/audit/reference/reference-context.d.ts.map +1 -0
- package/dist/design/audit/reference/reference-context.js +73 -0
- package/dist/design/audit/reference/reference-context.js.map +1 -0
- package/dist/design/audit/reference/retrieval/embedding-hash.d.ts +30 -0
- package/dist/design/audit/reference/retrieval/embedding-hash.d.ts.map +1 -0
- package/dist/design/audit/reference/retrieval/embedding-hash.js +87 -0
- package/dist/design/audit/reference/retrieval/embedding-hash.js.map +1 -0
- package/dist/design/audit/reference/retrieval/embedding-openai.d.ts +38 -0
- package/dist/design/audit/reference/retrieval/embedding-openai.d.ts.map +1 -0
- package/dist/design/audit/reference/retrieval/embedding-openai.js +73 -0
- package/dist/design/audit/reference/retrieval/embedding-openai.js.map +1 -0
- package/dist/design/audit/reference/retrieval/matcher.d.ts +34 -0
- package/dist/design/audit/reference/retrieval/matcher.d.ts.map +1 -0
- package/dist/design/audit/reference/retrieval/matcher.js +107 -0
- package/dist/design/audit/reference/retrieval/matcher.js.map +1 -0
- package/dist/design/audit/reference/run.d.ts +59 -0
- package/dist/design/audit/reference/run.d.ts.map +1 -0
- package/dist/design/audit/reference/run.js +99 -0
- package/dist/design/audit/reference/run.js.map +1 -0
- package/dist/design/audit/report.d.ts +35 -0
- package/dist/design/audit/report.d.ts.map +1 -0
- package/dist/design/audit/report.js +195 -0
- package/dist/design/audit/report.js.map +1 -0
- package/dist/design/audit/tokens/extract.d.ts +71 -0
- package/dist/design/audit/tokens/extract.d.ts.map +1 -0
- package/dist/design/audit/tokens/extract.js +1034 -0
- package/dist/design/audit/tokens/extract.js.map +1 -0
- package/dist/design/audit/types.d.ts +8 -0
- package/dist/design/audit/types.d.ts.map +1 -1
- package/dist/design/compare.d.ts.map +1 -1
- package/dist/design/compare.js +2 -6
- package/dist/design/compare.js.map +1 -1
- package/dist/design/cookie-consent.d.ts +3 -0
- package/dist/design/cookie-consent.d.ts.map +1 -0
- package/dist/design/cookie-consent.js +26 -0
- package/dist/design/cookie-consent.js.map +1 -0
- package/dist/design/viewports.d.ts +18 -0
- package/dist/design/viewports.d.ts.map +1 -0
- package/dist/design/viewports.js +10 -0
- package/dist/design/viewports.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/memory/store.d.ts +19 -1
- package/dist/memory/store.d.ts.map +1 -1
- package/dist/memory/store.js +47 -0
- package/dist/memory/store.js.map +1 -1
- package/dist/provider-defaults.d.ts +18 -0
- package/dist/provider-defaults.d.ts.map +1 -1
- package/dist/provider-defaults.js +33 -0
- package/dist/provider-defaults.js.map +1 -1
- package/dist/runner/allowed-domains.d.ts +11 -0
- package/dist/runner/allowed-domains.d.ts.map +1 -0
- package/dist/runner/allowed-domains.js +14 -0
- package/dist/runner/allowed-domains.js.map +1 -0
- package/dist/runner/batch-fill.d.ts +28 -0
- package/dist/runner/batch-fill.d.ts.map +1 -0
- package/dist/runner/batch-fill.js +80 -0
- package/dist/runner/batch-fill.js.map +1 -0
- package/dist/runner/completion-policy.d.ts +26 -0
- package/dist/runner/completion-policy.d.ts.map +1 -0
- package/dist/runner/completion-policy.js +76 -0
- package/dist/runner/completion-policy.js.map +1 -0
- package/dist/runner/constants.d.ts +14 -0
- package/dist/runner/constants.d.ts.map +1 -0
- package/dist/runner/constants.js +23 -0
- package/dist/runner/constants.js.map +1 -0
- package/dist/runner/decision-screenshot.d.ts +24 -0
- package/dist/runner/decision-screenshot.d.ts.map +1 -0
- package/dist/runner/decision-screenshot.js +23 -0
- package/dist/runner/decision-screenshot.js.map +1 -0
- package/dist/runner/domain-boundary.d.ts +36 -0
- package/dist/runner/domain-boundary.d.ts.map +1 -0
- package/dist/runner/domain-boundary.js +81 -0
- package/dist/runner/domain-boundary.js.map +1 -0
- package/dist/runner/effect-verify.d.ts +28 -0
- package/dist/runner/effect-verify.d.ts.map +1 -0
- package/dist/runner/effect-verify.js +42 -0
- package/dist/runner/effect-verify.js.map +1 -0
- package/dist/runner/execute-plan.d.ts +58 -0
- package/dist/runner/execute-plan.d.ts.map +1 -0
- package/dist/runner/execute-plan.js +426 -0
- package/dist/runner/execute-plan.js.map +1 -0
- package/dist/runner/max-turns-extension.d.ts +19 -0
- package/dist/runner/max-turns-extension.d.ts.map +1 -0
- package/dist/runner/max-turns-extension.js +25 -0
- package/dist/runner/max-turns-extension.js.map +1 -0
- package/dist/runner/micro-plan.d.ts +11 -0
- package/dist/runner/micro-plan.d.ts.map +1 -0
- package/dist/runner/micro-plan.js +29 -0
- package/dist/runner/micro-plan.js.map +1 -0
- package/dist/runner/prompt-snippets.d.ts +5 -0
- package/dist/runner/prompt-snippets.d.ts.map +1 -0
- package/dist/runner/prompt-snippets.js +13 -0
- package/dist/runner/prompt-snippets.js.map +1 -0
- package/dist/runner/replay/contracts.d.ts +300 -0
- package/dist/runner/replay/contracts.d.ts.map +1 -0
- package/dist/runner/replay/contracts.js +42 -0
- package/dist/runner/replay/contracts.js.map +1 -0
- package/dist/runner/replay/controller.d.ts +27 -0
- package/dist/runner/replay/controller.d.ts.map +1 -0
- package/dist/runner/replay/controller.js +197 -0
- package/dist/runner/replay/controller.js.map +1 -0
- package/dist/runner/replay/guard.d.ts +28 -0
- package/dist/runner/replay/guard.d.ts.map +1 -0
- package/dist/runner/replay/guard.js +100 -0
- package/dist/runner/replay/guard.js.map +1 -0
- package/dist/runner/runner.d.ts +44 -51
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +155 -851
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/scout-feedback.d.ts +51 -0
- package/dist/runner/scout-feedback.d.ts.map +1 -0
- package/dist/runner/scout-feedback.js +149 -0
- package/dist/runner/scout-feedback.js.map +1 -0
- package/dist/skills/macro-loader.d.ts +1 -1
- package/dist/test-runner.d.ts.map +1 -1
- package/dist/test-runner.js +25 -0
- package/dist/test-runner.js.map +1 -1
- package/dist/types/actions.d.ts +241 -0
- package/dist/types/actions.d.ts.map +1 -0
- package/dist/types/actions.js +5 -0
- package/dist/types/actions.js.map +1 -0
- package/dist/types/config.d.ts +211 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/design-audit.d.ts +92 -0
- package/dist/types/design-audit.d.ts.map +1 -0
- package/dist/types/design-audit.js +5 -0
- package/dist/types/design-audit.js.map +1 -0
- package/dist/types/design-tokens.d.ts +138 -0
- package/dist/types/design-tokens.d.ts.map +1 -0
- package/dist/types/design-tokens.js +5 -0
- package/dist/types/design-tokens.js.map +1 -0
- package/dist/types/page.d.ts +16 -0
- package/dist/types/page.d.ts.map +1 -0
- package/dist/types/page.js +2 -0
- package/dist/types/page.js.map +1 -0
- package/dist/types/plan.d.ts +50 -0
- package/dist/types/plan.d.ts.map +1 -0
- package/dist/types/plan.js +2 -0
- package/dist/types/plan.js.map +1 -0
- package/dist/types/preview.d.ts +9 -0
- package/dist/types/preview.d.ts.map +1 -0
- package/dist/types/preview.js +5 -0
- package/dist/types/preview.js.map +1 -0
- package/dist/types/result.d.ts +62 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/result.js +2 -0
- package/dist/types/result.js.map +1 -0
- package/dist/types/scenario.d.ts +20 -0
- package/dist/types/scenario.d.ts.map +1 -0
- package/dist/types/scenario.js +5 -0
- package/dist/types/scenario.js.map +1 -0
- package/dist/types/test-runner.d.ts +145 -0
- package/dist/types/test-runner.d.ts.map +1 -0
- package/dist/types/test-runner.js +10 -0
- package/dist/types/test-runner.js.map +1 -0
- package/dist/types/trajectory.d.ts +38 -0
- package/dist/types/trajectory.d.ts.map +1 -0
- package/dist/types/trajectory.js +2 -0
- package/dist/types/trajectory.js.map +1 -0
- package/dist/types/turn.d.ts +50 -0
- package/dist/types/turn.d.ts.map +1 -0
- package/dist/types/turn.js +2 -0
- package/dist/types/turn.js.map +1 -0
- package/dist/types.d.ts +16 -1017
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -8
- package/dist/types.js.map +1 -1
- package/dist/wallet/rpc-interception.d.ts +15 -0
- package/dist/wallet/rpc-interception.d.ts.map +1 -0
- package/dist/wallet/rpc-interception.js +95 -0
- package/dist/wallet/rpc-interception.js.map +1 -0
- package/package.json +6 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,1021 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for browser agent
|
|
3
|
-
*/
|
|
4
|
-
import type { SnapshotDiff } from './drivers/snapshot.js';
|
|
5
|
-
export interface ClickAction {
|
|
6
|
-
action: 'click';
|
|
7
|
-
selector: string;
|
|
8
|
-
}
|
|
9
|
-
export interface TypeAction {
|
|
10
|
-
action: 'type';
|
|
11
|
-
selector: string;
|
|
12
|
-
text: string;
|
|
13
|
-
}
|
|
14
|
-
export interface ScrollAction {
|
|
15
|
-
action: 'scroll';
|
|
16
|
-
direction: 'up' | 'down';
|
|
17
|
-
/** Scroll distance in pixels (default: 500) */
|
|
18
|
-
amount?: number;
|
|
19
|
-
/** Optional selector for scrolling a specific container (default: viewport) */
|
|
20
|
-
selector?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface NavigateAction {
|
|
23
|
-
action: 'navigate';
|
|
24
|
-
url: string;
|
|
25
|
-
}
|
|
26
|
-
export interface WaitAction {
|
|
27
|
-
action: 'wait';
|
|
28
|
-
ms: number;
|
|
29
|
-
}
|
|
30
|
-
export interface CompleteAction {
|
|
31
|
-
action: 'complete';
|
|
32
|
-
result: string;
|
|
33
|
-
}
|
|
34
|
-
export interface PressAction {
|
|
35
|
-
action: 'press';
|
|
36
|
-
selector: string;
|
|
37
|
-
key: string;
|
|
38
|
-
}
|
|
39
|
-
export interface HoverAction {
|
|
40
|
-
action: 'hover';
|
|
41
|
-
selector: string;
|
|
42
|
-
}
|
|
43
|
-
export interface SelectAction {
|
|
44
|
-
action: 'select';
|
|
45
|
-
selector: string;
|
|
46
|
-
value: string;
|
|
47
|
-
}
|
|
48
|
-
export interface EvaluateAction {
|
|
49
|
-
action: 'evaluate';
|
|
50
|
-
criteria: string;
|
|
51
|
-
}
|
|
52
|
-
export interface RunScriptAction {
|
|
53
|
-
action: 'runScript';
|
|
54
|
-
/** JavaScript expression to evaluate in page context */
|
|
55
|
-
script: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Extract a numbered, text-rich index of elements matching a CSS
|
|
59
|
-
* selector. Returns the visible textContent + tag + key attributes + a stable
|
|
60
|
-
* selector for each match. The agent then picks elements by index in the next
|
|
61
|
-
* turn (e.g., complete with `result: extracted[3].text`).
|
|
62
|
-
*
|
|
63
|
-
* The agent gets a broad selector (e.g. `'p, span, dd, code'`) and reads the
|
|
64
|
-
* actual text content of every match. Pick-by-content is more reliable than
|
|
65
|
-
* selector-by-name on pages where data lives in `<dl>/<dt>/<dd>/<code>/<pre>`
|
|
66
|
-
* or inside obscure wrapper divs.
|
|
67
|
-
*
|
|
68
|
-
* Example payload for npm weekly downloads:
|
|
69
|
-
* {
|
|
70
|
-
* action: 'extractWithIndex',
|
|
71
|
-
* query: 'p, span, strong',
|
|
72
|
-
* contains: 'downloads',
|
|
73
|
-
* }
|
|
74
|
-
*
|
|
75
|
-
* Optional `contains` filters matches to only those containing the substring
|
|
76
|
-
* (case-insensitive). Without `contains`, all matches are returned (capped at
|
|
77
|
-
* 80 to keep the response readable).
|
|
78
|
-
*/
|
|
79
|
-
export interface ExtractWithIndexAction {
|
|
80
|
-
action: 'extractWithIndex';
|
|
81
|
-
/** CSS selector — broad selectors are fine, the response includes full text per match */
|
|
82
|
-
query: string;
|
|
83
|
-
/** Optional substring filter (case-insensitive) applied to textContent */
|
|
84
|
-
contains?: string;
|
|
85
|
-
}
|
|
86
|
-
export interface VerifyPreviewAction {
|
|
87
|
-
action: 'verifyPreview';
|
|
88
|
-
}
|
|
89
|
-
export interface AbortAction {
|
|
90
|
-
action: 'abort';
|
|
91
|
-
reason: string;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Multi-field form fill — fill N fields, select N dropdowns, and check N
|
|
95
|
-
* checkboxes in a SINGLE action. Replaces the click+type+click+type pattern
|
|
96
|
-
* that takes one turn per field.
|
|
97
|
-
*
|
|
98
|
-
* Example payload for a 5-field form:
|
|
99
|
-
* {
|
|
100
|
-
* action: 'fill',
|
|
101
|
-
* fields: { '@t1': 'Jordan', '@t2': 'Rivera', '@t3': 'jordan@example.com' },
|
|
102
|
-
* selects: { '@s1': 'WA' },
|
|
103
|
-
* checks: ['@c1', '@c2'],
|
|
104
|
-
* }
|
|
105
|
-
*
|
|
106
|
-
* Each entry runs in order. Failures bail with the first error and report
|
|
107
|
-
* which field failed so the agent can recover by switching to single-step
|
|
108
|
-
* actions on the next turn.
|
|
109
|
-
*/
|
|
110
|
-
export interface BatchFillAction {
|
|
111
|
-
action: 'fill';
|
|
112
|
-
/** Map of @ref → text value to type into each field */
|
|
113
|
-
fields?: Record<string, string>;
|
|
114
|
-
/** Map of @ref → option value or label for select dropdowns */
|
|
115
|
-
selects?: Record<string, string>;
|
|
116
|
-
/** Array of @refs to check (checkboxes / radios) */
|
|
117
|
-
checks?: string[];
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Sequential clicks on a known set of refs. For multi-step UI navigation
|
|
121
|
-
* where the agent has identified the click chain ahead of time (e.g., open
|
|
122
|
-
* menu → click submenu → click item).
|
|
123
|
-
*
|
|
124
|
-
* Each click runs in order with an optional interval. Failures bail with
|
|
125
|
-
* the first error.
|
|
126
|
-
*/
|
|
127
|
-
export interface ClickSequenceAction {
|
|
128
|
-
action: 'clickSequence';
|
|
129
|
-
/** Array of @refs to click in order */
|
|
130
|
-
refs: string[];
|
|
131
|
-
/** Optional wait between clicks in ms (default: 100) */
|
|
132
|
-
intervalMs?: number;
|
|
133
|
-
}
|
|
134
|
-
export interface ClickAtAction {
|
|
135
|
-
action: 'clickAt';
|
|
136
|
-
/** X coordinate in virtual screen space (0-1024) */
|
|
137
|
-
x: number;
|
|
138
|
-
/** Y coordinate in virtual screen space (0-768) */
|
|
139
|
-
y: number;
|
|
140
|
-
}
|
|
141
|
-
export interface TypeAtAction {
|
|
142
|
-
action: 'typeAt';
|
|
143
|
-
/** X coordinate in virtual screen space (0-1024) */
|
|
144
|
-
x: number;
|
|
145
|
-
/** Y coordinate in virtual screen space (0-768) */
|
|
146
|
-
y: number;
|
|
147
|
-
/** Text to type after clicking */
|
|
148
|
-
text: string;
|
|
149
|
-
}
|
|
150
|
-
export interface ClickLabelAction {
|
|
151
|
-
action: 'clickLabel';
|
|
152
|
-
/** Label number from the SoM overlay (e.g., 3 for element [3]) */
|
|
153
|
-
label: number;
|
|
154
|
-
}
|
|
155
|
-
export interface TypeLabelAction {
|
|
156
|
-
action: 'typeLabel';
|
|
157
|
-
/** Label number from the SoM overlay */
|
|
158
|
-
label: number;
|
|
159
|
-
/** Text to type after clicking */
|
|
160
|
-
text: string;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Invoke a named macro defined in `skills/macros/<name>.json`. The macro
|
|
164
|
-
* expands into a sequence of existing primitive actions. The driver
|
|
165
|
-
* executes each step in order; the first failure aborts the macro and its
|
|
166
|
-
* error is surfaced as the macro's ActionResult error.
|
|
167
|
-
*
|
|
168
|
-
* Macros are flat (cannot call other macros) to keep dispatch bounded and
|
|
169
|
-
* to avoid cycles. They receive arguments via `args`, which is substituted
|
|
170
|
-
* into `${paramName}` placeholders in each step's string fields.
|
|
171
|
-
*/
|
|
172
|
-
export interface MacroAction {
|
|
173
|
-
action: 'macro';
|
|
174
|
-
/** Macro name, matches a registered MacroDefinition */
|
|
175
|
-
name: string;
|
|
176
|
-
/** Arguments to interpolate into the macro's steps. Optional when the
|
|
177
|
-
* macro has no declared parameters. */
|
|
178
|
-
args?: Record<string, string>;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Mid-run parallel fan-out. Spawns N sub-agents in fresh tabs,
|
|
182
|
-
* each with its own URL + goal, collects the results as structured
|
|
183
|
-
* feedback. Used when the agent sees "10 candidates, investigate each
|
|
184
|
-
* in parallel" — search result fan-out, roster screening, N-way
|
|
185
|
-
* comparison shopping, etc.
|
|
186
3
|
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
export
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
goal: string;
|
|
204
|
-
/** Human-readable label rendered in the overlay + feedback. */
|
|
205
|
-
label?: string;
|
|
206
|
-
/** Max turns for this sub-agent. Default: 8. */
|
|
207
|
-
maxTurns?: number;
|
|
208
|
-
}>;
|
|
209
|
-
/**
|
|
210
|
-
* Shorthand for batch-shaped fanOuts. Lets the agent emit a tiny JSON
|
|
211
|
-
* object (one baseUrl, one template, an array of string items) that
|
|
212
|
-
* the runtime expands into full subGoals. This is the PREFERRED shape
|
|
213
|
-
* for N>3 branches — it keeps the LLM's JSON output minimal and
|
|
214
|
-
* escape-free, which meaningfully improves reliability (long nested
|
|
215
|
-
* subGoals arrays cause JSON parse failures in practice).
|
|
216
|
-
*
|
|
217
|
-
* Example:
|
|
218
|
-
* {
|
|
219
|
-
* "action": "fanOut",
|
|
220
|
-
* "baseUrl": "https://sanctionssearch.ofac.treas.gov/",
|
|
221
|
-
* "goalTemplate": "Screen {item} on OFAC SDN. Report CLEARED / POSITIVE MATCH with program / NEEDS REVIEW.",
|
|
222
|
-
* "items": ["SMITH JOHN", "MADURO NICOLAS", "AL-ASSAD BASHAR"]
|
|
223
|
-
* }
|
|
224
|
-
*
|
|
225
|
-
* Expanded to:
|
|
226
|
-
* subGoals: [
|
|
227
|
-
* { url: baseUrl, goal: "Screen SMITH JOHN on OFAC SDN. ...", label: "SMITH JOHN" },
|
|
228
|
-
* { url: baseUrl, goal: "Screen MADURO NICOLAS on OFAC SDN. ...", label: "MADURO NICOLAS" },
|
|
229
|
-
* ...
|
|
230
|
-
* ]
|
|
231
|
-
*
|
|
232
|
-
* `{item}` in goalTemplate is replaced with each array entry verbatim.
|
|
233
|
-
* The label is the item itself.
|
|
234
|
-
*/
|
|
235
|
-
baseUrl?: string;
|
|
236
|
-
goalTemplate?: string;
|
|
237
|
-
items?: string[];
|
|
238
|
-
/**
|
|
239
|
-
* Optional guidance on how to combine sub-results when they return.
|
|
240
|
-
* Default: serialize as a JSON array with {label, verdict} entries.
|
|
241
|
-
*/
|
|
242
|
-
summarize?: string;
|
|
243
|
-
}
|
|
244
|
-
export type Action = ClickAction | TypeAction | PressAction | HoverAction | SelectAction | ScrollAction | NavigateAction | WaitAction | EvaluateAction | RunScriptAction | ExtractWithIndexAction | VerifyPreviewAction | CompleteAction | AbortAction | BatchFillAction | ClickSequenceAction | ClickAtAction | TypeAtAction | ClickLabelAction | TypeLabelAction | MacroAction | FanOutAction;
|
|
245
|
-
/**
|
|
246
|
-
* A single step in a Plan. Wraps an action with a verification checkpoint
|
|
247
|
-
* and optional recovery hint. The runner executes steps deterministically;
|
|
248
|
-
* `expectedEffect` is the post-condition that must hold for the next step
|
|
249
|
-
* to fire.
|
|
250
|
-
*/
|
|
251
|
-
export interface PlanStep {
|
|
252
|
-
/**
|
|
253
|
-
* The action to execute deterministically. Use batch verbs (`fill`,
|
|
254
|
-
* `clickSequence`) wherever possible to minimize step count.
|
|
255
|
-
*/
|
|
256
|
-
action: Action;
|
|
257
|
-
/**
|
|
258
|
-
* Post-condition the runner verifies before advancing. Same shape as
|
|
259
|
-
* the existing `expectedEffect` on Turn — natural-language assertion
|
|
260
|
-
* checked against the post-action snapshot.
|
|
261
|
-
*/
|
|
262
|
-
expectedEffect: string;
|
|
263
|
-
/**
|
|
264
|
-
* Optional human-readable description of what this step does. Surfaced
|
|
265
|
-
* in plan-step-executed events for observability and the live viewer.
|
|
266
|
-
*/
|
|
267
|
-
rationale?: string;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* A complete plan from `Brain.plan()`. The runner attempts to execute
|
|
271
|
-
* every step deterministically. On the first verification failure or
|
|
272
|
-
* selector miss, the runner falls back to the existing per-action
|
|
273
|
-
* decide loop with a `[REPLAN]` hint in extraContext.
|
|
274
|
-
*
|
|
275
|
-
* Plans are NOT trees — they're flat sequences. Branching is handled
|
|
276
|
-
* by the per-action fallback loop, which decide()'s its way through
|
|
277
|
-
* the unexpected state then potentially re-enters the planner.
|
|
278
|
-
*/
|
|
279
|
-
export interface Plan {
|
|
280
|
-
/** Steps to execute in order */
|
|
281
|
-
steps: PlanStep[];
|
|
282
|
-
/**
|
|
283
|
-
* Final result text the runner should emit as `complete` if all steps
|
|
284
|
-
* pass verification. If absent, the runner emits a generic completion.
|
|
285
|
-
*/
|
|
286
|
-
finalResult?: string;
|
|
287
|
-
/**
|
|
288
|
-
* Plan-level reasoning — what's the strategy, why this sequence?
|
|
289
|
-
* Surfaced in plan-completed events for observability.
|
|
290
|
-
*/
|
|
291
|
-
reasoning?: string;
|
|
292
|
-
}
|
|
293
|
-
export interface PageState {
|
|
294
|
-
/** Current URL */
|
|
295
|
-
url: string;
|
|
296
|
-
/** Page title */
|
|
297
|
-
title: string;
|
|
298
|
-
/** Simplified DOM snapshot (text format) */
|
|
299
|
-
snapshot: string;
|
|
300
|
-
/** Screenshot as base64 JPEG (optional, for debugging) */
|
|
301
|
-
screenshot?: string;
|
|
302
|
-
/** Diff from previous snapshot (undefined on first observe) */
|
|
303
|
-
snapshotDiff?: string;
|
|
304
|
-
/** Structured diff for programmatic use (undefined on first observe) */
|
|
305
|
-
snapshotDiffRaw?: SnapshotDiff;
|
|
306
|
-
}
|
|
307
|
-
export interface Scenario {
|
|
308
|
-
/** Natural language goal */
|
|
309
|
-
goal: string;
|
|
310
|
-
/** Starting URL (optional - uses current page if not set) */
|
|
311
|
-
startUrl?: string;
|
|
312
|
-
/** Optional task tags, used by adaptive runtime policies */
|
|
313
|
-
tags?: string[];
|
|
314
|
-
/** Explicit host allowlist for navigation/result selection (for benchmark and policy constraints) */
|
|
315
|
-
allowedDomains?: string[];
|
|
316
|
-
/** Max turns before giving up */
|
|
317
|
-
maxTurns?: number;
|
|
318
|
-
/** Abort signal for external cancellation (e.g., story timeout) */
|
|
319
|
-
signal?: AbortSignal;
|
|
320
|
-
/** Session ID for cross-run continuity. Runs with the same ID share session
|
|
321
|
-
* history regardless of domain. When omitted, sessions are scoped to domain. */
|
|
322
|
-
sessionId?: string;
|
|
323
|
-
/** Parent run ID — set when this run is a resume or fork of a previous run. */
|
|
324
|
-
parentRunId?: string;
|
|
325
|
-
}
|
|
326
|
-
export interface AgentConfig {
|
|
327
|
-
/** LLM provider: 'openai' (default), 'anthropic', 'google', 'cli-bridge', 'codex-cli', 'claude-code', 'sandbox-backend', or 'zai-coding-plan' */
|
|
328
|
-
provider?: 'openai' | 'anthropic' | 'google' | 'cli-bridge' | 'codex-cli' | 'claude-code' | 'sandbox-backend' | 'zai-coding-plan';
|
|
329
|
-
/** LLM model (default: gpt-5.4) */
|
|
330
|
-
model?: string;
|
|
331
|
-
/** Enable adaptive model routing for decide() (default: false) */
|
|
332
|
-
adaptiveModelRouting?: boolean;
|
|
333
|
-
/** Fast navigation model used when adaptive routing is enabled */
|
|
334
|
-
navModel?: string;
|
|
335
|
-
/** Provider for navModel (defaults to provider) */
|
|
336
|
-
navProvider?: 'openai' | 'anthropic' | 'google' | 'cli-bridge' | 'codex-cli' | 'claude-code' | 'sandbox-backend' | 'zai-coding-plan';
|
|
337
|
-
/** Per-role model overrides. Each role falls back to the main model/provider. */
|
|
338
|
-
models?: {
|
|
339
|
-
/** Planner — needs best reasoning. Default: main model. */
|
|
340
|
-
planner?: {
|
|
341
|
-
model: string;
|
|
342
|
-
provider?: string;
|
|
343
|
-
};
|
|
344
|
-
/** Executor — follows plans, can be cheap. Default: navModel or main model. */
|
|
345
|
-
executor?: {
|
|
346
|
-
model: string;
|
|
347
|
-
provider?: string;
|
|
348
|
-
};
|
|
349
|
-
/** Verifier — structured yes/no. Default: navModel or main model. */
|
|
350
|
-
verifier?: {
|
|
351
|
-
model: string;
|
|
352
|
-
provider?: string;
|
|
353
|
-
};
|
|
354
|
-
/** Supervisor — strategic recovery. Default: main model. */
|
|
355
|
-
supervisor?: {
|
|
356
|
-
model: string;
|
|
357
|
-
provider?: string;
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
/** API key (defaults to OPENAI_API_KEY) */
|
|
361
|
-
apiKey?: string;
|
|
362
|
-
/** Custom API base URL (for LiteLLM, local models, etc.) */
|
|
363
|
-
baseUrl?: string;
|
|
364
|
-
/** Native sidecar backend type when using provider='sandbox-backend' */
|
|
365
|
-
sandboxBackendType?: string;
|
|
366
|
-
/** Optional sidecar backend profile/preset identifier */
|
|
367
|
-
sandboxBackendProfile?: string;
|
|
368
|
-
/** Optional native backend model provider (mainly for opencode) */
|
|
369
|
-
sandboxBackendProvider?: string;
|
|
370
|
-
/** Optional override for the default browser-agent system prompt */
|
|
371
|
-
systemPrompt?: string;
|
|
372
|
-
/** Enable debug logging */
|
|
373
|
-
debug?: boolean;
|
|
374
|
-
/** Enable vision/multimodal (screenshots sent to LLM). Default: true */
|
|
375
|
-
vision?: boolean;
|
|
376
|
-
/** Vision policy: always, never, or auto-escalate on ambiguous/stalled states */
|
|
377
|
-
visionStrategy?: 'always' | 'never' | 'auto';
|
|
378
|
-
/** Observation mode — 'dom' (default), 'vision', or 'hybrid' */
|
|
379
|
-
observationMode?: 'dom' | 'vision' | 'hybrid';
|
|
380
|
-
/** Max conversation history turns to keep (default: 10) */
|
|
381
|
-
maxHistoryTurns?: number;
|
|
382
|
-
/** Number of retries on transient failures (default: 3) */
|
|
383
|
-
retries?: number;
|
|
384
|
-
/** Delay between retries in ms (default: 1000) */
|
|
385
|
-
retryDelayMs?: number;
|
|
386
|
-
/** Minimum quality score (1-10) for auto-evaluate on complete. 0 = skip. */
|
|
387
|
-
qualityThreshold?: number;
|
|
388
|
-
/** Timeout per LLM request in ms (default: 60000) */
|
|
389
|
-
llmTimeoutMs?: number;
|
|
390
|
-
/** Use a lower-token prompt/snapshot strategy on the first turn */
|
|
391
|
-
compactFirstTurn?: boolean;
|
|
392
|
-
/** Verify goal completion before accepting 'complete' action (default: true) */
|
|
393
|
-
goalVerification?: boolean;
|
|
394
|
-
/** Enable trajectory scoring when selecting reference traces (default: false) */
|
|
395
|
-
traceScoring?: boolean;
|
|
396
|
-
/** Retention window for trajectory scoring in days (default: 30) */
|
|
397
|
-
traceTtlDays?: number;
|
|
398
|
-
/** Optional micro-planning: execute small follow-up actions within a turn */
|
|
399
|
-
microPlan?: MicroPlanConfig;
|
|
400
|
-
/**
|
|
401
|
-
* Plan-then-execute. When true, BrowserAgent.run() makes a single
|
|
402
|
-
* `Brain.plan()` LLM call up front, then executes the plan steps
|
|
403
|
-
* deterministically without re-entering the LLM until verification fails.
|
|
404
|
-
* On the first plan deviation, the runner falls back to the existing
|
|
405
|
-
* per-action observe→decide→execute loop with a [REPLAN] hint injected.
|
|
406
|
-
*
|
|
407
|
-
* Default: false (per-action loop only). Set to true to enable the planner.
|
|
408
|
-
* Disable via BAD_PLANNER=0 env override.
|
|
409
|
-
*/
|
|
410
|
-
plannerEnabled?: boolean;
|
|
411
|
-
/**
|
|
412
|
-
* Planner routing policy. `always` uses the planner whenever plannerEnabled
|
|
413
|
-
* is true. `auto` routes extraction-style tasks through the per-action
|
|
414
|
-
* observe→act loop.
|
|
415
|
-
*/
|
|
416
|
-
plannerMode?: 'always' | 'auto';
|
|
417
|
-
/** Extra wait before the planner's initial observe, in ms. Default: 0. */
|
|
418
|
-
initialObserveSettleMs?: number;
|
|
419
|
-
/** Optional scout that ranks ambiguous link choices before the actor decides */
|
|
420
|
-
scout?: ScoutConfig;
|
|
421
|
-
/** Optional supervisor that can intervene when the run is hard-stalled */
|
|
422
|
-
supervisor?: SupervisorConfig;
|
|
423
|
-
/** Runtime observability artifacts (console/network/trace) */
|
|
424
|
-
observability?: ObservabilityConfig;
|
|
425
|
-
/** Enable DeFi/crypto app awareness in the brain (auto-set when wallet mode is active) */
|
|
426
|
-
walletMode?: boolean;
|
|
427
|
-
/** Wallet address (hex, with 0x prefix) — used for RPC interception calldata matching */
|
|
428
|
-
walletAddress?: string;
|
|
429
|
-
/** CAPTCHA solving using LLM vision (screenshot + model identifies tiles to click) */
|
|
430
|
-
captcha?: {
|
|
431
|
-
enabled?: boolean;
|
|
432
|
-
/** Max solve attempts per encounter (default: 5) */
|
|
433
|
-
maxAttempts?: number;
|
|
434
|
-
};
|
|
435
|
-
/** Parallel tab execution for compound goals */
|
|
436
|
-
parallelTabs?: {
|
|
437
|
-
/** Enable goal decomposition + parallel tab execution (default: false) */
|
|
438
|
-
enabled?: boolean;
|
|
439
|
-
/** Max parallel tabs (default: 3) */
|
|
440
|
-
maxTabs?: number;
|
|
441
|
-
};
|
|
442
|
-
/** Override token budget (used internally by parallel runner to split budget) */
|
|
443
|
-
tokenBudget?: number;
|
|
444
|
-
}
|
|
445
|
-
export interface ObservabilityConfig {
|
|
446
|
-
/** Enable runtime observability artifacts (default: true) */
|
|
447
|
-
enabled?: boolean;
|
|
448
|
-
/** Capture browser console warnings/errors and page errors (default: true) */
|
|
449
|
-
captureConsole?: boolean;
|
|
450
|
-
/** Capture failed requests and HTTP 4xx/5xx responses (default: true) */
|
|
451
|
-
captureNetwork?: boolean;
|
|
452
|
-
/** Trace capture policy (default: 'on-failure') */
|
|
453
|
-
tracePolicy?: 'off' | 'on-failure' | 'always';
|
|
454
|
-
/** Max console/page error entries persisted per test (default: 200) */
|
|
455
|
-
maxConsoleEntries?: number;
|
|
456
|
-
/** Max network entries persisted per test (default: 200) */
|
|
457
|
-
maxNetworkEntries?: number;
|
|
458
|
-
}
|
|
459
|
-
export interface MicroPlanConfig {
|
|
460
|
-
/** Enable multi-action micro plans (default: false) */
|
|
461
|
-
enabled?: boolean;
|
|
462
|
-
/** Max actions to execute in one turn including primary action (default: 2) */
|
|
463
|
-
maxActionsPerTurn?: number;
|
|
464
|
-
}
|
|
465
|
-
export interface ScoutConfig {
|
|
466
|
-
/** Enable scout recommendations on ambiguous link/result pages */
|
|
467
|
-
enabled?: boolean;
|
|
468
|
-
/** Optional model override for scout reasoning */
|
|
469
|
-
model?: string;
|
|
470
|
-
/** Optional provider override for scout model */
|
|
471
|
-
provider?: 'openai' | 'anthropic' | 'google' | 'cli-bridge' | 'codex-cli' | 'claude-code' | 'sandbox-backend' | 'zai-coding-plan';
|
|
472
|
-
/** Allow the scout to inspect the current screenshot when available */
|
|
473
|
-
useVision?: boolean;
|
|
474
|
-
/** Max ranked candidates sent to the scout */
|
|
475
|
-
maxCandidates?: number;
|
|
476
|
-
/** Skip scout when the top deterministic score is already above this threshold */
|
|
477
|
-
minTopScore?: number;
|
|
478
|
-
/** Skip scout when the top-vs-second score gap is wider than this threshold */
|
|
479
|
-
maxScoreGap?: number;
|
|
480
|
-
/** Enable a top-2 read-only challenger on ambiguous visible-link pages */
|
|
481
|
-
readOnlyTop2Challenger?: boolean;
|
|
482
|
-
}
|
|
483
|
-
export interface SupervisorConfig {
|
|
484
|
-
/** Enable supervisor interventions (default: true in config defaults) */
|
|
485
|
-
enabled?: boolean;
|
|
486
|
-
/** Optional model override for supervisor reasoning */
|
|
487
|
-
model?: string;
|
|
488
|
-
/** Optional provider override for supervisor model */
|
|
489
|
-
provider?: 'openai' | 'anthropic' | 'google' | 'cli-bridge' | 'codex-cli' | 'claude-code' | 'sandbox-backend' | 'zai-coding-plan';
|
|
490
|
-
/** Allow the supervisor to inspect the current screenshot when available */
|
|
491
|
-
useVision?: boolean;
|
|
492
|
-
/** Minimum completed turns before supervisor can intervene */
|
|
493
|
-
minTurnsBeforeInvoke?: number;
|
|
494
|
-
/** Cooldown turns between supervisor interventions */
|
|
495
|
-
cooldownTurns?: number;
|
|
496
|
-
/** Hard cap on interventions per run */
|
|
497
|
-
maxInterventions?: number;
|
|
498
|
-
/** Number of recent turns used to determine hard-stall conditions */
|
|
499
|
-
hardStallWindow?: number;
|
|
500
|
-
}
|
|
501
|
-
export interface SupervisorSignal {
|
|
502
|
-
severity: 'none' | 'soft' | 'hard';
|
|
503
|
-
reasons: string[];
|
|
504
|
-
repeatedActionCount: number;
|
|
505
|
-
unchangedTurns: number;
|
|
506
|
-
errorTurns: number;
|
|
507
|
-
verificationFailures: number;
|
|
508
|
-
}
|
|
509
|
-
export interface SupervisorDirective {
|
|
510
|
-
decision: 'none' | 'inject_feedback' | 'force_action' | 'abort';
|
|
511
|
-
feedback?: string;
|
|
512
|
-
action?: Action;
|
|
513
|
-
reason?: string;
|
|
514
|
-
confidence?: number;
|
|
515
|
-
raw?: string;
|
|
516
|
-
}
|
|
517
|
-
export interface Turn {
|
|
518
|
-
turn: number;
|
|
519
|
-
state: PageState;
|
|
520
|
-
action: Action;
|
|
521
|
-
/** Raw LLM response text */
|
|
522
|
-
rawLLMResponse?: string;
|
|
523
|
-
/** LLM's reasoning/thinking (if provided) */
|
|
524
|
-
reasoning?: string;
|
|
525
|
-
/** Multi-step plan from brain */
|
|
526
|
-
plan?: string[];
|
|
527
|
-
/** Actual action sequence executed this turn (primary action first) */
|
|
528
|
-
executedActions?: Action[];
|
|
529
|
-
/** Current step in the plan */
|
|
530
|
-
currentStep?: number;
|
|
531
|
-
/** Expected effect of the action (for verification) */
|
|
532
|
-
expectedEffect?: string;
|
|
533
|
-
/** Whether the expected effect was verified */
|
|
534
|
-
verified?: boolean;
|
|
535
|
-
/** Verification failure message */
|
|
536
|
-
verificationFailure?: string;
|
|
537
|
-
/** Tokens used for this turn */
|
|
538
|
-
tokensUsed?: number;
|
|
539
|
-
/** Input (prompt) tokens for this turn */
|
|
540
|
-
inputTokens?: number;
|
|
541
|
-
/** Output (completion) tokens for this turn */
|
|
542
|
-
outputTokens?: number;
|
|
543
|
-
/**
|
|
544
|
-
* Prompt-cache hit tokens (provider-agnostic). Populated by OpenAI/ZAI/GLM
|
|
545
|
-
* automatic server-side caching and by Anthropic explicit cache_control.
|
|
546
|
-
*/
|
|
547
|
-
cacheReadInputTokens?: number;
|
|
548
|
-
/** Prompt-cache write tokens (cache miss, first turn) */
|
|
549
|
-
cacheCreationInputTokens?: number;
|
|
550
|
-
/** Which model handled this turn (for adaptive routing cost tracking) */
|
|
551
|
-
modelUsed?: string;
|
|
552
|
-
/** Time taken for this turn in ms */
|
|
553
|
-
durationMs: number;
|
|
554
|
-
/** Error message if turn failed */
|
|
555
|
-
error?: string;
|
|
556
|
-
/** Bounding box of the target element at action time (for replay overlays) */
|
|
557
|
-
actionBounds?: {
|
|
558
|
-
x: number;
|
|
559
|
-
y: number;
|
|
560
|
-
width: number;
|
|
561
|
-
height: number;
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
export interface AgentResult {
|
|
565
|
-
success: boolean;
|
|
566
|
-
result?: string;
|
|
567
|
-
reason?: string;
|
|
568
|
-
turns: Turn[];
|
|
569
|
-
totalMs: number;
|
|
570
|
-
/** Phase timing instrumentation for the run */
|
|
571
|
-
phaseTimings?: RunPhaseTimings;
|
|
572
|
-
/** Startup-path instrumentation for the run */
|
|
573
|
-
startupDiagnostics?: RunStartupDiagnostics;
|
|
574
|
-
/** Wasted-turn instrumentation for the run */
|
|
575
|
-
wasteMetrics?: RunWasteMetrics;
|
|
576
|
-
/** Quality evaluation (if qualityThreshold is set or agent used "evaluate" action) */
|
|
577
|
-
evaluation?: {
|
|
578
|
-
score: number;
|
|
579
|
-
assessment: string;
|
|
580
|
-
strengths: string[];
|
|
581
|
-
issues: string[];
|
|
582
|
-
suggestions: string[];
|
|
583
|
-
};
|
|
584
|
-
/** Goal achievement verification (if goalVerification is enabled) */
|
|
585
|
-
goalVerification?: GoalVerification;
|
|
586
|
-
}
|
|
587
|
-
export interface GoalVerification {
|
|
588
|
-
/** Did the LLM judge the goal as achieved? */
|
|
589
|
-
achieved: boolean;
|
|
590
|
-
/** Confidence 0-1 */
|
|
591
|
-
confidence: number;
|
|
592
|
-
/** Evidence supporting achievement */
|
|
593
|
-
evidence: string[];
|
|
594
|
-
/** Missing criteria (empty if achieved) */
|
|
595
|
-
missing: string[];
|
|
596
|
-
}
|
|
597
|
-
export interface SuccessCriterion {
|
|
598
|
-
type: 'url-contains' | 'url-matches' | 'element-visible' | 'element-text' | 'element-count' | 'custom';
|
|
599
|
-
/** CSS/Playwright selector for element-based criteria */
|
|
600
|
-
selector?: string;
|
|
601
|
-
/** Expected value (URL substring, text content, element count) */
|
|
602
|
-
value?: string;
|
|
603
|
-
/** Custom check function (receives Playwright page) */
|
|
604
|
-
check?: (page: import('playwright').Page) => Promise<boolean>;
|
|
605
|
-
/** Human-readable description of what this checks */
|
|
606
|
-
description?: string;
|
|
607
|
-
}
|
|
608
|
-
export interface TestCase {
|
|
609
|
-
/** Unique identifier */
|
|
610
|
-
id: string;
|
|
611
|
-
/** Human-readable name */
|
|
612
|
-
name: string;
|
|
613
|
-
/** Detailed description */
|
|
614
|
-
description?: string;
|
|
615
|
-
/** Category for grouping */
|
|
616
|
-
category?: string;
|
|
617
|
-
/** Tags for filtering */
|
|
618
|
-
tags?: string[];
|
|
619
|
-
/** Starting URL */
|
|
620
|
-
startUrl: string;
|
|
621
|
-
/** Natural language goal for the agent */
|
|
622
|
-
goal: string;
|
|
623
|
-
/** Explicit host allowlist for navigation/result selection */
|
|
624
|
-
allowedDomains?: string[];
|
|
625
|
-
/** Max turns allowed (default: 30) */
|
|
626
|
-
maxTurns?: number;
|
|
627
|
-
/** Timeout in ms */
|
|
628
|
-
timeoutMs?: number;
|
|
629
|
-
/** Priority (lower = runs first) */
|
|
630
|
-
priority?: number;
|
|
631
|
-
/** IDs of prerequisite test cases that must pass first */
|
|
632
|
-
dependsOn?: string[];
|
|
633
|
-
/** Session ID for cross-run continuity. Runs with the same ID share session
|
|
634
|
-
* history regardless of domain. When omitted, sessions are scoped to domain. */
|
|
635
|
-
sessionId?: string;
|
|
636
|
-
/** Parent run ID — set when this run is a resume or fork of a previous run. */
|
|
637
|
-
parentRunId?: string;
|
|
638
|
-
/** Run before the agent starts (e.g., seed data, reset state) */
|
|
639
|
-
setup?: (page: import('playwright').Page) => Promise<void>;
|
|
640
|
-
/** Run after the agent finishes (e.g., cleanup) */
|
|
641
|
-
teardown?: (page: import('playwright').Page) => Promise<void>;
|
|
642
|
-
/** Ground-truth criteria verified AFTER the agent completes */
|
|
643
|
-
successCriteria?: SuccessCriterion[];
|
|
644
|
-
/** Natural-language criteria appended to the goal for LLM awareness */
|
|
645
|
-
successDescription?: string;
|
|
646
|
-
}
|
|
647
|
-
export interface CriterionResult {
|
|
648
|
-
criterion: SuccessCriterion;
|
|
649
|
-
passed: boolean;
|
|
650
|
-
detail?: string;
|
|
651
|
-
}
|
|
652
|
-
export interface TestResult {
|
|
653
|
-
testCase: TestCase;
|
|
654
|
-
agentResult: AgentResult;
|
|
655
|
-
/** Agent's self-reported success */
|
|
656
|
-
agentSuccess: boolean;
|
|
657
|
-
/** Ground-truth verification (true if no criteria defined OR all pass) */
|
|
658
|
-
verified: boolean;
|
|
659
|
-
/** Per-criterion verification results */
|
|
660
|
-
criteriaResults?: CriterionResult[];
|
|
661
|
-
/** Human-readable pass/fail explanation */
|
|
662
|
-
verdict: string;
|
|
663
|
-
/** Number of turns used */
|
|
664
|
-
turnsUsed: number;
|
|
665
|
-
/** Total tokens consumed */
|
|
666
|
-
tokensUsed: number;
|
|
667
|
-
/** Total input (prompt) tokens */
|
|
668
|
-
inputTokens?: number;
|
|
669
|
-
/** Total output (completion) tokens */
|
|
670
|
-
outputTokens?: number;
|
|
671
|
-
/** Estimated cost in USD (based on model pricing) */
|
|
672
|
-
estimatedCostUsd?: number;
|
|
673
|
-
/** Duration in ms */
|
|
674
|
-
durationMs: number;
|
|
675
|
-
/** Phase timing instrumentation copied from agentResult for report consumers */
|
|
676
|
-
phaseTimings?: RunPhaseTimings;
|
|
677
|
-
/** Startup-path instrumentation copied from agentResult for report consumers */
|
|
678
|
-
startupDiagnostics?: RunStartupDiagnostics;
|
|
679
|
-
/** Wasted-turn instrumentation copied from agentResult for report consumers */
|
|
680
|
-
wasteMetrics?: RunWasteMetrics;
|
|
681
|
-
startedAt: Date;
|
|
682
|
-
endedAt: Date;
|
|
683
|
-
/** Screenshots captured during execution */
|
|
684
|
-
screenshots?: {
|
|
685
|
-
turn: number;
|
|
686
|
-
base64: string;
|
|
687
|
-
}[];
|
|
688
|
-
/** Whether this test was skipped (unmet dependencies) */
|
|
689
|
-
skipped?: boolean;
|
|
690
|
-
skipReason?: string;
|
|
691
|
-
/** Runtime/backend configuration that produced this result */
|
|
692
|
-
runtime?: RunRuntimeConfig;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* Current on-disk schema version for `report.json` / `TestSuiteResult`.
|
|
696
|
-
*
|
|
697
|
-
* Consumers that parse `<sink>/report.json` should pin or range-check this.
|
|
698
|
-
* The contract: bump on any breaking shape change (removed fields, renamed
|
|
699
|
-
* fields, changed value semantics). Adding an optional field is non-breaking
|
|
700
|
-
* and does NOT bump the version.
|
|
701
|
-
*/
|
|
702
|
-
export declare const TEST_SUITE_SCHEMA_VERSION: "1";
|
|
703
|
-
export interface TestSuiteResult {
|
|
704
|
-
/**
|
|
705
|
-
* On-disk schema version. See {@link TEST_SUITE_SCHEMA_VERSION}. Consumers
|
|
706
|
-
* should verify this matches their expected version before destructuring.
|
|
707
|
-
*/
|
|
708
|
-
schemaVersion: string;
|
|
709
|
-
/** Model used */
|
|
710
|
-
model: string;
|
|
711
|
-
/** Runtime/backend configuration for the suite */
|
|
712
|
-
runtime?: RunRuntimeConfig;
|
|
713
|
-
/** Run timestamp */
|
|
714
|
-
timestamp: string;
|
|
715
|
-
/** Per-test results */
|
|
716
|
-
results: TestResult[];
|
|
717
|
-
/** Aggregate metrics */
|
|
718
|
-
summary: {
|
|
719
|
-
total: number;
|
|
720
|
-
passed: number;
|
|
721
|
-
failed: number;
|
|
722
|
-
skipped: number;
|
|
723
|
-
passRate: number;
|
|
724
|
-
avgTurns: number;
|
|
725
|
-
avgTokens: number;
|
|
726
|
-
avgDurationMs: number;
|
|
727
|
-
p50DurationMs: number;
|
|
728
|
-
p95DurationMs: number;
|
|
729
|
-
totalDurationMs: number;
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
export interface RunRuntimeConfig {
|
|
733
|
-
provider: NonNullable<AgentConfig['provider']>;
|
|
734
|
-
model: string;
|
|
735
|
-
sandboxBackendType?: string;
|
|
736
|
-
sandboxBackendProfile?: string;
|
|
737
|
-
sandboxBackendProvider?: string;
|
|
738
|
-
}
|
|
739
|
-
export interface RunPhaseTimings {
|
|
740
|
-
initialNavigateMs?: number;
|
|
741
|
-
firstObserveMs?: number;
|
|
742
|
-
firstDecideMs?: number;
|
|
743
|
-
firstExecuteMs?: number;
|
|
744
|
-
}
|
|
745
|
-
export interface RunStartupDiagnostics {
|
|
746
|
-
firstTurnSeen: boolean;
|
|
747
|
-
timeToFirstTurnMs?: number;
|
|
748
|
-
zeroTurnFailureClass?: 'pre_first_turn_timeout' | 'provider_or_credentials' | 'runner_startup_error' | 'unknown';
|
|
749
|
-
startupReason?: string;
|
|
750
|
-
}
|
|
751
|
-
export interface RunWasteMetrics {
|
|
752
|
-
repeatedQueryCount: number;
|
|
753
|
-
verificationRejectionCount: number;
|
|
754
|
-
turnsAfterSufficientEvidence: number;
|
|
755
|
-
errorTurns: number;
|
|
756
|
-
}
|
|
757
|
-
export interface TrajectoryStep {
|
|
758
|
-
/** URL at this step */
|
|
759
|
-
url: string;
|
|
760
|
-
/** Action taken */
|
|
761
|
-
action: Action;
|
|
762
|
-
/** Hash of snapshot for similarity comparison */
|
|
763
|
-
snapshotHash: string;
|
|
764
|
-
/** Whether the expected effect was verified */
|
|
765
|
-
verified?: boolean;
|
|
766
|
-
}
|
|
767
|
-
export interface Trajectory {
|
|
768
|
-
/** Unique ID */
|
|
769
|
-
id: string;
|
|
770
|
-
/** Goal that was achieved */
|
|
771
|
-
goal: string;
|
|
772
|
-
/** Normalized origin for environment scoping (e.g. https://app.example.com) */
|
|
773
|
-
origin?: string;
|
|
774
|
-
/** Steps taken */
|
|
775
|
-
steps: TrajectoryStep[];
|
|
776
|
-
/** Whether this trajectory succeeded */
|
|
777
|
-
success: boolean;
|
|
778
|
-
/** Total duration */
|
|
779
|
-
durationMs: number;
|
|
780
|
-
/** Model used */
|
|
781
|
-
model: string;
|
|
782
|
-
/** When this was recorded */
|
|
783
|
-
timestamp: string;
|
|
784
|
-
}
|
|
785
|
-
export interface DesignFinding {
|
|
786
|
-
category: 'visual-bug' | 'layout' | 'contrast' | 'alignment' | 'spacing' | 'typography' | 'accessibility' | 'ux';
|
|
787
|
-
severity: 'critical' | 'major' | 'minor';
|
|
788
|
-
description: string;
|
|
789
|
-
location: string;
|
|
790
|
-
suggestion: string;
|
|
791
|
-
/** CSS selector targeting the element to fix */
|
|
792
|
-
cssSelector?: string;
|
|
793
|
-
/** Concrete CSS property:value fix */
|
|
794
|
-
cssFix?: string;
|
|
795
|
-
/** 1-10: how much this hurts the user experience */
|
|
796
|
-
impact?: number;
|
|
797
|
-
/** 1-10: how hard the fix is (1 = trivial CSS change, 10 = architectural rework) */
|
|
798
|
-
effort?: number;
|
|
799
|
-
/** Scope of the fix's effect — page-specific, section-specific, component-level, or design-system-wide */
|
|
800
|
-
blast?: 'page' | 'section' | 'component' | 'system';
|
|
801
|
-
/** Computed: (impact * blastWeight) / effort. Higher = fix this first. */
|
|
802
|
-
roi?: number;
|
|
803
|
-
/** Number of audited pages where this finding (or its dedupe-equivalent) appears */
|
|
804
|
-
pageCount?: number;
|
|
805
|
-
/**
|
|
806
|
-
* Layer 2 — raw LLM-emitted patches, if any. Untyped here to keep the v1
|
|
807
|
-
* shape free of audit-internal types. The Layer 2 parser in
|
|
808
|
-
* src/design/audit/patches/parse.ts validates and converts to typed Patches
|
|
809
|
-
* before they land on the canonical AuditResult.
|
|
810
|
-
*/
|
|
811
|
-
rawPatches?: unknown[];
|
|
812
|
-
}
|
|
813
|
-
export interface DesignSystemScore {
|
|
814
|
-
layout: number;
|
|
815
|
-
typography: number;
|
|
816
|
-
color: number;
|
|
817
|
-
spacing: number;
|
|
818
|
-
components: number;
|
|
819
|
-
interactions: number;
|
|
820
|
-
accessibility: number;
|
|
821
|
-
polish: number;
|
|
822
|
-
}
|
|
823
|
-
export interface DesignEvolveResult {
|
|
824
|
-
/** Initial audit score */
|
|
825
|
-
beforeScore: number;
|
|
826
|
-
/** Score after applying fixes */
|
|
827
|
-
afterScore: number;
|
|
828
|
-
/** Score delta (positive = improvement) */
|
|
829
|
-
delta: number;
|
|
830
|
-
/** Rounds of fix-reaudit cycles completed */
|
|
831
|
-
rounds: number;
|
|
832
|
-
/** Fixes that were applied */
|
|
833
|
-
appliedFixes: Array<{
|
|
834
|
-
cssSelector: string;
|
|
835
|
-
cssFix: string;
|
|
836
|
-
finding: string;
|
|
837
|
-
}>;
|
|
838
|
-
/** Fixes that were generated but not applied */
|
|
839
|
-
skippedFixes: Array<{
|
|
840
|
-
cssSelector: string;
|
|
841
|
-
cssFix: string;
|
|
842
|
-
reason: string;
|
|
843
|
-
}>;
|
|
844
|
-
/** Per-round scores for convergence tracking */
|
|
845
|
-
scoreHistory: number[];
|
|
846
|
-
/** Generated CSS override stylesheet */
|
|
847
|
-
cssOverride: string;
|
|
848
|
-
}
|
|
849
|
-
export interface FlowAuditResult {
|
|
850
|
-
flow: string;
|
|
851
|
-
steps: number;
|
|
852
|
-
reachedGoal: boolean;
|
|
853
|
-
findings: DesignFinding[];
|
|
854
|
-
screenshots: string[];
|
|
855
|
-
score: number;
|
|
856
|
-
error?: string;
|
|
857
|
-
}
|
|
858
|
-
export interface DesignAuditReport {
|
|
859
|
-
timestamp: string;
|
|
860
|
-
flows: FlowAuditResult[];
|
|
861
|
-
summary: {
|
|
862
|
-
healthScore: number;
|
|
863
|
-
totalFindings: number;
|
|
864
|
-
critical: number;
|
|
865
|
-
major: number;
|
|
866
|
-
minor: number;
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
export interface AuditFlow {
|
|
870
|
-
name: string;
|
|
871
|
-
startUrl: string;
|
|
872
|
-
goal: string;
|
|
873
|
-
checkpoints: string[];
|
|
874
|
-
maxTurns?: number;
|
|
875
|
-
}
|
|
876
|
-
export interface DesignTokens {
|
|
877
|
-
url: string;
|
|
878
|
-
extractedAt: string;
|
|
879
|
-
viewportsAudited: string[];
|
|
880
|
-
customProperties: Record<string, string>;
|
|
881
|
-
colors: ColorToken[];
|
|
882
|
-
typography: {
|
|
883
|
-
families: FontFamily[];
|
|
884
|
-
scale: TypeScaleEntry[];
|
|
885
|
-
};
|
|
886
|
-
brand: {
|
|
887
|
-
title?: string;
|
|
888
|
-
description?: string;
|
|
889
|
-
themeColor?: string;
|
|
890
|
-
favicon?: string;
|
|
891
|
-
ogImage?: string;
|
|
892
|
-
appleTouchIcon?: string;
|
|
893
|
-
manifestUrl?: string;
|
|
894
|
-
};
|
|
895
|
-
logos: LogoAsset[];
|
|
896
|
-
icons: SvgIcon[];
|
|
897
|
-
fontFiles: FontFile[];
|
|
898
|
-
images: ImageAsset[];
|
|
899
|
-
videos: VideoAsset[];
|
|
900
|
-
stylesheets: Array<{
|
|
901
|
-
url: string;
|
|
902
|
-
localPath?: string;
|
|
903
|
-
}>;
|
|
904
|
-
responsive: Record<string, ViewportTokens>;
|
|
905
|
-
detectedLibraries: string[];
|
|
906
|
-
}
|
|
907
|
-
export interface VideoAsset {
|
|
908
|
-
url: string;
|
|
909
|
-
type: 'video' | 'video-source';
|
|
910
|
-
poster?: string;
|
|
911
|
-
localPath?: string;
|
|
912
|
-
mimeType?: string;
|
|
913
|
-
sizeBytes?: number;
|
|
914
|
-
}
|
|
915
|
-
export interface ColorToken {
|
|
916
|
-
value: string;
|
|
917
|
-
hex: string;
|
|
918
|
-
count: number;
|
|
919
|
-
properties: string[];
|
|
920
|
-
cluster?: 'primary' | 'secondary' | 'accent' | 'neutral' | 'background' | 'border';
|
|
921
|
-
}
|
|
922
|
-
export interface FontFamily {
|
|
923
|
-
family: string;
|
|
924
|
-
weights: number[];
|
|
925
|
-
classification: 'heading' | 'body' | 'mono' | 'display';
|
|
926
|
-
}
|
|
927
|
-
export interface TypeScaleEntry {
|
|
928
|
-
fontSize: string;
|
|
929
|
-
fontWeight: string;
|
|
930
|
-
lineHeight: string;
|
|
931
|
-
letterSpacing: string;
|
|
932
|
-
fontFamily: string;
|
|
933
|
-
usage: 'heading' | 'body' | 'caption' | 'label';
|
|
934
|
-
tag?: string;
|
|
935
|
-
count: number;
|
|
936
|
-
}
|
|
937
|
-
export interface LogoAsset {
|
|
938
|
-
type: 'svg' | 'img';
|
|
939
|
-
src?: string;
|
|
940
|
-
alt?: string;
|
|
941
|
-
width?: number;
|
|
942
|
-
height?: number;
|
|
943
|
-
svgContent?: string;
|
|
944
|
-
}
|
|
945
|
-
export interface SvgIcon {
|
|
946
|
-
selector: string;
|
|
947
|
-
viewBox?: string;
|
|
948
|
-
width?: number;
|
|
949
|
-
height?: number;
|
|
950
|
-
content: string;
|
|
951
|
-
}
|
|
952
|
-
export interface ViewportTokens {
|
|
953
|
-
width: number;
|
|
954
|
-
height: number;
|
|
955
|
-
spacing: SpacingToken[];
|
|
956
|
-
gridBaseUnit?: number;
|
|
957
|
-
borders: BorderToken[];
|
|
958
|
-
shadows: ShadowToken[];
|
|
959
|
-
components: {
|
|
960
|
-
buttons: ComponentFingerprint[];
|
|
961
|
-
inputs: ComponentFingerprint[];
|
|
962
|
-
cards: ComponentFingerprint[];
|
|
963
|
-
nav: NavPattern[];
|
|
964
|
-
};
|
|
965
|
-
animations: AnimationToken[];
|
|
966
|
-
screenshotPath?: string;
|
|
967
|
-
}
|
|
968
|
-
export interface SpacingToken {
|
|
969
|
-
value: string;
|
|
970
|
-
count: number;
|
|
971
|
-
properties: string[];
|
|
972
|
-
}
|
|
973
|
-
export interface BorderToken {
|
|
974
|
-
borderRadius: string;
|
|
975
|
-
count: number;
|
|
976
|
-
}
|
|
977
|
-
export interface ShadowToken {
|
|
978
|
-
value: string;
|
|
979
|
-
count: number;
|
|
980
|
-
}
|
|
981
|
-
export interface ComponentFingerprint {
|
|
982
|
-
fingerprint: string;
|
|
983
|
-
count: number;
|
|
984
|
-
exampleText?: string;
|
|
985
|
-
styles: Record<string, string>;
|
|
986
|
-
}
|
|
987
|
-
export interface NavPattern {
|
|
988
|
-
selector: string;
|
|
989
|
-
layout: Record<string, string>;
|
|
990
|
-
linkCount: number;
|
|
991
|
-
linkStyles: Record<string, string>;
|
|
992
|
-
}
|
|
993
|
-
export interface AnimationToken {
|
|
994
|
-
property: string;
|
|
995
|
-
value: string;
|
|
996
|
-
count: number;
|
|
997
|
-
}
|
|
998
|
-
export interface FontFile {
|
|
999
|
-
family: string;
|
|
1000
|
-
weight: string;
|
|
1001
|
-
style: string;
|
|
1002
|
-
src: string;
|
|
1003
|
-
format: string;
|
|
1004
|
-
localPath?: string;
|
|
1005
|
-
}
|
|
1006
|
-
export interface ImageAsset {
|
|
1007
|
-
url: string;
|
|
1008
|
-
type: 'img' | 'background' | 'favicon' | 'og-image' | 'icon' | 'video-poster' | 'lazy-load';
|
|
1009
|
-
localPath?: string;
|
|
1010
|
-
mimeType?: string;
|
|
1011
|
-
sizeBytes?: number;
|
|
1012
|
-
}
|
|
1013
|
-
export interface PreviewVerification {
|
|
1014
|
-
previewUrl: string;
|
|
1015
|
-
appLoaded: boolean;
|
|
1016
|
-
title: string;
|
|
1017
|
-
snapshot: string;
|
|
1018
|
-
screenshot?: string;
|
|
1019
|
-
errors: string[];
|
|
1020
|
-
}
|
|
4
|
+
* Barrel: domain modules live under `src/types/`. This file re-exports every
|
|
5
|
+
* one so the canonical `./types.js` / `../types.js` import path (and the
|
|
6
|
+
* `src/index.ts` re-export) keeps resolving every name unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export * from './types/actions.js';
|
|
9
|
+
export * from './types/plan.js';
|
|
10
|
+
export * from './types/page.js';
|
|
11
|
+
export * from './types/scenario.js';
|
|
12
|
+
export * from './types/config.js';
|
|
13
|
+
export * from './types/turn.js';
|
|
14
|
+
export * from './types/result.js';
|
|
15
|
+
export * from './types/test-runner.js';
|
|
16
|
+
export * from './types/trajectory.js';
|
|
17
|
+
export * from './types/design-audit.js';
|
|
18
|
+
export * from './types/design-tokens.js';
|
|
19
|
+
export * from './types/preview.js';
|
|
1021
20
|
//# sourceMappingURL=types.d.ts.map
|