@testmuai/kane-cli 0.8.8 → 0.8.10
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/{ChatSurface-LS3KF7XY.js → ChatSurface-OWGOCHG3.js} +1 -1
- package/dist/{ChromeProfilePicker-UIJ5ZBLY.js → ChromeProfilePicker-QIMCWPPI.js} +1 -1
- package/dist/{CliFeedbackPrompt-EIQQBWDY.js → CliFeedbackPrompt-34E2AXS4.js} +1 -1
- package/dist/{CliUploadProgress-6U77ZBAX.js → CliUploadProgress-TRKOSED7.js} +1 -1
- package/dist/{ConfigView-MVFLCF5N.js → ConfigView-XVKR7ATN.js} +1 -1
- package/dist/{EvidenceViewOffer-ANVEOXJA.js → EvidenceViewOffer-M2TGMSNE.js} +1 -1
- package/dist/FolderPicker-WZTNQ5IV.js +2 -0
- package/dist/{InfoBox-57MRRSJI.js → InfoBox-QM5YEBMH.js} +1 -1
- package/dist/{LinksBox-RKAEQBFS.js → LinksBox-CSEDEZGU.js} +1 -1
- package/dist/{ProfilesView-RQCQFIXH.js → ProfilesView-CZVPREIS.js} +1 -1
- package/dist/{ProjectPicker-5JEEHLY3.js → ProjectPicker-F6FEWNMY.js} +1 -1
- package/dist/{SaveSessionPrompt-TQROE5JM.js → SaveSessionPrompt-RUSFOLBZ.js} +1 -1
- package/dist/SingleShotApp-WBFVUZFP.js +2 -0
- package/dist/{SummaryBox-C4UY6R65.js → SummaryBox-KOJXTZVZ.js} +1 -1
- package/dist/TestMdRunView-BEXL7TIN.js +2 -0
- package/dist/{TestrunEvidenceTable-LY24PK3T.js → TestrunEvidenceTable-KGVBX76H.js} +1 -1
- package/dist/{WhoamiView-2FIHHS4G.js → WhoamiView-IOTBOCGK.js} +1 -1
- package/dist/{app-download-TO672LBR.js → app-download-7AF6QL2C.js} +1 -1
- package/dist/{auth-EVXJVU72.js → auth-2HTDCT7X.js} +1 -1
- package/dist/{binary-Y4DKNDQH.js → binary-NKX3NEK7.js} +1 -1
- package/dist/{bind-FVCVYYL3.js → bind-IMBQFRKT.js} +2 -2
- package/dist/{bootstrap-4XBQFKWF.js → bootstrap-TNFANHSS.js} +1 -1
- package/dist/bridge-SXYWYZDO.js +2 -0
- package/dist/{changelog-LAQ2VGK6.js → changelog-SQVLSCYO.js} +1 -1
- package/dist/{chunk-UY2ES2Z6.js → chunk-2BIPFAGX.js} +1 -1
- package/dist/{chunk-O4IEPE3T.js → chunk-2ULZVQZV.js} +2 -2
- package/dist/chunk-47OUD76M.js +6 -0
- package/dist/{chunk-ZSFOANLG.js → chunk-5EKTQY2S.js} +1 -1
- package/dist/{chunk-6TVNJDSE.js → chunk-5Q3W3SX7.js} +1 -1
- package/dist/{chunk-VCDXUUJQ.js → chunk-5YBKKWJA.js} +1 -1
- package/dist/{chunk-HK3FFI7Y.js → chunk-6S3Z3WPF.js} +2 -2
- package/dist/chunk-724NYDMU.js +27 -0
- package/dist/{chunk-7CXIOJB3.js → chunk-AWEUKXZQ.js} +1 -1
- package/dist/{chunk-GZLQ2AR6.js → chunk-B4CYIZP5.js} +1 -1
- package/dist/{chunk-ZKRL6HMY.js → chunk-BG2AZQLI.js} +1 -1
- package/dist/{chunk-ZHKBSKCB.js → chunk-BQSLPF5M.js} +1 -1
- package/dist/{chunk-H6YGG3GC.js → chunk-BUM367KV.js} +1 -1
- package/dist/{chunk-K5DL7CZ4.js → chunk-BZCVLCMG.js} +1 -1
- package/dist/{chunk-NAZ36RKI.js → chunk-C33E5XQM.js} +1 -1
- package/dist/{chunk-AZ73FJRK.js → chunk-CKNVMB4E.js} +1 -1
- package/dist/chunk-CPGUTSUD.js +6 -0
- package/dist/{chunk-LI5FMAUO.js → chunk-CSCJLGIY.js} +1 -1
- package/dist/{chunk-HZDNGNO2.js → chunk-CXKWVHZK.js} +1 -1
- package/dist/{chunk-BYOXTXLC.js → chunk-D6566A2X.js} +1 -1
- package/dist/{chunk-WALVOFKR.js → chunk-DF3DUGJS.js} +4 -4
- package/dist/{chunk-BRE426DP.js → chunk-EH3YMGQ7.js} +1 -1
- package/dist/{chunk-PYHWCV2V.js → chunk-EKOL4WCC.js} +1 -1
- package/dist/{chunk-VQVERWC3.js → chunk-ESHDTCSZ.js} +1 -1
- package/dist/{chunk-5LYPSIBC.js → chunk-ETIQJIDI.js} +1 -1
- package/dist/{chunk-RHL7KZNC.js → chunk-FH6EDP77.js} +1 -1
- package/dist/{chunk-V5DYLGAM.js → chunk-FOP6CJAM.js} +1 -1
- package/dist/{chunk-CQCV2RJK.js → chunk-GHL2A273.js} +2 -2
- package/dist/{chunk-JE6OO2Q6.js → chunk-GOF5PQ5T.js} +1 -1
- package/dist/{chunk-SQWVGI3J.js → chunk-HE3ZKFRC.js} +1 -1
- package/dist/{chunk-7RTITBZG.js → chunk-HNNVVK2O.js} +1 -1
- package/dist/{chunk-AO5QH6UU.js → chunk-HXSOZWFL.js} +1 -1
- package/dist/{chunk-XLVH4CIZ.js → chunk-I3OVXNBW.js} +2 -2
- package/dist/{chunk-R4PLEH2A.js → chunk-I5KYZHJ5.js} +49 -49
- package/dist/{chunk-FGRTNRBS.js → chunk-JGZWR3CR.js} +2 -2
- package/dist/{chunk-Q6743UUQ.js → chunk-KUAFVRSR.js} +1 -1
- package/dist/{chunk-N5I2QYFD.js → chunk-LKUWEQ5M.js} +1 -1
- package/dist/{chunk-6T3DWH56.js → chunk-LTNMOEHT.js} +1 -1
- package/dist/{chunk-5M5BG4MT.js → chunk-LUTRUSIV.js} +1 -1
- package/dist/{chunk-2YQ6TW77.js → chunk-M6SFFAAQ.js} +6 -6
- package/dist/{chunk-XJ4TJARR.js → chunk-ML2E3JGK.js} +1 -1
- package/dist/{chunk-7UYSTQMI.js → chunk-NDKHC6KL.js} +1 -1
- package/dist/{chunk-WPSQYEBP.js → chunk-NJQNHD5P.js} +1 -1
- package/dist/{chunk-6LYQ4MJH.js → chunk-NYQOYOBA.js} +1 -1
- package/dist/{chunk-S6M36UIV.js → chunk-NYSFEZUR.js} +1 -1
- package/dist/{chunk-WYOEOJM2.js → chunk-OSRRMY6M.js} +1 -1
- package/dist/{chunk-JPGRUMCS.js → chunk-P3UGM74Z.js} +1 -1
- package/dist/{chunk-OGJR5VIG.js → chunk-PCVTSFIX.js} +1 -1
- package/dist/chunk-PDXZROJM.js +2 -0
- package/dist/{chunk-P67CGWD6.js → chunk-PMOUXVUC.js} +1 -1
- package/dist/{chunk-DHPBVHED.js → chunk-QJNQN6ND.js} +1 -1
- package/dist/{chunk-3GZ4FQ4L.js → chunk-RJ4YFH7K.js} +1 -1
- package/dist/{chunk-5YCOYFZH.js → chunk-RP7FW23G.js} +1 -1
- package/dist/{chunk-BAKOH2BR.js → chunk-RSNG5PBN.js} +1 -1
- package/dist/{chunk-WDOEMLFZ.js → chunk-SAFETUCL.js} +1 -1
- package/dist/{chunk-7YX2HUHY.js → chunk-SAKUG4KE.js} +1 -1
- package/dist/{chunk-UYLNH4SH.js → chunk-SU3QKERU.js} +1 -1
- package/dist/{chunk-QVR2PB6Y.js → chunk-SXUQBPQ6.js} +1 -1
- package/dist/{chunk-XFTF7OOY.js → chunk-SXX7ZE6L.js} +3 -3
- package/dist/{chunk-ZIJLOYXX.js → chunk-TGPI7VDR.js} +7 -7
- package/dist/{chunk-QXLX6LMJ.js → chunk-TI7MR3PB.js} +1 -1
- package/dist/{chunk-AS5UKK27.js → chunk-UEANTGQS.js} +1 -1
- package/dist/{chunk-36ZVMJTJ.js → chunk-USUFF3S6.js} +1 -1
- package/dist/{chunk-HJOGBE23.js → chunk-VIJUT5AR.js} +9 -9
- package/dist/{chunk-4BIJCAR4.js → chunk-W7PBJXLJ.js} +1 -1
- package/dist/{chunk-WRIPTYSN.js → chunk-WAI5UHW3.js} +1 -1
- package/dist/{chunk-OO7LFDET.js → chunk-WAWMIKSI.js} +1 -1
- package/dist/chunk-WEJA3EVI.js +2 -0
- package/dist/{chunk-UDW4ZZAW.js → chunk-WXJQDLXX.js} +1 -1
- package/dist/chunk-XIGTZTFP.js +5 -0
- package/dist/{chunk-2MQP4SSF.js → chunk-XTUSDGAB.js} +1 -1
- package/dist/{chunk-K6JRFRGS.js → chunk-YHL5NA43.js} +1 -1
- package/dist/{chunk-PQYBIWZH.js → chunk-YUA2VDWH.js} +1 -1
- package/dist/{chunk-LMYE3M75.js → chunk-YXPWGIQ2.js} +1 -1
- package/dist/{chunk-FL6TCYA5.js → chunk-ZFZB4CGJ.js} +1 -1
- package/dist/{chunk-ATIX6CVS.js → chunk-ZXTVP4WX.js} +2 -2
- package/dist/{config-5UNFAVY6.js → config-UF635MC4.js} +1 -1
- package/dist/{credentials-64JYS7AQ.js → credentials-3KBLEVJH.js} +1 -1
- package/dist/{deps-bundle-5JPHXHQV.js → deps-bundle-WGF4YYGO.js} +1 -1
- package/dist/{deps-resolve-WFZZ22XH.js → deps-resolve-DVJPU4YX.js} +1 -1
- package/dist/{dispatch-JLMCXOSK.js → dispatch-YTIJKX6C.js} +1 -1
- package/dist/{doctor-KJMR7NRK.js → doctor-2KRK42L2.js} +1 -1
- package/dist/{evidence-OFTY5U4X.js → evidence-CDCFEYS7.js} +1 -1
- package/dist/{evolve-cmd-LU6LPT4F.js → evolve-cmd-L3JIBYP5.js} +1 -1
- package/dist/{extract-bind-YYIOEAYR.js → extract-bind-VFQWACVO.js} +2 -2
- package/dist/{extract-cmd-Q7OG6RY6.js → extract-cmd-2OFQBBJ4.js} +1 -1
- package/dist/{generate-headless-NCVM643E.js → generate-headless-B35UUR5A.js} +2 -2
- package/dist/index.js +26 -26
- package/dist/{ingest-cmd-42VRDSPV.js → ingest-cmd-LAUSXSI3.js} +1 -1
- package/dist/install-ENSOEMSX.js +2 -0
- package/dist/{interactive-bind-ZDJS7PCV.js → interactive-bind-OWASLPBQ.js} +3 -3
- package/dist/{list-commands-3IKFZSGB.js → list-commands-SLQDF6AT.js} +1 -1
- package/dist/login-flow-YKQUXP75.js +2 -0
- package/dist/{mobile-prompts-XPQSRBIW.js → mobile-prompts-6MGOXIKX.js} +1 -1
- package/dist/persist-recorded-session-RKG7HOEW.js +3 -0
- package/dist/pipeline-M25AR7RM.js +2 -0
- package/dist/prepare-target-UGACDQEJ.js +2 -0
- package/dist/{reconcile-cmd-BKIJFVQT.js → reconcile-cmd-MR2MSVZ5.js} +1 -1
- package/dist/{reconcile-deps-Y5G456WD.js → reconcile-deps-RYO67ZXY.js} +2 -2
- package/dist/{reconcile-engine-WDC2MEOY.js → reconcile-engine-PRH6YIAZ.js} +1 -1
- package/dist/{recording-banner-P3RUW62P.js → recording-banner-CH2SZ4IU.js} +1 -1
- package/dist/registry-ARR5ITIQ.js +2 -0
- package/dist/{require-project-folder-ZGQLWZV5.js → require-project-folder-XY77JKAQ.js} +1 -1
- package/dist/{resolve-run-intent-DHZD6A4B.js → resolve-run-intent-JFIGIF72.js} +1 -1
- package/dist/{resolver-W54NOQXY.js → resolver-6VDNZ6KP.js} +1 -1
- package/dist/{run-BGQTRIU4.js → run-GTBYWSLW.js} +1 -1
- package/dist/{run-7TZTUTTU.js → run-UETW72YU.js} +1 -1
- package/dist/{run-test-md-WO2UDYPM.js → run-test-md-OLGWTC4I.js} +2 -2
- package/dist/{skill-installer-UTVUPOTD.js → skill-installer-NT7ZT6O4.js} +1 -1
- package/dist/{spawner-SHCGHLQS.js → spawner-YQSAPZR4.js} +1 -1
- package/dist/tcg-generate-D73BMKOE.js +2 -0
- package/dist/testmd-actions-XPYXS36F.js +2 -0
- package/dist/token-refresh-2XVSIFRM.js +2 -0
- package/dist/{validate-basic-XEPS5I6V.js → validate-basic-OMAFYHME.js} +1 -1
- package/dist/{verdicts-SOX22V6V.js → verdicts-KEBSV2NL.js} +1 -1
- package/dist/{version-check-LWDLMWBJ.js → version-check-FRVZSYNF.js} +1 -1
- package/dist/{walk-session-M3OIWR5K.js → walk-session-LNFOCPJ6.js} +1 -1
- package/dist/{with-telemetry-SF5RHYQE.js → with-telemetry-4ATZC6IR.js} +1 -1
- package/package.json +11 -11
- package/dist/FolderPicker-HVI6KITN.js +0 -2
- package/dist/SingleShotApp-VJVY3F4H.js +0 -2
- package/dist/TestMdRunView-X3CCNYV5.js +0 -2
- package/dist/bridge-6DCBL3GY.js +0 -2
- package/dist/chunk-7UCICMK7.js +0 -5
- package/dist/chunk-HPBI3P6I.js +0 -6
- package/dist/chunk-LPH4TERT.js +0 -2
- package/dist/chunk-OQAN2WYO.js +0 -26
- package/dist/chunk-UPHF2J5E.js +0 -6
- package/dist/install-5NMP6ZV4.js +0 -2
- package/dist/login-flow-UXUQ7GQT.js +0 -2
- package/dist/persist-recorded-session-MFQ7JCLJ.js +0 -3
- package/dist/pipeline-2XITQU5W.js +0 -2
- package/dist/prepare-target-CKRWHYXS.js +0 -2
- package/dist/registry-OEY4IXB6.js +0 -2
- package/dist/tcg-generate-YDNE643C.js +0 -2
- package/dist/testmd-actions-UCJ4ULSX.js +0 -2
- package/dist/token-refresh-ZNV2OSZC.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as S}from"./chunk-KRKGZ2ZW.js";import{a as C,b as k,c as R,d as D}from"./chunk-
|
|
2
|
+
import{i as S}from"./chunk-KRKGZ2ZW.js";import{a as C,b as k,c as R,d as D}from"./chunk-DF3DUGJS.js";import{j as T,k as $,l as b}from"./chunk-54JZ6VEW.js";import{g as E}from"./chunk-R7QAS6LZ.js";import{c as y}from"./chunk-5DT7PIGB.js";import{a as O}from"./chunk-CH273NAE.js";import{C as _}from"./chunk-W3Z7AZNT.js";import{existsSync as H}from"fs";import{basename as q}from"path";import{appendFileSync as L,mkdirSync as U}from"fs";import{homedir as F}from"os";import{dirname as G,join as j}from"path";function P(c,s){let n=/^(DOCX_[A-Z_]+):/.exec(s)?.[1];if(n)try{let u=process.env.KANE_CONTEXT_REFUSAL_LOG??j(F(),".testmuai","kaneai","context-refusals.log");U(G(u),{recursive:!0}),L(u,`${new Date().toISOString()} ${n} ${c}
|
|
3
3
|
`)}catch{}}async function w(c,s,n,u=process.cwd(),p){let l=O(u),g=[];if(s.as!==void 0&&c.length>1)return(n.err??n.out)(`error: --as names ONE source identity \u2014 pass a single file (got ${c.length})`,"AS_SINGLE_SOURCE"),{code:2,results:g};for(let o of c){if(R(o)){let a=D(o);if(a===null)return(n.err??n.out)(`error: ${o}: unsupported remote URL \u2014 supported: ${k.map(d=>d.hint).join("; ")}`,"UNSUPPORTED_URL"),{code:1,results:g};let r=await a.ingest(o,s.as,n,l,p);if(r.code!==0)return{code:r.code,results:g};r.result&&g.push({status:r.result.status==="versioned"?"versioned":r.result.status==="unchanged"?"unchanged":"created",source_id:r.result.source_id,source_cid:r.result.source_cid});continue}let f=s.as,v;if(f===void 0&&H(l)){let a=T(o),r=$(a);if(r){let d=_(l);d.heads.get(r)!=null&&d.heads.get(a)==null&&(v=r,n.isTTY&&await n.confirm(`${a} looks like a new version of existing source '${r}' \u2014 ingest as '${r}' (replaces the current version; items built on it go stale)?`)&&(f=r))}}let e;try{e=await b({contextDir:l,filePath:o,asId:f,confirmSameSource:n.isTTY?a=>n.confirm(`identical bytes already ingested as ${a} \u2014 treat as the same source?`):void 0,converters:{pdf:E,docx:S}})}catch(a){let r=a instanceof Error?a.message:String(a);return P(o,r),(n.err??n.out)(`error: ${o}: ${r}`,"INGEST_FAILED"),{code:1,results:g}}n.out(C(n.isTTY,e,q(o)));for(let a of e.warnings??[])n.out(`warning: ${a}`);if(e.composite&&(e.composite.delivered>0||e.composite.omitted>0)){let a=e.composite.pages!==void 0?` ${e.composite.pages} pages,`:"";n.out(`${e.source_id}: ${e.composite.kind},${a} ${e.composite.delivered} images delivered (${e.composite.omitted} omitted)`)}let m;if(!n.isTTY&&e.status==="created"){let a=_(l);for(let[r,d]of a.heads.entries())if(!(r===e.source_id||d==null)&&a.getNode(d)?.content.blob===e.blob){m=r,n.out(`hint: identical bytes already ingested as ${r} \u2014 merged later via review`);break}}g.push({status:e.status,source_id:e.source_id,source_cid:e.cid,...e.warnings?.length?{warnings:e.warnings}:{},...e.composite?{media:{kind:e.composite.kind,...e.composite.pages!==void 0?{pages:e.composite.pages}:{},delivered:e.composite.delivered,omitted:e.composite.omitted}}:{},...m?{duplicate_of:m}:{},...v&&f===void 0?{lineage_candidate:v}:{}})}return{code:0,results:g}}async function se(c,s,n,u=process.cwd(),p){return(await w(c,s,n,u,p)).code}async function ie(c,s){if(s.mode!=null&&!["interactive","agent","ci","override"].includes(s.mode)){let{makeHeadlessIO:t,agentRefusal:i}=await import("./headless-io-66RG5NN5.js");return i(t("ndjson","extract"),`ingest: --mode must be interactive | agent | ci | override, got '${s.mode}'`,"MODE_USAGE")}let n=y();if(s.mode==="interactive"&&!n)return process.stderr.write(`ingest: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
4
4
|
`),2;let u=s.mode??(n?"interactive":void 0),p=u==="interactive"||u==="agent"||u==="override";if(!p&&(s.plan||s.force||s.trust!==void 0))return process.stderr.write(`ingest: --plan/--force/--trust steer the extraction \u2014 not available when only landing (use --mode agent to extract headless)
|
|
5
5
|
`),2;let{createInterface:l}=await import("readline/promises"),g=u==="agent",o=g?(await import("./headless-io-66RG5NN5.js")).makeHeadlessIO("ndjson","extract"):null,f=[],v=()=>{for(let t of f.splice(0))o.event({type:"error",message:t.message,...t.code?{code:t.code}:{}})},e=t=>{for(let i of t)o.event({type:"ingested",source_id:i.source_id,status:i.status,cid:i.source_cid,...i.warnings?.length?{warnings:i.warnings}:{},...i.media?{media:i.media}:{},...i.duplicate_of?{duplicate_of:i.duplicate_of}:{},...i.lineage_candidate?{lineage_candidate:i.lineage_candidate}:{}})},m=o?{out:()=>{},err:(t,i)=>f.push({message:t.replace(/^error: /,""),...i?{code:i}:{}}),isTTY:!1,confirm:async()=>!1}:{out:t=>process.stdout.write(t+`
|
|
6
6
|
`),err:t=>process.stderr.write(t+`
|
|
7
|
-
`),isTTY:n,confirm:async t=>{let i=l({input:process.stdin,output:process.stdout});try{let h=await i.question(`${t} [Y/n] `);return!/^n(o)?$/i.test(h.trim())}finally{i.close()}}};if(!p){let{withTelemetry:t}=await import("./with-telemetry-
|
|
7
|
+
`),isTTY:n,confirm:async t=>{let i=l({input:process.stdin,output:process.stdout});try{let h=await i.question(`${t} [Y/n] `);return!/^n(o)?$/i.test(h.trim())}finally{i.close()}}};if(!p){let{withTelemetry:t}=await import("./with-telemetry-4ATZC6IR.js");return t("ingest",async()=>{let{code:i,results:h}=await w(c,{as:s.as},m,void 0,void 0);if(i!==0)return i;let I=h.filter(Y=>Y.status!=="unchanged").length;return I>0&&(m.err??m.out)(`landed ${I} source(s) \u2014 run kane-cli context extract to extract them`),0},{write:!0})}let a;try{a=o?await(await import("./run-channel-RGH4WIQX.js")).runWithChannel({event:o.event},()=>w(c,{as:s.as},m,void 0,void 0)):await w(c,{as:s.as},m,void 0,void 0)}catch(t){if(o)return v(),o.event({type:"error",message:t instanceof Error?t.message:String(t),code:"INGEST_FAILED"}),o.done(1,"error");throw t}let{code:r,results:d}=a;if(r!==0)return o?(e(d),v(),o.done(r,r===2?"refused":"error")):r;if(d.length===0)return o?o.done(0):0;let{extractCommand:A}=await import("./extract-cmd-2OFQBBJ4.js"),N=[...new Set(d.map(t=>t.source_id))],x=await A({...s.mode!==void 0?{mode:s.mode}:{},...s.plan?{plan:!0}:{},...s.force?{force:!0}:{},...s.trust!==void 0?{trust:s.trust}:{},sources:N,landed:d});if(x===2&&!g){let t=d.filter(i=>i.status!=="unchanged").length;t>0&&(m.err??m.out)(`note: the ${t} landed source(s) are safe \u2014 extract later with kane-cli context extract`)}return x}export{w as a,se as b,ie as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as n}from"./chunk-
|
|
2
|
+
import{x as n}from"./chunk-WEJA3EVI.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as z,f as G,h as K}from"./chunk-
|
|
2
|
+
import{d as z,f as G,h as K}from"./chunk-HE3ZKFRC.js";import{a as O,b as j,c as L}from"./chunk-CXKWVHZK.js";import{d as R,f as N}from"./chunk-XTUSDGAB.js";import{b as F,c as M,j as $}from"./chunk-6S3Z3WPF.js";import{a as B}from"./chunk-TZXXJWHA.js";import{n as P}from"./chunk-RSSOJ3L2.js";import{a as Y,b as T,c as H}from"./chunk-LTNMOEHT.js";import{h as q}from"./chunk-TAOHYWEO.js";import{e as E}from"./chunk-Z7S3IWUX.js";import{b as _}from"./chunk-WEJA3EVI.js";function J(e){return e.kind==="simulator"?e.id:e.virtualName??e.id}function V(e,r,t={}){let o={platform:e.platform,udid:e.id,target_kind:e.kind};return r&&(o.app_package=r),t.noReset!==void 0&&(o.no_reset=t.noReset),t.appiumUrl&&(o.appium_url=t.appiumUrl),e.platform==="android"&&t.autoGrantPermissions!==void 0&&(o.auto_grant_permissions=t.autoGrantPermissions),e.platform==="ios"&&t.autoAcceptAlerts!==void 0&&(o.auto_accept_alerts=t.autoAcceptAlerts),o}import{createHash as Te}from"crypto";import{readdir as Ce,stat as Ae}from"fs/promises";import{basename as g,extname as De,join as ke,relative as xe}from"path";import{createHash as le}from"crypto";import{createReadStream as ce}from"fs";import{mkdir as ue,readFile as ge,rename as fe,writeFile as me}from"fs/promises";import{dirname as he,join as ve}from"path";var we=60,be=5;function X(){return{entries:[]}}function Z(){return ve(_,"mobile","app-cache.json")}async function C(e){let r=le("sha256");for await(let t of ce(e))r.update(t);return r.digest("hex")}function ye(){return{readFile:e=>ge(e,"utf8"),writeFile:async(e,r)=>{await ue(he(e),{recursive:!0});let t=`${e}.tmp`;await me(t,r),await fe(t,e)},hashFile:C,now:()=>new Date}}function A(e){if(!e)return;let r=/\/(\d{4})\/(\d{2})\/(\d{2})\//.exec(e);if(!r)return;let[,t,o,i]=r,s=new Date(`${t}-${o}-${i}T00:00:00Z`);return Number.isNaN(s.getTime())?void 0:s.toISOString()}function Pe(e,r){if(!e.storedAt)return!0;let t=new Date(e.storedAt).getTime();return Number.isNaN(t)?!0:(r.getTime()-t)/864e5>=we-be}var u=class{deps;constructor(r={}){this.deps={...ye(),...r}}async read(){try{let r=JSON.parse(await this.deps.readFile(Z()));if(!r||typeof r!="object")return X();let t=r;return{entries:Array.isArray(t.entries)?t.entries:[]}}catch{return X()}}async write(r){await this.deps.writeFile(Z(),JSON.stringify(r,null,2))}async hashOf(r){return this.deps.hashFile(r)}async lookup(r){return(await this.read()).entries.find(o=>o.sha256===r.sha256&&o.env===r.env&&o.orgId===r.orgId&&o.type===r.type)}async remember(r){let t=await this.read();t.entries=[...t.entries.filter(o=>!(o.sha256===r.sha256&&o.env===r.env&&o.orgId===r.orgId&&o.type===r.type)),r],await this.write(t)}async forget(r){let t=await this.read(),o=t.entries.length;t.entries=t.entries.filter(i=>!(i.sha256===r.sha256&&i.env===r.env&&i.orgId===r.orgId&&i.type===r.type)),t.entries.length!==o&&await this.write(t)}isNearExpiry(r){return Pe(r,this.deps.now())}};var Q={emulator:[".apk"],simulator:[".zip"]};function W(e){return e.skipped===!0}function Ie(e,r){let t=De(e).toLowerCase();return t===".ipa"?`${g(e)} is a device build \u2014 .ipa is not accepted for ${r} runs.`:Q[r].includes(t)?null:`${g(e)} cannot be uploaded for a ${r} run \u2014 expected one of ${Q[r].join(", ")}.`}async function D(e,r){if(!(await Ae(e)).isDirectory())return r.hashOf(e);let o=[],i=async n=>{for(let a of await Ce(n,{withFileTypes:!0})){let p=ke(n,a.name);a.isDirectory()?await i(p):a.isFile()&&o.push(p)}};await i(e),o.sort();let s=Te("sha256");for(let n of o)s.update(xe(e,n)),s.update("\0"),s.update(await C(n)),s.update("\0");return s.digest("hex")}async function ee(e){let r=Ie(e.path,e.type);if(r)return{skipped:!0,reason:r};let t=e.cache??new u,o=e.client??new q(e.baseUrl,{...e.auth,orgId:e.orgId}),i;try{i=await D(e.path,t)}catch(a){return{skipped:!0,reason:`could not read ${g(e.path)}: ${a.message}`}}let s={sha256:i,env:e.env,orgId:e.orgId,type:e.type},n=await t.lookup(s);if(n){if(await o.liveness(n.appId)!=="gone")return{appId:n.appId,...n.appUrl?{appUrl:n.appUrl}:{},fromCache:!0};e.onProgress?.(`${n.appId} is no longer in the cloud \u2014 uploading again`),await t.forget(s)}try{e.onProgress?.(`uploading ${g(e.path)}\u2026`);let a=await o.upload(e.path,e.type);return await t.remember({sha256:i,env:e.env,orgId:e.orgId,type:e.type,appId:a.appId,...a.appUrl?{appUrl:a.appUrl}:{},...A(a.url)?{storedAt:A(a.url)}:{},sourcePath:e.path}),e.onProgress?.(a.cached?`${g(e.path)} already in the cloud (${a.appId})`:`${g(e.path)} uploaded (${a.appId})`),{appId:a.appId,...a.appUrl?{appUrl:a.appUrl}:{},fromCache:!1}}catch(a){return{skipped:!0,reason:a.message}}}function h(e){return`${e.platform}|${J(e)}`}var f=new Map,re=new Set;function te(e){return re.has(h(e))}function rr(e,r,t){r.state==="stopped"&&(f.has(h(r))||ae(e,r,t))}async function oe(e,r,t){let o=f.get(h(r));return o?(t?.(`waiting for ${r.displayName} to finish booting\u2026`),o):ae(e,r,t)}function ae(e,r,t){let o=h(r),i=e.prepare(r,t);f.set(o,i),r.state==="stopped"&&i.then(()=>re.add(o),()=>{});let s=()=>{f.get(o)===i&&f.delete(o)};return i.then(s,s),i.catch(()=>{}),i}import{basename as Ue}from"path";import{spawnSync as Se}from"child_process";async function _e(e,r,t){if(!e.teardownPlan||!t.appPackage&&!t.shutdown)return;let o;try{o=await e.teardownPlan(r,t)}catch{return}o.length!==0&&P(`device:${r.id}`,()=>{z({udid:r.id,displayName:r.displayName});for(let i of o)try{Se(i.file,i.args,{timeout:3e4,stdio:"ignore"})}catch{}})}var ie={emulator:[".apk"],simulator:[".zip"]};async function Ee(e,r,t,o){if(e.kind==="package")return e;if(e.kind==="app_id"){let i=r.cloudUpload;if(!i)throw new Error(`${e.value} is an app id, which needs an account to download it. Log in, or pass a path to a local build instead.`);let s=await H({appId:e.value,baseUrl:i.baseUrl,auth:i.auth,...ie[t]?{accepts:ie[t]}:{},...o?{onProgress:o}:{}}),n=x(s.path);if(!n||n.kind==="app_id")throw new Error(`${s.name} is not a build this CLI can install (from ${e.value}).`);return n}try{let i=new u,s=await D(e.value,i),n=new Y;await n.find(s)||o?.(`copying ${Ue(e.value)} into the local app store\u2026`);let p=await n.put({key:s,sourcePath:e.value,source:"local"});return{...e,value:p.path}}catch{return e}}function Fe(e){P(`appium:${e}`,()=>{K({deviceClass:e,owner:process.pid})})}var k=class extends Error{constructor(r){super(r),this.name="MobileHostUnsupportedError"}},v=class extends Error{constructor(t,o){super(t);this.doctorText=o;this.name="MobilePreflightError"}};async function Me(e,r,t){let o=t.cloudUpload,i=await ee({path:e,type:r,env:o.env,orgId:o.orgId,userId:o.userId,auth:o.auth,baseUrl:o.baseUrl,...t.onProgress?{onProgress:t.onProgress}:{}});if(W(i)){t.onProgress?.(`app not uploaded \u2014 ${i.reason}`);return}return i.appId}var $e="app must be a build (.apk for an emulator, .zip of the .app bundle for a simulator) or an app id from your cloud uploads \u2014 a package id names something already installed on one device, so it cannot be uploaded, exported as code, or run anywhere else.",ne=/\.(apk|zip)$/i;function x(e){let r=e.trim();if(T(r))return{kind:"app_id",value:r};let t=ne.exec(r)?.[1]?.toLowerCase();return t?{kind:t,value:r}:null}function Re(e){return!!e&&(ne.test(e)||T(e.trim()))}function Ne(e){return e.filter(r=>r.required&&r.status==="fail")}function Be(e,r){return!!r&&E(e,r)}async function wr(e){let r=B();if(!r.supported)throw new k(r.reason);let t=e.appiumUrl??e.defaults?.appium_url,o=!!(e.agent||!e.interactive),i=$();o&&e.platform?.toLowerCase()!=="ios"&&((await i.status("emulator")).installed||await i.ensure("emulator",{automatic:!0,onProgress:e.onProgress}));let s=await O(e.platform,{appiumUrl:t});if(L(s)){let d=s.sections.flatMap(y=>Ne(y.checks)).map(y=>y.label).join(", ");throw new v(`Mobile toolchain not ready (${d}). Run \`kane-cli doctor --target ${e.platform?.toLowerCase()==="ios"?"simulator":e.platform?.toLowerCase()==="android"?"emulator":"<emulator|simulator>"}\` for details.`,j(s))}let n=await N({device:e.device,platform:e.platform,defaultTarget:e.defaults?.default_target,interactive:e.interactive}),a;if(n.ok)a=n.target;else if(n.reason==="needs-picker"&&e.pickTarget){let d=await e.pickTarget(n.candidates);if(!d)throw new Error("Target selection cancelled");a=d}else throw new Error(n.message);let p=R(a.platform);if(!p)throw new Error(`No provider for platform "${a.platform}"`);let l=F(a);if(!l)throw new Error(`No managed dependencies serve ${a.platform} ${a.kind} targets yet.`);try{await i.ensure(l,{automatic:o,onProgress:e.onProgress})}catch(d){throw d instanceof M?new v(d.message,d.message):d}let se=a.state!=="ready"||te(a);a=await oe(p,a,e.onProgress);let pe=await G(l,{...t?{appiumUrl:t}:{},device:{udid:a.id,displayName:a.displayName},onProgress:e.onProgress});Fe(l);let I=Be(a,e.defaults?.default_target)?e.defaults?.default_app:void 0,m=e.app??(Re(I)?I:void 0);if(e.app&&!x(e.app))throw new Error(`${e.app}: ${$e}`);let c=m?x(m):null,U=c?await Ee(c,e,l,e.onProgress):null,w=U?await p.ensureApp(a,U,e.onProgress):void 0,b=c?.kind==="app_id"?c.value:e.cloudUpload&&c&&m?await Me(c.value,l,e):void 0;await _e(p,a,{shutdown:se,...w?{appPackage:w}:{}});let de=V(a,w,{noReset:e.noReset??e.defaults?.no_reset,appiumUrl:pe.url,autoGrantPermissions:e.defaults?.auto_grant_permissions,autoAcceptAlerts:e.defaults?.auto_accept_alerts}),S=b??m;return{device:de,target:a,provider:p,...b?{appId:b}:{},...S?{appRef:S}:{}}}export{J as a,V as b,rr as c,oe as d,k as e,v as f,$e as g,x as h,Re as i,wr as j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as w}from"./chunk-TAOHYWEO.js";import{a as h}from"./chunk-RZ4F3BHX.js";import{b as f}from"./chunk-
|
|
2
|
+
import{h as w}from"./chunk-TAOHYWEO.js";import{a as h}from"./chunk-RZ4F3BHX.js";import{b as f}from"./chunk-WEJA3EVI.js";import{mkdtemp as O,rm as $}from"fs/promises";import{createWriteStream as R}from"fs";import{Readable as U}from"stream";import{pipeline as F}from"stream/promises";import{tmpdir as T}from"os";import{basename as z,join as A}from"path";import{access as x,cp as P,mkdir as g,readdir as y,readFile as S,rename as I,rm as k,stat as b,writeFile as v}from"fs/promises";import{basename as D,join as d}from"path";function u(){return d(f,"mobile","apps")}function m(){return d(u(),"index.json")}function C(){return{readIndex:async()=>{try{let e=JSON.parse(await S(m(),"utf8"));return{apps:Array.isArray(e.apps)?e.apps:[]}}catch{return{apps:[]}}},writeIndex:async r=>{await g(u(),{recursive:!0});let e=`${m()}.tmp`;await v(e,JSON.stringify(r,null,2)),await I(e,m())},exists:async r=>{try{return await x(r),!0}catch{return!1}},copy:(r,e)=>P(r,e,{recursive:!0,force:!0}),remove:r=>k(r,{recursive:!0,force:!0}),sizeOf:async r=>{try{return(await b(r)).size}catch{return}},now:()=>new Date}}var c=class{deps;constructor(e={}){this.deps={...C(),...e}}async list(){let{apps:e}=await this.deps.readIndex();return[...e].sort((t,s)=>s.lastUsedAt.localeCompare(t.lastUsedAt))}async find(e){return(await this.deps.readIndex()).apps.find(t=>t.key===e)}async put(e){let t=await this.deps.readIndex(),s=t.apps.find(n=>n.key===e.key),a=this.deps.now().toISOString();if(s&&await this.deps.exists(s.path))return s.lastUsedAt=a,await this.deps.writeIndex(t),s;s&&(t.apps=t.apps.filter(n=>n.key!==e.key));let l=D(e.name??e.sourcePath),o=d(u(),e.key),p=d(o,l);await g(o,{recursive:!0}),await this.deps.copy(e.sourcePath,p);let i={key:e.key,path:p,name:l,source:e.source,...e.source==="local"?{originPath:e.sourcePath}:{},addedAt:a,lastUsedAt:a,...await this.deps.sizeOf(p).then(n=>n?{bytes:n}:{})};return t.apps=[...t.apps.filter(n=>n.key!==e.key),i],await this.deps.writeIndex(t),i}async exists(e){if(await this.deps.sizeOf(e.path)!==void 0)return!0;try{return await y(e.path),!0}catch{return!1}}async forget(e){let t=await this.deps.readIndex(),s=t.apps.find(a=>a.key===e);s&&(await this.deps.remove(s.path),t.apps=t.apps.filter(a=>a.key!==e),await this.deps.writeIndex(t))}async prune(){let e=await this.deps.readIndex(),t=[];for(let s of e.apps)if(await this.deps.sizeOf(s.path)!==void 0)t.push(s);else try{await y(s.path),t.push(s)}catch{}return t.length!==e.apps.length&&await this.deps.writeIndex({apps:t}),t}};var E=30*6e4,j=/^APP\d{6,}$/;function Y(r){return!!r&&j.test(r.trim())}function _(){return{store:new c,client:(r,e)=>new w(r,e),fetchToFile:async(r,e)=>{let t=await h(r,{method:"GET",signal:AbortSignal.timeout(E)});if(!t.ok)throw new Error(`Downloading the app failed: ${t.status} ${t.statusText}`);if(!t.body)throw new Error("Downloading the app failed: empty response body");await F(U.fromWeb(t.body),R(e))}}}async function Z(r,e={}){let t={..._(),...e},s=r.appId.trim(),a=await t.store.find(s);if(a&&await t.store.exists(a))return r.onProgress?.(`using the copy of ${a.name} already on this machine`),await t.store.put({key:s,sourcePath:a.path,source:"cloud",name:a.name}),{path:a.path,name:a.name,fromStore:!0};r.onProgress?.(`looking up ${s}\u2026`);let o=await t.client(r.baseUrl,r.auth).details(s);if(r.accepts&&!r.accepts.some(i=>o.name.toLowerCase().endsWith(i)))throw new Error(`${o.name} cannot run on this device \u2014 expected ${r.accepts.join(" or ")}.`);r.onProgress?.(`downloading ${o.name} \u2014 this can take a while, please wait\u2026`);let p=await O(A(T(),"kane-app-dl-"));try{let i=A(p,z(o.name));await t.fetchToFile(o.url,i);let n=await t.store.put({key:s,sourcePath:i,source:"cloud",name:o.name});return r.onProgress?.(`${o.name} is ready`),{path:n.path,name:n.name,fromStore:!1,details:o}}finally{await $(p,{recursive:!0,force:!0})}}export{c as a,Y as b,Z as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as o}from"./chunk-
|
|
2
|
+
import{x as o}from"./chunk-WEJA3EVI.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
|