@agenticmail/enterprise 0.5.441 → 0.5.443

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 (257) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +3 -2
  3. package/dist/agent-heartbeat-QJ3WTWUK.js +518 -0
  4. package/dist/agent-status-CS5NNYIO.js +11 -0
  5. package/dist/agent-tools-3MD7EPO6.js +14629 -0
  6. package/dist/agent-tools-62HGQYDL.js +14629 -0
  7. package/dist/agent-tools-BTUVVOWT.js +14629 -0
  8. package/dist/agent-tools-BV3JMJPN.js +14629 -0
  9. package/dist/agent-tools-JVNQ4RPM.js +14629 -0
  10. package/dist/agent-tools-LD7LELVT.js +14629 -0
  11. package/dist/agent-tools-NRKQ5NMW.js +14629 -0
  12. package/dist/agent-tools-OXZJOD4D.js +14629 -0
  13. package/dist/agent-tools-PT2ES6G5.js +14629 -0
  14. package/dist/agent-tools-SS335E2E.js +14629 -0
  15. package/dist/chunk-2ACTQSPC.js +1728 -0
  16. package/dist/chunk-2XZE5NT3.js +5387 -0
  17. package/dist/chunk-325NTNE6.js +2180 -0
  18. package/dist/chunk-3AHKVWCO.js +5387 -0
  19. package/dist/chunk-3DM6QDVR.js +1728 -0
  20. package/dist/chunk-3L2N6LR2.js +7517 -0
  21. package/dist/chunk-3XP7VYIS.js +7437 -0
  22. package/dist/chunk-3ZD3XOV6.js +1728 -0
  23. package/dist/chunk-44VXWYPE.js +2570 -0
  24. package/dist/chunk-4UOSUXFR.js +7529 -0
  25. package/dist/chunk-54SHHX2S.js +2180 -0
  26. package/dist/chunk-5DVY3CNK.js +1728 -0
  27. package/dist/chunk-5F5DGV63.js +5596 -0
  28. package/dist/chunk-6IUUOWZY.js +7526 -0
  29. package/dist/chunk-77LFFLQX.js +7526 -0
  30. package/dist/chunk-7BKNDBSA.js +2191 -0
  31. package/dist/chunk-7BS2XPLW.js +5359 -0
  32. package/dist/chunk-7GCSGDXQ.js +1636 -0
  33. package/dist/chunk-7IAI45PR.js +4735 -0
  34. package/dist/chunk-7QPZGO27.js +4976 -0
  35. package/dist/chunk-7S5XAXRD.js +4747 -0
  36. package/dist/chunk-AD6ZR3QD.js +5357 -0
  37. package/dist/chunk-AO556OXZ.js +2570 -0
  38. package/dist/chunk-APUWQHXC.js +7437 -0
  39. package/dist/chunk-BKSSHV6C.js +1728 -0
  40. package/dist/chunk-BMUNQHLU.js +1208 -0
  41. package/dist/chunk-BPF5DKUM.js +392 -0
  42. package/dist/chunk-CFR5OSMI.js +1220 -0
  43. package/dist/chunk-CM4GUHXP.js +1728 -0
  44. package/dist/chunk-CVFIM72Q.js +501 -0
  45. package/dist/chunk-DFXVJNKW.js +4734 -0
  46. package/dist/chunk-DJ7LHRL7.js +2214 -0
  47. package/dist/chunk-DJFI6NR6.js +1624 -0
  48. package/dist/chunk-DJHYV5VY.js +1624 -0
  49. package/dist/chunk-DYM4PQO3.js +4727 -0
  50. package/dist/chunk-DZ75RF35.js +1728 -0
  51. package/dist/chunk-E5H64U5H.js +472 -0
  52. package/dist/chunk-EOD4EGFI.js +1728 -0
  53. package/dist/chunk-EP74QR5B.js +4980 -0
  54. package/dist/chunk-FE2M4FV5.js +5273 -0
  55. package/dist/chunk-FQWJMPKW.js +305 -0
  56. package/dist/chunk-FUH6NWIX.js +7540 -0
  57. package/dist/chunk-G5ADHHAD.js +1728 -0
  58. package/dist/chunk-GAYLPSM7.js +7529 -0
  59. package/dist/chunk-GDAFZJTJ.js +7540 -0
  60. package/dist/chunk-GLAN2JBA.js +1636 -0
  61. package/dist/chunk-GNAEBGU7.js +4812 -0
  62. package/dist/chunk-HDDA2Q3Q.js +1728 -0
  63. package/dist/chunk-HG62FWWQ.js +7437 -0
  64. package/dist/chunk-HV5VIS5K.js +1624 -0
  65. package/dist/chunk-IEVA23WK.js +4976 -0
  66. package/dist/chunk-IFMZ2IYC.js +7540 -0
  67. package/dist/chunk-IN7VIORK.js +2641 -0
  68. package/dist/chunk-KAX3ZDP2.js +7529 -0
  69. package/dist/chunk-KECO53GP.js +1728 -0
  70. package/dist/chunk-KGZ74UMA.js +1728 -0
  71. package/dist/chunk-M2ZLRUMX.js +7540 -0
  72. package/dist/chunk-MKQWC6KF.js +5374 -0
  73. package/dist/chunk-MQ3JBGLU.js +1636 -0
  74. package/dist/chunk-MVB6JARX.js +7529 -0
  75. package/dist/chunk-N37MOOFE.js +2210 -0
  76. package/dist/chunk-NELCAZUQ.js +5357 -0
  77. package/dist/chunk-NHLOKTUV.js +26305 -0
  78. package/dist/chunk-OPAO5QQS.js +1728 -0
  79. package/dist/chunk-OUHU3VW6.js +1728 -0
  80. package/dist/chunk-OWEXZVZ6.js +1728 -0
  81. package/dist/chunk-P4DHSJJY.js +7437 -0
  82. package/dist/chunk-Q7QA6MNJ.js +1728 -0
  83. package/dist/chunk-QKKTNPGV.js +7592 -0
  84. package/dist/chunk-REMMXZVU.js +7529 -0
  85. package/dist/chunk-RK3KATD4.js +4756 -0
  86. package/dist/chunk-RQ33L5T3.js +5374 -0
  87. package/dist/chunk-RU77F65Q.js +1728 -0
  88. package/dist/chunk-SAM3CVIU.js +5374 -0
  89. package/dist/chunk-SFMXIKWZ.js +1728 -0
  90. package/dist/chunk-SPZ5JBGW.js +1624 -0
  91. package/dist/chunk-TDOC6WSK.js +7529 -0
  92. package/dist/chunk-TPMT5WTW.js +5357 -0
  93. package/dist/chunk-TVXUR3PB.js +2180 -0
  94. package/dist/chunk-TZEEVEKG.js +5343 -0
  95. package/dist/chunk-U327O3ZR.js +7540 -0
  96. package/dist/chunk-ULD6C5DB.js +2180 -0
  97. package/dist/chunk-ULVRCJZV.js +5374 -0
  98. package/dist/chunk-UOCDOM2S.js +1624 -0
  99. package/dist/chunk-VINDZLLX.js +1636 -0
  100. package/dist/chunk-VODW5GJL.js +2180 -0
  101. package/dist/chunk-WEWL7Z3C.js +2180 -0
  102. package/dist/chunk-WG2MEMS6.js +5343 -0
  103. package/dist/chunk-WYV6QWOJ.js +1188 -0
  104. package/dist/chunk-X5AIAD77.js +1636 -0
  105. package/dist/chunk-XUETIRDV.js +2214 -0
  106. package/dist/chunk-XWSMX7RK.js +7529 -0
  107. package/dist/chunk-YUSYXHKB.js +1728 -0
  108. package/dist/chunk-ZC2RMHQD.js +5374 -0
  109. package/dist/chunk-ZDZQQGFG.js +5374 -0
  110. package/dist/chunk-ZJ2HCWKF.js +1728 -0
  111. package/dist/chunk-ZK4QCOJ5.js +5273 -0
  112. package/dist/chunk-ZMKVEJKR.js +392 -0
  113. package/dist/cli-agent-2UFGFO24.js +2761 -0
  114. package/dist/cli-agent-5FPUCFPG.js +2761 -0
  115. package/dist/cli-agent-7AB6NIYQ.js +2761 -0
  116. package/dist/cli-agent-7CAFSYOM.js +2761 -0
  117. package/dist/cli-agent-7OVOINHR.js +2757 -0
  118. package/dist/cli-agent-AWKBFIRS.js +2761 -0
  119. package/dist/cli-agent-ES3XOPHJ.js +2757 -0
  120. package/dist/cli-agent-FSO2N7I6.js +2757 -0
  121. package/dist/cli-agent-KPXZN5JK.js +2761 -0
  122. package/dist/cli-agent-LGTCFHGS.js +2757 -0
  123. package/dist/cli-agent-LLUYUHHF.js +2757 -0
  124. package/dist/cli-agent-NHZWYX5Q.js +2761 -0
  125. package/dist/cli-agent-TYUOTYCO.js +2757 -0
  126. package/dist/cli-agent-VQO6HI65.js +2757 -0
  127. package/dist/cli-agent-VV5JWRU7.js +2757 -0
  128. package/dist/cli-agent-Z5B23XED.js +2757 -0
  129. package/dist/cli-serve-2FLQXJW7.js +322 -0
  130. package/dist/cli-serve-34YFCCUX.js +322 -0
  131. package/dist/cli-serve-3NS6MNUS.js +322 -0
  132. package/dist/cli-serve-4PWFEPNA.js +322 -0
  133. package/dist/cli-serve-4VIBMXMT.js +322 -0
  134. package/dist/cli-serve-5ZUF5MGH.js +322 -0
  135. package/dist/cli-serve-6HGL56GB.js +322 -0
  136. package/dist/cli-serve-BBBWEKKW.js +322 -0
  137. package/dist/cli-serve-D2HQC4SB.js +322 -0
  138. package/dist/cli-serve-IKCMNUNM.js +322 -0
  139. package/dist/cli-serve-LTUKYMEF.js +322 -0
  140. package/dist/cli-serve-MIWI5PBE.js +322 -0
  141. package/dist/cli-serve-R6K4SZ3L.js +322 -0
  142. package/dist/cli-serve-RQIOBQGF.js +322 -0
  143. package/dist/cli-serve-S57ROYQ6.js +322 -0
  144. package/dist/cli-serve-WVSLOISY.js +322 -0
  145. package/dist/cli-serve-XDFSJIQV.js +322 -0
  146. package/dist/cli-serve-YKZSNR3P.js +322 -0
  147. package/dist/cli-serve-ZGKXWDMZ.js +322 -0
  148. package/dist/cli-serve-ZZOJWREY.js +322 -0
  149. package/dist/cli.js +3 -3
  150. package/dist/dashboard/components/utils.js +1 -1
  151. package/dist/dashboard/docs/polymarket.html +1 -1
  152. package/dist/dashboard/pages/polymarket.js +222 -80
  153. package/dist/index.js +12 -12
  154. package/dist/pipeline-C4C3ZF4X.js +15 -0
  155. package/dist/pipeline-DAF3EV7Q.js +15 -0
  156. package/dist/pipeline-MMESLRQG.js +15 -0
  157. package/dist/polymarket-3LGJSQZK.js +17 -0
  158. package/dist/polymarket-4OIWQFBO.js +17 -0
  159. package/dist/polymarket-AZEV7C6E.js +17 -0
  160. package/dist/polymarket-DBQYJC57.js +7 -0
  161. package/dist/polymarket-EVTKWLUO.js +7 -0
  162. package/dist/polymarket-GMKDVVQH.js +17 -0
  163. package/dist/polymarket-HZOAD4W4.js +17 -0
  164. package/dist/polymarket-PKGRF7ID.js +17 -0
  165. package/dist/polymarket-QUNR2H7U.js +17 -0
  166. package/dist/polymarket-TM624BN5.js +17 -0
  167. package/dist/polymarket-VT2EDGD7.js +17 -0
  168. package/dist/polymarket-W7B4TLP3.js +17 -0
  169. package/dist/polymarket-WS4VE6U7.js +7 -0
  170. package/dist/polymarket-runtime-772ADZJW.js +108 -0
  171. package/dist/polymarket-runtime-AIYHQKYQ.js +108 -0
  172. package/dist/polymarket-runtime-APJ5HW4Y.js +108 -0
  173. package/dist/polymarket-runtime-BX3ODZZD.js +108 -0
  174. package/dist/polymarket-runtime-ISD4CKKL.js +108 -0
  175. package/dist/polymarket-runtime-JU4PQZGJ.js +108 -0
  176. package/dist/polymarket-runtime-OFLBSPCK.js +108 -0
  177. package/dist/polymarket-runtime-POJRRWFS.js +108 -0
  178. package/dist/polymarket-runtime-XN5TVHU5.js +108 -0
  179. package/dist/polymarket-runtime-ZYFTKEJ4.js +108 -0
  180. package/dist/polymarket-watcher-2CKLTIXI.js +23 -0
  181. package/dist/polymarket-watcher-3C72X36B.js +23 -0
  182. package/dist/polymarket-watcher-IHRZ2URM.js +23 -0
  183. package/dist/polymarket-watcher-J7UWIN7I.js +23 -0
  184. package/dist/polymarket-watcher-M6CDW63Y.js +23 -0
  185. package/dist/polymarket-watcher-OSI73EDX.js +23 -0
  186. package/dist/polymarket-watcher-PN4JJV3V.js +23 -0
  187. package/dist/polymarket-watcher-PXK4NS5F.js +23 -0
  188. package/dist/polymarket-watcher-VDJ4SVHP.js +23 -0
  189. package/dist/polymarket-watcher-W4BV6JTG.js +23 -0
  190. package/dist/routes-PRBWZ4MQ.js +94 -0
  191. package/dist/runtime-22E2WCL6.js +46 -0
  192. package/dist/runtime-7GYS4FQU.js +46 -0
  193. package/dist/runtime-7OVDHKNW.js +46 -0
  194. package/dist/runtime-BR6K3Q3N.js +46 -0
  195. package/dist/runtime-CTTRDVJ6.js +46 -0
  196. package/dist/runtime-GIIPTHK5.js +46 -0
  197. package/dist/runtime-HYAKLZWI.js +46 -0
  198. package/dist/runtime-IQ2KIV2L.js +50 -0
  199. package/dist/runtime-ISXECIAB.js +46 -0
  200. package/dist/runtime-IV4BY7S4.js +46 -0
  201. package/dist/runtime-O65GGHL2.js +46 -0
  202. package/dist/runtime-PKHEGQYK.js +50 -0
  203. package/dist/runtime-RFKPIFK4.js +46 -0
  204. package/dist/runtime-S35B6PIY.js +46 -0
  205. package/dist/runtime-WEZJ4YRK.js +46 -0
  206. package/dist/runtime-WLWB62ZI.js +46 -0
  207. package/dist/screener-FB47G4YX.js +26 -0
  208. package/dist/screener-WQVQO4WF.js +26 -0
  209. package/dist/server-6GWGIGBH.js +36 -0
  210. package/dist/server-7VZ6XXBC.js +36 -0
  211. package/dist/server-7XBTD3FW.js +36 -0
  212. package/dist/server-BN56IMC4.js +36 -0
  213. package/dist/server-GD6SPDER.js +36 -0
  214. package/dist/server-IJHU2FIK.js +36 -0
  215. package/dist/server-J5WZGZX3.js +36 -0
  216. package/dist/server-JVUH2E3H.js +36 -0
  217. package/dist/server-MYXWTXSE.js +36 -0
  218. package/dist/server-ORGV7O7L.js +36 -0
  219. package/dist/server-QPE3WVUQ.js +36 -0
  220. package/dist/server-SUBGS5BJ.js +36 -0
  221. package/dist/server-SWAYJTFF.js +36 -0
  222. package/dist/server-TFIWDU2H.js +36 -0
  223. package/dist/server-VH4W6LWW.js +36 -0
  224. package/dist/server-WQXRTEKF.js +36 -0
  225. package/dist/server-X5UMJJ3J.js +36 -0
  226. package/dist/server-XOK5LHNU.js +36 -0
  227. package/dist/server-ZLK24KFY.js +36 -0
  228. package/dist/server-ZNSQGCRM.js +36 -0
  229. package/dist/setup-32ZRMW7R.js +20 -0
  230. package/dist/setup-3WF7PBIS.js +20 -0
  231. package/dist/setup-4TM64QG4.js +20 -0
  232. package/dist/setup-5SGUMKN7.js +20 -0
  233. package/dist/setup-7ENTPINX.js +20 -0
  234. package/dist/setup-AGYKOCIU.js +20 -0
  235. package/dist/setup-EIP4IHZN.js +20 -0
  236. package/dist/setup-F5SAGQJJ.js +20 -0
  237. package/dist/setup-LMF76UUM.js +20 -0
  238. package/dist/setup-MA5QR3J4.js +20 -0
  239. package/dist/setup-MLIPR2U3.js +20 -0
  240. package/dist/setup-MLIZYTT6.js +20 -0
  241. package/dist/setup-OPVZ3GM7.js +20 -0
  242. package/dist/setup-PWFHUXOK.js +20 -0
  243. package/dist/setup-QF5GCTPE.js +20 -0
  244. package/dist/setup-SGF4OX3A.js +20 -0
  245. package/dist/setup-TLWKGWC6.js +20 -0
  246. package/dist/setup-TYCRH63P.js +20 -0
  247. package/dist/setup-USUBKTVX.js +20 -0
  248. package/dist/setup-VMNTNEB4.js +20 -0
  249. package/dist/shared-S5ROHYCX.js +69 -0
  250. package/dist/shared-TLWZZZSK.js +69 -0
  251. package/dist/system-prompts-7ZRL27FN.js +69 -0
  252. package/dist/system-prompts-CNXUF2AV.js +69 -0
  253. package/dist/system-prompts-SYGQRBRG.js +69 -0
  254. package/logs/cloudflared-error.log +4 -57
  255. package/logs/cloudflared-error__2026-03-11_00-00-00.log +289 -0
  256. package/package.json +1 -1
  257. package/logs/cloudflared-error__2026-03-06_00-00-00.log +0 -245
