taphound 0.2.0-dev.1 → 0.2.0-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -149
- package/README.zh-CN.md +47 -147
- package/assets/skills/taphound-case-suite/SKILL.md +363 -0
- package/assets/skills/taphound-case-suite/schemas/base-flow-record.schema.json +22 -0
- package/assets/skills/taphound-case-suite/schemas/case-catalog.schema.json +26 -0
- package/assets/skills/taphound-case-suite/schemas/case-ledger.schema.json +158 -0
- package/assets/skills/taphound-case-suite/schemas/suite-input.schema.json +41 -0
- package/assets/skills/taphound-case-suite/schemas/transition.schema.json +61 -0
- package/assets/skills/taphound-case-suite/scripts/ledger.mjs +1207 -0
- package/assets/skills/taphound-case-suite/templates/base-flow-record.example.json +20 -0
- package/assets/skills/taphound-case-suite/templates/suite-input.example.json +27 -0
- package/assets/skills/taphound-case-suite/templates/transition.example.json +8 -0
- package/assets/skills/taphound-flash/SKILL.md +115 -0
- package/assets/skills/taphound-flash/scripts/flash.mjs +585 -0
- package/assets/skills/taphound-flash/templates/flash-plan.example.json +15 -0
- package/assets/skills/taphound-journey-brief-author/CONTEXT-GUIDE.md +471 -0
- package/assets/skills/taphound-journey-brief-author/SKILL.md +494 -0
- package/assets/skills/taphound-journey-brief-author/prompts/brief-author-role.md +96 -0
- package/assets/skills/taphound-journey-brief-author/prompts/brief-author-role.zh-CN.md +80 -0
- package/assets/skills/taphound-journey-brief-author/prompts/context-analyze-project.md +309 -0
- package/assets/skills/taphound-journey-brief-author/schemas/context-refresh-result.json +123 -0
- package/assets/skills/taphound-journey-brief-author/schemas/project-context-module.json +192 -0
- package/assets/skills/taphound-journey-brief-author/schemas/project-context.json +152 -0
- package/assets/skills/taphound-journey-brief-author/templates/project-context-module.example.json +58 -0
- package/assets/skills/taphound-journey-brief-author/templates/project-context.example.json +51 -0
- package/assets/skills/taphound-journey-brief-author/templates/taphound-journey-brief.template.md +63 -0
- package/assets/skills/taphound-journey-generator/SKILL.md +507 -0
- package/assets/skills/{taphound-ai-journey → taphound-journey-generator}/prompts/check-completion.md +3 -0
- package/assets/skills/taphound-journey-generator/prompts/consume-journey-brief.md +52 -0
- package/assets/skills/taphound-journey-generator/prompts/generate-step.md +211 -0
- package/assets/skills/taphound-journey-generator/prompts/select-flow.md +91 -0
- package/assets/skills/taphound-journey-generator/references/bridge.md +35 -0
- package/assets/skills/taphound-journey-generator/references/mid-session.md +44 -0
- package/assets/skills/taphound-journey-generator/schemas/external-flow.json +37 -0
- package/assets/skills/taphound-journey-generator/schemas/flow.json +28 -0
- package/assets/skills/taphound-journey-generator/schemas/journey-source.json +25 -0
- package/assets/skills/{taphound-ai-journey → taphound-journey-generator}/schemas/observe-output.json +13 -4
- package/assets/skills/{taphound-ai-journey → taphound-journey-generator}/schemas/proposed-step-envelope.json +127 -5
- package/assets/skills/taphound-journey-generator/scripts/envelope.mjs +578 -0
- package/assets/skills/taphound-journey-generator/templates/external-flow.example.json +22 -0
- package/assets/skills/taphound-journey-generator/templates/flow.example.json +22 -0
- package/assets/skills/taphound-journey-generator/templates/journey-source.example.json +17 -0
- package/assets/skills/taphound-journey-generator/templates/taphound-journey-brief.example.md +70 -0
- package/assets/skills/taphound-verify-change/SKILL.md +91 -0
- package/assets/skills/taphound-verify-change/references/accept.md +38 -0
- package/assets/skills/taphound-verify-change/references/preserve.md +357 -0
- package/assets/skills/taphound-verify-change/schemas/workflow-manifest.schema.json +295 -0
- package/assets/skills/taphound-verify-change/scripts/handoff.mjs +482 -0
- package/assets/skills/taphound-verify-change/scripts/ui-refactor.mjs +505 -0
- package/dist/adapters/adb/adb-adapter.d.ts +16 -2
- package/dist/adapters/adb/adb-adapter.js +199 -0
- package/dist/adapters/adb/system-uiautomator-snapshot-provider.d.ts +13 -0
- package/dist/adapters/adb/system-uiautomator-snapshot-provider.js +122 -0
- package/dist/adapters/adb/ui-automator-parser.d.ts +3 -0
- package/dist/adapters/adb/ui-automator-parser.js +160 -0
- package/dist/adapters/adb/window-topology-parser.d.ts +2 -0
- package/dist/adapters/adb/window-topology-parser.js +101 -0
- package/dist/adapters/android-cli/android-cli-adapter.d.ts +16 -8
- package/dist/adapters/android-cli/android-cli-adapter.js +137 -15
- package/dist/adapters/android-cli/android-cli-snapshot-provider.d.ts +9 -0
- package/dist/adapters/android-cli/android-cli-snapshot-provider.js +99 -0
- package/dist/adapters/android-cli/layout-parser.js +12 -8
- package/dist/adapters/appium/appium-doctor.d.ts +7 -0
- package/dist/adapters/appium/appium-doctor.js +128 -0
- package/dist/adapters/appium/appium-ui-snapshot-provider.d.ts +42 -0
- package/dist/adapters/appium/appium-ui-snapshot-provider.js +309 -0
- package/dist/adapters/camera/camera-probe-adapter.d.ts +18 -0
- package/dist/adapters/camera/camera-probe-adapter.js +286 -0
- package/dist/adapters/filesystem/artifact-store.js +40 -1
- package/dist/adapters/filesystem/context-document-writer.d.ts +15 -0
- package/dist/adapters/filesystem/context-document-writer.js +112 -0
- package/dist/adapters/filesystem/diagnostics-journal.d.ts +17 -0
- package/dist/adapters/filesystem/diagnostics-journal.js +130 -0
- package/dist/adapters/filesystem/external-flow-registry.d.ts +17 -0
- package/dist/adapters/filesystem/external-flow-registry.js +325 -0
- package/dist/adapters/filesystem/generation-session-store.d.ts +17 -11
- package/dist/adapters/filesystem/generation-session-store.js +281 -855
- package/dist/adapters/filesystem/generation-store/session-lock.d.ts +29 -0
- package/dist/adapters/filesystem/generation-store/session-lock.js +202 -0
- package/dist/adapters/filesystem/generation-store/session-transitions.d.ts +24 -0
- package/dist/adapters/filesystem/generation-store/session-transitions.js +340 -0
- package/dist/adapters/filesystem/generation-store/store-files.d.ts +50 -0
- package/dist/adapters/filesystem/generation-store/store-files.js +363 -0
- package/dist/adapters/filesystem/journey-composition-store.d.ts +23 -0
- package/dist/adapters/filesystem/journey-composition-store.js +151 -0
- package/dist/adapters/filesystem/knowledge-registry.d.ts +12 -0
- package/dist/adapters/filesystem/knowledge-registry.js +223 -0
- package/dist/adapters/filesystem/project-bound-file.js +3 -5
- package/dist/adapters/filesystem/project-file-inspector.d.ts +2 -0
- package/dist/adapters/filesystem/project-file-inspector.js +57 -28
- package/dist/adapters/filesystem/project-identity-inspector.d.ts +7 -0
- package/dist/adapters/filesystem/project-identity-inspector.js +215 -0
- package/dist/adapters/filesystem/project-inventory-inspector.d.ts +8 -0
- package/dist/adapters/filesystem/project-inventory-inspector.js +93 -0
- package/dist/adapters/filesystem/project-module-discoverer.d.ts +6 -0
- package/dist/adapters/filesystem/project-module-discoverer.js +158 -0
- package/dist/adapters/filesystem/skill-installer.d.ts +7 -2
- package/dist/adapters/filesystem/skill-installer.js +40 -11
- package/dist/adapters/filesystem/workspace-layout.d.ts +7 -0
- package/dist/adapters/filesystem/workspace-layout.js +57 -0
- package/dist/adapters/git/node-git-diff.d.ts +17 -0
- package/dist/adapters/git/node-git-diff.js +114 -0
- package/dist/adapters/process/node-detached-process-launcher.d.ts +6 -0
- package/dist/adapters/process/node-detached-process-launcher.js +96 -0
- package/dist/adapters/process/node-process-runner.js +11 -2
- package/dist/adapters/prompt/inquirer-align-prompt.d.ts +27 -0
- package/dist/adapters/prompt/inquirer-align-prompt.js +65 -0
- package/dist/adapters/prompt/inquirer-generation-prompt.js +3 -0
- package/dist/adapters/prompt/inquirer-recorder-prompt.d.ts +9 -1
- package/dist/adapters/prompt/inquirer-recorder-prompt.js +63 -0
- package/dist/adapters/runtime/adb-runtime-backend.d.ts +67 -0
- package/dist/adapters/runtime/adb-runtime-backend.js +206 -0
- package/dist/adapters/runtime/fake-runtime-backend.d.ts +87 -0
- package/dist/adapters/runtime/fake-runtime-backend.js +240 -0
- package/dist/adapters/runtime/mobile-mcp/mcp-tool-client.d.ts +45 -0
- package/dist/adapters/runtime/mobile-mcp/mcp-tool-client.js +153 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-errors.d.ts +23 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-errors.js +39 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-responses.d.ts +20 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-responses.js +180 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-runtime-backend.d.ts +78 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-runtime-backend.js +379 -0
- package/dist/adapters/runtime/mobile-mcp/mobile-mcp-tools.d.ts +46 -0
- package/dist/adapters/runtime/session-adb-view.d.ts +53 -0
- package/dist/adapters/runtime/session-adb-view.js +193 -0
- package/dist/adapters/runtime/session-backed-ports.d.ts +21 -0
- package/dist/adapters/runtime/session-backed-ports.js +43 -0
- package/dist/adapters/runtime/shared-session-runtime-backend.d.ts +12 -0
- package/dist/adapters/runtime/shared-session-runtime-backend.js +64 -0
- package/dist/adapters/ui/auto-ui-snapshot-provider.d.ts +8 -0
- package/dist/adapters/ui/auto-ui-snapshot-provider.js +48 -0
- package/dist/adapters/ui/device-layout-temp.d.ts +6 -0
- package/dist/adapters/ui/device-layout-temp.js +18 -0
- package/dist/adapters/ui/device-ui-environment.d.ts +13 -0
- package/dist/adapters/ui/device-ui-environment.js +81 -0
- package/dist/adapters/ui/layout-normalization.d.ts +9 -0
- package/dist/adapters/ui/layout-normalization.js +44 -0
- package/dist/adapters/ui/ui-snapshot-error.d.ts +11 -0
- package/dist/adapters/ui/ui-snapshot-error.js +12 -0
- package/dist/adapters/ui/ui-snapshot-support.d.ts +15 -0
- package/dist/adapters/ui/ui-snapshot-support.js +12 -0
- package/dist/application/align/align-service.d.ts +42 -0
- package/dist/application/align/align-service.js +106 -0
- package/dist/application/assertion/expectation-evaluator.d.ts +18 -5
- package/dist/application/assertion/expectation-evaluator.js +156 -18
- package/dist/application/assertion/guarded-expectation.d.ts +45 -0
- package/dist/application/assertion/guarded-expectation.js +74 -0
- package/dist/application/checkpoint/baseline-capturer.d.ts +26 -0
- package/dist/application/checkpoint/baseline-capturer.js +163 -0
- package/dist/application/checkpoint/baseline-error.d.ts +5 -0
- package/dist/application/checkpoint/baseline-error.js +8 -0
- package/dist/application/checkpoint/baseline-service.d.ts +31 -0
- package/dist/application/checkpoint/baseline-service.js +147 -0
- package/dist/application/checkpoint/checkpoint-evaluator.d.ts +35 -0
- package/dist/application/checkpoint/checkpoint-evaluator.js +415 -0
- package/dist/application/checkpoint/regression-comparator.d.ts +18 -0
- package/dist/application/checkpoint/regression-comparator.js +192 -0
- package/dist/application/collector/logcat-collector.d.ts +22 -1
- package/dist/application/collector/logcat-collector.js +103 -15
- package/dist/application/collector/logcat-event.d.ts +8 -0
- package/dist/application/collector/logcat-event.js +79 -0
- package/dist/application/collector/logcat-stop.d.ts +2 -0
- package/dist/application/collector/logcat-stop.js +11 -0
- package/dist/application/context/context-generator.d.ts +45 -0
- package/dist/application/context/context-generator.js +228 -0
- package/dist/application/context/context-loader.d.ts +40 -0
- package/dist/application/context/context-loader.js +223 -0
- package/dist/application/context/context-refresher.d.ts +59 -0
- package/dist/application/context/context-refresher.js +349 -0
- package/dist/application/context/context-rehasher.d.ts +36 -0
- package/dist/application/context/context-rehasher.js +110 -0
- package/dist/application/context/context-validator.d.ts +23 -1
- package/dist/application/context/context-validator.js +116 -9
- package/dist/application/context/evidence-hash.d.ts +1 -0
- package/dist/application/context/evidence-hash.js +125 -0
- package/dist/application/context/evidence-match.d.ts +9 -0
- package/dist/application/context/evidence-match.js +8 -0
- package/dist/application/context/shard-identity.d.ts +2 -0
- package/dist/application/context/shard-identity.js +7 -0
- package/dist/application/contract/contract-loader.d.ts +25 -0
- package/dist/application/contract/contract-loader.js +68 -0
- package/dist/application/contract/contract-review.d.ts +25 -0
- package/dist/application/contract/contract-review.js +51 -0
- package/dist/application/contract/contract-verifier.d.ts +53 -0
- package/dist/application/contract/contract-verifier.js +645 -0
- package/dist/application/devices/resolve-device-assignments.d.ts +21 -0
- package/dist/application/devices/resolve-device-assignments.js +60 -0
- package/dist/application/diagnosis/failure-classifier.d.ts +23 -0
- package/dist/application/diagnosis/failure-classifier.js +179 -0
- package/dist/application/diagnostics/diagnostics-exporter.d.ts +29 -0
- package/dist/application/diagnostics/diagnostics-exporter.js +283 -0
- package/dist/application/diagnostics/ui-capture-telemetry.d.ts +16 -0
- package/dist/application/diagnostics/ui-capture-telemetry.js +81 -0
- package/dist/application/doctor/doctor-service.d.ts +36 -3
- package/dist/application/doctor/doctor-service.js +255 -25
- package/dist/application/generation/generation-app-preparer.d.ts +20 -0
- package/dist/application/generation/generation-app-preparer.js +28 -0
- package/dist/application/generation/generation-config-service.d.ts +21 -0
- package/dist/application/generation/generation-config-service.js +53 -0
- package/dist/application/generation/generation-confirmation-service.d.ts +14 -3
- package/dist/application/generation/generation-confirmation-service.js +109 -24
- package/dist/application/generation/generation-context-snapshot.d.ts +6 -0
- package/dist/application/generation/generation-context-snapshot.js +29 -0
- package/dist/application/generation/generation-finalizer.d.ts +15 -9
- package/dist/application/generation/generation-finalizer.js +167 -70
- package/dist/application/generation/generation-publisher.js +12 -8
- package/dist/application/generation/generation-recovery-service.d.ts +35 -0
- package/dist/application/generation/generation-recovery-service.js +144 -0
- package/dist/application/generation/generation-reopen-service.d.ts +15 -0
- package/dist/application/generation/generation-reopen-service.js +37 -0
- package/dist/application/generation/generation-replace-service.d.ts +32 -0
- package/dist/application/generation/generation-replace-service.js +116 -0
- package/dist/application/generation/generation-starter.d.ts +44 -4
- package/dist/application/generation/generation-starter.js +175 -8
- package/dist/application/generation/generation-step-executor.d.ts +67 -5
- package/dist/application/generation/generation-step-executor.js +471 -108
- package/dist/application/generation/proposed-step-validator.js +96 -30
- package/dist/application/generation/replay-policy-loader.d.ts +16 -0
- package/dist/application/generation/replay-policy-loader.js +29 -0
- package/dist/application/generation/risk-evaluator.d.ts +4 -1
- package/dist/application/generation/risk-evaluator.js +118 -3
- package/dist/application/generation/runtime-observer.d.ts +39 -7
- package/dist/application/generation/runtime-observer.js +193 -24
- package/dist/application/impact/impact-resolver.d.ts +32 -0
- package/dist/application/impact/impact-resolver.js +160 -0
- package/dist/application/init/init-service.js +26 -13
- package/dist/application/interaction/action-executor.d.ts +3 -2
- package/dist/application/interaction/action-executor.js +11 -1
- package/dist/application/interaction/action-target.d.ts +17 -0
- package/dist/application/interaction/action-target.js +40 -0
- package/dist/application/interaction/external-step-runner.d.ts +153 -0
- package/dist/application/interaction/external-step-runner.js +332 -0
- package/dist/application/interaction/fallback-resolver.d.ts +6 -3
- package/dist/application/interaction/fallback-resolver.js +7 -5
- package/dist/application/interaction/scroll-to-executor.d.ts +17 -3
- package/dist/application/interaction/scroll-to-executor.js +118 -36
- package/dist/application/journey/external-flow-resolver.d.ts +25 -0
- package/dist/application/journey/external-flow-resolver.js +22 -0
- package/dist/application/journey/journey-check-service.d.ts +54 -0
- package/dist/application/journey/journey-check-service.js +207 -0
- package/dist/application/journey/journey-promoter.d.ts +26 -0
- package/dist/application/journey/journey-promoter.js +123 -0
- package/dist/application/journey/journey-resolver.d.ts +42 -0
- package/dist/application/journey/journey-resolver.js +239 -0
- package/dist/application/journey/journey-retirer.d.ts +25 -0
- package/dist/application/journey/journey-retirer.js +87 -0
- package/dist/application/knowledge/anchor-resolver.d.ts +36 -0
- package/dist/application/knowledge/anchor-resolver.js +110 -0
- package/dist/application/knowledge/knowledge-loader.d.ts +16 -0
- package/dist/application/knowledge/knowledge-loader.js +36 -0
- package/dist/application/locator/layout-failure-summary.d.ts +2 -0
- package/dist/application/locator/layout-failure-summary.js +67 -0
- package/dist/application/locator/layout-traversal.d.ts +11 -0
- package/dist/application/locator/layout-traversal.js +18 -0
- package/dist/application/locator/locator-resolver.d.ts +13 -1
- package/dist/application/locator/locator-resolver.js +182 -18
- package/dist/application/observe/observe-service.d.ts +20 -0
- package/dist/application/observe/observe-service.js +91 -0
- package/dist/application/project/project-describer.d.ts +14 -6
- package/dist/application/project/project-describer.js +38 -5
- package/dist/application/recognition/screen-detector.d.ts +28 -0
- package/dist/application/recognition/screen-detector.js +111 -0
- package/dist/application/recorder/locator-selector.js +151 -17
- package/dist/application/recorder/recorder-service.d.ts +16 -4
- package/dist/application/recorder/recorder-service.js +420 -128
- package/dist/application/report/report-writer.d.ts +5 -0
- package/dist/application/report/report-writer.js +17 -1
- package/dist/application/runtime/cold-launch.d.ts +28 -0
- package/dist/application/runtime/cold-launch.js +59 -0
- package/dist/application/runtime/step-runner.d.ts +49 -4
- package/dist/application/runtime/step-runner.js +721 -130
- package/dist/application/runtime/verify-runtime.d.ts +57 -7
- package/dist/application/runtime/verify-runtime.js +577 -175
- package/dist/application/ui/cached-ui-snapshot-provider.d.ts +45 -0
- package/dist/application/ui/cached-ui-snapshot-provider.js +111 -0
- package/dist/application/ui/observed-ui-snapshot-provider.d.ts +15 -0
- package/dist/application/ui/observed-ui-snapshot-provider.js +66 -0
- package/dist/application/ui/ui-snapshot-lifecycle.d.ts +2 -0
- package/dist/application/ui/ui-snapshot-lifecycle.js +8 -0
- package/dist/application/ui/ui-stability-probe.d.ts +9 -0
- package/dist/application/ui/ui-stability-probe.js +24 -0
- package/dist/application/wait/idle-advice.d.ts +6 -0
- package/dist/application/wait/idle-advice.js +27 -0
- package/dist/application/wait/idle-profiles.d.ts +15 -0
- package/dist/application/wait/idle-profiles.js +75 -0
- package/dist/application/wait/idle-waiter.d.ts +28 -4
- package/dist/application/wait/idle-waiter.js +201 -15
- package/dist/cli/commands/align.d.ts +3 -0
- package/dist/cli/commands/align.js +124 -0
- package/dist/cli/commands/baseline.d.ts +3 -0
- package/dist/cli/commands/baseline.js +130 -0
- package/dist/cli/commands/context.js +300 -27
- package/dist/cli/commands/contract.d.ts +3 -0
- package/dist/cli/commands/contract.js +120 -0
- package/dist/cli/commands/diagnose.d.ts +3 -0
- package/dist/cli/commands/diagnose.js +84 -0
- package/dist/cli/commands/doctor.js +16 -9
- package/dist/cli/commands/failure.d.ts +3 -0
- package/dist/cli/commands/failure.js +63 -0
- package/dist/cli/commands/generation/lifecycle-commands.d.ts +5 -0
- package/dist/cli/commands/generation/lifecycle-commands.js +211 -0
- package/dist/cli/commands/generation/session-commands.d.ts +11 -0
- package/dist/cli/commands/generation/session-commands.js +472 -0
- package/dist/cli/commands/generation/shared.d.ts +1414 -0
- package/dist/cli/commands/generation/shared.js +291 -0
- package/dist/cli/commands/generation/step-commands.d.ts +8 -0
- package/dist/cli/commands/generation/step-commands.js +315 -0
- package/dist/cli/commands/generation.js +10 -507
- package/dist/cli/commands/impact.d.ts +3 -0
- package/dist/cli/commands/impact.js +87 -0
- package/dist/cli/commands/init.js +13 -6
- package/dist/cli/commands/journey.d.ts +3 -0
- package/dist/cli/commands/journey.js +382 -0
- package/dist/cli/commands/knowledge.d.ts +3 -0
- package/dist/cli/commands/knowledge.js +93 -0
- package/dist/cli/commands/observe.d.ts +3 -0
- package/dist/cli/commands/observe.js +127 -0
- package/dist/cli/commands/project.js +2 -1
- package/dist/cli/commands/record.js +18 -5
- package/dist/cli/commands/verify.js +326 -64
- package/dist/cli/dependencies.d.ts +136 -1
- package/dist/cli/dependencies.js +504 -52
- package/dist/cli/diagnostics-recorder.d.ts +31 -0
- package/dist/cli/diagnostics-recorder.js +82 -0
- package/dist/cli/diff-verification.d.ts +41 -0
- package/dist/cli/diff-verification.js +192 -0
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +107 -2
- package/dist/cli/output.d.ts +5 -3
- package/dist/cli/output.js +12 -0
- package/dist/cli/program.js +21 -1
- package/dist/cli/project-root.d.ts +1 -0
- package/dist/cli/project-root.js +6 -0
- package/dist/cli/runtime-selection.d.ts +22 -0
- package/dist/cli/runtime-selection.js +92 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +14 -0
- package/dist/cli/workspace-guard.d.ts +2 -0
- package/dist/cli/workspace-guard.js +3 -0
- package/dist/domain/binding-reference.d.ts +4 -0
- package/dist/domain/binding-reference.js +23 -0
- package/dist/domain/checkpoint.d.ts +404 -0
- package/dist/domain/checkpoint.js +297 -0
- package/dist/domain/config.d.ts +107 -1
- package/dist/domain/config.js +52 -6
- package/dist/domain/contract.d.ts +413 -0
- package/dist/domain/contract.js +196 -0
- package/dist/domain/diagnostics.d.ts +1396 -0
- package/dist/domain/diagnostics.js +193 -0
- package/dist/domain/external-flow.d.ts +493 -0
- package/dist/domain/external-flow.js +15 -0
- package/dist/domain/failure-classification.d.ts +176 -0
- package/dist/domain/failure-classification.js +169 -0
- package/dist/domain/failure.d.ts +2 -1
- package/dist/domain/failure.js +123 -0
- package/dist/domain/generation.d.ts +1671 -132
- package/dist/domain/generation.js +202 -13
- package/dist/domain/geometry.d.ts +13 -0
- package/dist/domain/geometry.js +16 -0
- package/dist/domain/impact.d.ts +71 -0
- package/dist/domain/impact.js +76 -0
- package/dist/domain/init.d.ts +12 -4
- package/dist/domain/init.js +24 -18
- package/dist/domain/journey-composition.d.ts +2285 -0
- package/dist/domain/journey-composition.js +85 -0
- package/dist/domain/journey-lifecycle.d.ts +10 -0
- package/dist/domain/journey-lifecycle.js +9 -0
- package/dist/domain/journey.d.ts +2419 -212
- package/dist/domain/journey.js +384 -14
- package/dist/domain/knowledge.d.ts +165 -0
- package/dist/domain/knowledge.js +188 -0
- package/dist/domain/layout.d.ts +34 -5
- package/dist/domain/layout.js +64 -6
- package/dist/domain/locator-evidence.d.ts +3 -0
- package/dist/domain/locator-evidence.js +36 -0
- package/dist/domain/logcat-event.d.ts +54 -0
- package/dist/domain/logcat-event.js +40 -0
- package/dist/domain/observation.d.ts +33 -0
- package/dist/domain/observation.js +18 -0
- package/dist/domain/project-context.d.ts +219 -1
- package/dist/domain/project-context.js +209 -6
- package/dist/domain/proposed-step.d.ts +340 -60
- package/dist/domain/proposed-step.js +23 -3
- package/dist/domain/report.d.ts +1455 -28
- package/dist/domain/report.js +211 -14
- package/dist/domain/runtime-snapshot.d.ts +58 -1
- package/dist/domain/runtime-snapshot.js +14 -3
- package/dist/domain/runtime.d.ts +50 -0
- package/dist/domain/runtime.js +36 -0
- package/dist/domain/system-app-profiles.d.ts +6 -0
- package/dist/domain/system-app-profiles.js +43 -0
- package/dist/domain/ui-backend.d.ts +28 -0
- package/dist/domain/ui-backend.js +33 -0
- package/dist/domain/ui-cache.d.ts +11 -0
- package/dist/domain/ui-cache.js +10 -0
- package/dist/domain/verify-receipt.d.ts +17 -0
- package/dist/domain/verify-receipt.js +17 -0
- package/dist/domain/window-hierarchy.d.ts +84 -0
- package/dist/domain/window-hierarchy.js +172 -0
- package/dist/domain/workflow-manifest.d.ts +77 -0
- package/dist/domain/workflow-manifest.js +136 -0
- package/dist/domain/workspace.d.ts +30 -0
- package/dist/domain/workspace.js +74 -0
- package/dist/ports/adb.d.ts +34 -1
- package/dist/ports/align-prompt.d.ts +11 -0
- package/dist/ports/align-prompt.js +6 -0
- package/dist/ports/anchor-resolver.d.ts +30 -0
- package/dist/ports/anchor-resolver.js +1 -0
- package/dist/ports/annotated-screen-resolver.d.ts +4 -0
- package/dist/ports/annotated-screen-resolver.js +1 -0
- package/dist/ports/camera-probe.d.ts +23 -0
- package/dist/ports/camera-probe.js +8 -0
- package/dist/ports/context-document-writer.d.ts +24 -0
- package/dist/ports/context-document-writer.js +1 -0
- package/dist/ports/detached-process-launcher.d.ts +12 -0
- package/dist/ports/detached-process-launcher.js +1 -0
- package/dist/ports/diagnostics.d.ts +15 -0
- package/dist/ports/diagnostics.js +1 -0
- package/dist/ports/external-flow-registry.d.ts +37 -0
- package/dist/ports/external-flow-registry.js +1 -0
- package/dist/ports/generation-prompt.d.ts +2 -1
- package/dist/ports/generation-session-store.d.ts +12 -2
- package/dist/ports/git-diff.d.ts +9 -0
- package/dist/ports/git-diff.js +1 -0
- package/dist/ports/journey-composition-store.d.ts +17 -0
- package/dist/ports/journey-composition-store.js +1 -0
- package/dist/ports/knowledge-registry.d.ts +20 -0
- package/dist/ports/knowledge-registry.js +1 -0
- package/dist/ports/process-runner.d.ts +7 -0
- package/dist/ports/project-file-inspector.d.ts +1 -0
- package/dist/ports/project-identity-inspector.d.ts +24 -0
- package/dist/ports/project-identity-inspector.js +1 -0
- package/dist/ports/project-inventory-inspector.d.ts +21 -0
- package/dist/ports/project-inventory-inspector.js +1 -0
- package/dist/ports/project-module-discoverer.d.ts +26 -0
- package/dist/ports/project-module-discoverer.js +1 -0
- package/dist/ports/recorder-prompt.d.ts +10 -1
- package/dist/ports/runtime-backend.d.ts +89 -0
- package/dist/ports/runtime-backend.js +13 -0
- package/dist/ports/runtime-capability.d.ts +12 -0
- package/dist/ports/runtime-capability.js +20 -0
- package/dist/ports/runtime-session-ports.d.ts +25 -0
- package/dist/ports/runtime-session-ports.js +1 -0
- package/dist/ports/screenshot.d.ts +11 -0
- package/dist/ports/screenshot.js +1 -0
- package/dist/ports/skill-installer.d.ts +2 -2
- package/dist/ports/ui-snapshot.d.ts +35 -0
- package/dist/ports/ui-snapshot.js +1 -0
- package/dist/ports/ui-stability.d.ts +19 -0
- package/dist/ports/ui-stability.js +1 -0
- package/dist/ports/workspace-layout.d.ts +4 -0
- package/dist/ports/workspace-layout.js +1 -0
- package/dist/shared/errors.d.ts +2 -0
- package/dist/shared/errors.js +22 -0
- package/dist/shared/paths.d.ts +2 -0
- package/dist/shared/paths.js +24 -0
- package/dist/shared/strings.d.ts +2 -0
- package/dist/shared/strings.js +16 -0
- package/package.json +7 -2
- package/assets/skills/taphound-ai-journey/GUIDE.md +0 -862
- package/assets/skills/taphound-ai-journey/SKILL.md +0 -377
- package/assets/skills/taphound-ai-journey/prompts/analyze-project.md +0 -526
- package/assets/skills/taphound-ai-journey/prompts/generate-step.md +0 -109
- package/assets/skills/taphound-ai-journey/schemas/project-context.json +0 -81
- package/assets/skills/taphound-ai-journey/templates/project-context.example.json +0 -49
- package/dist/ports/android-cli.d.ts +0 -21
- /package/dist/{ports/android-cli.js → adapters/runtime/mobile-mcp/mobile-mcp-tools.js} +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Generate Next Proposed Step
|
|
2
|
+
|
|
3
|
+
You are generating the next proposed step in a TapHound journey. You have:
|
|
4
|
+
|
|
5
|
+
- **Goal**: the user's natural-language description of the test scenario.
|
|
6
|
+
- **Project Context Index**: the compact module catalog.
|
|
7
|
+
- **Selected module summaries**: only the shards cryptographically bound at
|
|
8
|
+
`generation start`, containing known Activities, screens, elements,
|
|
9
|
+
transitions, and Logcat candidates.
|
|
10
|
+
- **Snapshot**: the current device state from `generation observe --json`,
|
|
11
|
+
including the `layout` array (all visible UI elements with their
|
|
12
|
+
properties) and the current `activity`.
|
|
13
|
+
- **Completed steps**: a list of steps that have already succeeded in this
|
|
14
|
+
session.
|
|
15
|
+
- **Base Flow**: optional bound reusable prefix metadata. Its exit Activity is
|
|
16
|
+
the generation starting checkpoint; its navigation is already complete.
|
|
17
|
+
|
|
18
|
+
## Layout Structure
|
|
19
|
+
|
|
20
|
+
`snapshot.layout` is an array of root `LayoutElement` objects, not a flat
|
|
21
|
+
element list. Every element has recursive `children`; traverse the complete
|
|
22
|
+
tree when finding a target. `LayoutElement.id` is an internal parser identity
|
|
23
|
+
and is never a Locator field. Use only `resourceId`, `text`, and
|
|
24
|
+
`contentDescription`, in that priority order, plus `within` and `index` when
|
|
25
|
+
needed.
|
|
26
|
+
|
|
27
|
+
## Your Task
|
|
28
|
+
|
|
29
|
+
Determine the next single action that advances the Goal. Output one proposed
|
|
30
|
+
step JSON object (without the `binding` field — the caller adds binding from
|
|
31
|
+
the observe result).
|
|
32
|
+
|
|
33
|
+
## How to Decide
|
|
34
|
+
|
|
35
|
+
1. **Identify what remains**: Compare the Goal against completed steps. What
|
|
36
|
+
is the next logical action? Do not regenerate navigation already supplied by
|
|
37
|
+
the bound Base Flow.
|
|
38
|
+
|
|
39
|
+
2. **Verify Context coverage**: Find `snapshot.activity` in the selected
|
|
40
|
+
module summaries. If no selected shard covers it, return
|
|
41
|
+
`{"error":"context coverage missing","activity":"..."}`. Do not read or
|
|
42
|
+
add an unbound shard after session start.
|
|
43
|
+
|
|
44
|
+
3. **Verify hierarchy completeness**: Inspect `snapshot.windowHierarchy`
|
|
45
|
+
when present. If its status is `incomplete`, do not propose any action,
|
|
46
|
+
including Back or Wait. Return
|
|
47
|
+
`{"error":"window hierarchy incomplete","diagnostics":[...],"recovery":[...]}`
|
|
48
|
+
using the snapshot's exact diagnostics and recovery values. If the status
|
|
49
|
+
is `unknown`, continue only with elements already present in
|
|
50
|
+
`snapshot.layout`; never infer missing PopupWindow, dialog, or overlay
|
|
51
|
+
controls from the screenshot.
|
|
52
|
+
|
|
53
|
+
4. **Find the target element**: Look through `snapshot.layout` for an element
|
|
54
|
+
that matches the next intended action:
|
|
55
|
+
- Match by `resourceId` first (highest priority).
|
|
56
|
+
- If no `resourceId` match, match by `text`.
|
|
57
|
+
- If no `text` match, match by `contentDescription`.
|
|
58
|
+
- If identity fields still match multiple live elements, first add `within`
|
|
59
|
+
with a deterministic ancestor Locator when available. Add zero-based
|
|
60
|
+
`index` only when identical candidates remain in that scope.
|
|
61
|
+
- Do not add Locator `evidence`. Core derives versioned semantic evidence
|
|
62
|
+
from the bound snapshot when it persists a resolvable indexed step.
|
|
63
|
+
- The element must be `enabled: true`.
|
|
64
|
+
- For `click`: prefer `clickable: true` elements.
|
|
65
|
+
- For `inputText`: the target should be `focusable: true` (an EditText).
|
|
66
|
+
Do not include a `locator` for `inputText` — the Core uses the focused
|
|
67
|
+
element.
|
|
68
|
+
- For `swipe`: the target should be `scrollable: true` with `bounds`.
|
|
69
|
+
- For `scrollTo`: specify both `locator` (target) and `container`
|
|
70
|
+
(scrollable parent).
|
|
71
|
+
|
|
72
|
+
5. **Detect cross-app transitions**: Before proposing a `click` on a trigger
|
|
73
|
+
that opens an external app, check whether the element clearly initiates a
|
|
74
|
+
cross-app transition (e.g., a camera button, "choose from gallery", "attach
|
|
75
|
+
file", share sheet). If so, return a `bridge` signal (see **Cross-app
|
|
76
|
+
flows** in Rules) instead of a `click`. If an External Flow was bound at
|
|
77
|
+
`generation start --external-flow` and its `escapedPackageName` matches the
|
|
78
|
+
scenario, include `"flow": "<name>"` in the bridge signal so the caller can
|
|
79
|
+
pass `--flow` to `generation bridge` for deterministic auto replay.
|
|
80
|
+
|
|
81
|
+
6. **Determine activity.before**: This is `snapshot.activity` (the current
|
|
82
|
+
Activity class). The proposed step only includes `activity.before` —
|
|
83
|
+
never `activity.after`. The Core determines the after-Activity from
|
|
84
|
+
live device observation after executing the action.
|
|
85
|
+
|
|
86
|
+
7. **Add expect (optional)**: Only if there is a deterministic, verifiable
|
|
87
|
+
outcome:
|
|
88
|
+
- `element`: a specific element should appear after the action (e.g., a
|
|
89
|
+
search input field appears after clicking "open search"). Optional
|
|
90
|
+
predicates: `enabled` and `clickable` compare the resolved element's
|
|
91
|
+
state exactly on every poll (so `enabled: true` also waits-until-enabled
|
|
92
|
+
within `timeoutMs`); `absent: true` passes only when the locator matches
|
|
93
|
+
zero elements — use it for "element disappears" semantics, never combined
|
|
94
|
+
with `enabled`/`clickable`.
|
|
95
|
+
- `logcat`: a specific log line should be emitted (e.g., the source code
|
|
96
|
+
shows `Log.i("SearchViewModel", "submitted query=" + query)` — use
|
|
97
|
+
`tag: "SearchViewModel"`, `pattern: "submitted query=..."`,
|
|
98
|
+
`match: "literal"`). A `literal` pattern must be the stable prefix of the
|
|
99
|
+
logged message, never a whole line copied from a device run: drop every
|
|
100
|
+
run-varying tail such as `@1f3a2b` identity hashes, object `toString()`
|
|
101
|
+
dumps, timestamps, durations, counts, and generated IDs. When only a
|
|
102
|
+
varying middle can identify the event, use `match: "regex"` and anchor
|
|
103
|
+
the stable words instead of the varying text.
|
|
104
|
+
- `activity`: a specific Activity should be foregrounded.
|
|
105
|
+
- Do not add expectations you cannot verify from source code or Context.
|
|
106
|
+
- Do not invent log patterns that don't exist in the source.
|
|
107
|
+
|
|
108
|
+
## Output Format
|
|
109
|
+
|
|
110
|
+
A single JSON object matching one of the step types in
|
|
111
|
+
`schemas/proposed-step-envelope.json` `$defs/ProposedStep`, but **without**
|
|
112
|
+
the `binding` field. The caller wraps it with binding and snapshot using
|
|
113
|
+
`scripts/envelope.mjs bind` (offline validation, binding auto-filled from the
|
|
114
|
+
preceding observe/step output).
|
|
115
|
+
|
|
116
|
+
Example (click):
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"action": "click",
|
|
120
|
+
"locator": { "resourceId": "open_search" },
|
|
121
|
+
"activity": {
|
|
122
|
+
"before": "dev.taphound.demo.MainActivity"
|
|
123
|
+
},
|
|
124
|
+
"expect": {
|
|
125
|
+
"type": "element",
|
|
126
|
+
"locator": { "resourceId": "search_input" },
|
|
127
|
+
"timeoutMs": 3000
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Example (inputText):
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"action": "inputText",
|
|
136
|
+
"text": "hello world",
|
|
137
|
+
"activity": {
|
|
138
|
+
"before": "dev.taphound.demo.SearchActivity"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Example (bridge — auto replay with a bound External Flow):
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"bridge": true,
|
|
147
|
+
"scenario": "photoCapture",
|
|
148
|
+
"triggerLocator": { "resourceId": "camera_button" },
|
|
149
|
+
"flow": "camera/photo-capture",
|
|
150
|
+
"description": "Capture photo via system camera",
|
|
151
|
+
"activity": {
|
|
152
|
+
"before": "dev.taphound.demo.ProfileActivity"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Example (bridge — manual replay, no flow):
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"bridge": true,
|
|
161
|
+
"scenario": "pickFile",
|
|
162
|
+
"triggerLocator": { "text": "Choose file" },
|
|
163
|
+
"description": "Pick a file via system file picker",
|
|
164
|
+
"activity": {
|
|
165
|
+
"before": "dev.taphound.demo.ChatActivity"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Rules
|
|
171
|
+
|
|
172
|
+
- Never use coordinates, visual guessing, or annotated-label fallback.
|
|
173
|
+
- Never act when `snapshot.windowHierarchy.status` is `incomplete`.
|
|
174
|
+
- The proposed step only includes `activity.before`, never `activity.after`.
|
|
175
|
+
The Core determines `after` from live device observation.
|
|
176
|
+
- Locator priority is fixed: `resourceId` > `text` > `contentDescription`.
|
|
177
|
+
Do not use multiple fields simultaneously unless that is the only way to
|
|
178
|
+
disambiguate. `within` limits matching to a deterministic ancestor's
|
|
179
|
+
descendants; `index` is zero-based and applies only after all identity
|
|
180
|
+
fields have narrowed the live Layout candidates.
|
|
181
|
+
- The `snapshot.layout` from `observe` is the live device layout — it is
|
|
182
|
+
the source of truth for element matching, not the static XML files from
|
|
183
|
+
Context generation. The same `resourceId` may appear in different layout
|
|
184
|
+
XML files, but only one layout is active at runtime. Match against what
|
|
185
|
+
`observe` returns.
|
|
186
|
+
- Activities from library/feature modules are valid navigation targets.
|
|
187
|
+
Use the fully qualified class name from the manifest or source.
|
|
188
|
+
- Do not include `binding` — the caller adds it from the observe result.
|
|
189
|
+
- Do not include `fallback` — proposals do not support fallback.
|
|
190
|
+
- **Cross-app flows**: If the next action would open an external app (system
|
|
191
|
+
camera, image/file picker, share sheet), do NOT propose a `click` step. That
|
|
192
|
+
will fail with `PACKAGE_ESCAPE`. Instead, return:
|
|
193
|
+
`{"bridge": true, "scenario": "photoCapture|pickImage|pickFile|custom",
|
|
194
|
+
"triggerLocator": {...}, "description": "..." (required for custom)}`
|
|
195
|
+
The caller will use `generation bridge` to execute it. Only return this when
|
|
196
|
+
the target element clearly initiates a cross-app transition (e.g., a camera
|
|
197
|
+
button, "choose from gallery", "attach file").
|
|
198
|
+
- When a bound External Flow matches the scenario, include `"flow": "<name>"`
|
|
199
|
+
in the bridge signal. The caller passes `--flow <name>` to
|
|
200
|
+
`generation bridge` so Core resolves the flow, stamps its steps as
|
|
201
|
+
`externalSteps`, and commits with `replayMode: "auto"` for deterministic
|
|
202
|
+
replay. If no flow is bound, omit `flow`; the step commits with
|
|
203
|
+
`replayMode: "manual"` and needs a human operator during finalize.
|
|
204
|
+
- Do NOT include `externalSteps`, `escapedPackageName`, `replayMode`, or
|
|
205
|
+
`escapeTimeoutMs` in the bridge proposal. Core fills these from the resolved
|
|
206
|
+
flow and live device observation. The proposal only carries `flow` (the name)
|
|
207
|
+
and the standard bridge fields.
|
|
208
|
+
- If no actionable element matches the Goal, return:
|
|
209
|
+
`{"error": "no matching element", "reason": "..."}`
|
|
210
|
+
- If the Goal appears complete, return `{"complete": true}` instead of a
|
|
211
|
+
step.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Select a Reusable Base Flow
|
|
2
|
+
|
|
3
|
+
You are selecting an existing TapHound Flow to reuse before AI-driven Journey
|
|
4
|
+
generation.
|
|
5
|
+
|
|
6
|
+
## Inputs
|
|
7
|
+
|
|
8
|
+
- **Goal**: the user's natural-language test scenario.
|
|
9
|
+
- **Project Context Index**: the current validated module catalog.
|
|
10
|
+
- **Flow catalog**: exact output from `taphound journey list-flows --json`.
|
|
11
|
+
|
|
12
|
+
## Selection Procedure
|
|
13
|
+
|
|
14
|
+
1. Ignore every Flow whose `status` is not `valid`. Report invalid candidates;
|
|
15
|
+
never silently repair or bypass them.
|
|
16
|
+
2. Identify the Activity or screen where the Goal's business-specific actions
|
|
17
|
+
begin.
|
|
18
|
+
3. Require the first resolved step to start from a stable Activity that cold
|
|
19
|
+
launch deterministically reaches. `run.activity` is only the cold-launch
|
|
20
|
+
entry and may redirect immediately. Never require a transient Splash
|
|
21
|
+
Activity to remain foreground long enough to become the Flow's first
|
|
22
|
+
checkpoint.
|
|
23
|
+
4. Keep only Flows whose `exitActivity` is a deterministic prerequisite for
|
|
24
|
+
that screen and whose traversed Activities are covered by the Context
|
|
25
|
+
modules selected for generation.
|
|
26
|
+
5. Prefer the deepest valid Flow, meaning the candidate that eliminates the
|
|
27
|
+
largest reusable navigation prefix. For a Goal inside a chat detail screen,
|
|
28
|
+
prefer `chat/open-thread` over `core/launch-home` when both are valid.
|
|
29
|
+
6. Do not select by filename alone. A name containing `core`, `home`, or a Goal
|
|
30
|
+
keyword is not proof that the Flow is applicable.
|
|
31
|
+
7. If no candidate is applicable, return `{"selected": null}` and generate from
|
|
32
|
+
the normal launch state.
|
|
33
|
+
|
|
34
|
+
## Output
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"selected": "chat/open-thread",
|
|
39
|
+
"reason": "Deepest valid Flow whose exit Activity is the Goal's chat screen"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
or:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"selected": null,
|
|
48
|
+
"reason": "No valid Flow ends at a prerequisite screen for this Goal"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Safety Rules
|
|
53
|
+
|
|
54
|
+
- A Flow with missing dependencies, a cycle, an Activity boundary mismatch, or
|
|
55
|
+
stale resolution evidence is unusable.
|
|
56
|
+
- If a selected Flow fails Core replay, stop and report `FLOW_REPLAY_FAILED`.
|
|
57
|
+
Read its Flow name, Verify report path, primary failure, failed-step summary,
|
|
58
|
+
and recovery guidance. Repair or re-record the shared Flow; do not silently
|
|
59
|
+
regenerate it.
|
|
60
|
+
- Do not accept "the device is already on Home" as proof that a failed Flow
|
|
61
|
+
replayed exactly.
|
|
62
|
+
- Bypass reuse only when the user explicitly requests generation without a
|
|
63
|
+
base Flow.
|
|
64
|
+
|
|
65
|
+
## Stable Launch Anchor Example
|
|
66
|
+
|
|
67
|
+
Model `core/launch-home` as readiness at the stable Home destination, not as a
|
|
68
|
+
timing-sensitive `Splash -> Home` transition:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"version": 1,
|
|
73
|
+
"kind": "flow",
|
|
74
|
+
"name": "core/launch-home",
|
|
75
|
+
"includes": [],
|
|
76
|
+
"steps": [{
|
|
77
|
+
"action": "wait",
|
|
78
|
+
"activity": {
|
|
79
|
+
"before": "com.example.app.HomeActivity",
|
|
80
|
+
"after": "com.example.app.HomeActivity"
|
|
81
|
+
},
|
|
82
|
+
"expect": {
|
|
83
|
+
"type": "element",
|
|
84
|
+
"locator": { "resourceId": "home_root" },
|
|
85
|
+
"timeoutMs": 3000
|
|
86
|
+
}
|
|
87
|
+
}]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Choose an element unique to the ready Home screen for the expectation.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Cross-Application Bridge
|
|
2
|
+
|
|
3
|
+
When the Goal requires a cross-app flow (system camera, image/file picker,
|
|
4
|
+
share sheet), a regular `generation step` proposal fails with `PACKAGE_ESCAPE`.
|
|
5
|
+
Use `generation bridge` instead. Core clicks the trigger, detects the escape,
|
|
6
|
+
optionally executes a bound External Flow's steps inside the escaped package,
|
|
7
|
+
waits for return, and captures the post-return snapshot.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
taphound generation bridge \
|
|
11
|
+
--project <project> --session <generationId> \
|
|
12
|
+
--scenario photoCapture \
|
|
13
|
+
--trigger-locator '{"resourceId":"camera_button"}' \
|
|
14
|
+
--flow camera/photo-capture \
|
|
15
|
+
--return-timeout-ms 60000 --escape-timeout-ms 3000 \
|
|
16
|
+
--compact --json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Auto bridge** (deterministic): pass `--flow <name>` to bind a Phase 2
|
|
20
|
+
External Flow. The step commits with `replayMode: "auto"`. **Manual bridge**:
|
|
21
|
+
omit `--flow`; commits with `replayMode: "manual"` (human operator required
|
|
22
|
+
during finalize). Options: `--scenario` (`photoCapture`, `pickImage`,
|
|
23
|
+
`pickFile` built-in, or `custom` with `--description`), `--trigger-locator`
|
|
24
|
+
(inline JSON, must be clickable), `--return-timeout-ms`, `--escape-timeout-ms`
|
|
25
|
+
(default 3000; no escape fails with `BRIDGE_NO_ESCAPE`).
|
|
26
|
+
|
|
27
|
+
Bridge goes through risk confirmation like any step. Failure codes:
|
|
28
|
+
`BRIDGE_NO_ESCAPE`, `SCENARIO_PACKAGE_MISMATCH`, `BRIDGE_NOT_RETURNED`,
|
|
29
|
+
`EXTERNAL_FLOW_NOT_FOUND`, `EXTERNAL_FLOW_STALE`,
|
|
30
|
+
`EXTERNAL_PACKAGE_MISMATCH`, `EXTERNAL_ACTIVITY_MISMATCH`,
|
|
31
|
+
`EXTERNAL_STEP_FAILED`, `EXTERNAL_LOCATOR_STRICTNESS` (external steps require
|
|
32
|
+
`resourceId`-only locators), `MANUAL_STEP_REQUIRED` (non-interactive finalize
|
|
33
|
+
with manual replay — bind an External Flow or use a TTY).
|
|
34
|
+
|
|
35
|
+
A successful bridge returns `nextBinding` and `nextSnapshotRef` like any step.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Correcting and Adjusting a Generation Session
|
|
2
|
+
|
|
3
|
+
**Rewind a wrong committed step** with `step --replace` instead of restarting
|
|
4
|
+
the session or building workarounds on top of a mistake:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
taphound generation step \
|
|
8
|
+
--project <project> --session <generationId> \
|
|
9
|
+
--replace <index> \
|
|
10
|
+
--compact --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Core replays the stored candidate prefix `[0, index)` through the same
|
|
14
|
+
cold-launch replay engine as finalize (honoring the session's current idle
|
|
15
|
+
policy), truncates the candidate to that prefix, and binds a fresh
|
|
16
|
+
post-replay snapshot. The response matches `observe` plus `status:
|
|
17
|
+
"replaced"`, `stepIndex`, `remainingStepCount`, and `truncatedStepCount`;
|
|
18
|
+
the next proposal must bind the returned revision and snapshot. The index
|
|
19
|
+
must be an integer in `[0, candidateStepCount]` (`0` cold-resets without
|
|
20
|
+
replay); an index inside the bound Base Flow prefix fails with
|
|
21
|
+
`FLOW_INVALID`; `--input` and `--replace` are mutually exclusive. Replace is
|
|
22
|
+
rejected with `CONFIG_INVALID` unless the session is `active` with no
|
|
23
|
+
in-flight step, no pending confirmation, and verification and publication
|
|
24
|
+
both `notRun`. A prefix replay failure returns `VERIFICATION_FAILED` and
|
|
25
|
+
leaves the session untouched; superseded step evidence stays in the bundle
|
|
26
|
+
as an audit trail.
|
|
27
|
+
|
|
28
|
+
**Hot-adjust the idle policy** when `IDLE_TIMEOUT` recurs or the screen
|
|
29
|
+
needs a different stability strategy:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
taphound generation config idle \
|
|
33
|
+
--project <project> --session <generationId> \
|
|
34
|
+
--strategy layoutDiff --timeout-ms 20000 \
|
|
35
|
+
--json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
At least one of `--strategy`, `--poll-interval-ms`, `--stable-polls`,
|
|
39
|
+
`--timeout-ms` is required; the patch merges onto the session's current
|
|
40
|
+
policy and advances the session revision, so the next proposal must bind
|
|
41
|
+
the new revision. Rejected with `CONFIG_INVALID` unless the session is
|
|
42
|
+
`active` with no in-flight step, no pending confirmation, and verification
|
|
43
|
+
and publication both `notRun`. Subsequent observe, step, and finalize replay
|
|
44
|
+
honor the stored policy; `generation status` reports it as `idlePolicy`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "TapHound External Flow v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["version", "kind", "name", "description", "escapedPackageName", "includes", "steps"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": { "const": 1 },
|
|
9
|
+
"kind": { "const": "externalFlow" },
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
|
|
13
|
+
},
|
|
14
|
+
"description": { "type": "string", "minLength": 1 },
|
|
15
|
+
"escapedPackageName": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^(?:[A-Za-z_$][\\w$]*\\.)+[A-Za-z_$][\\w$]*$"
|
|
18
|
+
},
|
|
19
|
+
"expectedEscapeActivity": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^(?:[A-Za-z_$][\\w$]*\\.)+[A-Za-z_$][\\w$]*$"
|
|
22
|
+
},
|
|
23
|
+
"includes": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"uniqueItems": true,
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"steps": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"minItems": 1,
|
|
34
|
+
"items": { "type": "object" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "TapHound Flow v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["version", "kind", "name", "includes", "steps"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": { "const": 1 },
|
|
9
|
+
"kind": { "const": "flow" },
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
|
|
13
|
+
},
|
|
14
|
+
"includes": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"uniqueItems": true,
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"steps": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"minItems": 1,
|
|
25
|
+
"items": { "type": "object" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "TapHound Journey Source v1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["version", "kind", "name", "includes", "steps"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": { "const": 1 },
|
|
9
|
+
"kind": { "const": "journeySource" },
|
|
10
|
+
"name": { "type": "string", "minLength": 1 },
|
|
11
|
+
"includes": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"uniqueItems": true,
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"steps": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"minItems": 1,
|
|
22
|
+
"items": { "type": "object" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/assets/skills/{taphound-ai-journey → taphound-journey-generator}/schemas/observe-output.json
RENAMED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://taphound.dev/schemas/observe-output.json",
|
|
4
4
|
"title": "TapHound generation observe --json Output",
|
|
5
|
-
"description": "Reference shape for the JSON result of `generation observe --json`.
|
|
5
|
+
"description": "Reference shape for the JSON result of `generation observe --json`. snapshotRef is the authoritative project-relative snapshot evidence path. With --compact, snapshot is omitted and the agent reads snapshotRef before constructing the next proposed-step envelope.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
|
-
"required": ["status", "exitCode", "generationId", "baseRevision", "snapshotHash", "
|
|
8
|
+
"required": ["status", "exitCode", "generationId", "baseRevision", "snapshotHash", "snapshotRef"],
|
|
9
9
|
"properties": {
|
|
10
10
|
"status": { "const": "observed" },
|
|
11
11
|
"exitCode": { "const": 0 },
|
|
@@ -15,9 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"baseRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
17
17
|
"snapshotHash": { "type": "string", "pattern": "^[a-f\\d]{64}$" },
|
|
18
|
+
"snapshotRef": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^\\.taphound/build/generations/(?:\\.[^/]+\\.work|[^/]+)/evidence/snapshots/revision-\\d{6}/[^/]+/snapshot\\.json$",
|
|
21
|
+
"description": "Authoritative project-relative RuntimeSnapshot evidence path. Active sessions use the Store-owned .<generationId>.work bundle; publication atomically moves the same evidence to the final <generationId> bundle."
|
|
22
|
+
},
|
|
18
23
|
"snapshot": {
|
|
19
24
|
"type": "object",
|
|
20
|
-
"description": "Full RuntimeSnapshot. See proposed-step-envelope.json $defs/RuntimeSnapshot for the detailed schema.",
|
|
25
|
+
"description": "Full RuntimeSnapshot. Omitted only when --compact is used. See proposed-step-envelope.json $defs/RuntimeSnapshot for the detailed schema.",
|
|
21
26
|
"required": ["version", "generationId", "baseRevision", "deviceSerial", "expectedPackageName", "foregroundPackageName", "activity", "pid", "capturedAt", "layout"],
|
|
22
27
|
"properties": {
|
|
23
28
|
"version": { "const": 1 },
|
|
@@ -35,7 +40,11 @@
|
|
|
35
40
|
},
|
|
36
41
|
"capturedAt": { "type": "string" },
|
|
37
42
|
"screenshotPath": { "type": "string" },
|
|
38
|
-
"layout": { "type": "array" }
|
|
43
|
+
"layout": { "type": "array" },
|
|
44
|
+
"windowHierarchy": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"description": "Conservative comparison between visible touchable target-app windows and semantic layout roots. An incomplete status must block proposal generation."
|
|
47
|
+
}
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
}
|