taphound 0.2.0-dev.1
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/LICENSE +202 -0
- package/README.md +200 -0
- package/README.zh-CN.md +200 -0
- package/assets/brand/taphound-mark.svg +9 -0
- package/assets/skills/taphound-ai-journey/GUIDE.md +862 -0
- package/assets/skills/taphound-ai-journey/SKILL.md +377 -0
- package/assets/skills/taphound-ai-journey/prompts/analyze-project.md +526 -0
- package/assets/skills/taphound-ai-journey/prompts/check-completion.md +52 -0
- package/assets/skills/taphound-ai-journey/prompts/generate-step.md +109 -0
- package/assets/skills/taphound-ai-journey/schemas/observe-output.json +42 -0
- package/assets/skills/taphound-ai-journey/schemas/project-context.json +81 -0
- package/assets/skills/taphound-ai-journey/schemas/proposed-step-envelope.json +267 -0
- package/assets/skills/taphound-ai-journey/templates/project-context.example.json +49 -0
- package/dist/adapters/adb/adb-adapter.d.ts +23 -0
- package/dist/adapters/adb/adb-adapter.js +218 -0
- package/dist/adapters/android-cli/android-cli-adapter.d.ts +11 -0
- package/dist/adapters/android-cli/android-cli-adapter.js +64 -0
- package/dist/adapters/android-cli/layout-parser.d.ts +3 -0
- package/dist/adapters/android-cli/layout-parser.js +174 -0
- package/dist/adapters/clock/system-clock.d.ts +5 -0
- package/dist/adapters/clock/system-clock.js +13 -0
- package/dist/adapters/filesystem/artifact-store.d.ts +4 -0
- package/dist/adapters/filesystem/artifact-store.js +73 -0
- package/dist/adapters/filesystem/generation-meta-writer.d.ts +16 -0
- package/dist/adapters/filesystem/generation-meta-writer.js +34 -0
- package/dist/adapters/filesystem/generation-session-store.d.ts +68 -0
- package/dist/adapters/filesystem/generation-session-store.js +1603 -0
- package/dist/adapters/filesystem/journey-writer.d.ts +16 -0
- package/dist/adapters/filesystem/journey-writer.js +34 -0
- package/dist/adapters/filesystem/project-bound-file.d.ts +6 -0
- package/dist/adapters/filesystem/project-bound-file.js +240 -0
- package/dist/adapters/filesystem/project-file-inspector.d.ts +8 -0
- package/dist/adapters/filesystem/project-file-inspector.js +198 -0
- package/dist/adapters/filesystem/skill-installer.d.ts +10 -0
- package/dist/adapters/filesystem/skill-installer.js +39 -0
- package/dist/adapters/process/node-process-runner.d.ts +8 -0
- package/dist/adapters/process/node-process-runner.js +155 -0
- package/dist/adapters/prompt/inquirer-generation-prompt.d.ts +55 -0
- package/dist/adapters/prompt/inquirer-generation-prompt.js +213 -0
- package/dist/adapters/prompt/inquirer-init-prompt.d.ts +32 -0
- package/dist/adapters/prompt/inquirer-init-prompt.js +55 -0
- package/dist/adapters/prompt/inquirer-recorder-prompt.d.ts +47 -0
- package/dist/adapters/prompt/inquirer-recorder-prompt.js +157 -0
- package/dist/application/assertion/expectation-evaluator.d.ts +61 -0
- package/dist/application/assertion/expectation-evaluator.js +207 -0
- package/dist/application/collector/logcat-collector.d.ts +39 -0
- package/dist/application/collector/logcat-collector.js +107 -0
- package/dist/application/context/context-validator.d.ts +27 -0
- package/dist/application/context/context-validator.js +120 -0
- package/dist/application/doctor/doctor-service.d.ts +35 -0
- package/dist/application/doctor/doctor-service.js +178 -0
- package/dist/application/generation/focused-input.d.ts +2 -0
- package/dist/application/generation/focused-input.js +9 -0
- package/dist/application/generation/generation-confirmation-service.d.ts +76 -0
- package/dist/application/generation/generation-confirmation-service.js +383 -0
- package/dist/application/generation/generation-finalizer.d.ts +67 -0
- package/dist/application/generation/generation-finalizer.js +646 -0
- package/dist/application/generation/generation-publisher.d.ts +46 -0
- package/dist/application/generation/generation-publisher.js +178 -0
- package/dist/application/generation/generation-starter.d.ts +31 -0
- package/dist/application/generation/generation-starter.js +102 -0
- package/dist/application/generation/generation-step-executor.d.ts +52 -0
- package/dist/application/generation/generation-step-executor.js +668 -0
- package/dist/application/generation/proposed-step-validator.d.ts +11 -0
- package/dist/application/generation/proposed-step-validator.js +88 -0
- package/dist/application/generation/risk-evaluator.d.ts +9 -0
- package/dist/application/generation/risk-evaluator.js +14 -0
- package/dist/application/generation/runtime-observer.d.ts +39 -0
- package/dist/application/generation/runtime-observer.js +157 -0
- package/dist/application/init/init-service.d.ts +17 -0
- package/dist/application/init/init-service.js +44 -0
- package/dist/application/interaction/action-executor.d.ts +25 -0
- package/dist/application/interaction/action-executor.js +103 -0
- package/dist/application/interaction/fallback-resolver.d.ts +24 -0
- package/dist/application/interaction/fallback-resolver.js +48 -0
- package/dist/application/interaction/scroll-to-executor.d.ts +40 -0
- package/dist/application/interaction/scroll-to-executor.js +191 -0
- package/dist/application/locator/locator-resolver.d.ts +20 -0
- package/dist/application/locator/locator-resolver.js +89 -0
- package/dist/application/project/project-describer.d.ts +14 -0
- package/dist/application/project/project-describer.js +8 -0
- package/dist/application/recorder/locator-selector.d.ts +10 -0
- package/dist/application/recorder/locator-selector.js +80 -0
- package/dist/application/recorder/recorder-service.d.ts +41 -0
- package/dist/application/recorder/recorder-service.js +331 -0
- package/dist/application/report/report-writer.d.ts +10 -0
- package/dist/application/report/report-writer.js +39 -0
- package/dist/application/runtime/activity-waiter.d.ts +33 -0
- package/dist/application/runtime/activity-waiter.js +73 -0
- package/dist/application/runtime/launch-failure.d.ts +2 -0
- package/dist/application/runtime/launch-failure.js +20 -0
- package/dist/application/runtime/process-waiter.d.ts +27 -0
- package/dist/application/runtime/process-waiter.js +73 -0
- package/dist/application/runtime/step-runner.d.ts +50 -0
- package/dist/application/runtime/step-runner.js +429 -0
- package/dist/application/runtime/verify-runtime.d.ts +44 -0
- package/dist/application/runtime/verify-runtime.js +350 -0
- package/dist/application/wait/idle-waiter.d.ts +30 -0
- package/dist/application/wait/idle-waiter.js +90 -0
- package/dist/cli/commands/context.d.ts +3 -0
- package/dist/cli/commands/context.js +94 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +51 -0
- package/dist/cli/commands/generation.d.ts +3 -0
- package/dist/cli/commands/generation.js +518 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.js +104 -0
- package/dist/cli/commands/project.d.ts +3 -0
- package/dist/cli/commands/project.js +58 -0
- package/dist/cli/commands/record.d.ts +3 -0
- package/dist/cli/commands/record.js +88 -0
- package/dist/cli/commands/verify.d.ts +3 -0
- package/dist/cli/commands/verify.js +106 -0
- package/dist/cli/dependencies.d.ts +66 -0
- package/dist/cli/dependencies.js +204 -0
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.js +73 -0
- package/dist/cli/output.d.ts +16 -0
- package/dist/cli/output.js +22 -0
- package/dist/cli/program.d.ts +3 -0
- package/dist/cli/program.js +43 -0
- package/dist/domain/activity.d.ts +7 -0
- package/dist/domain/activity.js +65 -0
- package/dist/domain/app-process.d.ts +7 -0
- package/dist/domain/app-process.js +10 -0
- package/dist/domain/config.d.ts +15 -0
- package/dist/domain/config.js +17 -0
- package/dist/domain/failure.d.ts +4 -0
- package/dist/domain/failure.js +43 -0
- package/dist/domain/generation.d.ts +912 -0
- package/dist/domain/generation.js +342 -0
- package/dist/domain/init.d.ts +42 -0
- package/dist/domain/init.js +114 -0
- package/dist/domain/journey.d.ts +673 -0
- package/dist/domain/journey.js +109 -0
- package/dist/domain/layout.d.ts +35 -0
- package/dist/domain/layout.js +33 -0
- package/dist/domain/locator.d.ts +8 -0
- package/dist/domain/locator.js +5 -0
- package/dist/domain/project-context.d.ts +101 -0
- package/dist/domain/project-context.js +64 -0
- package/dist/domain/proposed-step.d.ts +341 -0
- package/dist/domain/proposed-step.js +87 -0
- package/dist/domain/report.d.ts +349 -0
- package/dist/domain/report.js +135 -0
- package/dist/domain/runtime-snapshot.d.ts +16 -0
- package/dist/domain/runtime-snapshot.js +46 -0
- package/dist/ports/adb.d.ts +42 -0
- package/dist/ports/adb.js +1 -0
- package/dist/ports/android-cli.d.ts +21 -0
- package/dist/ports/android-cli.js +1 -0
- package/dist/ports/artifact-store.d.ts +12 -0
- package/dist/ports/artifact-store.js +1 -0
- package/dist/ports/clock.d.ts +4 -0
- package/dist/ports/clock.js +1 -0
- package/dist/ports/generation-meta-writer.d.ts +10 -0
- package/dist/ports/generation-meta-writer.js +1 -0
- package/dist/ports/generation-prompt.d.ts +19 -0
- package/dist/ports/generation-prompt.js +6 -0
- package/dist/ports/generation-session-store.d.ts +32 -0
- package/dist/ports/generation-session-store.js +26 -0
- package/dist/ports/init-prompt.d.ts +8 -0
- package/dist/ports/init-prompt.js +6 -0
- package/dist/ports/journey-writer.d.ts +10 -0
- package/dist/ports/journey-writer.js +1 -0
- package/dist/ports/process-runner.d.ts +32 -0
- package/dist/ports/process-runner.js +1 -0
- package/dist/ports/project-bound-file.d.ts +8 -0
- package/dist/ports/project-bound-file.js +1 -0
- package/dist/ports/project-file-inspector.d.ts +33 -0
- package/dist/ports/project-file-inspector.js +1 -0
- package/dist/ports/recorder-prompt.d.ts +29 -0
- package/dist/ports/recorder-prompt.js +1 -0
- package/dist/ports/skill-installer.d.ts +8 -0
- package/dist/ports/skill-installer.js +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://taphound.dev/schemas/observe-output.json",
|
|
4
|
+
"title": "TapHound generation observe --json Output",
|
|
5
|
+
"description": "Reference shape for the JSON result of `generation observe --json`. The agent parses this to extract binding fields and the full snapshot for the next proposed-step envelope.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["status", "exitCode", "generationId", "baseRevision", "snapshotHash", "snapshot"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"status": { "const": "observed" },
|
|
11
|
+
"exitCode": { "const": 0 },
|
|
12
|
+
"generationId": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^[A-Za-z\\d](?:[A-Za-z\\d._-]*[A-Za-z\\d])?$"
|
|
15
|
+
},
|
|
16
|
+
"baseRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
17
|
+
"snapshotHash": { "type": "string", "pattern": "^[a-f\\d]{64}$" },
|
|
18
|
+
"snapshot": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Full RuntimeSnapshot. See proposed-step-envelope.json $defs/RuntimeSnapshot for the detailed schema.",
|
|
21
|
+
"required": ["version", "generationId", "baseRevision", "deviceSerial", "expectedPackageName", "foregroundPackageName", "activity", "pid", "capturedAt", "layout"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"version": { "const": 1 },
|
|
24
|
+
"generationId": { "type": "string", "minLength": 1 },
|
|
25
|
+
"baseRevision": { "type": "integer", "minimum": 1 },
|
|
26
|
+
"deviceSerial": { "type": "string", "minLength": 1 },
|
|
27
|
+
"expectedPackageName": { "type": "string" },
|
|
28
|
+
"foregroundPackageName": { "type": "string" },
|
|
29
|
+
"activity": { "type": "string" },
|
|
30
|
+
"pid": {
|
|
31
|
+
"oneOf": [
|
|
32
|
+
{ "type": "integer" },
|
|
33
|
+
{ "type": "null" }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"capturedAt": { "type": "string" },
|
|
37
|
+
"screenshotPath": { "type": "string" },
|
|
38
|
+
"layout": { "type": "array" }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://taphound.dev/schemas/project-context.json",
|
|
4
|
+
"title": "TapHound Project Context",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["version", "packageName", "launchActivity", "manifest", "interactionPolicy"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"version": { "const": 1 },
|
|
10
|
+
"packageName": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^(?:[A-Za-z_$][\\w$]*\\.)+[A-Za-z_$][\\w$]*$",
|
|
13
|
+
"description": "Fully qualified Android package name"
|
|
14
|
+
},
|
|
15
|
+
"launchActivity": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^(?:[A-Za-z_$][\\w$]*\\.)+[A-Za-z_$][\\w$]*$",
|
|
18
|
+
"description": "Fully qualified launch Activity class"
|
|
19
|
+
},
|
|
20
|
+
"manifest": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["version", "files"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"version": { "const": 1 },
|
|
26
|
+
"files": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": ["path", "sha256", "confidence"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"path": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1,
|
|
36
|
+
"description": "Project-relative path. Must not start with /, contain a drive letter, or include .. segments. Backslashes are normalized to forward slashes.",
|
|
37
|
+
"pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\.\\.)[A-Za-z0-9._/\\-]+$"
|
|
38
|
+
},
|
|
39
|
+
"sha256": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[a-f\\d]{64}$",
|
|
42
|
+
"description": "SHA-256 hex digest of the file content"
|
|
43
|
+
},
|
|
44
|
+
"confidence": {
|
|
45
|
+
"enum": ["sourceConfirmed", "runtimeConfirmed", "inferred", "unknown"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"minItems": 1
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"interactionPolicy": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["allowedActions", "confirmationRequiredActions", "forbiddenActions"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"allowedActions": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"enum": ["click", "longClick", "inputText", "swipe", "scrollTo", "back", "wait"]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"confirmationRequiredActions": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"enum": ["click", "longClick", "inputText", "swipe", "scrollTo", "back", "wait"]
|
|
68
|
+
},
|
|
69
|
+
"description": "Each action here must also appear in allowedActions."
|
|
70
|
+
},
|
|
71
|
+
"forbiddenActions": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"enum": ["click", "longClick", "inputText", "swipe", "scrollTo", "back", "wait"]
|
|
75
|
+
},
|
|
76
|
+
"description": "No action may appear in both allowedActions and forbiddenActions."
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://taphound.dev/schemas/proposed-step-envelope.json",
|
|
4
|
+
"title": "TapHound Proposed Step Envelope",
|
|
5
|
+
"description": "The input envelope for `generation step --input`. The proposal field is a ProposedStep; the snapshot field is the full RuntimeSnapshot from the preceding observe call.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version", "proposal", "snapshot"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"proposal": {
|
|
12
|
+
"$ref": "#/$defs/ProposedStep"
|
|
13
|
+
},
|
|
14
|
+
"snapshot": {
|
|
15
|
+
"$ref": "#/$defs/RuntimeSnapshot"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"$defs": {
|
|
19
|
+
"QualifiedName": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^(?:[A-Za-z_$][\\w$]*\\.)+[A-Za-z_$][\\w$]*$"
|
|
22
|
+
},
|
|
23
|
+
"Sha256": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[a-f\\d]{64}$"
|
|
26
|
+
},
|
|
27
|
+
"GenerationId": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"pattern": "^[A-Za-z\\d](?:[A-Za-z\\d._-]*[A-Za-z\\d])?$"
|
|
30
|
+
},
|
|
31
|
+
"Locator": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"properties": {
|
|
35
|
+
"resourceId": { "type": "string", "minLength": 1 },
|
|
36
|
+
"text": { "type": "string", "minLength": 1 },
|
|
37
|
+
"contentDescription": { "type": "string", "minLength": 1 }
|
|
38
|
+
},
|
|
39
|
+
"anyOf": [
|
|
40
|
+
{ "required": ["resourceId"] },
|
|
41
|
+
{ "required": ["text"] },
|
|
42
|
+
{ "required": ["contentDescription"] }
|
|
43
|
+
],
|
|
44
|
+
"description": "At least one identity field is required. Priority: resourceId > text > contentDescription."
|
|
45
|
+
},
|
|
46
|
+
"ProposalBinding": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"required": ["generationId", "baseRevision", "snapshotHash"],
|
|
50
|
+
"properties": {
|
|
51
|
+
"generationId": { "$ref": "#/$defs/GenerationId" },
|
|
52
|
+
"baseRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
53
|
+
"snapshotHash": { "$ref": "#/$defs/Sha256" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"ActivityCheckpoint": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": ["before"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"before": { "$ref": "#/$defs/QualifiedName" }
|
|
62
|
+
},
|
|
63
|
+
"description": "Only `before` is required in a proposed step. The Core determines `after` from live device observation after execution."
|
|
64
|
+
},
|
|
65
|
+
"Expect": {
|
|
66
|
+
"oneOf": [
|
|
67
|
+
{
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["type", "value", "timeoutMs"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"type": { "const": "activity" },
|
|
73
|
+
"value": { "$ref": "#/$defs/QualifiedName" },
|
|
74
|
+
"timeoutMs": { "type": "integer", "minimum": 1 }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"required": ["type", "locator", "timeoutMs"],
|
|
81
|
+
"properties": {
|
|
82
|
+
"type": { "const": "element" },
|
|
83
|
+
"locator": { "$ref": "#/$defs/Locator" },
|
|
84
|
+
"timeoutMs": { "type": "integer", "minimum": 1 }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"required": ["type", "tag", "pattern", "match", "timeoutMs"],
|
|
91
|
+
"properties": {
|
|
92
|
+
"type": { "const": "logcat" },
|
|
93
|
+
"tag": { "type": "string", "minLength": 1 },
|
|
94
|
+
"level": { "enum": ["V", "D", "I", "W", "E", "F", "A"] },
|
|
95
|
+
"pattern": { "type": "string", "minLength": 1 },
|
|
96
|
+
"match": { "enum": ["literal", "regex"] },
|
|
97
|
+
"timeoutMs": { "type": "integer", "minimum": 1 }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"ProposedStep": {
|
|
103
|
+
"oneOf": [
|
|
104
|
+
{
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": ["action", "locator", "binding", "activity"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"action": { "const": "click" },
|
|
110
|
+
"locator": { "$ref": "#/$defs/Locator" },
|
|
111
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
112
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
113
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": ["action", "locator", "binding", "activity"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"action": { "const": "longClick" },
|
|
122
|
+
"locator": { "$ref": "#/$defs/Locator" },
|
|
123
|
+
"durationMs": { "type": "integer", "minimum": 1, "default": 800 },
|
|
124
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
125
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
126
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": ["action", "text", "binding", "activity"],
|
|
133
|
+
"properties": {
|
|
134
|
+
"action": { "const": "inputText" },
|
|
135
|
+
"text": { "type": "string", "minLength": 1 },
|
|
136
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
137
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
138
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"type": "object",
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"required": ["action", "locator", "direction", "binding", "activity"],
|
|
145
|
+
"properties": {
|
|
146
|
+
"action": { "const": "swipe" },
|
|
147
|
+
"locator": { "$ref": "#/$defs/Locator" },
|
|
148
|
+
"direction": { "enum": ["up", "down", "left", "right"] },
|
|
149
|
+
"distancePercent": { "type": "number", "exclusiveMinimum": 0, "maximum": 1, "default": 0.6 },
|
|
150
|
+
"durationMs": { "type": "integer", "minimum": 1, "default": 300 },
|
|
151
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
152
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
153
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "object",
|
|
158
|
+
"additionalProperties": false,
|
|
159
|
+
"required": ["action", "locator", "container", "direction", "binding", "activity"],
|
|
160
|
+
"properties": {
|
|
161
|
+
"action": { "const": "scrollTo" },
|
|
162
|
+
"locator": { "$ref": "#/$defs/Locator" },
|
|
163
|
+
"container": { "$ref": "#/$defs/Locator" },
|
|
164
|
+
"direction": { "enum": ["up", "down", "left", "right"] },
|
|
165
|
+
"maxSwipes": { "type": "integer", "minimum": 1, "maximum": 30, "default": 20 },
|
|
166
|
+
"distancePercent": { "type": "number", "exclusiveMinimum": 0, "maximum": 1, "default": 0.6 },
|
|
167
|
+
"durationMs": { "type": "integer", "minimum": 1, "default": 300 },
|
|
168
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
169
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
170
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "object",
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": ["action", "binding", "activity"],
|
|
177
|
+
"properties": {
|
|
178
|
+
"action": { "const": "back" },
|
|
179
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
180
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
181
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"type": "object",
|
|
186
|
+
"additionalProperties": false,
|
|
187
|
+
"required": ["action", "binding", "activity"],
|
|
188
|
+
"properties": {
|
|
189
|
+
"action": { "const": "wait" },
|
|
190
|
+
"binding": { "$ref": "#/$defs/ProposalBinding" },
|
|
191
|
+
"activity": { "$ref": "#/$defs/ActivityCheckpoint" },
|
|
192
|
+
"expect": { "$ref": "#/$defs/Expect" }
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
"LayoutPoint": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"additionalProperties": false,
|
|
200
|
+
"required": ["x", "y"],
|
|
201
|
+
"properties": {
|
|
202
|
+
"x": { "type": "integer", "minimum": 0 },
|
|
203
|
+
"y": { "type": "integer", "minimum": 0 }
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"Bounds": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"additionalProperties": false,
|
|
209
|
+
"required": ["left", "top", "right", "bottom"],
|
|
210
|
+
"properties": {
|
|
211
|
+
"left": { "type": "integer", "minimum": 0 },
|
|
212
|
+
"top": { "type": "integer", "minimum": 0 },
|
|
213
|
+
"right": { "type": "integer", "exclusiveMinimum": 0 },
|
|
214
|
+
"bottom": { "type": "integer", "exclusiveMinimum": 0 }
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"LayoutElement": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"additionalProperties": false,
|
|
220
|
+
"required": ["id", "enabled", "children"],
|
|
221
|
+
"properties": {
|
|
222
|
+
"id": { "type": "string", "minLength": 1 },
|
|
223
|
+
"resourceId": { "type": "string", "minLength": 1 },
|
|
224
|
+
"text": { "type": "string" },
|
|
225
|
+
"contentDescription": { "type": "string" },
|
|
226
|
+
"clickable": { "type": "boolean" },
|
|
227
|
+
"longClickable": { "type": "boolean" },
|
|
228
|
+
"scrollable": { "type": "boolean" },
|
|
229
|
+
"focusable": { "type": "boolean" },
|
|
230
|
+
"focused": { "type": "boolean" },
|
|
231
|
+
"enabled": { "type": "boolean" },
|
|
232
|
+
"center": { "$ref": "#/$defs/LayoutPoint" },
|
|
233
|
+
"bounds": { "$ref": "#/$defs/Bounds" },
|
|
234
|
+
"children": {
|
|
235
|
+
"type": "array",
|
|
236
|
+
"items": { "$ref": "#/$defs/LayoutElement" }
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"RuntimeSnapshot": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": false,
|
|
243
|
+
"required": ["version", "generationId", "baseRevision", "deviceSerial", "expectedPackageName", "foregroundPackageName", "activity", "pid", "capturedAt", "layout"],
|
|
244
|
+
"properties": {
|
|
245
|
+
"version": { "const": 1 },
|
|
246
|
+
"generationId": { "type": "string", "minLength": 1 },
|
|
247
|
+
"baseRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
248
|
+
"deviceSerial": { "type": "string", "minLength": 1 },
|
|
249
|
+
"expectedPackageName": { "$ref": "#/$defs/QualifiedName" },
|
|
250
|
+
"foregroundPackageName": { "$ref": "#/$defs/QualifiedName" },
|
|
251
|
+
"activity": { "$ref": "#/$defs/QualifiedName" },
|
|
252
|
+
"pid": {
|
|
253
|
+
"oneOf": [
|
|
254
|
+
{ "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
255
|
+
{ "type": "null" }
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"capturedAt": { "type": "string", "format": "date-time" },
|
|
259
|
+
"screenshotPath": { "type": "string", "minLength": 1 },
|
|
260
|
+
"layout": {
|
|
261
|
+
"type": "array",
|
|
262
|
+
"items": { "$ref": "#/$defs/LayoutElement" }
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"packageName": "dev.taphound.demo",
|
|
4
|
+
"launchActivity": "dev.taphound.demo.MainActivity",
|
|
5
|
+
"manifest": {
|
|
6
|
+
"version": 1,
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"path": "settings.gradle.kts",
|
|
10
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
11
|
+
"confidence": "sourceConfirmed"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "app/build.gradle.kts",
|
|
15
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
16
|
+
"confidence": "sourceConfirmed"
|
|
17
|
+
}, {
|
|
18
|
+
"path": "app/src/main/AndroidManifest.xml",
|
|
19
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
20
|
+
"confidence": "sourceConfirmed"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "app/src/main/java/dev/taphound/demo/MainActivity.kt",
|
|
24
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
25
|
+
"confidence": "sourceConfirmed"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "app/src/main/java/dev/taphound/demo/SearchActivity.kt",
|
|
29
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
30
|
+
"confidence": "sourceConfirmed"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "app/src/main/res/layout/activity_main.xml",
|
|
34
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
35
|
+
"confidence": "sourceConfirmed"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"path": "app/src/main/res/layout/activity_search.xml",
|
|
39
|
+
"sha256": "RUNTIME_COMPUTED",
|
|
40
|
+
"confidence": "sourceConfirmed"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"interactionPolicy": {
|
|
45
|
+
"allowedActions": ["click", "inputText", "back", "wait"],
|
|
46
|
+
"confirmationRequiredActions": [],
|
|
47
|
+
"forbiddenActions": []
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ForegroundComponent } from "../../domain/activity.js";
|
|
2
|
+
import { type AppProcess } from "../../domain/app-process.js";
|
|
3
|
+
import type { AdbPort, AppIdentity, DeviceInfo, LaunchActivityOptions, LogcatOptions } from "../../ports/adb.js";
|
|
4
|
+
import type { Point } from "../../ports/android-cli.js";
|
|
5
|
+
import type { CommandResult, ProcessRunner, RunningCommand } from "../../ports/process-runner.js";
|
|
6
|
+
export declare class AdbAdapter implements AdbPort {
|
|
7
|
+
private readonly runner;
|
|
8
|
+
constructor(runner: ProcessRunner);
|
|
9
|
+
private run;
|
|
10
|
+
devices(signal?: AbortSignal): Promise<readonly DeviceInfo[]>;
|
|
11
|
+
foregroundComponent(identity: AppIdentity): Promise<ForegroundComponent>;
|
|
12
|
+
currentActivity(identity: AppIdentity): Promise<string>;
|
|
13
|
+
isInstalled(identity: AppIdentity): Promise<boolean>;
|
|
14
|
+
launchActivity(options: LaunchActivityOptions): Promise<CommandResult>;
|
|
15
|
+
forceStop(identity: AppIdentity): Promise<CommandResult>;
|
|
16
|
+
appProcesses(identity: AppIdentity): Promise<readonly AppProcess[]>;
|
|
17
|
+
tap(point: Point, deviceSerial: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
18
|
+
longClick(point: Point, durationMs: number, deviceSerial: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
19
|
+
swipe(from: Point, to: Point, durationMs: number, deviceSerial: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
20
|
+
back(deviceSerial: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
21
|
+
inputText(text: string, deviceSerial: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
22
|
+
startLogcat(options: LogcatOptions): RunningCommand;
|
|
23
|
+
}
|