gsd-pi 2.33.1-dev.235d83a → 2.33.1-dev.29a8268
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/cli.js +0 -16
- package/dist/resource-loader.d.ts +0 -2
- package/dist/resource-loader.js +3 -36
- package/dist/resources/extensions/ask-user-questions.ts +290 -0
- package/dist/resources/extensions/async-jobs/async-bash-tool.ts +212 -0
- package/dist/resources/extensions/async-jobs/await-tool.ts +103 -0
- package/dist/resources/extensions/async-jobs/cancel-job-tool.ts +35 -0
- package/dist/resources/extensions/async-jobs/index.ts +141 -0
- package/dist/resources/extensions/async-jobs/job-manager.ts +211 -0
- package/dist/resources/extensions/aws-auth/index.ts +144 -0
- package/dist/resources/extensions/bg-shell/bg-shell-command.ts +219 -0
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.ts +400 -0
- package/dist/resources/extensions/bg-shell/bg-shell-tool.ts +985 -0
- package/dist/resources/extensions/bg-shell/index.ts +59 -0
- package/dist/resources/extensions/bg-shell/interaction.ts +198 -0
- package/dist/resources/extensions/bg-shell/output-formatter.ts +279 -0
- package/dist/resources/extensions/bg-shell/overlay.ts +437 -0
- package/dist/resources/extensions/bg-shell/process-manager.ts +464 -0
- package/dist/resources/extensions/bg-shell/readiness-detector.ts +126 -0
- package/dist/resources/extensions/bg-shell/types.ts +303 -0
- package/dist/resources/extensions/bg-shell/utilities.ts +57 -0
- package/dist/resources/extensions/browser-tools/capture.ts +199 -0
- package/dist/resources/extensions/browser-tools/core.ts +1196 -0
- package/dist/resources/extensions/browser-tools/{evaluate-helpers.js → evaluate-helpers.ts} +1 -0
- package/dist/resources/extensions/browser-tools/index.ts +71 -0
- package/dist/resources/extensions/browser-tools/lifecycle.ts +270 -0
- package/dist/resources/extensions/browser-tools/refs.ts +264 -0
- package/dist/resources/extensions/browser-tools/settle.ts +197 -0
- package/dist/resources/extensions/browser-tools/state.ts +408 -0
- package/dist/resources/extensions/browser-tools/tools/action-cache.ts +216 -0
- package/dist/resources/extensions/browser-tools/tools/assertions.ts +342 -0
- package/dist/resources/extensions/browser-tools/tools/codegen.ts +274 -0
- package/dist/resources/extensions/browser-tools/tools/device.ts +183 -0
- package/dist/resources/extensions/browser-tools/tools/extract.ts +229 -0
- package/dist/resources/extensions/browser-tools/tools/forms.ts +801 -0
- package/dist/resources/extensions/browser-tools/tools/injection-detect.ts +221 -0
- package/dist/resources/extensions/browser-tools/tools/inspection.ts +492 -0
- package/dist/resources/extensions/browser-tools/tools/intent.ts +614 -0
- package/dist/resources/extensions/browser-tools/tools/interaction.ts +865 -0
- package/dist/resources/extensions/browser-tools/tools/navigation.ts +232 -0
- package/dist/resources/extensions/browser-tools/tools/network-mock.ts +244 -0
- package/dist/resources/extensions/browser-tools/tools/pages.ts +303 -0
- package/dist/resources/extensions/browser-tools/tools/pdf.ts +92 -0
- package/dist/resources/extensions/browser-tools/tools/refs.ts +541 -0
- package/dist/resources/extensions/browser-tools/tools/screenshot.ts +101 -0
- package/dist/resources/extensions/browser-tools/tools/session.ts +400 -0
- package/dist/resources/extensions/browser-tools/tools/state-persistence.ts +202 -0
- package/dist/resources/extensions/browser-tools/tools/visual-diff.ts +209 -0
- package/dist/resources/extensions/browser-tools/tools/wait.ts +247 -0
- package/dist/resources/extensions/browser-tools/tools/zoom.ts +104 -0
- package/dist/resources/extensions/browser-tools/utils.ts +660 -0
- package/dist/resources/extensions/context7/index.ts +428 -0
- package/dist/resources/extensions/get-secrets-from-user.ts +607 -0
- package/dist/resources/extensions/google-search/index.ts +466 -0
- package/dist/resources/extensions/gsd/activity-log.ts +162 -0
- package/dist/resources/extensions/gsd/atomic-write.ts +35 -0
- package/dist/resources/extensions/gsd/auto/session.ts +236 -0
- package/dist/resources/extensions/gsd/auto-budget.ts +32 -0
- package/dist/resources/extensions/gsd/{auto-constants.js → auto-constants.ts} +1 -0
- package/dist/resources/extensions/gsd/auto-dashboard.ts +626 -0
- package/dist/resources/extensions/gsd/auto-direct-dispatch.ts +224 -0
- package/dist/resources/extensions/gsd/auto-dispatch.ts +409 -0
- package/dist/resources/extensions/gsd/auto-idempotency.ts +151 -0
- package/dist/resources/extensions/gsd/auto-model-selection.ts +179 -0
- package/dist/resources/extensions/gsd/auto-observability.ts +72 -0
- package/dist/resources/extensions/gsd/auto-post-unit.ts +618 -0
- package/dist/resources/extensions/gsd/auto-prompts.ts +1273 -0
- package/dist/resources/extensions/gsd/auto-recovery.ts +578 -0
- package/dist/resources/extensions/gsd/auto-start.ts +483 -0
- package/dist/resources/extensions/gsd/auto-stuck-detection.ts +221 -0
- package/dist/resources/extensions/gsd/{auto-supervisor.js → auto-supervisor.ts} +33 -25
- package/dist/resources/extensions/gsd/auto-timeout-recovery.ts +263 -0
- package/dist/resources/extensions/gsd/auto-timers.ts +224 -0
- package/dist/resources/extensions/gsd/auto-tool-tracking.ts +54 -0
- package/dist/resources/extensions/gsd/auto-unit-closeout.ts +48 -0
- package/dist/resources/extensions/gsd/auto-verification.ts +229 -0
- package/dist/resources/extensions/gsd/auto-worktree.ts +658 -0
- package/dist/resources/extensions/gsd/auto.ts +1834 -0
- package/dist/resources/extensions/gsd/{cache.js → cache.ts} +7 -5
- package/dist/resources/extensions/gsd/captures.ts +427 -0
- package/dist/resources/extensions/gsd/claude-import.ts +656 -0
- package/dist/resources/extensions/gsd/collision-diagnostics.ts +332 -0
- package/dist/resources/extensions/gsd/commands-config.ts +102 -0
- package/dist/resources/extensions/gsd/commands-extensions.ts +328 -0
- package/dist/resources/extensions/gsd/commands-handlers.ts +395 -0
- package/dist/resources/extensions/gsd/commands-inspect.ts +91 -0
- package/dist/resources/extensions/gsd/commands-logs.ts +536 -0
- package/dist/resources/extensions/gsd/commands-maintenance.ts +206 -0
- package/dist/resources/extensions/gsd/commands-prefs-wizard.ts +780 -0
- package/dist/resources/extensions/gsd/commands-workflow-templates.ts +543 -0
- package/dist/resources/extensions/gsd/commands.ts +1149 -0
- package/dist/resources/extensions/gsd/complexity-classifier.ts +320 -0
- package/dist/resources/extensions/gsd/{constants.js → constants.ts} +6 -0
- package/dist/resources/extensions/gsd/context-budget.ts +266 -0
- package/dist/resources/extensions/gsd/context-store.ts +195 -0
- package/dist/resources/extensions/gsd/crash-recovery.ts +121 -0
- package/dist/resources/extensions/gsd/dashboard-overlay.ts +681 -0
- package/dist/resources/extensions/gsd/db-writer.ts +360 -0
- package/dist/resources/extensions/gsd/debug-logger.ts +178 -0
- package/dist/resources/extensions/gsd/detection.ts +470 -0
- package/dist/resources/extensions/gsd/diff-context.ts +214 -0
- package/dist/resources/extensions/gsd/dispatch-guard.ts +81 -0
- package/dist/resources/extensions/gsd/doctor-checks.ts +612 -0
- package/dist/resources/extensions/gsd/doctor-environment.ts +497 -0
- package/dist/resources/extensions/gsd/doctor-format.ts +78 -0
- package/dist/resources/extensions/gsd/doctor-proactive.ts +292 -0
- package/dist/resources/extensions/gsd/doctor-providers.ts +343 -0
- package/dist/resources/extensions/gsd/doctor-types.ts +87 -0
- package/dist/resources/extensions/gsd/doctor.ts +722 -0
- package/dist/resources/extensions/gsd/error-utils.ts +6 -0
- package/dist/resources/extensions/gsd/{errors.js → errors.ts} +11 -6
- package/dist/resources/extensions/gsd/exit-command.ts +18 -0
- package/dist/resources/extensions/gsd/{export-html.js → export-html.ts} +614 -482
- package/dist/resources/extensions/gsd/export.ts +317 -0
- package/dist/resources/extensions/gsd/file-watcher.ts +97 -0
- package/dist/resources/extensions/gsd/files.ts +1058 -0
- package/dist/resources/extensions/gsd/forensics.ts +629 -0
- package/dist/resources/extensions/gsd/{git-constants.js → git-constants.ts} +5 -4
- package/dist/resources/extensions/gsd/git-self-heal.ts +127 -0
- package/dist/resources/extensions/gsd/git-service.ts +586 -0
- package/dist/resources/extensions/gsd/{gitignore.js → gitignore.ts} +125 -98
- package/dist/resources/extensions/gsd/gsd-db.ts +685 -0
- package/dist/resources/extensions/gsd/guided-flow-queue.ts +440 -0
- package/dist/resources/extensions/gsd/guided-flow.ts +1303 -0
- package/dist/resources/extensions/gsd/health-widget.ts +167 -0
- package/dist/resources/extensions/gsd/history.ts +143 -0
- package/dist/resources/extensions/gsd/index.ts +1401 -0
- package/dist/resources/extensions/gsd/init-wizard.ts +587 -0
- package/dist/resources/extensions/gsd/json-persistence.ts +67 -0
- package/dist/resources/extensions/gsd/{jsonl-utils.js → jsonl-utils.ts} +7 -10
- package/dist/resources/extensions/gsd/key-manager.ts +996 -0
- package/dist/resources/extensions/gsd/marketplace-discovery.ts +508 -0
- package/dist/resources/extensions/gsd/md-importer.ts +527 -0
- package/dist/resources/extensions/gsd/mechanical-completion.ts +430 -0
- package/dist/resources/extensions/gsd/memory-extractor.ts +352 -0
- package/dist/resources/extensions/gsd/memory-store.ts +441 -0
- package/dist/resources/extensions/gsd/metrics.ts +532 -0
- package/dist/resources/extensions/gsd/migrate/command.ts +219 -0
- package/dist/resources/extensions/gsd/migrate/index.ts +42 -0
- package/dist/resources/extensions/gsd/migrate/parser.ts +323 -0
- package/dist/resources/extensions/gsd/migrate/parsers.ts +539 -0
- package/dist/resources/extensions/gsd/migrate/preview.ts +48 -0
- package/dist/resources/extensions/gsd/migrate/transformer.ts +346 -0
- package/dist/resources/extensions/gsd/migrate/types.ts +370 -0
- package/dist/resources/extensions/gsd/migrate/validator.ts +55 -0
- package/dist/resources/extensions/gsd/migrate/writer.ts +579 -0
- package/dist/resources/extensions/gsd/migrate-external.ts +140 -0
- package/dist/resources/extensions/gsd/milestone-actions.ts +126 -0
- package/dist/resources/extensions/gsd/{milestone-ids.js → milestone-ids.ts} +63 -50
- package/dist/resources/extensions/gsd/model-cost-table.ts +65 -0
- package/dist/resources/extensions/gsd/model-router.ts +256 -0
- package/dist/resources/extensions/gsd/namespaced-registry.ts +467 -0
- package/dist/resources/extensions/gsd/namespaced-resolver.ts +307 -0
- package/dist/resources/extensions/gsd/native-git-bridge.ts +1041 -0
- package/dist/resources/extensions/gsd/native-parser-bridge.ts +267 -0
- package/dist/resources/extensions/gsd/notifications.ts +87 -0
- package/dist/resources/extensions/gsd/observability-validator.ts +429 -0
- package/dist/resources/extensions/gsd/parallel-eligibility.ts +233 -0
- package/dist/resources/extensions/gsd/parallel-merge.ts +157 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.ts +826 -0
- package/dist/resources/extensions/gsd/paths.ts +449 -0
- package/dist/resources/extensions/gsd/plugin-importer.ts +411 -0
- package/dist/resources/extensions/gsd/post-unit-hooks.ts +520 -0
- package/dist/resources/extensions/gsd/preferences-models.ts +329 -0
- package/dist/resources/extensions/gsd/preferences-skills.ts +169 -0
- package/dist/resources/extensions/gsd/preferences-types.ts +229 -0
- package/dist/resources/extensions/gsd/preferences-validation.ts +590 -0
- package/dist/resources/extensions/gsd/preferences.ts +416 -0
- package/dist/resources/extensions/gsd/progress-score.ts +273 -0
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.ts +213 -0
- package/dist/resources/extensions/gsd/prompt-compressor.ts +508 -0
- package/dist/resources/extensions/gsd/prompt-loader.ts +130 -0
- package/dist/resources/extensions/gsd/prompt-ordering.ts +200 -0
- package/dist/resources/extensions/gsd/provider-error-pause.ts +88 -0
- package/dist/resources/extensions/gsd/queue-order.ts +230 -0
- package/dist/resources/extensions/gsd/queue-reorder-ui.ts +276 -0
- package/dist/resources/extensions/gsd/quick.ts +212 -0
- package/dist/resources/extensions/gsd/repo-identity.ts +169 -0
- package/dist/resources/extensions/gsd/{reports.js → reports.ts} +241 -146
- package/dist/resources/extensions/gsd/{resource-version.js → resource-version.ts} +53 -50
- package/dist/resources/extensions/gsd/roadmap-slices.ts +149 -0
- package/dist/resources/extensions/gsd/routing-history.ts +286 -0
- package/dist/resources/extensions/gsd/safe-fs.ts +47 -0
- package/dist/resources/extensions/gsd/semantic-chunker.ts +336 -0
- package/dist/resources/extensions/gsd/session-forensics.ts +537 -0
- package/dist/resources/extensions/gsd/session-lock.ts +426 -0
- package/dist/resources/extensions/gsd/session-status-io.ts +179 -0
- package/dist/resources/extensions/gsd/skill-discovery.ts +139 -0
- package/dist/resources/extensions/gsd/skill-health.ts +417 -0
- package/dist/resources/extensions/gsd/{skill-telemetry.js → skill-telemetry.ts} +74 -58
- package/dist/resources/extensions/gsd/state.ts +727 -0
- package/dist/resources/extensions/gsd/structured-data-formatter.ts +144 -0
- package/dist/resources/extensions/gsd/summary-distiller.ts +258 -0
- package/dist/resources/extensions/gsd/tests/activity-log.test.ts +213 -0
- package/dist/resources/extensions/gsd/tests/agent-end-retry.test.ts +107 -0
- package/dist/resources/extensions/gsd/tests/all-milestones-complete-merge.test.ts +200 -0
- package/dist/resources/extensions/gsd/tests/auto-budget-alerts.test.ts +50 -0
- package/dist/resources/extensions/gsd/tests/auto-dashboard.test.ts +166 -0
- package/dist/resources/extensions/gsd/tests/auto-dispatch-loop.test.ts +691 -0
- package/dist/resources/extensions/gsd/tests/auto-lock-creation.test.ts +186 -0
- package/dist/resources/extensions/gsd/tests/auto-preflight.test.ts +40 -0
- package/dist/resources/extensions/gsd/tests/auto-recovery.test.ts +640 -0
- package/dist/resources/extensions/gsd/tests/auto-reentrancy-guard.test.ts +127 -0
- package/dist/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +302 -0
- package/dist/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +257 -0
- package/dist/resources/extensions/gsd/tests/auto-skip-loop.test.ts +123 -0
- package/dist/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +340 -0
- package/dist/resources/extensions/gsd/tests/auto-worktree.test.ts +167 -0
- package/dist/resources/extensions/gsd/tests/budget-prediction.test.ts +220 -0
- package/dist/resources/extensions/gsd/tests/cache-staleness-regression.test.ts +317 -0
- package/dist/resources/extensions/gsd/tests/captures.test.ts +438 -0
- package/dist/resources/extensions/gsd/tests/claude-import-tui.test.ts +351 -0
- package/dist/resources/extensions/gsd/tests/collect-from-manifest.test.ts +469 -0
- package/dist/resources/extensions/gsd/tests/collision-diagnostics.test.ts +705 -0
- package/dist/resources/extensions/gsd/tests/commands-logs.test.ts +241 -0
- package/dist/resources/extensions/gsd/tests/complete-milestone.test.ts +209 -0
- package/dist/resources/extensions/gsd/tests/complexity-classifier.test.ts +181 -0
- package/dist/resources/extensions/gsd/tests/context-budget.test.ts +352 -0
- package/dist/resources/extensions/gsd/tests/context-compression.test.ts +193 -0
- package/dist/resources/extensions/gsd/tests/context-store.test.ts +462 -0
- package/dist/resources/extensions/gsd/tests/continue-here.test.ts +285 -0
- package/dist/resources/extensions/gsd/tests/cost-projection.test.ts +134 -0
- package/dist/resources/extensions/gsd/tests/crash-recovery.test.ts +134 -0
- package/dist/resources/extensions/gsd/tests/dashboard-budget.test.ts +346 -0
- package/dist/resources/extensions/gsd/tests/db-writer.test.ts +602 -0
- package/dist/resources/extensions/gsd/tests/debug-logger.test.ts +185 -0
- package/dist/resources/extensions/gsd/tests/derive-state-db.test.ts +405 -0
- package/dist/resources/extensions/gsd/tests/derive-state-deps.test.ts +421 -0
- package/dist/resources/extensions/gsd/tests/derive-state-draft.test.ts +308 -0
- package/dist/resources/extensions/gsd/tests/derive-state.test.ts +788 -0
- package/dist/resources/extensions/gsd/tests/detection.test.ts +398 -0
- package/dist/resources/extensions/gsd/tests/diff-context.test.ts +136 -0
- package/dist/resources/extensions/gsd/tests/discuss-prompt.test.ts +15 -0
- package/dist/resources/extensions/gsd/tests/dispatch-guard.test.ts +128 -0
- package/dist/resources/extensions/gsd/tests/dispatch-missing-task-plans.test.ts +132 -0
- package/dist/resources/extensions/gsd/tests/dispatch-stall-guard.test.ts +126 -0
- package/dist/resources/extensions/gsd/tests/doctor-environment.test.ts +314 -0
- package/dist/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +245 -0
- package/dist/resources/extensions/gsd/tests/doctor-git.test.ts +344 -0
- package/dist/resources/extensions/gsd/tests/doctor-proactive.test.ts +278 -0
- package/dist/resources/extensions/gsd/tests/doctor-providers.test.ts +298 -0
- package/dist/resources/extensions/gsd/tests/doctor-runtime.test.ts +302 -0
- package/dist/resources/extensions/gsd/tests/doctor.test.ts +652 -0
- package/dist/resources/extensions/gsd/tests/draft-promotion.test.ts +169 -0
- package/dist/resources/extensions/gsd/tests/exit-command.test.ts +50 -0
- package/dist/resources/extensions/gsd/tests/export-html-all.test.ts +105 -0
- package/dist/resources/extensions/gsd/tests/export-html-enhancements.test.ts +378 -0
- package/dist/resources/extensions/gsd/tests/extension-selector-separator.test.ts +144 -0
- package/dist/resources/extensions/gsd/tests/feature-branch-lifecycle-integration.test.ts +424 -0
- package/dist/resources/extensions/gsd/tests/git-self-heal.test.ts +131 -0
- package/dist/resources/extensions/gsd/tests/git-service.test.ts +1181 -0
- package/dist/resources/extensions/gsd/tests/gsd-db.test.ts +353 -0
- package/dist/resources/extensions/gsd/tests/gsd-inspect.test.ts +125 -0
- package/dist/resources/extensions/gsd/tests/gsd-tools.test.ts +326 -0
- package/dist/resources/extensions/gsd/tests/headless-answers.test.ts +340 -0
- package/dist/resources/extensions/gsd/tests/headless-query.test.ts +162 -0
- package/dist/resources/extensions/gsd/tests/idle-recovery.test.ts +485 -0
- package/dist/resources/extensions/gsd/tests/in-flight-tool-tracking.test.ts +32 -0
- package/dist/resources/extensions/gsd/tests/init-wizard.test.ts +197 -0
- package/dist/resources/extensions/gsd/tests/integration/headless-command.ts +534 -0
- package/dist/resources/extensions/gsd/tests/integration-edge.test.ts +228 -0
- package/dist/resources/extensions/gsd/tests/integration-lifecycle.test.ts +277 -0
- package/dist/resources/extensions/gsd/tests/integration-mixed-milestones.test.ts +523 -0
- package/dist/resources/extensions/gsd/tests/key-manager.test.ts +414 -0
- package/dist/resources/extensions/gsd/tests/knowledge.test.ts +161 -0
- package/dist/resources/extensions/gsd/tests/loop-regression.test.ts +877 -0
- package/dist/resources/extensions/gsd/tests/manifest-status.test.ts +283 -0
- package/dist/resources/extensions/gsd/tests/marketplace-test-fixtures.ts +91 -0
- package/dist/resources/extensions/gsd/tests/md-importer.test.ts +410 -0
- package/dist/resources/extensions/gsd/tests/mechanical-completion.test.ts +356 -0
- package/dist/resources/extensions/gsd/tests/memory-extractor.test.ts +180 -0
- package/dist/resources/extensions/gsd/tests/memory-leak-guards.test.ts +91 -0
- package/dist/resources/extensions/gsd/tests/memory-store.test.ts +345 -0
- package/dist/resources/extensions/gsd/tests/metrics.test.ts +253 -0
- package/dist/resources/extensions/gsd/tests/migrate-command.test.ts +369 -0
- package/dist/resources/extensions/gsd/tests/migrate-parser.test.ts +757 -0
- package/dist/resources/extensions/gsd/tests/migrate-transformer.test.ts +635 -0
- package/dist/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +414 -0
- package/dist/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +303 -0
- package/dist/resources/extensions/gsd/tests/migrate-writer.test.ts +398 -0
- package/dist/resources/extensions/gsd/tests/milestone-transition-worktree.test.ts +147 -0
- package/dist/resources/extensions/gsd/tests/model-cost-table.test.ts +69 -0
- package/dist/resources/extensions/gsd/tests/model-isolation.test.ts +157 -0
- package/dist/resources/extensions/gsd/tests/model-router.test.ts +167 -0
- package/dist/resources/extensions/gsd/tests/must-have-parser.test.ts +291 -0
- package/dist/resources/extensions/gsd/tests/namespaced-registry.test.ts +1027 -0
- package/dist/resources/extensions/gsd/tests/namespaced-resolver.test.ts +671 -0
- package/dist/resources/extensions/gsd/tests/native-has-changes-cache.test.ts +61 -0
- package/dist/resources/extensions/gsd/tests/next-milestone-id.test.ts +23 -0
- package/dist/resources/extensions/gsd/tests/none-mode-gates.test.ts +114 -0
- package/dist/resources/extensions/gsd/tests/notifications.test.ts +67 -0
- package/dist/resources/extensions/gsd/tests/overrides.test.ts +131 -0
- package/dist/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +331 -0
- package/dist/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +298 -0
- package/dist/resources/extensions/gsd/tests/parallel-merge.test.ts +468 -0
- package/dist/resources/extensions/gsd/tests/parallel-orchestration.test.ts +685 -0
- package/dist/resources/extensions/gsd/tests/parallel-worker-monitoring.test.ts +171 -0
- package/dist/resources/extensions/gsd/tests/parallel-workers-multi-milestone-e2e.test.ts +354 -0
- package/dist/resources/extensions/gsd/tests/park-edge-cases.test.ts +276 -0
- package/dist/resources/extensions/gsd/tests/park-milestone.test.ts +401 -0
- package/dist/resources/extensions/gsd/tests/parsers.test.ts +1704 -0
- package/dist/resources/extensions/gsd/tests/plan-milestone.test.ts +133 -0
- package/dist/resources/extensions/gsd/tests/plan-quality-validator.test.ts +363 -0
- package/dist/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +42 -0
- package/dist/resources/extensions/gsd/tests/plugin-importer-live.test.ts +481 -0
- package/dist/resources/extensions/gsd/tests/plugin-importer.test.ts +1383 -0
- package/dist/resources/extensions/gsd/tests/post-unit-hooks.test.ts +337 -0
- package/dist/resources/extensions/gsd/tests/preferences.test.ts +276 -0
- package/dist/resources/extensions/gsd/tests/progress-score.test.ts +206 -0
- package/dist/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +464 -0
- package/dist/resources/extensions/gsd/tests/prompt-cache-optimizer.test.ts +314 -0
- package/dist/resources/extensions/gsd/tests/prompt-compressor.test.ts +529 -0
- package/dist/resources/extensions/gsd/tests/prompt-db.test.ts +385 -0
- package/dist/resources/extensions/gsd/tests/prompt-ordering.test.ts +296 -0
- package/dist/resources/extensions/gsd/tests/provider-errors.test.ts +338 -0
- package/dist/resources/extensions/gsd/tests/queue-draft-detection.test.ts +126 -0
- package/dist/resources/extensions/gsd/tests/queue-order.test.ts +204 -0
- package/dist/resources/extensions/gsd/tests/queue-reorder-e2e.test.ts +282 -0
- package/dist/resources/extensions/gsd/tests/reassess-detection.test.ts +154 -0
- package/dist/resources/extensions/gsd/tests/reassess-prompt.test.ts +145 -0
- package/dist/resources/extensions/gsd/tests/regex-hardening.test.ts +281 -0
- package/dist/resources/extensions/gsd/tests/remote-questions.test.ts +642 -0
- package/dist/resources/extensions/gsd/tests/remote-status.test.ts +99 -0
- package/dist/resources/extensions/gsd/tests/replan-slice.test.ts +538 -0
- package/dist/resources/extensions/gsd/tests/requirements.test.ts +106 -0
- package/dist/resources/extensions/gsd/tests/roadmap-parse-regression.test.ts +358 -0
- package/dist/resources/extensions/gsd/tests/roadmap-slices.test.ts +66 -0
- package/dist/resources/extensions/gsd/tests/routing-history.test.ts +240 -0
- package/dist/resources/extensions/gsd/tests/run-uat.test.ts +416 -0
- package/dist/resources/extensions/gsd/tests/secure-env-collect.test.ts +185 -0
- package/dist/resources/extensions/gsd/tests/semantic-chunker.test.ts +426 -0
- package/dist/resources/extensions/gsd/tests/session-lock-regression.test.ts +216 -0
- package/dist/resources/extensions/gsd/tests/session-lock.test.ts +434 -0
- package/dist/resources/extensions/gsd/tests/skill-lifecycle.test.ts +126 -0
- package/dist/resources/extensions/gsd/tests/smart-entry-draft.test.ts +123 -0
- package/dist/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +142 -0
- package/dist/resources/extensions/gsd/tests/stop-auto-remote.test.ts +156 -0
- package/dist/resources/extensions/gsd/tests/structured-data-formatter.test.ts +365 -0
- package/dist/resources/extensions/gsd/tests/summary-distiller.test.ts +323 -0
- package/dist/resources/extensions/gsd/tests/test-helpers.ts +61 -0
- package/dist/resources/extensions/gsd/tests/token-counter.test.ts +129 -0
- package/dist/resources/extensions/gsd/tests/token-optimization-benchmark.test.ts +1272 -0
- package/dist/resources/extensions/gsd/tests/token-optimization-prefs.test.ts +164 -0
- package/dist/resources/extensions/gsd/tests/token-profile.test.ts +268 -0
- package/dist/resources/extensions/gsd/tests/token-savings.test.ts +366 -0
- package/dist/resources/extensions/gsd/tests/triage-dispatch.test.ts +340 -0
- package/dist/resources/extensions/gsd/tests/triage-resolution.test.ts +416 -0
- package/dist/resources/extensions/gsd/tests/undo.test.ts +136 -0
- package/dist/resources/extensions/gsd/tests/unique-milestone-ids.test.ts +219 -0
- package/dist/resources/extensions/gsd/tests/unit-runtime.test.ts +258 -0
- package/dist/resources/extensions/gsd/tests/update-command.test.ts +67 -0
- package/dist/resources/extensions/gsd/tests/validate-directory.test.ts +222 -0
- package/dist/resources/extensions/gsd/tests/validate-milestone.test.ts +375 -0
- package/dist/resources/extensions/gsd/tests/verification-evidence.test.ts +745 -0
- package/dist/resources/extensions/gsd/tests/verification-gate.test.ts +1208 -0
- package/dist/resources/extensions/gsd/tests/visualizer-critical-path.test.ts +145 -0
- package/dist/resources/extensions/gsd/tests/visualizer-data.test.ts +446 -0
- package/dist/resources/extensions/gsd/tests/visualizer-overlay.test.ts +237 -0
- package/dist/resources/extensions/gsd/tests/visualizer-views.test.ts +718 -0
- package/dist/resources/extensions/gsd/tests/worker-registry.test.ts +148 -0
- package/dist/resources/extensions/gsd/tests/workflow-templates.test.ts +173 -0
- package/dist/resources/extensions/gsd/tests/workspace-index.test.ts +38 -0
- package/dist/resources/extensions/gsd/tests/worktree-bugfix.test.ts +120 -0
- package/dist/resources/extensions/gsd/tests/worktree-e2e.test.ts +244 -0
- package/dist/resources/extensions/gsd/tests/worktree-integration.test.ts +207 -0
- package/dist/resources/extensions/gsd/tests/worktree-manager.test.ts +141 -0
- package/dist/resources/extensions/gsd/tests/worktree-post-create-hook.test.ts +165 -0
- package/dist/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +206 -0
- package/dist/resources/extensions/gsd/tests/worktree.test.ts +171 -0
- package/dist/resources/extensions/gsd/tests/write-gate.test.ts +211 -0
- package/dist/resources/extensions/gsd/token-counter.ts +65 -0
- package/dist/resources/extensions/gsd/triage-resolution.ts +284 -0
- package/dist/resources/extensions/gsd/triage-ui.ts +175 -0
- package/dist/resources/extensions/gsd/types.ts +425 -0
- package/dist/resources/extensions/gsd/undo.ts +223 -0
- package/dist/resources/extensions/gsd/unit-id.ts +14 -0
- package/dist/resources/extensions/gsd/unit-runtime.ts +192 -0
- package/dist/resources/extensions/gsd/validate-directory.ts +164 -0
- package/dist/resources/extensions/gsd/verification-evidence.ts +188 -0
- package/dist/resources/extensions/gsd/verification-gate.ts +643 -0
- package/dist/resources/extensions/gsd/visualizer-data.ts +866 -0
- package/dist/resources/extensions/gsd/visualizer-overlay.ts +566 -0
- package/dist/resources/extensions/gsd/visualizer-views.ts +1171 -0
- package/dist/resources/extensions/gsd/workflow-templates.ts +241 -0
- package/dist/resources/extensions/gsd/workspace-index.ts +217 -0
- package/dist/resources/extensions/gsd/worktree-command.ts +807 -0
- package/dist/resources/extensions/gsd/worktree-manager.ts +449 -0
- package/dist/resources/extensions/gsd/worktree.ts +257 -0
- package/dist/resources/extensions/mac-tools/index.ts +852 -0
- package/dist/resources/extensions/mcp-client/index.ts +459 -0
- package/dist/resources/extensions/remote-questions/config.ts +83 -0
- package/dist/resources/extensions/remote-questions/discord-adapter.ts +148 -0
- package/dist/resources/extensions/remote-questions/format.ts +315 -0
- package/dist/resources/extensions/remote-questions/http-client.ts +76 -0
- package/dist/resources/extensions/remote-questions/manager.ts +184 -0
- package/dist/resources/extensions/remote-questions/{mod.js → mod.ts} +10 -1
- package/dist/resources/extensions/remote-questions/notify.ts +90 -0
- package/dist/resources/extensions/remote-questions/remote-command.ts +457 -0
- package/dist/resources/extensions/remote-questions/slack-adapter.ts +141 -0
- package/dist/resources/extensions/remote-questions/status.ts +31 -0
- package/dist/resources/extensions/remote-questions/store.ts +81 -0
- package/dist/resources/extensions/remote-questions/telegram-adapter.ts +149 -0
- package/dist/resources/extensions/remote-questions/types.ts +102 -0
- package/dist/resources/extensions/search-the-web/cache.ts +78 -0
- package/dist/resources/extensions/search-the-web/command-search-provider.ts +101 -0
- package/dist/resources/extensions/search-the-web/format.ts +258 -0
- package/dist/resources/extensions/search-the-web/http.ts +238 -0
- package/dist/resources/extensions/search-the-web/index.ts +65 -0
- package/dist/resources/extensions/search-the-web/native-search.ts +193 -0
- package/dist/resources/extensions/search-the-web/provider.ts +148 -0
- package/dist/resources/extensions/search-the-web/tavily.ts +116 -0
- package/dist/resources/extensions/search-the-web/tool-fetch-page.ts +589 -0
- package/dist/resources/extensions/search-the-web/tool-llm-context.ts +608 -0
- package/dist/resources/extensions/search-the-web/tool-search.ts +649 -0
- package/dist/resources/extensions/search-the-web/url-utils.ts +125 -0
- package/dist/resources/extensions/shared/confirm-ui.ts +126 -0
- package/dist/resources/extensions/shared/{format-utils.js → format-utils.ts} +91 -85
- package/dist/resources/extensions/shared/frontmatter.ts +117 -0
- package/dist/resources/extensions/shared/interview-ui.ts +613 -0
- package/dist/resources/extensions/shared/{mod.js → mod.ts} +24 -2
- package/dist/resources/extensions/shared/next-action-ui.ts +212 -0
- package/dist/resources/extensions/shared/{path-display.js → path-display.ts} +3 -2
- package/dist/resources/extensions/shared/sanitize.ts +19 -0
- package/dist/resources/extensions/shared/terminal.ts +23 -0
- package/dist/resources/extensions/shared/tests/format-utils.test.ts +153 -0
- package/dist/resources/extensions/shared/ui.ts +400 -0
- package/dist/resources/extensions/shared/wizard-ui.ts +551 -0
- package/dist/resources/extensions/slash-commands/audit.ts +88 -0
- package/dist/resources/extensions/slash-commands/clear.ts +10 -0
- package/dist/resources/extensions/slash-commands/create-extension.ts +297 -0
- package/dist/resources/extensions/slash-commands/create-slash-command.ts +234 -0
- package/dist/resources/extensions/slash-commands/index.ts +12 -0
- package/dist/resources/extensions/subagent/agents.ts +126 -0
- package/dist/resources/extensions/subagent/index.ts +1121 -0
- package/dist/resources/extensions/subagent/isolation.ts +501 -0
- package/dist/resources/extensions/subagent/worker-registry.ts +99 -0
- package/dist/resources/extensions/ttsr/index.ts +168 -0
- package/dist/resources/extensions/ttsr/rule-loader.ts +74 -0
- package/dist/resources/extensions/ttsr/ttsr-manager.ts +456 -0
- package/dist/resources/extensions/universal-config/discovery.ts +104 -0
- package/dist/resources/extensions/universal-config/format.ts +191 -0
- package/dist/resources/extensions/universal-config/index.ts +120 -0
- package/dist/resources/extensions/universal-config/scanners.ts +642 -0
- package/dist/resources/extensions/universal-config/tests/discovery.test.ts +119 -0
- package/dist/resources/extensions/universal-config/tests/format.test.ts +127 -0
- package/dist/resources/extensions/universal-config/tests/scanners.test.ts +456 -0
- package/dist/resources/extensions/universal-config/tools.ts +60 -0
- package/dist/resources/extensions/universal-config/types.ts +135 -0
- package/dist/resources/extensions/voice/index.ts +272 -0
- package/dist/resources/skills/create-gsd-extension/templates/extension-skeleton.ts +51 -0
- package/dist/resources/skills/create-gsd-extension/templates/stateful-tool-skeleton.ts +143 -0
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +0 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +4 -31
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts +1 -1
- package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/index.js +1 -1
- package/packages/pi-coding-agent/dist/index.js.map +1 -1
- package/packages/pi-coding-agent/src/core/extensions/index.ts +0 -1
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +4 -35
- package/packages/pi-coding-agent/src/index.ts +0 -1
- package/src/resources/extensions/bg-shell/index.ts +46 -41
- package/src/resources/extensions/browser-tools/index.ts +67 -156
- package/src/resources/extensions/gsd/auto-verification.ts +2 -20
- package/src/resources/extensions/gsd/auto-worktree.ts +2 -3
- package/src/resources/extensions/gsd/commands.ts +31 -39
- package/src/resources/extensions/gsd/git-service.ts +0 -7
- package/src/resources/extensions/gsd/index.ts +32 -93
- package/src/resources/extensions/gsd/quick.ts +3 -52
- package/src/resources/extensions/gsd/repo-identity.ts +22 -56
- package/src/resources/extensions/gsd/tests/loop-regression.test.ts +4 -1
- package/src/resources/extensions/gsd/tests/verification-gate.test.ts +0 -65
- package/src/resources/extensions/gsd/types.ts +0 -4
- package/src/resources/extensions/gsd/verification-evidence.ts +1 -1
- package/src/resources/extensions/gsd/verification-gate.ts +2 -23
- package/src/resources/extensions/gsd/worktree-command.ts +11 -17
- package/src/resources/extensions/search-the-web/command-search-provider.ts +1 -1
- package/src/resources/extensions/search-the-web/index.ts +52 -35
- package/src/resources/extensions/search-the-web/tavily.ts +1 -1
- package/dist/resources/extensions/ask-user-questions.js +0 -217
- package/dist/resources/extensions/async-jobs/async-bash-tool.js +0 -180
- package/dist/resources/extensions/async-jobs/await-tool.js +0 -90
- package/dist/resources/extensions/async-jobs/cancel-job-tool.js +0 -28
- package/dist/resources/extensions/async-jobs/index.js +0 -119
- package/dist/resources/extensions/async-jobs/job-manager.js +0 -159
- package/dist/resources/extensions/aws-auth/index.js +0 -138
- package/dist/resources/extensions/bg-shell/bg-shell-command.js +0 -182
- package/dist/resources/extensions/bg-shell/bg-shell-lifecycle.js +0 -343
- package/dist/resources/extensions/bg-shell/bg-shell-tool.js +0 -831
- package/dist/resources/extensions/bg-shell/index.js +0 -41
- package/dist/resources/extensions/bg-shell/interaction.js +0 -160
- package/dist/resources/extensions/bg-shell/output-formatter.js +0 -245
- package/dist/resources/extensions/bg-shell/overlay.js +0 -378
- package/dist/resources/extensions/bg-shell/process-manager.js +0 -413
- package/dist/resources/extensions/bg-shell/readiness-detector.js +0 -109
- package/dist/resources/extensions/bg-shell/types.js +0 -96
- package/dist/resources/extensions/bg-shell/utilities.js +0 -50
- package/dist/resources/extensions/browser-tools/capture.js +0 -179
- package/dist/resources/extensions/browser-tools/core.js +0 -899
- package/dist/resources/extensions/browser-tools/index.js +0 -123
- package/dist/resources/extensions/browser-tools/lifecycle.js +0 -222
- package/dist/resources/extensions/browser-tools/refs.js +0 -254
- package/dist/resources/extensions/browser-tools/settle.js +0 -173
- package/dist/resources/extensions/browser-tools/state.js +0 -126
- package/dist/resources/extensions/browser-tools/tools/action-cache.js +0 -179
- package/dist/resources/extensions/browser-tools/tools/assertions.js +0 -320
- package/dist/resources/extensions/browser-tools/tools/codegen.js +0 -242
- package/dist/resources/extensions/browser-tools/tools/device.js +0 -162
- package/dist/resources/extensions/browser-tools/tools/extract.js +0 -191
- package/dist/resources/extensions/browser-tools/tools/forms.js +0 -710
- package/dist/resources/extensions/browser-tools/tools/injection-detect.js +0 -178
- package/dist/resources/extensions/browser-tools/tools/inspection.js +0 -426
- package/dist/resources/extensions/browser-tools/tools/intent.js +0 -556
- package/dist/resources/extensions/browser-tools/tools/interaction.js +0 -776
- package/dist/resources/extensions/browser-tools/tools/navigation.js +0 -208
- package/dist/resources/extensions/browser-tools/tools/network-mock.js +0 -194
- package/dist/resources/extensions/browser-tools/tools/pages.js +0 -280
- package/dist/resources/extensions/browser-tools/tools/pdf.js +0 -74
- package/dist/resources/extensions/browser-tools/tools/refs.js +0 -485
- package/dist/resources/extensions/browser-tools/tools/screenshot.js +0 -87
- package/dist/resources/extensions/browser-tools/tools/session.js +0 -375
- package/dist/resources/extensions/browser-tools/tools/state-persistence.js +0 -180
- package/dist/resources/extensions/browser-tools/tools/visual-diff.js +0 -174
- package/dist/resources/extensions/browser-tools/tools/wait.js +0 -201
- package/dist/resources/extensions/browser-tools/tools/zoom.js +0 -90
- package/dist/resources/extensions/browser-tools/utils.js +0 -490
- package/dist/resources/extensions/context7/index.js +0 -337
- package/dist/resources/extensions/get-secrets-from-user.js +0 -492
- package/dist/resources/extensions/google-search/index.js +0 -373
- package/dist/resources/extensions/gsd/activity-log.js +0 -146
- package/dist/resources/extensions/gsd/atomic-write.js +0 -38
- package/dist/resources/extensions/gsd/auto/session.js +0 -187
- package/dist/resources/extensions/gsd/auto-budget.js +0 -30
- package/dist/resources/extensions/gsd/auto-dashboard.js +0 -509
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +0 -180
- package/dist/resources/extensions/gsd/auto-dispatch.js +0 -382
- package/dist/resources/extensions/gsd/auto-idempotency.js +0 -106
- package/dist/resources/extensions/gsd/auto-model-selection.js +0 -133
- package/dist/resources/extensions/gsd/auto-observability.js +0 -54
- package/dist/resources/extensions/gsd/auto-post-unit.js +0 -495
- package/dist/resources/extensions/gsd/auto-prompts.js +0 -1121
- package/dist/resources/extensions/gsd/auto-recovery.js +0 -550
- package/dist/resources/extensions/gsd/auto-start.js +0 -393
- package/dist/resources/extensions/gsd/auto-stuck-detection.js +0 -165
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +0 -183
- package/dist/resources/extensions/gsd/auto-timers.js +0 -181
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +0 -50
- package/dist/resources/extensions/gsd/auto-unit-closeout.js +0 -30
- package/dist/resources/extensions/gsd/auto-verification.js +0 -209
- package/dist/resources/extensions/gsd/auto-worktree.js +0 -594
- package/dist/resources/extensions/gsd/auto.js +0 -1485
- package/dist/resources/extensions/gsd/captures.js +0 -348
- package/dist/resources/extensions/gsd/claude-import.js +0 -540
- package/dist/resources/extensions/gsd/collision-diagnostics.js +0 -226
- package/dist/resources/extensions/gsd/commands-bootstrap.js +0 -223
- package/dist/resources/extensions/gsd/commands-config.js +0 -89
- package/dist/resources/extensions/gsd/commands-extensions.js +0 -259
- package/dist/resources/extensions/gsd/commands-handlers.js +0 -310
- package/dist/resources/extensions/gsd/commands-inspect.js +0 -70
- package/dist/resources/extensions/gsd/commands-logs.js +0 -468
- package/dist/resources/extensions/gsd/commands-maintenance.js +0 -185
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +0 -660
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +0 -408
- package/dist/resources/extensions/gsd/commands.js +0 -1024
- package/dist/resources/extensions/gsd/complexity-classifier.js +0 -257
- package/dist/resources/extensions/gsd/context-budget.js +0 -187
- package/dist/resources/extensions/gsd/context-store.js +0 -165
- package/dist/resources/extensions/gsd/crash-recovery.js +0 -110
- package/dist/resources/extensions/gsd/dashboard-overlay.js +0 -562
- package/dist/resources/extensions/gsd/db-writer.js +0 -298
- package/dist/resources/extensions/gsd/debug-logger.js +0 -161
- package/dist/resources/extensions/gsd/detection.js +0 -373
- package/dist/resources/extensions/gsd/diff-context.js +0 -168
- package/dist/resources/extensions/gsd/dispatch-guard.js +0 -76
- package/dist/resources/extensions/gsd/doctor-checks.js +0 -563
- package/dist/resources/extensions/gsd/doctor-environment.js +0 -429
- package/dist/resources/extensions/gsd/doctor-format.js +0 -71
- package/dist/resources/extensions/gsd/doctor-proactive.js +0 -239
- package/dist/resources/extensions/gsd/doctor-providers.js +0 -292
- package/dist/resources/extensions/gsd/doctor-types.js +0 -12
- package/dist/resources/extensions/gsd/doctor.js +0 -672
- package/dist/resources/extensions/gsd/error-utils.js +0 -6
- package/dist/resources/extensions/gsd/exit-command.js +0 -11
- package/dist/resources/extensions/gsd/export.js +0 -268
- package/dist/resources/extensions/gsd/file-watcher.js +0 -76
- package/dist/resources/extensions/gsd/files.js +0 -937
- package/dist/resources/extensions/gsd/forensics.js +0 -511
- package/dist/resources/extensions/gsd/git-self-heal.js +0 -113
- package/dist/resources/extensions/gsd/git-service.js +0 -460
- package/dist/resources/extensions/gsd/gsd-db.js +0 -590
- package/dist/resources/extensions/gsd/guided-flow-queue.js +0 -366
- package/dist/resources/extensions/gsd/guided-flow.js +0 -1149
- package/dist/resources/extensions/gsd/health-widget.js +0 -141
- package/dist/resources/extensions/gsd/history.js +0 -118
- package/dist/resources/extensions/gsd/index.js +0 -1250
- package/dist/resources/extensions/gsd/init-wizard.js +0 -479
- package/dist/resources/extensions/gsd/json-persistence.js +0 -62
- package/dist/resources/extensions/gsd/key-manager.js +0 -829
- package/dist/resources/extensions/gsd/marketplace-discovery.js +0 -356
- package/dist/resources/extensions/gsd/md-importer.js +0 -440
- package/dist/resources/extensions/gsd/mechanical-completion.js +0 -351
- package/dist/resources/extensions/gsd/memory-extractor.js +0 -295
- package/dist/resources/extensions/gsd/memory-store.js +0 -351
- package/dist/resources/extensions/gsd/metrics.js +0 -377
- package/dist/resources/extensions/gsd/migrate/command.js +0 -157
- package/dist/resources/extensions/gsd/migrate/index.js +0 -7
- package/dist/resources/extensions/gsd/migrate/parser.js +0 -268
- package/dist/resources/extensions/gsd/migrate/parsers.js +0 -477
- package/dist/resources/extensions/gsd/migrate/preview.js +0 -47
- package/dist/resources/extensions/gsd/migrate/transformer.js +0 -278
- package/dist/resources/extensions/gsd/migrate/types.js +0 -4
- package/dist/resources/extensions/gsd/migrate/validator.js +0 -41
- package/dist/resources/extensions/gsd/migrate/writer.js +0 -477
- package/dist/resources/extensions/gsd/migrate-external.js +0 -130
- package/dist/resources/extensions/gsd/milestone-actions.js +0 -111
- package/dist/resources/extensions/gsd/model-cost-table.js +0 -48
- package/dist/resources/extensions/gsd/model-router.js +0 -187
- package/dist/resources/extensions/gsd/namespaced-registry.js +0 -322
- package/dist/resources/extensions/gsd/namespaced-resolver.js +0 -176
- package/dist/resources/extensions/gsd/native-git-bridge.js +0 -842
- package/dist/resources/extensions/gsd/native-parser-bridge.js +0 -156
- package/dist/resources/extensions/gsd/notifications.js +0 -58
- package/dist/resources/extensions/gsd/observability-validator.js +0 -398
- package/dist/resources/extensions/gsd/parallel-eligibility.js +0 -182
- package/dist/resources/extensions/gsd/parallel-merge.js +0 -121
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +0 -687
- package/dist/resources/extensions/gsd/paths.js +0 -414
- package/dist/resources/extensions/gsd/plugin-importer.js +0 -254
- package/dist/resources/extensions/gsd/post-unit-hooks.js +0 -433
- package/dist/resources/extensions/gsd/preferences-models.js +0 -294
- package/dist/resources/extensions/gsd/preferences-skills.js +0 -154
- package/dist/resources/extensions/gsd/preferences-types.js +0 -73
- package/dist/resources/extensions/gsd/preferences-validation.js +0 -607
- package/dist/resources/extensions/gsd/preferences.js +0 -325
- package/dist/resources/extensions/gsd/progress-score.js +0 -197
- package/dist/resources/extensions/gsd/prompt-cache-optimizer.js +0 -150
- package/dist/resources/extensions/gsd/prompt-compressor.js +0 -393
- package/dist/resources/extensions/gsd/prompt-loader.js +0 -119
- package/dist/resources/extensions/gsd/prompt-ordering.js +0 -170
- package/dist/resources/extensions/gsd/provider-error-pause.js +0 -60
- package/dist/resources/extensions/gsd/queue-order.js +0 -178
- package/dist/resources/extensions/gsd/queue-reorder-ui.js +0 -234
- package/dist/resources/extensions/gsd/quick.js +0 -230
- package/dist/resources/extensions/gsd/repo-identity.js +0 -187
- package/dist/resources/extensions/gsd/roadmap-slices.js +0 -130
- package/dist/resources/extensions/gsd/routing-history.js +0 -210
- package/dist/resources/extensions/gsd/safe-fs.js +0 -52
- package/dist/resources/extensions/gsd/semantic-chunker.js +0 -254
- package/dist/resources/extensions/gsd/session-forensics.js +0 -427
- package/dist/resources/extensions/gsd/session-lock.js +0 -376
- package/dist/resources/extensions/gsd/session-status-io.js +0 -134
- package/dist/resources/extensions/gsd/skill-discovery.js +0 -121
- package/dist/resources/extensions/gsd/skill-health.js +0 -324
- package/dist/resources/extensions/gsd/state.js +0 -653
- package/dist/resources/extensions/gsd/structured-data-formatter.js +0 -97
- package/dist/resources/extensions/gsd/summary-distiller.js +0 -212
- package/dist/resources/extensions/gsd/token-counter.js +0 -54
- package/dist/resources/extensions/gsd/triage-resolution.js +0 -217
- package/dist/resources/extensions/gsd/triage-ui.js +0 -125
- package/dist/resources/extensions/gsd/types.js +0 -4
- package/dist/resources/extensions/gsd/undo.js +0 -210
- package/dist/resources/extensions/gsd/unit-id.js +0 -7
- package/dist/resources/extensions/gsd/unit-runtime.js +0 -130
- package/dist/resources/extensions/gsd/validate-directory.js +0 -143
- package/dist/resources/extensions/gsd/verification-evidence.js +0 -123
- package/dist/resources/extensions/gsd/verification-gate.js +0 -543
- package/dist/resources/extensions/gsd/visualizer-data.js +0 -612
- package/dist/resources/extensions/gsd/visualizer-overlay.js +0 -501
- package/dist/resources/extensions/gsd/visualizer-views.js +0 -893
- package/dist/resources/extensions/gsd/workflow-templates.js +0 -188
- package/dist/resources/extensions/gsd/workspace-index.js +0 -139
- package/dist/resources/extensions/gsd/worktree-command-bootstrap.js +0 -40
- package/dist/resources/extensions/gsd/worktree-command.js +0 -676
- package/dist/resources/extensions/gsd/worktree-manager.js +0 -359
- package/dist/resources/extensions/gsd/worktree.js +0 -236
- package/dist/resources/extensions/mac-tools/index.js +0 -768
- package/dist/resources/extensions/mcp-client/index.js +0 -363
- package/dist/resources/extensions/package.json +0 -3
- package/dist/resources/extensions/remote-questions/config.js +0 -70
- package/dist/resources/extensions/remote-questions/discord-adapter.js +0 -134
- package/dist/resources/extensions/remote-questions/format.js +0 -234
- package/dist/resources/extensions/remote-questions/http-client.js +0 -43
- package/dist/resources/extensions/remote-questions/manager.js +0 -156
- package/dist/resources/extensions/remote-questions/notify.js +0 -89
- package/dist/resources/extensions/remote-questions/remote-command.js +0 -453
- package/dist/resources/extensions/remote-questions/slack-adapter.js +0 -123
- package/dist/resources/extensions/remote-questions/status.js +0 -25
- package/dist/resources/extensions/remote-questions/store.js +0 -70
- package/dist/resources/extensions/remote-questions/telegram-adapter.js +0 -123
- package/dist/resources/extensions/remote-questions/types.js +0 -5
- package/dist/resources/extensions/search-the-web/cache.js +0 -74
- package/dist/resources/extensions/search-the-web/command-search-provider.js +0 -79
- package/dist/resources/extensions/search-the-web/format.js +0 -161
- package/dist/resources/extensions/search-the-web/http.js +0 -178
- package/dist/resources/extensions/search-the-web/index.js +0 -41
- package/dist/resources/extensions/search-the-web/native-search.js +0 -166
- package/dist/resources/extensions/search-the-web/provider.js +0 -143
- package/dist/resources/extensions/search-the-web/tavily.js +0 -82
- package/dist/resources/extensions/search-the-web/tool-fetch-page.js +0 -452
- package/dist/resources/extensions/search-the-web/tool-llm-context.js +0 -455
- package/dist/resources/extensions/search-the-web/tool-search.js +0 -482
- package/dist/resources/extensions/search-the-web/url-utils.js +0 -121
- package/dist/resources/extensions/shared/confirm-ui.js +0 -96
- package/dist/resources/extensions/shared/frontmatter.js +0 -109
- package/dist/resources/extensions/shared/interview-ui.js +0 -569
- package/dist/resources/extensions/shared/next-action-ui.js +0 -168
- package/dist/resources/extensions/shared/sanitize.js +0 -17
- package/dist/resources/extensions/shared/terminal.js +0 -21
- package/dist/resources/extensions/shared/ui.js +0 -245
- package/dist/resources/extensions/shared/wizard-ui.js +0 -478
- package/dist/resources/extensions/slash-commands/audit.js +0 -72
- package/dist/resources/extensions/slash-commands/clear.js +0 -8
- package/dist/resources/extensions/slash-commands/create-extension.js +0 -264
- package/dist/resources/extensions/slash-commands/create-slash-command.js +0 -208
- package/dist/resources/extensions/slash-commands/index.js +0 -10
- package/dist/resources/extensions/subagent/agents.js +0 -103
- package/dist/resources/extensions/subagent/index.js +0 -905
- package/dist/resources/extensions/subagent/isolation.js +0 -384
- package/dist/resources/extensions/subagent/worker-registry.js +0 -73
- package/dist/resources/extensions/ttsr/index.js +0 -144
- package/dist/resources/extensions/ttsr/rule-loader.js +0 -70
- package/dist/resources/extensions/ttsr/ttsr-manager.js +0 -380
- package/dist/resources/extensions/universal-config/discovery.js +0 -94
- package/dist/resources/extensions/universal-config/format.js +0 -178
- package/dist/resources/extensions/universal-config/index.js +0 -99
- package/dist/resources/extensions/universal-config/scanners.js +0 -574
- package/dist/resources/extensions/universal-config/tools.js +0 -57
- package/dist/resources/extensions/universal-config/types.js +0 -8
- package/dist/resources/extensions/voice/index.js +0 -247
- package/dist/startup-timings.d.ts +0 -2
- package/dist/startup-timings.js +0 -22
- package/src/resources/extensions/gsd/commands-bootstrap.ts +0 -252
- package/src/resources/extensions/gsd/tests/quick-branch-lifecycle.test.ts +0 -281
- package/src/resources/extensions/gsd/tests/repo-identity-worktree.test.ts +0 -71
- package/src/resources/extensions/gsd/worktree-command-bootstrap.ts +0 -46
- package/src/resources/extensions/package.json +0 -3
|
@@ -0,0 +1,1196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-neutral helper logic for browser-tools.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of pi-specific imports so it can be exercised with node:test.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Interfaces & Types
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
export interface ActionTimeline {
|
|
12
|
+
limit: number;
|
|
13
|
+
nextId: number;
|
|
14
|
+
entries: ActionEntry[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ActionEntry {
|
|
18
|
+
id: number;
|
|
19
|
+
tool: string;
|
|
20
|
+
paramsSummary: string;
|
|
21
|
+
startedAt: number;
|
|
22
|
+
finishedAt: number | null;
|
|
23
|
+
status: string;
|
|
24
|
+
beforeUrl: string;
|
|
25
|
+
afterUrl: string;
|
|
26
|
+
verificationSummary?: string;
|
|
27
|
+
warningSummary?: string;
|
|
28
|
+
diffSummary?: string;
|
|
29
|
+
changed?: boolean;
|
|
30
|
+
error?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ActionPartial {
|
|
34
|
+
tool: string;
|
|
35
|
+
paramsSummary?: string;
|
|
36
|
+
startedAt?: number;
|
|
37
|
+
beforeUrl?: string;
|
|
38
|
+
afterUrl?: string;
|
|
39
|
+
verificationSummary?: string;
|
|
40
|
+
warningSummary?: string;
|
|
41
|
+
diffSummary?: string;
|
|
42
|
+
changed?: boolean;
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ActionUpdates {
|
|
47
|
+
finishedAt?: number;
|
|
48
|
+
status?: string;
|
|
49
|
+
afterUrl?: string;
|
|
50
|
+
verificationSummary?: string;
|
|
51
|
+
warningSummary?: string;
|
|
52
|
+
diffSummary?: string;
|
|
53
|
+
changed?: boolean;
|
|
54
|
+
error?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface DiffResult {
|
|
58
|
+
changed: boolean;
|
|
59
|
+
changes: Array<{ type: string; before: unknown; after: unknown }>;
|
|
60
|
+
summary: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface Threshold {
|
|
64
|
+
op: string;
|
|
65
|
+
n: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PageRegistry {
|
|
69
|
+
pages: PageEntry[];
|
|
70
|
+
activePageId: number | null;
|
|
71
|
+
nextId: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PageEntry {
|
|
75
|
+
id: number;
|
|
76
|
+
page: any;
|
|
77
|
+
title: string;
|
|
78
|
+
url: string;
|
|
79
|
+
opener: number | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface PageListEntry {
|
|
83
|
+
id: number;
|
|
84
|
+
title: string;
|
|
85
|
+
url: string;
|
|
86
|
+
opener: number | null;
|
|
87
|
+
isActive: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface SnapshotModeConfig {
|
|
91
|
+
tags: string[];
|
|
92
|
+
roles: string[];
|
|
93
|
+
selectors: string[];
|
|
94
|
+
ariaAttributes: string[];
|
|
95
|
+
useInteractiveFilter: boolean;
|
|
96
|
+
visibleOnly?: boolean;
|
|
97
|
+
containerExpand?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface AssertionCheckResult {
|
|
101
|
+
name: string;
|
|
102
|
+
passed: boolean;
|
|
103
|
+
actual: unknown;
|
|
104
|
+
expected: unknown;
|
|
105
|
+
selector?: string;
|
|
106
|
+
text?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface AssertionEvaluation {
|
|
110
|
+
verified: boolean;
|
|
111
|
+
checks: AssertionCheckResult[];
|
|
112
|
+
summary: string;
|
|
113
|
+
agentHint: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface WaitValidationError {
|
|
117
|
+
error: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface BatchStepResult {
|
|
121
|
+
ok: boolean;
|
|
122
|
+
stopReason: string | null;
|
|
123
|
+
failedStepIndex: number | null;
|
|
124
|
+
stepResults: unknown[];
|
|
125
|
+
summary: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface FormattedTimeline {
|
|
129
|
+
entries: Array<{
|
|
130
|
+
id: number | null;
|
|
131
|
+
tool: string;
|
|
132
|
+
status: string;
|
|
133
|
+
durationMs: number | null;
|
|
134
|
+
beforeUrl: string;
|
|
135
|
+
afterUrl: string;
|
|
136
|
+
line: string;
|
|
137
|
+
}>;
|
|
138
|
+
retained: number;
|
|
139
|
+
totalRecorded: number;
|
|
140
|
+
bounded: boolean;
|
|
141
|
+
summary: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface FailureHypothesis {
|
|
145
|
+
hasFailures: boolean;
|
|
146
|
+
categories: string[];
|
|
147
|
+
summary: string;
|
|
148
|
+
signals: Array<{ category: string; source: string; detail: string }>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface SessionSummary {
|
|
152
|
+
counts: {
|
|
153
|
+
pages: number;
|
|
154
|
+
actions: { total: number; retained: number; success: number; error: number; running: number };
|
|
155
|
+
waits: { total: number; success: number; error: number; running: number };
|
|
156
|
+
assertions: { total: number; passed: number; failed: number; running: number };
|
|
157
|
+
consoleErrors: number;
|
|
158
|
+
failedRequests: number;
|
|
159
|
+
dialogs: number;
|
|
160
|
+
};
|
|
161
|
+
activePage: { id: number | null; title: string; url: string } | null;
|
|
162
|
+
caveats: string[];
|
|
163
|
+
failureHypothesis: FailureHypothesis;
|
|
164
|
+
summary: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// Action Timeline
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
|
|
171
|
+
export function createActionTimeline(limit = 60): ActionTimeline {
|
|
172
|
+
return {
|
|
173
|
+
limit,
|
|
174
|
+
nextId: 1,
|
|
175
|
+
entries: [],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function beginAction(timeline: ActionTimeline, partial: ActionPartial): ActionEntry {
|
|
180
|
+
const entry: ActionEntry = {
|
|
181
|
+
id: timeline.nextId++,
|
|
182
|
+
tool: partial.tool,
|
|
183
|
+
paramsSummary: partial.paramsSummary ?? "",
|
|
184
|
+
startedAt: partial.startedAt ?? Date.now(),
|
|
185
|
+
finishedAt: null,
|
|
186
|
+
status: "running",
|
|
187
|
+
beforeUrl: partial.beforeUrl ?? "",
|
|
188
|
+
afterUrl: partial.afterUrl ?? "",
|
|
189
|
+
verificationSummary: partial.verificationSummary,
|
|
190
|
+
warningSummary: partial.warningSummary,
|
|
191
|
+
diffSummary: partial.diffSummary,
|
|
192
|
+
changed: partial.changed,
|
|
193
|
+
error: partial.error,
|
|
194
|
+
};
|
|
195
|
+
timeline.entries.push(entry);
|
|
196
|
+
if (timeline.entries.length > timeline.limit) {
|
|
197
|
+
timeline.entries.splice(0, timeline.entries.length - timeline.limit);
|
|
198
|
+
}
|
|
199
|
+
return entry;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function finishAction(timeline: ActionTimeline, actionId: number, updates: ActionUpdates = {}): ActionEntry | null {
|
|
203
|
+
const entry = timeline.entries.find((item) => item.id === actionId);
|
|
204
|
+
if (!entry) return null;
|
|
205
|
+
Object.assign(entry, updates, {
|
|
206
|
+
finishedAt: updates.finishedAt ?? Date.now(),
|
|
207
|
+
status: updates.status ?? entry.status ?? "success",
|
|
208
|
+
afterUrl: updates.afterUrl ?? entry.afterUrl ?? "",
|
|
209
|
+
verificationSummary: updates.verificationSummary ?? entry.verificationSummary,
|
|
210
|
+
warningSummary: updates.warningSummary ?? entry.warningSummary,
|
|
211
|
+
diffSummary: updates.diffSummary ?? entry.diffSummary,
|
|
212
|
+
changed: updates.changed ?? entry.changed,
|
|
213
|
+
error: updates.error ?? entry.error,
|
|
214
|
+
});
|
|
215
|
+
return entry;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function findAction(timeline: ActionTimeline, actionId: number): ActionEntry | null {
|
|
219
|
+
return timeline.entries.find((item) => item.id === actionId) ?? null;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export function toActionParamsSummary(params: unknown): string {
|
|
223
|
+
if (!params || typeof params !== "object") return "";
|
|
224
|
+
const entries: string[] = [];
|
|
225
|
+
for (const [key, value] of Object.entries(params as Record<string, unknown>)) {
|
|
226
|
+
if (value === undefined || value === null) continue;
|
|
227
|
+
if (typeof value === "string") {
|
|
228
|
+
entries.push(`${key}=${JSON.stringify(value.length > 60 ? `${value.slice(0, 57)}...` : value)}`);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (Array.isArray(value)) {
|
|
232
|
+
entries.push(`${key}=[${value.length}]`);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (typeof value === "object") {
|
|
236
|
+
entries.push(`${key}={...}`);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
entries.push(`${key}=${String(value)}`);
|
|
240
|
+
}
|
|
241
|
+
return entries.slice(0, 6).join(", ");
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// ---------------------------------------------------------------------------
|
|
245
|
+
// Compact State Diffing
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
|
|
248
|
+
interface CompactStateForDiff {
|
|
249
|
+
url?: string;
|
|
250
|
+
title?: string;
|
|
251
|
+
focus?: string;
|
|
252
|
+
dialog?: { count?: number; title?: string };
|
|
253
|
+
counts?: Record<string, number>;
|
|
254
|
+
headings?: string[];
|
|
255
|
+
bodyText?: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function diffCompactStates(before: CompactStateForDiff | null | undefined, after: CompactStateForDiff | null | undefined): DiffResult {
|
|
259
|
+
const changes: Array<{ type: string; before: unknown; after: unknown }> = [];
|
|
260
|
+
if (!before || !after) {
|
|
261
|
+
return {
|
|
262
|
+
changed: false,
|
|
263
|
+
changes: [],
|
|
264
|
+
summary: "Diff unavailable",
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (before.url !== after.url) {
|
|
269
|
+
changes.push({ type: "url", before: before.url, after: after.url });
|
|
270
|
+
}
|
|
271
|
+
if (before.title !== after.title) {
|
|
272
|
+
changes.push({ type: "title", before: before.title, after: after.title });
|
|
273
|
+
}
|
|
274
|
+
if (before.focus !== after.focus) {
|
|
275
|
+
changes.push({ type: "focus", before: before.focus, after: after.focus });
|
|
276
|
+
}
|
|
277
|
+
if ((before.dialog?.count ?? 0) !== (after.dialog?.count ?? 0)) {
|
|
278
|
+
changes.push({
|
|
279
|
+
type: "dialog_count",
|
|
280
|
+
before: before.dialog?.count ?? 0,
|
|
281
|
+
after: after.dialog?.count ?? 0,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
if ((before.dialog?.title ?? "") !== (after.dialog?.title ?? "")) {
|
|
285
|
+
changes.push({
|
|
286
|
+
type: "dialog_title",
|
|
287
|
+
before: before.dialog?.title ?? "",
|
|
288
|
+
after: after.dialog?.title ?? "",
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
for (const key of ["landmarks", "buttons", "links", "inputs"]) {
|
|
293
|
+
const beforeValue = before.counts?.[key] ?? 0;
|
|
294
|
+
const afterValue = after.counts?.[key] ?? 0;
|
|
295
|
+
if (beforeValue !== afterValue) {
|
|
296
|
+
changes.push({ type: `count:${key}`, before: beforeValue, after: afterValue });
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const beforeHeadings = JSON.stringify(before.headings ?? []);
|
|
301
|
+
const afterHeadings = JSON.stringify(after.headings ?? []);
|
|
302
|
+
if (beforeHeadings !== afterHeadings) {
|
|
303
|
+
changes.push({
|
|
304
|
+
type: "headings",
|
|
305
|
+
before: before.headings ?? [],
|
|
306
|
+
after: after.headings ?? [],
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const beforeBody = before.bodyText ?? "";
|
|
311
|
+
const afterBody = after.bodyText ?? "";
|
|
312
|
+
if (beforeBody !== afterBody) {
|
|
313
|
+
changes.push({
|
|
314
|
+
type: "body_text",
|
|
315
|
+
before: beforeBody.slice(0, 120),
|
|
316
|
+
after: afterBody.slice(0, 120),
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const changed = changes.length > 0;
|
|
321
|
+
const summary = changed
|
|
322
|
+
? changes
|
|
323
|
+
.slice(0, 4)
|
|
324
|
+
.map((change) => {
|
|
325
|
+
if (change.type === "url") return `URL changed to ${change.after}`;
|
|
326
|
+
if (change.type === "title") return `title changed to ${change.after}`;
|
|
327
|
+
if (change.type === "focus") return `focus changed`;
|
|
328
|
+
if (change.type === "dialog_count") return `dialog count ${change.before}→${change.after}`;
|
|
329
|
+
if (change.type.startsWith("count:")) return `${change.type.slice(6)} ${change.before}→${change.after}`;
|
|
330
|
+
if (change.type === "headings") return "headings changed";
|
|
331
|
+
if (change.type === "body_text") return "visible text changed";
|
|
332
|
+
return `${change.type} changed`;
|
|
333
|
+
})
|
|
334
|
+
.join("; ")
|
|
335
|
+
: "No meaningful browser-state change detected";
|
|
336
|
+
|
|
337
|
+
return { changed, changes, summary };
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ---------------------------------------------------------------------------
|
|
341
|
+
// String helpers
|
|
342
|
+
// ---------------------------------------------------------------------------
|
|
343
|
+
|
|
344
|
+
function normalizeString(value: unknown): string {
|
|
345
|
+
return String(value ?? "").trim();
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function includesNeedle(haystack: string, needle: string): boolean {
|
|
349
|
+
return normalizeString(haystack).toLowerCase().includes(normalizeString(needle).toLowerCase());
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// ---------------------------------------------------------------------------
|
|
353
|
+
// Threshold parsing for count-based assertions
|
|
354
|
+
// ---------------------------------------------------------------------------
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Parse a threshold expression like ">=3", "==0", "<5", or bare "3" (defaults to ">=").
|
|
358
|
+
*/
|
|
359
|
+
export function parseThreshold(value: string | null | undefined): Threshold | null {
|
|
360
|
+
if (value == null) return null;
|
|
361
|
+
const str = String(value).trim();
|
|
362
|
+
if (str === "") return null;
|
|
363
|
+
const match = str.match(/^(>=|<=|==|>|<)?\s*(\d+)$/);
|
|
364
|
+
if (!match) return null;
|
|
365
|
+
const op = match[1] || ">=";
|
|
366
|
+
const n = parseInt(match[2], 10);
|
|
367
|
+
return { op, n };
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Evaluate whether a count meets a parsed threshold.
|
|
372
|
+
*/
|
|
373
|
+
export function meetsThreshold(count: number, threshold: Threshold): boolean {
|
|
374
|
+
switch (threshold.op) {
|
|
375
|
+
case ">=": return count >= threshold.n;
|
|
376
|
+
case "<=": return count <= threshold.n;
|
|
377
|
+
case "==": return count === threshold.n;
|
|
378
|
+
case ">": return count > threshold.n;
|
|
379
|
+
case "<": return count < threshold.n;
|
|
380
|
+
default: return false;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Filter entries that occurred at or after a given action's start time.
|
|
386
|
+
* If sinceActionId is missing or the action isn't found, returns all entries.
|
|
387
|
+
*/
|
|
388
|
+
export function getEntriesSince(
|
|
389
|
+
entries: Array<{ timestamp?: number }>,
|
|
390
|
+
sinceActionId: number | undefined,
|
|
391
|
+
timeline: ActionTimeline,
|
|
392
|
+
): Array<{ timestamp?: number }> {
|
|
393
|
+
if (!entries || !Array.isArray(entries)) return [];
|
|
394
|
+
if (sinceActionId == null || !timeline) return entries;
|
|
395
|
+
const action = findAction(timeline, sinceActionId);
|
|
396
|
+
if (!action) return entries;
|
|
397
|
+
const since = action.startedAt;
|
|
398
|
+
return entries.filter((e) => (e.timestamp ?? 0) >= since);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// ---------------------------------------------------------------------------
|
|
402
|
+
// Assertion Evaluation
|
|
403
|
+
// ---------------------------------------------------------------------------
|
|
404
|
+
|
|
405
|
+
interface AssertionCheckInput {
|
|
406
|
+
kind: string;
|
|
407
|
+
selector?: string;
|
|
408
|
+
value?: string;
|
|
409
|
+
text?: string;
|
|
410
|
+
checked?: boolean;
|
|
411
|
+
sinceActionId?: number;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
interface AssertionState {
|
|
415
|
+
url?: string;
|
|
416
|
+
title?: string;
|
|
417
|
+
bodyText?: string;
|
|
418
|
+
focus?: string;
|
|
419
|
+
selectorStates?: Record<string, { visible?: boolean; value?: string; checked?: boolean | null }>;
|
|
420
|
+
consoleEntries?: Array<{ type?: string; text?: string; message?: string; timestamp?: number }>;
|
|
421
|
+
networkEntries?: Array<{ type?: string; url?: string; status?: number; failed?: boolean; timestamp?: number }>;
|
|
422
|
+
allConsoleEntries?: Array<{ type?: string; text?: string; message?: string; timestamp?: number }>;
|
|
423
|
+
allNetworkEntries?: Array<{ type?: string; url?: string; status?: number; failed?: boolean; timestamp?: number }>;
|
|
424
|
+
actionTimeline?: ActionTimeline | null;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export function evaluateAssertionChecks({ checks, state }: { checks: AssertionCheckInput[]; state: AssertionState }): AssertionEvaluation {
|
|
428
|
+
const results: AssertionCheckResult[] = [];
|
|
429
|
+
const selectorStates = state.selectorStates ?? {};
|
|
430
|
+
const consoleEntries = state.consoleEntries ?? [];
|
|
431
|
+
const networkEntries = state.networkEntries ?? [];
|
|
432
|
+
const allConsoleEntries = state.allConsoleEntries ?? state.consoleEntries ?? [];
|
|
433
|
+
const allNetworkEntries = state.allNetworkEntries ?? state.networkEntries ?? [];
|
|
434
|
+
const actionTimeline = state.actionTimeline ?? null;
|
|
435
|
+
|
|
436
|
+
for (const check of checks) {
|
|
437
|
+
const selectorState = check.selector ? selectorStates[check.selector] ?? null : null;
|
|
438
|
+
let passed = false;
|
|
439
|
+
let actual: unknown;
|
|
440
|
+
let expected: unknown;
|
|
441
|
+
|
|
442
|
+
switch (check.kind) {
|
|
443
|
+
case "url_contains":
|
|
444
|
+
actual = state.url ?? "";
|
|
445
|
+
expected = check.value ?? "";
|
|
446
|
+
passed = includesNeedle(actual as string, expected as string);
|
|
447
|
+
break;
|
|
448
|
+
case "title_contains":
|
|
449
|
+
actual = state.title ?? "";
|
|
450
|
+
expected = check.value ?? "";
|
|
451
|
+
passed = includesNeedle(actual as string, expected as string);
|
|
452
|
+
break;
|
|
453
|
+
case "text_visible":
|
|
454
|
+
actual = state.bodyText ?? "";
|
|
455
|
+
expected = check.text ?? "";
|
|
456
|
+
passed = includesNeedle(actual as string, expected as string);
|
|
457
|
+
break;
|
|
458
|
+
case "text_not_visible":
|
|
459
|
+
actual = state.bodyText ?? "";
|
|
460
|
+
expected = check.text ?? "";
|
|
461
|
+
passed = !includesNeedle(actual as string, expected as string);
|
|
462
|
+
break;
|
|
463
|
+
case "selector_visible":
|
|
464
|
+
actual = selectorState?.visible ?? false;
|
|
465
|
+
expected = true;
|
|
466
|
+
passed = actual === true;
|
|
467
|
+
break;
|
|
468
|
+
case "selector_hidden":
|
|
469
|
+
actual = selectorState?.visible ?? false;
|
|
470
|
+
expected = false;
|
|
471
|
+
passed = actual === false;
|
|
472
|
+
break;
|
|
473
|
+
case "value_equals":
|
|
474
|
+
actual = selectorState?.value ?? "";
|
|
475
|
+
expected = check.value ?? "";
|
|
476
|
+
passed = actual === expected;
|
|
477
|
+
break;
|
|
478
|
+
case "value_contains":
|
|
479
|
+
actual = selectorState?.value ?? "";
|
|
480
|
+
expected = check.value ?? "";
|
|
481
|
+
passed = includesNeedle(actual as string, expected as string);
|
|
482
|
+
break;
|
|
483
|
+
case "focused_matches":
|
|
484
|
+
actual = state.focus ?? "";
|
|
485
|
+
expected = check.value ?? "";
|
|
486
|
+
passed = includesNeedle(actual as string, expected as string);
|
|
487
|
+
break;
|
|
488
|
+
case "checked_equals":
|
|
489
|
+
actual = selectorState?.checked ?? null;
|
|
490
|
+
expected = !!check.checked;
|
|
491
|
+
passed = actual === expected;
|
|
492
|
+
break;
|
|
493
|
+
case "no_console_errors":
|
|
494
|
+
actual = consoleEntries.filter((entry) => entry.type === "error" || entry.type === "pageerror").length;
|
|
495
|
+
expected = 0;
|
|
496
|
+
passed = actual === 0;
|
|
497
|
+
break;
|
|
498
|
+
case "no_failed_requests":
|
|
499
|
+
actual = networkEntries.filter((entry) => entry.failed || (typeof entry.status === "number" && entry.status >= 400)).length;
|
|
500
|
+
expected = 0;
|
|
501
|
+
passed = actual === 0;
|
|
502
|
+
break;
|
|
503
|
+
|
|
504
|
+
// --- S02: New structured network/console assertion kinds ---
|
|
505
|
+
|
|
506
|
+
case "request_url_seen": {
|
|
507
|
+
const filtered = getEntriesSince(allNetworkEntries, check.sinceActionId, actionTimeline!);
|
|
508
|
+
const matches = (filtered as typeof allNetworkEntries).filter((e) => includesNeedle(e.url ?? "", check.text ?? ""));
|
|
509
|
+
actual = matches.length > 0;
|
|
510
|
+
expected = true;
|
|
511
|
+
passed = actual === true;
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
case "response_status": {
|
|
516
|
+
const filtered = getEntriesSince(allNetworkEntries, check.sinceActionId, actionTimeline!);
|
|
517
|
+
const statusNum = parseInt(check.value!, 10);
|
|
518
|
+
const matches = (filtered as typeof allNetworkEntries).filter(
|
|
519
|
+
(e) => includesNeedle(e.url ?? "", check.text ?? "") && typeof e.status === "number" && e.status === statusNum
|
|
520
|
+
);
|
|
521
|
+
actual = matches.length > 0 ? `found (status=${matches[0].status})` : `not found`;
|
|
522
|
+
expected = `status=${check.value ?? ""}`;
|
|
523
|
+
passed = matches.length > 0;
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
case "console_message_matches": {
|
|
528
|
+
const filtered = getEntriesSince(allConsoleEntries, check.sinceActionId, actionTimeline!);
|
|
529
|
+
const matches = (filtered as typeof allConsoleEntries).filter((e) => includesNeedle(e.text ?? "", check.text ?? ""));
|
|
530
|
+
actual = matches.length > 0;
|
|
531
|
+
expected = true;
|
|
532
|
+
passed = actual === true;
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
case "network_count": {
|
|
537
|
+
const filtered = getEntriesSince(allNetworkEntries, check.sinceActionId, actionTimeline!);
|
|
538
|
+
const matches = (filtered as typeof allNetworkEntries).filter((e) => includesNeedle(e.url ?? "", check.text ?? ""));
|
|
539
|
+
const threshold = parseThreshold(check.value);
|
|
540
|
+
if (!threshold) {
|
|
541
|
+
actual = `invalid threshold: ${check.value}`;
|
|
542
|
+
expected = check.value ?? "";
|
|
543
|
+
passed = false;
|
|
544
|
+
} else {
|
|
545
|
+
actual = `count=${matches.length}`;
|
|
546
|
+
expected = `${threshold.op}${threshold.n}`;
|
|
547
|
+
passed = meetsThreshold(matches.length, threshold);
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
case "console_count": {
|
|
553
|
+
const filtered = getEntriesSince(allConsoleEntries, check.sinceActionId, actionTimeline!);
|
|
554
|
+
const matches = (filtered as typeof allConsoleEntries).filter((e) => includesNeedle(e.text ?? "", check.text ?? ""));
|
|
555
|
+
const threshold = parseThreshold(check.value);
|
|
556
|
+
if (!threshold) {
|
|
557
|
+
actual = `invalid threshold: ${check.value}`;
|
|
558
|
+
expected = check.value ?? "";
|
|
559
|
+
passed = false;
|
|
560
|
+
} else {
|
|
561
|
+
actual = `count=${matches.length}`;
|
|
562
|
+
expected = `${threshold.op}${threshold.n}`;
|
|
563
|
+
passed = meetsThreshold(matches.length, threshold);
|
|
564
|
+
}
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
case "no_console_errors_since": {
|
|
569
|
+
const filtered = getEntriesSince(allConsoleEntries, check.sinceActionId, actionTimeline!);
|
|
570
|
+
const errors = (filtered as typeof allConsoleEntries).filter((e) => e.type === "error" || e.type === "pageerror");
|
|
571
|
+
actual = errors.length;
|
|
572
|
+
expected = 0;
|
|
573
|
+
passed = errors.length === 0;
|
|
574
|
+
break;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
case "no_failed_requests_since": {
|
|
578
|
+
const filtered = getEntriesSince(allNetworkEntries, check.sinceActionId, actionTimeline!);
|
|
579
|
+
const failures = (filtered as typeof allNetworkEntries).filter((e) => e.failed || (typeof e.status === "number" && e.status >= 400));
|
|
580
|
+
actual = failures.length;
|
|
581
|
+
expected = 0;
|
|
582
|
+
passed = failures.length === 0;
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
default:
|
|
587
|
+
actual = "unsupported";
|
|
588
|
+
expected = check.kind;
|
|
589
|
+
passed = false;
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
results.push({
|
|
594
|
+
name: check.kind,
|
|
595
|
+
passed,
|
|
596
|
+
actual,
|
|
597
|
+
expected,
|
|
598
|
+
selector: check.selector,
|
|
599
|
+
text: check.text,
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
const failed = results.filter((result) => !result.passed);
|
|
604
|
+
const verified = failed.length === 0;
|
|
605
|
+
return {
|
|
606
|
+
verified,
|
|
607
|
+
checks: results,
|
|
608
|
+
summary: verified
|
|
609
|
+
? `PASS (${results.length}/${results.length} checks)`
|
|
610
|
+
: `FAIL (${failed.length}/${results.length} checks failed)`,
|
|
611
|
+
agentHint: verified
|
|
612
|
+
? "All assertion checks passed"
|
|
613
|
+
: failed[0]
|
|
614
|
+
? `Investigate ${failed[0].name} (expected ${JSON.stringify(failed[0].expected)}, got ${JSON.stringify(failed[0].actual)})`
|
|
615
|
+
: "Assertion failed",
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// ---------------------------------------------------------------------------
|
|
620
|
+
// Wait-condition validation
|
|
621
|
+
// ---------------------------------------------------------------------------
|
|
622
|
+
|
|
623
|
+
interface WaitConditionSpec {
|
|
624
|
+
needsValue: boolean;
|
|
625
|
+
valueLabel: string;
|
|
626
|
+
needsThreshold?: boolean;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* All recognized wait conditions with their parameter requirements.
|
|
631
|
+
*/
|
|
632
|
+
const WAIT_CONDITIONS: Record<string, WaitConditionSpec> = {
|
|
633
|
+
// Existing 5 conditions
|
|
634
|
+
selector_visible: { needsValue: true, valueLabel: "CSS selector" },
|
|
635
|
+
selector_hidden: { needsValue: true, valueLabel: "CSS selector" },
|
|
636
|
+
url_contains: { needsValue: true, valueLabel: "URL substring" },
|
|
637
|
+
network_idle: { needsValue: false, valueLabel: "" },
|
|
638
|
+
delay: { needsValue: true, valueLabel: "milliseconds as a string (e.g. '1000')" },
|
|
639
|
+
|
|
640
|
+
// New 6 conditions (S03)
|
|
641
|
+
text_visible: { needsValue: true, valueLabel: "text to search for" },
|
|
642
|
+
text_hidden: { needsValue: true, valueLabel: "text to search for" },
|
|
643
|
+
request_completed: { needsValue: true, valueLabel: "URL substring to match" },
|
|
644
|
+
console_message: { needsValue: true, valueLabel: "message substring to match" },
|
|
645
|
+
element_count: { needsValue: true, valueLabel: "CSS selector", needsThreshold: true },
|
|
646
|
+
region_stable: { needsValue: true, valueLabel: "CSS selector" },
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Validate parameters for a browser_wait_for condition.
|
|
651
|
+
*/
|
|
652
|
+
export function validateWaitParams(params: { condition: string; value?: string; threshold?: string }): WaitValidationError | null {
|
|
653
|
+
const { condition, value, threshold } = params ?? {};
|
|
654
|
+
|
|
655
|
+
if (!condition) {
|
|
656
|
+
return { error: "condition is required" };
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const spec = WAIT_CONDITIONS[condition];
|
|
660
|
+
if (!spec) {
|
|
661
|
+
const known = Object.keys(WAIT_CONDITIONS).join(", ");
|
|
662
|
+
return { error: `unknown condition "${condition}". Known conditions: ${known}` };
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (spec.needsValue && (!value || String(value).trim() === "")) {
|
|
666
|
+
return { error: `${condition} requires a value (${spec.valueLabel})` };
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (spec.needsThreshold && threshold != null && String(threshold).trim() !== "") {
|
|
670
|
+
const parsed = parseThreshold(threshold);
|
|
671
|
+
if (!parsed) {
|
|
672
|
+
return { error: `${condition} threshold is malformed: "${threshold}". Expected format: >=N, <=N, ==N, >N, <N, or bare N` };
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// ---------------------------------------------------------------------------
|
|
680
|
+
// Region-stable script generator
|
|
681
|
+
// ---------------------------------------------------------------------------
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Generate a JS expression string for page.waitForFunction() that detects
|
|
685
|
+
* DOM stability by comparing snapshot hashes across polling intervals.
|
|
686
|
+
*/
|
|
687
|
+
export function createRegionStableScript(selector: string): string {
|
|
688
|
+
// Create a stable key from the selector (simple hash to avoid special chars)
|
|
689
|
+
const safeKey = Array.from(selector).reduce((h, c) => ((h << 5) - h + c.charCodeAt(0)) | 0, 0) >>> 0;
|
|
690
|
+
const windowKey = `__pw_region_stable_${safeKey}`;
|
|
691
|
+
|
|
692
|
+
return `(() => {
|
|
693
|
+
const el = document.querySelector(${JSON.stringify(selector)});
|
|
694
|
+
if (!el) return false;
|
|
695
|
+
const snapshot = el.innerHTML.length + '|' + el.childElementCount + '|' + el.innerText.length;
|
|
696
|
+
const prev = window[${JSON.stringify(windowKey)}];
|
|
697
|
+
window[${JSON.stringify(windowKey)}] = snapshot;
|
|
698
|
+
if (prev === undefined) return false;
|
|
699
|
+
return snapshot === prev;
|
|
700
|
+
})()`;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// ---------------------------------------------------------------------------
|
|
704
|
+
// Page Registry — pure-logic operations for multi-page/tab management
|
|
705
|
+
// ---------------------------------------------------------------------------
|
|
706
|
+
|
|
707
|
+
export function createPageRegistry(): PageRegistry {
|
|
708
|
+
return { pages: [], activePageId: null, nextId: 1 };
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export function registryAddPage(
|
|
712
|
+
registry: PageRegistry,
|
|
713
|
+
{ page, title = "", url = "", opener = null }: { page: unknown; title?: string; url?: string; opener?: number | null },
|
|
714
|
+
): PageEntry {
|
|
715
|
+
const entry: PageEntry = { id: registry.nextId++, page, title, url, opener };
|
|
716
|
+
registry.pages.push(entry);
|
|
717
|
+
return entry;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export function registryRemovePage(registry: PageRegistry, pageId: number): { removed: PageEntry; newActiveId: number | null } {
|
|
721
|
+
const idx = registry.pages.findIndex((p) => p.id === pageId);
|
|
722
|
+
if (idx === -1) {
|
|
723
|
+
const available = registry.pages.map((p) => p.id);
|
|
724
|
+
throw new Error(
|
|
725
|
+
`registryRemovePage: page ${pageId} not found. ` +
|
|
726
|
+
`Available page IDs: [${available.join(", ")}]. ` +
|
|
727
|
+
`Registry size: ${registry.pages.length}.`
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
const [removed] = registry.pages.splice(idx, 1);
|
|
731
|
+
|
|
732
|
+
// Orphan any pages whose opener was the removed page
|
|
733
|
+
for (const entry of registry.pages) {
|
|
734
|
+
if (entry.opener === pageId) {
|
|
735
|
+
entry.opener = null;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
let newActiveId = registry.activePageId;
|
|
740
|
+
if (registry.activePageId === pageId) {
|
|
741
|
+
if (registry.pages.length === 0) {
|
|
742
|
+
newActiveId = null;
|
|
743
|
+
} else if (removed.opener !== null && registry.pages.some((p) => p.id === removed.opener)) {
|
|
744
|
+
newActiveId = removed.opener;
|
|
745
|
+
} else {
|
|
746
|
+
newActiveId = registry.pages[registry.pages.length - 1].id;
|
|
747
|
+
}
|
|
748
|
+
registry.activePageId = newActiveId;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
return { removed, newActiveId };
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export function registrySetActive(registry: PageRegistry, pageId: number): void {
|
|
755
|
+
const entry = registry.pages.find((p) => p.id === pageId);
|
|
756
|
+
if (!entry) {
|
|
757
|
+
const available = registry.pages.map((p) => p.id);
|
|
758
|
+
throw new Error(
|
|
759
|
+
`registrySetActive: page ${pageId} not found. ` +
|
|
760
|
+
`Available page IDs: [${available.join(", ")}]. ` +
|
|
761
|
+
`Registry size: ${registry.pages.length}.`
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
registry.activePageId = pageId;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export function registryGetActive(registry: PageRegistry): PageEntry {
|
|
768
|
+
if (registry.activePageId === null) {
|
|
769
|
+
throw new Error(
|
|
770
|
+
`registryGetActive: no active page. ` +
|
|
771
|
+
`Registry contains ${registry.pages.length} page(s). ` +
|
|
772
|
+
`Page IDs: [${registry.pages.map((p) => p.id).join(", ")}].`
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
const entry = registry.pages.find((p) => p.id === registry.activePageId);
|
|
776
|
+
if (!entry) {
|
|
777
|
+
throw new Error(
|
|
778
|
+
`registryGetActive: activePageId ${registry.activePageId} not found in registry. ` +
|
|
779
|
+
`Available page IDs: [${registry.pages.map((p) => p.id).join(", ")}]. ` +
|
|
780
|
+
`Registry size: ${registry.pages.length}. This indicates stale state.`
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
return entry;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export function registryGetPage(registry: PageRegistry, pageId: number): PageEntry | null {
|
|
787
|
+
return registry.pages.find((p) => p.id === pageId) ?? null;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
export function registryListPages(registry: PageRegistry): PageListEntry[] {
|
|
791
|
+
return registry.pages.map((entry) => ({
|
|
792
|
+
id: entry.id,
|
|
793
|
+
title: entry.title,
|
|
794
|
+
url: entry.url,
|
|
795
|
+
opener: entry.opener,
|
|
796
|
+
isActive: entry.id === registry.activePageId,
|
|
797
|
+
}));
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// ---------------------------------------------------------------------------
|
|
801
|
+
// FIFO Bounded Log Pusher
|
|
802
|
+
// ---------------------------------------------------------------------------
|
|
803
|
+
|
|
804
|
+
export function createBoundedLogPusher(maxSize: number): (array: unknown[], entry: unknown) => void {
|
|
805
|
+
return function push(array: unknown[], entry: unknown): void {
|
|
806
|
+
array.push(entry);
|
|
807
|
+
if (array.length > maxSize) {
|
|
808
|
+
array.splice(0, array.length - maxSize);
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export async function runBatchSteps({ steps, executeStep, stopOnFailure = true }: {
|
|
814
|
+
steps: unknown[];
|
|
815
|
+
executeStep: (step: unknown, index: number) => Promise<{ ok: boolean; [key: string]: unknown }>;
|
|
816
|
+
stopOnFailure?: boolean;
|
|
817
|
+
}): Promise<BatchStepResult> {
|
|
818
|
+
const results: unknown[] = [];
|
|
819
|
+
for (let i = 0; i < steps.length; i += 1) {
|
|
820
|
+
const step = steps[i] as { action: string };
|
|
821
|
+
const result = await executeStep(step, i);
|
|
822
|
+
results.push(result);
|
|
823
|
+
if (result.ok === false && stopOnFailure) {
|
|
824
|
+
return {
|
|
825
|
+
ok: false,
|
|
826
|
+
stopReason: "step_failed",
|
|
827
|
+
failedStepIndex: i,
|
|
828
|
+
stepResults: results,
|
|
829
|
+
summary: `Stopped at step ${i + 1} (${step.action})`,
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return {
|
|
834
|
+
ok: true,
|
|
835
|
+
stopReason: null,
|
|
836
|
+
failedStepIndex: null,
|
|
837
|
+
stepResults: results,
|
|
838
|
+
summary: `Completed ${results.length} step(s)`,
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// ---------------------------------------------------------------------------
|
|
843
|
+
// Snapshot Modes — semantic element filtering for browser_snapshot_refs
|
|
844
|
+
// ---------------------------------------------------------------------------
|
|
845
|
+
|
|
846
|
+
export const SNAPSHOT_MODES: Record<string, SnapshotModeConfig> = {
|
|
847
|
+
interactive: {
|
|
848
|
+
tags: [],
|
|
849
|
+
roles: [],
|
|
850
|
+
selectors: [],
|
|
851
|
+
ariaAttributes: [],
|
|
852
|
+
useInteractiveFilter: true,
|
|
853
|
+
},
|
|
854
|
+
form: {
|
|
855
|
+
tags: ["input", "select", "textarea", "button", "fieldset", "label", "output", "datalist"],
|
|
856
|
+
roles: ["textbox", "searchbox", "combobox", "checkbox", "radio", "switch", "slider", "spinbutton", "listbox", "option"],
|
|
857
|
+
selectors: ["[contenteditable]"],
|
|
858
|
+
ariaAttributes: [],
|
|
859
|
+
useInteractiveFilter: false,
|
|
860
|
+
},
|
|
861
|
+
dialog: {
|
|
862
|
+
tags: ["dialog"],
|
|
863
|
+
roles: ["dialog", "alertdialog"],
|
|
864
|
+
selectors: ['[role="dialog"]', '[role="alertdialog"]'],
|
|
865
|
+
ariaAttributes: [],
|
|
866
|
+
useInteractiveFilter: false,
|
|
867
|
+
containerExpand: true,
|
|
868
|
+
},
|
|
869
|
+
navigation: {
|
|
870
|
+
tags: ["a", "nav"],
|
|
871
|
+
roles: ["link", "navigation", "menubar", "menu", "menuitem"],
|
|
872
|
+
selectors: [],
|
|
873
|
+
ariaAttributes: [],
|
|
874
|
+
useInteractiveFilter: false,
|
|
875
|
+
},
|
|
876
|
+
errors: {
|
|
877
|
+
tags: [],
|
|
878
|
+
roles: ["alert", "status"],
|
|
879
|
+
selectors: ['[aria-invalid="true"]', '[role="alert"]', '[role="status"]'],
|
|
880
|
+
ariaAttributes: ["aria-invalid", "aria-errormessage"],
|
|
881
|
+
useInteractiveFilter: false,
|
|
882
|
+
containerExpand: true,
|
|
883
|
+
},
|
|
884
|
+
headings: {
|
|
885
|
+
tags: ["h1", "h2", "h3", "h4", "h5", "h6"],
|
|
886
|
+
roles: ["heading"],
|
|
887
|
+
selectors: [],
|
|
888
|
+
ariaAttributes: [],
|
|
889
|
+
useInteractiveFilter: false,
|
|
890
|
+
},
|
|
891
|
+
visible_only: {
|
|
892
|
+
tags: [],
|
|
893
|
+
roles: [],
|
|
894
|
+
selectors: [],
|
|
895
|
+
ariaAttributes: [],
|
|
896
|
+
useInteractiveFilter: false,
|
|
897
|
+
visibleOnly: true,
|
|
898
|
+
},
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
export function getSnapshotModeConfig(mode: string): SnapshotModeConfig | null {
|
|
902
|
+
return SNAPSHOT_MODES[mode] ?? null;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
// ---------------------------------------------------------------------------
|
|
906
|
+
// Fingerprint functions — structural identity for ref resolution
|
|
907
|
+
// ---------------------------------------------------------------------------
|
|
908
|
+
|
|
909
|
+
export function computeContentHash(text: string): string {
|
|
910
|
+
if (!text) return "0";
|
|
911
|
+
let h = 5381;
|
|
912
|
+
for (let i = 0; i < text.length; i++) {
|
|
913
|
+
h = ((h << 5) - h + text.charCodeAt(i)) | 0;
|
|
914
|
+
}
|
|
915
|
+
return (h >>> 0).toString(16);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export function computeStructuralSignature(tag: string, role: string, childTags: string[]): string {
|
|
919
|
+
const input = `${tag}|${role}|${childTags.join(",")}`;
|
|
920
|
+
let h = 5381;
|
|
921
|
+
for (let i = 0; i < input.length; i++) {
|
|
922
|
+
h = ((h << 5) - h + input.charCodeAt(i)) | 0;
|
|
923
|
+
}
|
|
924
|
+
return (h >>> 0).toString(16);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export function matchFingerprint(
|
|
928
|
+
stored: { contentHash?: string; structuralSignature?: string },
|
|
929
|
+
candidate: { contentHash?: string; structuralSignature?: string },
|
|
930
|
+
): boolean {
|
|
931
|
+
if (!stored || !candidate) return false;
|
|
932
|
+
if (!stored.contentHash || !stored.structuralSignature) return false;
|
|
933
|
+
if (!candidate.contentHash || !candidate.structuralSignature) return false;
|
|
934
|
+
return stored.contentHash === candidate.contentHash &&
|
|
935
|
+
stored.structuralSignature === candidate.structuralSignature;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// ---------------------------------------------------------------------------
|
|
939
|
+
// Timeline Formatting
|
|
940
|
+
// ---------------------------------------------------------------------------
|
|
941
|
+
|
|
942
|
+
function formatDurationMs(entry: { startedAt?: number; finishedAt?: number | null }): number | null {
|
|
943
|
+
const startedAt = typeof entry?.startedAt === "number" ? entry.startedAt : null;
|
|
944
|
+
const finishedAt = typeof entry?.finishedAt === "number" ? entry.finishedAt : null;
|
|
945
|
+
if (startedAt == null || finishedAt == null || finishedAt < startedAt) return null;
|
|
946
|
+
return finishedAt - startedAt;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function summarizeActionStatus(status: string | undefined): string {
|
|
950
|
+
if (status === "error") return "error";
|
|
951
|
+
if (status === "running") return "running";
|
|
952
|
+
return "success";
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
function looksBoundedWarning(value: unknown): boolean {
|
|
956
|
+
return /bounded .*history/i.test(String(value ?? ""));
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function uniqueStrings(values: (string | undefined)[]): string[] {
|
|
960
|
+
return [...new Set(values.filter(Boolean))] as string[];
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
export function formatTimelineEntries(entries: ActionEntry[] = [], options: Record<string, unknown> = {}): FormattedTimeline {
|
|
964
|
+
const retained = (options.retained as number) ?? entries.length;
|
|
965
|
+
const totalRecorded = (options.totalRecorded as number) ?? retained;
|
|
966
|
+
const bounded = totalRecorded > retained;
|
|
967
|
+
|
|
968
|
+
if (!entries.length) {
|
|
969
|
+
return {
|
|
970
|
+
entries: [],
|
|
971
|
+
retained,
|
|
972
|
+
totalRecorded,
|
|
973
|
+
bounded,
|
|
974
|
+
summary: "No browser actions recorded.",
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
const formattedEntries = entries.map((entry) => {
|
|
979
|
+
const status = summarizeActionStatus(entry.status);
|
|
980
|
+
const durationMs = formatDurationMs(entry);
|
|
981
|
+
const parts: string[] = [
|
|
982
|
+
`#${entry.id ?? "?"}`,
|
|
983
|
+
entry.tool ?? "unknown_tool",
|
|
984
|
+
status,
|
|
985
|
+
];
|
|
986
|
+
|
|
987
|
+
if (durationMs != null) parts.push(`${durationMs}ms`);
|
|
988
|
+
if (entry.paramsSummary) parts.push(entry.paramsSummary);
|
|
989
|
+
if (entry.error) parts.push(entry.error);
|
|
990
|
+
if (entry.verificationSummary) parts.push(entry.verificationSummary);
|
|
991
|
+
if (entry.diffSummary) parts.push(entry.diffSummary);
|
|
992
|
+
if (entry.warningSummary) parts.push(entry.warningSummary);
|
|
993
|
+
|
|
994
|
+
return {
|
|
995
|
+
id: entry.id ?? null,
|
|
996
|
+
tool: entry.tool ?? "",
|
|
997
|
+
status,
|
|
998
|
+
durationMs,
|
|
999
|
+
beforeUrl: entry.beforeUrl ?? "",
|
|
1000
|
+
afterUrl: entry.afterUrl ?? "",
|
|
1001
|
+
line: parts.join(" | "),
|
|
1002
|
+
};
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
const summary = bounded
|
|
1006
|
+
? `Timeline: showing ${retained} of ${totalRecorded} recorded browser actions; older actions were discarded due to bounded history.`
|
|
1007
|
+
: `Timeline: ${retained} browser action${retained === 1 ? "" : "s"} recorded.`;
|
|
1008
|
+
|
|
1009
|
+
return {
|
|
1010
|
+
entries: formattedEntries,
|
|
1011
|
+
retained,
|
|
1012
|
+
totalRecorded,
|
|
1013
|
+
bounded,
|
|
1014
|
+
summary,
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// ---------------------------------------------------------------------------
|
|
1019
|
+
// Failure Hypothesis
|
|
1020
|
+
// ---------------------------------------------------------------------------
|
|
1021
|
+
|
|
1022
|
+
export function buildFailureHypothesis(session: Record<string, any> = {}): FailureHypothesis {
|
|
1023
|
+
const timelineEntries = session.actionTimeline?.entries ?? [];
|
|
1024
|
+
const consoleEntries = session.consoleEntries ?? [];
|
|
1025
|
+
const networkEntries = session.networkEntries ?? [];
|
|
1026
|
+
const dialogEntries = session.dialogEntries ?? [];
|
|
1027
|
+
const signals: Array<{ category: string; source: string; detail: string }> = [];
|
|
1028
|
+
|
|
1029
|
+
for (const entry of timelineEntries) {
|
|
1030
|
+
if (entry?.status !== "error") continue;
|
|
1031
|
+
if (entry.tool === "browser_wait_for") {
|
|
1032
|
+
signals.push({
|
|
1033
|
+
category: "wait",
|
|
1034
|
+
source: `action#${entry.id ?? "?"}`,
|
|
1035
|
+
detail: entry.error || entry.warningSummary || "Wait condition failed",
|
|
1036
|
+
});
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
if (entry.tool === "browser_assert") {
|
|
1040
|
+
signals.push({
|
|
1041
|
+
category: "assert",
|
|
1042
|
+
source: `action#${entry.id ?? "?"}`,
|
|
1043
|
+
detail: entry.error || entry.verificationSummary || "Assertion failed",
|
|
1044
|
+
});
|
|
1045
|
+
continue;
|
|
1046
|
+
}
|
|
1047
|
+
signals.push({
|
|
1048
|
+
category: "action",
|
|
1049
|
+
source: `action#${entry.id ?? "?"}`,
|
|
1050
|
+
detail: entry.error || `${entry.tool ?? "browser action"} failed`,
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
for (const entry of consoleEntries) {
|
|
1055
|
+
if (entry?.type !== "error" && entry?.type !== "pageerror") continue;
|
|
1056
|
+
signals.push({
|
|
1057
|
+
category: "console",
|
|
1058
|
+
source: entry.type!,
|
|
1059
|
+
detail: entry.text || "Console error recorded",
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
for (const entry of networkEntries) {
|
|
1064
|
+
const failed = entry?.failed || (typeof entry?.status === "number" && entry.status >= 400);
|
|
1065
|
+
if (!failed) continue;
|
|
1066
|
+
signals.push({
|
|
1067
|
+
category: "network",
|
|
1068
|
+
source: entry.url || "network request",
|
|
1069
|
+
detail: `${entry.url || "request"} failed${typeof entry?.status === "number" ? ` with ${entry.status}` : ""}`,
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
for (const entry of dialogEntries) {
|
|
1074
|
+
signals.push({
|
|
1075
|
+
category: "dialog",
|
|
1076
|
+
source: entry?.type || "dialog",
|
|
1077
|
+
detail: entry?.message || "Dialog appeared during failure investigation",
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
const categories = uniqueStrings(signals.map((signal) => signal.category));
|
|
1082
|
+
const hasFailures = categories.length > 0;
|
|
1083
|
+
const summary = hasFailures
|
|
1084
|
+
? `Recent failure signals detected across ${categories.join(", ")}.`
|
|
1085
|
+
: "No recent failure signals detected.";
|
|
1086
|
+
|
|
1087
|
+
return {
|
|
1088
|
+
hasFailures,
|
|
1089
|
+
categories,
|
|
1090
|
+
summary,
|
|
1091
|
+
signals,
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// ---------------------------------------------------------------------------
|
|
1096
|
+
// Session Summary
|
|
1097
|
+
// ---------------------------------------------------------------------------
|
|
1098
|
+
|
|
1099
|
+
export function summarizeBrowserSession(session: Record<string, any> = {}): SessionSummary {
|
|
1100
|
+
const actionTimeline = session.actionTimeline ?? { limit: 0, entries: [] as ActionEntry[] };
|
|
1101
|
+
const actionEntries: ActionEntry[] = actionTimeline.entries ?? [];
|
|
1102
|
+
const retainedActionCount: number = session.retainedActionCount ?? actionEntries.length;
|
|
1103
|
+
const totalActionCount: number = session.totalActionCount ?? retainedActionCount;
|
|
1104
|
+
const pages: Array<Record<string, any>> = session.pages ?? [];
|
|
1105
|
+
const consoleEntries: Array<Record<string, any>> = session.consoleEntries ?? [];
|
|
1106
|
+
const networkEntries: Array<Record<string, any>> = session.networkEntries ?? [];
|
|
1107
|
+
const dialogEntries: Array<Record<string, any>> = session.dialogEntries ?? [];
|
|
1108
|
+
|
|
1109
|
+
const actionStatusCounts = actionEntries.reduce(
|
|
1110
|
+
(acc: Record<string, number>, entry: ActionEntry) => {
|
|
1111
|
+
const status = summarizeActionStatus(entry.status);
|
|
1112
|
+
acc[status] = (acc[status] ?? 0) + 1;
|
|
1113
|
+
return acc;
|
|
1114
|
+
},
|
|
1115
|
+
{ success: 0, error: 0, running: 0 },
|
|
1116
|
+
);
|
|
1117
|
+
|
|
1118
|
+
const waitEntries = actionEntries.filter((entry: ActionEntry) => entry.tool === "browser_wait_for");
|
|
1119
|
+
const assertEntries = actionEntries.filter((entry: ActionEntry) => entry.tool === "browser_assert");
|
|
1120
|
+
const consoleErrors = consoleEntries.filter((entry: Record<string, any>) => entry.type === "error" || entry.type === "pageerror");
|
|
1121
|
+
const failedRequests = networkEntries.filter((entry: Record<string, any>) => entry.failed || (typeof entry.status === "number" && entry.status >= 400));
|
|
1122
|
+
const activePage = pages.find((page: Record<string, any>) => page.isActive) ?? pages[0] ?? null;
|
|
1123
|
+
|
|
1124
|
+
const caveats: string[] = [];
|
|
1125
|
+
if (totalActionCount > retainedActionCount) {
|
|
1126
|
+
caveats.push(`Showing ${retainedActionCount} of ${totalActionCount} recorded actions; older actions were discarded due to bounded history.`);
|
|
1127
|
+
}
|
|
1128
|
+
if (
|
|
1129
|
+
actionEntries.some((entry) => looksBoundedWarning(entry.warningSummary) || looksBoundedWarning(entry.error)) ||
|
|
1130
|
+
consoleEntries.some((entry) => looksBoundedWarning(entry.text) || looksBoundedWarning(entry.message)) ||
|
|
1131
|
+
consoleEntries.length > 0
|
|
1132
|
+
) {
|
|
1133
|
+
caveats.push("bounded console history may hide older console events.");
|
|
1134
|
+
}
|
|
1135
|
+
if (failedRequests.length > 0 || networkEntries.length > 0) {
|
|
1136
|
+
caveats.push("bounded network history may hide older requests.");
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
const failureHypothesis = buildFailureHypothesis(session);
|
|
1140
|
+
|
|
1141
|
+
if (!actionEntries.length && pages.length === 0 && consoleEntries.length === 0 && networkEntries.length === 0 && dialogEntries.length === 0) {
|
|
1142
|
+
return {
|
|
1143
|
+
counts: {
|
|
1144
|
+
pages: 0,
|
|
1145
|
+
actions: { total: 0, retained: 0, success: 0, error: 0, running: 0 },
|
|
1146
|
+
waits: { total: 0, success: 0, error: 0, running: 0 },
|
|
1147
|
+
assertions: { total: 0, passed: 0, failed: 0, running: 0 },
|
|
1148
|
+
consoleErrors: 0,
|
|
1149
|
+
failedRequests: 0,
|
|
1150
|
+
dialogs: 0,
|
|
1151
|
+
},
|
|
1152
|
+
activePage: null,
|
|
1153
|
+
caveats: [],
|
|
1154
|
+
failureHypothesis,
|
|
1155
|
+
summary: "No browser session activity recorded.",
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return {
|
|
1160
|
+
counts: {
|
|
1161
|
+
pages: pages.length,
|
|
1162
|
+
actions: {
|
|
1163
|
+
total: totalActionCount,
|
|
1164
|
+
retained: retainedActionCount,
|
|
1165
|
+
success: actionStatusCounts.success,
|
|
1166
|
+
error: actionStatusCounts.error,
|
|
1167
|
+
running: actionStatusCounts.running,
|
|
1168
|
+
},
|
|
1169
|
+
waits: {
|
|
1170
|
+
total: waitEntries.length,
|
|
1171
|
+
success: waitEntries.filter((entry) => summarizeActionStatus(entry.status) === "success").length,
|
|
1172
|
+
error: waitEntries.filter((entry) => summarizeActionStatus(entry.status) === "error").length,
|
|
1173
|
+
running: waitEntries.filter((entry) => summarizeActionStatus(entry.status) === "running").length,
|
|
1174
|
+
},
|
|
1175
|
+
assertions: {
|
|
1176
|
+
total: assertEntries.length,
|
|
1177
|
+
passed: assertEntries.filter((entry) => summarizeActionStatus(entry.status) === "success").length,
|
|
1178
|
+
failed: assertEntries.filter((entry) => summarizeActionStatus(entry.status) === "error").length,
|
|
1179
|
+
running: assertEntries.filter((entry) => summarizeActionStatus(entry.status) === "running").length,
|
|
1180
|
+
},
|
|
1181
|
+
consoleErrors: consoleErrors.length,
|
|
1182
|
+
failedRequests: failedRequests.length,
|
|
1183
|
+
dialogs: dialogEntries.length,
|
|
1184
|
+
},
|
|
1185
|
+
activePage: activePage
|
|
1186
|
+
? {
|
|
1187
|
+
id: activePage.id ?? null,
|
|
1188
|
+
title: activePage.title ?? "",
|
|
1189
|
+
url: activePage.url ?? "",
|
|
1190
|
+
}
|
|
1191
|
+
: null,
|
|
1192
|
+
caveats,
|
|
1193
|
+
failureHypothesis,
|
|
1194
|
+
summary: `Session: ${pages.length} page${pages.length === 1 ? "" : "s"}, ${totalActionCount} actions, ${waitEntries.length} wait${waitEntries.length === 1 ? "" : "s"}, ${assertEntries.length} assert${assertEntries.length === 1 ? "" : "s"}.${caveats.length ? ` ${caveats.join(" ")}` : ""}`,
|
|
1195
|
+
};
|
|
1196
|
+
}
|