swipium 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +21 -6
  2. package/THREAT_MODEL.md +59 -0
  3. package/dist/appMap/codeIndex.js +37 -5
  4. package/dist/appMap/codeIndex.js.map +1 -1
  5. package/dist/appMap/diff.js +60 -0
  6. package/dist/appMap/diff.js.map +1 -0
  7. package/dist/appMap/query.js +22 -4
  8. package/dist/appMap/query.js.map +1 -1
  9. package/dist/automation/capabilities.js +167 -0
  10. package/dist/automation/capabilities.js.map +1 -0
  11. package/dist/automation/gestures.js +94 -0
  12. package/dist/automation/gestures.js.map +1 -0
  13. package/dist/automation/maestroIr.js +282 -0
  14. package/dist/automation/maestroIr.js.map +1 -0
  15. package/dist/automation/plan.js +268 -0
  16. package/dist/automation/plan.js.map +1 -0
  17. package/dist/automation/report.js +83 -0
  18. package/dist/automation/report.js.map +1 -0
  19. package/dist/automation/selectors.js +201 -0
  20. package/dist/automation/selectors.js.map +1 -0
  21. package/dist/automation/types.js +13 -0
  22. package/dist/automation/types.js.map +1 -0
  23. package/dist/automation/waits.js +91 -0
  24. package/dist/automation/waits.js.map +1 -0
  25. package/dist/automation/webview.js +81 -0
  26. package/dist/automation/webview.js.map +1 -0
  27. package/dist/drivers/WdaDriver.js +18 -5
  28. package/dist/drivers/WdaDriver.js.map +1 -1
  29. package/dist/explore/candidates.js +17 -0
  30. package/dist/explore/candidates.js.map +1 -1
  31. package/dist/explore/runner.js +29 -2
  32. package/dist/explore/runner.js.map +1 -1
  33. package/dist/flows/repair.js +363 -0
  34. package/dist/flows/repair.js.map +1 -0
  35. package/dist/interop/maestro.js +151 -0
  36. package/dist/interop/maestro.js.map +1 -0
  37. package/dist/lib/wda.js +17 -0
  38. package/dist/lib/wda.js.map +1 -1
  39. package/dist/mobileAudit/checks.js +251 -0
  40. package/dist/mobileAudit/checks.js.map +1 -0
  41. package/dist/mobileAudit/evidence.js +49 -0
  42. package/dist/mobileAudit/evidence.js.map +1 -0
  43. package/dist/mobileAudit/profiles.js +73 -0
  44. package/dist/mobileAudit/profiles.js.map +1 -0
  45. package/dist/mobileAudit/results.js +41 -0
  46. package/dist/mobileAudit/results.js.map +1 -0
  47. package/dist/mobileAudit/runner.js +229 -0
  48. package/dist/mobileAudit/runner.js.map +1 -0
  49. package/dist/oracle/failures.js +1 -0
  50. package/dist/oracle/failures.js.map +1 -1
  51. package/dist/oracle/locator.js +177 -0
  52. package/dist/oracle/locator.js.map +1 -0
  53. package/dist/orchestration/envelope.js.map +1 -1
  54. package/dist/prompts/index.js +10 -0
  55. package/dist/prompts/index.js.map +1 -1
  56. package/dist/report/export.js +3 -1
  57. package/dist/report/export.js.map +1 -1
  58. package/dist/server.js +49 -2
  59. package/dist/server.js.map +1 -1
  60. package/dist/services/build.js +15 -2
  61. package/dist/services/build.js.map +1 -1
  62. package/dist/services/prepareIos.js +34 -4
  63. package/dist/services/prepareIos.js.map +1 -1
  64. package/dist/services/report.js +26 -9
  65. package/dist/services/report.js.map +1 -1
  66. package/dist/session/store.js.map +1 -1
  67. package/dist/suite/pom.js +24 -9
  68. package/dist/suite/pom.js.map +1 -1
  69. package/dist/testSuite/exporter.js +70 -0
  70. package/dist/testSuite/exporter.js.map +1 -0
  71. package/dist/testSuite/lint.js +53 -0
  72. package/dist/testSuite/lint.js.map +1 -0
  73. package/dist/tools/act.js +23 -2
  74. package/dist/tools/act.js.map +1 -1
  75. package/dist/tools/appControl.js +176 -0
  76. package/dist/tools/appControl.js.map +1 -0
  77. package/dist/tools/capabilities.js +75 -4
  78. package/dist/tools/capabilities.js.map +1 -1
  79. package/dist/tools/device.js +151 -0
  80. package/dist/tools/device.js.map +1 -0
  81. package/dist/tools/flow.js +67 -1
  82. package/dist/tools/flow.js.map +1 -1
  83. package/dist/tools/flowRepair.js +66 -0
  84. package/dist/tools/flowRepair.js.map +1 -0
  85. package/dist/tools/history.js +56 -0
  86. package/dist/tools/history.js.map +1 -0
  87. package/dist/tools/idling.js +104 -0
  88. package/dist/tools/idling.js.map +1 -0
  89. package/dist/tools/inputCapabilities.js +30 -0
  90. package/dist/tools/inputCapabilities.js.map +1 -0
  91. package/dist/tools/issues.js +218 -0
  92. package/dist/tools/issues.js.map +1 -0
  93. package/dist/tools/jobs.js +12 -1
  94. package/dist/tools/jobs.js.map +1 -1
  95. package/dist/tools/locator.js +57 -0
  96. package/dist/tools/locator.js.map +1 -0
  97. package/dist/tools/maestro.js +78 -0
  98. package/dist/tools/maestro.js.map +1 -0
  99. package/dist/tools/metro.js +260 -0
  100. package/dist/tools/metro.js.map +1 -0
  101. package/dist/tools/mobileAudit.js +115 -0
  102. package/dist/tools/mobileAudit.js.map +1 -0
  103. package/dist/tools/network.js +97 -5
  104. package/dist/tools/network.js.map +1 -1
  105. package/dist/tools/permissions.js +149 -0
  106. package/dist/tools/permissions.js.map +1 -0
  107. package/dist/tools/screenInfo.js +70 -0
  108. package/dist/tools/screenInfo.js.map +1 -0
  109. package/dist/tools/screenRecord.js +215 -6
  110. package/dist/tools/screenRecord.js.map +1 -1
  111. package/dist/tools/seed.js +101 -0
  112. package/dist/tools/seed.js.map +1 -0
  113. package/dist/tools/state.js +83 -0
  114. package/dist/tools/state.js.map +1 -1
  115. package/dist/tools/suite.js +49 -1
  116. package/dist/tools/suite.js.map +1 -1
  117. package/dist/tools/testSuite.js +233 -0
  118. package/dist/tools/testSuite.js.map +1 -0
  119. package/dist/tools/testThis.js +11 -3
  120. package/dist/tools/testThis.js.map +1 -1
  121. package/dist/tools/visual.js +139 -0
  122. package/dist/tools/visual.js.map +1 -0
  123. package/dist/tools/visualText.js +61 -0
  124. package/dist/tools/visualText.js.map +1 -0
  125. package/dist/tools/wait.js +58 -0
  126. package/dist/tools/wait.js.map +1 -0
  127. package/dist/version.js +54 -3
  128. package/dist/version.js.map +1 -1
  129. package/docs/README.md +4 -4
  130. package/docs/mcp-server.md +3 -3
  131. package/docs/tools.md +111 -2
  132. package/package.json +3 -2
