@kaeawc/auto-mobile 0.0.92 → 0.0.93
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.
- package/dist/build-info.json +12 -12
- package/dist/schemas/test-plan.schema.json +370 -52
- package/dist/src/{chunk-jhnbfj19.js → chunk-00167wan.js} +5 -5
- package/dist/src/chunk-0jrrsnc9.js +6 -0
- package/dist/src/chunk-0n6swkwg.js +5 -0
- package/dist/src/chunk-0qsy1qsx.js +57 -0
- package/dist/src/chunk-11m8wj8j.js +237 -0
- package/dist/src/{chunk-4pfftt07.js → chunk-1p7xf5kb.js} +3 -3
- package/dist/src/chunk-23p5f095.js +4 -0
- package/dist/src/{chunk-a4k9rt7z.js → chunk-26k317v5.js} +3 -3
- package/dist/src/chunk-284ptqa4.js +7 -0
- package/dist/src/chunk-28re4xrg.js +4 -0
- package/dist/src/chunk-2f9rkmhx.js +5 -0
- package/dist/src/chunk-2fxdh48t.js +4 -0
- package/dist/src/chunk-2tbdrbt6.js +4 -0
- package/dist/src/chunk-2tqzq5qh.js +971 -0
- package/dist/src/chunk-32gvv9b4.js +21 -0
- package/dist/src/chunk-3f3t1x97.js +8 -0
- package/dist/src/chunk-3fspkbc7.js +4 -0
- package/dist/src/chunk-3qwrzxh0.js +11 -0
- package/dist/src/chunk-3sy6ahhz.js +26 -0
- package/dist/src/chunk-3vg455e6.js +4 -0
- package/dist/src/chunk-3xkpk44w.js +5 -0
- package/dist/src/chunk-3y6eykz9.js +4 -0
- package/dist/src/chunk-49bsqdx3.js +4 -0
- package/dist/src/chunk-4hw3665t.js +42 -0
- package/dist/src/chunk-58wzr3mt.js +5 -0
- package/dist/src/chunk-5d2hft6c.js +5 -0
- package/dist/src/chunk-5snsn9cf.js +4 -0
- package/dist/src/chunk-5tm9mn47.js +54 -0
- package/dist/src/chunk-5zc77a5t.js +4 -0
- package/dist/src/chunk-64j0majr.js +19 -0
- package/dist/src/chunk-65y8v4td.js +17 -0
- package/dist/src/chunk-6awz7vhq.js +5 -0
- package/dist/src/{chunk-stfzjr9y.js → chunk-6bznss4t.js} +5 -5
- package/dist/src/chunk-6ep7f5ge.js +4 -0
- package/dist/src/{chunk-0dfnyfkh.js → chunk-6wt9rgjf.js} +3 -3
- package/dist/src/chunk-6xmss8er.js +8 -0
- package/dist/src/chunk-710rxz9y.js +5 -0
- package/dist/src/chunk-7cs2da62.js +5 -0
- package/dist/src/chunk-7g103b54.js +4 -0
- package/dist/src/chunk-7j5vj4pa.js +4 -0
- package/dist/src/chunk-7rz9898k.js +5 -0
- package/dist/src/chunk-7tw8x05v.js +4 -0
- package/dist/src/chunk-7zy586cb.js +4 -0
- package/dist/src/{chunk-r0f1q783.js → chunk-8037tzzj.js} +3 -3
- package/dist/src/chunk-84nanf8s.js +5 -0
- package/dist/src/{chunk-950qcq1e.js → chunk-8g1922rp.js} +4 -4
- package/dist/src/chunk-8gvwcv2p.js +4 -0
- package/dist/src/{chunk-sz1a7p43.js → chunk-8ph29g99.js} +1 -1
- package/dist/src/chunk-8thrmfat.js +4 -0
- package/dist/src/chunk-8zgzzs7k.js +78 -0
- package/dist/src/chunk-97b1zmaq.js +4 -0
- package/dist/src/chunk-9fth9ayh.js +4 -0
- package/dist/src/chunk-9j6anhjr.js +4 -0
- package/dist/src/{chunk-w7zsh13a.js → chunk-aabchzxk.js} +4 -4
- package/dist/src/{chunk-wry6skrm.js → chunk-ayp07wbb.js} +1 -1
- package/dist/src/chunk-bfjwqk8q.js +4 -0
- package/dist/src/{chunk-jdqvcq0a.js → chunk-bfw6125s.js} +3 -3
- package/dist/src/chunk-bnhscm2n.js +4 -0
- package/dist/src/chunk-bxmsax22.js +5 -0
- package/dist/src/chunk-c1vs4g1n.js +4 -0
- package/dist/src/chunk-ct3e7yng.js +4 -0
- package/dist/src/{chunk-8en08r7q.js → chunk-cyy71ggq.js} +3 -3
- package/dist/src/chunk-ddzkz92z.js +4 -0
- package/dist/src/chunk-dgrbdpb7.js +9 -0
- package/dist/src/chunk-drdz8hee.js +5 -0
- package/dist/src/chunk-e98dqnc9.js +145 -0
- package/dist/src/chunk-eersndy7.js +5 -0
- package/dist/src/chunk-eggq53ks.js +4 -0
- package/dist/src/chunk-f2dya7cs.js +4 -0
- package/dist/src/chunk-fbakd6cw.js +4 -0
- package/dist/src/chunk-fgb98zjj.js +5 -0
- package/dist/src/chunk-fmpad823.js +5 -0
- package/dist/src/{chunk-v90es00d.js → chunk-g04bwyj3.js} +2 -2
- package/dist/src/chunk-g0xr8zw0.js +4 -0
- package/dist/src/chunk-g3rjs80x.js +4 -0
- package/dist/src/chunk-g78rtrfv.js +4 -0
- package/dist/src/{chunk-r20pe1nv.js → chunk-g7tmjbkt.js} +3 -3
- package/dist/src/chunk-gabgv3y5.js +4 -0
- package/dist/src/chunk-gmr45m8f.js +4 -0
- package/dist/src/chunk-gsyfebqj.js +4 -0
- package/dist/src/chunk-h5rpn9wr.js +247 -0
- package/dist/src/chunk-hb1x7v55.js +4 -0
- package/dist/src/chunk-hrfytkxh.js +168 -0
- package/dist/src/chunk-j4yjzbak.js +4 -0
- package/dist/src/chunk-jd6a5v6p.js +5 -0
- package/dist/src/chunk-jh6vhqzx.js +5 -0
- package/dist/src/chunk-kn5spq15.js +4 -0
- package/dist/src/{chunk-w2mwa0jk.js → chunk-m94qs0f0.js} +2 -2
- package/dist/src/chunk-mjrps0ac.js +7 -0
- package/dist/src/chunk-n03dmn5q.js +5 -0
- package/dist/src/chunk-n72qhwd9.js +4 -0
- package/dist/src/{chunk-km0dy5vc.js → chunk-ndt1ccxm.js} +9 -9
- package/dist/src/chunk-nr6y0n4y.js +5 -0
- package/dist/src/chunk-pcsen2vs.js +4 -0
- package/dist/src/chunk-ppfr0b8h.js +4 -0
- package/dist/src/chunk-q10bdnat.js +4 -0
- package/dist/src/chunk-q9xmq595.js +4 -0
- package/dist/src/{chunk-2v7tw1nj.js → chunk-qcxzr2my.js} +3 -3
- package/dist/src/chunk-qf6nynk6.js +7 -0
- package/dist/src/chunk-qyqypn28.js +5 -0
- package/dist/src/chunk-r2epb56s.js +4 -0
- package/dist/src/chunk-r5bxavdx.js +311 -0
- package/dist/src/{chunk-r14wwk37.js → chunk-r6z1eztj.js} +12 -12
- package/dist/src/{chunk-d57432wq.js → chunk-r7bpkgff.js} +2 -2
- package/dist/src/chunk-r8jf3d92.js +4 -0
- package/dist/src/{chunk-9rkfyt6q.js → chunk-rbpdk7m0.js} +3 -3
- package/dist/src/chunk-rc0dbypm.js +4 -0
- package/dist/src/chunk-rhcty4ms.js +4 -0
- package/dist/src/chunk-rpvckv3p.js +4 -0
- package/dist/src/{chunk-s1zq65ny.js → chunk-rqc9ap3x.js} +2 -2
- package/dist/src/chunk-rvvy1bte.js +7 -0
- package/dist/src/chunk-ry0mz41y.js +4 -0
- package/dist/src/{chunk-34zxqcmq.js → chunk-s3jc6cwp.js} +3 -3
- package/dist/src/chunk-sfv61xjb.js +6 -0
- package/dist/src/chunk-t6bfvfkg.js +4 -0
- package/dist/src/chunk-t6c8akcm.js +5 -0
- package/dist/src/chunk-t7w8rctc.js +4 -0
- package/dist/src/chunk-thbh3jew.js +5 -0
- package/dist/src/chunk-v2wd4n3e.js +5 -0
- package/dist/src/{chunk-zg67wjkh.js → chunk-v6pya0dm.js} +3 -3
- package/dist/src/chunk-vy3bwm1d.js +17 -0
- package/dist/src/chunk-w3vs79ex.js +27 -0
- package/dist/src/chunk-w4zga19f.js +4 -0
- package/dist/src/chunk-w5b2jwk3.js +14 -0
- package/dist/src/chunk-w7hkv422.js +5 -0
- package/dist/src/{chunk-qv2918jt.js → chunk-waqwcjyn.js} +2 -2
- package/dist/src/{chunk-b4cxdzwy.js → chunk-wbh8spm5.js} +7 -7
- package/dist/src/{chunk-ajsrz473.js → chunk-wyrkw6hw.js} +3 -3
- package/dist/src/chunk-xa73x2cx.js +5 -0
- package/dist/src/{chunk-eka89q3k.js → chunk-xgan0qqp.js} +1 -1
- package/dist/src/chunk-y2vs6jwg.js +4 -0
- package/dist/src/chunk-yattm52s.js +4 -0
- package/dist/src/{chunk-9y5bcy28.js → chunk-yb97j25b.js} +4 -4
- package/dist/src/{chunk-c9nk1r78.js → chunk-ybbtagbt.js} +3 -3
- package/dist/src/chunk-ycaj2sgf.js +9 -0
- package/dist/src/chunk-yf7ympyz.js +325 -0
- package/dist/src/chunk-yjawdzk8.js +4 -0
- package/dist/src/chunk-z637nqg8.js +11 -0
- package/dist/src/{chunk-0w1spptt.js → chunk-zgja5f3p.js} +4 -4
- package/dist/src/chunk-zs1sghs9.js +4 -0
- package/dist/src/daemon/processEntry.js +2 -2
- package/dist/src/index.js +4 -4
- package/dist/src/runtime/bunRuntimeGuard.js +2 -2
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
- package/ios/CameraPosterInjection/Injection/CameraPosterInjection.m +466 -0
- package/package.json +3 -2
- package/schemas/test-plan.schema.json +370 -52
- package/dist/src/chunk-09442h7v.js +0 -4
- package/dist/src/chunk-0e4gm1kj.js +0 -5
- package/dist/src/chunk-0eb8576f.js +0 -4
- package/dist/src/chunk-0rjm4nx7.js +0 -5
- package/dist/src/chunk-1zmh2eak.js +0 -4
- package/dist/src/chunk-28k63ha3.js +0 -5
- package/dist/src/chunk-2d4wmp8b.js +0 -4
- package/dist/src/chunk-2e6s75qv.js +0 -78
- package/dist/src/chunk-32jpxz2y.js +0 -323
- package/dist/src/chunk-3jmvqygr.js +0 -238
- package/dist/src/chunk-3swvfhqt.js +0 -5
- package/dist/src/chunk-44bt78m9.js +0 -5
- package/dist/src/chunk-488vt2bp.js +0 -4
- package/dist/src/chunk-4fgdhcwx.js +0 -5
- package/dist/src/chunk-4jp2se4w.js +0 -4
- package/dist/src/chunk-4vhr9e4t.js +0 -4
- package/dist/src/chunk-4xd6zs3y.js +0 -15
- package/dist/src/chunk-51567pg8.js +0 -4
- package/dist/src/chunk-5agqsfev.js +0 -4
- package/dist/src/chunk-5d706gmr.js +0 -4
- package/dist/src/chunk-5kd4rqk7.js +0 -5
- package/dist/src/chunk-61t538bm.js +0 -4
- package/dist/src/chunk-6d3mmqxt.js +0 -54
- package/dist/src/chunk-6hyt398x.js +0 -5
- package/dist/src/chunk-6mnr8kpm.js +0 -4
- package/dist/src/chunk-79q5xsdc.js +0 -42
- package/dist/src/chunk-7bdgand3.js +0 -4
- package/dist/src/chunk-84cp9dw5.js +0 -4
- package/dist/src/chunk-86f2h5ww.js +0 -5
- package/dist/src/chunk-8cghfzb2.js +0 -19
- package/dist/src/chunk-9tf2p9y9.js +0 -5
- package/dist/src/chunk-a2sc4jm0.js +0 -5
- package/dist/src/chunk-aa5ng3d1.js +0 -4
- package/dist/src/chunk-b3h0a6ca.js +0 -4
- package/dist/src/chunk-b6a737qt.js +0 -4
- package/dist/src/chunk-bn64x5z5.js +0 -5
- package/dist/src/chunk-bvh649za.js +0 -12
- package/dist/src/chunk-c9tyfg4j.js +0 -26
- package/dist/src/chunk-cfsdfqnm.js +0 -4
- package/dist/src/chunk-cxyf04jc.js +0 -7
- package/dist/src/chunk-da08tx5v.js +0 -4
- package/dist/src/chunk-f2tc08m2.js +0 -4
- package/dist/src/chunk-f8tnk179.js +0 -5
- package/dist/src/chunk-f9s1kkhx.js +0 -5
- package/dist/src/chunk-fbp8a4rx.js +0 -4
- package/dist/src/chunk-fd2z0sze.js +0 -4
- package/dist/src/chunk-fk927f4q.js +0 -54
- package/dist/src/chunk-fxmr3a0f.js +0 -4
- package/dist/src/chunk-gaqwhd44.js +0 -4
- package/dist/src/chunk-ggtd5x5a.js +0 -5
- package/dist/src/chunk-gndcfrm7.js +0 -4
- package/dist/src/chunk-h3n4adc6.js +0 -310
- package/dist/src/chunk-h5pjbb83.js +0 -4
- package/dist/src/chunk-hgnnh302.js +0 -4
- package/dist/src/chunk-hmke8nhx.js +0 -5
- package/dist/src/chunk-j2bx12hn.js +0 -4
- package/dist/src/chunk-j70y1a2g.js +0 -4
- package/dist/src/chunk-js1jpyxp.js +0 -6
- package/dist/src/chunk-kbjq0qvb.js +0 -4
- package/dist/src/chunk-kfwx57xd.js +0 -4
- package/dist/src/chunk-kzwctna2.js +0 -4
- package/dist/src/chunk-m9ehyehy.js +0 -4
- package/dist/src/chunk-mct91p1f.js +0 -4
- package/dist/src/chunk-mf9spd4g.js +0 -5
- package/dist/src/chunk-mgrcansb.js +0 -4
- package/dist/src/chunk-mqc1d0eb.js +0 -6
- package/dist/src/chunk-n1zmpk0z.js +0 -4
- package/dist/src/chunk-ncyjf63g.js +0 -4
- package/dist/src/chunk-nr64d21q.js +0 -973
- package/dist/src/chunk-nwm2pq5v.js +0 -168
- package/dist/src/chunk-pm06b05d.js +0 -9
- package/dist/src/chunk-q50s00ry.js +0 -4
- package/dist/src/chunk-qwye1958.js +0 -14
- package/dist/src/chunk-r8z9pfve.js +0 -5
- package/dist/src/chunk-rdpgkjf6.js +0 -4
- package/dist/src/chunk-rkr0dks9.js +0 -5
- package/dist/src/chunk-rn84t3sf.js +0 -11
- package/dist/src/chunk-s123kn7n.js +0 -4
- package/dist/src/chunk-s73qn3fx.js +0 -4
- package/dist/src/chunk-sjn0nj4p.js +0 -5
- package/dist/src/chunk-sns0c35v.js +0 -7
- package/dist/src/chunk-t4dr5c8v.js +0 -8
- package/dist/src/chunk-tc8k9c1j.js +0 -4
- package/dist/src/chunk-teznhase.js +0 -4
- package/dist/src/chunk-ty9xgmz4.js +0 -4
- package/dist/src/chunk-tyazf3sk.js +0 -145
- package/dist/src/chunk-v6npjrjm.js +0 -5
- package/dist/src/chunk-vbvtzkwz.js +0 -5
- package/dist/src/chunk-vefd8qee.js +0 -8
- package/dist/src/chunk-vs9r72ta.js +0 -17
- package/dist/src/chunk-w88k0bgr.js +0 -4
- package/dist/src/chunk-wzdt0enk.js +0 -4
- package/dist/src/chunk-xhhv854c.js +0 -4
- package/dist/src/chunk-y58270hd.js +0 -4
- package/dist/src/chunk-yk0hmbex.js +0 -4
- package/dist/src/chunk-ympy4fdz.js +0 -28
- package/dist/src/chunk-yw436axy.js +0 -4
- package/dist/src/chunk-z04jrpjy.js +0 -5
- package/dist/src/chunk-z2xznczw.js +0 -4
- package/dist/src/chunk-z4xnrgps.js +0 -4
- package/dist/src/chunk-z7csyszv.js +0 -4
- package/dist/src/chunk-z8t0v07j.js +0 -11
- package/dist/src/chunk-z916af47.js +0 -228
- package/dist/src/chunk-zcr8he8q.js +0 -5
- package/dist/src/chunk-zd9vmkzn.js +0 -9
- package/dist/src/chunk-zj939v0h.js +0 -5
- package/dist/src/chunk-zkdjwtc1.js +0 -4
- package/dist/src/chunk-zkv5kzt6.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Tr,gt,ct,pe,ge,yV,pee,Fh}from"./chunk-e98dqnc9.js";import{f,Be,Pae}from"./chunk-58wzr3mt.js";import{i,e}from"./chunk-z637nqg8.js";import{Dr,N}from"./chunk-r5bxavdx.js";import{sS,Qi}from"./chunk-h5rpn9wr.js";import{FS}from"./chunk-hrfytkxh.js";import{NQ,Xy,Z4,Zy,Q4,ph,D0,m_,LQ}from"./chunk-64j0majr.js";import{n,a,Me,S,s,aP,Ne,_}from"./chunk-4hw3665t.js";import{r,t}from"./chunk-rbpdk7m0.js";var H="Invalid tools/call request: ",X="Invalid tools/call result: ",Z="AutoMobile drives Android and iOS devices. Start with listDevices, getAndroid or getApple, then bind your session. Call observe before acting and again after each action; element ids are only valid for the observation that returned them. Prefer tapOn/sendKeys on observed elements over raw coordinates. Large artifacts (screenshots, logs) are resources, not inline output. Read the automobile usage skill (skill://auto-mobile-usage/SKILL.md) for the full workflow before your first device call.";function ee(o=process.env){return Be(f.SERVER_INSTRUCTIONS,o)?Z:void 0}function rM(o,c,l={}){let{cacheHints:d,requestState:u,instructions:m=ee()}=l,p=new Fh(o,{capabilities:{...c,prompts:void 0},...d&&{cacheHints:d},...u&&{requestState:u},...m!==void 0&&{instructions:m}});if(c.prompts)p.server.registerCapabilities({prompts:c.prompts});return te(p.server),p}class q{result;constructor(o){this.result=o}}function te(o){let c=o._wrapHandler.bind(o);o._wrapHandler=(l,d)=>{if(l!=="tools/call")return c(l,(m,p)=>d(m,L(p)));let u=c(l,async(m,p)=>{let v=await d(m,L(p));if(ph(v))throw new q(v);return v});return async(m,p)=>{try{return await u(m,p)}catch(v){if(v instanceof q)return v.result;throw re(v)}}}}function re(o){if(!(o instanceof ge)||o instanceof Qi||o.code!==pe.InvalidParams)return o;if(o.message.startsWith(H))return new ge(sS.InternalError,o.message.slice(H.length),o.data);if(o.message.startsWith(X))return new Qi(sS.InvalidParams,o.message,o.data);return o}function L(o){return{...o,mcpReq:{...o.mcpReq,signal:oe(o.mcpReq.signal)}}}function oe(o){let c=new AbortController,l=()=>{c.abort(ne(o.reason)?void 0:o.reason)};if(o.aborted)l();else o.addEventListener("abort",l,{once:!0});return c.signal}function ne(o){return o instanceof ct&&o.code===gt.ConnectionClosed}var D="x-auto-mobile-mcp-session-id";function xU(o){let c=o["x-auto-mobile-mcp-session-id"],l=Array.isArray(c)?c[0]:c;return typeof l==="string"&&l.length>0?l:void 0}var w=s({version:_(1),toolName:n(),argumentsHash:n(),deviceIds:S(n())}),ie={createSecret:()=>crypto.getRandomValues(new Uint8Array(32))},z=600000,ae=w.extend({expiresAt:a().finite()});function se(o){let c=xU({[D]:o.http?.req?.headers.get(D)??void 0});return JSON.stringify(["ambiguous-device",c??null])}function ce(o={}){let c=o.timer??i,l,d=()=>(l??=NQ({key:(o.secretProvider??ie).createSecret(),ttlSeconds:z/1000,bind:se}),l);return{mint:(u,m)=>d().mint({...u,expiresAt:c.now()+z},m),verify:async(u,m)=>{let p=ae.parse(await d().verify(u,m));if(c.now()>=p.expiresAt)throw Error("expired");return w.parse(p)}}}var CU=ce();import{createHash as Se}from"crypto";function PE(o=process.env){return Pae(f.ELICITATION,o)!=="off"}class h{declined=new Set;static key(o){return[...new Set(o)].sort().join("\x00")}remembers(o){return this.declined.has(h.key(o))}remember(o){this.declined.add(h.key(o))}}function j(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function TP(o){let c=j(o)?o.elicitation:void 0;if(!j(c))return"none";if(c.form!==void 0)return"form";return c.url!==void 0?"url":"bare"}function le(o){return`[elicitation] ${o.toolName} era=${o.era} declared=${o.declared} outcome=${o.outcome} candidates=${o.candidateCount}`+(o.latencyMs===void 0?"":` latencyMs=${o.latencyMs}`)}var B={record:(o)=>e.info(le(o))};function OJ(o){return{record(c){B.record(c),o.recordElicitationEvent(c)}}}var K=B;function MJ(o){K=o}var AE={record:(o)=>K.record(o)};var de=20000;function U(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function nM(o){let c=U(o)?o.elicitation:void 0;if(!U(c))return!1;return c.form!==void 0||c.url===void 0}function V(o,c){return{declaresElicitation:()=>c.mcpReq.envelope===void 0&&nM(o.server.getClientCapabilities()),declaration:()=>c.mcpReq.envelope===void 0?TP(o.server.getClientCapabilities()):"none",elicit:(l,d)=>o.server.request({method:"elicitation/create",params:l},{signal:d})}}var ue=s({isError:_(!0),content:S(aP({type:n()})).min(1)}),me=s({code:_(FS),candidates:S(s({deviceId:n(),platform:n().default("unknown")}))}),fe=s({type:_("text"),text:n()});function ve(o){let c=ue.safeParse(o),l=c.success?fe.safeParse(c.data.content[0]):void 0;if(!l?.success||!l.data.text.includes(FS))return;try{let d=me.safeParse(JSON.parse(l.data.text));return d.success?d.data:void 0}catch(d){e.debug(`ambiguous device result is not JSON: ${r(d)}`);return}}function b(o){let c=new Map((ve(o)?.candidates??[]).map((l)=>[l.deviceId,l]));return c.size>1?[...c.values()]:void 0}function I(o,c){return{mode:"form",message:`${o} matched ${c.length} devices. Which device should it use?`,requestedSchema:{type:"object",properties:{deviceId:{type:"string",title:"Device",description:"The device this call should run on.",oneOf:c.map(({deviceId:l,platform:d})=>({const:l,title:`${l} (${d})`}))}},required:["deviceId"]}}}function ye(o,c){if(o.action!=="accept")return;let l=o.content?.deviceId;return typeof l==="string"&&c.some(({deviceId:d})=>d===l)?l:void 0}function Re(o,c){if(o.action!=="accept")return{outcome:o.action};let l=ye(o,c);return l===void 0?{outcome:"invalid"}:{outcome:"accept",deviceId:l}}async function Ce(o,c,l,d){let u=new AbortController,m=!1,p=()=>u.abort();d.callSignal.addEventListener("abort",p,{once:!0});let v=d.timer.setTimeout(()=>{m=!0,p()},d.timeoutMs);try{let g=await o.elicit(I(c,l),u.signal);return Re(g,l)}catch(g){if(u.signal.aborted)return e.debug(`device choice for ${c} not answered: ${r(g)}`),{outcome:m?"timeout":"cancel"};return e.warn(`device choice elicitation for ${c} failed: ${r(g)}`,g),{outcome:"error"}}finally{d.timer.clearTimeout(v),d.callSignal.removeEventListener("abort",p)}}function F(o,c,l={}){let d=l.timer??i,u=l.timeoutMs??de,m=l.recorder??AE,p=()=>c.declaration?.()??(c.declaresElicitation()?"form":"none"),v=l.enabled??(()=>PE()),g=(R,C,E)=>m.record({toolName:R.name,era:"legacy",declared:p(),outcome:E,candidateCount:C,atMs:d.now()}),y=(R)=>{if(!v())return"disabled";if(!c.declaresElicitation())return"not_offered";return l.declines?.remembers(R)?"remembered":void 0};return{...o,execute:async(R)=>{let C=await o.execute(R),E=R.args.deviceId===void 0?b(C):void 0;if(!E)return C;let x=E.map(({deviceId:Y})=>Y),A=y(x);if(A)return g(R,E.length,A),C;let Q=d.now(),T=await Ce(c,R.name,E,{timer:d,timeoutMs:u,callSignal:R.extra.signal}),O=d.now();if(m.record({toolName:R.name,era:"legacy",declared:p(),outcome:T.outcome,candidateCount:E.length,atMs:O,latencyMs:O-Q}),T.outcome==="decline"||T.outcome==="cancel")l.declines?.remember(x);return T.deviceId===void 0?C:o.execute({...R,args:{...R.args,deviceId:T.deviceId}})}}}async function DU(o,c,l,d){let u=await c(o),m=b(u);if(!m)return u;let p=d?.timer??i,v=p.now(),g=(C,E)=>{let x=p.now();d?.recorder.record({toolName:o.name,era:"modern",declared:d.declared,outcome:C,candidateCount:m.length,atMs:x,...E?{latencyMs:x-v}:{}})},y=await l({candidates:m,inputRequests:{deviceChoice:yV.elicit(I(o.name,m))}});if(!y)return g("not_offered",!1),u;if("pending"in y)return g("asked",!1),y.pending;let R=pee(y.responses,"deviceChoice",s({deviceId:n().refine((C)=>m.some(({deviceId:E})=>E===C)&&(y.offeredDeviceIds===void 0||y.offeredDeviceIds.includes(C)))}));return g(R?"accept":Ee(y.responses),!0),R?c({...o,args:{...o.args,deviceId:R.deviceId}}):u}function Ee(o){let c=o.deviceChoice,l=typeof c==="object"&&c!==null&&"action"in c?c.action:void 0;return l==="decline"||l==="cancel"?l:"invalid"}function W(o,c=AE,l=()=>PE()){return{...o,execute:async(d)=>{let u=!l();if(d.args.deviceId!==void 0||u||!nM(d.extra.envelope?.[Tr])){let v=await o.execute(d),g=d.args.deviceId===void 0&&b(v);if(g)xe(c,d,g.length,u?"disabled":"not_offered");return v}let m={...d.args};delete m.deviceId;let p=Se("sha256").update(Dr(m)).digest("hex");return DU(d,(v)=>o.execute(v),async({candidates:v,inputRequests:g})=>{if(d.extra.inputResponses!==void 0){let y=w.safeParse(d.extra.deviceChoiceState?.verified);if(!y.success||y.data.toolName!==d.name||y.data.argumentsHash!==p)return;return{responses:d.extra.inputResponses,offeredDeviceIds:y.data.deviceIds}}if(!d.extra.deviceChoiceState)return;return{pending:yV({requestState:await d.extra.deviceChoiceState.mint({version:1,toolName:d.name,argumentsHash:p,deviceIds:v.map(({deviceId:y})=>y)}),inputRequests:g})}},{recorder:c,declared:TP(d.extra.envelope?.[Tr])})}}}function xe(o,c,l,d){o.record({toolName:c.name,era:"modern",declared:TP(c.extra.envelope?.[Tr]),outcome:d,candidateCount:l,atMs:i.now()})}function Te(o,c){let l=o._meta?.progressToken;if(l===void 0)return;return async(d,u,m)=>{try{await o.sendNotification({method:"notifications/progress",params:{progressToken:l,progress:d,total:u,...m&&{message:m}}})}catch(p){e.warn(`${c}: ${p}`)}}}async function he(o,c,l){l.prepare?.(o);let d=o.params.name,u=o.params.arguments||{};if(!d)throw new t("Tool name is missing in the request");return l.execute({name:d,args:u,progressToken:c._meta?.progressToken,progress:Te(c,l.progressFailureMessage),extra:c})}function be(o,c){return{signal:o.mcpReq.signal,_meta:o.mcpReq._meta,...o.mcpReq.envelope!==void 0&&{envelope:o.mcpReq.envelope},...o.mcpReq.inputResponses!==void 0&&{inputResponses:o.mcpReq.inputResponses},...c&&{deviceChoiceState:{verified:o.mcpReq.requestState(),mint:(l)=>c.mint(l,o)}},sendNotification:(l)=>o.mcpReq.notify(l)}}function iM(o,c,l={}){let d=new h,u=l.era==="modern"?W(c):c,m=l.era==="modern"?l.deviceChoiceRequestState??CU:void 0;o.server.setRequestHandler("tools/call",async(p,v)=>await he(p,be(v,m),l.era!=="modern"&&l.ambiguousDeviceElicitation?F(c,V(o,v),{declines:d,...l.ambiguousDeviceElicitation}):u))}function Vb(o,c=N.isToolResultsNoStructuredContentEnabled()){if(!o)return"no-schema";if(c)return"flag";return null}function jK(o){return o!==null&&typeof o==="object"&&"structuredContent"in o}function Wb(o,c){if(c!==null&&jK(o))delete o.structuredContent;return o}var J=aP({taskId:n()}),we=aP({taskId:n(),inputResponses:Ne(n(),Me()).optional()});function KK(o){let c=o._oninitialize.bind(o);o.setRequestHandler("initialize",async(l,d)=>{let u=await c(l);if(!(Q4(l.params.capabilities)||G(d)))return u;return{...u,capabilities:{...u.capabilities,extensions:{...u.capabilities.extensions,[Xy]:{}}}}})}function G(o){return Zy({envelope:o.mcpReq.envelope,meta:o.mcpReq._meta})}function M(o){if(!G(o))throw D0()}function P(o){if(!o.ownerKey)throw m_("not_found");return o.ownerKey}function NJ(o,c){let l=o.server;KK(l),l.setRequestHandler("tasks/get",{params:J},async(d,u)=>{M(u);let m=await c.taskManager.get(P(c),d.taskId);return LQ(m)}),l.setRequestHandler("tasks/update",{params:we},async(d,u)=>{M(u);let m=u.mcpReq.inputResponses??d.inputResponses??{};return await c.taskManager.update(P(c),d.taskId,m),Z4}),l.setRequestHandler("tasks/cancel",{params:J},async(d,u)=>(M(u),await c.taskManager.cancel(P(c),d.taskId),Z4))}
|
|
3
|
+
export{rM,xU,CU,PE,TP,OJ,MJ,AE,nM,DU,iM,Vb,jK,Wb,KK,NJ};
|
|
4
|
+
|
|
5
|
+
//# debugId=907B41DE3198CE5664756E2164756E21
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{n,h,Xg,p,cE}from"./chunk-4hw3665t.js";var Pt=p(["android","ios","tvos","visionos"]),Vi=()=>p(["android","ios","watchos","tvos","visionos"]).optional().describe('Device platform. Name "watchos" to target an Apple Watch simulator, unless sessionUuid is a watch session. Name "tvos" for an Apple TV simulator; tools without tvOS support refuse it'),L5="Device label",T="Device id (Android serial such as emulator-5554, or iOS UDID) to target when several devices are booted",B5=h().optional().describe("Opt in to raw accessibility extras metadata in structuredContent only (default off). Only meaningful with project:'full' or raw:true; text content always omits extras."),wC=()=>h().optional().describe("Return the complete result as an automobile:tool-output resource and a resource_link block instead of inline (default off). Only the headline fields stay inline; read the link to get the rest."),kr={includeExtras:B5,raw:h().optional().describe("Return the raw view hierarchy instead of the compact skeleton"),project:p(["full","skeleton"]).optional().describe("Observation projection. 'skeleton' (default) returns a flat, actionable-only list (elementId/label/bounds/affordances) under `skeleton` in place of `viewHierarchy`; 'full' returns the raw view hierarchy under `viewHierarchy`. Each skeleton elementId/label is directly usable as a tapOn selector, except the collapsed keyboard row `<ime>` (drive it with sendKeys); re-request with raw/project:'full' to disambiguate.")},RC=["packageId","package","packageName","appPackage","appPackageId","bundle","bundleId","bundleID","bundleIdentifier","application","applicationId","applicationIdentifier","app","appIdentifier","package_id","package_name","bundle_id","application_id"],$5=/^[A-Za-z0-9._-]+$/,U5=256,P=n().trim().refine((e)=>e.length>0&&e.length<=U5&&$5.test(e),{error:(e)=>`appId must be a reverse-DNS identifier such as com.example.app; got: ${e.input}`}),A=new WeakMap,k=new WeakMap,b=new WeakSet;function zt(e,t){return A.set(e,t),e}function QF(e,t){return k.set(e,t),e}function eL(e,t){let r=t?e.describe(t):e;return zt(r,(o)=>{if(t)o.description=t})}function tL(e){if(x(e),Object.hasOwn(e,"allOf")){let t=e.allOf;if(Array.isArray(t))E(e,t);delete e.allOf}for(let t of["anyOf","oneOf","not","if","then","else"])if(Object.hasOwn(e,t))throw Error(`Anthropic input schema has unsupported root ${t}`);if(e.type!=="object")throw Error("Anthropic input schema root must have type object")}function x(e){delete e.if,delete e.then,delete e.else,delete e.not;let t=e.oneOf;if(Array.isArray(t)){let r=e.anyOf;e.anyOf=Array.isArray(r)?[...r,...t]:t}delete e.oneOf,l(e.properties),l(e.$defs),l(e.definitions),z(e.items),u(e.prefixItems),c(e.additionalProperties),u(e.anyOf),u(e.allOf),c(e.contains),l(e.patternProperties),g(e,"anyOf"),g(e,"allOf")}function l(e){if(!d(e))return;Object.values(e).forEach(c)}function c(e){if(d(e))x(e)}function z(e){if(Array.isArray(e))e.forEach(c);else c(e)}function u(e){if(Array.isArray(e))e.forEach(c)}function g(e,t){let r=e[t];if(!Array.isArray(r))return;let o=r.filter((i)=>!d(i)||Object.keys(i).length>0);if(o.length===0)delete e[t];else e[t]=o}function E(e,t){let r=w(e.properties)??{},o=O(e);for(let i of t){if(!d(i))continue;let s=w(i.properties);if(s)Object.assign(r,s);o.push(...O(i))}if(Object.keys(r).length>0)e.properties=r;if(o.length>0)e.required=[...new Set(o)]}function O(e){let t=e.required;return Array.isArray(t)&&t.every((r)=>typeof r==="string")?t:[]}function w(e){return d(e)?e:void 0}function d(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Yee(e,t){A.get(e)?.(t)}function Jee(e,t){k.get(e)?.(t)}function H5(e){if(b.has(e))return!0;return e instanceof Xg&&e.shape.deviceId===I.deviceId}function D(e){let t={},r=[],o=!0;for(let i of e){let s=i;if(s?.type!=="object"||typeof s.properties!=="object"||!Array.isArray(s.required)||s.required.length!==1||Object.keys(s.properties).length!==1){o=!1;break}let a=s.required[0];if(!(a in s.properties)){o=!1;break}t[a]=s.properties[a],r.push({required:[a]})}if(!o)return null;return{compact:{type:"object",additionalProperties:!1,properties:t},anyOf:r}}function gT(e,t){let r=e.properties;if(!r)return;for(let o of t){let i=r[o],s=i?.anyOf??i?.oneOf;if(!Array.isArray(s)||s.length<2)continue;let a=D(s);if(!a)continue;let{compact:f,anyOf:R}=a;if(typeof i.description==="string")f.description=i.description;f.anyOf=R,r[o]=f}}function C(e,t){let r=cE((o)=>m(o,t),e);if(H5(e))b.add(r);return r}function jt(e){return C(e,{appId:RC}).superRefine((r,o)=>{y(r,o)})}function y(e,t,r=[]){if(Array.isArray(e)){e.forEach((o,i)=>y(o,t,[...r,i]));return}if(!v(e))return;for(let[o,i]of Object.entries(e)){let s=[...r,o];if(o==="appId"&&typeof i==="string"){let a=P.safeParse(i);if(!a.success)t.addIssue({code:"custom",path:s,message:a.error.issues[0]?.message??"appId must be a valid application ID"})}y(i,t,s)}}function m(e,t){if(Array.isArray(e))return e.map((o)=>m(o,t));if(!v(e))return e;let r={};for(let[o,i]of Object.entries(e))r[o]=m(i,t);for(let[o,i]of Object.entries(t)){if(r[o]===void 0){let s=i.find((a)=>r[a]!==void 0);if(s)r[o]=r[s]}for(let s of i)delete r[s]}if(typeof r.appId==="string")r.appId=r.appId.trim();return r}function v(e){if(typeof e!=="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}var S={sessionUuid:n().optional().describe("Session"),keepScreenAwake:h().optional()},I={platform:Pt.optional(),...S,device:n().optional().describe(L5),deviceId:n().optional().describe(T)};function j(e,t){return e.extend({...t,...e.shape})}function km(e){return j(e,S)}function se(e){let t=j(e,I);if(!("deviceId"in e.shape))b.add(t);return t}
|
|
3
|
+
export{Pt,Vi,L5,B5,wC,kr,RC,$5,U5,zt,QF,eL,tL,Yee,Jee,H5,gT,jt,km,se};
|
|
4
|
+
|
|
5
|
+
//# debugId=E16B15D73EC140A264756E2164756E21
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{vV}from"./chunk-s3jc6cwp.js";import"./chunk-3f3t1x97.js";import"./chunk-w7hkv422.js";import"./chunk-thbh3jew.js";import"./chunk-vy3bwm1d.js";import"./chunk-ycaj2sgf.js";import"./chunk-7rz9898k.js";import"./chunk-qyqypn28.js";import"./chunk-fgb98zjj.js";import"./chunk-3xkpk44w.js";import"./chunk-0qsy1qsx.js";import"./chunk-zgja5f3p.js";import"./chunk-rvvy1bte.js";import"./chunk-r5bxavdx.js";import"./chunk-yf7ympyz.js";import"./chunk-4hw3665t.js";import"./chunk-5d2hft6c.js";import"./chunk-z637nqg8.js";import"./chunk-58wzr3mt.js";export{vV as InputText};
|
|
3
|
+
|
|
4
|
+
//# debugId=2BD32C6D83C9358664756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ZC,Pi,sf,Hs,si}from"./chunk-r5bxavdx.js";import"./chunk-58wzr3mt.js";import"./chunk-z637nqg8.js";import"./chunk-yf7ympyz.js";import"./chunk-5d2hft6c.js";import{jy,kA,EA,J7,MS}from"./chunk-hrfytkxh.js";import{Lh}from"./chunk-84nanf8s.js";import{t}from"./chunk-rbpdk7m0.js";function m(r,o,e){let i=sf(r,o);if(!i.value)throw new t(`${e} requires a value.`);return{value:i.value,consumed:i.last-o}}function v(r,o){let e=Hs(Pi(r).inlineValue);if(e===void 0)throw new t(`${o} must be true or false.`);return e}function d(r){let o={preferRunning:!0};for(let e=0;e<r.length;e++)e+=f(o,r,e,Pi(r[e]).flag);if(o.platform!=="android"&&o.platform!=="ios")throw new t("--platform must be android or ios.");return o}function f(r,o,e,i){let u={"--platform":"platform","--device-id":"deviceId","--name":"name","--min-os-version":"minOsVersion","--max-os-version":"maxOsVersion"}[i];if(u){let{value:s,consumed:a}=m(o,e,i);return r[u]=s,a}if(i==="--timeout-ms"){let{value:s,consumed:a}=m(o,e,i),c=Number(s);if(!Number.isFinite(c)||c<=0)throw new t("--timeout-ms must be a positive number.");return r.timeoutMs=c,a}if(i==="--create-if-missing")return r.createIfMissing=v(o[e],i),0;if(i==="--no-prefer-running")return r.preferRunning=!v(o[e],i),0;throw new t(`Unknown boot-device argument: ${i}`)}async function I(r){let o=d(r),e=await J7(o),n=await new MS({deviceManager:e?.deviceManager??new si,deviceMatcher:new ZC,deviceCreationGate:kA(),deviceProvisioner:e?.deviceProvisioner??EA(void 0,void 0,jy()),matchingStrategy:Lh,bootRecovery:e?.recovery}).boot(e?.request??o);console.log(JSON.stringify({deviceId:n.device.deviceId,name:n.device.name,platform:n.device.platform,osVersion:n.device.osVersion,source:n.source,processId:n.processId,provisioned:n.provisioned}))}export{I as runBootDeviceCommand};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=6DB7911BF534575A64756E2164756E21
|