autoglm-gui 1.4.1__py3-none-any.whl → 1.5.1__py3-none-any.whl

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 (135) hide show
  1. AutoGLM_GUI/__init__.py +11 -0
  2. AutoGLM_GUI/__main__.py +26 -4
  3. AutoGLM_GUI/actions/__init__.py +6 -0
  4. phone_agent/actions/handler_ios.py → AutoGLM_GUI/actions/handler.py +30 -112
  5. AutoGLM_GUI/actions/types.py +15 -0
  6. {phone_agent → AutoGLM_GUI}/adb/__init__.py +25 -23
  7. {phone_agent → AutoGLM_GUI}/adb/connection.py +5 -40
  8. {phone_agent → AutoGLM_GUI}/adb/device.py +12 -94
  9. {phone_agent → AutoGLM_GUI}/adb/input.py +6 -47
  10. AutoGLM_GUI/adb/screenshot.py +11 -0
  11. {phone_agent/config → AutoGLM_GUI/adb}/timing.py +1 -1
  12. AutoGLM_GUI/adb_plus/keyboard_installer.py +4 -2
  13. AutoGLM_GUI/adb_plus/screenshot.py +22 -1
  14. AutoGLM_GUI/adb_plus/serial.py +38 -20
  15. AutoGLM_GUI/adb_plus/touch.py +4 -9
  16. AutoGLM_GUI/agents/__init__.py +43 -12
  17. AutoGLM_GUI/agents/events.py +19 -0
  18. AutoGLM_GUI/agents/factory.py +31 -38
  19. AutoGLM_GUI/agents/glm/__init__.py +7 -0
  20. AutoGLM_GUI/agents/glm/agent.py +297 -0
  21. AutoGLM_GUI/agents/glm/message_builder.py +81 -0
  22. AutoGLM_GUI/agents/glm/parser.py +110 -0
  23. {phone_agent/config → AutoGLM_GUI/agents/glm}/prompts_en.py +7 -9
  24. {phone_agent/config → AutoGLM_GUI/agents/glm}/prompts_zh.py +18 -25
  25. AutoGLM_GUI/agents/mai/__init__.py +28 -0
  26. AutoGLM_GUI/agents/mai/agent.py +408 -0
  27. AutoGLM_GUI/agents/mai/parser.py +254 -0
  28. AutoGLM_GUI/agents/mai/prompts.py +103 -0
  29. AutoGLM_GUI/agents/mai/traj_memory.py +91 -0
  30. AutoGLM_GUI/agents/protocols.py +12 -8
  31. AutoGLM_GUI/agents/stream_runner.py +193 -0
  32. AutoGLM_GUI/api/__init__.py +40 -21
  33. AutoGLM_GUI/api/agents.py +181 -239
  34. AutoGLM_GUI/api/control.py +9 -6
  35. AutoGLM_GUI/api/devices.py +102 -12
  36. AutoGLM_GUI/api/history.py +104 -0
  37. AutoGLM_GUI/api/layered_agent.py +67 -15
  38. AutoGLM_GUI/api/media.py +64 -1
  39. AutoGLM_GUI/api/scheduled_tasks.py +98 -0
  40. AutoGLM_GUI/config.py +81 -0
  41. AutoGLM_GUI/config_manager.py +68 -51
  42. AutoGLM_GUI/device_manager.py +248 -29
  43. AutoGLM_GUI/device_protocol.py +1 -1
  44. AutoGLM_GUI/devices/adb_device.py +5 -10
  45. AutoGLM_GUI/devices/mock_device.py +4 -2
  46. AutoGLM_GUI/devices/remote_device.py +8 -3
  47. AutoGLM_GUI/history_manager.py +164 -0
  48. AutoGLM_GUI/model/__init__.py +5 -0
  49. AutoGLM_GUI/model/message_builder.py +69 -0
  50. AutoGLM_GUI/model/types.py +24 -0
  51. AutoGLM_GUI/models/__init__.py +10 -0
  52. AutoGLM_GUI/models/history.py +140 -0
  53. AutoGLM_GUI/models/scheduled_task.py +71 -0
  54. AutoGLM_GUI/parsers/__init__.py +22 -0
  55. AutoGLM_GUI/parsers/base.py +50 -0
  56. AutoGLM_GUI/parsers/phone_parser.py +58 -0
  57. AutoGLM_GUI/phone_agent_manager.py +62 -396
  58. AutoGLM_GUI/platform_utils.py +26 -0
  59. AutoGLM_GUI/prompt_config.py +15 -0
  60. AutoGLM_GUI/prompts/__init__.py +32 -0
  61. AutoGLM_GUI/scheduler_manager.py +350 -0
  62. AutoGLM_GUI/schemas.py +246 -72
  63. AutoGLM_GUI/scrcpy_stream.py +142 -24
  64. AutoGLM_GUI/socketio_server.py +100 -27
  65. AutoGLM_GUI/static/assets/{about-_XNhzQZX.js → about-CfwX1Cmc.js} +1 -1
  66. AutoGLM_GUI/static/assets/alert-dialog-CtGlN2IJ.js +1 -0
  67. AutoGLM_GUI/static/assets/chat-BYa-foUI.js +129 -0
  68. AutoGLM_GUI/static/assets/circle-alert-t08bEMPO.js +1 -0
  69. AutoGLM_GUI/static/assets/dialog-FNwZJFwk.js +45 -0
  70. AutoGLM_GUI/static/assets/eye-D0UPWCWC.js +1 -0
  71. AutoGLM_GUI/static/assets/history-CRo95B7i.js +1 -0
  72. AutoGLM_GUI/static/assets/{index-Cy8TmmHV.js → index-BaLMSqd3.js} +1 -1
  73. AutoGLM_GUI/static/assets/index-CTHbFvKl.js +11 -0
  74. AutoGLM_GUI/static/assets/index-CV7jGxGm.css +1 -0
  75. AutoGLM_GUI/static/assets/label-DJFevVmr.js +1 -0
  76. AutoGLM_GUI/static/assets/logs-RW09DyYY.js +1 -0
  77. AutoGLM_GUI/static/assets/popover--JTJrE5v.js +1 -0
  78. AutoGLM_GUI/static/assets/scheduled-tasks-DTRKsQXF.js +1 -0
  79. AutoGLM_GUI/static/assets/square-pen-CPK_K680.js +1 -0
  80. AutoGLM_GUI/static/assets/textarea-PRmVnWq5.js +1 -0
  81. AutoGLM_GUI/static/assets/workflows-CdcsAoaT.js +1 -0
  82. AutoGLM_GUI/static/index.html +2 -2
  83. AutoGLM_GUI/types.py +17 -0
  84. {autoglm_gui-1.4.1.dist-info → autoglm_gui-1.5.1.dist-info}/METADATA +179 -130
  85. autoglm_gui-1.5.1.dist-info/RECORD +118 -0
  86. AutoGLM_GUI/agents/mai_adapter.py +0 -627
  87. AutoGLM_GUI/api/dual_model.py +0 -317
  88. AutoGLM_GUI/device_adapter.py +0 -263
  89. AutoGLM_GUI/dual_model/__init__.py +0 -53
  90. AutoGLM_GUI/dual_model/decision_model.py +0 -664
  91. AutoGLM_GUI/dual_model/dual_agent.py +0 -917
  92. AutoGLM_GUI/dual_model/protocols.py +0 -354
  93. AutoGLM_GUI/dual_model/vision_model.py +0 -442
  94. AutoGLM_GUI/mai_ui_adapter/agent_wrapper.py +0 -291
  95. AutoGLM_GUI/phone_agent_patches.py +0 -147
  96. AutoGLM_GUI/static/assets/chat-DwJpiAWf.js +0 -126
  97. AutoGLM_GUI/static/assets/dialog-B3uW4T8V.js +0 -45
  98. AutoGLM_GUI/static/assets/index-Cpv2gSF1.css +0 -1
  99. AutoGLM_GUI/static/assets/index-UYYauTly.js +0 -12
  100. AutoGLM_GUI/static/assets/workflows-Du_de-dt.js +0 -1
  101. autoglm_gui-1.4.1.dist-info/RECORD +0 -117
  102. mai_agent/base.py +0 -137
  103. mai_agent/mai_grounding_agent.py +0 -263
  104. mai_agent/mai_naivigation_agent.py +0 -526
  105. mai_agent/prompt.py +0 -148
  106. mai_agent/unified_memory.py +0 -67
  107. mai_agent/utils.py +0 -73
  108. phone_agent/__init__.py +0 -12
  109. phone_agent/actions/__init__.py +0 -5
  110. phone_agent/actions/handler.py +0 -400
  111. phone_agent/adb/screenshot.py +0 -108
  112. phone_agent/agent.py +0 -253
  113. phone_agent/agent_ios.py +0 -277
  114. phone_agent/config/__init__.py +0 -53
  115. phone_agent/config/apps_harmonyos.py +0 -256
  116. phone_agent/config/apps_ios.py +0 -339
  117. phone_agent/config/prompts.py +0 -80
  118. phone_agent/device_factory.py +0 -166
  119. phone_agent/hdc/__init__.py +0 -53
  120. phone_agent/hdc/connection.py +0 -384
  121. phone_agent/hdc/device.py +0 -269
  122. phone_agent/hdc/input.py +0 -145
  123. phone_agent/hdc/screenshot.py +0 -127
  124. phone_agent/model/__init__.py +0 -5
  125. phone_agent/model/client.py +0 -290
  126. phone_agent/xctest/__init__.py +0 -47
  127. phone_agent/xctest/connection.py +0 -379
  128. phone_agent/xctest/device.py +0 -472
  129. phone_agent/xctest/input.py +0 -311
  130. phone_agent/xctest/screenshot.py +0 -226
  131. {phone_agent/config → AutoGLM_GUI/adb}/apps.py +0 -0
  132. {phone_agent/config → AutoGLM_GUI}/i18n.py +0 -0
  133. {autoglm_gui-1.4.1.dist-info → autoglm_gui-1.5.1.dist-info}/WHEEL +0 -0
  134. {autoglm_gui-1.4.1.dist-info → autoglm_gui-1.5.1.dist-info}/entry_points.txt +0 -0
  135. {autoglm_gui-1.4.1.dist-info → autoglm_gui-1.5.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./index-CTHbFvKl.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],o=e("circle-alert",c);export{o as C};