package/dist/version.js CHANGED
@@ -1,11 +1,12 @@
1
- // Single source of truth for the Swipium version and the public v1 tool surface. Used by the
1
+ // Single source of truth for the Swipium version and the public tool surface. Used by the
2
2
  // server identity, qa_doctor / qa_start_session, qa_capabilities, and `swipium verify`.
3
- export const SWIPIUM_VERSION = '1.0.1';
3
+ export const SWIPIUM_VERSION = '1.2.0';
4
4
  export const TOOL_NAMES = [
5
5
  'qa_agent_brief',
6
6
  'qa_capabilities',
7
7
  'qa_test_this',
8
8
  'qa_job_status',
9
+ 'qa_job_cancel',
9
10
  'qa_status',
10
11
  'qa_explain_blocker',
11
12
  'qa_continue_from_blocker',
@@ -18,6 +19,16 @@ export const TOOL_NAMES = [
18
19
  'qa_prepare_ios_target',
19
20
  'qa_ios',
20
21
  'qa_wda',
22
+ // Device / app environment parity (Phase 5)
23
+ 'qa_device_info',
24
+ 'qa_permissions',
25
+ 'qa_orientation',
26
+ 'qa_geolocation',
27
+ 'qa_network',
28
+ 'qa_metro',
29
+ 'qa_app_control',
30
+ 'qa_screen_info',
31
+ 'qa_screen_record',
21
32
  'qa_snapshot',
22
33
  'qa_act',
23
34
  'qa_clear_overlay',
@@ -25,31 +36,71 @@ export const TOOL_NAMES = [
25
36
  'qa_screenshot',
26
37
  'qa_note',
27
38
  'qa_assert_visual',
39
+ // Visual intelligence (Phase 8, local-first OCR + coordinate audit)
40
+ 'qa_visual',
41
+ 'qa_visual_find_text',
42
+ // Agent-efficiency helpers (Phase 7)
43
+ 'qa_locator_suggest',
44
+ 'qa_wait',
45
+ 'qa_idling_status',
46
+ 'qa_input_capabilities',
28
47
  'qa_smoke',
29
48
  'qa_explore',
30
49
  'qa_report',
50
+ // Report 2.0: durable history and run comparison (Phase 10)
51
+ 'qa_report_compare',
52
+ 'qa_run_history',
53
+ // Seeded state (Phase 9)
54
+ 'qa_seed',
55
+ 'qa_state_prepare',
56
+ 'qa_state_verify',
57
+ 'qa_state_teardown',
31
58
  'qa_app_map_build',
32
59
  'qa_app_map_read',
33
60
  'qa_app_map_query',
34
61
  'qa_app_map_feature_scope',
35
62
  'qa_app_map_validate',
63
+ // Repeatable flow system (Phase 4)
36
64
  'qa_flow_check',
65
+ 'qa_flow_plan',
37
66
  'qa_flow_run',
38
67
  'qa_flow_generate',
68
+ 'qa_flow_repair',
69
+ // Persistent test suite + POM (REQ-06)
39
70
  'qa_suite_generate',
40
71
  'qa_suite_compile',
72
+ 'qa_suite_lint',
73
+ 'qa_pom_generate',
41
74
  'qa_testcase_generate',
75
+ 'qa_test_suite_read',
76
+ 'qa_test_suite_update',
77
+ 'qa_test_suite_generate',
78
+ 'qa_test_suite_export',
79
+ 'qa_test_suite_lint',
42
80
  'qa_first_run_plan',
43
81
  'qa_first_run_continue',
44
82
  'qa_automation_plan',
45
83
  'qa_automation_generate',
46
84
  'qa_automation_validate',
85
+ // Maestro interop
86
+ 'qa_maestro_import',
87
+ 'qa_maestro_export',
88
+ // Durable issue memory + executable mobile audit (REQ-07/08)
89
+ 'qa_issue_log',
90
+ 'qa_issue_history',
91
+ 'qa_issue_mark_fixed',
92
+ 'qa_issue_triage',
93
+ 'qa_issue_suppress',
94
+ 'qa_issue_verify_fixed',
95
+ 'qa_issue_metrics',
96
+ 'qa_mobile_audit',
47
97
  ];
48
98
  export const TOOL_COUNT = TOOL_NAMES.length;
49
99
  export const TOOL_NAME_SET = new Set(TOOL_NAMES);
50
100
  /** MCP prompts (reusable workflow templates) — PHASE3-PLAN §3.3. */
51
101
  export const PROMPT_NAMES = [
52
102
  'swipium_setup_check',
103
+ 'swipium_guardrail_validation',
53
104
  'swipium_full_smoke',
54
105
  'swipium_bug_repro',
55
106
  'swipium_convert_run_to_flow',
@@ -57,6 +108,6 @@ export const PROMPT_NAMES = [
57
108
  export const PROMPT_COUNT = PROMPT_NAMES.length;
58
109
  /** Shown when a client may be running an older build than what's installed on disk. */
59
110
  export const STALE_CLIENT_HINT = `Swipium v${SWIPIUM_VERSION} exposes ${TOOL_COUNT} tools + ${PROMPT_COUNT} prompts. If your MCP client lists fewer ` +
60
- `(e.g. qa_test_this / qa_plan / qa_flow_run / qa_ios missing), it is running a server ` +
111
+ `(e.g. qa_issue_log / qa_test_suite_read / qa_mobile_audit / qa_maestro_export / qa_flow_repair missing), it is running a server ` +
61
112
  `spawned before the upgrade. Restart the client to reload Swipium.`;
62
113
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wFAAwF;AAExF,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,WAAW;IACX,oBAAoB;IACpB,0BAA0B;IAC1B,iBAAiB;IACjB,WAAW;IACX,kBAAkB;IAClB,mBAAmB;IACnB,SAAS;IACT,mBAAmB;IACnB,uBAAuB;IACvB,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,kBAAkB;IAClB,UAAU;IACV,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,0BAA0B;IAC1B,qBAAqB;IACrB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,sBAAsB;IACtB,mBAAmB;IACnB,uBAAuB;IACvB,oBAAoB;IACpB,wBAAwB;IACxB,wBAAwB;CAChB,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAEtE,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,qBAAqB;IACrB,oBAAoB;IACpB,mBAAmB;IACnB,6BAA6B;CACrB,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,YAAY,eAAe,YAAY,UAAU,YAAY,YAAY,2CAA2C;IACpH,uFAAuF;IACvF,mEAAmE,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wFAAwF;AAExF,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,eAAe;IACf,WAAW;IACX,oBAAoB;IACpB,0BAA0B;IAC1B,iBAAiB;IACjB,WAAW;IACX,kBAAkB;IAClB,mBAAmB;IACnB,SAAS;IACT,mBAAmB;IACnB,uBAAuB;IACvB,QAAQ;IACR,QAAQ;IACR,4CAA4C;IAC5C,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,QAAQ;IACR,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,kBAAkB;IAClB,oEAAoE;IACpE,WAAW;IACX,qBAAqB;IACrB,qCAAqC;IACrC,oBAAoB;IACpB,SAAS;IACT,kBAAkB;IAClB,uBAAuB;IACvB,UAAU;IACV,YAAY;IACZ,WAAW;IACX,4DAA4D;IAC5D,mBAAmB;IACnB,gBAAgB;IAChB,yBAAyB;IACzB,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,0BAA0B;IAC1B,qBAAqB;IACrB,mCAAmC;IACnC,eAAe;IACf,cAAc;IACd,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,uCAAuC;IACvC,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,wBAAwB;IACxB,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,oBAAoB;IACpB,wBAAwB;IACxB,wBAAwB;IACxB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,6DAA6D;IAC7D,cAAc;IACd,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;IACjB,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,iBAAiB;CACT,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAEtE,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,qBAAqB;IACrB,8BAA8B;IAC9B,oBAAoB;IACpB,mBAAmB;IACnB,6BAA6B;CACrB,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,YAAY,eAAe,YAAY,UAAU,YAAY,YAAY,2CAA2C;IACpH,kIAAkI;IAClI,mEAAmE,CAAC"}
package/docs/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Swipium Docs
2
2
 
3
- This directory contains public v1 documentation for the Swipium MCP server.
3
+ This directory contains public documentation for the Swipium MCP server.
4
4
 
5
5
  ## Index
6
6
 
7
7
  - [MCP Server](mcp-server.md): server setup, client configuration, and agent integration.
8
- - [Tool Reference](tools.md): public v1 MCP tools grouped by workflow.
8
+ - [Tool Reference](tools.md): public MCP tools grouped by workflow.
9
9
 
10
10
  ## Scope
11
11
 
12
- Swipium v1 is simulator-only:
12
+ Swipium is simulator-only:
13
13
 
14
14
  - Android Emulator.
15
15
  - iOS Simulator.
16
16
  - Local MCP stdio server.
17
17
  - Local artifacts and app-map memory.
18
18
 
19
- Real devices, Jira integration, external ticket workflows, cloud execution, and certification are outside the public v1 scope.
19
+ Real devices, Jira integration, external ticket workflows, cloud execution, and certification are outside the current public scope.
@@ -100,7 +100,7 @@ qa_capabilities
100
100
 
101
101
  Use `qa_doctor` with `platform:"android"`, `platform:"ios"`, or `platform:"both"` when checking platform-specific readiness.
102
102
 
103
- Expected v1 tool count: 42.
103
+ Expected tool count: 83.
104
104
 
105
105
  If the client lists fewer tools, restart the MCP client. MCP clients often keep an old server process alive after package upgrades.
106
106
 
@@ -128,10 +128,10 @@ The consent result includes a `consentId`. Re-call the same tool with `approve:
128
128
 
129
129
  ## Simulator Scope
130
130
 
131
- Public v1 supports:
131
+ Public scope supports:
132
132
 
133
133
  - Android Emulator.
134
134
  - iOS Simulator.
135
135
  - Optional WebDriverAgent for structured iOS simulator automation.
136
136
 
137
- Public v1 does not support real-device execution.
137
+ The public build does not support real-device execution.
package/docs/tools.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tool Reference
2
2
 
3
- Swipium v1 exposes 42 public MCP tools. The intended default entry point is `qa_test_this`.
3
+ Swipium exposes 83 public MCP tools. The intended default entry point is `qa_test_this`.
4
4
 
5
5
  ## Start
6
6
 
@@ -9,13 +9,14 @@ Use these tools to orient the agent, start autopilot work, poll jobs, handle blo
9
9
  | Tool | What it does | Use when |
10
10
  | --- | --- | --- |
11
11
  | `qa_agent_brief` | Returns the recommended orchestration rules for agents. | The agent needs the correct first call, polling behavior, report behavior, or blocker handling rules. |
12
- | `qa_capabilities` | Lists the public v1 tool surface grouped by purpose. | The agent or user needs to discover available Swipium capabilities. |
12
+ | `qa_capabilities` | Lists the public tool surface grouped by purpose. | The agent or user needs to discover available Swipium capabilities. |
13
13
  | `qa_test_this` | Autopilot for "test it": resolves the project, finds or builds an artifact, prepares a simulator, runs smoke or exploration, reports results, and can generate suite output. | The user gives a low-context request such as "test this app". |
14
14
  | `qa_job_status` | Polls a long-running job started by `qa_test_this` or prepare tools. | A tool returns a `jobId` with status `running`. |
15
15
  | `qa_status` | Returns compact session status and recommended next action. | The agent needs to recover context during a session. |
16
16
  | `qa_explain_blocker` | Explains a typed blocker, likely owner, and recovery path. | A run stops with a blocker and the user needs a concise explanation. |
17
17
  | `qa_continue_from_blocker` | Resumes after user input and registers secret values for redaction. | A blocker asks for credentials, OTP, target choice, or approval data. |
18
18
  | `qa_get_artifact` | Fetches artifact metadata or contents by `swipium://` URI. | A report, screenshot, dump, log, or generated file must be read. |
19
+ | `qa_job_cancel` | Cancels a running job and aborts its spawned children. | A long-running job must be stopped early. |
19
20
 
20
21
  ## Setup
21
22
 
@@ -32,6 +33,22 @@ Use these tools to verify the local environment, create sessions, and prepare si
32
33
  | `qa_ios` | Runs iOS Simulator lifecycle operations such as boot, install, launch, screenshot, logs, privacy reset, and erase. | Direct iOS simulator control is needed. |
33
34
  | `qa_wda` | Checks, builds, or starts WebDriverAgent for structured iOS simulator automation. | iOS needs structured UI tree access instead of visual-only checks. |
34
35
 
36
+ ## Device
37
+
38
+ Use these tools to inspect and control the device and app environment without raw `adb` or `simctl`. Mutating actions are consent-gated and recorded as environment changes; network changes are auto-restored at report end.
39
+
40
+ | Tool | What it does | Use when |
41
+ | --- | --- | --- |
42
+ | `qa_device_info` | Reports model, SDK, ABIs, locale, screen, orientation, and installed apps (read-only). | The agent needs device context before testing. |
43
+ | `qa_permissions` | Lists, grants, or revokes runtime permissions. Revoke is consent-gated. | A flow needs a known permission state. |
44
+ | `qa_orientation` | Sets portrait, landscape, or auto orientation. | A screen must be tested in a specific orientation. |
45
+ | `qa_geolocation` | Spoofs a GPS location on the emulator. Consent-gated. | Testing map or location-aware screens. |
46
+ | `qa_network` | Reports, sets offline/online, or restores airplane-mode state. Consent-gated and auto-restored. | Testing offline behavior or network errors. |
47
+ | `qa_metro` | Reports, starts, stops, or diagnoses the RN/Expo Metro bundler with RedBox detection. | A debug RN/Expo build needs Metro. |
48
+ | `qa_app_control` | Runs launch, foreground, background, force_stop, restart, clear_data, or fresh_start. Destructive actions are guarded. | The app lifecycle must be controlled directly. |
49
+ | `qa_screen_info` | Reports screen width, height, density, orientation, mode, and coordinate landmarks. | Coordinate-space context is needed for visual work. |
50
+ | `qa_screen_record` | Records a screen video to an mp4 artifact (start/stop). Consent-gated with sensitive-screen warnings. | A run needs a video of the reproduction. |
51
+
35
52
  ## Drive
36
53
 
37
54
  Use these tools to observe the UI, act on it, collect evidence, and record results.
@@ -45,6 +62,23 @@ Use these tools to observe the UI, act on it, collect evidence, and record resul
45
62
  | `qa_screenshot` | Captures a screenshot artifact with coordinate-space metadata. | Visual evidence is required. |
46
63
  | `qa_note` | Records a structured QA outcome in the session. | The agent needs to log pass, fail, blocked, skipped, or finding details. |
47
64
  | `qa_assert_visual` | Captures a visual assertion with evidence. | The agent needs to document that a visual condition is true or false. |
65
+ | `qa_visual` | Runs local visual operations: baseline capture, regression diff, image-target matching with tappable coordinates, and optional OCR. | A screen is visual-only or needs pixel-level regression checks. |
66
+ | `qa_visual_find_text` | Locates on-screen text with OCR and returns structured regions with coordinate-space conversion. | A target has visible text but no structured selector. |
67
+ | `qa_locator_suggest` | Scores each element's locator durability and grades automation readiness. | The agent needs to know which controls need testIDs before generating automation. |
68
+ | `qa_input_capabilities` | Reports backend text-entry limits: ASCII, Unicode, clipboard, and WDA typing frequency. | Typing fails or behaves oddly and the agent needs the backend's input limits. |
69
+ | `qa_wait` | Waits without a shell for `device_online`, `metro_ready`, or `job_done`. | The agent needs to block on a condition without raw `adb`/`sleep`. |
70
+ | `qa_idling_status` | Reads app-declared idling hooks or label-heuristic settling before automation. | The agent needs to know the app has settled before acting. |
71
+
72
+ ## State
73
+
74
+ Use these tools to create and verify reproducible preconditions instead of only reporting them as missing. All mutating seed and state actions are consent-gated and recorded.
75
+
76
+ | Tool | What it does | Use when |
77
+ | --- | --- | --- |
78
+ | `qa_seed` | Creates a declared precondition via a fixture seed using a deeplink, script, or API hook. Consent-gated. | A workflow is blocked by missing test data. |
79
+ | `qa_state_prepare` | Prepares a reproducible state profile: reset, launch, seed, and verify a ledger. | A test needs a known starting state. |
80
+ | `qa_state_verify` | Verifies a state profile without treating setup drift as an app bug. | The precondition must be confirmed before testing. |
81
+ | `qa_state_teardown` | Runs state-profile teardown and restores declared environment state. | A run must leave the environment clean. |
48
82
 
49
83
  ## Run
50
84
 
@@ -55,6 +89,8 @@ Use these tools to run broader QA workflows and produce reports.
55
89
  | `qa_smoke` | Runs launch smoke, baseline health, screenshot evidence, and saved flows. | The app is prepared and the agent needs a deterministic smoke pass. |
56
90
  | `qa_explore` | Performs bounded guided exploration, builds a screen graph, and records evidence. | The agent needs to discover reachable workflows or collect runtime app-map data. |
57
91
  | `qa_report` | Generates a session report with findings, blockers, evidence, mutations, workarounds, next actions, and separate app and coverage verdicts. | A run should be summarized or exported. |
92
+ | `qa_report_compare` | Compares the current `report.json` against a baseline report. | A run should be checked for regression against a known-good report. |
93
+ | `qa_run_history` | Summarizes local run history with pass rate, failures, flaky flows, and confidence calibration. | The user wants trends across runs, not a single report. |
58
94
 
59
95
  ## App Map
60
96
 
@@ -75,12 +111,52 @@ Use these tools to create, validate, run, and compile reusable test assets.
75
111
  | Tool | What it does | Use when |
76
112
  | --- | --- | --- |
77
113
  | `qa_flow_check` | Parses and statically validates a Swipium flow. | A flow file should be checked before execution. |
114
+ | `qa_flow_plan` | Plans a flow against backend capabilities without executing it. | A flow should be checked for feasibility before a run. |
78
115
  | `qa_flow_run` | Executes a Swipium flow against a prepared simulator session. | A saved flow needs to run against the app. |
79
116
  | `qa_flow_generate` | Generates a flow from recorded actions. | A manual or exploratory run should become a reusable flow. |
117
+ | `qa_flow_repair` | Suggests or patches a stronger locator for a failed flow step from the current screen. | A flow step fails on a brittle locator. |
80
118
  | `qa_suite_generate` | Generates a POM-style suite from recorded behavior. | The run should become a structured test suite. |
81
119
  | `qa_suite_compile` | Compiles a generated suite into runnable Swipium flows. | A generated suite needs executable flow output. |
120
+ | `qa_suite_lint` | Lints generated page objects for brittle, coordinate-only, or dynamic locators. | A generated suite needs a durability check. |
121
+ | `qa_pom_generate` | Generates page objects and a locator audit from recorded actions. | A run should produce reusable page objects. |
82
122
  | `qa_testcase_generate` | Generates test-case documentation from recorded behavior. | The run should produce human-readable test cases and steps. |
83
123
 
124
+ ## Persistent Test Suite
125
+
126
+ Use these tools to grow and maintain a canonical test suite that persists across runs in `.swipium/test-suite.json`.
127
+
128
+ | Tool | What it does | Use when |
129
+ | --- | --- | --- |
130
+ | `qa_test_suite_read` | Reads the canonical suite, filtered by functionality or status, as summary, json, or markdown. | The agent needs the durable suite without re-deriving it. |
131
+ | `qa_test_suite_update` | Merges cases into the persistent suite, deduping by feature, objective, and steps. | A run produced cases to fold into the suite. |
132
+ | `qa_test_suite_generate` | Generates or refreshes canonical cases from a recorded run and exploration. | The suite needs to be (re)built from observed behavior. |
133
+ | `qa_test_suite_export` | Exports the persistent suite to markdown, a yaml directory, json, or junit. | The suite must be shared or fed to CI. |
134
+ | `qa_test_suite_lint` | Validates the suite for missing expected/actual, stale map links, and duplicate ids. | The suite must be trusted before a release sign-off. |
135
+
136
+ ## Maestro Interop
137
+
138
+ Use these tools to exchange flows with the Maestro ecosystem.
139
+
140
+ | Tool | What it does | Use when |
141
+ | --- | --- | --- |
142
+ | `qa_maestro_import` | Imports supported Maestro YAML commands into a Swipium Flow V2. | An existing Maestro flow should run under Swipium. |
143
+ | `qa_maestro_export` | Exports a Swipium Flow V2 to Maestro YAML with portability grades. | A Swipium flow should be shared as Maestro YAML. |
144
+
145
+ ## Issue Memory and Mobile Audit
146
+
147
+ Use these tools for a durable, per-project issue ledger and executable mobile-QA audit profiles. The ledger lives in `.swipium/issues-log.jsonl`; fingerprints let later runs detect regressions of previously fixed issues.
148
+
149
+ | Tool | What it does | Use when |
150
+ | --- | --- | --- |
151
+ | `qa_issue_log` | Lists the durable issue ledger with counts, recurrence candidates, and linked evidence. | The agent needs the project's known issues. |
152
+ | `qa_issue_history` | Shows the append-only event trail for one issue. | An issue's lifecycle needs auditing. |
153
+ | `qa_issue_mark_fixed` | Records a fix (date, commit, version, how-fixed) so future runs detect regressions. | A reported issue has been resolved. |
154
+ | `qa_issue_triage` | Changes an issue's category, severity, or owner, or appends a note. | An issue needs reclassification. |
155
+ | `qa_issue_suppress` | Suppresses known noise with a reason and expiration; it stays visible as known-noise. | A recurring non-bug should stop dominating reports. |
156
+ | `qa_issue_verify_fixed` | Links passing test or audit evidence to a fixed issue. | A report should honestly claim an issue was verified this run. |
157
+ | `qa_issue_metrics` | Summarizes issue trends: opened, fixed, reopened, verified, aging, and reopen rate. | The user wants issue quality trends. |
158
+ | `qa_mobile_audit` | Plans or executes a named mobile-QA profile (smoke, account_cycle, store_compliance, resilience, release_gate). | A structured, repeatable audit is needed; execution records issues and evidence. |
159
+
84
160
  ## First Run
85
161
 
86
162
  Use these tools for login, account creation, onboarding, permissions, OTP, and paywall screens.
@@ -100,6 +176,39 @@ Use these tools to generate and validate automation code from Swipium evidence.
100
176
  | `qa_automation_generate` | Generates an Appium POM suite from recorded actions and validates it. | The run should produce automation code. |
101
177
  | `qa_automation_validate` | Validates generated automation code without a device. | Generated files need checks for secrets, durability, capabilities, syntax, and empty files. |
102
178
 
179
+ ## Detailed Reference: Device, Visual, State, and History Tools
180
+
181
+ Technical detail for the tools added alongside the device-parity, visual-intelligence, seeded-state, and reporting phases. All take a `sessionId` from `qa_start_session` (except `qa_report_compare`, which is filesystem-only). Mutating actions accept `consentId` + `approve` and are recorded in the report's mutation ledger.
182
+
183
+ ### Device and app environment
184
+
185
+ - **`qa_device_info`** — read-only Android introspection. *Inputs:* `listPackages?`, `packageFilter?`. *Outputs:* `props` (manufacturer, model, SDK, release, ABIs, locale, timezone), `screen` (`width`/`height`/`density`), `orientation`/`rotation`/`autoRotate`, `installedThirdPartyCount`, optional `packages[]`. No consent.
186
+ - **`qa_orientation`** — set rotation. *Inputs:* `orientation: portrait | landscape | auto`. *Outputs:* resulting `orientation`/`rotation`/`autoRotate`. Non-destructive; logged as an environment change.
187
+ - **`qa_geolocation`** — spoof GPS via `adb emu geo fix <lng> <lat>`. *Inputs:* `lat`, `lng` (decimal degrees). *Outputs:* `{ lat, lng, set }`. Consent-gated (medium). Emulator/`direct` backend only; iOS and real devices return `BACKEND_UNSUPPORTED`.
188
+ - **`qa_permissions`** — runtime permission control. *Inputs:* `action: list | grant | revoke`, `package?` (default session `appId`), `permission?` (`android.permission.*`, required for grant/revoke). *Outputs:* `granted[]`/`denied[]` (list) or `{ package, permission, action }`. `list` is read-only; `grant` is consent-gated low (it can mask a permission-prompt bug); `revoke` is consent-gated medium (can break app state).
189
+ - **`qa_network`** — offline/online via `cmd connectivity airplane-mode` (Android 11+). *Inputs:* `action: status | offline | online | restore`. *Outputs:* `network` (`online`/`offline`), `restoreAvailable`. `offline`/`online` consent-gated (medium); the original airplane state is recorded on first change and auto-restored at `qa_report`, on `restore`, and on server shutdown.
190
+ - **`qa_metro`** — RN/Expo Metro lifecycle. *Inputs:* `action: status | diagnose | start | stop`. *Outputs:* `framework`, `metroListening`, `reverseSet`, `serving`, `ready`, `metroPid`, plus `redBox` + `recovery[]` (+ logcat artifact) for `diagnose`. `start` is consent-gated (low): it runs `adb reverse tcp:8081 tcp:8081` and spawns Metro (`npx expo start --dev-client` or `npx react-native start`) detached, logging to an artifact and tracking the PID; `stop` signals the whole process group.
191
+ - **`qa_app_control`** — app lifecycle. *Inputs:* `action: launch | foreground | background | force_stop | restart | clear_data | fresh_start`, `acknowledgeBundleRisk?`. *Outputs:* `packageName`, `action`, `processKilled`, `foreground`, `foregroundIsApp`. `clear_data`/`fresh_start` are destructive → consent-gated (high); on debug RN/Expo builds they additionally require `acknowledgeBundleRisk:true` because a data wipe can remove the cached JS bundle.
192
+ - **`qa_screen_info`** — coordinate-space metadata for visual-fallback work. *Outputs:* `screen` (`width`/`height`/`density`), `orientation`, session `mode`, `latestScreenshot`, named `landmarks` and `bands` (device pixels, origin top-left), `counters`, `budget`. Read-only.
193
+ - **`qa_screen_record`** — screen video. *Inputs:* `action: start | status | stop`, `save?: always | on_failure`, `failed?`. *Outputs:* `recording`/`capturing`/`autoStopped`, `seconds`, and on stop a `uri` (mp4 artifact) + `bytes`. Consent-gated (medium); refused on sensitive sessions. Android uses `adb screenrecord --time-limit 180`; iOS uses `simctl io recordVideo`. One recording per session.
194
+
195
+ ### Visual intelligence (local-first)
196
+
197
+ - **`qa_visual`** — deterministic visual ops + regression. *Inputs:* `action: baseline | diff | find_image | ocr`, `name?` (baseline/diff), `template?` (find_image PNG path), `threshold?` (diff, default 0.02), `minScore?` (find_image, default 0.85), `force?`. *Outputs:* always include `coordinateSpace` (screenshot↔device scale); `diff` adds `changedRatio`/`pass`/`changedBoxDevice`; `find_image` adds `devicePoint`. `baseline`/`diff`/`find_image` are local and need no consent; `ocr` is consent-gated and requires a configured `ocrCommand`. Withheld when a secure (password/OTP) field is on screen unless `force:true`.
198
+ - **`qa_visual_find_text`** — OCR text locator. *Inputs:* `query`, `minConfidence?` (default 0.8). *Outputs:* `found`, matched `region` (text/confidence/bbox), `devicePoint`, `coordinateSpace`. Consent-gated (the screenshot is passed to the configured local OCR provider); requires `ocrCommand` returning JSON regions.
199
+
200
+ ### Seeded state
201
+
202
+ - **`qa_seed`** — create a declared precondition. *Inputs:* `fixture` (must declare a `seed`: `deeplink | script | api`). *Outputs:* `{ fixture, type, seeded, warnings[] }`. Consent-gated; risk scales by type (`script` high, `api` medium, `deeplink` low). Git commands are refused (`GIT_SCOPE_FORBIDDEN`); a failed seed is reported as a SETUP failure (`missing_test_data`), never an app bug.
203
+ - **`qa_state_prepare`** — apply a state profile as one transaction. *Inputs:* `profile` (`.swipium/state/<name>.yaml` or inline YAML). *Outputs:* a state `ledger` + `ledgerUri`. Consent-gated when it mutates (reset/launch/seed); refuses debug-bundle-loss resets unless acknowledged.
204
+ - **`qa_state_verify`** — confirm a profile's declared checks (e.g. `assertVisible`). *Inputs:* `profile`. *Outputs:* verification `ledger`. Non-mutating; failures are setup/state blockers, not app-test failures.
205
+ - **`qa_state_teardown`** — run profile teardown. *Inputs:* `profile`. *Outputs:* teardown `ledger`. Consent-gated when it mutates; restores declared state such as `networkOnline` and runs fixture cleanup hooks.
206
+
207
+ ### Report history
208
+
209
+ - **`qa_report_compare`** — diff two reports. *Inputs:* `current`, `baseline` (paths to `report.json`), `trendRoot?`. *Outputs:* new/fixed failures, changed screenshots, outcome changes, runtime regression, optional flake status, and a `summary`. Filesystem-only — no session or device.
210
+ - **`qa_run_history`** — local trend summary. *Inputs:* `sessionId?` or `projectRoot?`. *Outputs:* report count, per-flow `passRate`, median/average runtime, top failures, flaky flows, confidence calibration, and slowest steps. Reads `.swipium/runs/**/report.json` (and legacy `.swipium/ci/**`).
211
+
103
212
  ## Recommended Entry Points
104
213
 
105
214
  | User intent | First tool |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swipium",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "Swipium MCP server for simulator-based mobile QA workflows, evidence capture, app maps, and generated test suites.",
6
6
  "keywords": [
@@ -27,7 +27,8 @@
27
27
  },
28
28
  "files": [
29
29
  "dist",
30
- "docs"
30
+ "docs",
31
+ "THREAT_MODEL.md"
31
32
  ],
32
33
  "engines": {
33
34
  "node": ">=20"