@@ -3,6 +3,7 @@ import { I as Icons } from '../components/icons.js';
3
3
  var iconMap = { 'trending-up': 'activity', 'refresh-cw': 'refresh', 'play': 'play', 'pause': 'pause', 'check': 'check', 'x': 'x', 'edit': 'settings', 'link': 'link', 'message-circle': 'messages', 'calendar': 'calendar', 'trash-2': 'trash', 'zap': 'warning', 'git-branch': 'link', 'shuffle': 'refresh', 'activity': 'activity', 'crosshair': 'search', 'layers': 'folder', 'shield': 'shield', 'log-out': 'logout', 'pie-chart': 'dashboard', 'trending-down': 'activity', 'brain': 'brain', 'key': 'key', 'globe': 'globe', 'eye': 'eye', 'chart': 'chart', 'clock': 'clock', 'database': 'database' };
4
4
  function I(name) { var k = iconMap[name] || name; var fn = Icons[k]; return fn ? fn() : ''; }
5
5
  import { HelpButton } from '../components/help-button.js';
6
+ import { Modal } from '../components/modal.js';
6
7
  import { useOrgContext } from '../components/org-switcher.js';
7
8
 
8
9
  var CHART_COLORS = ['#6366f1', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#06b6d4', '#ec4899', '#14b8a6', '#f97316', '#84cc16'];
@@ -85,6 +86,7 @@ export function PolymarketPage() {
85
86
  const [showAddAddr, setShowAddAddr] = useState(false);
86
87
  const [goals, setGoals] = useState([]);
87
88
  const [goalEval, setGoalEval] = useState(null);
89
+ const [dailyScorecard, setDailyScorecard] = useState(null);
88
90
  const [showGoalForm, setShowGoalForm] = useState(false);
89
91
  const [editGoal, setEditGoal] = useState(null);
90
92
  const [goalDetail, setGoalDetail] = useState(null);
@@ -123,6 +125,18 @@ export function PolymarketPage() {
123
125
  const [transferPinSetup, setTransferPinSetup] = useState({ pin: '', confirm: '' });
124
126
  const [transferLoading, setTransferLoading] = useState(false);
125
127
  const [walletSecurity, setWalletSecurity] = useState(null); // { has2fa, hasPin, pinEnabled }
128
+ // Swap modal state
129
+ const [swapModal, setSwapModal] = useState(null); // null | { direction, maxAmount, label }
130
+ const [swapAmount, setSwapAmount] = useState('');
131
+ const [swapLoading, setSwapLoading] = useState(false);
132
+ const [swapCountdown, setSwapCountdown] = useState(0);
133
+
134
+ // Countdown timer during swap
135
+ useEffect(function() {
136
+ if (swapCountdown <= 0) return;
137
+ var t = setTimeout(function() { setSwapCountdown(swapCountdown - 1); }, 1000);
138
+ return function() { clearTimeout(t); };
139
+ }, [swapCountdown]);
126
140
 
127
141
  var showTip = function(e, lines) { setTooltip({ x: e.clientX, y: e.clientY, lines: lines }); };
128
142
  var hideTip = function() { setTooltip(null); };
@@ -561,7 +575,7 @@ export function PolymarketPage() {
561
575
  if (!agentId) return;
562
576
  try {
563
577
  const [c, p, t, al, pp, w, preds, cal, strats, less,
564
- wh, soc, ev, na, cor, arb, reg, sn, sc, hd, ex, dd, pnl, wtch, wevt, engSt, aiCfg, goalsRes, livePos] = await Promise.all([
578
+ wh, soc, ev, na, cor, arb, reg, sn, sc, hd, ex, dd, pnl, wtch, wevt, engSt, aiCfg, goalsRes, livePos, sc2] = await Promise.all([
565
579
  apiCall('/polymarket/' + agentId + '/config').catch(() => ({ config: null })),
566
580
  apiCall('/polymarket/' + agentId + '/pending').catch(() => ({ trades: [] })),
567
581
  apiCall('/polymarket/' + agentId + '/trades').catch(() => ({ trades: [] })),
@@ -592,7 +606,9 @@ export function PolymarketPage() {
592
606
  apiCall('/polymarket/' + agentId + '/watcher-config').catch(() => null),
593
607
  apiCall('/polymarket/' + agentId + '/goals').catch(() => ({ goals: [] })),
594
608
  apiCall('/polymarket/' + agentId + '/live-positions').catch(() => ({ positions: [] })),
609
+ apiCall('/polymarket/' + agentId + '/daily-scorecard').catch(() => null),
595
610
  ]);
611
+ setDailyScorecard(sc2 || null);
596
612
  setLivePositions(livePos?.positions || []);
597
613
  setGoals(goalsRes?.goals || []);
598
614
  setConfig(c.config); setPendingTrades(p.trades || []); setTradeHistory(t.trades || []);
@@ -864,10 +880,11 @@ export function PolymarketPage() {
864
880
  });
865
881
  return out;
866
882
  }
867
- function paginateData(data, tabId) {
868
- var s = getTC(tabId), total = data.length, totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE));
869
- var p = Math.min(Math.max(1, s.page || 1), totalPages), start = (p - 1) * PAGE_SIZE;
870
- return { items: data.slice(start, start + PAGE_SIZE), total: total, totalPages: totalPages, page: p, start: start };
883
+ function paginateData(data, tabId, customPageSize) {
884
+ var ps = customPageSize || PAGE_SIZE;
885
+ var s = getTC(tabId), total = data.length, totalPages = Math.max(1, Math.ceil(total / ps));
886
+ var p = Math.min(Math.max(1, s.page || 1), totalPages), start = (p - 1) * ps;
887
+ return { items: data.slice(start, start + ps), total: total, totalPages: totalPages, page: p, start: start, pageSize: ps };
871
888
  }
872
889
  function renderControls(tabId, filterDefs, result, extraLeft) {
873
890
  var s = getTC(tabId);
@@ -898,7 +915,7 @@ export function PolymarketPage() {
898
915
  extraLeft,
899
916
  h('div', { style: { flex: 1 } }),
900
917
  result.total > 0 && h('div', { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: 12, color: 'var(--text-muted)', flexShrink: 0 } },
901
- h('span', null, (result.start + 1) + '\u2013' + Math.min(result.start + PAGE_SIZE, result.total) + ' of ' + result.total),
918
+ h('span', null, (result.start + 1) + '\u2013' + Math.min(result.start + (result.pageSize || PAGE_SIZE), result.total) + ' of ' + result.total),
902
919
  h('button', { className: 'btn btn-sm btn-outline', disabled: result.page <= 1, style: { padding: '4px 8px', minWidth: 28 },
903
920
  onClick: function() { updateTC(tabId, { page: result.page - 1 }); } }, '\u2039'),
904
921
  h('span', { style: { fontSize: 12, minWidth: 36, textAlign: 'center' } }, result.page + '/' + result.totalPages),
@@ -910,7 +927,7 @@ export function PolymarketPage() {
910
927
  function renderFilteredTable(tabId, data, emptyMsg, headers, rowFn, opts) {
911
928
  var clickFn = opts.onRowClick || function(item) { setSelectedRow({ tab: tabId, data: item }); };
912
929
  var filtered = applySearchFilter(data, tabId, opts.searchFields || [], opts.filters || []);
913
- var result = paginateData(filtered, tabId);
930
+ var result = paginateData(filtered, tabId, opts.pageSize);
914
931
  var hasData = data && data.length > 0;
915
932
  var s = getTC(tabId);
916
933
  var isFiltered = s.search || Object.values(s.filters || {}).some(function(v) { return v && v !== 'all'; });
@@ -1673,6 +1690,51 @@ export function PolymarketPage() {
1673
1690
  statCard('Social Signals', socialSignals.length),
1674
1691
  statCard('Events', events.length),
1675
1692
  ),
1693
+ // ── Daily Scorecard ──
1694
+ dailyScorecard && h('div', { className: 'card', style: { padding: 16, marginBottom: 20 } },
1695
+ h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 } },
1696
+ h('h3', { style: { margin: 0, fontSize: 15, fontWeight: 600 } }, 'Daily Scorecard'),
1697
+ h('span', { className: 'badge ' + (dailyScorecard.status === 'TARGET_HIT' ? 'badge-success' : dailyScorecard.status === 'AHEAD' ? 'badge-success' : dailyScorecard.status === 'ON_TRACK' ? 'badge-secondary' : dailyScorecard.status === 'STOP_TRADING' ? 'badge-danger' : 'badge-warning') }, dailyScorecard.status?.replace(/_/g, ' '))
1698
+ ),
1699
+ // Progress bar
1700
+ h('div', { style: { marginBottom: 12 } },
1701
+ h('div', { style: { display: 'flex', justifyContent: 'space-between', fontSize: 12, marginBottom: 4, color: 'var(--text-muted)' } },
1702
+ h('span', null, 'P&L: $' + (dailyScorecard.total_pnl || 0).toFixed(2)),
1703
+ h('span', null, 'Target: $' + (dailyScorecard.daily_target || 0))
1704
+ ),
1705
+ h('div', { style: { height: 8, background: 'var(--bg-secondary)', borderRadius: 4, overflow: 'hidden' } },
1706
+ h('div', { style: { height: '100%', width: Math.min(100, Math.max(0, dailyScorecard.target_progress_pct || 0)) + '%', background: (dailyScorecard.total_pnl || 0) >= 0 ? '#22c55e' : '#ef4444', borderRadius: 4, transition: 'width 0.3s' } })
1707
+ ),
1708
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginTop: 2 } }, (dailyScorecard.target_progress_pct || 0).toFixed(0) + '% of daily target')
1709
+ ),
1710
+ // Score metrics row
1711
+ h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(100px, 1fr))', gap: 8 } },
1712
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1713
+ h('div', { style: { fontSize: 18, fontWeight: 700, color: (dailyScorecard.realized_pnl || 0) >= 0 ? '#22c55e' : '#ef4444' } }, '$' + (dailyScorecard.realized_pnl || 0).toFixed(2)),
1714
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Realized')
1715
+ ),
1716
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1717
+ h('div', { style: { fontSize: 18, fontWeight: 700, color: (dailyScorecard.unrealized_pnl || 0) >= 0 ? '#22c55e' : '#ef4444' } }, '$' + (dailyScorecard.unrealized_pnl || 0).toFixed(2)),
1718
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Unrealized')
1719
+ ),
1720
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1721
+ h('div', { style: { fontSize: 18, fontWeight: 700 } }, dailyScorecard.trades_today || 0),
1722
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Trades')
1723
+ ),
1724
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1725
+ h('div', { style: { fontSize: 18, fontWeight: 700 } }, (dailyScorecard.win_rate_today || 0).toFixed(0) + '%'),
1726
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Win Rate')
1727
+ ),
1728
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1729
+ h('div', { style: { fontSize: 18, fontWeight: 700 } }, '$' + (dailyScorecard.available_capital || 0).toFixed(0)),
1730
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Available')
1731
+ ),
1732
+ h('div', { style: { textAlign: 'center', padding: 8, background: 'var(--bg-secondary)', borderRadius: 6 } },
1733
+ h('div', { style: { fontSize: 18, fontWeight: 700 } }, dailyScorecard.open_positions || 0),
1734
+ h('div', { style: { fontSize: 10, color: 'var(--text-muted)' } }, 'Positions')
1735
+ )
1736
+ )
1737
+ ),
1676
1738
  agents.length === 0 && h('div', { className: 'empty-state card', style: { padding: "40px", textAlign: "center" } },
1677
1739
  h('h3', null, 'No Polymarket Agents'),
1678
1740
  h('p', null, 'Create an agent with the Polymarket Trader template to get started.'),
@@ -1854,19 +1916,19 @@ export function PolymarketPage() {
1854
1916
  var oc = p.outcome || resolveOutcome(p.side, p.outcome);
1855
1917
  var isWon = p.resolved && p.current >= 0.99;
1856
1918
  var isLost = p.resolved && p.current <= 0.01;
1857
- // Win amount = shares * $1 (each winning share pays $1) minus cost
1919
+ // Win amount = total payout if prediction is correct (shares × $1 = full amount you get back)
1858
1920
  var cost = (p.entry || 0) * (p.size || 0);
1859
- var winAmount = (p.size || 0) - cost; // profit if prediction is correct
1921
+ var winAmount = (p.size || 0); // each winning share pays $1, so total payout = number of shares
1860
1922
  var statusBadge = p.redeemable
1861
- ? h('span', { className: 'badge', style: { background: 'rgba(245,158,11,0.15)', color: '#f59e0b', fontSize: 9, marginLeft: 6 } }, '\u2728 REDEEM')
1923
+ ? h('span', { className: 'badge', style: { background: 'rgba(245,158,11,0.15)', color: '#f59e0b', fontSize: 9, marginLeft: 6 } }, 'REDEEM')
1862
1924
  : isWon
1863
- ? h('span', { className: 'badge', style: { background: 'rgba(16,185,129,0.15)', color: '#10b981', fontSize: 9, marginLeft: 6 } }, '\u2705 WON')
1925
+ ? h('span', { className: 'badge', style: { background: 'rgba(16,185,129,0.15)', color: '#10b981', fontSize: 9, marginLeft: 6 } }, 'WON')
1864
1926
  : isLost
1865
- ? h('span', { className: 'badge', style: { background: 'rgba(239,68,68,0.15)', color: '#ef4444', fontSize: 9, marginLeft: 6 } }, '\u274c LOST')
1927
+ ? h('span', { className: 'badge', style: { background: 'rgba(239,68,68,0.15)', color: '#ef4444', fontSize: 9, marginLeft: 6 } }, 'LOST')
1866
1928
  : null;
1867
1929
  return [
1868
- h('td', { key: 'm', style: { maxWidth: 220, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
1869
- h('span', null, p.market || shortId(p.token_id), statusBadge)
1930
+ h('td', { key: 'm', style: { maxWidth: 120, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
1931
+ h('span', { title: p.market || shortId(p.token_id) }, ((p.market || shortId(p.token_id)).length > 12 ? (p.market || shortId(p.token_id)).slice(0, 12) + '...' : (p.market || shortId(p.token_id))), statusBadge)
1870
1932
  ),
1871
1933
  h('td', { key: 's' }, sideBadge(p.side)),
1872
1934
  h('td', { key: 'o' }, oc
@@ -1880,10 +1942,10 @@ export function PolymarketPage() {
1880
1942
  ),
1881
1943
  h('td', { key: 'sz' }, '$' + cost.toFixed(2)),
1882
1944
  h('td', { key: 'win', style: { fontWeight: 600, color: '#10b981' } },
1883
- isWon ? h('span', null, '$' + (p.size || 0).toFixed(2), h('span', { style: { fontSize: 10, marginLeft: 4, opacity: 0.7 } }, 'WON'))
1945
+ isWon ? h('span', null, '$' + winAmount.toFixed(2), h('span', { style: { fontSize: 10, marginLeft: 4, opacity: 0.7 } }, 'WON'))
1884
1946
  : isLost ? h('span', { style: { color: '#ef4444' } }, '$0.00')
1885
- : h('span', null, '+$' + winAmount.toFixed(2),
1886
- h('span', { style: { fontSize: 10, marginLeft: 4, opacity: 0.7 } }, 'if correct')
1947
+ : h('span', null, '$' + winAmount.toFixed(2),
1948
+ h('span', { style: { fontSize: 10, marginLeft: 4, color: '#10b981', opacity: 0.7 } }, ' (+$' + (winAmount - cost).toFixed(2) + ' profit)')
1887
1949
  )
1888
1950
  ),
1889
1951
  h('td', { key: 'pnl' }, pnlCell(p.pnl)),
@@ -1899,7 +1961,7 @@ export function PolymarketPage() {
1899
1961
  }, sellExecuting === p.token_id ? '...' : 'Sell')
1900
1962
  )
1901
1963
  ];
1902
- }, { searchKeys: ['market', 'outcome'] }
1964
+ }, { searchKeys: ['market', 'outcome'], pageSize: 6 }
1903
1965
  )
1904
1966
  ),
1905
1967
 
@@ -1964,36 +2026,24 @@ export function PolymarketPage() {
1964
2026
  '\u21C4', ' Swap USDC',
1965
2027
  h(HelpButton, { label: 'USDC Swap' },
1966
2028
  h('p', null, 'Polymarket uses USDC.e (bridged USDC), not native USDC. If you received native USDC, swap it to USDC.e to trade. You can also swap USDC.e back to native USDC for withdrawals to exchanges that only accept native USDC.'),
2029
+ h('p', null, 'Swaps are executed directly on-chain via Uniswap V3 — no agent or LLM call required.'),
1967
2030
  )
1968
2031
  )
1969
2032
  ),
1970
2033
  h('div', { style: { display: 'flex', gap: 8 } },
1971
2034
  walletBalance.balances.usdcNative > 0 && h('button', {
1972
2035
  className: 'btn btn-sm btn-warning',
1973
- onClick: async function() {
1974
- var amt = walletBalance.balances.usdcNative;
1975
- if (!(await showConfirm('Swap $' + amt.toFixed(2) + ' Native USDC \u2192 USDC.e?\n\nThis converts your native USDC to the bridged version used by Polymarket.'))) return;
1976
- try {
1977
- var res = await apiCall('/polymarket/' + selectedAgent + '/wallet/swap', { method: 'POST', body: JSON.stringify({ direction: 'native_to_bridged', amount: amt }) });
1978
- toast(res.message || 'Swap initiated! Balance will update shortly.', 'success');
1979
- setTimeout(function() { loadWalletBalance(selectedAgent); }, 3000);
1980
- } catch (e) { toast(e.message || 'Swap failed', 'error'); }
2036
+ onClick: function() {
2037
+ setSwapAmount(walletBalance.balances.usdcNative.toFixed(2));
2038
+ setSwapModal({ direction: 'native_to_bridged', maxAmount: walletBalance.balances.usdcNative, label: 'Native USDC \u2192 USDC.e' });
1981
2039
  }
1982
2040
  }, 'Swap Native USDC \u2192 USDC.e ($' + (walletBalance.balances.usdcNative || 0).toFixed(2) + ')'),
1983
2041
  (walletBalance.balances.usdce != null ? walletBalance.balances.usdce : walletBalance.balances.usdc || 0) > 0 && h('button', {
1984
2042
  className: 'btn btn-sm btn-secondary',
1985
- onClick: async function() {
2043
+ onClick: function() {
1986
2044
  var usdceBalance = walletBalance.balances.usdce != null ? walletBalance.balances.usdce : walletBalance.balances.usdc || 0;
1987
- var amtStr = prompt('Amount of USDC.e to swap to Native USDC (max: $' + usdceBalance.toFixed(2) + '):');
1988
- if (!amtStr) return;
1989
- var amt = parseFloat(amtStr);
1990
- if (isNaN(amt) || amt <= 0 || amt > usdceBalance) { toast('Invalid amount', 'error'); return; }
1991
- if (!(await showConfirm('Swap $' + amt.toFixed(2) + ' USDC.e \u2192 Native USDC?\n\nNote: Native USDC cannot be used for trading on Polymarket.'))) return;
1992
- try {
1993
- var res = await apiCall('/polymarket/' + selectedAgent + '/wallet/swap', { method: 'POST', body: JSON.stringify({ direction: 'bridged_to_native', amount: amt }) });
1994
- toast(res.message || 'Swap initiated! Balance will update shortly.', 'success');
1995
- setTimeout(function() { loadWalletBalance(selectedAgent); }, 3000);
1996
- } catch (e) { toast(e.message || 'Swap failed', 'error'); }
2045
+ setSwapAmount('');
2046
+ setSwapModal({ direction: 'bridged_to_native', maxAmount: usdceBalance, label: 'USDC.e \u2192 Native USDC' });
1997
2047
  }
1998
2048
  }, 'Swap USDC.e \u2192 Native USDC')
1999
2049
  ),
@@ -2002,12 +2052,15 @@ export function PolymarketPage() {
2002
2052
  )
2003
2053
  ),
2004
2054
  // POL/MATIC gas token
2005
- h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', padding: '12px 16px', background: 'rgba(139,92,246,0.06)', borderRadius: 8, border: '1px solid rgba(139,92,246,0.15)' } },
2055
+ h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '12px 16px', background: (walletBalance.balances.matic || 0) < 1 ? 'rgba(239,68,68,0.06)' : 'rgba(139,92,246,0.06)', borderRadius: 8, border: '1px solid ' + ((walletBalance.balances.matic || 0) < 1 ? 'rgba(239,68,68,0.2)' : 'rgba(139,92,246,0.15)') } },
2006
2056
  h('div', null,
2007
2057
  h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginBottom: 2 } }, 'POL'),
