@sun-asterisk/sungen 3.2.2 → 3.2.3-beta.3

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 (355) hide show
  1. package/dist/capabilities/discover.d.ts.map +1 -1
  2. package/dist/capabilities/discover.js +26 -3
  3. package/dist/capabilities/discover.js.map +1 -1
  4. package/dist/cli/commands/add-flow.d.ts.map +1 -1
  5. package/dist/cli/commands/add-flow.js +2 -0
  6. package/dist/cli/commands/add-flow.js.map +1 -1
  7. package/dist/cli/commands/add.d.ts.map +1 -1
  8. package/dist/cli/commands/add.js +4 -0
  9. package/dist/cli/commands/add.js.map +1 -1
  10. package/dist/cli/commands/capability.d.ts.map +1 -1
  11. package/dist/cli/commands/capability.js +61 -0
  12. package/dist/cli/commands/capability.js.map +1 -1
  13. package/dist/cli/commands/delivery.d.ts.map +1 -1
  14. package/dist/cli/commands/delivery.js +89 -2
  15. package/dist/cli/commands/delivery.js.map +1 -1
  16. package/dist/cli/commands/eval.js +3 -3
  17. package/dist/cli/commands/eval.js.map +1 -1
  18. package/dist/cli/commands/gate.d.ts +3 -0
  19. package/dist/cli/commands/gate.d.ts.map +1 -0
  20. package/dist/cli/commands/gate.js +83 -0
  21. package/dist/cli/commands/gate.js.map +1 -0
  22. package/dist/cli/commands/generate.d.ts.map +1 -1
  23. package/dist/cli/commands/generate.js +2 -1
  24. package/dist/cli/commands/generate.js.map +1 -1
  25. package/dist/cli/commands/init.d.ts.map +1 -1
  26. package/dist/cli/commands/init.js +32 -2
  27. package/dist/cli/commands/init.js.map +1 -1
  28. package/dist/cli/commands/journey.d.ts +3 -0
  29. package/dist/cli/commands/journey.d.ts.map +1 -0
  30. package/dist/cli/commands/journey.js +114 -0
  31. package/dist/cli/commands/journey.js.map +1 -0
  32. package/dist/cli/commands/update.d.ts.map +1 -1
  33. package/dist/cli/commands/update.js +10 -3
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/cli/index.js +4 -0
  36. package/dist/cli/index.js.map +1 -1
  37. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  38. package/dist/dashboard/snapshot-builder.js +10 -1
  39. package/dist/dashboard/snapshot-builder.js.map +1 -1
  40. package/dist/exporters/csv-exporter.d.ts.map +1 -1
  41. package/dist/exporters/csv-exporter.js +3 -1
  42. package/dist/exporters/csv-exporter.js.map +1 -1
  43. package/dist/exporters/json-exporter.js +3 -1
  44. package/dist/exporters/json-exporter.js.map +1 -1
  45. package/dist/exporters/mobile-app-id.d.ts +22 -0
  46. package/dist/exporters/mobile-app-id.d.ts.map +1 -0
  47. package/dist/exporters/mobile-app-id.js +37 -0
  48. package/dist/exporters/mobile-app-id.js.map +1 -0
  49. package/dist/exporters/spec-parser.d.ts.map +1 -1
  50. package/dist/exporters/spec-parser.js +6 -2
  51. package/dist/exporters/spec-parser.js.map +1 -1
  52. package/dist/generators/test-generator/adapters/adapter-interface.d.ts +3 -0
  53. package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
  54. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  55. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  56. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  57. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  58. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  59. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  60. package/dist/generators/test-generator/code-generator.js +48 -9
  61. package/dist/generators/test-generator/code-generator.js.map +1 -1
  62. package/dist/generators/test-generator/template-engine.d.ts +3 -0
  63. package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
  64. package/dist/generators/test-generator/template-engine.js +11 -1
  65. package/dist/generators/test-generator/template-engine.js.map +1 -1
  66. package/dist/generators/test-generator/utils/selector-resolver.d.ts +11 -1
  67. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  68. package/dist/generators/test-generator/utils/selector-resolver.js +33 -0
  69. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  70. package/dist/harness/audit.d.ts.map +1 -1
  71. package/dist/harness/audit.js +8 -1
  72. package/dist/harness/audit.js.map +1 -1
  73. package/dist/harness/catalog/universal-viewpoints.yaml +15 -0
  74. package/dist/harness/eval/skill-lint.d.ts +3 -3
  75. package/dist/harness/eval/skill-lint.d.ts.map +1 -1
  76. package/dist/harness/eval/skill-lint.js +88 -68
  77. package/dist/harness/eval/skill-lint.js.map +1 -1
  78. package/dist/harness/journey.d.ts +88 -0
  79. package/dist/harness/journey.d.ts.map +1 -0
  80. package/dist/harness/journey.js +414 -0
  81. package/dist/harness/journey.js.map +1 -0
  82. package/dist/harness/quality-gates.d.ts +13 -0
  83. package/dist/harness/quality-gates.d.ts.map +1 -1
  84. package/dist/harness/quality-gates.js +23 -0
  85. package/dist/harness/quality-gates.js.map +1 -1
  86. package/dist/harness/sensors.d.ts +1 -1
  87. package/dist/harness/sensors.d.ts.map +1 -1
  88. package/dist/harness/sensors.js +32 -9
  89. package/dist/harness/sensors.js.map +1 -1
  90. package/dist/orchestrator/ai-rules-updater.d.ts +11 -3
  91. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
  92. package/dist/orchestrator/ai-rules-updater.js +44 -180
  93. package/dist/orchestrator/ai-rules-updater.js.map +1 -1
  94. package/dist/orchestrator/ai-skills/adapters.d.ts +28 -0
  95. package/dist/orchestrator/ai-skills/adapters.d.ts.map +1 -0
  96. package/dist/orchestrator/ai-skills/adapters.js +34 -0
  97. package/dist/orchestrator/ai-skills/adapters.js.map +1 -0
  98. package/dist/orchestrator/ai-skills/build.d.ts +10 -0
  99. package/dist/orchestrator/ai-skills/build.d.ts.map +1 -0
  100. package/dist/orchestrator/ai-skills/build.js +128 -0
  101. package/dist/orchestrator/ai-skills/build.js.map +1 -0
  102. package/dist/orchestrator/ai-skills/cap-stripper.d.ts +27 -0
  103. package/dist/orchestrator/ai-skills/cap-stripper.d.ts.map +1 -0
  104. package/dist/orchestrator/ai-skills/cap-stripper.js +78 -0
  105. package/dist/orchestrator/ai-skills/cap-stripper.js.map +1 -0
  106. package/dist/orchestrator/ai-skills/commands.d.ts +22 -0
  107. package/dist/orchestrator/ai-skills/commands.d.ts.map +1 -0
  108. package/dist/orchestrator/ai-skills/commands.js +109 -0
  109. package/dist/orchestrator/ai-skills/commands.js.map +1 -0
  110. package/dist/orchestrator/ai-skills/generator.d.ts +23 -0
  111. package/dist/orchestrator/ai-skills/generator.d.ts.map +1 -0
  112. package/dist/orchestrator/ai-skills/generator.js +79 -0
  113. package/dist/orchestrator/ai-skills/generator.js.map +1 -0
  114. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts +2 -0
  115. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts.map +1 -0
  116. package/dist/orchestrator/ai-skills/golden-skills.test.js +183 -0
  117. package/dist/orchestrator/ai-skills/golden-skills.test.js.map +1 -0
  118. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts +8 -0
  119. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts.map +1 -0
  120. package/dist/orchestrator/ai-skills/resolve-assistants.js +28 -0
  121. package/dist/orchestrator/ai-skills/resolve-assistants.js.map +1 -0
  122. package/dist/orchestrator/ai-skills/writer.d.ts +15 -0
  123. package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -0
  124. package/dist/orchestrator/ai-skills/writer.js +129 -0
  125. package/dist/orchestrator/ai-skills/writer.js.map +1 -0
  126. package/dist/orchestrator/flow-manager.d.ts +11 -0
  127. package/dist/orchestrator/flow-manager.d.ts.map +1 -1
  128. package/dist/orchestrator/flow-manager.js +147 -29
  129. package/dist/orchestrator/flow-manager.js.map +1 -1
  130. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts +59 -0
  131. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts.map +1 -0
  132. package/dist/orchestrator/mobile-runtime-scaffolder.js +298 -0
  133. package/dist/orchestrator/mobile-runtime-scaffolder.js.map +1 -0
  134. package/dist/orchestrator/project-initializer.d.ts +44 -7
  135. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  136. package/dist/orchestrator/project-initializer.js +147 -79
  137. package/dist/orchestrator/project-initializer.js.map +1 -1
  138. package/dist/orchestrator/screen-manager.d.ts +30 -0
  139. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  140. package/dist/orchestrator/screen-manager.js +205 -22
  141. package/dist/orchestrator/screen-manager.js.map +1 -1
  142. package/dist/orchestrator/templates/ai-src/README.md +58 -0
  143. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  144. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  145. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -4
  146. package/{src/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → dist/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  147. package/{src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → dist/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  148. package/dist/orchestrator/templates/ai-src/commands/design.md +29 -0
  149. package/{src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → dist/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  150. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  151. package/{src/orchestrator/templates/ai-instructions/claude-cmd-review.md → dist/orchestrator/templates/ai-src/commands/review.md} +57 -2
  152. package/{src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md → dist/orchestrator/templates/ai-src/commands/run-test.md} +116 -5
  153. package/dist/orchestrator/templates/ai-src/config/codex.md +8 -0
  154. package/{src/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  155. package/dist/orchestrator/templates/{ai-instructions/github-skill-sungen-error-mapping.md → ai-src/skills/sungen-error-mapping/SKILL.md} +49 -9
  156. package/{src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  157. package/{src/orchestrator/templates/ai-instructions/claude-skill-locale.md → dist/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  158. package/{src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
  159. package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-fix-mobile.md → ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  160. package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  161. package/dist/orchestrator/templates/playwright.config.ts +7 -4
  162. package/package.json +3 -3
  163. package/src/capabilities/discover.ts +29 -3
  164. package/src/cli/commands/add-flow.ts +2 -0
  165. package/src/cli/commands/add.ts +4 -0
  166. package/src/cli/commands/capability.ts +64 -1
  167. package/src/cli/commands/delivery.ts +89 -2
  168. package/src/cli/commands/eval.ts +3 -3
  169. package/src/cli/commands/gate.ts +44 -0
  170. package/src/cli/commands/generate.ts +2 -1
  171. package/src/cli/commands/init.ts +50 -3
  172. package/src/cli/commands/journey.ts +72 -0
  173. package/src/cli/commands/update.ts +14 -4
  174. package/src/cli/index.ts +4 -0
  175. package/src/dashboard/snapshot-builder.ts +10 -1
  176. package/src/exporters/csv-exporter.ts +3 -1
  177. package/src/exporters/json-exporter.ts +3 -1
  178. package/src/exporters/mobile-app-id.ts +34 -0
  179. package/src/exporters/spec-parser.ts +6 -2
  180. package/src/generators/test-generator/adapters/adapter-interface.ts +3 -0
  181. package/src/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  182. package/src/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  183. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  184. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  185. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  186. package/src/generators/test-generator/code-generator.ts +49 -9
  187. package/src/generators/test-generator/template-engine.ts +14 -1
  188. package/src/generators/test-generator/utils/selector-resolver.ts +51 -1
  189. package/src/harness/audit.ts +9 -2
  190. package/src/harness/catalog/universal-viewpoints.yaml +15 -0
  191. package/src/harness/eval/skill-lint.ts +71 -60
  192. package/src/harness/journey.ts +434 -0
  193. package/src/harness/quality-gates.ts +20 -0
  194. package/src/harness/sensors.ts +25 -8
  195. package/src/orchestrator/ai-rules-updater.ts +35 -197
  196. package/src/orchestrator/ai-skills/adapters.ts +52 -0
  197. package/src/orchestrator/ai-skills/build.ts +103 -0
  198. package/src/orchestrator/ai-skills/cap-stripper.ts +85 -0
  199. package/src/orchestrator/ai-skills/commands.ts +112 -0
  200. package/src/orchestrator/ai-skills/generator.ts +47 -0
  201. package/src/orchestrator/ai-skills/golden-skills.test.ts +124 -0
  202. package/src/orchestrator/ai-skills/resolve-assistants.ts +18 -0
  203. package/src/orchestrator/ai-skills/writer.ts +92 -0
  204. package/src/orchestrator/flow-manager.ts +165 -29
  205. package/src/orchestrator/mobile-runtime-scaffolder.ts +277 -0
  206. package/src/orchestrator/project-initializer.ts +159 -86
  207. package/src/orchestrator/screen-manager.ts +237 -22
  208. package/src/orchestrator/templates/ai-src/README.md +58 -0
  209. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  210. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  211. package/src/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -4
  212. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → src/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  213. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → src/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  214. package/src/orchestrator/templates/ai-src/commands/design.md +29 -0
  215. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → src/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  216. package/src/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  217. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-review.md → src/orchestrator/templates/ai-src/commands/review.md} +57 -2
  218. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md → src/orchestrator/templates/ai-src/commands/run-test.md} +116 -5
  219. package/src/orchestrator/templates/ai-src/config/codex.md +8 -0
  220. package/{dist/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  221. package/{dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md → src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md} +49 -9
  222. package/{dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  223. package/{dist/orchestrator/templates/ai-instructions/claude-skill-locale.md → src/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  224. package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
  225. package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-fix-mobile.md → ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  226. package/src/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  227. package/src/orchestrator/templates/playwright.config.ts +7 -4
  228. package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  229. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  230. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  231. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  232. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -93
  233. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  234. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  235. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  236. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  237. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  238. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  239. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -155
  240. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  241. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  242. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  243. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  244. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  245. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  246. package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  247. package/src/orchestrator/templates/ai-instructions/claude-skill-api-design.md +0 -62
  248. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +0 -82
  249. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-pat.md +0 -117
  250. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +0 -60
  251. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +0 -38
  252. package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +0 -35
  253. package/src/orchestrator/templates/ai-instructions/claude-skill-dashboard.md +0 -121
  254. package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +0 -141
  255. package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +0 -157
  256. package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +0 -446
  257. package/src/orchestrator/templates/ai-instructions/claude-skill-ingest-legacy.md +0 -79
  258. package/src/orchestrator/templates/ai-instructions/claude-skill-mobile-gestures.md +0 -109
  259. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  260. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +0 -320
  261. package/src/orchestrator/templates/ai-instructions/claude-skill-test-design-techniques.md +0 -118
  262. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-a-data-entry.md +0 -203
  263. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-b-data-ops.md +0 -179
  264. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-c-data-explore.md +0 -233
  265. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-d-display.md +0 -226
  266. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-e-identity.md +0 -177
  267. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint.md +0 -118
  268. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  269. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  270. package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -93
  271. package/src/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  272. package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  273. package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  274. package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  275. package/src/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  276. package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  277. package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -155
  278. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +0 -62
  279. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  280. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +0 -82
  281. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md +0 -117
  282. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +0 -60
  283. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +0 -38
  284. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +0 -35
  285. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md +0 -121
  286. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +0 -141
  287. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +0 -157
  288. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +0 -446
  289. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  290. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md +0 -79
  291. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  292. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md +0 -109
  293. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  294. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  295. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  296. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +0 -320
  297. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md +0 -118
  298. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md +0 -203
  299. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md +0 -179
  300. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md +0 -233
  301. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md +0 -226
  302. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md +0 -177
  303. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md +0 -118
  304. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  305. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  306. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  307. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  308. /package/dist/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  309. /package/dist/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  310. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-api-design.md → ai-src/skills/sungen-api-design/SKILL.md} +0 -0
  311. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture.md → ai-src/skills/sungen-capture/SKILL.md} +0 -0
  312. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-mcp.md → ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
  313. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-pat.md → ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
  314. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-live.md → ai-src/skills/sungen-capture/mode-live.md} +0 -0
  315. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-local.md → ai-src/skills/sungen-capture/mode-local.md} +0 -0
  316. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-dashboard.md → ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  317. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-delivery.md → ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  318. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-gherkin-syntax.md → ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
  319. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-ingest-legacy.md → ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
  320. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-mobile-gestures.md → ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
  321. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  322. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-review.md → ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
  323. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-test-design-techniques.md → ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
  324. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint.md → ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  325. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-a-data-entry.md → ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
  326. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-b-data-ops.md → ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
  327. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-c-data-explore.md → ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
  328. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-d-display.md → ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
  329. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-e-identity.md → ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
  330. /package/src/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  331. /package/src/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  332. /package/src/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  333. /package/src/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  334. /package/src/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  335. /package/src/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  336. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md → src/orchestrator/templates/ai-src/skills/sungen-api-design/SKILL.md} +0 -0
  337. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md → src/orchestrator/templates/ai-src/skills/sungen-capture/SKILL.md} +0 -0
  338. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
  339. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
  340. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-live.md} +0 -0
  341. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md} +0 -0
  342. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md → src/orchestrator/templates/ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  343. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md → src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  344. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md → src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
  345. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md → src/orchestrator/templates/ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
  346. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md → src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
  347. /package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  348. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md → src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
  349. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md → src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
  350. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  351. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
  352. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
  353. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
  354. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
  355. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.FlowManager = void 0;