@@ -0,0 +1,45 @@
1
+ import{o as ae,r as i,j as u,b as S,G as de,y as G,P as F,E as et,x as tt,A as Y,H as oe,ak as nt,D as _,z as rt,al as at,ao as ot}from"./index-CTHbFvKl.js";const it=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=ae("loader-circle",it);const ct=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],On=ae("trash-2",ct);const st=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lt=ae("x",st),ut=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("rounded-2xl border border-slate-200 bg-white text-slate-950 shadow-sm dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",e),...t}));ut.displayName="Card";const dt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex flex-col space-y-1.5 p-6",e),...t}));dt.displayName="CardHeader";const ft=i.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:S("text-xl font-semibold leading-none tracking-tight",e),...t}));ft.displayName="CardTitle";const vt=i.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:S("text-sm text-slate-500 dark:text-slate-400",e),...t}));vt.displayName="CardDescription";const mt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("p-6 pt-0",e),...t}));mt.displayName="CardContent";const pt=i.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:S("flex items-center p-6 pt-0",e),...t}));pt.displayName="CardFooter";var Z="focusScope.autoFocusOnMount",q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},ht="FocusScope",we=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[c,y]=i.useState(null),h=de(a),m=de(o),f=i.useRef(null),p=G(t,s=>y(s)),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let s=function(E){if(g.paused||!c)return;const C=E.target;c.contains(C)?f.current=C:T(f.current,{select:!0})},d=function(E){if(g.paused||!c)return;const C=E.relatedTarget;C!==null&&(c.contains(C)||T(f.current,{select:!0}))},v=function(E){if(document.activeElement===document.body)for(const w of E)w.removedNodes.length>0&&T(c)};document.addEventListener("focusin",s),document.addEventListener("focusout",d);const b=new MutationObserver(v);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",d),b.disconnect()}}},[r,c,g.paused]),i.useEffect(()=>{if(c){me.add(g);const s=document.activeElement;if(!c.contains(s)){const v=new CustomEvent(Z,fe);c.addEventListener(Z,h),c.dispatchEvent(v),v.defaultPrevented||(gt(wt(xe(c)),{select:!0}),document.activeElement===s&&T(c))}return()=>{c.removeEventListener(Z,h),setTimeout(()=>{const v=new CustomEvent(q,fe);c.addEventListener(q,m),c.dispatchEvent(v),v.defaultPrevented||T(s??document.body,{select:!0}),c.removeEventListener(q,m),me.remove(g)},0)}}},[c,h,m,g]);const x=i.useCallback(s=>{if(!n&&!r||g.paused)return;const d=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,v=document.activeElement;if(d&&v){const b=s.currentTarget,[E,C]=yt(b);E&&C?!s.shiftKey&&v===C?(s.preventDefault(),n&&T(E,{select:!0})):s.shiftKey&&v===E&&(s.preventDefault(),n&&T(C,{select:!0})):v===b&&s.preventDefault()}},[n,r,g.paused]);return u.jsx(F.div,{tabIndex:-1,...l,ref:p,onKeyDown:x})});we.displayName=ht;function gt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(T(r,{select:t}),document.activeElement!==n)return}function yt(e){const t=xe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!bt(n,{upTo:t}))return n}function bt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Et(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Et(e)&&t&&e.select()}}var me=Ct();function Ct(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pe(e,t),e.unshift(t)},remove(t){e=pe(e,t),e[0]?.resume()}}}function pe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wt(e){return e.filter(t=>t.tagName!=="A")}var Q=0;function xt(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??he()),document.body.insertAdjacentElement("beforeend",e[1]??he()),Q++,()=>{Q===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q--}},[])}function he(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function St(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",Nt="with-scroll-bars-hidden",Rt="--removed-body-scroll-bar-size";function J(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dt(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var kt=typeof window<"u"?i.useLayoutEffect:i.useEffect,ge=new WeakMap;function Tt(e,t){var n=Dt(null,function(r){return e.forEach(function(a){return J(a,r)})});return kt(function(){var r=ge.get(n);if(r){var a=new Set(r),o=new Set(e),l=n.current;a.forEach(function(c){o.has(c)||J(c,null)}),o.forEach(function(c){a.has(c)||J(c,l)})}ge.set(n,e)},[e]),n}function At(e){return e}function Pt(e,t){t===void 0&&(t=At);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(o),l=n}var y=function(){var m=l;l=[],m.forEach(o)},h=function(){return Promise.resolve().then(y)};h(),n={push:function(m){l.push(m),h()},filter:function(m){return l=l.filter(m),n}}}};return a}function Ot(e){e===void 0&&(e={});var t=Pt(null);return t.options=R({async:!0,ssr:!1},e),t}var Ne=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,R({},n))};Ne.isSideCarExport=!0;function Mt(e,t){return e.useMedium(t),Ne}var Re=Ot(),ee=function(){},K=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ee,onWheelCapture:ee,onTouchMoveCapture:ee}),a=r[0],o=r[1],l=e.forwardProps,c=e.children,y=e.className,h=e.removeScrollBar,m=e.enabled,f=e.shards,p=e.sideCar,g=e.noRelative,x=e.noIsolation,s=e.inert,d=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,E=e.gapMode,C=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,D=Tt([n,t]),k=R(R({},C),a);return i.createElement(i.Fragment,null,m&&i.createElement(w,{sideCar:Re,removeScrollBar:h,shards:f,noRelative:g,noIsolation:x,inert:s,setCallbacks:o,allowPinchZoom:!!d,lockRef:n,gapMode:E}),l?i.cloneElement(i.Children.only(c),R(R({},k),{ref:D})):i.createElement(b,R({},k,{className:y,ref:D}),c))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var It=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ft(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=It();return t&&e.setAttribute("nonce",t),e}function _t(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ft())&&(_t(t,n),jt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wt=function(){var e=Lt();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Wt(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Bt={left:0,top:0,right:0,gap:0},te=function(e){return parseInt(e||"",10)||0},Ht=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[te(n),te(r),te(a)]},Ut=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Bt;var t=Ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$t=De(),I="data-scroll-locked",Vt=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(Nt,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(c,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(I,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(a,`px;
11
+ padding-top: `).concat(o,`px;
12
+ padding-right: `).concat(l,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(c,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(U,` {
20
+ right: `).concat(c,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat($,` {
24
+ margin-right: `).concat(c,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(U," .").concat(U,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat($," .").concat($,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(I,`] {
36
+ `).concat(Rt,": ").concat(c,`px;
37
+ }
38
+ `)},ye=function(){var e=parseInt(document.body.getAttribute(I)||"0",10);return isFinite(e)?e:0},Gt=function(){i.useEffect(function(){return document.body.setAttribute(I,(ye()+1).toString()),function(){var e=ye()-1;e<=0?document.body.removeAttribute(I):document.body.setAttribute(I,e.toString())}},[])},Kt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Gt();var o=i.useMemo(function(){return Ut(a)},[a]);return i.createElement($t,{styles:Vt(o,!t,a,n?"":"!important")})},re=!1;if(typeof window<"u")try{var L=Object.defineProperty({},"passive",{get:function(){return re=!0,!0}});window.addEventListener("test",L,L),window.removeEventListener("test",L,L)}catch{re=!1}var P=re?{passive:!1}:!1,zt=function(e){return e.tagName==="TEXTAREA"},ke=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zt(e)&&n[t]==="visible")},Xt=function(e){return ke(e,"overflowY")},Yt=function(e){return ke(e,"overflowX")},be=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Te(e,r);if(a){var o=Ae(e,r),l=o[1],c=o[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},qt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Te=function(e,t){return e==="v"?Xt(t):Yt(t)},Ae=function(e,t){return e==="v"?Zt(t):qt(t)},Qt=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jt=function(e,t,n,r,a){var o=Qt(e,window.getComputedStyle(t).direction),l=o*r,c=n.target,y=t.contains(c),h=!1,m=l>0,f=0,p=0;do{if(!c)break;var g=Ae(e,c),x=g[0],s=g[1],d=g[2],v=s-d-o*x;(x||v)&&Te(e,c)&&(f+=v,p+=x);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!y&&c!==document.body||y&&(t.contains(c)||t===c));return(m&&Math.abs(f)<1||!m&&Math.abs(p)<1)&&(h=!0),h},W=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ee=function(e){return[e.deltaX,e.deltaY]},Ce=function(e){return e&&"current"in e?e.current:e},en=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tn=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},nn=0,O=[];function rn(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),a=i.useState(nn++)[0],o=i.useState(De)[0],l=i.useRef(e);i.useEffect(function(){l.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var s=St([e.lockRef.current],(e.shards||[]).map(Ce),!0).filter(Boolean);return s.forEach(function(d){return d.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),s.forEach(function(d){return d.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(s,d){if("touches"in s&&s.touches.length===2||s.type==="wheel"&&s.ctrlKey)return!l.current.allowPinchZoom;var v=W(s),b=n.current,E="deltaX"in s?s.deltaX:b[0]-v[0],C="deltaY"in s?s.deltaY:b[1]-v[1],w,D=s.target,k=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in s&&k==="h"&&D.type==="range")return!1;var le=window.getSelection(),X=le&&le.anchorNode,Je=X?X===D||X.contains(D):!1;if(Je)return!1;var j=be(k,D);if(!j)return!0;if(j?w=k:(w=k==="v"?"h":"v",j=be(k,D)),!j)return!1;if(!r.current&&"changedTouches"in s&&(E||C)&&(r.current=w),!w)return!0;var ue=r.current||w;return Jt(ue,d,s,ue==="h"?E:C)},[]),y=i.useCallback(function(s){var d=s;if(!(!O.length||O[O.length-1]!==o)){var v="deltaY"in d?Ee(d):W(d),b=t.current.filter(function(w){return w.name===d.type&&(w.target===d.target||d.target===w.shadowParent)&&en(w.delta,v)})[0];if(b&&b.should){d.cancelable&&d.preventDefault();return}if(!b){var E=(l.current.shards||[]).map(Ce).filter(Boolean).filter(function(w){return w.contains(d.target)}),C=E.length>0?c(d,E[0]):!l.current.noIsolation;C&&d.cancelable&&d.preventDefault()}}},[]),h=i.useCallback(function(s,d,v,b){var E={name:s,delta:d,target:v,should:b,shadowParent:an(v)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(C){return C!==E})},1)},[]),m=i.useCallback(function(s){n.current=W(s),r.current=void 0},[]),f=i.useCallback(function(s){h(s.type,Ee(s),s.target,c(s,e.lockRef.current))},[]),p=i.useCallback(function(s){h(s.type,W(s),s.target,c(s,e.lockRef.current))},[]);i.useEffect(function(){return O.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",y,P),document.addEventListener("touchmove",y,P),document.addEventListener("touchstart",m,P),function(){O=O.filter(function(s){return s!==o}),document.removeEventListener("wheel",y,P),document.removeEventListener("touchmove",y,P),document.removeEventListener("touchstart",m,P)}},[]);var g=e.removeScrollBar,x=e.inert;return i.createElement(i.Fragment,null,x?i.createElement(o,{styles:tn(a)}):null,g?i.createElement(Kt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function an(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const on=Mt(Re,rn);var Pe=i.forwardRef(function(e,t){return i.createElement(K,R({},e,{ref:t,sideCar:on}))});Pe.classNames=K.classNames;var cn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},M=new WeakMap,B=new WeakMap,H={},ne=0,Oe=function(e){return e&&(e.host||Oe(e.parentNode))},sn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Oe(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ln=function(e,t,n,r){var a=sn(t,Array.isArray(e)?e:[e]);H[n]||(H[n]=new WeakMap);var o=H[n],l=[],c=new Set,y=new Set(a),h=function(f){!f||c.has(f)||(c.add(f),h(f.parentNode))};a.forEach(h);var m=function(f){!f||y.has(f)||Array.prototype.forEach.call(f.children,function(p){if(c.has(p))m(p);else try{var g=p.getAttribute(r),x=g!==null&&g!=="false",s=(M.get(p)||0)+1,d=(o.get(p)||0)+1;M.set(p,s),o.set(p,d),l.push(p),s===1&&x&&B.set(p,!0),d===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return m(t),c.clear(),ne++,function(){l.forEach(function(f){var p=M.get(f)-1,g=o.get(f)-1;M.set(f,p),o.set(f,g),p||(B.has(f)||f.removeAttribute(r),B.delete(f)),g||f.removeAttribute(n)}),ne--,ne||(M=new WeakMap,M=new WeakMap,B=new WeakMap,H={})}},un=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=cn(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),ln(r,a,n,"aria-hidden")):function(){return null}},z="Dialog",[Me]=tt(z),[dn,N]=Me(z),Ie=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=i.useRef(null),y=i.useRef(null),[h,m]=et({prop:r,defaultProp:a??!1,onChange:o,caller:z});return u.jsx(dn,{scope:t,triggerRef:c,contentRef:y,contentId:Y(),titleId:Y(),descriptionId:Y(),open:h,onOpenChange:m,onOpenToggle:i.useCallback(()=>m(f=>!f),[m]),modal:l,children:n})};Ie.displayName=z;var Fe="DialogTrigger",fn=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=N(Fe,n),o=G(t,a.triggerRef);return u.jsx(F.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":se(a.open),...r,ref:o,onClick:_(e.onClick,a.onOpenToggle)})});fn.displayName=Fe;var ie="DialogPortal",[vn,_e]=Me(ie,{forceMount:void 0}),je=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=N(ie,t);return u.jsx(vn,{scope:t,forceMount:n,children:i.Children.map(r,l=>u.jsx(oe,{present:n||o.open,children:u.jsx(nt,{asChild:!0,container:a,children:l})}))})};je.displayName=ie;var V="DialogOverlay",Le=i.forwardRef((e,t)=>{const n=_e(V,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=N(V,e.__scopeDialog);return o.modal?u.jsx(oe,{present:r||o.open,children:u.jsx(pn,{...a,ref:t})}):null});Le.displayName=V;var mn=rt("DialogOverlay.RemoveScroll"),pn=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=N(V,n);return u.jsx(Pe,{as:mn,allowPinchZoom:!0,shards:[a.contentRef],children:u.jsx(F.div,{"data-state":se(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),A="DialogContent",We=i.forwardRef((e,t)=>{const n=_e(A,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=N(A,e.__scopeDialog);return u.jsx(oe,{present:r||o.open,children:o.modal?u.jsx(hn,{...a,ref:t}):u.jsx(gn,{...a,ref:t})})});We.displayName=A;var hn=i.forwardRef((e,t)=>{const n=N(A,e.__scopeDialog),r=i.useRef(null),a=G(t,n.contentRef,r);return i.useEffect(()=>{const o=r.current;if(o)return un(o)},[]),u.jsx(Be,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:_(e.onFocusOutside,o=>o.preventDefault())})}),gn=i.forwardRef((e,t)=>{const n=N(A,e.__scopeDialog),r=i.useRef(!1),a=i.useRef(!1);return u.jsx(Be,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),Be=i.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,c=N(A,n),y=i.useRef(null),h=G(t,y);return xt(),u.jsxs(u.Fragment,{children:[u.jsx(we,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:u.jsx(at,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":se(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(yn,{titleId:c.titleId}),u.jsx(En,{contentRef:y,descriptionId:c.descriptionId})]})]})}),ce="DialogTitle",He=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=N(ce,n);return u.jsx(F.h2,{id:a.titleId,...r,ref:t})});He.displayName=ce;var Ue="DialogDescription",$e=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=N(Ue,n);return u.jsx(F.p,{id:a.descriptionId,...r,ref:t})});$e.displayName=Ue;var Ve="DialogClose",Ge=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=N(Ve,n);return u.jsx(F.button,{type:"button",...r,ref:t,onClick:_(e.onClick,()=>a.onOpenChange(!1))})});Ge.displayName=Ve;function se(e){return e?"open":"closed"}var Ke="DialogTitleWarning",[Mn,ze]=ot(Ke,{contentName:A,titleName:ce,docsSlug:"dialog"}),yn=({titleId:e})=>{const t=ze(Ke),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bn="DialogDescriptionWarning",En=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ze(bn).contentName}}.`;return i.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Cn=Ie,wn=je,Xe=Le,Ye=We,Ze=He,qe=$e,xn=Ge;const In=Cn,Sn=wn,Qe=i.forwardRef(({className:e,...t},n)=>u.jsx(Xe,{ref:n,className:S("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Qe.displayName=Xe.displayName;const Nn=i.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Sn,{children:[u.jsx(Qe,{}),u.jsxs(Ye,{ref:r,className:S("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg max-h-[90vh] translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-200 bg-white p-6 shadow-lg duration-200 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",e),...n,children:[t,u.jsxs(xn,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[#1d9bf0] focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 data-[state=open]:text-slate-500 dark:ring-offset-slate-950 dark:focus:ring-[#1d9bf0] dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-400",children:[u.jsx(lt,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nn.displayName=Ye.displayName;const Rn=({className:e,...t})=>u.jsx("div",{className:S("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Rn.displayName="DialogHeader";const Dn=({className:e,...t})=>u.jsx("div",{className:S("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Dn.displayName="DialogFooter";const kn=i.forwardRef(({className:e,...t},n)=>u.jsx(Ze,{ref:n,className:S("text-lg font-semibold leading-none tracking-tight",e),...t}));kn.displayName=Ze.displayName;const Tn=i.forwardRef(({className:e,...t},n)=>u.jsx(qe,{ref:n,className:S("text-sm text-slate-500 dark:text-slate-400",e),...t}));Tn.displayName=qe.displayName;export{ut as C,In as D,we as F,Pn as L,Pe as R,On as T,dt as a,ft as b,mt as c,Nn as d,Rn as e,kn as f,Dn as g,Tn as h,un as i,xt as u};
@@ -0,0 +1 @@
1
+ import{o as c}from"./index-CTHbFvKl.js";const e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n=c("chevron-right",e);const o=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",o);export{n as C,r as E};
@@ -0,0 +1 @@
1
+ import{o as K,u as de,r,p as xe,j as e,B as h,f as m,C as E,g as he,q as me,s as ge}from"./index-CTHbFvKl.js";import{T as F,L as H,C as ue,c as pe,D as je,d as fe,e as ye,f as Ne}from"./dialog-FNwZJFwk.js";import{S as ke,a as be,b as ve,c as we,d as R,A as z,e as B,f as V,g as q,h as I,i as J,j as U,k as X}from"./alert-dialog-CtGlN2IJ.js";import{C as Y,a as G,b as De}from"./popover--JTJrE5v.js";import{E as Se,C as Ce}from"./eye-D0UPWCWC.js";const Pe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Le=K("bot",Pe);const Ae=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_e=K("user",Ae);function Fe(){const t=de(),[N,Q]=r.useState([]),[n,k]=r.useState(""),[o,x]=r.useState([]),[W,b]=r.useState(!1),[v,w]=r.useState(!1),[D,g]=r.useState(0),[S,u]=r.useState(0),[Z,p]=r.useState(!1),[ee,j]=r.useState(!1),[f,C]=r.useState(null),[se,P]=r.useState(!1),[i,te]=r.useState(null),[y,L]=r.useState(new Set),ae=20;r.useEffect(()=>{(async()=>{try{const a=await he();Q(a),a.length>0&&!n&&k(a[0].serial)}catch(a){console.error("Failed to load devices:",a)}})()},[n]);const A=r.useCallback(async(s,a=!0)=>{if(s)try{a?(b(!0),u(0)):w(!0);const l=a?0:S,c=await xe(s,ae,l);x(a?c.records:d=>[...d,...c.records]),g(c.total),u(l+c.records.length)}catch(l){console.error("Failed to load history:",l)}finally{b(!1),w(!1)}},[S]);r.useEffect(()=>{n&&A(n,!0)},[n]);const le=()=>{n&&o.length<D&&A(n,!1)},re=async()=>{if(n){try{await me(n),x([]),g(0),u(0)}catch(s){console.error("Failed to clear history:",s)}p(!1)}},ne=async()=>{if(!(!n||!f)){try{await ge(n,f),x(s=>s.filter(a=>a.id!==f)),g(s=>s-1)}catch(s){console.error("Failed to delete record:",s)}j(!1),C(null)}},_=s=>{te(s);const a=new Set;s.messages.forEach(l=>{l.step!==null&&l.step!==void 0&&a.add(l.step)}),L(a),P(!0)},ie=s=>{L(a=>{const l=new Set(a);return l.has(s)?l.delete(s):l.add(s),l})},M=s=>s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}min`,ce=s=>{const a=new Date(s),l=new Date,c=a.toDateString()===l.toDateString(),d=new Date(l);d.setDate(d.getDate()-1);const oe=a.toDateString()===d.toDateString(),$=a.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return c?`${t.history.today} ${$}`:oe?`${t.history.yesterday} ${$}`:a.toLocaleDateString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},T=s=>({chat:t.historyPage.source.chat,layered:t.historyPage.source.layered,scheduled:t.historyPage.source.scheduled})[s]||s,O=s=>{switch(s){case"chat":return"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300";case"layered":return"bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-300";case"scheduled":return"bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-300";default:return"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}};return e.jsxs("div",{className:"container mx-auto p-6 max-w-4xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:t.historyPage.title}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(ke,{value:n,onValueChange:k,children:[e.jsx(be,{className:"w-[200px]",children:e.jsx(ve,{placeholder:t.historyPage.selectDevice})}),e.jsx(we,{children:N.length===0?e.jsx(R,{value:"_none",disabled:!0,children:t.historyPage.noDevices}):N.map(s=>e.jsx(R,{value:s.serial,children:s.model||s.serial},s.serial))})]}),o.length>0&&e.jsxs(h,{variant:"destructive",size:"sm",onClick:()=>p(!0),children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),t.historyPage.clearAll]})]})]}),W?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(H,{className:"w-8 h-8 animate-spin text-slate-400"})}):o.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.noRecords}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:t.historyPage.noRecordsDesc})]}):e.jsxs("div",{className:"space-y-4",children:[o.map(s=>e.jsx(ue,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>_(s),children:e.jsx(pe,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100 line-clamp-2 mb-2",children:s.task_text}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 line-clamp-2 mb-3",children:s.final_message}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.success?e.jsxs(m,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700",children:[e.jsx(Y,{className:"w-3 h-3 mr-1"}),t.historyPage.success]}):e.jsxs(m,{variant:"outline",className:"text-red-600 border-red-300 dark:text-red-400 dark:border-red-700",children:[e.jsx(G,{className:"w-3 h-3 mr-1"}),t.historyPage.failed]}),e.jsxs(m,{className:O(s.source),children:[T(s.source),s.source_detail&&`: ${s.source_detail}`]}),s.steps>0&&e.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:t.historyPage.steps.replace("{count}",String(s.steps))}),e.jsxs("span",{className:"text-slate-500 dark:text-slate-400 flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(s.duration_ms)]}),e.jsx("span",{className:"text-slate-400 dark:text-slate-500",children:ce(s.start_time)})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-blue-500",onClick:a=>{a.stopPropagation(),_(s)},children:e.jsx(Se,{className:"w-4 h-4"})}),e.jsx(h,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-red-500",onClick:a=>{a.stopPropagation(),C(s.id),j(!0)},children:e.jsx(F,{className:"w-4 h-4"})})]})]})})},s.id)),o.length<D&&e.jsx("div",{className:"text-center py-4",children:e.jsx(h,{variant:"outline",onClick:le,disabled:v,children:v?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),t.historyPage.loading]}):t.historyPage.loadMore})})]}),e.jsx(z,{open:Z,onOpenChange:p,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.historyPage.clearAll}),e.jsx(I,{children:t.historyPage.clearAllConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:re,children:t.common.confirm})]})]})}),e.jsx(z,{open:ee,onOpenChange:j,children:e.jsxs(B,{children:[e.jsxs(V,{children:[e.jsx(q,{children:t.common.delete}),e.jsx(I,{children:t.historyPage.deleteConfirm})]}),e.jsxs(J,{children:[e.jsx(U,{children:t.common.cancel}),e.jsx(X,{onClick:ne,children:t.common.confirm})]})]})}),e.jsx(je,{open:se,onOpenChange:P,children:e.jsxs(fe,{className:"max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[e.jsx(ye,{className:"flex-shrink-0",children:e.jsxs(Ne,{className:"flex items-center gap-2",children:[i?.success?e.jsx(Y,{className:"w-5 h-5 text-green-500"}):e.jsx(G,{className:"w-5 h-5 text-red-500"}),t.historyPage.detailTitle||"对话详情"]})}),i&&e.jsx("div",{className:"overflow-y-auto max-h-[calc(80vh-120px)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-900 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:t.historyPage.taskLabel||"任务"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.task_text})]}),e.jsx("div",{className:"space-y-3",children:i.messages.length>0?i.messages.map((s,a)=>e.jsx("div",{className:"space-y-2",children:s.role==="user"?e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center flex-shrink-0",children:e.jsx(_e,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),e.jsx("div",{className:"flex-1 p-3 bg-blue-50 dark:bg-blue-900/30 rounded-lg",children:e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:s.content})})]}):e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-100 dark:bg-emerald-900 flex items-center justify-center flex-shrink-0",children:e.jsx(Le,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[s.step!==null&&s.step!==void 0&&e.jsxs("button",{className:"flex items-center gap-1 text-xs text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",onClick:()=>ie(s.step),children:[y.has(s.step)?e.jsx(De,{className:"w-3 h-3"}):e.jsx(Ce,{className:"w-3 h-3"}),t.historyPage.stepLabel?.replace("{step}",String(s.step))||`步骤 ${s.step}`]}),s.thinking&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-slate-100 dark:bg-slate-800 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 mb-1",children:t.historyPage.thinkingLabel||"思考"}),e.jsx("p",{className:"text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap",children:s.thinking})]}),s.action&&(s.step===null||s.step===void 0||y.has(s.step))&&e.jsxs("div",{className:"p-3 bg-amber-50 dark:bg-amber-900/20 rounded-lg",children:[e.jsx("p",{className:"text-xs font-medium text-amber-600 dark:text-amber-400 mb-1",children:t.historyPage.actionLabel||"动作"}),e.jsx("pre",{className:"text-xs text-slate-700 dark:text-slate-300 overflow-x-auto",children:JSON.stringify(s.action,null,2)})]})]})]})},a)):e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 text-center py-4",children:t.historyPage.noMessages||"暂无详细消息记录"})}),e.jsxs("div",{className:`p-3 rounded-lg ${i.success?"bg-green-50 dark:bg-green-900/20":"bg-red-50 dark:bg-red-900/20"}`,children:[e.jsx("p",{className:`text-xs font-medium mb-1 ${i.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:t.historyPage.resultLabel||"结果"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-slate-100",children:i.final_message})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs text-slate-500 dark:text-slate-400 pt-2 border-t border-slate-200 dark:border-slate-700",children:[e.jsx("span",{children:t.historyPage.steps.replace("{count}",String(i.steps))}),e.jsxs("span",{className:"flex items-center",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),M(i.duration_ms)]}),e.jsx(m,{className:O(i.source),children:T(i.source)})]})]})})]})})]})}export{Fe as component};
@@ -1 +1 @@
1
- import{a5 as o,r as s,j as t}from"./index-UYYauTly.js";function n(){const e=o();return s.useEffect(()=>{e({to:"/chat"})},[e]),t.jsx("div",{className:"p-2",children:t.jsx("h3",{children:"Welcome Home!"})})}export{n as component};
1
+ import{a9 as o,r as s,j as t}from"./index-CTHbFvKl.js";function n(){const e=o();return s.useEffect(()=>{e({to:"/chat"})},[e]),t.jsx("div",{className:"p-2",children:t.jsx("h3",{children:"Welcome Home!"})})}export{n as component};