2008
2058
  h('div', { style: { fontSize: 18, fontWeight: 600 } }, (walletBalance.balances.matic || 0).toFixed(4))
2009
2059
  ),
2010
- h('div', { style: { fontSize: 11, color: 'var(--text-muted)' } }, 'Gas token')
2060
+ h('div', { style: { fontSize: 11, color: (walletBalance.balances.matic || 0) < 1 ? '#ef4444' : 'var(--text-muted)', textAlign: 'right' } },
2061
+ h('div', null, 'Gas token'),
2062
+ (walletBalance.balances.matic || 0) < 1 && h('div', { style: { fontWeight: 600, marginTop: 2 } }, 'Low! Deposit $5\u2013$10 of POL')
2063
+ )
2011
2064
  ),
2012
2065
  walletBalance?.portfolio && (function() {
2013
2066
  // Use live SSE data for real-time portfolio value when available
@@ -2040,7 +2093,8 @@ export function PolymarketPage() {
2040
2093
  h('ul', { style: _ul },
2041
2094
  h('li', null, 'Send ', h('strong', null, 'USDC on Polygon only'), '. Other tokens or networks will result in lost funds.'),
2042
2095
  h('li', null, 'You can also bridge from Ethereum, Arbitrum, Base, or Optimism via ', h('a', { href: 'https://polymarket.com', target: '_blank' }, 'polymarket.com'), '.'),
2043
- h('li', null, 'Polygon confirmations take ~2 seconds. Balance updates within 15 seconds.')
2096
+ h('li', null, 'Polygon confirmations take ~2 seconds. Balance updates within 15 seconds.'),
2097
+ h('li', null, h('strong', null, 'Also deposit $5\u2013$10 worth of POL'), ' (Polygon gas token) for transaction fees. Swaps, trades, and approvals each cost ~$0.01 in POL gas. Keep your POL balance topped up when running low.')
2044
2098
  )
2045
2099
  )
2046
2100
  ),
@@ -2058,6 +2112,7 @@ export function PolymarketPage() {
2058
2112
  h('div', { style: { fontWeight: 600, marginBottom: 6 } }, 'How to deposit:'),
2059
2113
  h('ol', { style: { margin: 0, paddingLeft: 20 } },
2060
2114
  h('li', null, 'Send USDC on the ', h('strong', null, 'Polygon'), ' network to the address above'),
2115
+ h('li', null, 'Also send ', h('strong', null, '$5\u2013$10 worth of POL'), ' (Polygon gas token) to the same address for transaction fees'),
2061
2116
  h('li', null, 'Confirmation takes ~2 seconds on Polygon'),
2062
2117
  h('li', null, 'You can also deposit via ', h('a', { href: 'https://polymarket.com', target: '_blank', style: { color: 'var(--brand)' } }, 'polymarket.com'), ' bridge from Ethereum, Arbitrum, Base, or Optimism')
2063
2118
  )
@@ -2106,6 +2161,85 @@ export function PolymarketPage() {
2106
2161
  )
2107
2162
  ),
2108
2163
 
2164
+ // ── Swap Modal ──
2165
+ swapModal && h(Modal, {
2166
+ title: swapModal.label,
2167
+ width: 420,
2168
+ onClose: function() { if (!swapLoading) { setSwapModal(null); setSwapAmount(''); } },
2169
+ footer: h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end' } },
2170
+ h('button', { className: 'btn btn-secondary', disabled: swapLoading, onClick: function() { setSwapModal(null); setSwapAmount(''); } }, 'Cancel'),
2171
+ h('button', {
2172
+ className: 'btn btn-primary',
2173
+ disabled: swapLoading || !swapAmount || parseFloat(swapAmount) <= 0 || parseFloat(swapAmount) > swapModal.maxAmount,
2174
+ onClick: async function() {
2175
+ var amt = parseFloat(swapAmount);
2176
+ if (isNaN(amt) || amt <= 0 || amt > swapModal.maxAmount) { toast('Invalid amount (max $' + swapModal.maxAmount.toFixed(2) + ')', 'error'); return; }
2177
+ setSwapLoading(true);
2178
+ setSwapCountdown(99);
2179
+ try {
2180
+ var res = await apiCall('/polymarket/' + selectedAgent + '/wallet/swap', { method: 'POST', body: JSON.stringify({ direction: swapModal.direction, amount: amt }) });
2181
+ setSwapCountdown(0);
2182
+ toast(res.message || 'Swap completed!', 'success');
2183
+ if (res.txHash) toast('Tx: ' + res.txHash.slice(0, 10) + '...', 'info');
2184
+ setSwapModal(null); setSwapAmount('');
2185
+ setTimeout(function() { loadWalletBalance(selectedAgent); }, 3000);
2186
+ } catch (e) { setSwapCountdown(0); toast(e.message || 'Swap failed', 'error'); }
2187
+ setSwapLoading(false);
2188
+ }
2189
+ }, swapLoading ? h('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 8 } },
2190
+ h('span', {
2191
+ style: {
2192
+ display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
2193
+ width: 28, height: 28, borderRadius: '50%', background: 'rgba(255,255,255,0.2)',
2194
+ fontSize: 12, fontWeight: 700, fontVariantNumeric: 'tabular-nums'
2195
+ }
2196
+ }, swapCountdown > 0 ? swapCountdown : '...'),
2197
+ 'Swapping on-chain...'
2198
+ ) : 'Confirm Swap')
2199
+ )
2200
+ },
2201
+ h('div', { style: { display: 'flex', flexDirection: 'column', gap: 16 } },
2202
+ h('div', { style: { padding: 12, background: swapModal.direction === 'native_to_bridged' ? 'rgba(251,191,36,0.08)' : 'rgba(99,102,241,0.08)', borderRadius: 8, fontSize: 13, lineHeight: 1.6 } },
2203
+ swapModal.direction === 'native_to_bridged'
2204
+ ? 'Convert your native USDC to USDC.e (bridged), which is required for trading on Polymarket.'
2205
+ : 'Convert your USDC.e (bridged) back to native USDC. Note: Native USDC cannot be used for trading on Polymarket.'
2206
+ ),
2207
+ h('div', null,
2208
+ h('label', { style: { display: 'block', fontSize: 12, fontWeight: 600, marginBottom: 6, color: 'var(--text-muted)' } },
2209
+ 'Amount to swap (max: $' + swapModal.maxAmount.toFixed(2) + ')'
2210
+ ),
2211
+ h('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
2212
+ h('input', {
2213
+ type: 'number',
2214
+ className: 'input',
2215
+ style: { flex: 1, fontSize: 16, padding: '10px 12px' },
2216
+ placeholder: '0.00',
2217
+ min: 0,
2218
+ max: swapModal.maxAmount,
2219
+ step: '0.01',
2220
+ value: swapAmount,
2221
+ disabled: swapLoading,
2222
+ autoFocus: true,
2223
+ onInput: function(e) { setSwapAmount(e.target.value); }
2224
+ }),
2225
+ h('button', {
2226
+ className: 'btn btn-sm btn-secondary',
2227
+ disabled: swapLoading,
2228
+ onClick: function() { setSwapAmount(swapModal.maxAmount.toFixed(2)); }
2229
+ }, 'Max')
2230
+ ),
2231
+ (swapAmount && parseFloat(swapAmount) > swapModal.maxAmount) && h('div', { style: { fontSize: 11, color: '#ef4444', marginTop: 4 } },
2232
+ 'Amount exceeds available balance of $' + swapModal.maxAmount.toFixed(2)
2233
+ )
2234
+ ),
2235
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', lineHeight: 1.6 } },
2236
+ 'Swap is executed directly on-chain via Uniswap V3 on Polygon. Typical fee: 0.01%. Slippage tolerance: 0.5%.',
2237
+ h('br'),
2238
+ 'Requires POL for gas fees (~$0.01 per swap).'
2239
+ )
2240
+ )
2241
+ ),
2242
+
2109
2243
  // ── Transfer Modal with 2FA/PIN ──
