autoglm-gui 1.5.0__py3-none-any.whl → 1.5.2__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.
- AutoGLM_GUI/__init__.py +1 -1
- AutoGLM_GUI/__main__.py +11 -2
- AutoGLM_GUI/adb_plus/qr_pair.py +3 -3
- AutoGLM_GUI/agents/__init__.py +7 -2
- AutoGLM_GUI/agents/factory.py +46 -6
- AutoGLM_GUI/agents/glm/agent.py +8 -3
- AutoGLM_GUI/agents/glm/async_agent.py +515 -0
- AutoGLM_GUI/agents/glm/parser.py +4 -2
- AutoGLM_GUI/agents/mai/agent.py +3 -0
- AutoGLM_GUI/agents/protocols.py +111 -1
- AutoGLM_GUI/agents/stream_runner.py +11 -7
- AutoGLM_GUI/api/__init__.py +3 -1
- AutoGLM_GUI/api/agents.py +103 -37
- AutoGLM_GUI/api/devices.py +72 -0
- AutoGLM_GUI/api/history.py +27 -1
- AutoGLM_GUI/api/layered_agent.py +9 -8
- AutoGLM_GUI/api/mcp.py +6 -4
- AutoGLM_GUI/config_manager.py +38 -1
- AutoGLM_GUI/device_manager.py +28 -4
- AutoGLM_GUI/device_metadata_manager.py +174 -0
- AutoGLM_GUI/devices/mock_device.py +8 -1
- AutoGLM_GUI/models/history.py +45 -1
- AutoGLM_GUI/phone_agent_manager.py +145 -32
- AutoGLM_GUI/scheduler_manager.py +52 -6
- AutoGLM_GUI/schemas.py +101 -0
- AutoGLM_GUI/scrcpy_stream.py +2 -1
- AutoGLM_GUI/static/assets/{about-BQm96DAl.js → about-D7r9gCvG.js} +1 -1
- AutoGLM_GUI/static/assets/{alert-dialog-B42XxGPR.js → alert-dialog-BKM-yRiQ.js} +1 -1
- AutoGLM_GUI/static/assets/chat-k6TTD7PW.js +129 -0
- AutoGLM_GUI/static/assets/{circle-alert-D4rSJh37.js → circle-alert-sohSDLhl.js} +1 -1
- AutoGLM_GUI/static/assets/{dialog-DZ78cEcj.js → dialog-BgtPh0d5.js} +1 -1
- AutoGLM_GUI/static/assets/eye-DLqKbQmg.js +1 -0
- AutoGLM_GUI/static/assets/history-Bv1lfGUU.js +1 -0
- AutoGLM_GUI/static/assets/index-CV7jGxGm.css +1 -0
- AutoGLM_GUI/static/assets/index-CxWwh1VO.js +1 -0
- AutoGLM_GUI/static/assets/{index-CssG-3TH.js → index-SysdKciY.js} +5 -5
- AutoGLM_GUI/static/assets/label-DTUnzN4B.js +1 -0
- AutoGLM_GUI/static/assets/{logs-eoFxn5of.js → logs-BIhnDizW.js} +1 -1
- AutoGLM_GUI/static/assets/{popover-DLsuV5Sx.js → popover-CikYqu2P.js} +1 -1
- AutoGLM_GUI/static/assets/scheduled-tasks-B-KBsGbl.js +1 -0
- AutoGLM_GUI/static/assets/{textarea-BX6y7uM5.js → textarea-knJZrz77.js} +1 -1
- AutoGLM_GUI/static/assets/workflows-DzcSYwLZ.js +1 -0
- AutoGLM_GUI/static/index.html +2 -2
- {autoglm_gui-1.5.0.dist-info → autoglm_gui-1.5.2.dist-info}/METADATA +58 -7
- autoglm_gui-1.5.2.dist-info/RECORD +119 -0
- AutoGLM_GUI/device_adapter.py +0 -263
- AutoGLM_GUI/static/assets/chat-C0L2gQYG.js +0 -129
- AutoGLM_GUI/static/assets/history-DFBv7TGc.js +0 -1
- AutoGLM_GUI/static/assets/index-Bzyv2yQ2.css +0 -1
- AutoGLM_GUI/static/assets/index-CmZSnDqc.js +0 -1
- AutoGLM_GUI/static/assets/label-BCUzE_nm.js +0 -1
- AutoGLM_GUI/static/assets/scheduled-tasks-MyqGJvy_.js +0 -1
- AutoGLM_GUI/static/assets/square-pen-zGWYrdfj.js +0 -1
- AutoGLM_GUI/static/assets/workflows-CYFs6ssC.js +0 -1
- autoglm_gui-1.5.0.dist-info/RECORD +0 -157
- mai_agent/base.py +0 -137
- mai_agent/mai_grounding_agent.py +0 -263
- mai_agent/mai_naivigation_agent.py +0 -526
- mai_agent/prompt.py +0 -148
- mai_agent/unified_memory.py +0 -67
- mai_agent/utils.py +0 -73
- phone_agent/__init__.py +0 -12
- phone_agent/actions/__init__.py +0 -5
- phone_agent/actions/handler.py +0 -400
- phone_agent/actions/handler_ios.py +0 -278
- phone_agent/adb/__init__.py +0 -51
- phone_agent/adb/connection.py +0 -358
- phone_agent/adb/device.py +0 -253
- phone_agent/adb/input.py +0 -108
- phone_agent/adb/screenshot.py +0 -108
- phone_agent/agent.py +0 -253
- phone_agent/agent_ios.py +0 -277
- phone_agent/config/__init__.py +0 -53
- phone_agent/config/apps.py +0 -227
- phone_agent/config/apps_harmonyos.py +0 -256
- phone_agent/config/apps_ios.py +0 -339
- phone_agent/config/i18n.py +0 -81
- phone_agent/config/prompts.py +0 -80
- phone_agent/config/prompts_en.py +0 -79
- phone_agent/config/prompts_zh.py +0 -82
- phone_agent/config/timing.py +0 -167
- phone_agent/device_factory.py +0 -166
- phone_agent/hdc/__init__.py +0 -53
- phone_agent/hdc/connection.py +0 -384
- phone_agent/hdc/device.py +0 -269
- phone_agent/hdc/input.py +0 -145
- phone_agent/hdc/screenshot.py +0 -127
- phone_agent/model/__init__.py +0 -5
- phone_agent/model/client.py +0 -290
- phone_agent/xctest/__init__.py +0 -47
- phone_agent/xctest/connection.py +0 -379
- phone_agent/xctest/device.py +0 -472
- phone_agent/xctest/input.py +0 -311
- phone_agent/xctest/screenshot.py +0 -226
- {autoglm_gui-1.5.0.dist-info → autoglm_gui-1.5.2.dist-info}/WHEEL +0 -0
- {autoglm_gui-1.5.0.dist-info → autoglm_gui-1.5.2.dist-info}/entry_points.txt +0 -0
- {autoglm_gui-1.5.0.dist-info → autoglm_gui-1.5.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as i,j as r,b as o,r as s,ah as d}from"./index-SysdKciY.js";const u=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],x=i("plus",u);const c=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],g=i("square-pen",c);function v({className:a,type:t,...e}){return r.jsx("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",a),...e})}var p="Label",n=s.forwardRef((a,t)=>r.jsx(d.label,{...a,ref:t,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(a.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));n.displayName=p;var l=n;const f=s.forwardRef(({className:a,...t},e)=>r.jsx(l,{ref:e,className:o("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-slate-900 dark:text-slate-100",a),...t}));f.displayName=l.displayName;export{v as I,f as L,x as P,g as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as j,u as I,r as l,j as e,B as i,F as u}from"./index-
|
|
1
|
+
import{o as j,u as I,r as l,j as e,B as i,F as u}from"./index-SysdKciY.js";import{C as d}from"./circle-alert-sohSDLhl.js";const A=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],E=j("folder-open",A);const M=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],P=j("refresh-cw",M);function B(){const r=I(),[x,p]=l.useState([]),[o,v]=l.useState(null),[N,w]=l.useState(""),[m,h]=l.useState(!1),[b,g]=l.useState(!1),[f,a]=l.useState(""),[k,F]=l.useState(!1),n=l.useCallback(async()=>{try{h(!0),a("");const s=window.electronAPI;if(!s?.logs)return;const t=await s.logs.listFiles();p(t)}catch(s){const t=s instanceof Error?s.message:String(s);a(r.logs.loadFailed.replace("{error}",t))}finally{h(!1)}},[r.logs.loadFailed]);l.useEffect(()=>{window.electronAPI?.logs&&(F(!0),n())},[n]);const L=async s=>{g(!0),a("");try{const t=window.electronAPI;if(!t?.logs)return;const c=await t.logs.readFile(s);v(s),w(c)}catch(t){const c=t instanceof Error?t.message:String(t);a(r.logs.readFailed.replace("{error}",c))}finally{g(!1)}},y=async()=>{try{const s=window.electronAPI;if(!s?.logs)return;const t=await s.logs.openFolder();t.success||a(r.logs.openFolderFailed.replace("{error}",t.error||""))}catch(s){const t=s instanceof Error?s.message:String(s);a(r.logs.openFolderFailed.replace("{error}",t))}},C=s=>s<1024?s+" B":s<1024*1024?(s/1024).toFixed(1)+" KB":(s/(1024*1024)).toFixed(1)+" MB",S=s=>new Date(s).toLocaleString("zh-CN");return k?e.jsxs("div",{className:"h-full flex",children:[e.jsxs("div",{className:"w-80 border-r border-slate-200 dark:border-slate-800 flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:r.logs.title}),e.jsx(i,{variant:"ghost",size:"icon",onClick:n,disabled:m,title:r.logs.refresh,children:e.jsx(P,{className:`w-4 h-4 ${m?"animate-spin":""}`})})]}),e.jsxs(i,{variant:"outline",className:"w-full",onClick:y,children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),r.logs.openFolder]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:x.length===0?e.jsx("div",{className:"p-4 text-center text-slate-500 text-sm",children:r.logs.noLogs}):e.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:x.map(s=>e.jsxs("div",{className:`p-4 hover:bg-slate-50 dark:hover:bg-slate-900 cursor-pointer transition-colors ${o===s.name?"bg-slate-50 dark:bg-slate-900":""}`,onClick:()=>!s.isCompressed&&L(s.name),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[s.isError?e.jsx(d,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}):e.jsx(u,{className:"w-5 h-5 text-slate-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[C(s.size)," •"," ",S(s.modified)]})]})]}),s.isCompressed&&e.jsx("div",{className:"text-xs text-slate-400 mt-2 ml-8",children:r.logs.compressedFileNote})]},s.name))})})]}),e.jsx("div",{className:"flex-1 flex flex-col",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800",children:e.jsx("h3",{className:"font-semibold",children:o})}),e.jsx("div",{className:"flex-1 overflow-auto p-4 bg-slate-50 dark:bg-slate-950",children:b?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{className:"text-slate-500",children:r.logs.loading})}):e.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:N})})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-slate-500",children:e.jsxs("div",{className:"text-center",children:[e.jsx(u,{className:"w-12 h-12 mx-auto mb-4 text-slate-300"}),e.jsx("p",{children:r.logs.selectLog})]})})}),f&&e.jsx("div",{className:"fixed bottom-4 right-4 max-w-md bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 shadow-lg",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(d,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}),e.jsx("div",{className:"flex-1 text-sm text-red-600 dark:text-red-400",children:f}),e.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-400 hover:text-red-600",onClick:()=>a(""),children:"✕"})]})})]}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx(d,{className:"w-12 h-12 mx-auto mb-4 text-slate-400"}),e.jsx("p",{className:"text-slate-600",dangerouslySetInnerHTML:{__html:r.logs.webVersionNotice}})]})})}export{B as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as R,r as i,
|
|
1
|
+
import{o as R,r as i,ai as _,G as z,j as s,aj as $,y as L,D as G,z as O,P as b,E as P,ak as j,I as w,al as H,A as q,am as K,an as B,ao as U,b as V}from"./index-SysdKciY.js";import{i as W,R as X,u as Z,F as J}from"./dialog-BgtPh0d5.js";const Q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],he=R("chevron-down",Q);const Y=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],me=R("circle-check-big",Y);const ee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ce=R("circle-x",ee);var C="Popover",[y]=L(C,[_]),g=_(),[oe,l]=y(C),E=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:t,onOpenChange:r,modal:c=!1}=e,p=g(n),f=i.useRef(null),[v,h]=i.useState(!1),[m,d]=z({prop:a,defaultProp:t??!1,onChange:r,caller:C});return s.jsx($,{...p,children:s.jsx(oe,{scope:n,contentId:G(),triggerRef:f,open:m,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(x=>!x),[d]),hasCustomAnchor:v,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:c,children:o})})};E.displayName=C;var N="PopoverAnchor",te=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(N,o),r=g(o),{onCustomAnchorAdd:c,onCustomAnchorRemove:p}=t;return i.useEffect(()=>(c(),()=>p()),[c,p]),s.jsx(j,{...r,...a,ref:n})});te.displayName=N;var k="PopoverTrigger",F=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(k,o),r=g(o),c=O(n,t.triggerRef),p=s.jsx(b.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.contentId,"data-state":T(t.open),...a,ref:c,onClick:P(e.onClick,t.onOpenToggle)});return t.hasCustomAnchor?p:s.jsx(j,{asChild:!0,...r,children:p})});F.displayName=k;var A="PopoverPortal",[re,ne]=y(A,{forceMount:void 0}),S=e=>{const{__scopePopover:n,forceMount:o,children:a,container:t}=e,r=l(A,n);return s.jsx(re,{scope:n,forceMount:o,children:s.jsx(w,{present:o||r.open,children:s.jsx(H,{asChild:!0,container:t,children:a})})})};S.displayName=A;var u="PopoverContent",D=i.forwardRef((e,n)=>{const o=ne(u,e.__scopePopover),{forceMount:a=o.forceMount,...t}=e,r=l(u,e.__scopePopover);return s.jsx(w,{present:a||r.open,children:r.modal?s.jsx(se,{...t,ref:n}):s.jsx(ce,{...t,ref:n})})});D.displayName=u;var ae=q("PopoverContent.RemoveScroll"),se=i.forwardRef((e,n)=>{const o=l(u,e.__scopePopover),a=i.useRef(null),t=O(n,a),r=i.useRef(!1);return i.useEffect(()=>{const c=a.current;if(c)return W(c)},[]),s.jsx(X,{as:ae,allowPinchZoom:!0,children:s.jsx(M,{...e,ref:t,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,c=>{c.preventDefault(),r.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,c=>{const p=c.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0,v=p.button===2||f;r.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),ce=i.forwardRef((e,n)=>{const o=l(u,e.__scopePopover),a=i.useRef(!1),t=i.useRef(!1);return s.jsx(M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(a.current||o.triggerRef.current?.focus(),r.preventDefault()),a.current=!1,t.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const c=r.target;o.triggerRef.current?.contains(c)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&t.current&&r.preventDefault()}})}),M=i.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:a,onOpenAutoFocus:t,onCloseAutoFocus:r,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onInteractOutside:h,...m}=e,d=l(u,o),x=g(o);return Z(),s.jsx(J,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:t,onUnmountAutoFocus:r,children:s.jsx(K,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onDismiss:()=>d.onOpenChange(!1),children:s.jsx(B,{"data-state":T(d.open),role:"dialog",id:d.contentId,...x,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I="PopoverClose",ie=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(I,o);return s.jsx(b.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>t.onOpenChange(!1))})});ie.displayName=I;var pe="PopoverArrow",le=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=g(o);return s.jsx(U,{...t,...a,ref:n})});le.displayName=pe;function T(e){return e?"open":"closed"}var de=E,ue=F,fe=S,ve=D;function xe({...e}){return s.jsx(de,{"data-slot":"popover",...e})}function Re({...e}){return s.jsx(ue,{"data-slot":"popover-trigger",...e})}function Ae({className:e,align:n="center",sideOffset:o=4,...a}){return s.jsx(fe,{children:s.jsx(ve,{"data-slot":"popover-content",align:n,sideOffset:o,className:V("bg-popover text-popover-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}export{me as C,xe as P,Ce as a,he as b,Re as c,Ae as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as e,b as C,u as J,e as K,l as Q,g as U,B as i,f as Y,C as Z,h as $,i as ee,k as se,m as ae,n as le}from"./index-SysdKciY.js";import{P as ne,S as te,L as x,I as D}from"./label-DTUnzN4B.js";import{L as _,C as re,a as ce,b as ie,c as oe,T as de,D as me,d as he,e as xe,f as ue,g as je}from"./dialog-BgtPh0d5.js";import{S,a as F,b as A,c as E,d as P,A as pe,e as fe,f as ke,g as ge,h as we,i as ve,j as Ne,k as Te}from"./alert-dialog-BKM-yRiQ.js";import{C as be,a as ye}from"./popover-CikYqu2P.js";const L=n.forwardRef(({className:a,checked:r=!1,onCheckedChange:j,disabled:o,...p},d)=>e.jsx("button",{ref:d,role:"switch",type:"button","aria-checked":r,disabled:o,className:C("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-slate-900 dark:bg-slate-50":"bg-slate-200 dark:bg-slate-800",a),onClick:()=>j?.(!r),...p,children:e.jsx("span",{className:C("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform dark:bg-slate-950",r?"translate-x-5":"translate-x-0")})}));L.displayName="Switch";const Ce=[{key:"everyHour",cron:"0 * * * *"},{key:"daily8am",cron:"0 8 * * *"},{key:"daily12pm",cron:"0 12 * * *"},{key:"daily6pm",cron:"0 18 * * *"},{key:"weeklyMonday",cron:"0 9 * * 1"}];function Ee(){const a=J(),[r,j]=n.useState([]),[o,p]=n.useState([]),[d,H]=n.useState([]),[O,g]=n.useState(!0),[W,m]=n.useState(!1),[f,w]=n.useState(null),[t,c]=n.useState({name:"",workflow_uuid:"",device_serialno:"",cron_expression:"",enabled:!0}),[v,N]=n.useState(!1),[z,k]=n.useState(!1),[T,b]=n.useState(null);n.useEffect(()=>{u()},[]);const u=async()=>{try{g(!0);const[s,l,h]=await Promise.all([K(),Q(),U()]);j(s.tasks),p(l.workflows),H(h)}catch(s){console.error("Failed to load data:",s)}finally{g(!1)}},B=()=>{w(null),c({name:"",workflow_uuid:"",device_serialno:"",cron_expression:"",enabled:!0}),m(!0)},R=s=>{w(s),c({name:s.name,workflow_uuid:s.workflow_uuid,device_serialno:s.device_serialno,cron_expression:s.cron_expression,enabled:s.enabled}),m(!0)},V=async()=>{try{N(!0),f?await se(f.id,t):await ae(t),m(!1),u()}catch(s){console.error("Failed to save task:",s)}finally{N(!1)}},I=async()=>{if(T){try{await le(T),u()}catch(s){console.error("Failed to delete task:",s)}k(!1),b(null)}},q=async s=>{try{s.enabled?await $(s.id):await ee(s.id),u()}catch(l){console.error("Failed to toggle task:",l)}},M=s=>o.find(h=>h.uuid===s)?.name||s,X=s=>d.find(h=>h.serial===s)?.model||s,y=s=>s?new Date(s).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):a.scheduledTasks.never,G=t.name.trim()&&t.workflow_uuid&&t.device_serialno&&t.cron_expression.trim();return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:a.scheduledTasks.title}),e.jsxs(i,{onClick:B,children:[e.jsx(ne,{className:"w-4 h-4 mr-2"}),a.scheduledTasks.create]})]}),O?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(_,{className:"w-8 h-8 animate-spin text-slate-400"})}):r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:a.scheduledTasks.noTasks}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:a.scheduledTasks.noTasksDesc})]}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:r.map(s=>e.jsxs(re,{className:"hover:shadow-md transition-shadow",children:[e.jsx(ce,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ie,{className:"text-lg truncate flex-1 mr-2",children:s.name}),e.jsx(L,{checked:s.enabled,onCheckedChange:()=>q(s)})]})}),e.jsx(oe,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.workflow,":"," "]}),e.jsx("span",{className:"font-medium",children:M(s.workflow_uuid)})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.device,":"," "]}),e.jsx("span",{className:"font-medium",children:X(s.device_serialno)})]}),e.jsx("div",{className:"text-sm",children:e.jsxs(Y,{variant:"outline",className:"font-mono",children:[e.jsx(Z,{className:"w-3 h-3 mr-1"}),s.cron_expression]})}),e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.lastRun,":"]}),s.last_run_time?e.jsxs(e.Fragment,{children:[s.last_run_success?e.jsx(be,{className:"w-4 h-4 text-green-500"}):e.jsx(ye,{className:"w-4 h-4 text-red-500"}),e.jsx("span",{children:y(s.last_run_time)})]}):e.jsx("span",{className:"text-slate-400",children:a.scheduledTasks.never})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.nextRun,":"," "]}),e.jsx("span",{children:y(s.next_run_time)})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>R(s),children:[e.jsx(te,{className:"w-3 h-3 mr-1"}),a.common.edit]}),e.jsxs(i,{variant:"destructive",size:"sm",onClick:()=>{b(s.id),k(!0)},children:[e.jsx(de,{className:"w-3 h-3 mr-1"}),a.common.delete]})]})]})})]},s.id))}),e.jsx(me,{open:W,onOpenChange:m,children:e.jsxs(he,{className:"sm:max-w-[500px]",children:[e.jsx(xe,{children:e.jsx(ue,{children:f?a.scheduledTasks.edit:a.scheduledTasks.create})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{htmlFor:"name",children:a.scheduledTasks.taskName}),e.jsx(D,{id:"name",value:t.name,onChange:s=>c(l=>({...l,name:s.target.value})),placeholder:a.scheduledTasks.taskNamePlaceholder})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{children:a.scheduledTasks.workflow}),o.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noWorkflows}):e.jsxs(S,{value:t.workflow_uuid,onValueChange:s=>c(l=>({...l,workflow_uuid:s})),children:[e.jsx(F,{children:e.jsx(A,{placeholder:a.scheduledTasks.selectWorkflow})}),e.jsx(E,{children:o.map(s=>e.jsx(P,{value:s.uuid,children:s.name},s.uuid))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{children:a.scheduledTasks.device}),d.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noDevicesOnline}):e.jsxs(S,{value:t.device_serialno,onValueChange:s=>c(l=>({...l,device_serialno:s})),children:[e.jsx(F,{children:e.jsx(A,{placeholder:a.scheduledTasks.selectDevice})}),e.jsx(E,{children:d.map(s=>e.jsx(P,{value:s.serial,children:s.model||s.serial},s.serial))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{htmlFor:"cron",children:a.scheduledTasks.cronExpression}),e.jsx(D,{id:"cron",value:t.cron_expression,onChange:s=>c(l=>({...l,cron_expression:s.target.value})),placeholder:a.scheduledTasks.cronPlaceholder,className:"font-mono"}),e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:a.scheduledTasks.cronHelp})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{children:a.scheduledTasks.presets}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Ce.map(s=>e.jsx(i,{variant:"outline",size:"sm",onClick:()=>c(l=>({...l,cron_expression:s.cron})),children:a.scheduledTasks.preset[s.key]},s.key))})]})]}),e.jsxs(je,{children:[e.jsx(i,{variant:"outline",onClick:()=>m(!1),children:a.common.cancel}),e.jsx(i,{onClick:V,disabled:!G||v,children:v?e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"w-4 h-4 mr-2 animate-spin"}),a.common.loading]}):a.common.save})]})]})}),e.jsx(pe,{open:z,onOpenChange:k,children:e.jsxs(fe,{children:[e.jsxs(ke,{children:[e.jsx(ge,{children:a.common.delete}),e.jsx(we,{children:a.scheduledTasks.deleteConfirm})]}),e.jsxs(ve,{children:[e.jsx(Ne,{children:a.common.cancel}),e.jsx(Te,{onClick:I,children:a.common.confirm})]})]})})]})}export{Ee as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as a,b as i}from"./index-
|
|
1
|
+
import{r as s,j as a,b as i}from"./index-SysdKciY.js";const l=s.forwardRef(({className:e,...r},t)=>a.jsx("textarea",{className:i("flex min-h-[40px] w-full rounded-full border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d9bf0] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-100 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus-visible:ring-[#1d9bf0] resize-none",e),ref:t,...r}));l.displayName="Textarea";export{l as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as D,r as t,l as S,j as e,B as n,d as W,a as F,c as b}from"./index-SysdKciY.js";import{P as T,S as E,L as u,I as L}from"./label-DTUnzN4B.js";import{T as P}from"./textarea-knJZrz77.js";import{L as j,C as z,a as B,b as H,c as I,T as q,D as O,d as R,e as A,f as G,g as J}from"./dialog-BgtPh0d5.js";function V(){const a=D(),[m,p]=t.useState([]),[g,x]=t.useState(!0),[k,o]=t.useState(!1),[c,h]=t.useState(null),[l,i]=t.useState({name:"",text:""}),[w,f]=t.useState(!1);t.useEffect(()=>{d()},[]);const d=async()=>{try{x(!0);const s=await S();p(s.workflows)}catch(s){console.error("Failed to load workflows:",s)}finally{x(!1)}},v=()=>{h(null),i({name:"",text:""}),o(!0)},N=s=>{h(s),i({name:s.name,text:s.text}),o(!0)},C=async()=>{try{f(!0),c?await F(c.uuid,l):await b(l),o(!1),d()}catch(s){console.error("Failed to save workflow:",s)}finally{f(!1)}},y=async s=>{if(window.confirm(a.workflows.deleteConfirm))try{await W(s),d()}catch(r){console.error("Failed to delete workflow:",r)}};return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:a.workflows.title}),e.jsxs(n,{onClick:v,children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),a.workflows.createNew]})]}),g?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(j,{className:"w-8 h-8 animate-spin text-slate-400"})}):m.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:a.workflows.empty})}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(s=>e.jsxs(z,{className:"hover:shadow-md transition-shadow",children:[e.jsx(B,{children:e.jsx(H,{className:"text-lg",children:s.name})}),e.jsxs(I,{children:[e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-4 line-clamp-3",children:s.text}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(n,{variant:"outline",size:"sm",onClick:()=>N(s),children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),a.common.edit]}),e.jsxs(n,{variant:"destructive",size:"sm",onClick:()=>y(s.uuid),children:[e.jsx(q,{className:"w-3 h-3 mr-1"}),a.common.delete]})]})]})]},s.uuid))}),e.jsx(O,{open:k,onOpenChange:o,children:e.jsxs(R,{className:"sm:max-w-[600px]",children:[e.jsx(A,{children:e.jsx(G,{children:c?a.workflows.edit:a.workflows.create})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"name",children:a.workflows.name}),e.jsx(L,{id:"name",value:l.name,onChange:s=>i(r=>({...r,name:s.target.value})),placeholder:a.workflows.namePlaceholder})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"text",children:a.workflows.text}),e.jsx(P,{id:"text",value:l.text,onChange:s=>i(r=>({...r,text:s.target.value})),placeholder:a.workflows.textPlaceholder,rows:6,className:"resize-none !rounded-lg"})]})]}),e.jsxs(J,{children:[e.jsx(n,{variant:"outline",onClick:()=>o(!1),children:a.common.cancel}),e.jsx(n,{onClick:C,disabled:!l.name.trim()||!l.text.trim()||w,children:w?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}),a.common.loading]}):a.common.save})]})]})})]})}export{V as component};
|
AutoGLM_GUI/static/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<link rel="icon" type="image/png" sizes="192x192" href="/logo-192.png" />
|
|
12
12
|
<link rel="icon" type="image/png" sizes="512x512" href="/logo-512.png" />
|
|
13
13
|
<meta name="theme-color" content="#f5f1e8" />
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-SysdKciY.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CV7jGxGm.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autoglm-gui
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.2
|
|
4
4
|
Summary: Web GUI for AutoGLM Phone Agent - AI-powered Android automation
|
|
5
5
|
Project-URL: Homepage, https://github.com/suyiiyii/AutoGLM-GUI
|
|
6
6
|
Project-URL: Repository, https://github.com/suyiiyii/AutoGLM-GUI
|
|
7
7
|
Author: suyiiyii
|
|
8
|
-
License-Expression:
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Keywords: ai,android,autoglm,automation,gui,phone-agent
|
|
11
11
|
Classifier: Development Status :: 3 - Alpha
|
|
12
12
|
Classifier: Environment :: Web Environment
|
|
13
13
|
Classifier: Framework :: FastAPI
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved ::
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -80,9 +80,9 @@ AutoGLM 手机助手的现代化 Web 图形界面 - 让 AI 自动化操作 Andro
|
|
|
80
80
|
|
|
81
81
|
| 操作系统 | 下载链接 | 说明 |
|
|
82
82
|
|---------|---------|------|
|
|
83
|
-
| 🪟 **Windows** (x64) | [📦 下载便携版 EXE](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.
|
|
84
|
-
| 🍎 **macOS** (Apple Silicon) | [📦 下载 DMG](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.
|
|
85
|
-
| 🐧 **Linux** (x64) | [📦 下载 AppImage](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.
|
|
83
|
+
| 🪟 **Windows** (x64) | [📦 下载便携版 EXE](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.4.1/AutoGLM.GUI.1.4.1.exe) | 适用于 Windows 10/11,免安装 |
|
|
84
|
+
| 🍎 **macOS** (Apple Silicon) | [📦 下载 DMG](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.4.1/AutoGLM.GUI-1.4.1-arm64.dmg) | 适用于 M 芯片 Mac |
|
|
85
|
+
| 🐧 **Linux** (x64) | [📦 下载 AppImage](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.4.1/AutoGLM.GUI-1.4.1.AppImage) \| [deb](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.4.1/autoglm-gui_1.4.1_amd64.deb) \| [tar.gz](https://github.com/suyiiyii/AutoGLM-GUI/releases/download/v1.4.1/autoglm-gui-1.4.1.tar.gz) | 通用格式,支持主流发行版 |
|
|
86
86
|
|
|
87
87
|
</div>
|
|
88
88
|
|
|
@@ -96,6 +96,15 @@ AutoGLM 手机助手的现代化 Web 图形界面 - 让 AI 自动化操作 Andro
|
|
|
96
96
|
|
|
97
97
|
> 💡 **提示**: 桌面版已内置所有依赖(Python、ADB 等),无需手动配置环境。首次运行时需配置模型服务 API。
|
|
98
98
|
|
|
99
|
+
**自动更新:**
|
|
100
|
+
|
|
101
|
+
AutoGLM GUI 桌面版支持自动更新功能:
|
|
102
|
+
|
|
103
|
+
- **🪟 Windows 安装版**:启动时自动检测更新,下载完成后退出时自动安装
|
|
104
|
+
- **🍎 macOS DMG**:启动时自动检测更新,下载完成后提示用户重启(未签名应用可能需要手动允许)
|
|
105
|
+
- **🐧 Linux AppImage**:启动时自动检测更新(需配合 [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher))
|
|
106
|
+
- **便携版(Windows EXE/Linux tar.gz)**:不支持自动更新,请手动下载新版本
|
|
107
|
+
|
|
99
108
|
---
|
|
100
109
|
|
|
101
110
|
**或者使用 Python 包(需要 Python 环境):**
|
|
@@ -499,6 +508,48 @@ docker run -d -p 9000:8000 \
|
|
|
499
508
|
curl http://localhost:8000/api/health
|
|
500
509
|
```
|
|
501
510
|
|
|
511
|
+
## 🤝 如何贡献
|
|
512
|
+
|
|
513
|
+
我们热烈欢迎社区贡献!无论是修复 bug、添加新功能、改进文档,还是分享使用经验,都对项目有重要价值。
|
|
514
|
+
|
|
515
|
+
### 🎯 快速开始贡献
|
|
516
|
+
|
|
517
|
+
1. **查看置顶 Issue** - [🎯 Start Here: 如何贡献 / 认领任务 / 本地跑起来](https://github.com/suyiiyii/AutoGLM-GUI/issues/170)
|
|
518
|
+
2. **阅读贡献指南** - 详细步骤请参考 [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
519
|
+
3. **认领任务** - 在感兴趣的 Issue 下评论 `/assign me`
|
|
520
|
+
|
|
521
|
+
### 💡 贡献方式
|
|
522
|
+
|
|
523
|
+
- 🐛 **修复 Bug** - 查找标记为 `bug` 的 Issue
|
|
524
|
+
- ✨ **添加功能** - 实现标记为 `enhancement` 的需求
|
|
525
|
+
- 📖 **改进文档** - 修正错误、补充说明、添加示例
|
|
526
|
+
- 🧪 **添加测试** - 提升代码质量和测试覆盖率
|
|
527
|
+
- 🌍 **翻译文档** - 帮助更多语言的用户使用
|
|
528
|
+
|
|
529
|
+
### 🏷️ 新手友好任务
|
|
530
|
+
|
|
531
|
+
如果你是第一次贡献开源项目,可以从这些任务开始:
|
|
532
|
+
|
|
533
|
+
- 查找标记为 [`good first issue`](https://github.com/suyiiyii/AutoGLM-GUI/labels/good%20first%20issue) 的 Issue
|
|
534
|
+
- 改进文档(修正拼写错误、补充说明)
|
|
535
|
+
- 测试软件并报告使用体验
|
|
536
|
+
|
|
537
|
+
### 📚 参考资源
|
|
538
|
+
|
|
539
|
+
| 文档 | 说明 |
|
|
540
|
+
|------|------|
|
|
541
|
+
| [CONTRIBUTING.md](./CONTRIBUTING.md) | 完整的贡献指南(环境配置、开发流程、PR 规范) |
|
|
542
|
+
| [CLAUDE.md](./CLAUDE.md) | 技术架构文档(代码结构、关键实现细节) |
|
|
543
|
+
| [Issues](https://github.com/suyiiyii/AutoGLM-GUI/issues) | 查看和认领任务 |
|
|
544
|
+
|
|
545
|
+
### 💬 交流讨论
|
|
546
|
+
|
|
547
|
+
- 💭 在 Issue 中讨论想法和问题
|
|
548
|
+
- 🎮 加入 [QQ 交流群](https://qm.qq.com/q/J5eAs9tn0W)
|
|
549
|
+
- 📝 [创建新 Issue](https://github.com/suyiiyii/AutoGLM-GUI/issues/new/choose) 报告问题或提出建议
|
|
550
|
+
|
|
551
|
+
感谢每一位贡献者,你们让 AutoGLM-GUI 变得更好!🎉
|
|
552
|
+
|
|
502
553
|
## 📝 开源协议
|
|
503
554
|
|
|
504
555
|
Apache License 2.0
|
|
@@ -506,7 +557,7 @@ Apache License 2.0
|
|
|
506
557
|
|
|
507
558
|
### 许可证说明
|
|
508
559
|
|
|
509
|
-
AutoGLM-GUI 打包了 ADB Keyboard APK (`com.android.adbkeyboard`),该组件使用 GPL-2.0 许可证。ADB Keyboard 组件作为独立工具使用,不影响 AutoGLM-GUI 本身的
|
|
560
|
+
AutoGLM-GUI 打包了 ADB Keyboard APK (`com.android.adbkeyboard`),该组件使用 GPL-2.0 许可证。ADB Keyboard 组件作为独立工具使用,不影响 AutoGLM-GUI 本身的 Apache 2.0 许可。
|
|
510
561
|
|
|
511
562
|
详见:`AutoGLM_GUI/resources/apks/ADBKeyBoard.LICENSE.txt`
|
|
512
563
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
AutoGLM_GUI/__init__.py,sha256=ZAaFdGp9Xaep9FvBe_j4YkJWs7-QmIMsaqX_RQ0XTEo,2418
|
|
2
|
+
AutoGLM_GUI/__main__.py,sha256=l9ULeqL5fRHAB-zoHo5dKqCmPJHmx-c7icYLzaNb8r8,7176
|
|
3
|
+
AutoGLM_GUI/config.py,sha256=OrjhbjcaZWBRLiLTzmknm6pONglDXjfoZngQd8jU9bk,2286
|
|
4
|
+
AutoGLM_GUI/config_manager.py,sha256=Pg2vRqlZzuRbWkROLzZm0AxgSyrGSpBkm9OeG6Ct9ns,25878
|
|
5
|
+
AutoGLM_GUI/device_manager.py,sha256=DNXkFV9zN1q1PAkww40PMrq5g-KOelS5K1PumYCu4h4,36380
|
|
6
|
+
AutoGLM_GUI/device_metadata_manager.py,sha256=vKblcuIhsQ5KGTcP3Rh8oxp5QsFHZe2BKU0v-d-SaGs,6137
|
|
7
|
+
AutoGLM_GUI/device_protocol.py,sha256=T3JctpggGekkYDeNXiPj_PoINPg8yFqalTx8Lk9w-9A,6944
|
|
8
|
+
AutoGLM_GUI/exceptions.py,sha256=QXTQzxdbEHDUrtaD1G4zuKZydFJO5ymNvuo8ZvVjUdA,3487
|
|
9
|
+
AutoGLM_GUI/history_manager.py,sha256=wbndRk2fnuY5n2bcsfbt2HEa_1N9AcnSC1xAn1VMgcA,6347
|
|
10
|
+
AutoGLM_GUI/i18n.py,sha256=-x8yD5ywyK7xwjoI-pOYqPlSeId_W9KkVjmKayr36m0,2501
|
|
11
|
+
AutoGLM_GUI/logger.py,sha256=wLzjbRqsHAsOtI9yB0bcUZFVzgGK6qM8330std6FjVw,2553
|
|
12
|
+
AutoGLM_GUI/metrics.py,sha256=L72hzMNzw1eemQLz6Hoth5sRW6OQlI4Np5BIFSFwl1c,8994
|
|
13
|
+
AutoGLM_GUI/phone_agent_manager.py,sha256=Ong3wh-WWh7Bcrif3JUa2pfu2o5SUsavn-cY8UKKA14,24382
|
|
14
|
+
AutoGLM_GUI/platform_utils.py,sha256=tsZ-H6Lsgz3aceWQ3GVBmO4lgKBEyD5l-fYyXU7nPU4,3356
|
|
15
|
+
AutoGLM_GUI/prompt_config.py,sha256=3eNEDdlrk8rvuqakQTiVrGEmFFH5X-UdV-9yUibCSsI,336
|
|
16
|
+
AutoGLM_GUI/prompts.py,sha256=lC5UktW0KRpWKij6T0GG1OrNKV9gAfM6dUcp_tjX7mo,4814
|
|
17
|
+
AutoGLM_GUI/scheduler_manager.py,sha256=WLHGBF4xrQv1zguGSA7S2IpWP9r8P5SXxHe_A9s5TXQ,12046
|
|
18
|
+
AutoGLM_GUI/schemas.py,sha256=LhdU3X3Ys4cgYWFxNgdfSEPmF44SljYG7ao598TXq4M,23527
|
|
19
|
+
AutoGLM_GUI/scrcpy_protocol.py,sha256=h6AtAGq3zMM30FWM7EYiYKJz7BDikpNCOjcKtFcRx3s,997
|
|
20
|
+
AutoGLM_GUI/scrcpy_stream.py,sha256=fOlWMW9U3L6J_pbH0bNaf06HMzuQXwA5e5ZRHhgZHYw,21459
|
|
21
|
+
AutoGLM_GUI/server.py,sha256=Fo2Afl6CFT5B6MBggvR0n_savNxqxW22bFdN51NXRJs,299
|
|
22
|
+
AutoGLM_GUI/socketio_server.py,sha256=Y_B3lKXCv9rDs8IbbKUCGoA2eldZ1pr6_qK1Gh99XOQ,6532
|
|
23
|
+
AutoGLM_GUI/state.py,sha256=qGnqZKdWFDpegVBLB4KHDbzfAVWc89C0AiCum_R9LSk,912
|
|
24
|
+
AutoGLM_GUI/types.py,sha256=FY-M0VWK0CyiLhV1gL1aqY872zdftlkHiJPLEORk4ug,2927
|
|
25
|
+
AutoGLM_GUI/version.py,sha256=z0MPXu-k9UO7RXxVGcAwim2M3yklrRqLwgOq66zSdzo,178
|
|
26
|
+
AutoGLM_GUI/workflow_manager.py,sha256=AZ_zrhSeEvtlF1HTNMNS3f4qBwRuX-bzImdZEVZVXV8,5552
|
|
27
|
+
AutoGLM_GUI/actions/__init__.py,sha256=kdprfh9IzhoaBBlKG10q6MROSQ96n-uo9GkREjcv9gc,165
|
|
28
|
+
AutoGLM_GUI/actions/handler.py,sha256=wztZwIDRIAhokxJ3LvDQY8i2AS9MdmTn7Q3h3e34Elo,6993
|
|
29
|
+
AutoGLM_GUI/actions/types.py,sha256=19TZNoi6KkFtsGkaqhw23vIE7c549j1t2CpKxBXuUKo,266
|
|
30
|
+
AutoGLM_GUI/adb/__init__.py,sha256=QdiryYhjt-Ox8MKGCUv6Dd9L1e0VFAcXS4TMpDNCi9s,1095
|
|
31
|
+
AutoGLM_GUI/adb/apps.py,sha256=D9HcsGzqwJL3g1ZRS4_Iq4WjviijDDEtkBJlV4-TSjE,8774
|
|
32
|
+
AutoGLM_GUI/adb/connection.py,sha256=4_u3tZ21y8SvDrucSTe1tLDk4MSIMRV-vRl6uS3njFk,9212
|
|
33
|
+
AutoGLM_GUI/adb/device.py,sha256=erVAjyefzsd1Dz5qB2nrr7zJwwPNFOrLiX_Se9r7Kjk,4351
|
|
34
|
+
AutoGLM_GUI/adb/input.py,sha256=DELZOebzg9Dh7OxOICe-cPIPbe6kIye2pUY24fIHTVM,1738
|
|
35
|
+
AutoGLM_GUI/adb/screenshot.py,sha256=VJWbZM3wNCc0kfdm6ra7ja0fcS9yw5KvfezzaMH4mfk,434
|
|
36
|
+
AutoGLM_GUI/adb/timing.py,sha256=3NPcuMzNQuo_eqs3SKQESsKeRa5L4Ice5GTyrx0WqLc,5790
|
|
37
|
+
AutoGLM_GUI/adb_plus/__init__.py,sha256=YwYYbeMrsKv8BGPcD6dv0PB8-wW93Ik9pMHo02i8QoU,945
|
|
38
|
+
AutoGLM_GUI/adb_plus/device.py,sha256=nCMDUd18LPfl5CsJeDjKd9HSt6FFOy2jS1muOSeLO08,1683
|
|
39
|
+
AutoGLM_GUI/adb_plus/ip.py,sha256=dt6ffIjiW_jGoEqUKUDi9fRGbWN1W9LxfT8rWIqgS-0,2200
|
|
40
|
+
AutoGLM_GUI/adb_plus/keyboard_installer.py,sha256=OfBdtFNbIZtiEgsJJaewgCAucaP4ppoAmd1M6y9-URY,13586
|
|
41
|
+
AutoGLM_GUI/adb_plus/mdns.py,sha256=AwQ4MQsPKVW1tPjIUpOWvBQGlJxvVrO9eTvxoqsgPUo,5862
|
|
42
|
+
AutoGLM_GUI/adb_plus/pair.py,sha256=3UElG0yjylhmZBtPpDER2BNMZs9CwDeavjuQOwOC4sw,1945
|
|
43
|
+
AutoGLM_GUI/adb_plus/qr_pair.py,sha256=ZluqUusM5C6UIRM7jUaQ9QjKEl5IaRkob0RKN4nSOtM,13595
|
|
44
|
+
AutoGLM_GUI/adb_plus/screenshot.py,sha256=12JFZJsrUsW4hTSFCQMEDFtMA6WWROaa8bcXxVvi1iw,4023
|
|
45
|
+
AutoGLM_GUI/adb_plus/serial.py,sha256=DZEm5R-w9UypMpqPbnE1uRvQXsAx9Jr-4vQk07_X7eM,3850
|
|
46
|
+
AutoGLM_GUI/adb_plus/touch.py,sha256=cqGmGBmo9gUjSI31OBEV4Q_hLKhRo48ed4XNmbYwgSs,2135
|
|
47
|
+
AutoGLM_GUI/adb_plus/version.py,sha256=u5u1N40izJceeORN9kFhyz0wq_hZtlwBXaiytfA3px8,2428
|
|
48
|
+
AutoGLM_GUI/agents/__init__.py,sha256=-SCUNLfJtdol690k3I82IeomVa00GlSs7b3Zm9UDvhE,1383
|
|
49
|
+
AutoGLM_GUI/agents/events.py,sha256=4810WrCNYqQFTpkIcU0lv3XUYwzR4uGn3MeshhDrFaI,392
|
|
50
|
+
AutoGLM_GUI/agents/factory.py,sha256=vOLJra6FT7kk_QFNWAnq72dVRQe1FNB-ocucUh7z1g4,6404
|
|
51
|
+
AutoGLM_GUI/agents/protocols.py,sha256=3UoT9pUaJPOow0AFsTzv2dct2Zy91tcfQVt9ZKR0fsc,3806
|
|
52
|
+
AutoGLM_GUI/agents/stream_runner.py,sha256=9yxg0QdG3av2m6RUe6hvh8zJW3_FYO_zwIFAHmOhCN8,6841
|
|
53
|
+
AutoGLM_GUI/agents/glm/__init__.py,sha256=1b9SzDLmWXcxlPS708p96o4W1Ks40YWQ3dd2HPaYewI,179
|
|
54
|
+
AutoGLM_GUI/agents/glm/agent.py,sha256=pcj4AEc4OPx0og8jecgdMxlD8lNIUWjozLqKUPY3OHM,10119
|
|
55
|
+
AutoGLM_GUI/agents/glm/async_agent.py,sha256=AmUYK3VQElIXIStJPFgvMgxso1TxiNhZappdSGDF54w,17500
|
|
56
|
+
AutoGLM_GUI/agents/glm/message_builder.py,sha256=Z1eNMifdrQfojoDBnUBaFRMnxxvugE8kTvFX2jiyHFk,2302
|
|
57
|
+
AutoGLM_GUI/agents/glm/parser.py,sha256=-8l8OfMbHUoXkAOWWtxlSBxff2mTHiUKoImkGCF3NLU,3512
|
|
58
|
+
AutoGLM_GUI/agents/glm/prompts_en.py,sha256=ms92sFAl45gZC1mVdKjYN4kntJG-OZujbCcI-jyzJGo,2608
|
|
59
|
+
AutoGLM_GUI/agents/glm/prompts_zh.py,sha256=g3_6nBjcLZwc5Keg1u26Z4w6xjoL05Fk078263A5EZ8,8285
|
|
60
|
+
AutoGLM_GUI/agents/mai/__init__.py,sha256=HOma4Vc0SDgk2uyS-bq6IvWCrpTBTC_9u6TJp1fOplU,935
|
|
61
|
+
AutoGLM_GUI/agents/mai/agent.py,sha256=xkLXjTJeKiTuaBddi70RHsQGpcaBzMjyXjjB9LBfqgc,14158
|
|
62
|
+
AutoGLM_GUI/agents/mai/parser.py,sha256=0VoxBiW3gEaU759tw1iD0qoOOFgUcaq-CyiWQJ1u0aM,8453
|
|
63
|
+
AutoGLM_GUI/agents/mai/prompts.py,sha256=X3dvVLAP01_OcpUYiwJxBNhETU3lbY-EUK0gJURtkec,4392
|
|
64
|
+
AutoGLM_GUI/agents/mai/traj_memory.py,sha256=2oEpwgz4YGT3KgW0BojFYEcsZL8WKlkaBJao0QcLHcY,2965
|
|
65
|
+
AutoGLM_GUI/api/__init__.py,sha256=gg-aRjfiaeFrXL9J8vRSo3hQd1fo9nt_xna5v-_wHwQ,6386
|
|
66
|
+
AutoGLM_GUI/api/agents.py,sha256=jF1CnaGhVviyRFoqcMrntpdrY_FuQ-O9GqWIYCi9eN8,20788
|
|
67
|
+
AutoGLM_GUI/api/control.py,sha256=mxklJ7o4Eb_nc-lZKKG86zMk2s5DHv3WGPatnyzQB44,3374
|
|
68
|
+
AutoGLM_GUI/api/devices.py,sha256=Unc8iMkEJK4QMRg3UUufz67UGmb_shabcCVQyzhZbjI,16215
|
|
69
|
+
AutoGLM_GUI/api/health.py,sha256=ZedFUv-IHst_YUyeQ_MpL5JXOKuOhWVlHBVwAY3MM0I,266
|
|
70
|
+
AutoGLM_GUI/api/history.py,sha256=GFJ3kphNAkQFATiWAzLVsCJPrjrJ6_LMGYwfUwTHy4c,3582
|
|
71
|
+
AutoGLM_GUI/api/layered_agent.py,sha256=T2O6oKX3BWGSe-OdzSNkrspibLx84lKxrJBYPO_tgck,28563
|
|
72
|
+
AutoGLM_GUI/api/mcp.py,sha256=BG-FKS9E7nZZMtJeKFht3Wy2Qx2fkdlf_Z4gBH204pc,4738
|
|
73
|
+
AutoGLM_GUI/api/media.py,sha256=Cwtk2cikZSBK8gV-igpdtx7bsGYyb2letOe4ZEj0-k4,3806
|
|
74
|
+
AutoGLM_GUI/api/metrics.py,sha256=2h5MnUiMTRAshD6nvcarLVoSlOjtlyVAGg-LRXq03vQ,941
|
|
75
|
+
AutoGLM_GUI/api/scheduled_tasks.py,sha256=BJvu2TlNfXw6C_y4lYYl-sxfcUQzyE6TYWf-jiVa2-Y,3622
|
|
76
|
+
AutoGLM_GUI/api/version.py,sha256=DYiSNNykJsxOXO1zvf3w5AcAtQJTs2c-qtA1HRVihx0,6085
|
|
77
|
+
AutoGLM_GUI/api/workflows.py,sha256=waYwlm2HxwkcfZwp7Bm2Z2l_bms6UmOy2xJEU9B_t0s,2431
|
|
78
|
+
AutoGLM_GUI/devices/__init__.py,sha256=3RHDxS3feJ1jGdWbDKeOHSFUogmexcEr9lpcXWhlnjg,1471
|
|
79
|
+
AutoGLM_GUI/devices/adb_device.py,sha256=uKgSMh7Dn7VPkfjkGltUqAgMcXsXBPIvG4dD3C__MOw,6334
|
|
80
|
+
AutoGLM_GUI/devices/mock_device.py,sha256=mUQrSbBhgYvneDWrhPCw6rWbfrnrJEmpSPpZFDfe3uQ,6164
|
|
81
|
+
AutoGLM_GUI/devices/remote_device.py,sha256=PXc2uoczKcDi7ovcIZoWcDA8U9CrIXDamyPApGXNXYI,5665
|
|
82
|
+
AutoGLM_GUI/model/__init__.py,sha256=eBat20fq5PyTUL_uRW33eQQzj6m3JQkG5rVgmDOgh3c,120
|
|
83
|
+
AutoGLM_GUI/model/message_builder.py,sha256=wUX3iFiR8kj2lBEpI9gJXVISzsW1AgvRVeIG4DaHmEQ,2148
|
|
84
|
+
AutoGLM_GUI/model/types.py,sha256=Lk96Nmn9U69RaT9OZbUgop2HvZK0Dx4ticCqpGgTsM8,750
|
|
85
|
+
AutoGLM_GUI/models/__init__.py,sha256=NYsb1EcyrcoSYeRYC9u4wEPfTmtEKUScxjd_RNrvIaQ,252
|
|
86
|
+
AutoGLM_GUI/models/history.py,sha256=v6_-VA-QQgwnh3SicsRaoDOIpPaB7Z1-AxionFp2OGI,4600
|
|
87
|
+
AutoGLM_GUI/models/scheduled_task.py,sha256=Z4qO9W72nRyI--gDLqAkO1AMN30B_SDAqZUeF7mQ6o8,2536
|
|
88
|
+
AutoGLM_GUI/parsers/__init__.py,sha256=pa5GK6zVJH0vxofZkkMf4UJmoqAUo29cxI9ujkBeI0E,693
|
|
89
|
+
AutoGLM_GUI/parsers/base.py,sha256=3HGsMAhIv5oQU9GjLGPzMDtDmhScpFQKYK1kaRhNm8w,1565
|
|
90
|
+
AutoGLM_GUI/parsers/phone_parser.py,sha256=JEgfZfpolmGM_j9F1gNZC1nxBNWXlo4h1k_JIyNuLCE,2053
|
|
91
|
+
AutoGLM_GUI/prompts/__init__.py,sha256=GtS7Ek3ds5G8orJj4R-2odjm1Hchje3cF1-1YaxZD38,1069
|
|
92
|
+
AutoGLM_GUI/static/favicon.ico,sha256=uB4wrcENiFaF-K4V-FzNp51XLW8GC4-ujpBDHgISfGM,781
|
|
93
|
+
AutoGLM_GUI/static/index.html,sha256=FCtzOZIYmfohUpAYyrrwHOmxG5DtbQb3KqkshNDIuM0,761
|
|
94
|
+
AutoGLM_GUI/static/logo-192.png,sha256=FOXgZxFrN0ZleO0VjlCnvD5cDkd1okJPkwPDZqsflNs,35243
|
|
95
|
+
AutoGLM_GUI/static/logo-512.png,sha256=HlwSg09dQ3_Jtb09Ght4l2VK3YNLZlP_941LCdpDkWk,251598
|
|
96
|
+
AutoGLM_GUI/static/assets/about-D7r9gCvG.js,sha256=seOsk-M_DHXatjXUUlZYJQbtxhwvPJ14fRNdjwAHwgg,155
|
|
97
|
+
AutoGLM_GUI/static/assets/alert-dialog-BKM-yRiQ.js,sha256=1O6BY4hgeqSy2hwv9w-xmxx-c_Ry1jvFFHkjrK3m114,3140
|
|
98
|
+
AutoGLM_GUI/static/assets/chat-k6TTD7PW.js,sha256=sImfeE_kZ__ivPWe5MijS5_0glwX8X_AEgyj6kyNG-8,303635
|
|
99
|
+
AutoGLM_GUI/static/assets/circle-alert-sohSDLhl.js,sha256=5xMBlF4WPbhveamsVQGYIXwWGTs0CwDSUP3G8p1rdsM,251
|
|
100
|
+
AutoGLM_GUI/static/assets/dialog-BgtPh0d5.js,sha256=kcxJBUYFd2A1EmheQM0pQnWUbOUY1_Q-P5nupdZQyuY,25373
|
|
101
|
+
AutoGLM_GUI/static/assets/eye-DLqKbQmg.js,sha256=Ad86MnhncrOj5RcogC6PNQ3SL0gV342VgoFmdaSoXz8,339
|
|
102
|
+
AutoGLM_GUI/static/assets/history-Bv1lfGUU.js,sha256=9Kc9TbTUTEOH1SqB9cw0fsCqj19kX1nbWAcW3nUpZr8,10787
|
|
103
|
+
AutoGLM_GUI/static/assets/index-CV7jGxGm.css,sha256=cw7HZ3DBylOyAOpqLz6j5bnSBvGL6mrqXb1hvBvWXjE,83985
|
|
104
|
+
AutoGLM_GUI/static/assets/index-CxWwh1VO.js,sha256=ID3boRolCifQ8hsRagoafrJDYzMORc0yS-1EKjOsLeA,229
|
|
105
|
+
AutoGLM_GUI/static/assets/index-SysdKciY.js,sha256=5sEYf0BuZt6nFcFXaLqn5vfWNjKGC1HYZDy2Ug7ZXo0,397346
|
|
106
|
+
AutoGLM_GUI/static/assets/label-DTUnzN4B.js,sha256=764q78RyiBfWmKVwIMw1I5SMpV8eDNyXAxjlqSkR29I,1679
|
|
107
|
+
AutoGLM_GUI/static/assets/logo-Cyfm06Ym.png,sha256=6GRUFH2KNmB4ZmnrmJ1wxpoIYEmOW-__XlmKImyAMKM,4955675
|
|
108
|
+
AutoGLM_GUI/static/assets/logs-BIhnDizW.js,sha256=Gc7De-WAn4LEbcUAwx5PPw9RZwFlPG3QDME5tP2PFjY,5048
|
|
109
|
+
AutoGLM_GUI/static/assets/popover-CikYqu2P.js,sha256=nDB58S6OJ0_7rp3RipIT4PbuxPz7HJCocL6avcC0Mos,5782
|
|
110
|
+
AutoGLM_GUI/static/assets/scheduled-tasks-B-KBsGbl.js,sha256=FnqVmjK5qv2VCQhGYat0nsc8PJzFUsVnYs3Iz0rBiWY,8326
|
|
111
|
+
AutoGLM_GUI/static/assets/textarea-knJZrz77.js,sha256=A-czfx0uSQvE7EkX6EyIUrNdcmCrKvUSMeRHVO94jcQ,705
|
|
112
|
+
AutoGLM_GUI/static/assets/worker-D6BRitjy.js,sha256=RL1NIRIks9dXdDhXOHK1cCg-OELT0uv9a6u_UEHfQ0Q,173494
|
|
113
|
+
AutoGLM_GUI/static/assets/workflows-DzcSYwLZ.js,sha256=BhyyZiXWyCi8cX4tIoXOrP-p-MaY8tx9xAq03WeNY9Q,3263
|
|
114
|
+
scrcpy-server-v3.3.3,sha256=fnAyO6fyWWSd1KzOl6xP77roECssbZHi575hP9U1S-A,90164
|
|
115
|
+
autoglm_gui-1.5.2.dist-info/METADATA,sha256=jUoi5L-efIuu350isKTvswuHSSRuS8fnhYSvXJd7fg8,22228
|
|
116
|
+
autoglm_gui-1.5.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
117
|
+
autoglm_gui-1.5.2.dist-info/entry_points.txt,sha256=sz4rBO_kgrYmOiT0QnhCCv0b9QqBdWyCjugJgY8AEOI,58
|
|
118
|
+
autoglm_gui-1.5.2.dist-info/licenses/LICENSE,sha256=0IkSHDewdtmXnmYzTNq4U47EJYjTuhjQNpT0bZKuqWc,11342
|
|
119
|
+
autoglm_gui-1.5.2.dist-info/RECORD,,
|
AutoGLM_GUI/device_adapter.py
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
"""Device Protocol Adapter for phone_agent integration.
|
|
2
|
-
|
|
3
|
-
This module provides an adapter that bridges DeviceProtocol implementations
|
|
4
|
-
to the interface expected by phone_agent's DeviceFactory.
|
|
5
|
-
|
|
6
|
-
The adapter allows injecting any DeviceProtocol implementation (ADB, Mock, Remote)
|
|
7
|
-
into phone_agent without modifying the third-party code.
|
|
8
|
-
|
|
9
|
-
Example:
|
|
10
|
-
>>> from AutoGLM_GUI.device_adapter import inject_device_protocol
|
|
11
|
-
>>> from AutoGLM_GUI.devices import MockDevice, ADBDevice
|
|
12
|
-
>>>
|
|
13
|
-
>>> # For testing: inject mock device
|
|
14
|
-
>>> mock = MockDevice("mock_001", state_machine)
|
|
15
|
-
>>> inject_device_protocol(lambda _: mock)
|
|
16
|
-
>>>
|
|
17
|
-
>>> # For production: inject ADB device
|
|
18
|
-
>>> devices = {"phone_1": ADBDevice("emulator-5554")}
|
|
19
|
-
>>> inject_device_protocol(lambda device_id: devices[device_id])
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
from typing import Callable
|
|
23
|
-
|
|
24
|
-
import phone_agent.device_factory as device_factory_module
|
|
25
|
-
from AutoGLM_GUI.device_protocol import DeviceProtocol, Screenshot
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class DeviceProtocolAdapter:
|
|
29
|
-
"""
|
|
30
|
-
Adapter that bridges DeviceProtocol to phone_agent's DeviceFactory interface.
|
|
31
|
-
|
|
32
|
-
This adapter wraps a DeviceProtocol getter function and exposes the same
|
|
33
|
-
interface as phone_agent's DeviceFactory, allowing seamless injection.
|
|
34
|
-
|
|
35
|
-
The adapter handles:
|
|
36
|
-
- Routing device operations to the correct DeviceProtocol instance
|
|
37
|
-
- Converting between DeviceProtocol and DeviceFactory method signatures
|
|
38
|
-
- Managing device_id parameters (phone_agent passes device_id to each method)
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
def __init__(
|
|
42
|
-
self,
|
|
43
|
-
get_device: Callable[[str | None], DeviceProtocol],
|
|
44
|
-
default_device_id: str | None = None,
|
|
45
|
-
):
|
|
46
|
-
"""
|
|
47
|
-
Initialize the adapter.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
get_device: Function that returns a DeviceProtocol given a device_id.
|
|
51
|
-
If device_id is None, should return a default device.
|
|
52
|
-
default_device_id: Default device ID to use when None is passed.
|
|
53
|
-
"""
|
|
54
|
-
self._get_device = get_device
|
|
55
|
-
self._default_device_id = default_device_id
|
|
56
|
-
# For compatibility with code that checks device_type
|
|
57
|
-
self.device_type = "protocol_adapter"
|
|
58
|
-
|
|
59
|
-
def _device(self, device_id: str | None) -> DeviceProtocol:
|
|
60
|
-
"""Get device for the given ID."""
|
|
61
|
-
effective_id = device_id or self._default_device_id
|
|
62
|
-
return self._get_device(effective_id)
|
|
63
|
-
|
|
64
|
-
# === Screenshot ===
|
|
65
|
-
def get_screenshot(
|
|
66
|
-
self, device_id: str | None = None, timeout: int = 10
|
|
67
|
-
) -> Screenshot:
|
|
68
|
-
"""Get screenshot from device."""
|
|
69
|
-
return self._device(device_id).get_screenshot(timeout)
|
|
70
|
-
|
|
71
|
-
# === Input Operations ===
|
|
72
|
-
def tap(
|
|
73
|
-
self, x: int, y: int, device_id: str | None = None, delay: float | None = None
|
|
74
|
-
) -> None:
|
|
75
|
-
"""Tap at coordinates."""
|
|
76
|
-
self._device(device_id).tap(x, y, delay)
|
|
77
|
-
|
|
78
|
-
def double_tap(
|
|
79
|
-
self, x: int, y: int, device_id: str | None = None, delay: float | None = None
|
|
80
|
-
) -> None:
|
|
81
|
-
"""Double tap at coordinates."""
|
|
82
|
-
self._device(device_id).double_tap(x, y, delay)
|
|
83
|
-
|
|
84
|
-
def long_press(
|
|
85
|
-
self,
|
|
86
|
-
x: int,
|
|
87
|
-
y: int,
|
|
88
|
-
duration_ms: int = 3000,
|
|
89
|
-
device_id: str | None = None,
|
|
90
|
-
delay: float | None = None,
|
|
91
|
-
) -> None:
|
|
92
|
-
"""Long press at coordinates."""
|
|
93
|
-
self._device(device_id).long_press(x, y, duration_ms, delay)
|
|
94
|
-
|
|
95
|
-
def swipe(
|
|
96
|
-
self,
|
|
97
|
-
start_x: int,
|
|
98
|
-
start_y: int,
|
|
99
|
-
end_x: int,
|
|
100
|
-
end_y: int,
|
|
101
|
-
duration_ms: int | None = None,
|
|
102
|
-
device_id: str | None = None,
|
|
103
|
-
delay: float | None = None,
|
|
104
|
-
) -> None:
|
|
105
|
-
"""Swipe from start to end."""
|
|
106
|
-
self._device(device_id).swipe(
|
|
107
|
-
start_x, start_y, end_x, end_y, duration_ms, delay
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
def type_text(self, text: str, device_id: str | None = None) -> None:
|
|
111
|
-
"""Type text."""
|
|
112
|
-
self._device(device_id).type_text(text)
|
|
113
|
-
|
|
114
|
-
def clear_text(self, device_id: str | None = None) -> None:
|
|
115
|
-
"""Clear text."""
|
|
116
|
-
self._device(device_id).clear_text()
|
|
117
|
-
|
|
118
|
-
# === Navigation ===
|
|
119
|
-
def back(self, device_id: str | None = None, delay: float | None = None) -> None:
|
|
120
|
-
"""Press back button."""
|
|
121
|
-
self._device(device_id).back(delay)
|
|
122
|
-
|
|
123
|
-
def home(self, device_id: str | None = None, delay: float | None = None) -> None:
|
|
124
|
-
"""Press home button."""
|
|
125
|
-
self._device(device_id).home(delay)
|
|
126
|
-
|
|
127
|
-
def launch_app(
|
|
128
|
-
self, app_name: str, device_id: str | None = None, delay: float | None = None
|
|
129
|
-
) -> bool:
|
|
130
|
-
"""Launch an app."""
|
|
131
|
-
return self._device(device_id).launch_app(app_name, delay)
|
|
132
|
-
|
|
133
|
-
# === State Query ===
|
|
134
|
-
def get_current_app(self, device_id: str | None = None) -> str:
|
|
135
|
-
"""Get current app name."""
|
|
136
|
-
return self._device(device_id).get_current_app()
|
|
137
|
-
|
|
138
|
-
# === Keyboard Management ===
|
|
139
|
-
def detect_and_set_adb_keyboard(self, device_id: str | None = None) -> str:
|
|
140
|
-
"""Detect and set keyboard."""
|
|
141
|
-
return self._device(device_id).detect_and_set_adb_keyboard()
|
|
142
|
-
|
|
143
|
-
def restore_keyboard(self, ime: str, device_id: str | None = None) -> None:
|
|
144
|
-
"""Restore keyboard."""
|
|
145
|
-
self._device(device_id).restore_keyboard(ime)
|
|
146
|
-
|
|
147
|
-
# === Device Management ===
|
|
148
|
-
def list_devices(self) -> list[str]:
|
|
149
|
-
"""
|
|
150
|
-
List connected devices.
|
|
151
|
-
|
|
152
|
-
Note: This is a simplified implementation. For full device listing,
|
|
153
|
-
use ADBDeviceManager.list_devices() directly.
|
|
154
|
-
"""
|
|
155
|
-
# This is called by some parts of phone_agent
|
|
156
|
-
# Return the default device if available
|
|
157
|
-
if self._default_device_id:
|
|
158
|
-
return [self._default_device_id]
|
|
159
|
-
return []
|
|
160
|
-
|
|
161
|
-
def get_connection_class(self):
|
|
162
|
-
"""Not applicable for protocol adapter."""
|
|
163
|
-
raise NotImplementedError(
|
|
164
|
-
"Protocol adapter does not support get_connection_class. "
|
|
165
|
-
"Use ADBDeviceManager for connection management."
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
# Store original factory for restoration
|
|
170
|
-
_original_factory = None
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
def inject_device_protocol(
|
|
174
|
-
get_device: Callable[[str | None], DeviceProtocol],
|
|
175
|
-
default_device_id: str | None = None,
|
|
176
|
-
) -> DeviceProtocolAdapter:
|
|
177
|
-
"""
|
|
178
|
-
Inject a DeviceProtocol implementation into phone_agent.
|
|
179
|
-
|
|
180
|
-
This replaces phone_agent's global _device_factory with an adapter
|
|
181
|
-
that routes all device operations through the provided DeviceProtocol.
|
|
182
|
-
|
|
183
|
-
Args:
|
|
184
|
-
get_device: Function that returns a DeviceProtocol given a device_id.
|
|
185
|
-
default_device_id: Default device ID when None is passed.
|
|
186
|
-
|
|
187
|
-
Returns:
|
|
188
|
-
The adapter instance (for inspection or further configuration).
|
|
189
|
-
|
|
190
|
-
Example:
|
|
191
|
-
>>> # Single mock device
|
|
192
|
-
>>> mock = MockDevice("mock_001", state_machine)
|
|
193
|
-
>>> inject_device_protocol(lambda _: mock)
|
|
194
|
-
>>>
|
|
195
|
-
>>> # Multiple devices
|
|
196
|
-
>>> devices = {
|
|
197
|
-
... "phone_1": ADBDevice("emulator-5554"),
|
|
198
|
-
... "phone_2": RemoteDevice("phone_2", "http://remote:8080"),
|
|
199
|
-
... }
|
|
200
|
-
>>> inject_device_protocol(lambda did: devices.get(did, devices["phone_1"]))
|
|
201
|
-
"""
|
|
202
|
-
# TODO: 不应该依赖这种全部变量
|
|
203
|
-
global _original_factory
|
|
204
|
-
|
|
205
|
-
# Save original factory if not already saved
|
|
206
|
-
if _original_factory is None:
|
|
207
|
-
_original_factory = device_factory_module._device_factory
|
|
208
|
-
|
|
209
|
-
# Create and inject adapter
|
|
210
|
-
adapter = DeviceProtocolAdapter(get_device, default_device_id)
|
|
211
|
-
device_factory_module._device_factory = adapter
|
|
212
|
-
|
|
213
|
-
return adapter
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def restore_device_factory() -> None:
|
|
217
|
-
"""
|
|
218
|
-
Restore the original device factory.
|
|
219
|
-
|
|
220
|
-
Call this after testing to restore normal operation.
|
|
221
|
-
"""
|
|
222
|
-
global _original_factory
|
|
223
|
-
|
|
224
|
-
if _original_factory is not None:
|
|
225
|
-
device_factory_module._device_factory = _original_factory
|
|
226
|
-
_original_factory = None
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
class DeviceProtocolContext:
|
|
230
|
-
"""
|
|
231
|
-
Context manager for temporarily injecting a DeviceProtocol.
|
|
232
|
-
|
|
233
|
-
Example:
|
|
234
|
-
>>> with DeviceProtocolContext(lambda _: mock_device):
|
|
235
|
-
... agent.run("test instruction")
|
|
236
|
-
>>> # Original factory is automatically restored
|
|
237
|
-
"""
|
|
238
|
-
|
|
239
|
-
def __init__(
|
|
240
|
-
self,
|
|
241
|
-
get_device: Callable[[str | None], DeviceProtocol],
|
|
242
|
-
default_device_id: str | None = None,
|
|
243
|
-
):
|
|
244
|
-
"""
|
|
245
|
-
Initialize context.
|
|
246
|
-
|
|
247
|
-
Args:
|
|
248
|
-
get_device: Function that returns a DeviceProtocol given a device_id.
|
|
249
|
-
default_device_id: Default device ID when None is passed.
|
|
250
|
-
"""
|
|
251
|
-
self._get_device = get_device
|
|
252
|
-
self._default_device_id = default_device_id
|
|
253
|
-
self._original_factory = None
|
|
254
|
-
|
|
255
|
-
def __enter__(self) -> DeviceProtocolAdapter:
|
|
256
|
-
"""Enter context and inject adapter."""
|
|
257
|
-
self._original_factory = device_factory_module._device_factory
|
|
258
|
-
return inject_device_protocol(self._get_device, self._default_device_id)
|
|
259
|
-
|
|
260
|
-
def __exit__(self, exc_type, exc_val, exc_tb) -> None:
|
|
261
|
-
"""Exit context and restore original factory."""
|
|
262
|
-
device_factory_module._device_factory = self._original_factory
|
|
263
|
-
return None
|