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
|
@@ -1,776 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { StringEnum } from "@gsd/pi-ai";
|
|
3
|
-
import { diffCompactStates, } from "../core.js";
|
|
4
|
-
import { setLastActionBeforeState, setLastActionAfterState, } from "../state.js";
|
|
5
|
-
import { readFocusedDescriptor } from "../settle.js";
|
|
6
|
-
export function registerInteractionTools(pi, deps) {
|
|
7
|
-
// -------------------------------------------------------------------------
|
|
8
|
-
// browser_click
|
|
9
|
-
// -------------------------------------------------------------------------
|
|
10
|
-
pi.registerTool({
|
|
11
|
-
name: "browser_click",
|
|
12
|
-
label: "Browser Click",
|
|
13
|
-
description: "Click an element on the page by CSS selector or by x,y coordinates. Returns a compact page summary plus lightweight verification details after clicking. Provide either selector or both x and y. Prefer selector over coordinates — selectors are more reliable because they handle shadow DOM via getByRole fallbacks. Use coordinates only when you have no other option.",
|
|
14
|
-
parameters: Type.Object({
|
|
15
|
-
selector: Type.Optional(Type.String({ description: "CSS selector of the element to click. The tool will try getByRole fallbacks if the CSS selector fails (handles shadow DOM)." })),
|
|
16
|
-
x: Type.Optional(Type.Number({ description: "X coordinate to click" })),
|
|
17
|
-
y: Type.Optional(Type.Number({ description: "Y coordinate to click" })),
|
|
18
|
-
}),
|
|
19
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
20
|
-
let actionId = null;
|
|
21
|
-
let beforeState = null;
|
|
22
|
-
try {
|
|
23
|
-
const { page: p } = await deps.ensureBrowser();
|
|
24
|
-
const target = deps.getActiveTarget();
|
|
25
|
-
beforeState = await deps.captureCompactPageState(p, { selectors: params.selector ? [params.selector] : [], includeBodyText: true, target });
|
|
26
|
-
actionId = deps.beginTrackedAction("browser_click", params, beforeState.url).id;
|
|
27
|
-
const beforeUrl = p.url();
|
|
28
|
-
const beforeHash = deps.getUrlHash(beforeUrl);
|
|
29
|
-
const beforeTargetState = params.selector
|
|
30
|
-
? await deps.captureClickTargetState(target, params.selector)
|
|
31
|
-
: null;
|
|
32
|
-
if (params.selector) {
|
|
33
|
-
try {
|
|
34
|
-
await target.locator(params.selector).first().click({ timeout: 5000 });
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
const nameMatch = params.selector.match(/\[(?:aria-label|name|placeholder)="([^"]+)"\]/i);
|
|
38
|
-
const roleName = nameMatch?.[1];
|
|
39
|
-
let clicked = false;
|
|
40
|
-
for (const role of ["combobox", "searchbox", "textbox", "button", "link"]) {
|
|
41
|
-
try {
|
|
42
|
-
const loc = roleName
|
|
43
|
-
? target.getByRole(role, { name: new RegExp(roleName, "i") })
|
|
44
|
-
: target.getByRole(role);
|
|
45
|
-
await loc.first().click({ timeout: 3000 });
|
|
46
|
-
clicked = true;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
catch { /* try next role */ }
|
|
50
|
-
}
|
|
51
|
-
if (!clicked) {
|
|
52
|
-
if (params.x !== undefined && params.y !== undefined) {
|
|
53
|
-
await p.mouse.click(params.x, params.y);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
throw new Error(`Could not click selector "${params.selector}" — element not found (shadow DOM?)`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else if (params.x !== undefined && params.y !== undefined) {
|
|
62
|
-
await p.mouse.click(params.x, params.y);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return {
|
|
66
|
-
content: [
|
|
67
|
-
{
|
|
68
|
-
type: "text",
|
|
69
|
-
text: "Must provide either selector or both x and y coordinates",
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
details: {},
|
|
73
|
-
isError: true,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
77
|
-
const afterState = await deps.captureCompactPageState(p, { selectors: params.selector ? [params.selector] : [], includeBodyText: true, target });
|
|
78
|
-
const url = afterState.url;
|
|
79
|
-
const hash = deps.getUrlHash(url);
|
|
80
|
-
const afterTargetState = params.selector
|
|
81
|
-
? await deps.captureClickTargetState(target, params.selector)
|
|
82
|
-
: null;
|
|
83
|
-
const targetStateChanged = !!beforeTargetState && !!afterTargetState && (beforeTargetState.exists !== afterTargetState.exists ||
|
|
84
|
-
beforeTargetState.ariaExpanded !== afterTargetState.ariaExpanded ||
|
|
85
|
-
beforeTargetState.ariaPressed !== afterTargetState.ariaPressed ||
|
|
86
|
-
beforeTargetState.ariaSelected !== afterTargetState.ariaSelected ||
|
|
87
|
-
beforeTargetState.open !== afterTargetState.open);
|
|
88
|
-
const verification = deps.verificationFromChecks([
|
|
89
|
-
{ name: "url_changed", passed: url !== beforeUrl, value: url, expected: `!= ${beforeUrl}` },
|
|
90
|
-
{ name: "hash_changed", passed: hash !== beforeHash, value: hash, expected: `!= ${beforeHash}` },
|
|
91
|
-
{ name: "target_state_changed", passed: targetStateChanged, value: afterTargetState, expected: beforeTargetState },
|
|
92
|
-
{ name: "dialog_open", passed: afterState.dialog.count > beforeState.dialog.count, value: afterState.dialog.count, expected: `> ${beforeState.dialog.count}` },
|
|
93
|
-
], "Try a more specific selector or click a clearly interactive element.");
|
|
94
|
-
const clickTarget = params.selector ?? `(${params.x}, ${params.y})`;
|
|
95
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
96
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
97
|
-
const diff = diffCompactStates(beforeState, afterState);
|
|
98
|
-
setLastActionBeforeState(beforeState);
|
|
99
|
-
setLastActionAfterState(afterState);
|
|
100
|
-
deps.finishTrackedAction(actionId, {
|
|
101
|
-
status: "success",
|
|
102
|
-
afterUrl: afterState.url,
|
|
103
|
-
verificationSummary: verification.verificationSummary,
|
|
104
|
-
warningSummary: jsErrors.trim() || undefined,
|
|
105
|
-
diffSummary: diff.summary,
|
|
106
|
-
changed: diff.changed,
|
|
107
|
-
beforeState: beforeState,
|
|
108
|
-
afterState,
|
|
109
|
-
});
|
|
110
|
-
return {
|
|
111
|
-
content: [{ type: "text", text: `Clicked: ${clickTarget}\nURL: ${url}\nAction: ${actionId}\n${deps.verificationLine(verification)}${jsErrors}\n\nDiff:\n${deps.formatDiffText(diff)}\n\nPage summary:\n${summary}` }],
|
|
112
|
-
details: { target: clickTarget, url, actionId, diff, ...settle, ...verification },
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
catch (err) {
|
|
116
|
-
if (actionId !== null) {
|
|
117
|
-
deps.finishTrackedAction(actionId, { status: "error", afterUrl: deps.getActivePageOrNull()?.url() ?? "", error: err.message, beforeState: beforeState ?? undefined });
|
|
118
|
-
}
|
|
119
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
120
|
-
const content = [{ type: "text", text: `Click failed: ${err.message}` }];
|
|
121
|
-
if (errorShot) {
|
|
122
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
content,
|
|
126
|
-
details: { error: err.message },
|
|
127
|
-
isError: true,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
// -------------------------------------------------------------------------
|
|
133
|
-
// browser_drag
|
|
134
|
-
// -------------------------------------------------------------------------
|
|
135
|
-
pi.registerTool({
|
|
136
|
-
name: "browser_drag",
|
|
137
|
-
label: "Browser Drag",
|
|
138
|
-
description: "Drag an element and drop it onto another element. Use for sortable lists, kanban boards, sliders, and any drag-and-drop UI.",
|
|
139
|
-
parameters: Type.Object({
|
|
140
|
-
sourceSelector: Type.String({
|
|
141
|
-
description: "CSS selector of the element to drag",
|
|
142
|
-
}),
|
|
143
|
-
targetSelector: Type.String({
|
|
144
|
-
description: "CSS selector of the element to drop onto",
|
|
145
|
-
}),
|
|
146
|
-
}),
|
|
147
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
148
|
-
try {
|
|
149
|
-
const { page: p } = await deps.ensureBrowser();
|
|
150
|
-
const target = deps.getActiveTarget();
|
|
151
|
-
await target.dragAndDrop(params.sourceSelector, params.targetSelector, { timeout: 10000 });
|
|
152
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
153
|
-
const afterState = await deps.captureCompactPageState(p, { includeBodyText: false, target });
|
|
154
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
155
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
156
|
-
return {
|
|
157
|
-
content: [{
|
|
158
|
-
type: "text",
|
|
159
|
-
text: `Dragged "${params.sourceSelector}" → "${params.targetSelector}"${jsErrors}\n\nPage summary:\n${summary}`,
|
|
160
|
-
}],
|
|
161
|
-
details: { source: params.sourceSelector, target: params.targetSelector, ...settle },
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
catch (err) {
|
|
165
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
166
|
-
const content = [{ type: "text", text: `Drag failed: ${err.message}` }];
|
|
167
|
-
if (errorShot) {
|
|
168
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
169
|
-
}
|
|
170
|
-
return { content, details: { error: err.message }, isError: true };
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
// -------------------------------------------------------------------------
|
|
175
|
-
// browser_type
|
|
176
|
-
// -------------------------------------------------------------------------
|
|
177
|
-
pi.registerTool({
|
|
178
|
-
name: "browser_type",
|
|
179
|
-
label: "Browser Type",
|
|
180
|
-
description: "Type text into an input element. By default uses atomic fill (clears and sets value instantly). Use 'slowly' for character-by-character typing when you need to trigger key handlers (e.g. search autocomplete). Use 'submit' to press Enter after typing. Returns a compact page summary plus lightweight verification details. IMPORTANT: Always provide a selector — do NOT rely on coordinate clicks to focus an input before calling this. CSS attribute selectors like combobox[aria-label='X'] work for most inputs; for shadow DOM inputs (e.g. Google Search), the tool automatically tries getByRole fallbacks.",
|
|
181
|
-
parameters: Type.Object({
|
|
182
|
-
text: Type.String({ description: "Text to type" }),
|
|
183
|
-
selector: Type.Optional(Type.String({ description: "CSS selector of the input to type into (clicks it first). Examples: 'input[name=q]', 'textarea', 'combobox[aria-label=\"Search\"]'. The tool will try getByRole fallbacks if the CSS selector fails." })),
|
|
184
|
-
clearFirst: Type.Optional(Type.Boolean({
|
|
185
|
-
description: "Clear the input's existing value before typing (default: false). Use this when replacing existing text.",
|
|
186
|
-
})),
|
|
187
|
-
submit: Type.Optional(Type.Boolean({
|
|
188
|
-
description: "Press Enter after typing to submit the form (default: false).",
|
|
189
|
-
})),
|
|
190
|
-
slowly: Type.Optional(Type.Boolean({
|
|
191
|
-
description: "Type one character at a time instead of filling atomically. Use when you need to trigger key handlers (e.g. search autocomplete). Default: false.",
|
|
192
|
-
})),
|
|
193
|
-
}),
|
|
194
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
195
|
-
let actionId = null;
|
|
196
|
-
let beforeState = null;
|
|
197
|
-
try {
|
|
198
|
-
const { page: p } = await deps.ensureBrowser();
|
|
199
|
-
const target = deps.getActiveTarget();
|
|
200
|
-
beforeState = await deps.captureCompactPageState(p, { selectors: params.selector ? [params.selector] : [], includeBodyText: true, target });
|
|
201
|
-
actionId = deps.beginTrackedAction("browser_type", params, beforeState.url).id;
|
|
202
|
-
const beforeUrl = p.url();
|
|
203
|
-
async function focusViaRole(selector) {
|
|
204
|
-
const nameMatch = selector.match(/\[(?:aria-label|name|placeholder)="([^"]+)"\]/i);
|
|
205
|
-
const roleName = nameMatch?.[1];
|
|
206
|
-
for (const role of ["combobox", "searchbox", "textbox"]) {
|
|
207
|
-
try {
|
|
208
|
-
const loc = roleName
|
|
209
|
-
? target.getByRole(role, { name: new RegExp(roleName, "i") })
|
|
210
|
-
: target.getByRole(role);
|
|
211
|
-
await loc.first().click({ timeout: 3000 });
|
|
212
|
-
return true;
|
|
213
|
-
}
|
|
214
|
-
catch { /* try next */ }
|
|
215
|
-
}
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
if (params.selector) {
|
|
219
|
-
if (params.slowly) {
|
|
220
|
-
let focused = false;
|
|
221
|
-
try {
|
|
222
|
-
await target.locator(params.selector).first().click({ timeout: 5000 });
|
|
223
|
-
focused = true;
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
focused = await focusViaRole(params.selector);
|
|
227
|
-
}
|
|
228
|
-
if (!focused)
|
|
229
|
-
throw new Error(`Could not focus selector "${params.selector}"`);
|
|
230
|
-
if (params.clearFirst) {
|
|
231
|
-
await p.keyboard.press("Control+A");
|
|
232
|
-
await p.keyboard.press("Delete");
|
|
233
|
-
}
|
|
234
|
-
await p.keyboard.type(params.text);
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
let filled = false;
|
|
238
|
-
try {
|
|
239
|
-
await target.locator(params.selector).first().fill(params.text, { timeout: 5000 });
|
|
240
|
-
filled = true;
|
|
241
|
-
}
|
|
242
|
-
catch { /* fall through */ }
|
|
243
|
-
if (!filled) {
|
|
244
|
-
const nameMatch = params.selector.match(/\[(?:aria-label|name|placeholder)="([^"]+)"\]/i);
|
|
245
|
-
const roleName = nameMatch?.[1];
|
|
246
|
-
for (const role of ["combobox", "searchbox", "textbox"]) {
|
|
247
|
-
try {
|
|
248
|
-
const loc = roleName
|
|
249
|
-
? target.getByRole(role, { name: new RegExp(roleName, "i") })
|
|
250
|
-
: target.getByRole(role);
|
|
251
|
-
await loc.first().fill(params.text, { timeout: 3000 });
|
|
252
|
-
filled = true;
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
catch { /* try next */ }
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
if (!filled) {
|
|
259
|
-
let focused = false;
|
|
260
|
-
try {
|
|
261
|
-
await target.locator(params.selector).first().click({ timeout: 5000 });
|
|
262
|
-
focused = true;
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
focused = await focusViaRole(params.selector);
|
|
266
|
-
}
|
|
267
|
-
if (!focused)
|
|
268
|
-
throw new Error(`Could not focus selector "${params.selector}"`);
|
|
269
|
-
if (params.clearFirst) {
|
|
270
|
-
await p.keyboard.press("Control+A");
|
|
271
|
-
await p.keyboard.press("Delete");
|
|
272
|
-
}
|
|
273
|
-
await target.locator(":focus").pressSequentially(params.text, { timeout: 5000 }).catch(() => p.keyboard.type(params.text));
|
|
274
|
-
}
|
|
275
|
-
else if (params.clearFirst) {
|
|
276
|
-
// fill() already replaced the value; clearFirst is a no-op here
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
const hasFocus = await target.evaluate(() => {
|
|
282
|
-
const el = document.activeElement;
|
|
283
|
-
return !!(el && el !== document.body && el !== document.documentElement);
|
|
284
|
-
});
|
|
285
|
-
if (!hasFocus) {
|
|
286
|
-
return {
|
|
287
|
-
content: [{ type: "text", text: "Type failed: no element is focused. Use browser_click to focus an input first, or provide a selector." }],
|
|
288
|
-
details: { error: "no focused element" },
|
|
289
|
-
isError: true,
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
await target.locator(":focus").pressSequentially(params.text, { timeout: 10000 }).catch(() => p.keyboard.type(params.text));
|
|
293
|
-
}
|
|
294
|
-
if (params.submit) {
|
|
295
|
-
await p.keyboard.press("Enter");
|
|
296
|
-
}
|
|
297
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
298
|
-
const typedValue = await deps.readInputLikeValue(target, params.selector);
|
|
299
|
-
const afterUrl = p.url();
|
|
300
|
-
const verification = deps.verificationFromChecks([
|
|
301
|
-
{ name: "value_equals_expected", passed: typedValue === params.text, value: typedValue, expected: params.text },
|
|
302
|
-
{ name: "value_contains_expected", passed: typeof typedValue === "string" && typedValue.includes(params.text), value: typedValue, expected: params.text },
|
|
303
|
-
{ name: "url_changed_after_submit", passed: !!params.submit && afterUrl !== beforeUrl, value: afterUrl, expected: `!= ${beforeUrl}` },
|
|
304
|
-
], "Try clearFirst=true, use a more specific selector, or set slowly=true for key-driven inputs.");
|
|
305
|
-
const typeTarget = params.selector ? ` into "${params.selector}"` : "";
|
|
306
|
-
const afterState = await deps.captureCompactPageState(p, { selectors: params.selector ? [params.selector] : [], includeBodyText: true, target });
|
|
307
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
308
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
309
|
-
const diff = diffCompactStates(beforeState, afterState);
|
|
310
|
-
setLastActionBeforeState(beforeState);
|
|
311
|
-
setLastActionAfterState(afterState);
|
|
312
|
-
deps.finishTrackedAction(actionId, {
|
|
313
|
-
status: "success",
|
|
314
|
-
afterUrl: afterState.url,
|
|
315
|
-
verificationSummary: verification.verificationSummary,
|
|
316
|
-
warningSummary: jsErrors.trim() || undefined,
|
|
317
|
-
diffSummary: diff.summary,
|
|
318
|
-
changed: diff.changed,
|
|
319
|
-
beforeState: beforeState,
|
|
320
|
-
afterState,
|
|
321
|
-
});
|
|
322
|
-
return {
|
|
323
|
-
content: [{ type: "text", text: `Typed "${params.text}"${typeTarget}\nAction: ${actionId}\n${deps.verificationLine(verification)}${jsErrors}\n\nDiff:\n${deps.formatDiffText(diff)}\n\nPage summary:\n${summary}` }],
|
|
324
|
-
details: { text: params.text, selector: params.selector, typedValue, actionId, diff, ...settle, ...verification },
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
catch (err) {
|
|
328
|
-
if (actionId !== null) {
|
|
329
|
-
deps.finishTrackedAction(actionId, { status: "error", afterUrl: deps.getActivePageOrNull()?.url() ?? "", error: err.message, beforeState: beforeState ?? undefined });
|
|
330
|
-
}
|
|
331
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
332
|
-
const content = [{ type: "text", text: `Type failed: ${err.message}` }];
|
|
333
|
-
if (errorShot) {
|
|
334
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
335
|
-
}
|
|
336
|
-
return {
|
|
337
|
-
content,
|
|
338
|
-
details: { error: err.message },
|
|
339
|
-
isError: true,
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
});
|
|
344
|
-
// -------------------------------------------------------------------------
|
|
345
|
-
// browser_upload_file
|
|
346
|
-
// -------------------------------------------------------------------------
|
|
347
|
-
pi.registerTool({
|
|
348
|
-
name: "browser_upload_file",
|
|
349
|
-
label: "Browser Upload File",
|
|
350
|
-
description: "Set files on a file input element. The selector must target an <input type=\"file\"> element. Accepts one or more absolute file paths.",
|
|
351
|
-
parameters: Type.Object({
|
|
352
|
-
selector: Type.String({
|
|
353
|
-
description: 'CSS selector targeting the <input type="file"> element',
|
|
354
|
-
}),
|
|
355
|
-
files: Type.Array(Type.String({ description: "Absolute path to a file" }), {
|
|
356
|
-
description: "One or more file paths to upload",
|
|
357
|
-
}),
|
|
358
|
-
}),
|
|
359
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
360
|
-
try {
|
|
361
|
-
const { page: p } = await deps.ensureBrowser();
|
|
362
|
-
const target = deps.getActiveTarget();
|
|
363
|
-
const cleanFiles = params.files.map((f) => f.replace(/^@/, ""));
|
|
364
|
-
await target.locator(params.selector).first().setInputFiles(cleanFiles);
|
|
365
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
366
|
-
const afterState = await deps.captureCompactPageState(p, { includeBodyText: false, target });
|
|
367
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
368
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
369
|
-
return {
|
|
370
|
-
content: [{
|
|
371
|
-
type: "text",
|
|
372
|
-
text: `Uploaded ${cleanFiles.length} file(s) to "${params.selector}": ${cleanFiles.join(", ")}${jsErrors}\n\nPage summary:\n${summary}`,
|
|
373
|
-
}],
|
|
374
|
-
details: { selector: params.selector, files: cleanFiles, ...settle },
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
catch (err) {
|
|
378
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
379
|
-
const content = [{ type: "text", text: `Upload failed: ${err.message}` }];
|
|
380
|
-
if (errorShot) {
|
|
381
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
382
|
-
}
|
|
383
|
-
return { content, details: { error: err.message }, isError: true };
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
});
|
|
387
|
-
// -------------------------------------------------------------------------
|
|
388
|
-
// browser_scroll
|
|
389
|
-
// -------------------------------------------------------------------------
|
|
390
|
-
pi.registerTool({
|
|
391
|
-
name: "browser_scroll",
|
|
392
|
-
label: "Browser Scroll",
|
|
393
|
-
description: "Scroll the page up or down by a given number of pixels. Returns scroll position (px and percentage) and an accessibility snapshot of the visible content.",
|
|
394
|
-
parameters: Type.Object({
|
|
395
|
-
direction: StringEnum(["up", "down"]),
|
|
396
|
-
amount: Type.Optional(Type.Number({ description: "Pixels to scroll (default: 300)" })),
|
|
397
|
-
}),
|
|
398
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
399
|
-
try {
|
|
400
|
-
const { page: p } = await deps.ensureBrowser();
|
|
401
|
-
const target = deps.getActiveTarget();
|
|
402
|
-
const pixels = params.amount ?? 300;
|
|
403
|
-
const delta = params.direction === "up" ? -pixels : pixels;
|
|
404
|
-
await p.mouse.wheel(0, delta);
|
|
405
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
406
|
-
const scrollInfo = await target.evaluate(() => ({
|
|
407
|
-
scrollY: Math.round(window.scrollY),
|
|
408
|
-
scrollHeight: document.documentElement.scrollHeight,
|
|
409
|
-
clientHeight: document.documentElement.clientHeight,
|
|
410
|
-
}));
|
|
411
|
-
const maxScroll = scrollInfo.scrollHeight - scrollInfo.clientHeight;
|
|
412
|
-
const percent = maxScroll > 0 ? Math.round((scrollInfo.scrollY / maxScroll) * 100) : 0;
|
|
413
|
-
const afterState = await deps.captureCompactPageState(p, { includeBodyText: false, target });
|
|
414
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
415
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
416
|
-
return {
|
|
417
|
-
content: [
|
|
418
|
-
{
|
|
419
|
-
type: "text",
|
|
420
|
-
text: `Scrolled ${params.direction} by ${pixels}px\n` +
|
|
421
|
-
`Position: ${scrollInfo.scrollY}px / ${scrollInfo.scrollHeight}px (${percent}% down)\n` +
|
|
422
|
-
`Viewport height: ${scrollInfo.clientHeight}px${jsErrors}\n\nPage summary:\n${summary}`,
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
details: { direction: params.direction, amount: pixels, ...scrollInfo, percent, ...settle },
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
catch (err) {
|
|
429
|
-
return {
|
|
430
|
-
content: [{ type: "text", text: `Scroll failed: ${err.message}` }],
|
|
431
|
-
details: { error: err.message },
|
|
432
|
-
isError: true,
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
},
|
|
436
|
-
});
|
|
437
|
-
// -------------------------------------------------------------------------
|
|
438
|
-
// browser_hover
|
|
439
|
-
// -------------------------------------------------------------------------
|
|
440
|
-
pi.registerTool({
|
|
441
|
-
name: "browser_hover",
|
|
442
|
-
label: "Browser Hover",
|
|
443
|
-
description: "Move the mouse over an element to trigger hover states — reveals tooltips, dropdown menus, CSS :hover effects, and other hover-dependent UI. Returns a compact page summary showing the resulting hover state.",
|
|
444
|
-
parameters: Type.Object({
|
|
445
|
-
selector: Type.String({
|
|
446
|
-
description: "CSS selector of the element to hover over",
|
|
447
|
-
}),
|
|
448
|
-
}),
|
|
449
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
450
|
-
try {
|
|
451
|
-
const { page: p } = await deps.ensureBrowser();
|
|
452
|
-
const target = deps.getActiveTarget();
|
|
453
|
-
await target.locator(params.selector).first().hover({ timeout: 10000 });
|
|
454
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
455
|
-
const afterState = await deps.captureCompactPageState(p, { includeBodyText: false, target });
|
|
456
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
457
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
458
|
-
return {
|
|
459
|
-
content: [{ type: "text", text: `Hovering over "${params.selector}"${jsErrors}\n\nPage summary:\n${summary}` }],
|
|
460
|
-
details: { selector: params.selector, ...settle },
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
catch (err) {
|
|
464
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
465
|
-
const content = [{ type: "text", text: `Hover failed: ${err.message}` }];
|
|
466
|
-
if (errorShot) {
|
|
467
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
468
|
-
}
|
|
469
|
-
return {
|
|
470
|
-
content,
|
|
471
|
-
details: { error: err.message },
|
|
472
|
-
isError: true,
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
});
|
|
477
|
-
// -------------------------------------------------------------------------
|
|
478
|
-
// browser_key_press
|
|
479
|
-
// -------------------------------------------------------------------------
|
|
480
|
-
pi.registerTool({
|
|
481
|
-
name: "browser_key_press",
|
|
482
|
-
label: "Browser Key Press",
|
|
483
|
-
description: "Press a keyboard key or key combination. Returns a compact page summary plus lightweight verification details after the key press. Use for: submitting forms (Enter), closing modals (Escape), navigating focusable elements (Tab / Shift+Tab), operating dropdowns and menus (ArrowDown, ArrowUp, Space), copying/pasting (Meta+C, Meta+V). Key names follow the DOM KeyboardEvent key convention.",
|
|
484
|
-
parameters: Type.Object({
|
|
485
|
-
key: Type.String({
|
|
486
|
-
description: "Key or combination to press, e.g. 'Enter', 'Escape', 'Tab', 'ArrowDown', 'ArrowUp', 'Space', 'Meta+A', 'Shift+Tab', 'Control+Enter'",
|
|
487
|
-
}),
|
|
488
|
-
}),
|
|
489
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
490
|
-
let actionId = null;
|
|
491
|
-
let beforeState = null;
|
|
492
|
-
try {
|
|
493
|
-
const { page: p } = await deps.ensureBrowser();
|
|
494
|
-
const target = deps.getActiveTarget();
|
|
495
|
-
beforeState = await deps.captureCompactPageState(p, { includeBodyText: true, target });
|
|
496
|
-
actionId = deps.beginTrackedAction("browser_key_press", params, beforeState.url).id;
|
|
497
|
-
const beforeUrl = p.url();
|
|
498
|
-
const beforeFocus = await readFocusedDescriptor(target);
|
|
499
|
-
await p.keyboard.press(params.key);
|
|
500
|
-
const settle = await deps.settleAfterActionAdaptive(p, { checkFocusStability: true });
|
|
501
|
-
const afterState = await deps.captureCompactPageState(p, { includeBodyText: true, target });
|
|
502
|
-
const afterUrl = afterState.url;
|
|
503
|
-
const afterFocus = await readFocusedDescriptor(target);
|
|
504
|
-
const verification = deps.verificationFromChecks([
|
|
505
|
-
{ name: "url_changed", passed: afterUrl !== beforeUrl, value: afterUrl, expected: `!= ${beforeUrl}` },
|
|
506
|
-
{ name: "focus_changed", passed: afterFocus !== beforeFocus, value: afterFocus, expected: `!= ${beforeFocus}` },
|
|
507
|
-
{ name: "dialog_open", passed: afterState.dialog.count > beforeState.dialog.count, value: afterState.dialog.count, expected: `> ${beforeState.dialog.count}` },
|
|
508
|
-
], "If this key should trigger UI changes, confirm focus is on the intended element first.");
|
|
509
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
510
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
511
|
-
const diff = diffCompactStates(beforeState, afterState);
|
|
512
|
-
setLastActionBeforeState(beforeState);
|
|
513
|
-
setLastActionAfterState(afterState);
|
|
514
|
-
deps.finishTrackedAction(actionId, {
|
|
515
|
-
status: "success",
|
|
516
|
-
afterUrl: afterState.url,
|
|
517
|
-
verificationSummary: verification.verificationSummary,
|
|
518
|
-
warningSummary: jsErrors.trim() || undefined,
|
|
519
|
-
diffSummary: diff.summary,
|
|
520
|
-
changed: diff.changed,
|
|
521
|
-
beforeState: beforeState,
|
|
522
|
-
afterState,
|
|
523
|
-
});
|
|
524
|
-
return {
|
|
525
|
-
content: [{ type: "text", text: `Pressed "${params.key}"\nAction: ${actionId}\n${deps.verificationLine(verification)}${jsErrors}\n\nDiff:\n${deps.formatDiffText(diff)}\n\nPage summary:\n${summary}` }],
|
|
526
|
-
details: { key: params.key, beforeFocus, afterFocus, actionId, diff, ...settle, ...verification },
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
catch (err) {
|
|
530
|
-
if (actionId !== null) {
|
|
531
|
-
deps.finishTrackedAction(actionId, { status: "error", afterUrl: deps.getActivePageOrNull()?.url() ?? "", error: err.message, beforeState: beforeState ?? undefined });
|
|
532
|
-
}
|
|
533
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
534
|
-
const content = [{ type: "text", text: `Key press failed: ${err.message}` }];
|
|
535
|
-
if (errorShot) {
|
|
536
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
537
|
-
}
|
|
538
|
-
return {
|
|
539
|
-
content,
|
|
540
|
-
details: { error: err.message },
|
|
541
|
-
isError: true,
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
});
|
|
546
|
-
// -------------------------------------------------------------------------
|
|
547
|
-
// browser_select_option
|
|
548
|
-
// -------------------------------------------------------------------------
|
|
549
|
-
pi.registerTool({
|
|
550
|
-
name: "browser_select_option",
|
|
551
|
-
label: "Browser Select Option",
|
|
552
|
-
description: "Select an option from a <select> dropdown element by its visible label or value. Returns a compact page summary plus lightweight verification details. For custom-built dropdowns use browser_click to open them then browser_click to pick the option.",
|
|
553
|
-
parameters: Type.Object({
|
|
554
|
-
selector: Type.String({
|
|
555
|
-
description: "CSS selector targeting the <select> element",
|
|
556
|
-
}),
|
|
557
|
-
option: Type.String({
|
|
558
|
-
description: "The option to select — can be the visible label text or the value attribute. Will try label first, then value.",
|
|
559
|
-
}),
|
|
560
|
-
}),
|
|
561
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
562
|
-
let actionId = null;
|
|
563
|
-
let beforeState = null;
|
|
564
|
-
try {
|
|
565
|
-
const { page: p } = await deps.ensureBrowser();
|
|
566
|
-
const target = deps.getActiveTarget();
|
|
567
|
-
beforeState = await deps.captureCompactPageState(p, { selectors: [params.selector], includeBodyText: true, target });
|
|
568
|
-
actionId = deps.beginTrackedAction("browser_select_option", params, beforeState.url).id;
|
|
569
|
-
let selected;
|
|
570
|
-
try {
|
|
571
|
-
selected = await target.selectOption(params.selector, { label: params.option }, { timeout: 5000 });
|
|
572
|
-
}
|
|
573
|
-
catch {
|
|
574
|
-
selected = await target.selectOption(params.selector, { value: params.option }, { timeout: 5000 });
|
|
575
|
-
}
|
|
576
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
577
|
-
const selectedState = await target.locator(params.selector).first().evaluate((el) => {
|
|
578
|
-
if (!(el instanceof HTMLSelectElement)) {
|
|
579
|
-
return { selectedValues: [], selectedLabels: [] };
|
|
580
|
-
}
|
|
581
|
-
const selectedOptions = Array.from(el.selectedOptions || []);
|
|
582
|
-
return {
|
|
583
|
-
selectedValues: selectedOptions.map((opt) => opt.value),
|
|
584
|
-
selectedLabels: selectedOptions.map((opt) => (opt.textContent || "").trim()),
|
|
585
|
-
};
|
|
586
|
-
});
|
|
587
|
-
const optionNeedle = params.option.toLowerCase();
|
|
588
|
-
const verification = deps.verificationFromChecks([
|
|
589
|
-
{ name: "selected_values_include_option", passed: selectedState.selectedValues.includes(params.option), value: selectedState.selectedValues, expected: params.option },
|
|
590
|
-
{ name: "selected_labels_include_option", passed: selectedState.selectedLabels.some((label) => label.toLowerCase().includes(optionNeedle)), value: selectedState.selectedLabels, expected: params.option },
|
|
591
|
-
], "Confirm whether the target select uses option label or value, then retry with that exact text.");
|
|
592
|
-
const afterState = await deps.captureCompactPageState(p, { selectors: [params.selector], includeBodyText: true, target });
|
|
593
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
594
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
595
|
-
const diff = diffCompactStates(beforeState, afterState);
|
|
596
|
-
setLastActionBeforeState(beforeState);
|
|
597
|
-
setLastActionAfterState(afterState);
|
|
598
|
-
deps.finishTrackedAction(actionId, {
|
|
599
|
-
status: "success",
|
|
600
|
-
afterUrl: afterState.url,
|
|
601
|
-
verificationSummary: verification.verificationSummary,
|
|
602
|
-
warningSummary: jsErrors.trim() || undefined,
|
|
603
|
-
diffSummary: diff.summary,
|
|
604
|
-
changed: diff.changed,
|
|
605
|
-
beforeState: beforeState,
|
|
606
|
-
afterState,
|
|
607
|
-
});
|
|
608
|
-
return {
|
|
609
|
-
content: [
|
|
610
|
-
{
|
|
611
|
-
type: "text",
|
|
612
|
-
text: `Selected "${params.option}" in "${params.selector}". Values: ${selected.join(", ")}\nAction: ${actionId}\n${deps.verificationLine(verification)}${jsErrors}\n\nDiff:\n${deps.formatDiffText(diff)}\n\nPage summary:\n${summary}`,
|
|
613
|
-
},
|
|
614
|
-
],
|
|
615
|
-
details: { selector: params.selector, option: params.option, selected, selectedState, actionId, diff, ...settle, ...verification },
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
catch (err) {
|
|
619
|
-
if (actionId !== null) {
|
|
620
|
-
deps.finishTrackedAction(actionId, { status: "error", afterUrl: deps.getActivePageOrNull()?.url() ?? "", error: err.message, beforeState: beforeState ?? undefined });
|
|
621
|
-
}
|
|
622
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
623
|
-
const content = [{ type: "text", text: `Select option failed: ${err.message}` }];
|
|
624
|
-
if (errorShot) {
|
|
625
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
626
|
-
}
|
|
627
|
-
return {
|
|
628
|
-
content,
|
|
629
|
-
details: { error: err.message },
|
|
630
|
-
isError: true,
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
},
|
|
634
|
-
});
|
|
635
|
-
// -------------------------------------------------------------------------
|
|
636
|
-
// browser_set_checked
|
|
637
|
-
// -------------------------------------------------------------------------
|
|
638
|
-
pi.registerTool({
|
|
639
|
-
name: "browser_set_checked",
|
|
640
|
-
label: "Browser Set Checked",
|
|
641
|
-
description: "Check or uncheck a checkbox or radio button. More reliable than clicking for form elements where you need a specific state.",
|
|
642
|
-
parameters: Type.Object({
|
|
643
|
-
selector: Type.String({
|
|
644
|
-
description: "CSS selector targeting the checkbox or radio input",
|
|
645
|
-
}),
|
|
646
|
-
checked: Type.Boolean({
|
|
647
|
-
description: "true to check, false to uncheck",
|
|
648
|
-
}),
|
|
649
|
-
}),
|
|
650
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
651
|
-
let actionId = null;
|
|
652
|
-
let beforeState = null;
|
|
653
|
-
try {
|
|
654
|
-
const { page: p } = await deps.ensureBrowser();
|
|
655
|
-
const target = deps.getActiveTarget();
|
|
656
|
-
beforeState = await deps.captureCompactPageState(p, { selectors: [params.selector], includeBodyText: true, target });
|
|
657
|
-
actionId = deps.beginTrackedAction("browser_set_checked", params, beforeState.url).id;
|
|
658
|
-
await target.locator(params.selector).first().setChecked(params.checked, { timeout: 10000 });
|
|
659
|
-
const settle = await deps.settleAfterActionAdaptive(p);
|
|
660
|
-
const actualChecked = await target.locator(params.selector).first().isChecked().catch(() => null);
|
|
661
|
-
const verification = deps.verificationFromChecks([
|
|
662
|
-
{ name: "checked_state_matches", passed: actualChecked === params.checked, value: actualChecked, expected: params.checked },
|
|
663
|
-
], "Ensure selector points to a checkbox/radio input and retry.");
|
|
664
|
-
const state = params.checked ? "checked" : "unchecked";
|
|
665
|
-
const afterState = await deps.captureCompactPageState(p, { selectors: [params.selector], includeBodyText: true, target });
|
|
666
|
-
const summary = deps.formatCompactStateSummary(afterState);
|
|
667
|
-
const jsErrors = deps.getRecentErrors(p.url());
|
|
668
|
-
const diff = diffCompactStates(beforeState, afterState);
|
|
669
|
-
setLastActionBeforeState(beforeState);
|
|
670
|
-
setLastActionAfterState(afterState);
|
|
671
|
-
deps.finishTrackedAction(actionId, {
|
|
672
|
-
status: "success",
|
|
673
|
-
afterUrl: afterState.url,
|
|
674
|
-
verificationSummary: verification.verificationSummary,
|
|
675
|
-
warningSummary: jsErrors.trim() || undefined,
|
|
676
|
-
diffSummary: diff.summary,
|
|
677
|
-
changed: diff.changed,
|
|
678
|
-
beforeState: beforeState,
|
|
679
|
-
afterState,
|
|
680
|
-
});
|
|
681
|
-
return {
|
|
682
|
-
content: [{
|
|
683
|
-
type: "text",
|
|
684
|
-
text: `Set "${params.selector}" to ${state}\nAction: ${actionId}\n${deps.verificationLine(verification)}${jsErrors}\n\nDiff:\n${deps.formatDiffText(diff)}\n\nPage summary:\n${summary}`,
|
|
685
|
-
}],
|
|
686
|
-
details: { selector: params.selector, checked: params.checked, actualChecked, actionId, diff, ...settle, ...verification },
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
catch (err) {
|
|
690
|
-
if (actionId !== null) {
|
|
691
|
-
deps.finishTrackedAction(actionId, { status: "error", afterUrl: deps.getActivePageOrNull()?.url() ?? "", error: err.message, beforeState: beforeState ?? undefined });
|
|
692
|
-
}
|
|
693
|
-
const errorShot = await deps.captureErrorScreenshot(deps.getActivePageOrNull());
|
|
694
|
-
const content = [{ type: "text", text: `Set checked failed: ${err.message}` }];
|
|
695
|
-
if (errorShot) {
|
|
696
|
-
content.push({ type: "image", data: errorShot.data, mimeType: errorShot.mimeType });
|
|
697
|
-
}
|
|
698
|
-
return { content, details: { error: err.message }, isError: true };
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
});
|
|
702
|
-
// -------------------------------------------------------------------------
|
|
703
|
-
// browser_set_viewport
|
|
704
|
-
// -------------------------------------------------------------------------
|
|
705
|
-
pi.registerTool({
|
|
706
|
-
name: "browser_set_viewport",
|
|
707
|
-
label: "Browser Set Viewport",
|
|
708
|
-
description: "Resize the browser viewport to test responsive layouts at different screen sizes. Use presets for common breakpoints or specify exact pixel dimensions. Essential for verifying mobile/tablet/desktop layouts.",
|
|
709
|
-
parameters: Type.Object({
|
|
710
|
-
preset: Type.Optional(StringEnum(["mobile", "tablet", "desktop", "wide"])),
|
|
711
|
-
width: Type.Optional(Type.Number({ description: "Custom viewport width in pixels (requires height too)" })),
|
|
712
|
-
height: Type.Optional(Type.Number({ description: "Custom viewport height in pixels (requires width too)" })),
|
|
713
|
-
}),
|
|
714
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
715
|
-
try {
|
|
716
|
-
const { page: p } = await deps.ensureBrowser();
|
|
717
|
-
let width;
|
|
718
|
-
let height;
|
|
719
|
-
let label;
|
|
720
|
-
if (params.preset) {
|
|
721
|
-
switch (params.preset) {
|
|
722
|
-
case "mobile":
|
|
723
|
-
width = 390;
|
|
724
|
-
height = 844;
|
|
725
|
-
label = "mobile (390×844)";
|
|
726
|
-
break;
|
|
727
|
-
case "tablet":
|
|
728
|
-
width = 768;
|
|
729
|
-
height = 1024;
|
|
730
|
-
label = "tablet (768×1024)";
|
|
731
|
-
break;
|
|
732
|
-
case "desktop":
|
|
733
|
-
width = 1280;
|
|
734
|
-
height = 800;
|
|
735
|
-
label = "desktop (1280×800)";
|
|
736
|
-
break;
|
|
737
|
-
case "wide":
|
|
738
|
-
width = 1920;
|
|
739
|
-
height = 1080;
|
|
740
|
-
label = "wide (1920×1080)";
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
else if (params.width !== undefined && params.height !== undefined) {
|
|
745
|
-
width = params.width;
|
|
746
|
-
height = params.height;
|
|
747
|
-
label = `custom (${width}×${height})`;
|
|
748
|
-
}
|
|
749
|
-
else {
|
|
750
|
-
return {
|
|
751
|
-
content: [
|
|
752
|
-
{
|
|
753
|
-
type: "text",
|
|
754
|
-
text: "Provide either a preset (mobile/tablet/desktop/wide) or both width and height.",
|
|
755
|
-
},
|
|
756
|
-
],
|
|
757
|
-
details: {},
|
|
758
|
-
isError: true,
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
await p.setViewportSize({ width: width, height: height });
|
|
762
|
-
return {
|
|
763
|
-
content: [{ type: "text", text: `Viewport set to ${label}` }],
|
|
764
|
-
details: { width: width, height: height, label: label },
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
catch (err) {
|
|
768
|
-
return {
|
|
769
|
-
content: [{ type: "text", text: `Set viewport failed: ${err.message}` }],
|
|
770
|
-
details: { error: err.message },
|
|
771
|
-
isError: true,
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
},
|
|
775
|
-
});
|
|
776
|
-
}
|