2110
2244
  showTransferModal && h('div', { className: 'modal-overlay', onMouseMove: hideTip, onClick: function() { setShowTransferModal(false); } },
2111
2245
  h('div', { className: 'modal', onClick: function(e) { e.stopPropagation(); }, style: { width: 560, maxHeight: '90vh', overflow: 'auto' } },
@@ -2118,7 +2252,7 @@ export function PolymarketPage() {
2118
2252
  // Step 1: Locked — need to verify identity
2119
2253
  transferVerifyStep === 'locked' && h('div', null,
2120
2254
  h('div', { style: { textAlign: 'center', padding: '20px 0' } },
2121
- h('div', { style: { fontSize: 48, marginBottom: 12 } }, '\uD83D\uDD12'),
2255
+ h('div', { style: { marginBottom: 12, color: 'var(--text-muted)' } }, I('lock', 48)),
2122
2256
  h('h3', { style: { marginBottom: 8 } }, 'Security Verification Required'),
2123
2257
  h('p', { style: { color: 'var(--text-muted)', fontSize: 13, marginBottom: 20 } },
2124
2258
  'To protect your funds, you must verify your identity before transferring. The transfer window stays open for ', h('strong', null, '9 minutes'), ' after verification.'
@@ -2130,7 +2264,7 @@ export function PolymarketPage() {
2130
2264
  I('key'), ' Verify with Wallet PIN'
2131
2265
  ),
2132
2266
  (!walletSecurity || (!walletSecurity.has2fa && !walletSecurity.hasPin)) && h('div', { style: { padding: 16, background: 'rgba(245,158,11,0.08)', borderRadius: 8, border: '1px solid rgba(245,158,11,0.2)', marginTop: 12 } },
2133
- h('p', { style: { fontWeight: 600, marginBottom: 8, color: '#f59e0b' } }, '\u26A0 No Security Method Set Up'),
2267
+ h('p', { style: { fontWeight: 600, marginBottom: 8, color: '#f59e0b', display: 'flex', alignItems: 'center', gap: 6 } }, I('warning'), ' No Security Method Set Up'),
2134
2268
  h('p', { style: { fontSize: 12, color: 'var(--text-muted)', marginBottom: 12 } }, 'You need to set up either 2FA (from Settings page) or a 6-digit Wallet PIN to enable transfers.'),
2135
2269
  h('button', { className: 'btn btn-warning', style: { width: '100%' }, onClick: function() { setTransferVerifyStep('setup_pin'); setTransferPinSetup({ pin: '', confirm: '' }); } },
2136
2270
  I('plus'), ' Set Up Wallet PIN'
@@ -2192,47 +2326,55 @@ export function PolymarketPage() {
2192
2326
  ),
2193
2327
 
2194
2328
  // Step: Set up PIN (first time)
2195
- transferVerifyStep === 'setup_pin' && h('div', null,
2196
- h('h3', { style: { marginBottom: 12 } }, 'Create Wallet PIN'),
2197
- h('p', { style: { fontSize: 12, color: 'var(--text-muted)', marginBottom: 16 } }, 'Set a 6-digit PIN for your wallet. This PIN is encrypted and stored securely using the vault encryption system.'),
2198
- h('div', { style: { marginBottom: 12 } },
2199
- h('label', { style: { fontSize: 12, fontWeight: 600, display: 'block', marginBottom: 4 } }, 'PIN'),
2200
- h('input', { type: 'password', value: transferPinSetup.pin, maxLength: 6, placeholder: '\u2022\u2022\u2022\u2022\u2022\u2022', style: { width: '100%', padding: '10px 14px', fontSize: 20, textAlign: 'center', letterSpacing: 8, fontFamily: 'var(--font-mono)', border: '2px solid var(--border)', borderRadius: 8, background: 'var(--bg-secondary)' },
2201
- onChange: function(e) { setTransferPinSetup(Object.assign({}, transferPinSetup, { pin: e.target.value.replace(/\D/g, '').slice(0, 6) })); }
2202
- })
2203
- ),
2204
- h('div', { style: { marginBottom: 12 } },
2205
- h('label', { style: { fontSize: 12, fontWeight: 600, display: 'block', marginBottom: 4 } }, 'Confirm PIN'),
2206
- h('input', { type: 'password', value: transferPinSetup.confirm, maxLength: 6, placeholder: '\u2022\u2022\u2022\u2022\u2022\u2022', style: { width: '100%', padding: '10px 14px', fontSize: 20, textAlign: 'center', letterSpacing: 8, fontFamily: 'var(--font-mono)', border: '2px solid var(--border)', borderRadius: 8, background: 'var(--bg-secondary)' },
2207
- onChange: function(e) { setTransferPinSetup(Object.assign({}, transferPinSetup, { confirm: e.target.value.replace(/\D/g, '').slice(0, 6) })); }
2208
- })
2209
- ),
2210
- transferPinSetup.pin.length === 6 && transferPinSetup.confirm.length === 6 && transferPinSetup.pin !== transferPinSetup.confirm && h('div', { style: { fontSize: 12, color: '#ef4444', marginBottom: 8 } }, 'PINs do not match'),
2211
- h('div', { style: { display: 'flex', gap: 8, marginTop: 16 } },
2212
- h('button', { className: 'btn btn-secondary', onClick: function() { setTransferVerifyStep('locked'); } }, 'Back'),
2213
- h('button', { className: 'btn btn-primary', disabled: transferPinSetup.pin.length !== 6 || transferPinSetup.pin !== transferPinSetup.confirm || transferLoading, onClick: async function() {
2214
- setTransferLoading(true);
2215
- try {
2216
- var res = await apiCall('/polymarket/' + selectedAgent + '/wallet/setup-pin', { method: 'POST', body: JSON.stringify({ pin: transferPinSetup.pin }) });
2217
- if (res.ok) {
2218
- toast('Wallet PIN created successfully! You can now use it to unlock transfers.', 'success');
2219
- setWalletSecurity(Object.assign({}, walletSecurity, { hasPin: true }));
2220
- // Auto-unlock after setup
2221
- setTransferUnlocked(true);
2222
- var expiry = Date.now() + 9 * 60 * 1000;
2223
- setTransferUnlockExpiry(expiry);
2224
- setTransferVerifyStep('unlocked');
2225
- } else { toast(res.error || 'Failed to set PIN', 'error'); }
2226
- } catch (e) { toast(e.message || 'Setup failed', 'error'); }
2227
- setTransferLoading(false);
2228
- } }, transferLoading ? 'Setting up...' : 'Create PIN')
2229
- )
2230
- ),
2329
+ transferVerifyStep === 'setup_pin' && (function() {
2330
+ var pinVal = transferPinSetup.pin;
2331
+ var confVal = transferPinSetup.confirm;
2332
+ var isTrivial = pinVal.length === 6 && (/^(.)\1{5}$/.test(pinVal) || pinVal === '123456' || pinVal === '654321');
2333
+ var mismatch = pinVal.length === 6 && confVal.length === 6 && pinVal !== confVal;
2334
+ var canSubmit = pinVal.length === 6 && confVal.length === 6 && pinVal === confVal && !isTrivial && !transferLoading;
2335
+ return h('div', null,
2336
+ h('h3', { style: { marginBottom: 12 } }, 'Create Wallet PIN'),
2337
+ h('p', { style: { fontSize: 12, color: 'var(--text-muted)', marginBottom: 16 } }, 'Set a 6-digit PIN for your wallet. This PIN is encrypted and stored securely. You\'ll need it to authorize fund transfers.'),
2338
+ h('div', { style: { marginBottom: 12 } },
2339
+ h('label', { style: { fontSize: 12, fontWeight: 600, display: 'block', marginBottom: 4 } }, 'PIN (6 digits)'),
2340
+ h('input', { type: 'password', inputMode: 'numeric', pattern: '[0-9]*', value: pinVal, maxLength: 6, placeholder: '\u2022\u2022\u2022\u2022\u2022\u2022', autoComplete: 'new-password', style: { width: '100%', padding: '10px 14px', fontSize: 20, textAlign: 'center', letterSpacing: 8, fontFamily: 'var(--font-mono)', border: '2px solid ' + (isTrivial ? '#ef4444' : 'var(--border)'), borderRadius: 8, background: 'var(--bg-secondary)' },
2341
+ onInput: function(e) { setTransferPinSetup(Object.assign({}, transferPinSetup, { pin: e.target.value.replace(/\D/g, '').slice(0, 6) })); }
2342
+ }),
2343
+ isTrivial && h('div', { style: { fontSize: 11, color: '#ef4444', marginTop: 4 } }, 'PIN is too simple (e.g. 111111, 123456). Choose a less predictable PIN.')
2344
+ ),
2345
+ h('div', { style: { marginBottom: 12 } },
2346
+ h('label', { style: { fontSize: 12, fontWeight: 600, display: 'block', marginBottom: 4 } }, 'Confirm PIN'),
2347
+ h('input', { type: 'password', inputMode: 'numeric', pattern: '[0-9]*', value: confVal, maxLength: 6, placeholder: '\u2022\u2022\u2022\u2022\u2022\u2022', autoComplete: 'new-password', style: { width: '100%', padding: '10px 14px', fontSize: 20, textAlign: 'center', letterSpacing: 8, fontFamily: 'var(--font-mono)', border: '2px solid ' + (mismatch ? '#ef4444' : 'var(--border)'), borderRadius: 8, background: 'var(--bg-secondary)' },
2348
+ onInput: function(e) { setTransferPinSetup(Object.assign({}, transferPinSetup, { confirm: e.target.value.replace(/\D/g, '').slice(0, 6) })); }
2349
+ }),
2350
+ mismatch && h('div', { style: { fontSize: 11, color: '#ef4444', marginTop: 4 } }, 'PINs do not match')
2351
+ ),
2352
+ h('div', { style: { display: 'flex', gap: 8, marginTop: 16 } },
2353
+ h('button', { className: 'btn btn-secondary', onClick: function() { setTransferVerifyStep('locked'); } }, 'Back'),
2354
+ h('button', { className: 'btn btn-primary', disabled: !canSubmit, onClick: async function() {
2355
+ setTransferLoading(true);
2356
+ try {
2357
+ var res = await apiCall('/polymarket/' + selectedAgent + '/wallet/setup-pin', { method: 'POST', body: JSON.stringify({ pin: pinVal }) });
2358
+ if (res.ok) {
2359
+ toast('Wallet PIN created successfully! You can now use it to unlock transfers.', 'success');
2360
+ setWalletSecurity(Object.assign({}, walletSecurity, { hasPin: true }));
2361
+ // Auto-unlock after setup
2362
+ setTransferUnlocked(true);
2363
+ var expiry = Date.now() + 9 * 60 * 1000;
2364
+ setTransferUnlockExpiry(expiry);
2365
+ setTransferVerifyStep('unlocked');
2366
+ } else { toast(res.error || 'Failed to set PIN', 'error'); }
2367
+ } catch (e) { toast(e.message || 'Setup failed', 'error'); }
2368
+ setTransferLoading(false);
2369
+ } }, transferLoading ? 'Setting up...' : 'Create PIN')
2370
+ )
2371
+ );
2372
+ })(),
2231
2373
 
2232
2374
  // Step: Unlocked — show transfer form
2233
2375
  transferVerifyStep === 'unlocked' && h('div', null,
2234
2376
  h('div', { style: { padding: '8px 12px', background: 'rgba(16,185,129,0.08)', borderRadius: 8, border: '1px solid rgba(16,185,129,0.2)', marginBottom: 16, fontSize: 12, display: 'flex', alignItems: 'center', justifyContent: 'space-between' } },
2235
- h('span', null, '\uD83D\uDD13 Transfer window open'),
2377
+ h('span', { style: { display: 'flex', alignItems: 'center', gap: 6 } }, I('check'), ' Transfer window open'),
2236
2378
  transferUnlockExpiry && h('span', { style: { fontWeight: 600, color: '#10b981' } },
2237
2379
  Math.max(0, Math.ceil((transferUnlockExpiry - Date.now()) / 60000)) + ' min remaining'
2238
2380
  )
@@ -2246,7 +2388,7 @@ export function PolymarketPage() {
2246
2388
  h('option', { value: '' }, 'Select whitelisted address...'),
2247
2389
  whitelist.map(function(a) { return h('option', { key: a.address, value: a.address }, a.label + ' (' + a.address.slice(0,6) + '...' + a.address.slice(-4) + ')'); })
2248
2390
  )
2249
- : h('div', { style: { fontSize: 12, color: '#f59e0b', padding: '8px 12px', background: 'rgba(245,158,11,0.08)', borderRadius: 6 } }, '\u26A0 No whitelisted addresses. Add one in the Withdrawal Addresses section first.')
2391
+ : h('div', { style: { fontSize: 12, color: '#f59e0b', padding: '8px 12px', background: 'rgba(245,158,11,0.08)', borderRadius: 6, display: 'flex', alignItems: 'center', gap: 6 } }, I('warning'), ' No whitelisted addresses. Add one in the Withdrawal Addresses section first.')
2250
2392
  ),
2251
2393
  h('div', { style: { display: 'flex', gap: 8, marginBottom: 12 } },
2252
2394
  h('div', { style: { flex: 1 } },
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  provision,
9
9
  runSetupWizard
10
- } from "./chunk-QHC352XV.js";
10
+ } from "./chunk-RU77F65Q.js";
11
11
  import {
12
12
  AgenticMailManager,
13
13
  GoogleEmailProvider,
@@ -28,8 +28,8 @@ import {
28
28
  executeTool,
29
29
  runAgentLoop,
30
30
  toolsToDefinitions
31
- } from "./chunk-I2HLHSPB.js";
32
- import "./chunk-RBRZW63F.js";
31
+ } from "./chunk-2XZE5NT3.js";
32
+ import "./chunk-CFR5OSMI.js";
33
33
  import {
34
34
  ValidationError,
35
35
  auditLogger,
@@ -43,7 +43,7 @@ import {
43
43
  requireRole,
44
44
  securityHeaders,
45
45
  validate
46
- } from "./chunk-KNQ2MAWJ.js";
46
+ } from "./chunk-QKKTNPGV.js";
47
47
  import "./chunk-DJBCRQTD.js";
48
48
  import {
49
49
  PROVIDER_REGISTRY,
@@ -83,7 +83,7 @@ import {
83
83
  init_storage_manager,
84
84
  init_tenant,
85
85
  init_workforce
86
- } from "./chunk-IXTGONDB.js";
86
+ } from "./chunk-NHLOKTUV.js";
87
87
  import "./chunk-3UAFHUEC.js";
88
88
  import {
89
89
  ENGINE_TABLES,
@@ -103,7 +103,7 @@ import {
103
103
  import "./chunk-AF3WSNVX.js";
104
104
  import "./chunk-74ZCQKYU.js";
105
105
  import "./chunk-ZNLABJCS.js";
106
- import "./chunk-C6JP5NR6.js";
106
+ import "./chunk-FQWJMPKW.js";
107
107
  import "./chunk-WYDVMFGJ.js";
108
108
  import {
109
109
  BUILTIN_SKILLS,
@@ -117,18 +117,18 @@ import {
117
117
  init_agent_config,
118
118
  init_deployer
119
119
  } from "./chunk-E6B4W3WG.js";
120
- import "./chunk-6PUGRYBU.js";
120
+ import "./chunk-5F5DGV63.js";
121
121
  import "./chunk-ZB3VC2MR.js";
122
122
  import "./chunk-N5C3PJZC.js";
123
- import "./chunk-QHRJSIAG.js";
123
+ import "./chunk-GLAN2JBA.js";
124
124
  import {
125
125
  SecureVault,
126
126
  init_vault
127
127
  } from "./chunk-WUAWWKTN.js";
128
- import "./chunk-X2ZHRKPL.js";
129
- import "./chunk-YHOMKT3Q.js";
130
- import "./chunk-WH37MNM7.js";
131
- import "./chunk-V7Z6WGHI.js";
128
+ import "./chunk-IN7VIORK.js";
129
+ import "./chunk-ZMKVEJKR.js";
130
+ import "./chunk-CVFIM72Q.js";
131
+ import "./chunk-DJ7LHRL7.js";
132
132
  import {
133
133
  CircuitBreaker,
134
134
  CircuitOpenError,
@@ -0,0 +1,15 @@
1
+ import {
2
+ batchScreen,
3
+ fullAnalysis,
4
+ portfolioReview,
5
+ quickAnalysis
6
+ } from "./chunk-44VXWYPE.js";
7
+ import "./chunk-ZMKVEJKR.js";
8
+ import "./chunk-CVFIM72Q.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ batchScreen,
12
+ fullAnalysis,
13
+ portfolioReview,
14
+ quickAnalysis
15
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ batchScreen,
3
+ fullAnalysis,
4
+ portfolioReview,
5
+ quickAnalysis
6
+ } from "./chunk-AO556OXZ.js";
7
+ import "./chunk-BPF5DKUM.js";
8
+ import "./chunk-E5H64U5H.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ batchScreen,
12
+ fullAnalysis,
13
+ portfolioReview,
14
+ quickAnalysis
15
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ batchScreen,
3
+ fullAnalysis,
4
+ portfolioReview,
5
+ quickAnalysis
6
+ } from "./chunk-IN7VIORK.js";
7
+ import "./chunk-ZMKVEJKR.js";
8
+ import "./chunk-CVFIM72Q.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ batchScreen,
12
+ fullAnalysis,
13
+ portfolioReview,
14
+ quickAnalysis
15
+ };