@kaeawc/auto-mobile 0.0.91 → 0.0.92
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/README.md +16 -0
- package/dist/schemas/prototype-icon-names.json +302 -0
- package/dist/src/chunk-09442h7v.js +4 -0
- package/dist/src/chunk-0dfnyfkh.js +5 -0
- package/dist/src/chunk-0e4gm1kj.js +5 -0
- package/dist/src/chunk-0eb8576f.js +4 -0
- package/dist/src/chunk-0rjm4nx7.js +5 -0
- package/dist/src/chunk-0w1spptt.js +6 -0
- package/dist/src/chunk-1zmh2eak.js +4 -0
- package/dist/src/chunk-28k63ha3.js +5 -0
- package/dist/src/chunk-2d4wmp8b.js +4 -0
- package/dist/src/chunk-2e6s75qv.js +78 -0
- package/dist/src/chunk-2v7tw1nj.js +5 -0
- package/dist/src/chunk-32jpxz2y.js +323 -0
- package/dist/src/chunk-34zxqcmq.js +5 -0
- package/dist/src/chunk-3jmvqygr.js +238 -0
- package/dist/src/chunk-3swvfhqt.js +5 -0
- package/dist/src/chunk-44bt78m9.js +5 -0
- package/dist/src/chunk-488vt2bp.js +4 -0
- package/dist/src/chunk-4fgdhcwx.js +5 -0
- package/dist/src/chunk-4jp2se4w.js +4 -0
- package/dist/src/chunk-4pfftt07.js +5 -0
- package/dist/src/chunk-4vhr9e4t.js +4 -0
- package/dist/src/chunk-4xd6zs3y.js +15 -0
- package/dist/src/chunk-51567pg8.js +4 -0
- package/dist/src/chunk-5agqsfev.js +4 -0
- package/dist/src/chunk-5d706gmr.js +4 -0
- package/dist/src/chunk-5kd4rqk7.js +5 -0
- package/dist/src/chunk-5s645vr4.js +4 -0
- package/dist/src/chunk-61t538bm.js +4 -0
- package/dist/src/chunk-6d3mmqxt.js +54 -0
- package/dist/src/chunk-6hyt398x.js +5 -0
- package/dist/src/chunk-6mnr8kpm.js +4 -0
- package/dist/src/chunk-6pg7bqck.js +4 -0
- package/dist/src/chunk-79q5xsdc.js +42 -0
- package/dist/src/chunk-7bdgand3.js +4 -0
- package/dist/src/chunk-84cp9dw5.js +4 -0
- package/dist/src/chunk-86f2h5ww.js +5 -0
- package/dist/src/chunk-8cghfzb2.js +19 -0
- package/dist/src/chunk-8en08r7q.js +5 -0
- package/dist/src/chunk-950qcq1e.js +10 -0
- package/dist/src/chunk-9rkfyt6q.js +5 -0
- package/dist/src/chunk-9tf2p9y9.js +5 -0
- package/dist/src/chunk-9y5bcy28.js +6 -0
- package/dist/src/chunk-a2sc4jm0.js +5 -0
- package/dist/src/chunk-a4k9rt7z.js +5 -0
- package/dist/src/chunk-aa5ng3d1.js +4 -0
- package/dist/src/chunk-ajsrz473.js +5 -0
- package/dist/src/chunk-b3h0a6ca.js +4 -0
- package/dist/src/chunk-b4cxdzwy.js +20 -0
- package/dist/src/chunk-b6a737qt.js +4 -0
- package/dist/src/chunk-bn64x5z5.js +5 -0
- package/dist/src/chunk-bvh649za.js +12 -0
- package/dist/src/chunk-c9nk1r78.js +5 -0
- package/dist/src/chunk-c9tyfg4j.js +26 -0
- package/dist/src/chunk-cfsdfqnm.js +4 -0
- package/dist/src/chunk-cxyf04jc.js +7 -0
- package/dist/src/chunk-d57432wq.js +4 -0
- package/dist/src/chunk-da08tx5v.js +4 -0
- package/dist/src/chunk-eka89q3k.js +4 -0
- package/dist/src/chunk-f2tc08m2.js +4 -0
- package/dist/src/chunk-f8tnk179.js +5 -0
- package/dist/src/chunk-f9s1kkhx.js +5 -0
- package/dist/src/chunk-fbp8a4rx.js +4 -0
- package/dist/src/chunk-fd2z0sze.js +4 -0
- package/dist/src/chunk-fk927f4q.js +54 -0
- package/dist/src/chunk-fxmr3a0f.js +4 -0
- package/dist/src/chunk-gaqwhd44.js +4 -0
- package/dist/src/chunk-ggtd5x5a.js +5 -0
- package/dist/src/chunk-gndcfrm7.js +4 -0
- package/dist/src/chunk-h3n4adc6.js +310 -0
- package/dist/src/chunk-h5pjbb83.js +4 -0
- package/dist/src/chunk-hgnnh302.js +4 -0
- package/dist/src/chunk-hmke8nhx.js +5 -0
- package/dist/src/chunk-j2bx12hn.js +4 -0
- package/dist/src/chunk-j70y1a2g.js +4 -0
- package/dist/src/chunk-jdqvcq0a.js +5 -0
- package/dist/src/chunk-jhnbfj19.js +55 -0
- package/dist/src/chunk-js1jpyxp.js +6 -0
- package/dist/src/chunk-kbjq0qvb.js +4 -0
- package/dist/src/chunk-kfwx57xd.js +4 -0
- package/dist/src/chunk-km0dy5vc.js +71 -0
- package/dist/src/chunk-kzwctna2.js +4 -0
- package/dist/src/chunk-m9ehyehy.js +4 -0
- package/dist/src/chunk-mct91p1f.js +4 -0
- package/dist/src/chunk-mf9spd4g.js +5 -0
- package/dist/src/chunk-mgrcansb.js +4 -0
- package/dist/src/chunk-mqc1d0eb.js +6 -0
- package/dist/src/chunk-n1zmpk0z.js +4 -0
- package/dist/src/chunk-ncyjf63g.js +4 -0
- package/dist/src/chunk-nr64d21q.js +973 -0
- package/dist/src/chunk-nwm2pq5v.js +168 -0
- package/dist/src/chunk-pm06b05d.js +9 -0
- package/dist/src/chunk-q50s00ry.js +4 -0
- package/dist/src/chunk-qv2918jt.js +4 -0
- package/dist/src/chunk-qwye1958.js +14 -0
- package/dist/src/chunk-r0f1q783.js +5 -0
- package/dist/src/chunk-r14wwk37.js +18 -0
- package/dist/src/chunk-r20pe1nv.js +5 -0
- package/dist/src/chunk-r8z9pfve.js +5 -0
- package/dist/src/chunk-rdpgkjf6.js +4 -0
- package/dist/src/chunk-rkr0dks9.js +5 -0
- package/dist/src/chunk-rn84t3sf.js +11 -0
- package/dist/src/chunk-s123kn7n.js +4 -0
- package/dist/src/chunk-s1zq65ny.js +4 -0
- package/dist/src/chunk-s73qn3fx.js +4 -0
- package/dist/src/chunk-sjn0nj4p.js +5 -0
- package/dist/src/chunk-sns0c35v.js +7 -0
- package/dist/src/chunk-stfzjr9y.js +8 -0
- package/dist/src/chunk-sz1a7p43.js +4 -0
- package/dist/src/chunk-t4dr5c8v.js +8 -0
- package/dist/src/chunk-tc8k9c1j.js +4 -0
- package/dist/src/chunk-teznhase.js +4 -0
- package/dist/src/chunk-ty9xgmz4.js +4 -0
- package/dist/src/chunk-tyazf3sk.js +145 -0
- package/dist/src/chunk-v6npjrjm.js +5 -0
- package/dist/src/chunk-v90es00d.js +4 -0
- package/dist/src/chunk-vbvtzkwz.js +5 -0
- package/dist/src/chunk-vefd8qee.js +8 -0
- package/dist/src/chunk-vs9r72ta.js +17 -0
- package/dist/src/chunk-w2mwa0jk.js +4 -0
- package/dist/src/chunk-w7zsh13a.js +9 -0
- package/dist/src/chunk-w88k0bgr.js +4 -0
- package/dist/src/chunk-wry6skrm.js +4 -0
- package/dist/src/chunk-wzdt0enk.js +4 -0
- package/dist/src/chunk-xhhv854c.js +4 -0
- package/dist/src/chunk-y58270hd.js +4 -0
- package/dist/src/chunk-yk0hmbex.js +4 -0
- package/dist/src/chunk-ympy4fdz.js +28 -0
- package/dist/src/chunk-yw436axy.js +4 -0
- package/dist/src/chunk-z04jrpjy.js +5 -0
- package/dist/src/chunk-z2xznczw.js +4 -0
- package/dist/src/chunk-z4xnrgps.js +4 -0
- package/dist/src/chunk-z7csyszv.js +4 -0
- package/dist/src/chunk-z8t0v07j.js +11 -0
- package/dist/src/chunk-z916af47.js +228 -0
- package/dist/src/chunk-zcr8he8q.js +5 -0
- package/dist/src/chunk-zd9vmkzn.js +9 -0
- package/dist/src/chunk-zg67wjkh.js +5 -0
- package/dist/src/chunk-zj939v0h.js +5 -0
- package/dist/src/chunk-zkdjwtc1.js +4 -0
- package/dist/src/chunk-zkv5kzt6.js +4 -0
- package/dist/src/daemon/processEntry.js +4 -0
- package/dist/src/index.js +4 -2843
- package/dist/src/runtime/bunRuntimeGuard.js +4 -0
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -3
- package/package.json +5 -5
- package/schemas/README.md +16 -0
- package/schemas/prototype-icon-names.json +302 -0
- package/node_modules/@borewit/text-codec/README.md +0 -87
- package/node_modules/@jimp/diff/node_modules/pixelmatch/README.md +0 -110
- package/node_modules/@jimp/diff/node_modules/pixelmatch/node_modules/pngjs/README.md +0 -433
- package/node_modules/@jimp/file-ops/dist/browser/index.js +0 -8
- package/node_modules/@jimp/js-png/README.md +0 -35
- package/node_modules/@jimp/js-png/src/__image_snapshots__/index-node-test-ts-png-should-use-png-options-1-snap.png +0 -0
- package/node_modules/@jimp/js-png/src/output.png +0 -0
- package/node_modules/@jimp/js-png/vitest.config.browser.mjs +0 -3
- package/node_modules/@jimp/plugin-resize/README.md +0 -12
- package/node_modules/@jimp/plugin-resize/vitest.config.browser.mjs +0 -3
- package/node_modules/@tokenizer/inflate/README.md +0 -114
- package/node_modules/@tokenizer/token/README.md +0 -19
- package/node_modules/await-to-js/README.md +0 -82
- package/node_modules/debug/README.md +0 -481
- package/node_modules/exif-parser/README.md +0 -83
- package/node_modules/file-type/readme.md +0 -667
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/mime/README.md +0 -178
- package/node_modules/ms/readme.md +0 -59
- package/node_modules/parse-bmfont-xml/README.md +0 -74
- package/node_modules/parse-bmfont-xml/lib/browser.js +0 -85
- package/node_modules/parse-bmfont-xml/node_modules/xml2js/README.md +0 -507
- package/node_modules/pngjs/README.md +0 -287
- package/node_modules/sax/README.md +0 -228
- package/node_modules/strtok3/README.md +0 -795
- package/node_modules/tinycolor2/README.md +0 -492
- package/node_modules/tinycolor2/cjs/test.js +0 -2191
- package/node_modules/tinycolor2/cjs/test_template.js +0 -26
- package/node_modules/tinycolor2/deno_asserts@0.168.0.mjs +0 -807
- package/node_modules/tinycolor2/esm/test.js +0 -2189
- package/node_modules/tinycolor2/esm/test_template.js +0 -24
- package/node_modules/tinycolor2/tinycolor.js +0 -1191
- package/node_modules/token-types/README.md +0 -160
- package/node_modules/uint8array-extras/readme.md +0 -318
- package/node_modules/xml-parse-from-string/README.md +0 -35
- package/node_modules/xmlbuilder/README.md +0 -86
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/v4/locales/ar.d.cts +0 -4
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.d.cts +0 -4
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.d.cts +0 -4
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.d.cts +0 -4
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.d.cts +0 -4
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.d.cts +0 -4
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/es.d.cts +0 -4
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.d.cts +0 -4
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.d.cts +0 -4
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.d.cts +0 -4
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.d.cts +0 -4
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.d.cts +0 -4
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/index.d.cts +0 -39
- package/node_modules/zod/v4/locales/index.d.ts +0 -39
- package/node_modules/zod/v4/locales/it.d.cts +0 -4
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.d.cts +0 -4
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/kh.d.cts +0 -4
- package/node_modules/zod/v4/locales/kh.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.d.cts +0 -4
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.d.cts +0 -4
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.d.cts +0 -4
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.d.cts +0 -4
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.d.cts +0 -4
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.d.cts +0 -4
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.d.cts +0 -4
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.d.cts +0 -4
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.d.cts +0 -4
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.d.cts +0 -4
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.d.cts +0 -4
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.d.cts +0 -4
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.d.cts +0 -4
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.d.cts +0 -4
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.d.cts +0 -4
- package/node_modules/zod/v4/locales/ua.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.d.cts +0 -4
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.d.cts +0 -4
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{L}from"./chunk-32jpxz2y.js";import{i,hd,Ae,Xe,si,l,e}from"./chunk-z8t0v07j.js";import{g,ft}from"./chunk-mf9spd4g.js";import{Ge,U,at,To,Pe,Ce,R5,zee,jee,Qi,qn,eB}from"./chunk-h3n4adc6.js";import{nV,Ln,B4,yo,rT,J4,wa}from"./chunk-6d3mmqxt.js";import{r,t,u}from"./chunk-9rkfyt6q.js";import{access as Q}from"fs/promises";import{existsSync as M}from"fs";import{access as Y}from"fs/promises";import{dirname as E,join as S}from"path";import{fileURLToPath as z}from"url";var P=S("ios","control-proxy","CtrlProxy.xcodeproj");async function X(n,o={}){let s=o.access??Y,c=[Ae(n),(o.launchDirectory??(()=>hd()))(),(o.packageRoot??K)()].filter((d)=>typeof d==="string"&&d.length>0),a=[...new Set(c.map((d)=>S(d,P)))];for(let d of a)try{return await s(d),{found:!0,projectPath:d,checked:a}}catch(h){e.debug(`CtrlProxy project not at ${d}: ${r(h)}`)}return{found:!1,checked:a}}var A;function K(){if(A===void 0){let n=E(z(import.meta.url));while(!M(S(n,"package.json"))&&E(n)!==n)n=E(n);A=M(S(n,"package.json"))?n:null}return A??void 0}var x="CtrlProxyWatch";class I{dependencies;builds=new at;constructor(n){this.dependencies=n}async resolve(n){n?.throwIfAborted();let o=(this.dependencies.override??(()=>ft(g.WATCH_RUNNER_XCTESTRUN)))();if(o){let d=Ae(o);return await(this.dependencies.access??Q)(d),d}let s=this.dependencies.builder,c=await s.getXctestrunPath("watchSimulator");if(c)return c;let a=s.getConfig();return await this.builds.run(a.derivedDataPath,async(d)=>await U(d,async()=>{let h=async()=>{d?.throwIfAborted();let p=await X(a.projectRoot,{...this.dependencies.projectLocator,access:this.dependencies.access});if(!p.found)throw q(p.checked,a.derivedDataPath);let m=p.projectPath;await(this.dependencies.xcodebuild??new qn).executeCommand(["build-for-testing","-project",m,"-scheme",x,"-destination","generic/platform=watchOS Simulator","-derivedDataPath",a.derivedDataPath,"CODE_SIGNING_ALLOWED=NO"],{signal:d,timeoutMs:120000});let y=await s.getXctestrunPath("watchSimulator");if(!y)throw new t(`No watchsimulator xctestrun found in ${a.derivedDataPath}/Build/Products after building ${x}; set ${g.WATCH_RUNNER_XCTESTRUN.name} to a prebuilt watch runner.`);return y};return s.runExclusiveOnDerivedData?await s.runExclusiveOnDerivedData(h):await h()}),n,{cancelWhenAllWaitersAbort:!0})}}function Z(n,o){return`xcodebuild build-for-testing -project ${n} -scheme ${x} -destination 'generic/platform=watchOS Simulator' -derivedDataPath ${o} CODE_SIGNING_ALLOWED=NO`}function q(n,o){return new t([`The ${x} watch runner is not built in ${o} and ${P} was not found at: ${n.join(", ")}.`,`From an AutoMobile checkout, set ${g.PROJECT_ROOT.name} to the checkout root and retry startDevice to build it automatically,`,`or build it yourself: ${Z(`<checkout>/${P}`,o)}.`,`The published package does not include the watch project; there, set ${g.WATCH_RUNNER_XCTESTRUN.name} to a prebuilt watch runner xctestrun.`].join(" "))}import ee from"ws";var re=(n)=>{let o=new ee(n);return{send:(s)=>o.send(s),close:()=>o.close(),onMessage:(s)=>{o.on("message",(c)=>s(c.toString()))},onFailure:(s)=>{o.on("error",s),o.on("close",()=>s(Error("Watch runner disconnected; reconnect it.")))}}};class W{options;socket;pending=new Map;sequence=0;supported=new Set;ready;resolveReady;rejectReady;failure;constructor(n,o={}){this.options=o;this.ready=new Promise((s,c)=>{this.resolveReady=s,this.rejectReady=c}),this.ready.then(void 0,()=>{}),this.socket=(o.factory??re)(n),this.socket.onMessage((s)=>this.receive(s)),this.socket.onFailure((s)=>this.fail(u(s,"Watch runner connection failed")))}isUsable(){return this.failure===void 0}fail(n){this.failure=n,this.rejectReady(n);for(let o of this.pending.values())o.reject(n);this.pending.clear()}receive(n){try{let o=JSON.parse(n);if(!o||typeof o!=="object"||!("type"in o))throw new t("Invalid watch runner response; reconnect it.");let s=o;if(s.type==="connected")this.connected(s);else this.reply(s)}catch(o){this.fail(u(o,"Invalid watch runner response")),this.socket.close()}}connected(n){if(n.platform!=="watchos"){this.fail(new wa("Refusing runner: connected platform must be watchos.","invalid_runner_platform")),this.socket.close();return}this.supported=new Set(Array.isArray(n.supportedCommands)?n.supportedCommands.filter((o)=>typeof o==="string"):[]),this.resolveReady();return}reply(n){let o=typeof n.requestId==="string"?this.pending.get(n.requestId):void 0;if(!o)return;if(n.type==="error"||n.success===!1)o.reject(new wa(String(n.error??"Watch command failed"),String(n.errorCode??"command_failed")));else if(n.type===(o.type==="hierarchy"?"hierarchy_update":`${o.type}_result`)&&n.success===!0)o.resolve(n.type==="face_result"?n.text??n.data:n.data)}async request(n,o,s){let c=this.options.timer??i,a=s?.timeoutMs??this.options.timeoutMs??5000,d=String(++this.sequence),h=new AbortController,p=o?AbortSignal.any([o,h.signal]):h.signal;try{return await l(async()=>{if(await this.ready,p.throwIfAborted(),this.failure)throw this.failure;if(!this.supported.has(n.type))throw new wa(`The watch runner does not support ${n.type}.`,"unsupported_on_watchos");return new Promise((m,y)=>{this.pending.set(d,{type:n.type,resolve:m,reject:y}),this.socket.send(JSON.stringify({...n,requestId:d}))})},{timer:c,timeoutMs:a,signal:p,label:`Watch runner ${n.type}`})}finally{h.abort(),this.pending.delete(d)}}async hierarchy(n){let o=await this.request({type:"hierarchy"},n);if(!B4(o))throw new t("Invalid watch hierarchy; reconnect the runner.");return o}close(){this.fail(new t("Watch runner closed; reconnect it.")),this.socket.close()}}import{rm as te}from"fs/promises";class D{dependencies;constructor(n){this.dependencies=n}async launch(n){if(!Number.isInteger(n.port)||n.port<1||n.port>65535)throw new t("Watch runner port must be an integer from 1 to 65535.");if(yo.get(n.deviceId))throw new t("Watch runner is already connected.");n.signal?.throwIfAborted();let o=await this.dependencies.writeRunnerEnvironment(n.xctestrun,{AM_PORT:String(n.port)},`watch-${n.deviceId}`),s=!1,c=()=>{if(!s&&o!==n.xctestrun)s=!0,te(o,{force:!0}).catch((a)=>{e.warn("Failed to remove watch runner xctestrun copy",a)})};try{return await this.launchPrepared({...n,xctestrun:o},c)}catch(a){throw c(),u(a,"Failed to launch watch runner")}}async launchPrepared(n,o){let s=this.dependencies.timer??i;n.signal?.throwIfAborted();let c=await(this.dependencies.xcodebuild??new qn).startStreaming(["test-without-building","-xctestrun",n.xctestrun,"-destination",`platform=watchOS Simulator,id=${n.deviceId}`,"-only-testing:CtrlProxyWatchUITests/CtrlProxyWatchUITests/testRunService"],{env:{...globalThis.process.env,TEST_RUNNER_AM_PORT:String(n.port),...n.bundleId!==void 0?{TEST_RUNNER_AM_BUNDLE_ID:n.bundleId}:{}},stdio:"ignore",startupSignal:n.signal}),a={exited:!1,unregister:()=>{}},d=()=>{a.exited=!0,a.unregister(),a.client?.close(),o()},h=()=>{let p=!a.exited;if(d(),p)c.kill("SIGTERM")};c.once("exit",d),c.once("error",d);try{return await l(()=>this.waitForRunner(n,a),{timer:s,timeoutMs:60000,label:"Watch runner startup",onTimeout:h,signal:n.signal}),{stop:h}}catch(p){throw h(),u(p,"Failed to launch watch runner")}}async waitForRunner(n,o){let s=this.dependencies.timer??i;while(!o.exited){let c=(this.dependencies.connect??((a)=>new W(a,{timer:s})))(`ws://127.0.0.1:${n.port}/ws`);o.client=c;try{await c.hierarchy(n.signal)}catch(a){if(c.close(),o.exited||n.signal?.aborted||a instanceof wa)throw u(a,"Watch runner exited during startup");e.debug("Watch runner not ready during startup",a),await s.sleep(100);continue}if(o.exited)break;n.signal?.throwIfAborted(),o.unregister=yo.register(n.deviceId,c);return}throw new t("Watch runner exited before becoming ready; check the prebuilt test bundle.")}}class B{dependencies;runners=new Map;observedSessions=new WeakSet;constructor(n){this.dependencies=n}async ensure(n){let o=await this.start(n);return this.attach(n)??o.runnerUnavailable}async start(n){let{deviceId:o,bundleId:s,sessions:c,signal:a}=n;return this.launchEntry({deviceId:o,bundleId:s,sessions:c,signal:a})}async launchEntry(n){let{deviceId:o,sessions:s}=n;if(s)this.observeSessions(s);if(yo.get(o)?.isUsable())return{};if(this.stop(o),yo.get(o))return{runnerUnavailable:`The watch runner for ${o} is disconnected and was not started by AutoMobile; restart it before trying again.`};let a={controller:new AbortController,bundleId:n.bundleId,ownerSession:n.ownerSession},d=Ge(n.signal,a.controller.signal);this.runners.set(o,a);try{let h=await this.dependencies.artifacts.resolve(d);d.throwIfAborted(),a.port=this.dependencies.ports.allocate(o);let p=await this.dependencies.launcher.launch({deviceId:o,bundleId:n.bundleId,xctestrun:h,port:a.port,signal:d});if(a.stop=p.stop,d.aborted||this.runners.get(o)!==a){if(this.runners.get(o)!==a)p.stop();throw new t("the watch session ended during runner startup")}return{stop:()=>{if(this.runners.get(o)===a)this.stop(o)}}}catch(h){if(this.runners.get(o)===a)this.stop(o);let p=r(h);return e.warn(`[WatchRunner] Runner unavailable for ${o}: ${p}`,h),{runnerUnavailable:p}}}async retarget(n){let o=this.runners.get(n.deviceId);if(!o)return;if(o.bundleId===n.bundleId&&yo.get(n.deviceId)?.isUsable()===!0)return;let s=o.ownerSession;try{return this.stop(n.deviceId),(await this.launchEntry({...n,ownerSession:s})).runnerUnavailable}catch(c){let a=r(c);return e.warn(`[WatchRunner] Failed to retarget runner for ${n.deviceId}: ${a}`,c),a}}attach({deviceId:n,ownerSession:o,sessions:s}){if(this.observeSessions(s),!s.hasSession(o))return this.stop(n),"the watch session ended before runner startup";let c=this.runners.get(n);if(c)c.ownerSession=o;return}stop(n){let o=this.runners.get(n);if(!o)return;this.runners.delete(n),o.controller.abort(new t("Watch runner lifecycle ended"));try{o.stop?.()}catch(s){e.warn(`[WatchRunner] Failed to stop runner for ${n}`,s)}finally{if(o.port!==void 0)this.dependencies.ports.release(n,o.port)}}stopSession(n){for(let[o,s]of this.runners)if(s.ownerSession===n)this.stop(o)}stopAll(){for(let n of this.runners.keys())this.stop(n)}observeSessions(n){if(this.observedSessions.has(n))return;this.observedSessions.add(n),n.onSessionRelease((o)=>this.stopSession(o)),n.onSessionDeviceUnbound((o,s)=>{if(this.runners.get(s)?.ownerSession===o)this.stop(s)})}}var k;function iJ(n){k=n}function T(){if(!k)throw new t("Watch runner builder has not been registered by the server.");return k()}var w;function uf(){if(!w)w=new B({artifacts:new I({builder:{getXctestrunPath:(n)=>T().getXctestrunPath(n),getConfig:()=>T().getConfig(),runExclusiveOnDerivedData:(n)=>{let o=T();return o.runExclusiveOnDerivedData?o.runExclusiveOnDerivedData(n):n()}}}),launcher:new D({writeRunnerEnvironment:(n,o,s)=>T().writeRunnerEnvironment(n,o,`${s}-${L.next()}`)}),ports:{allocate:(n)=>Pe.allocate(`watch:${n}`,{reservedPorts:To}),release:(n,o)=>Pe.releaseIfAllocated(`watch:${n}`,o)}}),process.once("exit",()=>w?.stopAll());return w}function oJ(){w?.stopAll()}var IU=new nV;import*as f from"fs/promises";import v from"path";var F="tvos-runner",ne="automobile-runner-",ie="tvos-runner.json";class O{deps;cache;cacheDir;env;timer;fileSystem;flights=new at;constructor(n={}){this.deps=n;this.timer=n.timer??i,this.cache=new Qi({downloader:n.downloader,checksumCalculator:n.checksumCalculator,timer:this.timer}),this.cacheDir=v.resolve(n.cacheDir??Xe(F)),this.env=n.env??process.env,this.fileSystem=n.fileSystem??f}async ensure(n){if(n?.throwIfAborted(),(this.deps.platform??process.platform)!=="darwin")return null;return this.flights.run("runner",async()=>{try{return await this.doEnsure()}catch(o){throw u(o,"Unable to resolve the released tvOS runner")}},n)}async doEnsure(){let n=this.deps.expectedChecksum??jee(this.env);if(!n)return e.info("[TVOS_RUNNER] This release has no pinned tvOS runner; no archive can be trusted."),null;if(!/^[a-f0-9]{64}$/i.test(n))throw new t("Invalid pinned tvOS runner SHA-256 checksum.");let o=v.join(this.cacheDir,n.toLowerCase()),s=v.join(o,ie),c=null;if(await this.cache.isCached({label:"[TVOS_RUNNER]",subject:"runner",expectedSha256:n,metadataPath:s,parseMetadata:(a)=>typeof a==="object"&&a!==null&&("sha256"in a)&&typeof a.sha256==="string"?{sha256:a.sha256}:null,verifyArtifact:async()=>(c=await this.findXctestrun(o),c!==null)}))return c;return this.download(n,o,s)}async findXctestrun(n){let o=v.join(n,"Build","Products");try{let s=(await this.fileSystem.readdir(o)).filter((a)=>a.includes("appletvsimulator")&&a.endsWith(".xctestrun")&&!a.startsWith(ne)&&v.basename(a)===a),c=[];for(let a of s){let d=v.join(o,a);if((await this.fileSystem.stat(d)).isFile())c.push(d)}return c.length===1?c[0]:null}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT")e.debug("[TVOS_RUNNER] No cached runner products");else e.warn("[TVOS_RUNNER] Unable to inspect runner products",s);return null}}async download(n,o,s){if(this.deps.cacheDir===void 0)si(F);else await f.mkdir(this.cacheDir,{recursive:!0,mode:448}),await f.chmod(this.cacheDir,448);let c=await f.mkdtemp(v.join(this.cacheDir,".staging-")),a=v.join(c,R5),d=v.join(c,"extracted"),h,p=!1;try{await this.fetch({expected:n,archivePath:a,metadataPath:s,destination:o,extracted:d,staging:c,onDownloaded:()=>{p=!0},onPublished:(m)=>{h=m}})}catch(m){if(p)throw m;return e.warn(`[TVOS_RUNNER] Unable to download the released tvOS runner; falling back to a local build: ${r(m)}`,m),null}if(!h)throw new t("tvOS runner extraction did not publish an xctestrun.");return v.join(o,h)}async fetch(n){let{expected:o,archivePath:s,metadataPath:c,destination:a,extracted:d,staging:h}=n;await this.cache.fetch({label:"[TVOS_RUNNER]",expectedSha256:o,url:this.deps.releaseUrl??zee(this.env),archivePath:s,metadataPath:c,metadataMode:384,downloadTimeoutMs:this.deps.downloadTimeoutMs??120000,afterDownload:async(p)=>{n.onDownloaded(),await f.chmod(p,384)},mismatchError:(p,m)=>new t(`tvOS runner checksum verification failed. Expected: ${p}, Got: ${m}. The release archive is corrupted or tampered.`),timeoutError:()=>new t("Timed out downloading the tvOS runner. Check release asset availability."),publish:async(p,m)=>{await(this.deps.extract??((G,J)=>new eB().extractBundle(G,J)))(p,d);let R=await this.findXctestrun(d);if(!R)throw new t("tvOS runner archive must contain exactly one appletvsimulator xctestrun in Build/Products.");return n.onPublished(v.relative(d,R)),await f.chmod(d,448),await f.rm(a,{recursive:!0,force:!0}),await f.rename(d,a),{version:Ce(this.env),sha256:m,downloadedAt:this.timer.now()}},settle:()=>f.rm(h,{recursive:!0,force:!0})})}}import{access as V}from"fs/promises";import{join as oe}from"path";class _{dependencies;builds=new at;constructor(n){this.dependencies=n}async resolve(n){n?.throwIfAborted();let o=(this.dependencies.override??(()=>ft(g.TVOS_RUNNER_XCTESTRUN)))();if(o){let h=Ae(o);return await(this.dependencies.access??V)(h),h}let s=this.dependencies.builder,c=await s.getXctestrunPath("tvSimulator");if(c)return c;let a=await this.dependencies.release?.ensure(n);if(n?.throwIfAborted(),a)return a;let d=s.getConfig();return await this.builds.run(d.derivedDataPath,async(h)=>await U(h,async()=>{let p=async()=>{h?.throwIfAborted();let m=oe(d.projectRoot,"ios","control-proxy","CtrlProxy.xcodeproj");try{await(this.dependencies.access??V)(m)}catch(R){throw new t(`Tvos runner project is unavailable; set ${g.TVOS_RUNNER_XCTESTRUN.name} to a prebuilt tvos runner xctestrun. This release has no published tvOS runner, and the published package does not include the tvos project.`,{cause:R})}await(this.dependencies.xcodebuild??new qn).executeCommand(["build-for-testing","-project",m,"-scheme","AutoMobileTVTest","-destination","generic/platform=tvOS Simulator","-derivedDataPath",d.derivedDataPath,"CODE_SIGNING_ALLOWED=NO"],{signal:h,timeoutMs:120000});let y=await s.getXctestrunPath("tvSimulator");if(!y)throw new t(`No appletvsimulator xctestrun found in ${d.derivedDataPath}/Build/Products after building AutoMobileTVTest; set ${g.TVOS_RUNNER_XCTESTRUN.name} to a prebuilt tvos runner.`);return y};return s.runExclusiveOnDerivedData?await s.runExclusiveOnDerivedData(p):await p()}),n,{cancelWhenAllWaitersAbort:!0})}}import{rm as se}from"fs/promises";function ae(n,o,s={}){let c=s.targetApps??IU;return new J4(n,{timer:s.timer,factory:s.factory,foregroundApp:()=>c.get(o)})}class N{dependencies;constructor(n){this.dependencies=n}async launch(n){if(!Number.isInteger(n.port)||n.port<1||n.port>65535)throw new t("Tvos runner port must be an integer from 1 to 65535.");if(Ln.get(n.deviceId))throw new t("Tvos runner is already connected.");n.signal?.throwIfAborted();let o=await this.dependencies.writeRunnerEnvironment(n.xctestrun,{AM_PORT:String(n.port)},`tvos-${n.deviceId}`),s=!1,c=()=>{if(!s&&o!==n.xctestrun)s=!0,se(o,{force:!0}).catch((a)=>{e.warn("Failed to remove tvos runner xctestrun copy",a)})};try{return await this.launchPrepared({...n,xctestrun:o},c)}catch(a){throw c(),u(a,"Failed to launch tvos runner")}}async launchPrepared(n,o){let s=this.dependencies.timer??i;n.signal?.throwIfAborted();let c=await(this.dependencies.xcodebuild??new qn).startStreaming(["test-without-building","-xctestrun",n.xctestrun,"-destination",`platform=tvOS Simulator,id=${n.deviceId}`,"-only-testing:CtrlProxyTVUITests/CtrlProxyTVUITests/testRunService"],{env:{...globalThis.process.env,TEST_RUNNER_AM_PORT:String(n.port)},stdio:"ignore",startupSignal:n.signal}),a={exited:!1,unregister:()=>{}},d=()=>{a.exited=!0,a.unregister(),a.client?.close(),o()},h=()=>{let p=!a.exited;if(d(),p)c.kill("SIGTERM")};c.once("exit",d),c.once("error",d);try{return await l(()=>this.waitForRunner(n,a),{timer:s,timeoutMs:60000,label:"Tvos runner startup",onTimeout:h,signal:n.signal}),{stop:h}}catch(p){throw h(),u(p,"Failed to launch tvos runner")}}async waitForRunner(n,o){let s=this.dependencies.timer??i;while(!o.exited){let c=(this.dependencies.connect??((a)=>ae(a,n.deviceId,{timer:s})))(`ws://127.0.0.1:${n.port}/ws`);o.client=c;try{await c.hierarchy(n.signal)}catch(a){if(c.close(),o.exited||n.signal?.aborted||a instanceof rT)throw u(a,"Tvos runner exited during startup");e.debug("Tvos runner not ready during startup",a),await s.sleep(100);continue}if(o.exited)break;n.signal?.throwIfAborted(),o.unregister=Ln.register(n.deviceId,c);return}throw new t("Tvos runner exited before becoming ready; check the prebuilt test bundle.")}}class H{dependencies;runners=new Map;observedSessions=new WeakSet;constructor(n){this.dependencies=n}async ensure(n){let o=await this.start(n);return this.attach(n)??o.runnerUnavailable}async start(n){let{deviceId:o,sessions:s}=n;if(s)this.observeSessions(s);if(Ln.get(o)?.isUsable())return{};this.stop(o);let c={controller:new AbortController},a=Ge(n.signal,c.controller.signal);this.runners.set(o,c);try{let d=await this.dependencies.artifacts.resolve(a);a.throwIfAborted(),c.port=this.dependencies.ports.allocate(o);let h=await this.dependencies.launcher.launch({deviceId:o,xctestrun:d,port:c.port,signal:a});if(c.stop=h.stop,a.aborted||this.runners.get(o)!==c){if(this.runners.get(o)!==c)h.stop();throw new t("the tvos session ended during runner startup")}return{stop:()=>{if(this.runners.get(o)===c)this.stop(o)}}}catch(d){if(this.runners.get(o)===c)this.stop(o);let h=r(d);return e.warn(`[TvosRunner] Runner unavailable for ${o}: ${h}`,d),{runnerUnavailable:h}}}attach({deviceId:n,ownerSession:o,sessions:s}){if(this.observeSessions(s),!s.hasSession(o))return this.stop(n),"the tvos session ended before runner startup";let c=this.runners.get(n);if(c)c.ownerSession=o;return}stop(n){let o=this.runners.get(n);if(!o)return;this.runners.delete(n),o.controller.abort(new t("Tvos runner lifecycle ended"));try{o.stop?.()}catch(s){e.warn(`[TvosRunner] Failed to stop runner for ${n}`,s)}finally{if(o.port!==void 0)this.dependencies.ports.release(n,o.port)}}stopSession(n){for(let[o,s]of this.runners)if(s.ownerSession===n)this.stop(o)}stopAll(){for(let n of this.runners.keys())this.stop(n)}observeSessions(n){if(this.observedSessions.has(n))return;this.observedSessions.add(n),n.onSessionRelease((o)=>this.stopSession(o)),n.onSessionDeviceUnbound((o,s)=>{if(this.runners.get(s)?.ownerSession===o)this.stop(s)})}}var j;function sJ(n){j=n}function C(){if(!j)throw new t("Tvos runner builder has not been registered by the server.");return j()}var b;function Ab(){if(!b)b=new H({artifacts:new _({release:new O,builder:{getXctestrunPath:(n)=>C().getXctestrunPath(n),getConfig:()=>C().getConfig(),runExclusiveOnDerivedData:(n)=>{let o=C();return o.runExclusiveOnDerivedData?o.runExclusiveOnDerivedData(n):n()}}}),launcher:new N({writeRunnerEnvironment:(n,o,s)=>C().writeRunnerEnvironment(n,o,`${s}-${L.next()}`)}),ports:{allocate:(n)=>Pe.allocate(`tvos:${n}`,{reservedPorts:To}),release:(n,o)=>Pe.releaseIfAllocated(`tvos:${n}`,o)}}),process.once("exit",()=>b?.stopAll());return b}function aJ(){b?.stopAll()}
|
|
3
|
+
export{iJ,uf,oJ,IU,sJ,Ab,aJ};
|
|
4
|
+
|
|
5
|
+
//# debugId=6B9FD0CB5F5BF76D64756E2164756E21
|