@capagents/forgeqe 2.8.9 → 2.9.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 (131) hide show
  1. package/dist/docs-site/docs/index.html +74 -0
  2. package/dist/docs-site/docs/search.js +1 -1
  3. package/dist/forgeqe.js +2035 -2028
  4. package/dist/template.html +66 -66
  5. package/dist/web/THIRD_PARTY_NOTICES.md +455 -0
  6. package/dist/web/assets/Agent-BGwHbXbc.js +4 -0
  7. package/dist/web/assets/ApiTests-DSnZHRlF.js +10 -0
  8. package/dist/web/assets/Browse-Dx3pHGuG.js +2 -0
  9. package/dist/web/assets/Chat-BcFP0BbA.js +3 -0
  10. package/dist/web/assets/CommandPalette-v6mqHZnU.js +1 -0
  11. package/dist/web/assets/Cost-C9LZdx1p.js +1 -0
  12. package/dist/web/assets/Data-DvbaOc9e.js +6 -0
  13. package/dist/web/assets/Evidence-Y1AeSzh5.js +1 -0
  14. package/dist/web/assets/Explore-Dw8S6DG1.js +2 -0
  15. package/dist/web/assets/Features-CjrVraBE.js +1 -0
  16. package/dist/web/assets/Flags-C_Qm0078.js +2 -0
  17. package/dist/web/assets/Flaky-DYgN586D.js +1 -0
  18. package/dist/web/assets/ForceGraph-CEH86-Z0.js +1 -0
  19. package/dist/web/assets/Impact-dBPp7aM2.js +3 -0
  20. package/dist/web/assets/Jobs-CSyN6YRx.js +5 -0
  21. package/dist/web/assets/KindPage-BQl-5bcd.js +6 -0
  22. package/dist/web/assets/Migration-COly7O-T.js +2 -0
  23. package/dist/web/assets/Product-7mM8tcxH.js +7 -0
  24. package/dist/web/assets/Production-De5CCUoP.js +1 -0
  25. package/dist/web/assets/Quality-Q_iqj3fk.js +1 -0
  26. package/dist/web/assets/Readiness-kU9kum_I.js +1 -0
  27. package/dist/web/assets/Record-CIhINuEz.js +2 -0
  28. package/dist/web/assets/Regression-CMQnH7dN.js +5 -0
  29. package/dist/web/assets/Reports-dUOe6_vN.js +2 -0
  30. package/dist/web/assets/Response-DGl2R0A-.js +4 -0
  31. package/dist/web/assets/RunDiff-BVRRIz3m.js +1 -0
  32. package/dist/web/assets/Runs-CkNWhAhe.js +2 -0
  33. package/dist/web/assets/TestCases-exR7hRWd.js +1 -0
  34. package/dist/web/assets/TestData-yVPMg9kw.js +2 -0
  35. package/dist/web/assets/TestDebt-C3sM6cH0.js +1 -0
  36. package/dist/web/assets/Tosca-Bcalg1JU.js +2 -0
  37. package/dist/web/assets/WhatsNew-EFSt6xx2.js +1 -0
  38. package/dist/web/assets/dataParts-D33u08WR.js +3 -0
  39. package/dist/web/assets/{families-q4nF1Fqo.js → families-Btjss8bN.js} +1 -1
  40. package/dist/web/assets/frame-D3IhgCFt.js +4 -0
  41. package/dist/web/assets/index-D5sya6FK.css +2 -0
  42. package/dist/web/assets/index-v-k_CVn7.js +45 -0
  43. package/dist/web/assets/line-icons-CQ-3V8ax.js +1 -0
  44. package/dist/web/assets/logos-CfpaNwbY.js +1 -0
  45. package/dist/web/assets/palette-X7hU78Wy.js +1 -0
  46. package/dist/web/assets/parts-B7YrlR3a.js +1 -0
  47. package/dist/web/assets/productParts-CAxyMnWJ.js +1 -0
  48. package/dist/web/assets/qualityParts-CN9JVKZN.js +1 -0
  49. package/dist/web/assets/rows-IEP4Jvfi.js +1 -0
  50. package/dist/web/assets/{segmented-BJECij_J.js → segmented-DBqHvZW3.js} +1 -1
  51. package/dist/web/assets/thread-BeaLQ_f4.js +5 -0
  52. package/dist/web/assets/usePageChat-D_3KsqBU.js +1 -0
  53. package/dist/web/index.html +4 -3
  54. package/docs/user-guide.html +74 -0
  55. package/evals/evidence/build/README.md +20 -0
  56. package/evals/evidence/build/base/package.json +1 -0
  57. package/evals/evidence/build/base/src/index.ts +1 -0
  58. package/evals/evidence/build/base/src/pricing.ts +22 -0
  59. package/evals/evidence/build/base/tests/discount.test.ts +6 -0
  60. package/evals/evidence/build/base/tests/legacy.test.ts +7 -0
  61. package/evals/evidence/build/base/tests/pricing.test.ts +10 -0
  62. package/evals/evidence/build/cases/build-broken/after/src/pricing.ts +22 -0
  63. package/evals/evidence/build/cases/build-broken/case.json +13 -0
  64. package/evals/evidence/build/cases/fixes-legacy/after/src/pricing.ts +22 -0
  65. package/evals/evidence/build/cases/fixes-legacy/case.json +11 -0
  66. package/evals/evidence/build/cases/flaky-test/after/tests/flaky.test.ts +11 -0
  67. package/evals/evidence/build/cases/flaky-test/case.json +11 -0
  68. package/evals/evidence/build/cases/good-feature/after/src/index.ts +1 -0
  69. package/evals/evidence/build/cases/good-feature/after/src/pricing.ts +28 -0
  70. package/evals/evidence/build/cases/good-feature/after/tests/bulk.test.ts +7 -0
  71. package/evals/evidence/build/cases/good-feature/case.json +17 -0
  72. package/evals/evidence/build/cases/new-test-fails/after/src/index.ts +1 -0
  73. package/evals/evidence/build/cases/new-test-fails/after/src/pricing.ts +27 -0
  74. package/evals/evidence/build/cases/new-test-fails/after/tests/coupon.test.ts +6 -0
  75. package/evals/evidence/build/cases/new-test-fails/case.json +19 -0
  76. package/evals/evidence/build/cases/regression/after/src/pricing.ts +23 -0
  77. package/evals/evidence/build/cases/regression/case.json +13 -0
  78. package/evals/evidence/build/cases/test-removed/case.json +14 -0
  79. package/forgeqe.example.yaml +2 -0
  80. package/package.json +2 -1
  81. package/py/forgeqe_engine/browser.py +309 -31
  82. package/py/forgeqe_engine/browserdoctor.py +255 -0
  83. package/py/forgeqe_engine/browserlaunch.py +271 -0
  84. package/py/forgeqe_engine/capture.py +20 -4
  85. package/py/forgeqe_engine/cli.py +26 -0
  86. package/py/forgeqe_engine/logins.py +1 -1
  87. package/py/forgeqe_engine/pwlaunch.mjs +61 -0
  88. package/py/forgeqe_engine/recordsession.py +1 -1
  89. package/py/forgeqe_engine/service.py +1 -1
  90. package/dist/web/assets/Agent-CHliM9aG.js +0 -4
  91. package/dist/web/assets/ApiTests-DcGDtIjl.js +0 -10
  92. package/dist/web/assets/Browse-DWZgEdaB.js +0 -1
  93. package/dist/web/assets/Chat-DVolc6Rs.js +0 -3
  94. package/dist/web/assets/CommandPalette-CdwjRIsa.js +0 -1
  95. package/dist/web/assets/Cost-BifpK_Ac.js +0 -1
  96. package/dist/web/assets/Data-Crk0ef8O.js +0 -6
  97. package/dist/web/assets/Evidence-EYGofupD.js +0 -1
  98. package/dist/web/assets/Explore-DtqBRQi7.js +0 -2
  99. package/dist/web/assets/Features-B_ZtQEtR.js +0 -1
  100. package/dist/web/assets/Flags-DCLSg8Na.js +0 -2
  101. package/dist/web/assets/Flaky-HpgrkJIF.js +0 -1
  102. package/dist/web/assets/ForceGraph-Dm4VEUjO.js +0 -1
  103. package/dist/web/assets/Impact-CyzbgGih.js +0 -3
  104. package/dist/web/assets/Jobs-CbTd9csb.js +0 -5
  105. package/dist/web/assets/KindPage-cfP76U_9.js +0 -6
  106. package/dist/web/assets/Migration-va16JqtB.js +0 -2
  107. package/dist/web/assets/Product-D0iY6orX.js +0 -7
  108. package/dist/web/assets/Production-CBUb6wZJ.js +0 -1
  109. package/dist/web/assets/Quality-OMhrUKTU.js +0 -1
  110. package/dist/web/assets/Readiness-B64Rxahv.js +0 -1
  111. package/dist/web/assets/Record-B_JXq6Dv.js +0 -2
  112. package/dist/web/assets/Regression-2blJAX7v.js +0 -5
  113. package/dist/web/assets/Reports-DCgjGdw4.js +0 -2
  114. package/dist/web/assets/Response-BtMM8nqx.js +0 -4
  115. package/dist/web/assets/RunDiff-KuUVRuQI.js +0 -1
  116. package/dist/web/assets/Runs-zHDZ-rSo.js +0 -2
  117. package/dist/web/assets/TestCases-B1j2Oelt.js +0 -1
  118. package/dist/web/assets/TestData-CZSynoi-.js +0 -2
  119. package/dist/web/assets/TestDebt-DEdIBwdb.js +0 -1
  120. package/dist/web/assets/Tosca-BcuaHsQC.js +0 -2
  121. package/dist/web/assets/WhatsNew-CjvX6DNo.js +0 -1
  122. package/dist/web/assets/dataParts-BImZKYEu.js +0 -3
  123. package/dist/web/assets/frame-eAHxqKfn.js +0 -4
  124. package/dist/web/assets/index-COTk3Bz-.js +0 -45
  125. package/dist/web/assets/index-DvuGI8X3.css +0 -2
  126. package/dist/web/assets/logos-DEPdha9g.js +0 -1
  127. package/dist/web/assets/parts-CVdJRIxI.js +0 -1
  128. package/dist/web/assets/productParts-CqY4Zs7J.js +0 -1
  129. package/dist/web/assets/qualityParts-BcrXEQ9B.js +0 -1
  130. package/dist/web/assets/thread-Cuvu0HhP.js +0 -5
  131. package/dist/web/assets/usePageChat-Bz7fuynu.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{sn as e,tn as t}from"./frame-D3IhgCFt.js";var n=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},r=e=>typeof e==`string`?e:e==null?``:String(e),i=(e,t=400)=>e.length>t?`${e.slice(0,t-1)}…`:e,a=e=>typeof e==`number`?` in ${Math.round(e/1e3)}s`:``;function o(e,t=400){return i(e.replace(/\s+/g,` `).trim(),t).replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}function s(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${n==="``"?` `:``}${t}${n==="``"?` `:``}${n}`}function c(e,t){return/^https?:\/\/[^\s)]+$/i.test(t)?`[${o(e||t,120)}](${t})`:o(e)}var l=e=>[s(r(n(e).id)),o(r(n(e).title),200)].filter(Boolean).join(` `);function u(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).trim()}function d(e){return e.replace(/\[((?:\\.|[^\]\\])*)\]\(https?:\/\/[^\s)]+\)/g,`$1`).replace(/\\(.)/g,`$1`).replace(/[*`]/g,``)}var f=(e,t)=>({tone:e,kind:`item`,md:t}),p=(e,t)=>({tone:e,kind:`sub`,md:t});function m(e,t=``){let i=t||(e.agent&&e.agent!==`forgeqe`?`**${o(r(e.agent))}:** `:``);switch(e.kind){case`info`:return f(`info`,`${i}${o(r(e.text))}`);case`start`:return f(`dim`,`${i}→ ${s(r(e.tool))}${e.text&&e.text!==e.tool?` ${o(r(e.text),200)}`:``}`);case`tool`:{let t=n(e.file);return f(e.ok===!1?`warn`:`dim`,`${i}${e.ok===!1?`⚠`:`✓`} ${o(r(e.text)||r(e.tool),240)}${t.path?` (${o(r(t.action))} ${s(r(t.path))})`:``}`)}case`say`:{let t=u(r(e.text));return t?f(`say`,`${i}*${o(t)}*`):null}case`test`:return Number(e.attempt)>0?f(e.ok?`ok`:`fail`,`${i}${e.ok?`✓`:`✗`} **Test, attempt ${o(r(e.attempt))}:** ${o(r(e.text),240)}`):f(e.ok?`ok`:`fail`,`${i}${e.ok?`✓`:`✗`} ${o(r(e.text),240)}`);case`plan`:{let t=Array.isArray(e.items)?e.items.map(n):[],a=t.find(e=>e.status===`in_progress`);return f(`info`,`${i}**Plan:** ${t.filter(e=>e.status===`completed`).length} of ${t.length} done${a?`; now: ${o(r(a.text))}`:``}`)}case`review`:return f(e.approved?`ok`:`warn`,`${i}**Review, attempt ${o(r(e.attempt))}:** ${e.approved?`approved`:`changes asked`}. ${o(r(e.summary),240)}`);case`attempt`:return f(`warn`,`${i}**Attempt ${o(r(e.attempt))} of ${o(r(e.max))}:** ${o(r(e.why),240)}`);case`answer`:return f(`dim`,`${i}Attempt ${o(r(e.attempt))}: ${o(r(e.notes)||`changed ${(Array.isArray(e.changed)?e.changed:[]).map(r).join(`, `)}`,240)}`);case`context`:return e.compacted?f(`info`,`${i}Context compacted: the conversation was summarised to make room.`):null;default:return null}}function h(e,t=``){switch(e.type){case`log`:return f(e.level===`error`?`fail`:e.level===`warn`?`warn`:`dim`,`${t}${e.level===`warn`||e.level===`error`?`⚠ `:``}${o(r(e.text))}`);case`step`:return f(`dim`,`${t}**Step ${o(r(e.step))}** · ${e.source===`memory`?`from memory`:o(r(e.category))} · ${c(r(e.title)||`untitled`,r(e.url))}`);case`memory`:return f(`info`,`${t}↻ ${o(r(e.text))}`);case`thought`:return p(`think`,`*${o(r(e.text))}*`);case`outcome`:return p(e.ok?`ok`:`fail`,`${e.ok?`✓`:`✗`} ${o(r(e.text),300)}`);case`done`:{let i=n(e.result);return f(i.status===`complete`?`ok`:`fail`,`${t}**${o(r(i.status))}:** ${o(r(i.summary))}`)}case`code`:return m(e,t);default:return null}}function g(e){switch(e.type){case`run-start`:return{tone:`info`,kind:`head`,md:`Browser run: ${o(r(e.goal),200)}${e.url?` · ${c(r(e.url).replace(/^https?:\/\//,``),r(e.url))}`:``}`};case`run-event`:return h(n(e.event));case`run-done`:{let t=n(e.result),i=!e.error&&(t.outcome===`passed`||!t.outcome&&t.status===`complete`);return f(i?`ok`:`fail`,`${i?`✓`:`✗`} **Run ${i?`passed`:`failed`}**${a(e.ms)}: ${o(r(e.error)||r(t.summary))}${e.runDir?` · ${s(r(e.runDir))}`:``}`)}case`suite-start`:return{tone:`info`,kind:`head`,md:`Suite: ${(Array.isArray(e.cases)?e.cases:[]).length} cases, ${o(r(e.parallel))} at once`};case`suite-event`:{let t=n(e.event);if(t.type===`case-start`)return f(`info`,`**Case ${Number(t.index)+1} of ${o(r(t.total))}:** ${l(t.case)}`);if(t.type===`case-event`)return h(n(t.event),`${s(r(n(t.case).id))} `);if(t.type===`case-done`){let e=n(t.result);return f(e.status===`passed`?`ok`:`fail`,`${e.status===`passed`?`✓`:`✗`} ${l(e.case)}: **${o(r(e.status))}**${a(e.ms)}${e.summary?`. ${o(r(e.summary),240)}`:``}`)}return t.type===`code-start`?f(`info`,`${s(r(n(t.case).id))} writing its test`):t.type===`writeback`?f(`dim`,`Posted the result back: ${o(JSON.stringify(t.item),240)}`):null}case`suite-done`:{let t=(Array.isArray(n(e.suite).results)?n(e.suite).results:[]).map(n),r=t.filter(e=>e.status===`passed`).length;return f(r===t.length?`ok`:`fail`,`**Suite: ${r} of ${t.length} passed**${a(n(e.suite).ms)}`)}case`info`:return f(e.ok===!1?`fail`:e.ok===!0?`ok`:`info`,o(r(e.text)));case`agent`:return m(n(n(e.event)),`**Coding agent:** `);case`code-start`:return{tone:`info`,kind:`head`,md:`Writing a test: ${o(r(e.goal),200)}`};case`code-done`:return f(e.error?`fail`:`ok`,`${e.error?`✗`:`✓`} **Test ${e.error?`not written`:`written`}**${a(e.ms)}${e.error?`: ${o(r(e.error),240)}`:``}`);case`card`:{let t=n(e.card),i=(Array.isArray(t.body)?t.body:[]).map(r).filter(Boolean);return f(t.status===`ok`?`ok`:t.status===`fail`?`fail`:`info`,`**${o(r(t.title))}**${t.stats?` · ${o(r(t.stats))}`:``}${i.length?`: ${o(i.join(`; `),300)}`:``}`)}case`report`:return f(`ok`,`✓ Report saved: ${o(r(e.title))}`);case`call-start`:return f(`dim`,`→ ${o(r(e.text),240)}`);case`call`:return f(e.ok===!1?`warn`:`dim`,`${e.ok===!1?`⚠`:`✓`} ${o(r(e.text),240)}`);default:return null}}function _(e){let t=r(e.at)||r(e.t),i=null;switch(e.type){case`user`:i=f(`you`,`**You:** ${o(r(e.text),240)}`);break;case`agent`:i=m(n(e.event));break;case`tool`:i=g(n(e.event));break;case`ask`:i=f(`you`,`**Asked:** ${o(r(n(e.question).title))}`);break;case`wait`:i=f(`you`,`**Waiting for you:** ${o(r(e.prompt))}`);break;case`answered`:i=f(`you`,`**You:** ${e.label===void 0?e.ok?`done, continue`:`cancel`:o(r(e.label))}`);break;case`turn_done`:i=f(e.outcome===`done`?`ok`:e.outcome===`stopped`?`warn`:`fail`,`**${e.outcome===`done`?`Done`:e.outcome===`stopped`?`Stopped`:e.outcome===`needs_input`?`Needs your input`:`Failed`}**${e.error?`: ${o(r(e.error),300)}`:``}`);break;case`settings`:i=f(`you`,`**Settings:** browser ${e.headed?`shown`:`headless`}, ${e.writeTests?`passed runs become tests`:`no tests written`}`);break;case`model`:i=f(`you`,`**Model:** ${o(r(n(e.profile).name),80)}`);break;case`settings_applied`:i=f(`you`,`**Settings:** carried on with the settings as they are on disk now`);break;case`stderr`:i={tone:`dim`,kind:`out`,md:r(e.text)};break;case`error`:i=f(`warn`,`⚠ ${o(r(e.message))}`);break;case`fatal`:i=f(`fail`,`✗ **ForgeQE cannot go on:** ${o(r(e.message))}`);break;case`exit`:i=f(e.code===0?`dim`:`fail`,`ForgeQE stopped${e.code!==null&&e.code!==void 0?` (exit ${o(r(e.code))})`:``}${e.message?`: ${o(r(e.message))}`:``}`)}return i?{at:t,...i,plain:i.kind===`out`?i.md:d(i.md)}:null}function v(e,t){if(!e||!t)return``;let n=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));return Number.isFinite(n)?`+${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`:``}function y(e,t,n){let r=n?[`## ${o(n,200)}`,``]:[],i=[],a=()=>{if(!i.length)return;let e=Math.max(2,...i.map(e=>Math.max(0,...(e.match(/`+/g)||[]).map(e=>e.length)))),t="`".repeat(e+1);r.push(``,`${t}text`,...i,t,``),i=[]};for(let n of e){let e=v(t,n.at),o=e?`\`${e}\``:``;n.kind===`out`?i.push(e?`${e} ${n.md}`:n.md):(a(),n.kind===`head`?r.push(``,`#### ${n.md}${o?` ${o}`:``}`,``):n.kind===`sub`?r.push(` - ${n.md}`):r.push(`- ${o?`${o} `:``}${n.md}`))}return a(),r.join(`
2
+ `).replace(/\n{3,}/g,`
3
+
4
+ `).trim()+`
5
+ `}var b=e=>{let t=S(e);return typeof t.input==`number`&&typeof t.output==`number`?{input:t.input,output:t.output,cached:typeof t.cached==`number`?t.cached:void 0}:void 0};function x(e,t){let n=(e?.cached||0)+(t?.cached||0);return{input:(e?.input||0)+(t?.input||0),output:(e?.output||0)+(t?.output||0),...n?{cached:n}:{}}}var S=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},C=e=>typeof e==`string`?e:e==null?``:String(e),w=[[/^(product_(knowledge|docs|code|runs?)|services|database_schema)$/,`Product knowledge`],[/^page_memory$/,`Memory`],[/^playbook$/,`Playbook`],[/^(requirements_file|trace_criteria)$/,`Requirements`],[/^read_confluence$/,`Confluence pages`],[/^read_mapping_file$/,`Mapping file`]],T={github:`GitHub`,gitlab:`GitLab`,azure_devops:`Azure DevOps`,atlassian:`Jira`,confluence:`Confluence`,notify:`Notifications`,sentry:`Sentry`,browserstack:`BrowserStack`,testmu:`TestMu`,dataverse:`Dataverse`,aws:`AWS`,azure:`Azure`,gcp:`Google Cloud`,postman:`Postman`},E=20;function D(e,t,n){let r=(e,t)=>{t&&e.length<E&&!e.includes(t)&&e.push(t)},i=t.toLowerCase();if(i===`skill`){let t=(n||``).trim();/^[\w.:-]{1,64}$/.test(t)&&r(e.skills,t);return}let a=i.replace(/^forgeqe_/,``),o=w.find(([e])=>e.test(a));if(o)return r(e.knowledge,o[1]);if(Object.hasOwn(T,a))return r(e.systems,T[a]);let s=I.find(([e])=>e.test(a))?.[1];s&&r(e.systems,s)}var O=[[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`Finding test cases`,`searching`],[/environment|logins/,`Preparing the environment`,`handing`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`Running in the browser`,`browsing`],[/comment_on_pr/,`Commenting on the pull request`,`working`],[/write_back|post_result|post_results|file_bugs|create_bugs/,`Posting the result`,`working`],[/write_test|heal/,`Writing the test`,`writing`],[/run_tests|bash|shell/,`Running the tests`,`working`],[/read_confluence|read|grep|glob|list|webfetch/,`Reading`,`reading`],[/edit|write|patch/,`Changing the code`,`writing`],[/task/,`Handing work to another agent`,`handing`]],k=/^(test|attempt|info|review)$/,A=/run_test_cases|browser_run|run_suite|write_test/,j=[[/(^|_)skill/,`skill`],[/code_element/,`element`],[/code_outline/,`outline`],[/code_references/,`references`],[/code_impact|(^|_)impact/,`impact`],[/code_find|find_tests/,`find`],[/code_test_file/,`testfile`],[/code_command|code_status|run_tests|bash|shell/,`run`],[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`cases`],[/environment|logins/,`environment`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`browser`],[/comment_on_pr|write_back|post_result|post_results|file_bugs|create_bugs/,`post`],[/grep|glob|search/,`search`],[/webfetch|websearch|fetch/,`web`],[/(^|_)list/,`list`],[/read/,`read`],[/edit|write|patch/,`edit`],[/task/,`task`]];function M(e){let t=e.toLowerCase();return j.find(([e])=>e.test(t))?.[1]??`work`}function N(e){let t=/^(.*?\(attempt \d+\/\d+\))\s*:\s*([\s\S]+)$/.exec(e)??/^([^:\n]{1,160}?):\s+([\s\S]{40,})$/.exec(e),n=(t?t[1]:e).replace(/\s*\(attempt \d+\/\d+\)$/,``).replace(/(^|\s)(?:[\w.-]+[\\/])+([\w.-]+)/g,`$1$2`);return{summary:n.length>140?`${n.slice(0,139)}…`:n,detail:t?t[2].trim():``}}var P=[[/find_test_cases|story_test_cases|check_test_cases/,`forgeqe-find`],[/run_test_cases|browser_run|run_goal|run_direct|suite|explore_run/,`engine`],[/write_test/,`forgeqe-test`],[/heal/,`forgeqe-heal`],[/review_pr|pr_review/,`forgeqe-pr-review`],[/api_plan/,`forgeqe-api-plan`],[/write_api|api_test/,`forgeqe-api`],[/explore_plan|plan_charters/,`forgeqe-explore-plan`],[/defect_rca|root_cause/,`forgeqe-defect-rca`],[/insights|forgeqe_bi|defect_intelligence/,`forgeqe-bi`],[/refine/,`forgeqe-refine`]];function F(e){let t=e.toLowerCase();if(!R(t))return P.find(([e])=>e.test(t))?.[1]}var I=[[/^(azure_devops|ado|azuredevops)_/,`Azure DevOps`],[/^(jira|atlassian)_/,`Jira`],[/^confluence_/,`Confluence`],[/^github_/,`GitHub`],[/^xray_/,`Xray`],[/^testrail_/,`TestRail`],[/^zephyr_/,`Zephyr Scale`],[/^qtest_/,`qTest`]],L=/(^|_)(create|update|add|delete|remove|post|comment|link|unlink|upload|set|assign|transition|edit|merge|close|reopen|queue|trigger|run|push|move|copy|import|write|publish|approve|vote|lock|unlock)(_|$)/;function R(e){let t=e.toLowerCase();if(!t.startsWith(`forgeqe_`))return I.find(([e])=>e.test(t))?.[1]}var z=e=>{let t=S(e);return typeof t.diff==`string`&&t.diff?{diff:t.diff,added:Number(t.added)||0,removed:Number(t.removed)||0}:void 0},B=e=>Array.isArray(e)?e.map(C).filter(Boolean):[];function V(e,t,n){let r=C(e.status)||(t?`failed`:``);return{status:r,ok:!t&&/^(passed|pass|written|ok|known_defect)$/i.test(r),...C(e.testFile)?{testFile:C(e.testFile)}:{},...C(e.testName)?{testName:C(e.testName)}:{},...C(e.command)?{command:C(e.command)}:{},...typeof e.attempts==`number`?{attempts:e.attempts}:{},...typeof e.maxAttempts==`number`?{maxAttempts:e.maxAttempts}:{},changed:B(e.changed),reused:B(e.reused),...n?{runDir:n}:{},...t?{error:t}:{},...C(e.notes)?{notes:C(e.notes)}:{}}}function H(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=S(n),r=(typeof n==`string`?n:C(e.label)||C(e.request)).replace(/\s+/g,` `).trim(),i=(typeof n==`string`?n:C(e.request)||C(e.label)).trim();r&&i&&!t.some(e=>e.label.toLowerCase()===r.toLowerCase())&&t.push({label:r.length>60?`${r.slice(0,59)}…`:r,request:i})}return t.slice(0,4)}function U(e){let t=e.toLowerCase(),n=R(t);if(n)return L.test(t.replace(/^[a-z]+_/,``))?{label:`Updating ${n}`,orb:`working`}:{label:`Reading ${n}`,orb:`reading`};for(let[e,n,r]of O)if(e.test(t))return{label:n,orb:r};let r=t.replace(/^forgeqe_/,``).replace(/[_-]+/g,` `).trim();return{label:r?r[0].toUpperCase()+r.slice(1):`Working`,orb:`working`}}function W(e,t){return{id:e,user:t,steps:[],parts:[],next:[],asks:[],waits:[],log:[],plan:[],changes:[],tests:[],reports:[]}}function G(e){let t=S(e);return[C(t.id),C(t.title)].filter(Boolean).join(`: `)}function K(n){let r={turns:[],notes:[]},i=new Map,a=e=>(typeof e==`string`?i.get(e):void 0)??r.turns.at(-1),o=(e,t)=>{let n=e=>{for(let r of e){if(r.key===t)return r;let e=r.children&&n(r.children);if(e)return e}};return n(e.steps)},s=(e,t,n)=>{let r={lines:[],...t};if(n)n.push(r);else{let t=e.plan.find(e=>e.status===`active`)??e.plan.find(e=>e.status===`pending`)??e.plan.at(-1);t&&(r.phase=t.text),e.steps.push(r)}return r},c=(e,n,r)=>{let i=n.parent?o(e,`c:${C(n.parent)}`):void 0;if(i)return i.children??=[];let a=C(n.agent);if(!a&&k.test(C(n.kind))){let t=[...e.steps].reverse().find(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);return t?l(t):void 0}if(!r||!a||a===`forgeqe`)return;let c=[...e.steps].reverse().find(e=>e.status===`running`);return c||=s(e,{key:`ag:${a}:${e.steps.length}`,label:t(a).name,status:`running`,orb:`handing`,agent:a}),c.agent??=a,l(c)},l=e=>{let t=e.children??=[],n=t.at(-1);return n&&n.key.startsWith(`try:`)&&n.status===`running`?n.children??=[]:t},u=(e,t)=>{let n=e?.children?.at(-1);if(!n||!n.key.startsWith(`try:`)||n.status!==`running`)return;let r=[...n.children||[]].reverse().find(e=>e.key.startsWith(`t:`)||!!e.review),i=t??(r?r.review?r.review.approved:r.status===`ok`:void 0);n.status=i===void 0?`info`:i?`ok`:`fail`},d,f=new Map,p=new Map,m=0,h=e=>{let t=r.agents??=[],n=t.find(t=>t.agent===e);return n||t.push(n={agent:e,usage:{input:0,output:0},at:0}),n.at=++m,n},g=(n,i,a)=>{let l=C(i.kind),m=C(i.id);if((l===`start`||l===`tool`)&&A.test(C(i.tool))&&!R(C(i.tool)))return;let g=c(n,i,a),_=S(i.delegate),v=C(i.tool)||C(i.text),y=C(_.agent)?{agent:C(_.agent),task:C(_.task)}:void 0;if(l===`start`){if(y)s(n,{key:`c:${m}`,label:`Hands off to ${e(t(y.agent).name)}`,arg:y.task||void 0,status:`running`,orb:`handing`,agent:y.agent,handoff:y,children:[]},g);else{let{label:e,orb:t}=U(v),r=g?void 0:F(C(i.tool));s(n,{key:`c:${m}`,label:e,arg:C(i.text)&&C(i.text)!==C(i.tool)?C(i.text):void 0,status:`running`,orb:t,icon:M(v),...r?{agent:r}:{}},g)}}else if(l===`tool`){i.ok!==!1&&C(i.tool)&&D(r.uses??={skills:[],knowledge:[],systems:[]},C(i.tool),C(i.skill));let a=m?o(n,`c:${m}`):void 0,c=S(i.file),l=z(i.change);if(l&&C(c.path)){let e=n.changes.find(e=>e.path===C(c.path));e?Object.assign(e,{diff:`${e.diff}\n${l.diff}`,added:e.added+l.added,removed:e.removed+l.removed}):n.changes.push({path:C(c.path),...l,...C(i.agent)?{agent:C(i.agent)}:{}})}if(a)a.status=i.ok===!1?`fail`:`ok`,a.handoff&&C(_.result)&&(a.handoff.result=C(_.result));else if(y)s(n,{key:`c:${m||n.steps.length}`,label:`Hands off to ${e(t(y.agent).name)}`,arg:y.task||void 0,status:i.ok===!1?`fail`:`ok`,orb:`handing`,agent:y.agent,handoff:{...y,...C(_.result)?{result:C(_.result)}:{}},children:[]},g);else{let{label:e,orb:t}=U(v),r=g?void 0:F(C(i.tool));s(n,{key:`c:${m||n.steps.length}`,label:e,arg:C(c.path)||C(i.text)||void 0,status:i.ok===!1?`fail`:`ok`,orb:t,icon:M(v),...r?{agent:r}:{},...l?{change:l}:{}},g)}a&&l&&(a.change=l)}else if(l===`stream`||l===`say`){if(a)return;let e=n.parts.find(e=>e.id===m);e?e.text=l===`say`?C(i.text):e.text+C(i.text):n.parts.push({id:m||`p${n.parts.length}`,text:C(i.text)})}else if(l===`plan`){if(g||i.agent&&i.agent!==`forgeqe`)return;let e=Array.isArray(i.items)?i.items.map(S):[],t=e=>e===`completed`?`done`:e===`in_progress`?`active`:e===`cancelled`?`skipped`:`pending`;n.plan=e.map(e=>({text:C(e.text),status:t(e.status)})).filter(e=>e.text)}else if(l===`test`){let e=Number(i.attempt)||0;if(e>0){let{summary:t,detail:r}=N(C(i.text));s(n,{key:`t:${e}:${n.steps.length}`,label:`Test, attempt ${e}`,arg:t||void 0,status:i.ok?`ok`:`fail`,orb:`retrying`,icon:`test`,...r?{output:r}:{},...d?{command:d}:{}},g),d=void 0}else if(i.ok&&/\bconnected$/i.test(C(i.text)))return;else s(n,{key:`t:${n.steps.length}`,label:C(i.text)||(i.ok?`Checked`:`Check failed`),status:i.ok?`ok`:`fail`,orb:/connect|mcp/i.test(C(i.text))?`waiting`:`working`},g)}else if(l===`attempt`){let e=[...n.steps].reverse().find(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);if(!e)return;u(e);let t=C(i.fixing)||C(i.why);(e.children??=[]).push({key:`try:${C(i.attempt)}:${e.children.length}`,label:`Attempt ${C(i.attempt)} of ${C(i.max)}`,arg:t?t.length>120?`${t.slice(0,119)}…`:t:void 0,status:`running`,orb:`retrying`,icon:`retry`,lines:t.length>120?[{text:t}]:[],children:[]})}else if(l===`review`){let e=(Array.isArray(i.issues)?i.issues:[]).map(S).map(e=>({kind:C(e.kind)===`standards`?`standards`:`correctness`,...C(e.file)?{file:C(e.file)}:{},problem:C(e.problem),...C(e.fix)?{fix:C(e.fix)}:{}})).filter(e=>e.problem).slice(0,20),t=i.approved===!0,r=(g??n.steps).length;s(n,{key:`r:${C(i.attempt)}:${r}`,label:t?`Review approved`:`Review asked for changes`,arg:e.length?`${e.length} ${e.length===1?`issue`:`issues`}`:void 0,status:t?`ok`:`fail`,orb:`thinking`,agent:`forgeqe-review`,icon:`review`,review:{approved:t,summary:C(i.summary),issues:e}},g)}else if(l===`context`||l===`usage`){let e=C(i.agent)||`forgeqe`,t=h(e);l===`context`&&typeof i.tokens==`number`&&typeof i.limit==`number`&&(t.context={tokens:i.tokens,limit:i.limit,compactsAt:typeof i.compactsAt==`number`?i.compactsAt:void 0},e===`forgeqe`&&(r.context=t.context));let n=l===`usage`?b(i.usage):void 0;if(n){let i=f.get(e);i&&(n.input<i.input||n.output<i.output)&&p.set(e,x(p.get(e),i)),f.set(e,n),t.usage=x(p.get(e),n),r.usage=(r.agents||[]).reduce((e,t)=>x(e,t.usage),void 0)}}else if(l===`info`){let e=(g??n.steps).at(-1),t=/^ForgeQE runs the test:\s*([\s\S]+)$/.exec(C(i.text));t?d=t[1].trim():e&&e.lines.push({text:C(i.text)})}},v,y=(e,t)=>{let n=C(t.type);if(n===`run-start`)s(e,{key:`run:${e.steps.length}`,label:`Running in the browser`,arg:C(t.goal),status:`running`,orb:`browsing`,agent:`engine`});else if(n===`run-event`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`run:`)),r=S(t.event);if(!n)return;r.type===`outcome`?n.lines.push({text:`Step ${C(r.step)}: ${C(r.action)||C(r.text)}`,ok:r.ok===!0||r.ok!==!1&&void 0}):r.type===`log`&&(r.level!==`info`||r.progress)&&n.lines.push({text:C(r.text),ok:r.level!==`error`&&void 0})}else if(n===`run-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`run:`)&&e.status===`running`),r=S(t.result),i=!t.error&&(r.outcome===`passed`||!r.outcome&&r.status===`complete`);if(n){n.status=i?`ok`:`fail`;let e=C(t.error)||C(r.summary);e&&n.lines.push({text:e,ok:!!i})}C(t.runDir)&&e.reports.push({label:i?`Browser run report`:`Browser run report (failed)`,path:C(t.runDir)})}else if(n===`suite-start`){let n=Array.isArray(t.cases)?t.cases:[];s(e,{key:`suite:${e.steps.length}`,label:`Running ${n.length} test case${n.length===1?``:`s`}`,status:`running`,orb:`working`,agent:`engine`})}else if(n===`suite-event`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`suite:`)),r=S(t.event);if(n&&r.type===`case-done`){let e=S(r.result);n.lines.push({text:`${G(e.case)}: ${C(e.status)}`,ok:e.status===`passed`})}}else if(n===`suite-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`suite:`)),r=Array.isArray(S(t.suite).results)?S(t.suite).results.map(S):[];if(n){let e=r.filter(e=>e.status!==`passed`).length;n.status=e?`fail`:`ok`,n.arg=`${r.length-e} of ${r.length} passed`}}else if(n===`card`){let n=S(t.card);s(e,{key:`card:${e.steps.length}`,label:C(n.title),arg:C(n.stats)||void 0,status:n.status===`ok`?`ok`:n.status===`fail`?`fail`:`info`,orb:`working`,lines:(Array.isArray(n.body)?n.body:[]).map(e=>({text:C(e)}))})}else if(n===`call-start`&&!t.quiet)s(e,{key:`call:${C(t.id)}`,label:C(t.text),status:`running`,orb:`working`});else if(n===`call`&&!t.quiet){let n=t.id?o(e,`call:${C(t.id)}`):void 0;n?n.status=t.ok===!1?`fail`:`ok`:s(e,{key:`call:${e.steps.length}`,label:C(t.text),status:t.ok===!1?`fail`:`ok`,orb:`working`})}else if(n===`code-start`)v=C(t.runDir)||void 0,s(e,{key:`code:${e.steps.length}`,label:`Hands off to the Coding agent`,arg:C(t.goal),status:`running`,orb:`writing`,agent:`forgeqe-test`,handoff:{agent:`forgeqe-test`,task:C(t.goal)},children:[]});else if(n===`code-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`code:`)&&e.status===`running`);u(n),n&&(n.status=t.error?`fail`:`ok`,t.error&&n.lines.push({text:C(t.error),ok:!1}));let r=[],i=(e=[])=>e.forEach(e=>(r.push(e),i(e.children)));i(n?.children);let a=r.filter(e=>e.key.startsWith(`t:`)),o=r.filter(e=>e.review);e.tests.push({...V(S(t.result),C(t.error),v),...n?{runs:a.length,failedRuns:a.filter(e=>e.status===`fail`).length,reviews:o.length}:{},...o.length?{review:o.at(-1).review}:{}}),v=void 0}else if(n===`agent`)g(e,S(t.event),!0);else if(n===`info`){let n=e.steps.at(-1);n?n.lines.push({text:C(t.text),ok:t.ok===!0||t.ok!==!1&&void 0}):s(e,{key:`info:${e.steps.length}`,label:C(t.text),status:t.ok===!1?`fail`:`info`,orb:`working`})}else n===`report`&&(s(e,{key:`report:${e.steps.length}`,label:`Report saved`,arg:C(t.title),status:`ok`,orb:`working`}),C(t.html)&&e.reports.push({label:C(t.title)||`Report`,path:C(t.html)}))};for(let e of n){w(e);let t=_(e);t&&(typeof e.id==`string`&&i.get(e.id)||typeof e.turn==`string`&&i.get(e.turn)||r.turns.at(-1))?.log.push(t)}return r;function w(e){switch(e.type){case`user`:{let t=W(C(e.id),C(e.text));r.turns.push(t),i.set(t.id,t);break}case`ready`:{r.ended=void 0,r.fatal=void 0;let t=S(e.profile);t.name&&(r.model={name:C(t.name),provider:C(t.provider)}),r.writeTests=e.writeTests!==!1,r.headed=e.headed===!0;break}case`models`:case`model`:{let t=S(e.profile);t.name&&(r.model={name:C(t.name),provider:C(t.provider)}),e.type===`models`&&Array.isArray(e.models)&&(r.models=e.models.map(e=>({name:C(S(e).name),provider:C(S(e).provider)})).filter(e=>e.name));break}case`settings`:typeof e.writeTests==`boolean`&&(r.writeTests=e.writeTests),typeof e.headed==`boolean`&&(r.headed=e.headed);break;case`turn_start`:{let t=a(e.id);t&&(t.started=C(e.t)||C(e.at));break}case`agent`:{let t=a(e.id);t&&g(t,S(e.event),!1);break}case`tool`:{let t=a(e.id);t&&y(t,S(e.event));break}case`ask`:{let t=a(e.turn),n=S(e.question);t?.asks.push({id:C(e.id),title:C(n.title),detail:C(n.detail)||void 0,lines:Array.isArray(n.lines)?n.lines.map(C):[],options:(Array.isArray(n.options)?n.options:[]).map(e=>({id:C(S(e).id),label:C(S(e).label)}))});break}case`wait`:a(e.turn)?.waits.push({id:C(e.id),prompt:C(e.prompt)});break;case`answered`:for(let t of r.turns){let n=t.asks.find(t=>t.id===e.ask);n&&(n.answer=C(e.label));let r=t.waits.find(t=>t.id===e.ask);r&&(r.answer=e.ok===!0)}break;case`turn_done`:{let t=a(e.id);if(!t)break;t.outcome=e.outcome,t.reply=C(e.reply),t.next=H(e.next),t.error=C(e.error)||void 0,t.ended=C(e.t)||C(e.at),r.usage=b(e.usage)??r.usage;let n=e=>{for(let r of e)r.status===`running`&&(r.status=t.outcome===`done`?`ok`:`info`),r.children&&n(r.children)};if(n(t.steps),t.outcome===`done`)for(let e of t.plan)e.status===`active`&&(e.status=`done`);break}case`error`:e.code!==`busy`&&r.notes.push(C(e.message));break;case`fatal`:r.fatal=C(e.message);break;case`exit`:r.ended={code:typeof e.code==`number`?e.code:null,stderr:Array.isArray(e.stderr)?e.stderr.map(C):void 0,message:C(e.message)||void 0}}}}function q(e){let t=e.asks.find(e=>e.answer===void 0),n=e.waits.find(e=>e.answer===void 0);if(t||n)return{text:`Waiting for you…`,orb:`waiting`};let r=[...e.steps].reverse().find(e=>e.status===`running`);return r?{text:`${r.label}…`,orb:r.orb}:e.parts.some(e=>e.text.trim())&&e.steps.length?{text:`Writing a reply…`,orb:`writing`}:{text:`Thinking…`,orb:`thinking`}}function J(e){if(!e.started||!e.ended)return`Done`;let t=Math.max(1,Math.round((Date.parse(e.ended)-Date.parse(e.started))/1e3)),n=e.outcome===`stopped`?`Stopped after`:`Worked for`;return t<60?`${n} ${t} second${t===1?``:`s`}`:`${n} ${Math.floor(t/60)} min ${t%60} s`}var Y={running:`active`,ok:`done`,fail:`failed`,info:`note`};function X(e,t){let n=e=>e===`active`&&!t?`done`:e;if(!e.plan.length)return e.steps.map(e=>({key:e.key,label:e.label,status:n(Y[e.status]),steps:[],step:e}));let r=new Set(e.plan.map(e=>e.text)),i=new Map,a=``;for(let t of e.steps)t.phase&&r.has(t.phase)&&(a=t.phase),i.set(a,[...i.get(a)||[],t]);let o=e=>e.some(e=>e.status===`running`),s=[],c=i.get(``)||[];c.length&&s.push({key:`plan:start`,label:`Getting started`,status:n(o(c)?`active`:`done`),steps:c});let l=e.plan.map((e,n)=>{let r=i.get(e.text)||[],a=e.status===`done`?`done`:e.status===`skipped`?`skipped`:e.status===`active`||o(r)?`active`:`pending`;return{key:`plan:${n}`,label:e.text,status:a===`active`&&!t?`pending`:a,steps:r}});return[...s,...Z(l)]}function Z(e){let t=e.findIndex(e=>e.status===`active`);return t<0?e:e.map((e,n)=>e.status===`skipped`||e.status===`failed`||n===t?e:{...e,status:n<t?`done`:`pending`})}export{_ as a,u as c,J as i,K as n,y as o,X as r,v as s,q as t};
@@ -0,0 +1 @@
1
+ import{Ir as e,Nr as t}from"./line-icons-CQ-3V8ax.js";import{Pn as n}from"./frame-D3IhgCFt.js";import{n as r}from"./thread-BeaLQ_f4.js";var i=e(t(),1),a=e=>e&&/^No model in llms\.json/.test(e)?`No model is set up for the agent yet: add one in Settings, Models (or sign in to GitHub Copilot there), then send this again.`:e;function o(e){let t=()=>{try{return localStorage.getItem(e)}catch{return null}},a=t=>{try{t?localStorage.setItem(e,t):localStorage.removeItem(e)}catch{}},[o,s]=(0,i.useState)(t),[c,l]=(0,i.useState)([]),[u,d]=(0,i.useState)(null);(0,i.useEffect)(()=>{if(!o){l([]),d(null);return}let e=!1,t=0;return l([]),(async()=>{for(;!e;)try{let r=await n.events(o,t,t>0);if(e||(d(r.state),r.events.length&&(t=r.events.at(-1).n,l(e=>[...e,...r.events])),(r.state===`closed`||r.state===`failed`)&&!r.events.length))return}catch(t){if(e)return;if(t.status===404){a(null),s(null);return}await new Promise(e=>setTimeout(e,2e3))}})(),()=>{e=!0}},[o]);let f=(0,i.useMemo)(()=>r(c),[c]),p=f.turns.at(-1),m=u===`closed`||u===`failed`;return{chat:o,thread:f,last:p,busy:u===`busy`||u===`starting`||!!p&&!p.outcome&&!m,ended:m,send:async(e,t,r={})=>{if(o&&!m)await n.send(o,e);else{let{id:i}=await n.start(`${t}\n${e}`,r);a(i),s(i)}},reset:()=>{a(null),s(null)}}}export{o as n,a as t};
@@ -5,9 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="referrer" content="no-referrer" />
7
7
  <title>ForgeQE</title>