42
42
  const fs = __importStar(require("fs"));
43
43
  const path = __importStar(require("path"));
44
+ const capability_1 = require("../harness/capability");
44
45
  class FlowManager {
45
46
  constructor() {
46
47
  this.cwd = process.cwd();
@@ -48,6 +49,14 @@ class FlowManager {
48
49
  }
49
50
  async addFlow(options) {
50
51
  this.validateFlowName(options.name);
52
+ // Detect project platform from qa/capabilities.yaml
53
+ const caps = (0, capability_1.readCapabilities)(this.cwd);
54
+ const isMobile = caps.platform === 'mobile';
55
+ // --reach is mobile-only; warn and drop when the project is web
56
+ if (options.reach && !isMobile) {
57
+ console.warn(`Warning: --reach is a mobile navigation recipe and is ignored for web projects. Dropping it.`);
58
+ options = { ...options, reach: undefined };
59
+ }
51
60
  const flowName = this.normalizeFlowName(options.name);
52
61
  const flowDir = path.join(this.flowsDir, flowName);
53
62
  const featuresDir = path.join(flowDir, 'features');
@@ -77,27 +86,39 @@ class FlowManager {
77
86
  console.error(` ${error instanceof Error ? error.message : String(error)}`);
78
87
  process.exit(1);
79
88
  }
80
- fs.writeFileSync(featurePath, this.generateFeatureTemplate(options, flowName), 'utf-8');
89
+ fs.writeFileSync(featurePath, this.generateFeatureTemplate(options, flowName, isMobile), 'utf-8');
81
90
  const startPath = options.path || '/login';
82
- fs.writeFileSync(selectorPath, [
83
- `# ${options.name} Flow Selectors`,
84
- `# Namespace keys by screen to avoid duplicates: "login:submit", "awards:submit"`,
85
- ``,
86
- `# --- Login screen ---`,
87
- `login:`,
88
- ` type: 'page'`,
89
- ` value: '${startPath}'`,
90
- ``,
91
- `# "login:email":`,
92
- `# type: 'testid'`,
93
- `# value: 'email-input'`,
94
- ``,
95
- `# "login:submit":`,
96
- `# type: 'role'`,
97
- `# value: 'button'`,
98
- `# name: 'Login'`,
99
- ``,
100
- ].join('\n'), 'utf-8');
91
+ const selectorLines = isMobile
92
+ ? [
93
+ `# ${options.name} Flow Selectors (mobile)`,
94
+ `# Namespace keys by screen: "home:button", "settings:save"`,
95
+ `# Generated at /sungen:run-test via Appium MCP — accessibility-id preferred.`,
96
+ ``,
97
+ `# "home:element":`,
98
+ `# type: 'accessibility-id'`,
99
+ `# value: 'element-id'`,
100
+ ``,
101
+ ]
102
+ : [
103
+ `# ${options.name} Flow Selectors`,
104
+ `# Namespace keys by screen to avoid duplicates: "login:submit", "awards:submit"`,
105
+ ``,
106
+ `# --- Login screen ---`,
107
+ `login:`,
108
+ ` type: 'page'`,
109
+ ` value: '${startPath}'`,
110
+ ``,
111
+ `# "login:email":`,
112
+ `# type: 'testid'`,
113
+ `# value: 'email-input'`,
114
+ ``,
115
+ `# "login:submit":`,
116
+ `# type: 'role'`,
117
+ `# value: 'button'`,
118
+ `# name: 'Login'`,
119
+ ``,
120
+ ];
121
+ fs.writeFileSync(selectorPath, selectorLines.join('\n'), 'utf-8');
101
122
  fs.writeFileSync(testDataPath, [
102
123
  `# ${options.name} Flow Test Data`,
103
124
  `# Namespace by phase: login.email, submission.nominee`,
@@ -105,7 +126,7 @@ class FlowManager {
105
126
  ``,
106
127
  ].join('\n'), 'utf-8');
107
128
  const specPath = path.join(requirementsDir, 'spec.md');
108
- fs.writeFileSync(specPath, this.generateSpecTemplate(options, flowName), 'utf-8');
129
+ fs.writeFileSync(specPath, this.generateSpecTemplate(options, flowName, isMobile), 'utf-8');
109
130
  const viewpointPath = path.join(requirementsDir, 'test-viewpoint.md');
110
131
  fs.writeFileSync(viewpointPath, this.generateViewpointTemplate(options), 'utf-8');
111
132
  console.log(`Created files:`);
@@ -116,12 +137,22 @@ class FlowManager {
116
137
  console.log(` ${path.relative(this.cwd, viewpointPath)}`);
117
138
  console.log(` ${path.relative(this.cwd, requirementsUiDir)}/`);
118
139
  console.log('');
119
- console.log('Next steps:');
120
- console.log(` 1. Fill requirements/spec.md with flow specification (screens, transitions, business rules)`);
121
- console.log(` Optionally add UI designs to requirements/ui/`);
122
- console.log(` 2. Generate test cases: /sungen:create-test ${flowName}`);
123
- console.log(` 3. Compile: sungen generate --flow ${flowName}`);
124
- console.log(` 4. Run: npx playwright test\n`);
140
+ if (isMobile) {
141
+ console.log('Next steps:');
142
+ console.log(` 1. Fill requirements/spec.md with flow specification (screens, transitions, business rules)`);
143
+ console.log(` Use sungen-capture-mobile to scan each screen via Appium MCP`);
144
+ console.log(` 2. Generate test cases: /sungen:create-test ${flowName}`);
145
+ console.log(` 3. Compile: sungen generate --flow ${flowName} --framework appium`);
146
+ console.log(` 4. Run: npm run test:mobile\n`);
147
+ }
148
+ else {
149
+ console.log('Next steps:');
150
+ console.log(` 1. Fill requirements/spec.md with flow specification (screens, transitions, business rules)`);
151
+ console.log(` Optionally add UI designs to requirements/ui/`);
152
+ console.log(` 2. Generate test cases: /sungen:create-test ${flowName}`);
153
+ console.log(` 3. Compile: sungen generate --flow ${flowName}`);
154
+ console.log(` 4. Run: npx playwright test\n`);
155
+ }
125
156
  }
126
157
  validateFlowName(name) {
127
158
  if (!name || name.trim().length === 0) {
@@ -140,7 +171,38 @@ class FlowManager {
140
171
  .replace(/^-+|-+$/g, '')
141
172
  .replace(/-+/g, '-');
142
173
  }
143
- generateSpecTemplate(options, flowName) {
174
+ generateSpecTemplate(options, flowName, isMobile) {
175
+ if (isMobile) {
176
+ return `# ${options.name} Flow Specification
177
+
178
+ ## Overview
179
+ - **Platform:** mobile (Android + iOS)
180
+ - **Auth Required:** no
181
+ - **Starting screen reach:** ${options.reach || '<!-- nav recipe to reach the first screen, e.g. "tap [Tab] > tap [Row]" -->'}
182
+
183
+ ## Screens in Flow
184
+ <!-- List all screens this flow visits, in order -->
185
+
186
+ | # | Screen | Reach | Description |
187
+ |---|--------|-------|-------------|
188
+ | 1 | [Screen Name] | tap [element] | [What user does here] |
189
+
190
+ ## Flow Steps
191
+
192
+ ### Step 1: [Screen Name]
193
+ - **Action:** [What the user taps]
194
+ - **Expected:** [What should happen]
195
+ - **Transition:** Navigates to Step 2
196
+
197
+ ## Business Rules
198
+ <!-- Rules that affect the flow: permissions, conditions, limits -->
199
+ - [Rule 1]
200
+
201
+ ## Notes
202
+ <!-- Edge cases, known issues, environment-specific behavior -->
203
+ - [Note 1]
204
+ `;
205
+ }
144
206
  const startPath = options.path || '/login';
145
207
  return `# ${options.name} Flow Specification
146
208
 
@@ -222,8 +284,31 @@ class FlowManager {
222
284
  '',
223
285
  ].join('\n');
224
286
  }
225
- generateFeatureTemplate(options, flowName) {
287
+ generateFeatureTemplate(options, flowName, isMobile) {
226
288
  const description = options.description || `complete the ${options.name} flow`;
289
+ if (isMobile) {
290
+ const background = this.buildMobileBackground(options.reach);
291
+ return `@flow @platform:mobile
292
+ Feature: ${options.name} Flow
293
+
294
+ As a user
295
+ I want to ${description}
296
+ So that I can accomplish my end-to-end goal
297
+
298
+ # Mobile (Appium) flow — selectors use colon namespace: "home:element", "settings:save".
299
+ # See sungen-mobile-gestures for swipe/long-press/scroll steps.
300
+
301
+ ${background}
302
+ @high
303
+ Scenario: Sample step for ${options.name}
304
+ When User tap [Home:element]
305
+ Then User see [Settings] screen
306
+
307
+ Scenario: Sample next step for ${options.name}
308
+ When User tap [Settings:element]
309
+ Then User see [Result:header] header with {{result_text}}
310
+ `;
311
+ }
227
312
  return `@flow
228
313
  Feature: ${options.name} Flow
229
314
 
@@ -246,6 +331,39 @@ Feature: ${options.name} Flow
246
331
  Then User see "expected result" text
247
332
  `;
248
333
  }
334
+ /**
335
+ * Build the Background block for a mobile flow — same structure as screen-manager.
336
+ * The `--reach` steps represent how to reach the FIRST screen of the flow from app launch.
337
+ */
338
+ buildMobileBackground(reach) {
339
+ const normalizeStep = (raw) => raw
340
+ .trim()
341
+ .replace(/^(given|when|and|then|but)\s+/i, '')
342
+ .replace(/^user\s+/i, '')
343
+ .trim();
344
+ const steps = (reach || '')
345
+ .split('>')
346
+ .map(normalizeStep)
347
+ .filter(Boolean);
348
+ if (steps.length === 0) {
349
+ return [
350
+ ' Background:',
351
+ ' # Navigation recipe — how to reach the first screen of this flow from app launch.',
352
+ ' # Prefill with --reach "tap [Tab] > tap [Row]" at add-flow time.',
353
+ ' Given User is on [Home] screen',
354
+ ' # When User tap [<tab or button that leads to the first screen>]',
355
+ '',
356
+ ].join('\n');
357
+ }
358
+ const navLines = steps.map((body, i) => ` ${i === 0 ? 'When' : 'And'} User ${body}`);
359
+ return [
360
+ ' Background:',
361
+ ' # Navigation recipe — replayed by capture-mobile to land on the first screen.',
362
+ ' Given User is on [Home] screen',
363
+ ...navLines,
364
+ '',
365
+ ].join('\n');
366
+ }
249
367
  }
250
368
  exports.FlowManager = FlowManager;
251
369
  //# sourceMappingURL=flow-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow-manager.js","sourceRoot":"","sources":["../../src/orchestrator/flow-manager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAQ7B,MAAa,WAAW;IAItB;QACE,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB;QAChC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAA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BhC,CAAC;IACA,CAAC;IAEO,yBAAyB,CAAC,OAAoB;QACpD,OAAO;YACL,KAAK,OAAO,CAAC,IAAI,yBAAyB;YAC1C,EAAE;YACF,eAAe;YACf,EAAE;YACF,6DAA6D;YAC7D,2EAA2E;YAC3E,8EAA8E;YAC9E,6EAA6E;YAC7E,sEAAsE;YACtE,KAAK;YACL,EAAE;YACF,iBAAiB;YACjB,EAAE;YACF,iDAAiD;YACjD,+DAA+D;YAC/D,oEAAoE;YACpE,KAAK;YACL,EAAE;YACF,qBAAqB;YACrB,EAAE;YACF,qDAAqD;YACrD,yDAAyD;YACzD,+CAA+C;YAC/C,+CAA+C;YAC/C,KAAK;YACL,EAAE;YACF,0BAA0B;YAC1B,EAAE;YACF,0DAA0D;YAC1D,uDAAuD;YACvD,mEAAmE;YACnE,6EAA6E;YAC7E,KAAK;YACL,EAAE;YACF,wBAAwB;YACxB,EAAE;YACF,kEAAkE;YAClE,EAAE;YACF,4BAA4B;YAC5B,2BAA2B;YAC3B,oDAAoD;YACpD,mDAAmD;YACnD,oEAAoE;YACpE,2EAA2E;YAC3E,KAAK;YACL,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAEO,uBAAuB,CAAC,OAAoB,EAAE,QAAgB;QACpE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,gBAAgB,OAAO,CAAC,IAAI,OAAO,CAAC;QAE/E,OAAO;WACA,OAAO,CAAC,IAAI;;;cAGT,WAAW;;;;;;;;;;;;;mCAaU,OAAO,CAAC,IAAI;;;CAG9C,CAAC;IACA,CAAC;CACF;AAnOD,kCAmOC"}
1
+ {"version":3,"file":"flow-manager.js","sourceRoot":"","sources":["../../src/orchestrator/flow-manager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,sDAAyD;AAczD,MAAa,WAAW;IAItB;QACE,I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FAAmF;YACnF,oCAAoC;YACpC,GAAG,QAAQ;YACX,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF;AApWD,kCAoWC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Mobile Runtime Scaffolder
3
+ *
4
+ * Emits the Appium/WebdriverIO harness files into a project directory.
5
+ * Called by ProjectInitializer (init --mobile) and, in Phase 02, by `capability add mobile`.
6
+ * Never duplicated — always imported from here.
7
+ */
8
+ export interface MobileInitOptions {
9
+ enabled: boolean;
10
+ /** Mobile-only project: skip all web (Playwright) scaffolding, deps, and Chromium download. */
11
+ mobileOnly?: boolean;
12
+ appPackage?: string;
13
+ appActivity?: string;
14
+ appApk?: string;
15
+ androidUdid?: string;
16
+ iosBundleId?: string;
17
+ iosDevice?: string;
18
+ iosVersion?: string;
19
+ }
20
+ export interface ScaffoldResult {
21
+ created: string[];
22
+ skipped: string[];
23
+ }
24
+ /**
25
+ * Emit the mobile runtime harness into `cwd`.
26
+ *
27
+ * Files written:
28
+ * wdio.conf.ts — project root (seeded from mobile options)
29
+ * specs/reporters/pw-shape-reporter.ts — Playwright-shaped JSON reporter for WDIO
30
+ * .env.appium — seeded from flags (gitignored)
31
+ * .env.appium.example — committed placeholder guide
32
+ *
33
+ * The caller is responsible for adding `test:mobile` to package.json scripts and
34
+ * writing qa/capabilities.yaml — helpers for both are exported below.
35
+ */
36
+ export declare function emitMobileRuntime(cwd: string, opts: MobileInitOptions): ScaffoldResult;
37
+ /**
38
+ * Write qa/capabilities.yaml for a mobile project.
39
+ * Uses the canonical writeCapabilities from harness/capability so the format is always consistent.
40
+ */
41
+ export declare function writeMobileCapabilities(cwd: string): string;
42
+ /**
43
+ * Best-effort provision of the mobile runtime into a project that has opted into mobile
44
+ * (`sungen init --mobile` / `sungen capability add mobile` — never auto-run; consent-gated).
45
+ *
46
+ * Installs everything the runner needs:
47
+ * 1. `@sungen/driver-mobile` + its WebdriverIO/Appium runtime (declared as that package's `dependencies`).
48
+ * A local `file:` spec (dev/dogfood) uses `npm install --install-links` so npm COPIES the package and
49
+ * installs its transitive deps — a plain file: install only SYMLINKS it and skips the runtime. A
50
+ * published/registry spec installs deps normally.
51
+ * 2. the appium PLATFORM drivers (uiautomator2 / xcuitest, ~/.appium-managed) — NOT npm packages, so
52
+ * installed via the appium CLI here (installAppiumPlatformDrivers), so a session can actually start.
53
+ *
54
+ * Non-fatal: logs a warning on failure so offline/air-gapped init still scaffolds correctly.
55
+ *
56
+ * @returns true if the driver install succeeded (or was already present), false on failure
57
+ */
58
+ export declare function installMobileDriver(cwd: string): boolean;
59
+ //# sourceMappingURL=mobile-runtime-scaffolder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-runtime-scaffolder.d.ts","sourceRoot":"","sources":["../../src/orchestrator/mobile-runtime-scaffolder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAQD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,cAAc,CAkEtF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAgGD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAyCxD"}
@@ -0,0 +1,298 @@
1
+ "use strict";
2
+ /**
3
+ * Mobile Runtime Scaffolder
4
+ *
5
+ * Emits the Appium/WebdriverIO harness files into a project directory.
6
+ * Called by ProjectInitializer (init --mobile) and, in Phase 02, by `capability add mobile`.
7
+ * Never duplicated — always imported from here.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.emitMobileRuntime = emitMobileRuntime;
44
+ exports.writeMobileCapabilities = writeMobileCapabilities;
45
+ exports.installMobileDriver = installMobileDriver;
46
+ const fs = __importStar(require("fs"));
47
+ const path = __importStar(require("path"));
48
+ const child_process_1 = require("child_process");
49
+ const capability_1 = require("../harness/capability");
50
+ /** Read a template from the orchestrator's bundled templates directory. */
51
+ function readTemplate(filename) {
52
+ const templatePath = path.join(__dirname, 'templates', filename);
53
+ return fs.readFileSync(templatePath, 'utf-8');
54
+ }
55
+ /**
56
+ * Emit the mobile runtime harness into `cwd`.
57
+ *
58
+ * Files written:
59
+ * wdio.conf.ts — project root (seeded from mobile options)
60
+ * specs/reporters/pw-shape-reporter.ts — Playwright-shaped JSON reporter for WDIO
61
+ * .env.appium — seeded from flags (gitignored)
62
+ * .env.appium.example — committed placeholder guide
63
+ *
64
+ * The caller is responsible for adding `test:mobile` to package.json scripts and
65
+ * writing qa/capabilities.yaml — helpers for both are exported below.
66
+ */
67
+ function emitMobileRuntime(cwd, opts) {
68
+ const created = [];
69
+ const skipped = [];
70
+ // wdio.conf.ts (project root) — substitute init-provided app defaults into the template
71
+ const wdioPath = path.join(cwd, 'wdio.conf.ts');
72
+ if (fs.existsSync(wdioPath)) {
73
+ skipped.push('wdio.conf.ts');
74
+ }
75
+ else {
76
+ const content = readTemplate('wdio.conf.ts')
77
+ .replace('__APP_PACKAGE__', opts.appPackage || 'com.example.app')
78
+ // appActivity is optional — leave empty when not provided so UiAutomator2
79
+ // auto-resolves the launcher activity from appPackage. Only pin when explicitly passed.
80
+ .replace('__APP_ACTIVITY__', opts.appActivity || '')
81
+ .replace('__ANDROID_UDID__', opts.androidUdid || 'emulator-5554')
82
+ .replace('__IOS_BUNDLE_ID__', opts.iosBundleId || 'com.example.app')
83
+ .replace('__IOS_DEVICE__', opts.iosDevice || 'iPhone 16')
84
+ .replace('__IOS_VERSION__', opts.iosVersion || '18.0');
85
+ fs.writeFileSync(wdioPath, content, 'utf-8');
86
+ created.push('wdio.conf.ts');
87
+ }
88
+ // specs/reporters/pw-shape-reporter.ts
89
+ const reporterPath = path.join(cwd, 'specs', 'reporters', 'pw-shape-reporter.ts');
90
+ if (fs.existsSync(reporterPath)) {
91
+ skipped.push('specs/reporters/pw-shape-reporter.ts');
92
+ }
93
+ else {
94
+ fs.mkdirSync(path.dirname(reporterPath), { recursive: true });
95
+ fs.writeFileSync(reporterPath, readTemplate('specs-pw-shape-reporter.ts'), 'utf-8');
96
+ created.push('specs/reporters/pw-shape-reporter.ts');
97
+ }
98
+ // .env.appium — seeded from the flags that were provided; env vars that were not passed
99
+ // are left commented out so the file is a useful guide without imposing bogus values.
100
+ const envPath = path.join(cwd, '.env.appium');
101
+ if (fs.existsSync(envPath)) {
102
+ skipped.push('.env.appium');
103
+ }
104
+ else {
105
+ const lines = [
106
+ '# .env.appium — loaded by wdio.conf.ts. Shell exports override these values.',
107
+ '# See .env.appium.example for the full reference.',
108
+ '',
109
+ ];
110
+ if (opts.appPackage)
111
+ lines.push(`APP_PACKAGE=${opts.appPackage}`);
112
+ if (opts.appActivity)
113
+ lines.push(`APP_ACTIVITY=${opts.appActivity}`);
114
+ if (opts.appApk)
115
+ lines.push(`APP_APK=${opts.appApk}`);
116
+ if (opts.androidUdid)
117
+ lines.push(`ANDROID_UDID=${opts.androidUdid}`);
118
+ if (opts.iosBundleId)
119
+ lines.push(`IOS_BUNDLE_ID=${opts.iosBundleId}`);
120
+ if (opts.iosDevice)
121
+ lines.push(`IOS_DEVICE=${opts.iosDevice}`);
122
+ if (opts.iosVersion)
123
+ lines.push(`IOS_VERSION=${opts.iosVersion}`);
124
+ lines.push('');
125
+ fs.writeFileSync(envPath, lines.join('\n'), 'utf-8');
126
+ created.push('.env.appium');
127
+ }
128
+ // .env.appium.example — committed placeholder guide (template stored without leading dot
129
+ // so copy-templates' glob picks it up; the output file gets the dot).
130
+ const envExamplePath = path.join(cwd, '.env.appium.example');
131
+ if (fs.existsSync(envExamplePath)) {
132
+ skipped.push('.env.appium.example');
133
+ }
134
+ else {
135
+ fs.writeFileSync(envExamplePath, readTemplate('env.appium.example'), 'utf-8');
136
+ created.push('.env.appium.example');
137
+ }
138
+ return { created, skipped };
139
+ }
140
+ /**
141
+ * Write qa/capabilities.yaml for a mobile project.
142
+ * Uses the canonical writeCapabilities from harness/capability so the format is always consistent.
143
+ */
144
+ function writeMobileCapabilities(cwd) {
145
+ return (0, capability_1.writeCapabilities)(cwd, { platform: 'mobile', enabled: ['mobile'] });
146
+ }
147
+ /**
148
+ * Resolve the install spec for `@sungen/driver-mobile`.
149
+ *
150
+ * In a monorepo checkout (dev / dogfood) the driver lives at `packages/driver-mobile` next to core and
151
+ * is NOT published to the registry — so we install it by `file:` path. In a published install (core in
152
+ * node_modules, no sibling package) we fall back to the registry pinned to the core version (lockstep).
153
+ *
154
+ * Why: a bare `@sungen/driver-mobile@<coreVersion>` hits npm E404 whenever the driver is unpublished or
155
+ * the consuming project lives outside the workspace (`test-mobile/`). The local `file:` path makes the
156
+ * dev/dogfood path work without the registry, while the registry fallback preserves lockstep for users.
157
+ */
158
+ function resolveMobileDriverSpec() {
159
+ // From this file (src/orchestrator OR dist/orchestrator) the sibling driver package is ../../../driver-mobile.
160
+ const localDriverDir = path.resolve(__dirname, '..', '..', '..', 'driver-mobile');
161
+ if (fs.existsSync(path.join(localDriverDir, 'package.json'))) {
162
+ return `file:${localDriverDir}`;
163
+ }
164
+ let coreVersion = 'latest';
165
+ try {
166
+ coreVersion = require('../../package.json').version || 'latest';
167
+ }
168
+ catch {
169
+ // noop — fall back to latest
170
+ }
171
+ return `@sungen/driver-mobile@${coreVersion}`;
172
+ }
173
+ /** Best-effort `npm install -D <specs…> [extraArgs…]` in `cwd`. Returns true on exit code 0. */
174
+ function npmInstallDev(cwd, specs, extraArgs = []) {
175
+ const result = (0, child_process_1.spawnSync)('npm', ['install', '-D', ...specs, ...extraArgs], { cwd, stdio: 'inherit', shell: true });
176
+ return result.status === 0;
177
+ }
178
+ /**
179
+ * Locate the project's locally-installed appium CLI bin. Walks up from `cwd` so it works whether the
180
+ * appium dep is nested under @sungen/driver-mobile or hoisted to a parent node_modules/.bin. Returns
181
+ * null when appium is not installed in the project (then we skip cleanly — no `npx` auto-fetch).
182
+ */
183
+ function appiumBinPath(cwd) {
184
+ const binName = process.platform === 'win32' ? 'appium.cmd' : 'appium';
185
+ let dir = path.resolve(cwd);
186
+ for (let i = 0; i < 8; i++) {
187
+ const bin = path.join(dir, 'node_modules', '.bin', binName);
188
+ if (fs.existsSync(bin))
189
+ return bin;
190
+ const parent = path.dirname(dir);
191
+ if (parent === dir)
192
+ break;
193
+ dir = parent;
194
+ }
195
+ return null;
196
+ }
197
+ /** Appium platform drivers already installed in ~/.appium (per-user). Empty set if it can't tell. */
198
+ function installedAppiumDrivers(appiumBin, cwd) {
199
+ const r = (0, child_process_1.spawnSync)(appiumBin, ['driver', 'list', '--installed', '--json'], { cwd, encoding: 'utf-8' });
200
+ if (r.status !== 0 || !r.stdout)
201
+ return new Set();
202
+ try {
203
+ return new Set(Object.keys(JSON.parse(r.stdout)));
204
+ }
205
+ catch {
206
+ return new Set();
207
+ }
208
+ }
209
+ /**
210
+ * Auto-install the Appium PLATFORM drivers needed for ANY session — both the appium-mcp live capture
211
+ * (`/sungen:create-test`) and the wdio runner (`/sungen:run-test`). Provisioned by the SAME code path
212
+ * that installs @sungen/driver-mobile (right after its `appium` dep is installed). Best-effort + idempotent.
213
+ *
214
+ * - `uiautomator2` (Android): cross-platform → always.
215
+ * - `xcuitest` (iOS): macOS-only — it builds WebDriverAgent via Xcode at RUN time, usable only on a
216
+ * Mac → installed only on darwin; elsewhere we print the command for when on a Mac.
217
+ *
218
+ * Runs the project-local appium bin directly (NOT `npx`, which would either auto-fetch a latest appium
219
+ * or hard-fail with `--no-install`). If appium isn't installed in the project, skip with a clear hint.
220
+ */
221
+ function installAppiumPlatformDrivers(cwd) {
222
+ const appiumBin = appiumBinPath(cwd);
223
+ if (!appiumBin) {
224
+ console.warn('⚠️ appium is not installed in the project — skipping platform-driver install.\n' +
225
+ ' Install the mobile runtime first (the @sungen/driver-mobile deps via `npm install`), then run:\n' +
226
+ ` npx appium driver install uiautomator2${process.platform === 'darwin' ? ' (+ xcuitest)' : ''}`);
227
+ return;
228
+ }
229
+ const installed = installedAppiumDrivers(appiumBin, cwd);
230
+ const want = ['uiautomator2', ...(process.platform === 'darwin' ? ['xcuitest'] : [])];
231
+ for (const drv of want) {
232
+ if (installed.has(drv)) {
233
+ console.log(`✓ appium driver "${drv}" already installed.`);
234
+ continue;
235
+ }
236
+ console.log(`📦 Installing appium driver "${drv}"...`);
237
+ const r = (0, child_process_1.spawnSync)(appiumBin, ['driver', 'install', drv], { cwd, stdio: 'inherit' });
238
+ if (!r || r.status !== 0) {
239
+ console.warn(`⚠️ appium driver "${drv}" not installed (best-effort) — retry: npx appium driver install ${drv}`);
240
+ }
241
+ }
242
+ if (process.platform !== 'darwin') {
243
+ console.log('ℹ️ iOS (xcuitest) is macOS-only (needs Xcode at run time) — skipped on this OS. On a Mac: npx appium driver install xcuitest');
244
+ }
245
+ }
246
+ /**
247
+ * Best-effort provision of the mobile runtime into a project that has opted into mobile
248
+ * (`sungen init --mobile` / `sungen capability add mobile` — never auto-run; consent-gated).
249
+ *
250
+ * Installs everything the runner needs:
251
+ * 1. `@sungen/driver-mobile` + its WebdriverIO/Appium runtime (declared as that package's `dependencies`).
252
+ * A local `file:` spec (dev/dogfood) uses `npm install --install-links` so npm COPIES the package and
253
+ * installs its transitive deps — a plain file: install only SYMLINKS it and skips the runtime. A
254
+ * published/registry spec installs deps normally.
255
+ * 2. the appium PLATFORM drivers (uiautomator2 / xcuitest, ~/.appium-managed) — NOT npm packages, so
256
+ * installed via the appium CLI here (installAppiumPlatformDrivers), so a session can actually start.
257
+ *
258
+ * Non-fatal: logs a warning on failure so offline/air-gapped init still scaffolds correctly.
259
+ *
260
+ * @returns true if the driver install succeeded (or was already present), false on failure
261
+ */
262
+ function installMobileDriver(cwd) {
263
+ const driverSpec = resolveMobileDriverSpec();
264
+ // A `file:` spec (unpublished dev/dogfood driver) MUST install with --install-links: a plain file:
265
+ // install only SYMLINKS the package and skips its transitive deps, so the wdio/appium runtime never
266
+ // lands in the project. --install-links makes npm COPY it and install those deps. Registry specs
267
+ // install deps normally, so the flag is omitted there.
268
+ const isFileSpec = driverSpec.startsWith('file:');
269
+ // Provisioned only when BOTH the driver dep AND its appium runtime are present — a driver that was
270
+ // symlinked earlier (no runtime) must be re-installed (with --install-links) to actually pull appium.
271
+ let hasDriverDep = false;
272
+ try {
273
+ const pkgJsonPath = path.join(cwd, 'package.json');
274
+ if (fs.existsSync(pkgJsonPath)) {
275
+ const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
276
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
277
+ hasDriverDep = !!allDeps['@sungen/driver-mobile'];
278
+ }
279
+ }
280
+ catch {
281
+ // proceed to install
282
+ }
283
+ const runtimeReady = hasDriverDep && appiumBinPath(cwd) !== null;
284
+ let driverOk = runtimeReady;
285
+ if (!runtimeReady) {
286
+ console.log(`📦 Installing mobile driver + runtime (${driverSpec})...`);
287
+ driverOk = npmInstallDev(cwd, [driverSpec], isFileSpec ? ['--install-links'] : []);
288
+ if (!driverOk) {
289
+ console.warn(`⚠️ Could not install ${driverSpec} — scaffold is complete but the mobile driver is not installed.\n` +
290
+ ` Install manually later: npm install -D ${driverSpec}${isFileSpec ? ' --install-links' : ''}`);
291
+ }
292
+ }
293
+ // Appium platform driver(s) — REQUIRED for any session (appium-mcp live capture AND the wdio runner).
294
+ // NOT npm packages, so installed via the appium CLI here, by the same code path that installs the driver.
295
+ installAppiumPlatformDrivers(cwd);
296
+ return driverOk;
297
+ }
298
+ //# sourceMappingURL=mobile-runtime-scaffolder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-runtime-scaffolder.js","sourceRoot":"","sources":["../../src/orchestrator/mobile-runtime-scaffolder.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CH,8CAkEC;AAMD,0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