8
- <script type="module" crossorigin src="/assets/index-COTk3Bz-.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/frame-eAHxqKfn.js">
10
- <link rel="stylesheet" crossorigin href="/assets/index-DvuGI8X3.css">
8
+ <script type="module" crossorigin src="/assets/index-v-k_CVn7.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/line-icons-CQ-3V8ax.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/frame-D3IhgCFt.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-D5sya6FK.css">
11
12
  </head>
12
13
  <body>
13
14
  <div id="root"></div>
@@ -3310,6 +3310,80 @@ mobile:
3310
3310
  <code>run.json</code>, <code>report.html</code>, step screenshots, and for Maestro runs the flow, <code>maestro.log</code> and Maestro's JUnit report.</p>
3311
3311
  </div>
3312
3312
  </section>
3313
+ <section class="doc" id="doc-docs-mobile-devices">
3314
+ <h4>Devices</h4>
3315
+ <div class="prose"><p>Say what each device is and where it runs; Settings → Mobile edits all of it. ForgeQE builds what Appium, Maestro and
3316
+ the cloud need from that and the app: the W3C capabilities (<code>platformName</code>, <code>appium:udid</code>, <code>bstack:options</code>,
3317
+ <code>LT:Options</code>, …), the cloud's hub address, Maestro's <code>--device</code>, and TestMu's HyperExecute YAML. Nobody types
3318
+ capabilities.</p>
3319
+ <p>Devices on this computer are in forgeqe.yaml:</p>
3320
+ <pre><code class="language-yaml">mobile:
3321
+ parallel: 3 # devices at once, here and on the clouds; default: all of them
3322
+ devices:
3323
+ pixel8: # an emulator
3324
+ type: virtual
3325
+ platform: android
3326
+ udid: emulator-5554
3327
+ iphone-sim: # an iOS simulator (XCUITest boots it)
3328
+ type: virtual
3329
+ platform: ios
3330
+ model: iPhone 15
3331
+ os_version: &quot;17.2&quot;
3332
+ </code></pre>
3333
+ <p>Devices on TestMu AI or BrowserStack are in that cloud's own file, the one <code>browser.providers</code> links
3334
+ (<code>.forgeqe/testmu.yaml</code>, <code>.forgeqe/browserstack.yaml</code>), beside its browsers and with the same sign-in. Settings →
3335
+ Mobile shows each file's devices and edits them; Integrations edits the file's browsers and its browser devices.
3336
+ A file with only mobile devices sets up no browser on that cloud.</p>
3337
+ <pre><code class="language-yaml"># .forgeqe/testmu.yaml
3338
+ provider: testmu
3339
+ remote:
3340
+ username_env: LT_USERNAME # the sign-in, as variable names; values in the credential store
3341
+ access_key_env: LT_ACCESS_KEY
3342
+ mobile:
3343
+ region: us
3344
+ devices:
3345
+ galaxy-s23:
3346
+ type: real # real | virtual (TestMu's emulators and simulators)
3347
+ platform: android
3348
+ model: Galaxy S23
3349
+ os_version: &quot;13&quot;
3350
+ </code></pre>
3351
+ <ul>
3352
+ <li><strong>Which devices run.</strong> Every device with <code>enabled</code> on (the default), of the app's platform: an Android workflow
3353
+ skips the iOS devices. <code>--devices pixel8,galaxy</code> (or the agent's <code>devices</code>) names some for one run.</li>
3354
+ <li><strong>At once.</strong> <code>mobile.parallel</code> of them at a time. Devices on this computer running at once get their own driver
3355
+ ports (<code>appium:systemPort</code> 8200+, <code>appium:wdaLocalPort</code> 8100+, <code>appium:mjpegServerPort</code> 9100+) on the one Appium
3356
+ server. On TestMu, <code>mobile.parallel</code> also caps HyperExecute's concurrency.</li>
3357
+ <li><strong>Maestro</strong> runs on each device on this computer, and as one HyperExecute job for TestMu's real devices (and one
3358
+ for its emulators). It does not run on BrowserStack here: replay those with Appium.</li>
3359
+ <li><strong>Results.</strong> Each device's run is in a folder of its own inside the run's folder, with <code>devices.json</code> listing each
3360
+ one's result and report, and a failed device's first failed step. The run passes only when every device passes;
3361
+ <code>--junit</code> has one case per device. Each step line and log line names its device (<code>[pixel8] ✓ 3 tap Sign in</code>).</li>
3362
+ <li><strong>The cloud check.</strong> Before a run, ForgeQE asks each cloud whether it has the real devices the run goes on (those of
3363
+ the app's platform; for explore, the first); for one it does not, it offers the most similar (in a terminal) and
3364
+ swaps only that device, this run only. TestMu's list changes through the day (a model's OS versions come and go),
3365
+ so a pipeline that must not stop can list a pattern (<code>os_version: &quot;1[345]&quot;</code>) or a second device.</li>
3366
+ <li><code>explore</code> works through a goal once, on the first device in use.</li>
3367
+ <li><strong>TestMu's emulators and simulators</strong> are a list of their own, which no API gives: <code>type: virtual</code> devices are not
3368
+ checked, and one TestMu does not have is refused at once with where to look (its capabilities generator). An iOS
3369
+ simulator's <code>os_version: &quot;17&quot;</code> is sent as <code>17.0</code>, which TestMu needs. Every TestMu session says <code>w3c: true</code>.</li>
3370
+ <li><strong>iOS alerts</strong> stay until a step closes them: TestMu accepts every iOS alert by default, which closes a success or
3371
+ error alert before a check can read it. A config that sets <code>appium:autoAcceptAlerts</code> or <code>autoDismissAlerts</code> keeps it.
3372
+ iOS's own permission prompts (notifications, location, tracking) are saved under <code>dismiss</code>, like Android's system
3373
+ dialogs, and a replay closes a <code>dismiss</code> dialog that shows as the app starts; where it never shows, nothing fails.</li>
3374
+ <li><strong>iOS real devices</strong> need a device build (<code>.ipa</code> built for iphoneos); a simulator build (<code>.app</code> in a <code>.zip</code>) runs
3375
+ on TestMu's simulators only. TestMu signs an uploaded <code>.ipa</code> for its devices. iOS lists only the controls on screen
3376
+ to the model and to steps (XCUITest also lists ones scrolled out of view).</li>
3377
+ <li><strong>Secrets</strong> a workflow types are checked before a device is taken: one that is not set, or not listed, stops the
3378
+ replay at once.</li>
3379
+ <li><strong>A control re-drawn under a step</strong> (an alert animating in: Appium's &quot;stale element reference&quot;) is looked up again,
3380
+ twice at most, besides the step's own <code>retries</code>.</li>
3381
+ <li><code>mobile.appium.capabilities</code> is still added to every session, for the rare setting ForgeQE does not make.</li>
3382
+ </ul>
3383
+ <p>Without <code>mobile.devices</code>, the device is the one <code>mobile.appium</code> (its URL and capabilities) and <code>mobile.maestro</code>
3384
+ (<code>device</code>, <code>testmu</code>) name, as before.</p>
3385
+ </div>
3386
+ </section>
3313
3387
  <section class="doc" id="doc-docs-mobile-workflow-yaml-forgeqe-mobile-v1">
3314
3388
  <h4>Workflow YAML (<code>forgeqe-mobile-v1</code>)</h4>
3315
3389
  <div class="prose"><pre><code class="language-yaml">format: forgeqe-mobile-v1
@@ -0,0 +1,20 @@
1
+ # The build and test check's sample (B2)
2
+
3
+ A small pricing library, built and tested by its own commands (`bun build`, `bun test` with JUnit results), and seven
4
+ changes planted on it. `tests/evidence-buildcheck.test.ts` checks out each change clean beside the base and expects
5
+ exactly the findings its `case.json` names; `forgeqe evidence demo` uses `regression` as code-agent's change.
6
+
7
+ - `base/`: the repository as released. Three tests pass; one (legacy rounding) fails already, and is never held
8
+ against a change.
9
+ - `cases/<name>/case.json`: why the change is planted, the files it changes (`after/<path>`) or deletes, and the
10
+ findings expected.
11
+
12
+ | Case | Change | Findings |
13
+ | --- | --- | --- |
14
+ | good-feature | adds bulk pricing and its test, which passes | none |
15
+ | regression | totals a line without its quantity | regression |
16
+ | new-test-fails | adds a coupon and a test it does not pass | new-test-failed |
17
+ | build-broken | leaves a syntax error | build-failed |
18
+ | test-removed | deletes the discount test | test-removed |
19
+ | flaky-test | adds a test that fails once, then passes | none (flaky, not counted) |
20
+ | fixes-legacy | fixes legacy rounding | none |
@@ -0,0 +1 @@
1
+ { "name": "shop-pricing", "private": true, "type": "module", "description": "Prices an order's lines (the build and test check's sample)" }
@@ -0,0 +1 @@
1
+ export { applyDiscount, legacyRound, lineTotal, orderTotal } from "./pricing.ts"
@@ -0,0 +1,22 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ return line.price * line.quantity
7
+ }
8
+
9
+ /** An order's total in pence: every line's total. */
10
+ export function orderTotal(lines: Line[]): number {
11
+ return lines.reduce((sum, line) => sum + lineTotal(line), 0)
12
+ }
13
+
14
+ /** A total with a percentage off, to the nearest penny. */
15
+ export function applyDiscount(total: number, percent: number): number {
16
+ return Math.round(total * (1 - percent / 100))
17
+ }
18
+
19
+ /** Pounds to whole pence as the old till did it. Known wrong: it cuts off instead of rounding (see legacy.test.ts). */
20
+ export function legacyRound(pounds: number): number {
21
+ return Math.floor(pounds * 100)
22
+ }
@@ -0,0 +1,6 @@
1
+ import { expect, test } from "bun:test"
2
+ import { applyDiscount } from "../src/index.ts"
3
+
4
+ test("a discount takes its percentage off, to the nearest penny", () => {
5
+ expect(applyDiscount(999, 10)).toBe(899)
6
+ })
@@ -0,0 +1,7 @@
1
+ import { expect, test } from "bun:test"
2
+ import { legacyRound } from "../src/index.ts"
3
+
4
+ // Fails at the base on purpose: a known bug the check must never hold against a change.
5
+ test("legacy rounding rounds half a penny up", () => {
6
+ expect(legacyRound(0.125)).toBe(13)
7
+ })
@@ -0,0 +1,10 @@
1
+ import { expect, test } from "bun:test"
2
+ import { lineTotal, orderTotal } from "../src/index.ts"
3
+
4
+ test("a line's total multiplies its price by its quantity", () => {
5
+ expect(lineTotal({ price: 250, quantity: 3 })).toBe(750)
6
+ })
7
+
8
+ test("an order's total adds its lines", () => {
9
+ expect(orderTotal([{ price: 250, quantity: 2 }, { price: 99, quantity: 1 }])).toBe(599)
10
+ })
@@ -0,0 +1,22 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ return line.price * line.quantity +
7
+ }
8
+
9
+ /** An order's total in pence: every line's total. */
10
+ export function orderTotal(lines: Line[]): number {
11
+ return lines.reduce((sum, line) => sum + lineTotal(line), 0)
12
+ }
13
+
14
+ /** A total with a percentage off, to the nearest penny. */
15
+ export function applyDiscount(total: number, percent: number): number {
16
+ return Math.round(total * (1 - percent / 100))
17
+ }
18
+
19
+ /** Pounds to whole pence as the old till did it. Known wrong: it cuts off instead of rounding (see legacy.test.ts). */
20
+ export function legacyRound(pounds: number): number {
21
+ return Math.floor(pounds * 100)
22
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "why": "Planted: leaves a syntax error, so the change does not build.",
3
+ "changes": [
4
+ {
5
+ "path": "src/pricing.ts"
6
+ }
7
+ ],
8
+ "expect": {
9
+ "findings": [
10
+ "build-failed"
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,22 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ return line.price * line.quantity
7
+ }
8
+
9
+ /** An order's total in pence: every line's total. */
10
+ export function orderTotal(lines: Line[]): number {
11
+ return lines.reduce((sum, line) => sum + lineTotal(line), 0)
12
+ }
13
+
14
+ /** A total with a percentage off, to the nearest penny. */
15
+ export function applyDiscount(total: number, percent: number): number {
16
+ return Math.round(total * (1 - percent / 100))
17
+ }
18
+
19
+ /** Pounds to whole pence as the old till did it. Rounds half a penny up. */
20
+ export function legacyRound(pounds: number): number {
21
+ return Math.round(pounds * 100 + Number.EPSILON)
22
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "why": "Planted: fixes legacy rounding; a test that failed at the base passes, which is no finding.",
3
+ "changes": [
4
+ {
5
+ "path": "src/pricing.ts"
6
+ }
7
+ ],
8
+ "expect": {
9
+ "findings": []
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { expect, test } from "bun:test"
2
+ import { existsSync, writeFileSync } from "node:fs"
3
+ import path from "node:path"
4
+
5
+ // Fails the first time it runs in a checkout and passes after: what a flaky test looks like to the check.
6
+ test("a quote is ready on the second try", () => {
7
+ const marker = path.join(import.meta.dir, ".ran-once")
8
+ const first = !existsSync(marker)
9
+ writeFileSync(marker, "")
10
+ expect(first).toBe(false)
11
+ })
@@ -0,0 +1,11 @@
1
+ {
2
+ "why": "Planted: adds a test that fails on its first run and passes when run again: flaky, said and not counted.",
3
+ "changes": [
4
+ {
5
+ "path": "tests/flaky.test.ts"
6
+ }
7
+ ],
8
+ "expect": {
9
+ "findings": []
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ export { applyDiscount, bulkLineTotal, legacyRound, lineTotal, orderTotal } from "./pricing.ts"
@@ -0,0 +1,28 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ return line.price * line.quantity
7
+ }
8
+
9
+ /** An order's total in pence: every line's total. */
10
+ export function orderTotal(lines: Line[]): number {
11
+ return lines.reduce((sum, line) => sum + lineTotal(line), 0)
12
+ }
13
+
14
+ /** A total with a percentage off, to the nearest penny. */
15
+ export function applyDiscount(total: number, percent: number): number {
16
+ return Math.round(total * (1 - percent / 100))
17
+ }
18
+
19
+ /** Pounds to whole pence as the old till did it. Known wrong: it cuts off instead of rounding (see legacy.test.ts). */
20
+ export function legacyRound(pounds: number): number {
21
+ return Math.floor(pounds * 100)
22
+ }
23
+
24
+ /** Ten or more of a line: 5% off that line, to the nearest penny. */
25
+ export function bulkLineTotal(line: Line): number {
26
+ const total = lineTotal(line)
27
+ return line.quantity >= 10 ? applyDiscount(total, 5) : total
28
+ }
@@ -0,0 +1,7 @@
1
+ import { expect, test } from "bun:test"
2
+ import { bulkLineTotal } from "../src/index.ts"
3
+
4
+ test("ten or more of a line take 5% off it", () => {
5
+ expect(bulkLineTotal({ price: 100, quantity: 10 })).toBe(950)
6
+ expect(bulkLineTotal({ price: 100, quantity: 9 })).toBe(900)
7
+ })
@@ -0,0 +1,17 @@
1
+ {
2
+ "why": "Planted: adds bulk pricing with a test that passes; nothing else changes.",
3
+ "changes": [
4
+ {
5
+ "path": "src/pricing.ts"
6
+ },
7
+ {
8
+ "path": "src/index.ts"
9
+ },
10
+ {
11
+ "path": "tests/bulk.test.ts"
12
+ }
13
+ ],
14
+ "expect": {
15
+ "findings": []
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ export { applyCoupon, applyDiscount, legacyRound, lineTotal, orderTotal } from "./pricing.ts"
@@ -0,0 +1,27 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ return line.price * line.quantity
7
+ }
8
+
9
+ /** An order's total in pence: every line's total. */
10
+ export function orderTotal(lines: Line[]): number {
11
+ return lines.reduce((sum, line) => sum + lineTotal(line), 0)
12
+ }
13
+
14
+ /** A total with a percentage off, to the nearest penny. */
15
+ export function applyDiscount(total: number, percent: number): number {
16
+ return Math.round(total * (1 - percent / 100))
17
+ }
18
+
19
+ /** Pounds to whole pence as the old till did it. Known wrong: it cuts off instead of rounding (see legacy.test.ts). */
20
+ export function legacyRound(pounds: number): number {
21
+ return Math.floor(pounds * 100)
22
+ }
23
+
24
+ /** A coupon of a fixed amount off, never below nothing. Wrong on purpose: it can go below nothing. */
25
+ export function applyCoupon(total: number, amount: number): number {
26
+ return total - amount
27
+ }
@@ -0,0 +1,6 @@
1
+ import { expect, test } from "bun:test"
2
+ import { applyCoupon } from "../src/index.ts"
3
+
4
+ test("a coupon never takes a total below nothing", () => {
5
+ expect(applyCoupon(300, 500)).toBe(0)
6
+ })
@@ -0,0 +1,19 @@
1
+ {
2
+ "why": "Planted: adds a coupon and a test of it that fails.",
3
+ "changes": [
4
+ {
5
+ "path": "src/pricing.ts"
6
+ },
7
+ {
8
+ "path": "src/index.ts"
9
+ },
10
+ {
11
+ "path": "tests/coupon.test.ts"
12
+ }
13
+ ],
14
+ "expect": {
15
+ "findings": [
16
+ "new-test-failed"
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,23 @@
1
+ /** A line of an order: its unit price in pence and how many. */
2
+ export type Line = { price: number; quantity: number }
3
+
4
+ /** A line's total in pence. */
5
+ export function lineTotal(line: Line): number {
6
+ // Quantity is applied when the order is totalled.
7
+ return line.price
8
+ }
9
+
10
+ /** An order's total in pence: every line's total. */
11
+ export function orderTotal(lines: Line[]): number {
12
+ return lines.reduce((sum, line) => sum + lineTotal(line) * line.quantity, 0)
13
+ }
14
+
15
+ /** A total with a percentage off, to the nearest penny. */
16
+ export function applyDiscount(total: number, percent: number): number {
17
+ return Math.round(total * (1 - percent / 100))
18
+ }
19
+
20
+ /** Pounds to whole pence as the old till did it. Known wrong: it cuts off instead of rounding (see legacy.test.ts). */
21
+ export function legacyRound(pounds: number): number {
22
+ return Math.floor(pounds * 100)
23
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "why": "Planted: code-agent's quantity fix totals a line without its quantity, and a test that passed now fails.",
3
+ "changes": [
4
+ {
5
+ "path": "src/pricing.ts"
6
+ }
7
+ ],
8
+ "expect": {
9
+ "findings": [
10
+ "regression"
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "why": "Planted: deletes the discount test, which passes at the base.",
3
+ "changes": [
4
+ {
5
+ "path": "tests/discount.test.ts",
6
+ "deleted": true
7
+ }
8
+ ],
9
+ "expect": {
10
+ "findings": [
11
+ "test-removed"
12
+ ]
13
+ }
14
+ }
@@ -122,6 +122,8 @@ browser:
122
122
  height: 800
123
123
  window: maximized # visible browser: maximized | viewport
124
124
  local_browser: auto # auto: installed Chrome, then Microsoft Edge, then Playwright's Chromium when one does not start | chrome | edge | chromium (that one only)
125
+ launch: auto # how: auto (directly, then through ForgeQE's Playwright when this computer stops a browser started directly; what worked is remembered) | direct | playwright | attach (a browser you started)
126
+ # attach_port: 9222 # launch: attach: the port you started your browser with (--remote-debugging-port=9222), on this computer only
125
127
  video: true # video.mp4 of each run, shown in its report
126
128
  allowed_hosts: []
127
129
  judge: false # true: a second model call checks each finished run against the goal and can fail it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capagents/forgeqe",
3
- "version": "2.8.9",
3
+ "version": "2.9.0",
4
4
  "description": "ForgeQE: a browser agent CLI that runs goals and test cases in local Chrome or Chromium, or BrowserStack and TestMu AI/LambdaTest when configured, and turns passing runs into tests in your repo",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -17,6 +17,7 @@
17
17
  "reporters/",
18
18
  "dist/",
19
19
  "py/forgeqe_engine/*.py",
20
+ "py/forgeqe_engine/*.mjs",
20
21
  "py/forgeqe_desktop/*.py",
21
22
  "py/forgeqe_mobile/*.py",
22
23
  "py/forgeqe_knowledge/*.py",