@tansr/cli 0.10.3 → 0.11.0
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/package.json +1 -1
- package/tansr-artifacts.json +1223 -831
- package/tansr-bg-A35DNHK2.mjs +5 -0
- package/tansr-chunk-2CIB4KCJ.mjs +5 -0
- package/{tansr-chunk-XXBNISJJ.mjs → tansr-chunk-2HZJSKHM.mjs} +2 -2
- package/{tansr-chunk-CJP7YEGC.mjs → tansr-chunk-2PB54HDR.mjs} +2 -2
- package/tansr-chunk-33QZBUL6.mjs +6 -0
- package/tansr-chunk-3YSQG6KY.mjs +5 -0
- package/tansr-chunk-4DAH4AIH.mjs +7 -0
- package/{tansr-chunk-HHL7HM62.mjs → tansr-chunk-4IWNKAT5.mjs} +2 -2
- package/tansr-chunk-4YAEV3T6.mjs +9 -0
- package/tansr-chunk-546BDI3V.mjs +7 -0
- package/tansr-chunk-6N333TUL.mjs +241 -0
- package/{tansr-chunk-KQVXXXEF.mjs → tansr-chunk-6QKU3GNA.mjs} +2 -2
- package/tansr-chunk-AHUB2IHT.mjs +5 -0
- package/tansr-chunk-AOH7YPF3.mjs +8 -0
- package/{tansr-chunk-C6COFFZK.mjs → tansr-chunk-B2O4DB4K.mjs} +2 -2
- package/tansr-chunk-C2NTVBEY.mjs +5 -0
- package/{tansr-chunk-D7VSW2LQ.mjs → tansr-chunk-C75DEEUJ.mjs} +2 -2
- package/tansr-chunk-ECYZ457U.mjs +5 -0
- package/tansr-chunk-EFN24XG3.mjs +25 -0
- package/tansr-chunk-ENRIN7EG.mjs +7 -0
- package/{tansr-chunk-RVSBSUXE.mjs → tansr-chunk-ITZBYACC.mjs} +2 -2
- package/{tansr-chunk-GMPMRXL4.mjs → tansr-chunk-IZZYKHSW.mjs} +3 -3
- package/tansr-chunk-JIC3VWLQ.mjs +252 -0
- package/tansr-chunk-JTGWG4BG.mjs +32 -0
- package/tansr-chunk-LA3LGOYQ.mjs +11 -0
- package/tansr-chunk-MAMODDQN.mjs +5 -0
- package/tansr-chunk-N644DEOO.mjs +5 -0
- package/tansr-chunk-NQOYEFEE.mjs +5 -0
- package/tansr-chunk-O7P4OFK7.mjs +7 -0
- package/tansr-chunk-OEHA7T4Q.mjs +26 -0
- package/{tansr-chunk-ZV3NCXTD.mjs → tansr-chunk-OKNSOZDU.mjs} +7 -7
- package/tansr-chunk-OT4KIQLR.mjs +9 -0
- package/tansr-chunk-OUOTEH4A.mjs +5 -0
- package/tansr-chunk-Q3XDAUKT.mjs +65 -0
- package/tansr-chunk-RFH7OCN6.mjs +5 -0
- package/tansr-chunk-RUYIVG72.mjs +12 -0
- package/tansr-chunk-SCFXBKV6.mjs +8 -0
- package/tansr-chunk-SHLU4JN2.mjs +5 -0
- package/{tansr-chunk-M774GK3P.mjs → tansr-chunk-SIV2666W.mjs} +2 -2
- package/tansr-chunk-SX3XZNN6.mjs +6 -0
- package/tansr-chunk-SXNTYWJY.mjs +8 -0
- package/tansr-chunk-UVL2XWKL.mjs +5 -0
- package/tansr-chunk-V4HGMAJS.mjs +375 -0
- package/{tansr-chunk-2X337GKC.mjs → tansr-chunk-W2WIN3M2.mjs} +2 -2
- package/tansr-chunk-WAYVH5ON.mjs +5 -0
- package/tansr-chunk-WPKFARCU.mjs +11 -0
- package/{tansr-chunk-726Y5F3M.mjs → tansr-chunk-YEYFEVYF.mjs} +2 -2
- package/tansr-chunk-YK3CE3JM.mjs +5 -0
- package/tansr-chunk-YOSRXZWY.mjs +5 -0
- package/tansr-compaction-history-LZXZTWBV.mjs +5 -0
- package/tansr-compaction-log-H2SPLK24.mjs +5 -0
- package/tansr-indexed-CPYJVPFI.mjs +5 -0
- package/tansr-lock-XWDVZMLY.mjs +5 -0
- package/tansr-main-6GDLXIRQ.mjs +7 -0
- package/tansr-render-SVMDLHLN.mjs +6 -0
- package/tansr-restore-7PS7WCJR.mjs +5 -0
- package/tansr-run-acp-entry-EQGUKZ5R.mjs +68 -0
- package/tansr-run-approvals-entry-SEYBHLS2.mjs +12 -0
- package/{tansr-run-auth-entry-7HA4C4NJ.mjs → tansr-run-auth-entry-R3GKGKWX.mjs} +2 -2
- package/tansr-run-doctor-B3XK72DW.mjs +11 -0
- package/tansr-run-headless-entry-4XTAVPTW.mjs +84 -0
- package/tansr-run-init-entry-GH2KDGI6.mjs +5 -0
- package/tansr-run-logout-entry-PLGYDEOB.mjs +5 -0
- package/tansr-run-mcp-serve-entry-UHK4WSKL.mjs +14 -0
- package/tansr-run-orchestrate-entry-M7R3433X.mjs +11 -0
- package/tansr-run-org-entry-UONLGJIJ.mjs +17 -0
- package/tansr-run-policy-entry-NNQCV5WS.mjs +16 -0
- package/tansr-run-profile-entry-PV6OO7FV.mjs +14 -0
- package/tansr-run-serve-entry-GWZQZ37P.mjs +16 -0
- package/tansr-run-sessions-entry-WL7YLRJL.mjs +25 -0
- package/tansr-run-update-entry-YI47IPCC.mjs +5 -0
- package/tansr-spill-YVUTIFOS.mjs +5 -0
- package/tansr-src-LPMSGRKO.mjs +5 -0
- package/{tansr-src-A6WDMY6X.mjs → tansr-src-RQJPOVDN.mjs} +50 -50
- package/tansr-startup-account-MYFJ3NOL.mjs +7 -0
- package/{tansr-startup-model-I6LOCFDP.mjs → tansr-startup-model-BCGEYUM4.mjs} +3 -3
- package/tansr-storage-journal-4E274MUA.mjs +5 -0
- package/tansr-todos-replay-TVQKP7OD.mjs +5 -0
- package/tansr-tui-3Q7Z3ALV.mjs +73 -0
- package/tansr.mjs +1 -1
- package/tansrd.mjs +444 -265
- package/tansr-bg-EAYYM4XW.mjs +0 -5
- package/tansr-chunk-2C6JKHKM.mjs +0 -25
- package/tansr-chunk-4LNN4SQL.mjs +0 -22
- package/tansr-chunk-5T7X32UX.mjs +0 -6
- package/tansr-chunk-5TJVZSZE.mjs +0 -6
- package/tansr-chunk-74H5GQTJ.mjs +0 -35
- package/tansr-chunk-7T6OLLFW.mjs +0 -12
- package/tansr-chunk-BX7CF5RQ.mjs +0 -25
- package/tansr-chunk-DN22GXHD.mjs +0 -8
- package/tansr-chunk-F7C6ITED.mjs +0 -5
- package/tansr-chunk-GDJ5YVNY.mjs +0 -5
- package/tansr-chunk-GR6BWQGG.mjs +0 -38
- package/tansr-chunk-HRKJLVKC.mjs +0 -7
- package/tansr-chunk-I3TOVAA6.mjs +0 -5
- package/tansr-chunk-IZICOKKF.mjs +0 -279
- package/tansr-chunk-J2LWM3S7.mjs +0 -5
- package/tansr-chunk-M6XHWCMA.mjs +0 -11
- package/tansr-chunk-MWHLITGY.mjs +0 -11
- package/tansr-chunk-N3R2URKL.mjs +0 -5
- package/tansr-chunk-NA22YT73.mjs +0 -5
- package/tansr-chunk-OSK64SU3.mjs +0 -5
- package/tansr-chunk-QEKVLX7W.mjs +0 -5
- package/tansr-chunk-QHEQQ2JB.mjs +0 -9
- package/tansr-chunk-QUFHVA3F.mjs +0 -5
- package/tansr-chunk-QWGSXFEJ.mjs +0 -7
- package/tansr-chunk-SJFDQLLC.mjs +0 -5
- package/tansr-chunk-X4GLXJ2Z.mjs +0 -67
- package/tansr-chunk-X5REV3T3.mjs +0 -8
- package/tansr-chunk-ZQ3ZK7IL.mjs +0 -37
- package/tansr-main-STVTNYAI.mjs +0 -7
- package/tansr-render-PUEISX75.mjs +0 -6
- package/tansr-run-acp-entry-6J44XOYJ.mjs +0 -63
- package/tansr-run-approvals-entry-HQWSIW3P.mjs +0 -12
- package/tansr-run-doctor-7T6IAXYE.mjs +0 -10
- package/tansr-run-headless-entry-XEFQC5LE.mjs +0 -78
- package/tansr-run-init-entry-3VKXS2WK.mjs +0 -5
- package/tansr-run-logout-entry-VNCNNCSS.mjs +0 -5
- package/tansr-run-mcp-serve-entry-5KLWER3G.mjs +0 -14
- package/tansr-run-orchestrate-entry-AR57AZLR.mjs +0 -11
- package/tansr-run-org-entry-TJPRLGCL.mjs +0 -17
- package/tansr-run-policy-entry-DHMQ3PAP.mjs +0 -16
- package/tansr-run-profile-entry-LOFPHFG4.mjs +0 -14
- package/tansr-run-serve-entry-CHVKUY5J.mjs +0 -99
- package/tansr-run-sessions-entry-JOMFB5LJ.mjs +0 -23
- package/tansr-run-update-entry-XI6KG7UI.mjs +0 -5
- package/tansr-sqlite-event-store-UQLSSZKP.mjs +0 -26
- package/tansr-sqlite-spool-implementation-LHEIRSUX.mjs +0 -29
- package/tansr-src-KOEPYVXX.mjs +0 -5
- package/tansr-startup-account-7ZFSP3FV.mjs +0 -7
- package/tansr-tui-OWG3JNA6.mjs +0 -75
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{b as Bo}from"./tansr-chunk-2PB54HDR.mjs";import{a as Do,b as As,c as Os}from"./tansr-chunk-2CIB4KCJ.mjs";import{b as be,c as Is,d as Cs,e as Re,f as Ts}from"./tansr-chunk-33QZBUL6.mjs";import{g as Hs}from"./tansr-chunk-WPKFARCU.mjs";import"./tansr-chunk-SCFXBKV6.mjs";import{$b as ps,A as Zo,Ab as rs,B as er,C as tr,Cb as ss,D as or,Db as ns,Ea as xr,Eb as is,F as rr,Fa as Or,Fb as as,G as sr,Ga as Lr,I as nr,J as ir,K as ar,L as dr,Ma as Nr,Nb as ds,Oa as Br,Qb as at,Ra as jr,Rb as cs,Sa as Dr,Sb as ls,T as cr,Ta as Fr,Ub as us,X as lr,_ as ur,a as st,aa as pr,ab as Ur,ac as dt,b as Ho,bb as Hr,bc as ms,d as _o,da as kr,f as Wo,fb as _r,fc as fs,g as qo,gb as Wr,gc as gs,i as Go,ia as Sr,ic as ks,j as Ko,ja as nt,jb as qr,jc as Ss,k as $o,ka as wr,kc as ws,lb as Gr,lc as bs,m as Vo,n as Yo,na as br,nc as Rs,oa as Rr,oc as Ms,pa as Mr,pb as Kr,pc as Es,qa as Er,qb as $r,rb as Vr,sb as Yr,ta as Ar,tb as Qr,ua as Ir,v as Qo,va as Cr,w as zo,wa as Tr,x as Jo,xa as Pr,xb as es,y as Xo,yb as ts,zb as os}from"./tansr-chunk-Q3XDAUKT.mjs";import{c as Ze,e as Jt,f as Xt}from"./tansr-chunk-PIET7WB3.mjs";import{a as Oo,d as Lo,f as No}from"./tansr-chunk-C2NTVBEY.mjs";import{a as mr,c as fr,d as gr,f as yr,g as hr,j as vr}from"./tansr-chunk-4IWNKAT5.mjs";import"./tansr-chunk-YEYFEVYF.mjs";import{P as _s,S as Ws,U as qs,a as Me}from"./tansr-chunk-W2WIN3M2.mjs";import{h as Uo,j as it,t as zr,u as Jr,y as Xr,z as Zr}from"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-F5STVU7J.mjs";import"./tansr-chunk-ECYZ457U.mjs";import{a as Ls,b as Ns,c as Bs,d as js,g as Ds,h as Fs,i as Us}from"./tansr-chunk-JTGWG4BG.mjs";import{n as Ps,o as xs}from"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-2QKLANZQ.mjs";import{c as Ao,d as Io,e as Co,f as To,g as Po,h as xo,i as ys,k as hs,l as vs}from"./tansr-chunk-OUOTEH4A.mjs";import{a as u}from"./tansr-chunk-AMMPDY4V.mjs";import{c as we}from"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import{V as Fo}from"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{a as k,b as S}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import{o as tt,p as ot,t as jo}from"./tansr-chunk-WAYVH5ON.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-RFH7OCN6.mjs";import{r as rt}from"./tansr-chunk-SHLU4JN2.mjs";import{$e as Eo,D as uo,Gc as Ro,Ia as ho,J as po,T as mo,Ub as vo,V as fo,_ as go,be as Mo,nc as ko,oc as So,pc as wo,qc as bo,ua as yo}from"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import{Ja as ao,K as no,Ta as co,gb as lo}from"./tansr-chunk-6N333TUL.mjs";import{A as to,D as oo,aa as ro,c as eo,oa as so,pa as et}from"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{k as Qt,m as r,o as zt}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import{Vb as Zt}from"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import{v as io}from"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import{randomUUID as an}from"node:crypto";import Ks from"node:os";function Gs(y){let d=y.fetchImpl??fetch;return g=>{let h=g.challenge,l=mo(g.call.args),s=`/v1/approvals/${h.id}/credential`,M=g.gate.adjudication,o={kind:"tansr.approval.challenge",challengeId:h.id,digest:h.digest,policyAnchor:h.policyAnchor,createdAt:h.createdAt,expiresAt:h.expiresAt,tool:{name:g.call.name,...l!==void 0?{summary:l}:{}},attribution:{decision:g.gate.decision,source:g.gate.source,...g.gate.matchedRule!==void 0?{matchedRule:g.gate.matchedRule}:{},...g.gate.sourceLayer!==void 0?{sourceLayer:g.gate.sourceLayer}:{}},...M!==void 0?{adjudication:{childAgentId:M.childAgentId,childDescription:M.childDescription,endorsed:M.endorsed,chain:M.chain.map(f=>({adjudicator:f.adjudicator,verdict:f.verdict,reason:f.reason,via:f.via,elapsedMs:f.elapsedMs}))}}:{},...g.session!==void 0?{session:g.session}:{},credential:{method:"POST",path:s,...y.credentialBaseUrl!==void 0?{url:`${y.credentialBaseUrl.replace(/\/+$/,"")}${s}`}:{}}},p=f=>{y.coordinator.cancel(h.id),y.onError?.(r(k.approvalPublishFailed,{challengeId:h.id,message:f}))};d(y.endpoint,{method:"POST",headers:{"content-type":"application/json",...y.token!==void 0?{authorization:`Bearer ${y.token}`}:{}},body:JSON.stringify(Zt(o))}).then(f=>{f.ok||p(`HTTP ${f.status}`)}).catch(f=>{p(f instanceof Error?f.message:String(f))})}}var ce=ao;async function dn(y){let{checkpoints:d,sink:g,history:h,checkpointId:l}=y,s=y.generation.signal,M,o=(p,f=u.usage)=>({ok:!1,reason:p,exitCode:f});try{if(s?.aborted)return o("aborted",u.aborted);let p=await d.readAncestor?.(l);if(p==null)return o("unverified_ancestor");let f=ko({history:h,checkpoint:p.checkpoint,sourceSessionId:p.sourceSessionId,allowedSourceSessionIds:p.allowedSourceSessionIds,generation:0});if(!f.ok)return o(f.reason);let{plan:E}=f,W,i=()=>g.currentSessionId()===E.sourceSessionId&&W?.()!==!1&&So(E,{history:h,generation:0});await g.commitHistoryDurable(h);let I=await bo({...y.generation,plan:E,isCurrent:i});if(!I.ok)return o(I.reason,I.reason==="aborted"?u.aborted:I.reason==="budget"?u.resourceLimit:u.modelError);if(W=I.isCurrent,s?.aborted)return o("aborted",u.aborted);if(!i())return o("source_changed");let Y=async()=>{let T=await d.readAncestor?.(l);return T!=null&&T.sourceSessionId===E.sourceSessionId&&wo(E,T.checkpoint)};if(!await Y())return o("source_changed");M=await d.write({trigger:"pre_restore",messages:h,deferRetention:!0});let j=await g.prepareHistoryRewrite(I.messages,{signal:s});try{let T=await Y();return s?.aborted?o("aborted",u.aborted):!T||!i()?o("source_changed"):(j.publish(),y.install(I.messages),{ok:!0,targetMessages:E.targetMessages.length,toMessages:I.messages.length})}finally{await j.dispose()}}catch(p){return o(s?.aborted?"aborted":p instanceof Error?p.message:String(p),s?.aborted?u.aborted:u.modelError)}finally{if(M!==void 0)try{let p=await d.settleRetention?.(M);p!==void 0&&y.onRetentionError?.(new Error(p))}catch(p){try{y.onRetentionError?.(p)}catch{}}}}async function Hn(y){let d=Ns(y);if(!d.ok)return process.stderr.write(r(d.error.key,d.error.params)+`
|
|
5
|
+
`),u.usage;let g=vo({onProgress:Do(e=>process.stderr.write(e+`
|
|
6
|
+
`))}),h=await g.run("identity",()=>Bo({requested:d.options.cwd,fallback:process.cwd(),homedir:Ks.homedir()}));if(!h.ok)return process.stderr.write(r(h.key,h.params)+`
|
|
7
|
+
`),u.usage;let l=h.cwd;if(d.options.worktree!==void 0||d.options.bg===!0){let e=l,t=ot(process.env),n;if(d.options.worktree!==void 0){let m=await _s({storageRoot:t,cwd:e,...d.options.worktree.name!==void 0?{name:d.options.worktree.name}:{}});if(!m.ok)return process.stderr.write(r(m.key,m.params)+`
|
|
8
|
+
`),u.usage;n=m.path,process.stderr.write(r(S.worktreeCreated,{path:m.path})+`
|
|
9
|
+
`),process.stderr.write(r(S.worktreeKeepHint,{path:m.path})+`
|
|
10
|
+
`)}if(d.options.bg===!0){let m=await Ws({storageRoot:t,env:process.env,cwd:e,argv:y,prompt:d.options.prompt??"",...n!==void 0?{worktreePath:n}:{},stripArgv:Bs});return m.ok?(Ls(d.options)==="text"?(process.stdout.write(r(Me.launchTask,{id:m.record.id})+`
|
|
11
|
+
`),process.stdout.write(r(Me.launchLog,{path:m.record.logPath})+`
|
|
12
|
+
`),n!==void 0&&process.stdout.write(r(Me.launchWorktree,{path:n})+`
|
|
13
|
+
`)):process.stdout.write(JSON.stringify({type:"background_launched",id:m.record.id,logPath:m.record.logPath,...n!==void 0?{worktreePath:n}:{}})+`
|
|
14
|
+
`),u.ok):(process.stderr.write(r(m.key,m.params)+`
|
|
15
|
+
`),u.modelError)}n!==void 0&&(process.chdir(n),l=process.cwd())}let s=process.env,M={lang:d.options.lang,effort:d.options.effort,outputStyle:d.options.outputStyle,maxBudgetUsd:d.options.maxBudgetUsd,model:d.options.model,contextScheme:d.options.contextScheme},o=await g.run("authority",()=>Zr({cwd:l,env:s,flagOverrides:zr(M)})),p=Jr(o.remoteSettings,M);Qt(zt({cliLang:p.lang,configLocale:o.loaded.locale,env:s}));let f;try{f=Lo({flags:{...d.options.sessionsDir!==void 0?{sessionsDir:d.options.sessionsDir}:{},...d.options.checkpointsDir!==void 0?{checkpointsDir:d.options.checkpointsDir}:{}},env:s,settings:o.loaded.storage,homedir:Ks.homedir(),cwd:l})}catch(e){if(e instanceof Oo)return process.stderr.write(e.message+`
|
|
16
|
+
`),u.usage;throw e}let E=No(f.sessionsDir),W=wr(s),i;try{i=await ts({env:s,sessionEvents:W,...o.loaded.network?.twpIdleTimeoutMs!==void 0?{twpIdleTimeoutMs:o.loaded.network.twpIdleTimeoutMs}:{}})}catch(e){if(!es(e))throw e;return process.stderr.write(e.message+`
|
|
17
|
+
`),u.usage}for(let e of i.notices)process.stderr.write(r(e.key,e.params)+`
|
|
18
|
+
`);i.setWarningListener(e=>{process.stderr.write(r(e.key,e.params)+`
|
|
19
|
+
`)});let I=i.applyTo(o.registryConfig);if(I===null){let e=Xr({gate:o.localProviders,remoteEnabled:i.enabled,env:s});return process.stderr.write(r(e.key,e.params)+`
|
|
20
|
+
`),u.usage}let Y=ss(I,i.governance);for(let e of Y.notices)process.stderr.write(r(e.key,e.params)+`
|
|
21
|
+
`);let j=Y.config,T={...i.providerEnv!==null?{env:i.providerEnv}:{},...i.fetchImpl!==null?{fetchImpl:i.fetchImpl}:{},...i.twp!==null?{twp:i.twp}:{}},le=await ks({cwd:l,env:s});for(let e of Rs(le.diagnostics))process.stderr.write(e.message+`
|
|
22
|
+
`);let F=bs({...p.outputStyle!==void 0?{flagName:p.outputStyle}:{},env:s,...o.loaded.outputStyle!==void 0?{configName:o.loaded.outputStyle}:{},styles:le.styles});if(!F.ok){let e=ws(le.styles);return process.stderr.write((F.channel==="flag"?r(S.invalidChoice,{flag:"--output-style",value:F.requested,expected:e}):r(F.channel==="config"?k.unknownOutputStyleConfig:k.unknownOutputStyleEnv,{value:F.requested,expected:e}))+`
|
|
23
|
+
`),u.usage}let se=ns({...p.model!==void 0?{flag:p.model}:{},...o.modelSelection.selected!==void 0?{persisted:o.modelSelection.selected}:{},...o.modelSelection.layer!==void 0?{persistedLayer:o.modelSelection.layer}:{},projectPinnedMain:o.modelSelection.projectPinnedMain,config:j,review:Y});if(se.error!==void 0)return i.dispose?.(),process.stderr.write(r(se.error.key,se.error.params)+`
|
|
24
|
+
`),u.usage;let Ee=is({notice:se.notice,modelSelection:o.modelSelection,config:j,sources:o.sources,env:s});Ee!==void 0&&process.stderr.write(r(Ee.key,Ee.params)+`
|
|
25
|
+
`);let Ae=se.alias,P=an(),ct=[],lt=0,ne,Q=(e,t)=>{let n={...e,sessionId:P,seq:lt,ts:Date.now(),v:"v0",source:t};return ne?.consume(n),ct.push(n),lt+=1,n},$s=e=>{let t=so(e);t!==null&&Q(t,"provider")},ut=null,Ie=ds(),ue=eo({onAttempt:e=>{Ie.note(e),ut?.(e)}}).observer,z,a,J;try{({client:z,resolved:a,registry:J}=it(j,Ae,{onProviderSelected:$s,attemptObserver:ue,...T}))}catch(e){if(e instanceof oo)return process.stderr.write(r(k.missingApiKey,{env:e.envVar??r(k.authEnvUnset)})+`
|
|
26
|
+
`),u.usage;if(e instanceof to)return process.stderr.write(r(k.unknownModel,{model:Ae})+`
|
|
27
|
+
`),u.usage;throw e}let q=Ur(o.loaded.window?.byModel),x=Or(j,a,{mainAlias:Ae,attemptObserver:ue,mainRunWindow:q(a.capability,a.modelName),...i.enabled?{fastStrategy:{fallbackRefs:i.governance.fastFallbackGroup.map(e=>`tansr/${e}`)}}:{},...T});x.fast!==void 0&&xr(x,{provider:a.providerId,model:a.modelName})&&process.stderr.write(r(k.compactionOnMainModel,{fast:`${x.fast.model.provider}/${x.fast.model.model}`,main:`${a.providerId}/${a.modelName}`})+`
|
|
28
|
+
`);let ie=Ao({...o.loaded.context!==void 0?{settings:o.loaded.context}:{},...i.governance.contextScheme!==null?{remote:i.governance.contextScheme}:{}});for(let e of ie.diagnostics)process.stderr.write(r(e.key,e.params)+`
|
|
29
|
+
`);let G=Io({registry:ie,...p.contextScheme!==void 0?{flagId:p.contextScheme}:{},...ie.remoteSchemeId!==null?{remoteId:ie.remoteSchemeId}:{},remoteLocked:ie.remoteSchemeLocked,...o.loaded.context!==void 0?{settings:o.loaded.context}:{}});if(!G.ok)return process.stderr.write(r(G.key,G.params)+`
|
|
30
|
+
`),u.usage;G.notice!==void 0&&process.stderr.write(r(G.notice.key,G.notice.params)+`
|
|
31
|
+
`);let O=G.scheme,Ce=To(O);Ce!==null&&process.stderr.write(r(Ce.key,Ce.params)+`
|
|
32
|
+
`);let L=Co(O,x.compaction),Te=Po(O,L.query,q(a.capability,a.modelName));Te!==null&&process.stderr.write(r(Te.key,Te.params)+`
|
|
33
|
+
`);let Pe=xo(O,L.query,q(a.capability,a.modelName));Pe!==null&&process.stderr.write(r(Pe.key,Pe.params)+`
|
|
34
|
+
`);let xe=ot(s),X=d.options.resume;if(d.options.continueSession===!0&&(X=await jo(E,l),X===void 0))return process.stderr.write(r(S.continueNotFound)+`
|
|
35
|
+
`),u.usage;let pt,mt=o.loaded.usageReporting?.enabled!==!1,c=await g.run("context",()=>Hs({storageRoot:E,cwd:l,model:{provider:a.providerId,model:a.modelName},...X!==void 0?{resumeSessionId:X}:{},defaultSessionId:P,outputStyle:()=>pt,platformSessionId:()=>i.platformSessionId(),...mt?{}:{usageReportingDisabled:!0},onSinkError:e=>process.stderr.write(e+`
|
|
36
|
+
`),...o.loaded.storage?.segmentation!==void 0?{segmentation:o.loaded.storage.segmentation}:{}}));if(!c.ok)return process.stderr.write(r(c.key,c.params)+`
|
|
37
|
+
`),u.usage;P=c.sessionId;let Oe;if(d.options.restore!==void 0&&d.options.branchSummary!==!0){let e=d.options.restore,t;try{t=await Qo({paths:f,sessionsRoot:E,currentSessionId:()=>c.sink.currentSessionId(),volumeIds:()=>c.sink.volumeIds()},e)}catch(n){return process.stderr.write(r(S.restoreFailed,{checkpointId:e,message:n instanceof Error?n.message:String(n)})+`
|
|
38
|
+
`),u.usage}if(t===null)return process.stderr.write(r(S.restoreNotFound,{checkpointId:e})+`
|
|
39
|
+
`),u.usage;Oe={checkpointId:e,located:t}}if(c.lastEffectiveModel!==void 0){let e=br(c.lastEffectiveModel,{provider:a.providerId,model:a.modelName});e!==null&&W.record(e)}let Le=mt&&i.enabled&&i.fetchImpl!==null?Os({env:s,apiBaseUrl:we(s),fetchImpl:i.fetchImpl,directEndpoints:i.governance.directEndpoints,sessionId:()=>i.platformSessionId()??void 0,...i.keyId!==null?{profileKeyId:i.keyId}:{}}):null,pe=F.selection?.style,Ne=c.meta?.outputStyle;if(Ne!==void 0&&F.selection?.source!=="flag"&&F.selection?.source!=="env"){let e=Ss(le.styles,Ne);e===void 0?process.stderr.write(r(tt.resumeStyleUnknown,{style:Ne})+`
|
|
40
|
+
`):(pe=e,pt=e.name)}let ft=pe?.body!==void 0?{name:pe.name,body:pe.body}:void 0;await qs(s,P,e=>process.stderr.write(e+`
|
|
41
|
+
`));let Z=nr(l,await sr(rr(s))),gt=Jt(Z,{env:s,flag:d.options.trustProjectHooks===!0}),yt=ir(Z,gt);yt!==null&&process.stderr.write(yt+`
|
|
42
|
+
`);let ht=ar({enforce:o.loaded.workspaceTrust.enforce,status:Z});o.loaded.workspaceTrust.enforce===!0&&ht&&process.stderr.write(dr(Z)+`
|
|
43
|
+
`);let Vs=d.options.permissionMode!==void 0?await Ir(o.sources):Ar,me=Cr({flagMode:d.options.permissionMode,configMode:o.loaded.permissions.defaultMode,managed:Vs});me.overriddenFlagMode!==void 0&&process.stderr.write(r(k.permissionModeLocked,{mode:me.overriddenFlagMode,locked:me.mode??"default"})+`
|
|
44
|
+
`);let w=await yr({env:s,policy:o.loaded.policy}),Be=fr(me.mode,w.anchor);Be.lockedMode!==void 0&&process.stderr.write(gr(Be.lockedMode).message+`
|
|
45
|
+
`);let vt={env:s,...o.loaded.permissions.classifierEnabled!==void 0?{configEnabled:o.loaded.permissions.classifierEnabled}:{},configGovernance:Wr(o.loaded.permissions),...x.fast!==void 0?{fast:x.fast}:{},stage2:{client:z,model:{provider:a.providerId,model:a.modelName},...a.capability.sampling?.temperatureFixed!==void 0?{temperatureFixed:a.capability.sampling.temperatureFixed}:{}}},kt=await qr({env:s,...w.anchor?.qualificationRemote!==void 0?{anchor:w.anchor.qualificationRemote}:{},...w.trustedKeys!==void 0?{trustedKeys:w.trustedKeys}:{}});for(let e of kt.notices)process.stderr.write(e.message+`
|
|
46
|
+
`);let ee=await Gr({env:s,...w.anchor?.adjudicatorPool!==void 0?{anchor:w.anchor.adjudicatorPool}:{},...w.trustedKeys!==void 0?{trustedKeys:w.trustedKeys}:{}});for(let e of ee.notices)process.stderr.write(e.message+`
|
|
47
|
+
`);i.setAdjudicatorPool(ee.governance);let fe={adjudicator:i.governance.adjudicator,adjudicatorPolicies:i.governance.adjudicatorPolicies,...i.governance.modelRoles===void 0?{}:{modelRoles:i.governance.modelRoles,modelRoleRevision:i.governance.modelRoleRevision},buildClient:(e,t)=>{let n=it(j,e,{modelRole:"adjudicator",primaryOnly:t,attemptObserver:ue,...T});return{client:n.client,resolved:n.resolved,roleFallbackDisabled:n.registry.usesGatewayCache,retryBudget:n.registry.governor?.retryBudget,...n.temperatureFixed===void 0?{}:{temperatureFixed:n.temperatureFixed},model:{provider:n.resolved.providerId,model:n.resolved.modelName}}},pricing:i.pricingUpdates,platformHandles:i.governance.models.map(e=>e.handle),remoteAliases:i.governance.remoteAliases,...ee.governance!==null?{pool:ee.governance.entries}:{}},U=st(fe);fe.adjudicatorPolicies!==void 0&&i.setGovernanceRefreshListener(e=>{U=st({...fe,latestAdjudicatorPolicies:e.governance.adjudicatorPolicies??null,latestAdjudicatorSelection:e.governance.modelRoles?.adjudicator,latestAdjudicatorCandidates:e.governance.modelRoles?.adjudicator.candidates??[],latestAdjudicatorUnavailable:e.governance.modelRoles?.adjudicator.primary==null,pricing:e.pricingUpdates});for(let t of U.notices)process.stderr.write(r(t.key,t.params)+`
|
|
48
|
+
`)});for(let e of U.notices)process.stderr.write(r(e.key,e.params)+`
|
|
49
|
+
`);let je=Fo(),St=null,wt=await $r({env:s}),{config:bt,appointment:Ys,evidence:Qs}=Kr({...i.governance.modelRoles===void 0?{}:{roleBinding:()=>U.remote?.roleBinding},...vt,remoteQualification:kt,...ee.governance!==null?{pool:ee.governance.entries}:{},...wt!==void 0?{evaluationLedger:wt}:{},...w.anchor?.autoTierCeiling!==void 0?{managedCeiling:w.anchor.autoTierCeiling}:{},requestMeasurement:{onRequestMeasured:e=>{St?.onRequestMeasured(e)}}}),De=Vr({appointment:Ys,evidence:Qs});De!==void 0&&process.stderr.write(r(De.key,De.params)+`
|
|
50
|
+
`);let Fe=Yr({pool:U.remote?.pool,profileId:i.governance.adjudicator?.profileId});Fe!==void 0&&process.stderr.write(r(Fe.key,Fe.params)+`
|
|
51
|
+
`);let Ue=bt===void 0?void 0:{...bt,rejectEffect:Hr(!1),transcript:()=>je.transcript(),onBreakerTrip:e=>process.stderr.write(r(e.kind==="total"?k.classifierBreakerTotal:k.classifierBreakerConsecutive)+`
|
|
52
|
+
`),onBudgetExhausted:()=>process.stderr.write(r(k.classifierBudgetExhausted)+`
|
|
53
|
+
`)};Ue===void 0&&_r(vt)&&process.stderr.write(r(k.classifierFastMissing)+`
|
|
54
|
+
`);let He=ht?or:Be.mode,Rt=Pr({mode:He,env:s});if(Rt.kind==="refused")return process.stderr.write(r(k.bypassRootRefused)+`
|
|
55
|
+
`),u.usage;Rt.kind==="overridden"&&process.stderr.write(r(k.bypassRootOverridden)+`
|
|
56
|
+
`);let Mt=fs({env:s,...o.loaded.audit!==void 0?{auditConfig:o.loaded.audit}:{}}),v=await Br({enabled:Nr({settingValue:o.loaded.memory.autoMemory,scheme:O}),cwd:l,env:s});for(let e of v.warnings)process.stderr.write(r(e.key,e.params)+`
|
|
57
|
+
`);let N=new yo({...He!==void 0?{mode:He}:{},layers:o.loaded.permissions.layers,baseline:{enabled:o.loaded.permissions.disableBaselineProtection!==!0},...Ue!==void 0?{classifier:Ue}:{},...Mt!==void 0?{hardSafety:Mt}:{},...v.setup!==null?{memoryWriteCarveOut:{dirs:[v.setup.dir]}}:{}});Tr(N,{allowedTools:d.options.allowedTools,disallowedTools:d.options.disallowedTools},l);{let e=o.loaded.permissions.frozenProjectAllow??[],t=(await us(cs(s))).records;if(e.length>0||t.length>0){let n=ls(l);if(e.length>0){let{granted:B}=ps(e,t,n);B.length>0&&(dt(N,B,l),process.stderr.write(r(at.restored,{count:B.length})+`
|
|
58
|
+
`))}let m=ms(t,n);m.length>0&&(dt(N,m,l),process.stderr.write(r(at.restoredAsk,{count:m.length})+`
|
|
59
|
+
`))}}let Et=await vr(N,{env:s,trust:w,...o.loaded.permissions.recommendedRules!==void 0?{recommendedRules:o.loaded.permissions.recommendedRules}:{}});for(let e of Et.notices)process.stderr.write(e.message+`
|
|
60
|
+
`);if(Et.refuseLaunch)return process.stderr.write(r(mr.refuseLaunch)+`
|
|
61
|
+
`),u.usage;let At=hr(w),te=await pr({cwd:l,env:s,reservedMcpNames:new Set(o.loaded.mcpServers.map(e=>e.name)),...At!==void 0?{verify:At}:{},projectTrust:{projectPath:l,records:await ur(lr(xe)),interactive:!1}});for(let e of te.notices)process.stderr.write(e.message+`
|
|
62
|
+
`);let It=Xt(()=>gt.enabled);It.exempt(te.hooks);let Ct=Uo(i.pricingUpdates),Tt=o.loaded.budget!==void 0||p.maxBudgetUsd!==void 0?{...o.loaded.budget??{},...p.maxBudgetUsd!==void 0?{maxUsd:p.maxBudgetUsd}:{}}:void 0,ae=c.usageSnapshot;ae!==void 0&&ae.staleMessages>0&&process.stderr.write(r(tt.resumeUsageStale,{count:ae.staleMessages})+`
|
|
63
|
+
`);let _e=null,C=await g.run("installation",()=>kr({surface:"headless",sessionId:P,currentSessionId:()=>c.sink.currentSessionId(),cwd:l,sessionsRoot:E,env:s,loaded:o.loaded,engine:N,hooks:{config:Eo(o.loaded.hooks,te.hooks),trust:It},budget:{section:Tt,...ae!==void 0?{restoredSnapshot:ae.payload.snapshot}:{},...Ct!==void 0?{pricing:Ct}:{},resolveReasoningTokens:Yo(J)},spill:!0,...c.spillRecovery===void 0?{}:{spillRecovery:c.spillRecovery},checkpoints:{paths:f,volumeIds:()=>c.sink.volumeIds(),model:()=>({provider:a.providerId,model:a.modelName})},contextEvents:{scheme:()=>({id:O.id,fingerprint:O.fingerprint}),mcp:()=>_e?.meter()}},{emit:Q,notify:e=>process.stderr.write(e+`
|
|
64
|
+
`)}));ne=C.audit;let{hooks:Pt,tracker:K,budget:H,checkpoints:We}=C,qe=Vo(Tt,()=>K.snapshot()),xt=Pt.engine,Ge=Pt.wiring;o.loaded.workspaceTrust.enforce===!0&&Q({type:"session.workspace_trust.changed",trusted:Z.status==="trusted",persisted:Z.status!=="unknown"},"trust");let _=c.initialHistory,ge;if(Oe!==void 0){let{checkpointId:e,located:t}=Oe;if(We.autoCheckpoint&&_.length>0)try{await We.write({trigger:"pre_restore",messages:_})}catch(n){return process.stderr.write(r(S.restoreFailed,{checkpointId:e,message:n instanceof Error?n.message:String(n)})+`
|
|
65
|
+
`),ne?.close("restore_failed"),u.usage}t.checkpoint.cwd!==l&&process.stderr.write(r(S.restoreCwdMismatch,{expected:t.checkpoint.cwd,actual:l})+`
|
|
66
|
+
`),ge={checkpointId:e,fromMessages:_.length,toMessages:t.checkpoint.messages.length},_=t.checkpoint.messages,rt(C.spill)}Ge.sessionStart(X!==void 0?"resume":"startup");let Ot=await as({cwd:l,env:s,extraDirs:te.skillDirs}),oe=await po(l,Ze(s),{userDir:uo(Ze(s),s),...v.setup!==null?{autoMemory:{dir:v.setup.readDir}}:{}});v.setup!==null&&Dr(oe,v.setup);let D=Qr(l,{memory:oe.segments,...v.setup!==null?{autoMemoryWriteGuidance:!0}:{},skillsIndex:Ot.indexSegment,...o.loaded.verify!==void 0?{verify:o.loaded.verify}:{},...ft!==void 0?{outputStyle:ft}:{}}),ye=new co;c.restoredTodos!==void 0&&c.restoredTodos.length>0&&ye.replace(c.restoredTodos);let Lt=Er({env:s,cwd:l,...o.loaded.sandbox!==void 0?{section:o.loaded.sandbox}:{}}),Nt=Ro(s,o.loaded.semanticIndex),Bt=os({env:s,apiBaseUrl:we(s),fetchImpl:i.fetchImpl,governance:i.governance}),zs=_o({env:s,apiBaseUrl:we(s),fetchImpl:i.fetchImpl,governance:i.governance}),Js=rs({cwd:l,sessionId:()=>c.sink.currentSessionId()}),b=Wo({spillReader:()=>C.spill?.reader,store:ye,extraTools:[Ot.tool,...Nt!==null?[Nt]:[]],...Lt!==void 0?{sandbox:Lt}:{},...Bt!==void 0?{searchProvider:Bt}:{},mediaProviders:zs,artifactSink:Js,imageInput:()=>ro(a.capability),...Mo(o.loaded.http)}),Xs=C.sessionArtifactWhitelist,jt=nt(N,b.registry,{cwd:l,hooks:xt,onNotice:e=>process.stderr.write(e+`
|
|
67
|
+
`),sessionEvents:W,sessionArtifactWhitelist:Xs,...v.setup!==null?{memoryReadWhitelist:Rr({dirs:jr(v.setup)})}:{},mcpDiscoverDefaultAllow:!0}),Dt=C.decisions.onDecision,Ft=null,Ut=v.setup!==null?{dirs:[v.setup.dir],onWrite:e=>Ft?.(e)}:void 0,Ht=null,_t=null,Ke=Es({emit:e=>Q(e,"cost"),consume:e=>{let t=K.consume(e),n=As(t);return n!==null&&Q(n,"cost"),t}}),$e=K.snapshot().totals.lines,Ve=v.setup===null?void 0:Ms({dir:v.setup.readDir,roots:[l,v.setup.canonicalRoot],scheme:O,modelTier:()=>x.fast??{client:z,model:{provider:a.providerId,model:a.modelName}},contextEvents:()=>R(c.sink.currentSessionId()),emitUsage:Ke.emitUsage,...H===void 0?{}:{budget:H},persistence:{scope:P,restoring:X!==void 0||ge!==void 0},recall:{onRecall:e=>Ht?.(e),onAdmission:e=>_t?.(e)}}),A=Ve?.lifecycle,Zs=Ve?.budgets??null,en=new fo({registry:b.registry,cwd:l,permissionGate:jt,onDecision:Dt,...Ut!==void 0?{memoryWrite:Ut}:{},...A!==void 0?{onFilesTouched:e=>A.observeTouched(e)}:{}}),R=C.contextEvents.writerFor,Ye,Wt={onCompactionStarted:e=>{R(c.sink.currentSessionId()).observer.onCompactionStarted?.(e)},onCompactionFinished:e=>{let t=e.outcome;(t!==void 0?t.ok:e.foldedRemovedCount!==void 0)&&e.agentId===void 0&&(Ye={compactionId:e.compactionId,trigger:e.trigger,...t!==void 0&&t.ok?{beforeTokens:t.measurementBefore.contextTokens,afterTokens:t.measurementAfter.contextTokens}:{},...t!==void 0&&t.checkpointId!==void 0?{checkpointId:t.checkpointId}:{}}),R(c.sink.currentSessionId()).observer.onCompactionFinished?.(e)},onMicrocompactApplied:e=>{R(c.sink.currentSessionId()).observer.onMicrocompactApplied?.(e)},onToolResultsClamped:e=>{R(c.sink.currentSessionId()).observer.onToolResultsClamped?.(e)},onRequestMeasured:e=>{R(c.sink.currentSessionId()).observer.onRequestMeasured?.(e),Le?.onRequestMeasured(e)}},Qe={onRequestMeasured:e=>{R(c.sink.currentSessionId()).observer.onRequestMeasured?.(e),Le?.onRequestMeasured(e)}};if(St=Qe,Ft=e=>{R(c.sink.currentSessionId()).memoryWrite({...e,source:"main"})},Ht=e=>{R(c.sink.currentSessionId()).memoryRecall(e)},_t=e=>{R(c.sink.currentSessionId()).memoryRecallAdmission?.(e)},v.setup!==null){let e=oe.segments.find(t=>t.scope==="auto-memory");R(c.sink.currentSessionId()).memoryInjected({indexPath:v.setup.indexPath,present:e!==void 0,bytes:e!==void 0?Buffer.byteLength(e.content,"utf8"):0,lines:e!==void 0?e.content.split(`
|
|
68
|
+
`).length:0,truncated:oe.warnings.some(t=>t.startsWith("auto_memory_truncated"))})}ut=e=>{R(c.sink.currentSessionId()).observer.onProviderAttempt?.(e)};let tn=(e,t)=>{try{let n=et(J,e,e==="fast"?"fast":"main")[0];return et(J,n.providerId+"/"+n.modelName,"main"),{provider:n.providerId,model:n.modelName}}catch{return t}},qt=Lr({env:s,models:()=>i.governance.models,registry:J,crossProviderClient:{config:j,clientOptions:{attemptObserver:ue,...T}}}),on=e=>{try{let t=J.resolveAlias(`${e.provider}/${e.model}`);return q(t.capability,t.modelName)}catch{return}},{toolResultBudget:Gt}=C,rn=Sr({engine:N,registry:b.registry,nativeRead:b.registry.get("Read"),cwd:()=>l,hooks:()=>xt}),sn={...L.query,...L.manager?.timeoutMs!==void 0?{timeoutMs:L.manager.timeoutMs}:{},observer:Wt,endpointHealthProbe:Ie.probeFor(x.compactionBaseUrl)},he=(s.TANSR_APPROVAL_ENDPOINT??"").trim()||void 0,ve,ze;if(he!==void 0){if(!/^https?:\/\//i.test(he))return process.stderr.write(r(S.approvalEndpointInvalid,{value:he})+`
|
|
69
|
+
`),u.usage;let e=(s.TANSR_APPROVAL_LISTEN??"").trim()||void 0,t=(s.TANSR_APPROVAL_TOKEN??"").trim()||void 0;if(e===void 0||Fs(e)===null)return process.stderr.write(r(S.approvalListenInvalid,{value:e??""})+`
|
|
70
|
+
`),u.usage;if(t===void 0)return process.stderr.write(r(S.approvalListenTokenRequired)+`
|
|
71
|
+
`),u.usage;let n=new ho;ve=await Us({coordinator:n,listen:e,token:t}),process.stderr.write(r(S.approvalListenStarted,{url:ve.url})+`
|
|
72
|
+
`),ze=Mr({coordinator:n,engine:N,redecide:nt(N,b.registry,{cwd:l}),cwd:l,publish:Gs({endpoint:he,token:t,coordinator:n,credentialBaseUrl:ve.url,onError:m=>process.stderr.write(m+`
|
|
73
|
+
`)}),onOutcome:m=>process.stderr.write(r(S.approvalOutcome,{challengeId:m.challengeId,toolName:m.toolName,outcome:m.outcome})+`
|
|
74
|
+
`),session:{id:P,surface:"headless"}})}let Kt=await qo({cwd:l,env:s,extraDirs:te.agentDirs});$o(b,{client:z,memory:Ve?.subagentMemory,...H===void 0?{}:{budget:H},onReportedUsage:e=>Ke.emitUsage({type:"cost.usage.updated",...e}),system:D,parentModel:{provider:a.providerId,model:a.modelName},maxTokens:ce,sessionId:P,permissionGate:jt,cwd:l,resolveModel:tn,...qt!==void 0?{dispatchPolicy:qt}:{},onDecision:Dt,mcpDiscover:e=>{let t=_e?.discoverToolFactory;if(t===void 0)throw new Error("McpDiscover subagent factory unavailable before MCP assembly (ordering bug)");return t(e)},...(()=>{let e=Ho({engine:N,env:s,...ze!==void 0?{askUser:ze}:{},...U.remote!==void 0?{remote:fe.adjudicatorPolicies===void 0?U.remote:()=>U.remote}:{}});return e!==void 0?{adjudication:e}:{}})(),compaction:sn,resolveContextWindow:on,toolResultBudget:Gt,concurrency:()=>Ko(O)},Kt);for(let e of Go(Kt.diagnostics))process.stderr.write(e.message+`
|
|
75
|
+
`);let $t=await cr(o.loaded.mcpServers,s,{projectPath:l,storageRoot:xe});for(let e of $t.notices)process.stderr.write(e.message+`
|
|
76
|
+
`);let $=await Zo(b,[...$t.allowed,...te.mcpServers],{storageRoot:xe,onEvent:e=>{let t=gs(e);t!==null&&Q(t,"mcp")}}).catch(e=>Is(e,process.stderr));if(_e=$,$.segment!==null){D.push($.segment);let e=Xo(D);e!==D&&D.splice(0,D.length,...e)}for(let e of er($.manager.snapshot()))e.level==="error"&&process.stderr.write(e.message+`
|
|
77
|
+
`);if($.fold!==null){let e=tr($.fold);e!==null&&process.stderr.write(e.message+`
|
|
78
|
+
`)}let ke=Jo({scheme:O,windowTokens:q(a.capability,a.modelName),system:D,memorySegments:oe.segments,toolDefs:b.toolDefs,registry:b.registry,recallBudgets:Zs,writeGuidance:v.setup!==null});if(ke!==null){ke.toolState==="short"&&zo(b.toolDefs,b.registry),R(c.sink.currentSessionId()).assemblyBudget(ke.probe);for(let e of ke.warnings)process.stderr.write(r(e.key,e.params)+`
|
|
79
|
+
`)}let Se=hs({...p.effort!==void 0?{flagLevel:p.effort}:{},env:s,...o.loaded.effort!==void 0?{configLevel:o.loaded.effort}:{}});Se.invalidEnvValue!==void 0&&process.stderr.write(r(k.invalidEffortEnv,{value:Se.invalidEnvValue,expected:ys.join("|")})+`
|
|
80
|
+
`);let re=Se.selection!==void 0?vs(Se.selection,ce,{...a.capability.thinking.budgetMaxTokens!==void 0?{thinkingBudgetMaxTokens:a.capability.thinking.budgetMaxTokens}:{}}):void 0,Je,Xe=new no,nn=Ts({resources:()=>[$],before:async()=>{let e=[];try{await be([Cs(Je),Re({settleResources:t=>Xe.settle(t)}),(A?.settleResources({timeoutMs:1/0})??Promise.resolve([])).then(t=>be(t.map(n=>Re({settleResources:async()=>n})),"headless/recall"))],"headless/beforeMcp")}catch(t){e.push(t)}try{if(K.snapshot().totals.lines>$e){let t=qe.takePayload();t!==void 0&&c.sink.appendUsageSnapshot(t)}}catch(t){e.push(t)}await be([c.sink.close(),Promise.resolve(Le?.close())],"headless/accounting",e)},after:async()=>{await ve?.close()}});try{if(d.options.branchSummary===!0){let t=new AbortController,n=xs(process.stderr),m=Ps({hardExitAfterMs:1e4,drain:()=>{t.abort()},exitCode:u.aborted,onSecondSignal:n.onSecondSignal,onHardExit:n.onHardExit});try{let B=_.length,de=await dn({checkpointId:d.options.restore,history:_,checkpoints:We,sink:c.sink,generation:{client:z,model:{provider:a.providerId,model:a.modelName},system:D,tools:b.toolDefs,contextWindowTokens:q(a.capability,a.modelName),maxTokens:Math.min(ce,a.capability.maxOutput??1/0),responseReserveTokens:re?.maxTokens??ce,resources:Xe,signal:t.signal,requestMeasurement:Qe,...H===void 0?{}:{budget:H},...L.manager?.timeoutMs===void 0?{}:{timeoutMs:L.manager.timeoutMs},onUsage:(V,Vt)=>{K.record({usage:V,purpose:"other",sessionId:P,model:Vt?.model??a.modelName,provider:Vt?.provider??a.providerId});let Yt=qe.takePayload();Yt!==void 0&&c.sink.appendUsageSnapshot(Yt),$e=K.snapshot().totals.lines}},install:V=>{_=V,rt(C.spill),ye.replace([])},onRetentionError:V=>process.stderr.write(r(S.branchSummaryRetentionFailed,{message:V instanceof Error?V.message:String(V)})+`
|
|
81
|
+
`)});if(!de.ok)return process.stderr.write(r(S.branchSummaryFailed,{reason:de.reason})+`
|
|
82
|
+
`),de.exitCode;process.stderr.write(r(S.branchSummaryInstalled,{checkpointId:d.options.restore,fromMessages:B,targetMessages:de.targetMessages,toMessages:de.toMessages})+`
|
|
83
|
+
`)}finally{try{await Re({settleResources:B=>Xe.settle(B)})}finally{m.dispose()}}if(t.signal.aborted)return u.aborted}let e=await g.finish(()=>({initialHistory:_,tools:b.toolDefs}));return await Ds(d.options,{runQueryImpl:t=>(Je=go(t),Je),client:z,executor:en,tools:e.tools,system:D,stdout:process.stdout,stderr:process.stderr,stdin:js(process.stdin),model:{provider:a.providerId,model:a.modelName},contextWindowTokens:q(a.capability,a.modelName),...a.capability.maxOutput!==void 0?{maxOutputTokens:a.capability.maxOutput}:{},maxTokens:re?.maxTokens??ce,...re?.thinking!==void 0?{thinking:re.thinking}:{},...re!==void 0?{effortDiagnostic:re}:{},sessionId:P,sessionEvents:W,drainSideEvents:()=>ct.splice(0),initialHistory:e.initialHistory,...c.resumedFromSeq!==void 0?{resumedFromSeq:c.resumedFromSeq}:{},...ge!==void 0?{restoredFrom:ge}:{},onFinalMessages:(t,n)=>{let m=n.rewritten?Ye:void 0;Ye=void 0,c.sink.commitHistory(t,{...n,...m!==void 0?{compaction:m}:{}});let B=qe.takePayload();B!==void 0&&c.sink.appendUsageSnapshot(B),$e=K.snapshot().totals.lines},compaction:{...L.query,observer:Wt,restoreFileReader:rn,endpointHealthProbe:Ie.probeFor(x.compactionBaseUrl),beforeCompact:C.beforeCompact},...L.manager!==void 0?{compactionManagerOptions:L.manager}:{},transcriptHint:()=>io(E,c.sink.currentSessionId()),requestMeasurement:Qe,reminders:lo({todoStore:ye,memoryPaths:Fr(oe),...A!==void 0?{reconcileMemoryContext:t=>A.reconcileContext(t),prepareMemoryRecalls:t=>A.prepareReminders(t),drainMemoryRecalls:()=>A.drainRecalls(),drainMemorySelections:()=>A.drainSelections()}:{}}),onInputsConsumed:t=>{je.noteInput(t),A?.supplement(t)},queryHooks:t=>(A?.beginTurn(t),je.noteTurn(t),Ge.queryHooks(t)),trackEvent:t=>{Ke.trackEvent(t),t.source!=="hook"&&ne?.consume(t)},...H!==void 0?{budget:H}:{},toolResultBudget:Gt})}finally{A?.finishTurn(),A?.dispose();try{await Ge.sessionEnd("result"),ne?.close("result"),C.decisions.writeMetrics()}finally{await nn.observe({stderr:process.stderr})}}}export{dn as installHeadlessBranchSummary,Hn as runHeadlessEntry};
|
|
84
|
+
//# sourceMappingURL=tansr-run-headless-entry-4XTAVPTW.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{f as a,g as b,h as c}from"./tansr-chunk-6QKU3GNA.mjs";import"./tansr-chunk-YEYFEVYF.mjs";import"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-B2O4DB4K.mjs";import"./tansr-chunk-F5STVU7J.mjs";import"./tansr-chunk-NROI7AG5.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-2QKLANZQ.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";export{a as TANSR_PAT_ENV,b as parseInitArgs,c as runInitEntry};
|
|
5
|
+
//# sourceMappingURL=tansr-run-init-entry-GH2KDGI6.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{c as a,d as b}from"./tansr-chunk-RUYIVG72.mjs";import"./tansr-chunk-WW5ZPL6Q.mjs";import"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-NROI7AG5.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-2QKLANZQ.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-S3KHAGOR.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";export{a as parseLogoutArgs,b as runLogoutEntry};
|
|
5
|
+
//# sourceMappingURL=tansr-run-logout-entry-PLGYDEOB.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import"./tansr-chunk-WPKFARCU.mjs";import"./tansr-chunk-SCFXBKV6.mjs";import{F as j,G as V,I as B,J as K,c as N,f as W,fc as oe,ja as Q,qa as Z,r as F,s as O,u as Y,xa as $}from"./tansr-chunk-Q3XDAUKT.mjs";import{e as M,f as _}from"./tansr-chunk-PIET7WB3.mjs";import"./tansr-chunk-C2NTVBEY.mjs";import{a as U,c as X,d as q,f as z,j as J}from"./tansr-chunk-4IWNKAT5.mjs";import"./tansr-chunk-YEYFEVYF.mjs";import{z as ee}from"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-F5STVU7J.mjs";import"./tansr-chunk-ECYZ457U.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import{l as re,n as te,o as se}from"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-2QKLANZQ.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import{a as d}from"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{a as p}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import{p as A}from"./tansr-chunk-WAYVH5ON.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-RFH7OCN6.mjs";import"./tansr-chunk-SHLU4JN2.mjs";import{Se as I,Wd as H,be as C,ce as D,ua as G}from"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{k as h,m as l,o as L}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import{v as x}from"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import{randomUUID as pe}from"node:crypto";var fe=1e4;async function Re(e={}){let ne=e.input??process.stdin,ie=e.output??process.stdout,r=e.stderr??process.stderr,t=e.env??process.env,n=e.cwd??process.cwd(),ce=e.version??"0.11.0",o=await ee({cwd:n,env:t});h(L({configLocale:o.loaded.locale,env:t}));let f=await z({env:t,policy:o.loaded.policy}),i=X(o.loaded.permissions.defaultMode,f.anchor);i.lockedMode!==void 0&&r.write(q(i.lockedMode).message+`
|
|
5
|
+
`);let m=$({mode:i.mode,env:t,geteuid:e.geteuid});if(m.kind==="refused")return r.write(l(p.bypassRootRefused)+`
|
|
6
|
+
`),d.usage;m.kind==="overridden"&&r.write(l(p.bypassRootOverridden)+`
|
|
7
|
+
`);let g=oe({env:t,...o.loaded.audit!==void 0?{auditConfig:o.loaded.audit}:{}}),c=new G({...i.mode!==void 0?{mode:i.mode}:{},layers:o.loaded.permissions.layers,baseline:{enabled:o.loaded.permissions.disableBaselineProtection!==!0},...g!==void 0?{hardSafety:g}:{}}),y=await J(c,{env:t,trust:f,...o.loaded.permissions.recommendedRules!==void 0?{recommendedRules:o.loaded.permissions.recommendedRules}:{}});for(let s of y.notices)r.write(s.message+`
|
|
8
|
+
`);if(y.refuseLaunch)return r.write(l(U.refuseLaunch)+`
|
|
9
|
+
`),d.usage;let a=pe(),S=B(n,await V(j(t))),E=M(S,{env:t,flag:e.trustProjectHooks===!0}),v=K(S,E);v!==null&&r.write(v+`
|
|
10
|
+
`);let k=_(()=>E.enabled),w=new I({hooks:o.loaded.hooks,sessionId:a,cwd:n,permissionMode:c.getMode(),emit:()=>{},http:{client:N(),...D(o.loaded.http),...k.http},layerEnabled:k.layerEnabled}),P=Z({env:t,cwd:n,...o.loaded.sandbox!==void 0?{section:o.loaded.sandbox}:{}}),u=W({...P!==void 0?{sandbox:P}:{},...C(o.loaded.http),imageInput:()=>"supported"}),de=Q(c,u.registry,{cwd:n,hooks:w,onNotice:s=>r.write(s+`
|
|
11
|
+
`)}),R=x(A(t),a),ae=F({sessionId:a,sessionDir:R,engine:c}),T=H({registry:u.registry,toolDefs:u.toolDefs},{serverInfo:{name:"tansr",version:ce},permissionGate:de,cwd:n,onDecision:Y(w,ae.record)}).serve({input:ne,output:ie}),b=se(r),le=te({hardExitAfterMs:fe,...e.processLifecycle,...e.onSigint!==void 0?{signalSource:e.onSigint}:{},drain:()=>T.close(),exitCode:d.aborted,...e.processExit!==void 0?{exit:e.processExit}:{},onSecondSignal:b.onSecondSignal,onHardExit:b.onHardExit}),ue=re({logger:{info:s=>r.write(s+`
|
|
12
|
+
`),error:s=>r.write(s+`
|
|
13
|
+
`)},onFatal:"log",...e.processGuardTarget!==void 0?{target:e.processGuardTarget}:{}});try{await T.done}finally{try{ue(),O({sessionId:a,sessionDir:R,engine:c})}finally{le.dispose()}}return d.ok}export{Re as runMcpServeEntry};
|
|
14
|
+
//# sourceMappingURL=tansr-run-mcp-serve-entry-UHK4WSKL.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import{a as u}from"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{b as p}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{m as c}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import{readFile as y}from"node:fs/promises";import S from"node:path";import{fileURLToPath as T}from"node:url";var o={invalidPort:"cli.orchestrate.error.invalid_port",configReadFailed:"cli.orchestrate.error.config_read_failed",configInvalid:"cli.orchestrate.error.config_invalid",bundleMissing:"cli.orchestrate.error.bundle_missing",startFailed:"cli.orchestrate.error.start_failed",started:"cli.orchestrate.started"},O=Object.values(o);var _=new Set(["--port","--host","--config"]);function k(f){let e={};for(let a=0;a<f.length;a++){let r=f[a],l=r,d,s=r.indexOf("=");if(r.startsWith("--")&&s!==-1&&(l=r.slice(0,s),d=r.slice(s+1)),_.has(l)){let n;if(d!==void 0)n=d;else{let t=f[a+1];if(t===void 0||t.startsWith("-")&&t!=="-")return{ok:!1,error:{key:p.missingValue,params:{flag:l}}};n=t,a++}switch(l){case"--port":{let t=/^\d+$/.test(n)?Number.parseInt(n,10):NaN;if(!Number.isInteger(t)||t<0||t>65535)return{ok:!1,error:{key:o.invalidPort,params:{value:n}}};e.port=t;break}case"--host":e.host=n;break;default:e.configPath=n}continue}return r.startsWith("-")?{ok:!1,error:{key:p.unknownFlag,params:{flag:l}}}:{ok:!1,error:{key:p.unexpectedArg,params:{arg:r}}}}return{ok:!0,args:e}}async function A(){{let e=new URL("./tansrd.mjs",import.meta.url);try{return await import(e.href)}catch(a){throw new Error(c(o.bundleMissing,{path:T(e)}),{cause:a})}}return await import("@tansr/tansrd/main")}async function G(f,e={}){let a=e.stdout??process.stdout,r=e.stderr??process.stderr,l=e.cwd??process.cwd(),d=k(f);if(!d.ok)return r.write(c(d.error.key,d.error.params)+`
|
|
5
|
+
`),u.usage;let s=d.args,n={};if(s.configPath!==void 0){let i=S.resolve(l,s.configPath),E;try{E=await y(i,"utf8")}catch(h){return r.write(c(o.configReadFailed,{path:i,message:h instanceof Error?h.message:String(h)})+`
|
|
6
|
+
`),u.usage}let g;try{g=JSON.parse(E)}catch{return r.write(c(o.configInvalid,{path:i})+`
|
|
7
|
+
`),u.usage}if(typeof g!="object"||g===null||Array.isArray(g))return r.write(c(o.configInvalid,{path:i})+`
|
|
8
|
+
`),u.usage;n=g}let t={...n,...s.port!==void 0?{port:s.port}:{},...s.host!==void 0?{host:s.host}:{}},w=e.loadTansrd??A,m;try{m=await(await w()).runTansrd({configOverrides:t})}catch(i){return r.write(c(o.startFailed,{message:i instanceof Error?i.message:String(i)})+`
|
|
9
|
+
`),u.usage}return a.write(c(o.started,{url:m.address.url})+`
|
|
10
|
+
`),await m.whenStopped(),u.ok}export{G as runOrchestrateEntry};
|
|
11
|
+
//# sourceMappingURL=tansr-run-orchestrate-entry-M7R3433X.mjs.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{b as T}from"./tansr-chunk-WW5ZPL6Q.mjs";import{z as O}from"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import{a as S}from"./tansr-chunk-F5STVU7J.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import{a as m}from"./tansr-chunk-AMMPDY4V.mjs";import{b as k,c as x,d as v}from"./tansr-chunk-N644DEOO.mjs";import{g as I}from"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{b as D}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{k as E,m as a,o as _}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import P from"node:os";var l={usage:"cli.org.usage",activateMissingCode:"cli.org.activate.missing_code",activateOpenUrl:"cli.org.activate.open_url",activateUserCode:"cli.org.activate.user_code",activateWaiting:"cli.org.activate.waiting",activateDenied:"cli.org.activate.denied",activateExpired:"cli.org.activate.expired",activateSuccess:"cli.org.activate.success",activateInvalidCode:"cli.org.activate.invalid_code"},M=Object.values(l);function g(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function C(t){let e=`http_${t.status}`,n=t.statusText;try{let i=await t.json();typeof i.error?.code=="string"&&(e=i.error.code),typeof i.error?.message=="string"&&(n=i.error.message)}catch{}return new v(t.status,e,n)}async function h(t,e,n,i){return(t.fetchImpl??fetch)(`${t.baseUrl}${e}`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json",...i!==void 0?{authorization:`Bearer ${i}`}:{}},body:JSON.stringify(n)})}async function b(t,e){let n=await h(t,"/v1/auth/device/code",{clientName:e});if(!n.ok)throw await C(n);let i=null;try{i=await n.json()}catch{}let r=g(i)?i:{},f=typeof r.deviceCode=="string"?r.deviceCode:"",s=typeof r.userCode=="string"?r.userCode:"",p=typeof r.verificationUri=="string"?r.verificationUri:"";if(f===""||s===""||p==="")throw new v(n.status,"malformed_response","device code grant missing fields");let c=r.expiresIn,d=r.interval;return{deviceCode:f,userCode:s,verificationUri:p,verificationUriComplete:typeof r.verificationUriComplete=="string"&&r.verificationUriComplete!==""?r.verificationUriComplete:p,expiresInSec:typeof c=="number"&&Number.isFinite(c)&&c>0?Math.floor(c):600,pollIntervalSec:typeof d=="number"&&Number.isFinite(d)&&d>0?Math.floor(d):5}}async function A(t,e){let n=t.now??Date.now,i=t.sleep??(s=>new Promise(p=>setTimeout(p,s))),r=n()+e.expiresInSec*1e3,f=Math.max(1,e.pollIntervalSec)*1e3;for(;;){if(n()>=r)throw new v(400,"device_code_expired","device code expired");await i(f);let s;try{s=await h(t,"/v1/auth/device/token",{deviceCode:e.deviceCode})}catch{continue}if(s.ok){let c=null;try{c=await s.json()}catch{throw new v(s.status,"malformed_response","token response not json")}let d=g(c)?c:{},u=typeof d.accessToken=="string"?d.accessToken:"";if(u==="")throw new v(s.status,"malformed_response","token response missing fields");let o=g(d.user)?d.user:{};return{accessToken:u,refreshToken:typeof d.refreshToken=="string"?d.refreshToken:"",user:{id:typeof o.id=="string"?o.id:"",name:typeof o.name=="string"?o.name:""}}}let p=await C(s);if(!(p.code==="device_code_pending"||p.status===429))throw p}}async function U(t,e,n){let i=await h(t,"/v1/org-licenses/activate",{code:n},e);if(!i.ok)throw await C(i);let r=null;try{r=await i.json()}catch{}let f=g(r)?r:{},s=g(f.license)?f.license:{};return{status:typeof s.status=="string"?s.status:"active",appId:typeof s.appId=="string"?s.appId:""}}async function L(t,e){try{await h(t,"/v1/auth/logout",e.refreshToken!==""?{refreshToken:e.refreshToken}:{},e.accessToken)}catch{}}async function z(t,e={}){let n=e.stdout??process.stdout,i=e.stderr??process.stderr,r=e.env??process.env,f=e.cwd??process.cwd(),s=e.homedir??P.homedir(),p=await O({cwd:f,env:r,...e.loadOptions!==void 0?{loadOptions:e.loadOptions}:{}});if(E(_({configLocale:p.loaded.locale,env:r})),t[0]!=="activate")return i.write(a(l.usage)+`
|
|
5
|
+
`),m.usage;let c=t[1];if(c===void 0||c===""||c.startsWith("-"))return i.write(a(l.activateMissingCode)+`
|
|
6
|
+
`),m.usage;if(t.length>2)return i.write(a(D.unexpectedArg,{arg:t[2]??""})+`
|
|
7
|
+
`),m.usage;let u={baseUrl:(await T(I(r,s)))?.apiBaseUrl??x(r),...e.fetchImpl!==void 0?{fetchImpl:e.fetchImpl}:{},...e.sleep!==void 0?{sleep:e.sleep}:{},...e.now!==void 0?{now:e.now}:{}};try{let o=await b(u,k);n.write(a(l.activateOpenUrl,{url:o.verificationUriComplete})+`
|
|
8
|
+
`),n.write(a(l.activateUserCode,{code:o.userCode})+`
|
|
9
|
+
`),n.write(a(l.activateWaiting,{seconds:String(o.expiresInSec)})+`
|
|
10
|
+
`);let w=await A(u,o);try{let y=await U(u,w.accessToken,c);return n.write(a(l.activateSuccess,{status:y.status,appId:y.appId!==""?y.appId:"-"})+`
|
|
11
|
+
`),m.ok}finally{await L(u,w)}}catch(o){if(o instanceof v)return o.code==="device_code_denied"?i.write(a(l.activateDenied)+`
|
|
12
|
+
`):o.code==="device_code_expired"?i.write(a(l.activateExpired)+`
|
|
13
|
+
`):o.code==="validation_failed"?i.write(a(l.activateInvalidCode)+`
|
|
14
|
+
`):i.write(a(S.apiError,{status:String(o.status),code:o.code,message:o.message})+`
|
|
15
|
+
`),m.modelError;let w=o instanceof Error?o.message:String(o);return i.write(a(S.requestFailed,{server:u.baseUrl,message:w})+`
|
|
16
|
+
`),m.modelError}}export{z as runOrgEntry};
|
|
17
|
+
//# sourceMappingURL=tansr-run-org-entry-UONLGJIJ.mjs.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{f as R,h as S}from"./tansr-chunk-4IWNKAT5.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import{a as v}from"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{b as h}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import{Aa as _,ta as A}from"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{m as g}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import{wa as b}from"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import{mkdir as L,rename as C,writeFile as O}from"node:fs/promises";import T from"node:path";var E=class extends Error{status;code;constructor(t,s,n){super(n),this.name="PolicyApiError",this.status=t,this.code=s}};async function x(r,t={}){let s=r.fetchImpl??fetch,n=r.server.endsWith("/")?r.server.slice(0,-1):r.server,l=new URL(`${n}/v1/policy/dist`);t.workspace!==void 0&&l.searchParams.set("workspace",t.workspace);for(let[i,u]of Object.entries(t.labels??{}))l.searchParams.set(`label.${i}`,u);let o=await s(l,{headers:r.token!==void 0?{authorization:`Bearer ${r.token}`}:{}});if(!o.ok){let i=`http_${o.status}`,u=o.statusText;try{let a=await o.json();typeof a.error?.code=="string"&&(i=a.error.code),typeof a.error?.message=="string"&&(u=a.error.message)}catch{}throw new E(o.status,i,u)}return await o.json()}var d={unknownAction:"cli.policy.pull.unknown_action",invalidLabel:"cli.policy.pull.invalid_label",apiError:"cli.policy.pull.api_error",requestFailed:"cli.policy.pull.request_failed",empty:"cli.policy.pull.empty",rejected:"cli.policy.pull.rejected",summary:"cli.policy.pull.summary"};var j=new Set(["--server","--token","--workspace","--label","--dir"]);function D(r){let t=[],s=new Map,n={},l=0;for(let k=0;k<r.length;k++){let f=r[k],e=f,P,p=f.indexOf("=");if(f.startsWith("--")&&p!==-1&&(e=f.slice(0,p),P=f.slice(p+1)),j.has(e)){let c;if(P!==void 0)c=P;else{let m=r[k+1];if(m===void 0||m.startsWith("-")&&m!=="-")return{ok:!1,error:{key:h.missingValue,params:{flag:e}}};c=m,k++}if(e==="--label"){let m=c.indexOf("=");if(m<=0)return{ok:!1,error:{key:d.invalidLabel,params:{value:c}}};n[c.slice(0,m)]=c.slice(m+1),l++;continue}s.set(e,c);continue}if(f.startsWith("-"))return{ok:!1,error:{key:h.unknownFlag,params:{flag:e}}};t.push(f)}let[o,...i]=t;if(o!=="pull")return{ok:!1,error:{key:d.unknownAction,params:{action:o??""}}};if(i.length>0)return{ok:!1,error:{key:h.unexpectedArg,params:{arg:i[0]}}};let u=s.get("--server"),a=s.get("--token"),y=s.get("--workspace"),w=s.get("--dir");return{ok:!0,args:{action:"pull",...u!==void 0?{server:u}:{},...a!==void 0?{token:a}:{},...y!==void 0?{workspace:y}:{},...l>0?{labels:n}:{},...w!==void 0?{dir:w}:{}}}}var I="http://127.0.0.1:7420";async function B(r,t){await L(r,{recursive:!0});let s=T.join(r,`${t.meta.id}.json`),n=`${s}.tmp-${process.pid}-${Date.now()}`;return await O(n,`${JSON.stringify(t,null,2)}
|
|
5
|
+
`,"utf8"),await C(n,s),s}function $(r){return r.status==="verified"||r.status==="unverified"}async function Z(r,t={}){let s=t.stdout??process.stdout,n=t.stderr??process.stderr,l=t.env??process.env,o=D(r);if(!o.ok)return n.write(g(o.error.key,o.error.params)+`
|
|
6
|
+
`),v.usage;let i=o.args,u=await R({env:l});for(let e of u.notices)(e.level==="error"?n:s).write(e.message+`
|
|
7
|
+
`);let a;try{a=await x({server:i.server??l.TANSRD_SERVER??I,...(i.token??l.TANSRD_TOKEN)!==void 0?{token:i.token??l.TANSRD_TOKEN}:{},...t.fetchImpl!==void 0?{fetchImpl:t.fetchImpl}:{}},{...i.workspace!==void 0?{workspace:i.workspace}:{},...i.labels!==void 0?{labels:i.labels}:{}})}catch(e){return e instanceof E?(n.write(g(d.apiError,{status:e.status,code:e.code,message:e.message})+`
|
|
8
|
+
`),v.modelError):(n.write(g(d.requestFailed,{server:i.server??l.TANSRD_SERVER??I,message:e instanceof Error?e.message:String(e)})+`
|
|
9
|
+
`),v.modelError)}let y=a.rejected?.length??0;for(let e of a.rejected??[])n.write(g(d.rejected,{id:e.bundleId,version:e.version,reason:e.reason})+`
|
|
10
|
+
`);if(a.bundles.length===0&&y===0)return s.write(g(d.empty)+`
|
|
11
|
+
`),v.ok;let w=S(l,t.homedir),k=i.dir??w[w.length-1],f=0;for(let e of a.bundles){let P=_(e.bundle);if(!P.ok||!b.test(P.bundle.meta.id)){y++,n.write(g(d.rejected,{id:e.bundleId,version:e.version,reason:"bundle_invalid"})+`
|
|
12
|
+
`);continue}let p=P.bundle,c=A(p,u.verify??{});if(!$(c)){y++,n.write(g(d.rejected,{id:p.meta.id,version:p.meta.version,reason:c.reason??c.status})+`
|
|
13
|
+
`);continue}let m=await B(k,p);f++,s.write([p.meta.id,p.meta.version,c.status,m].join(" ")+`
|
|
14
|
+
`)}return s.write(g(d.summary,{installed:f,rejected:y,dir:k})+`
|
|
15
|
+
`),y>0?v.modelError:v.ok}export{I as DEFAULT_POLICY_SERVER,Z as runPolicyEntry};
|
|
16
|
+
//# sourceMappingURL=tansr-run-policy-entry-NNQCV5WS.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{a as k,b as P,c as _,d as L,e as S}from"./tansr-chunk-WW5ZPL6Q.mjs";import{z as I}from"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-JTGWG4BG.mjs";import"./tansr-chunk-SXNTYWJY.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import{a as i}from"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-N644DEOO.mjs";import{f as g}from"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{b as c}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-SX3XZNN6.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{k as E,m as o,o as w}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import O from"node:os";var n={usage:"cli.profile.usage",listEmpty:"cli.profile.list.empty",listLine:"cli.profile.list.line",useDone:"cli.profile.use.done",useNotFound:"cli.profile.use.not_found",useCorrupt:"cli.profile.use.corrupt",useMissingKeyId:"cli.profile.use.missing_key_id"},A=Object.values(n);function v(s,e,l){s.write(o(n.listLine,{marker:l?"*":" ",name:e.app.name!==""?e.app.name:e.keyId,keyId:e.keyId,ownerType:e.app.ownerType!==""?e.app.ownerType:"-",server:e.apiBaseUrl})+`
|
|
5
|
+
`)}async function R(s,e={}){let l=e.stdout??process.stdout,a=e.stderr??process.stderr,u=e.env??process.env,h=e.cwd??process.cwd(),f=e.homedir??O.homedir(),C=await I({cwd:h,env:u,...e.loadOptions!==void 0?{loadOptions:e.loadOptions}:{}});E(w({configLocale:C.loaded.locale,env:u}));let p=g(u,f),m=k(u,f),y=s[0];if(y==="list"){if(s.length>1)return a.write(o(c.unexpectedArg,{arg:s[1]??""})+`
|
|
6
|
+
`),i.usage;let t=await P(p),r=await _(m);if(t!==null&&!r.some(d=>d.keyId===t.keyId)&&r.push(t),r.length===0)return l.write(o(n.listEmpty)+`
|
|
7
|
+
`),i.ok;for(let d of r)v(l,d,d.keyId===t?.keyId);return i.ok}if(y==="use"){let t=s[1];if(t===void 0||t===""||t.startsWith("-"))return a.write(o(n.useMissingKeyId)+`
|
|
8
|
+
`),i.usage;if(s.length>2)return a.write(o(c.unexpectedArg,{arg:s[2]??""})+`
|
|
9
|
+
`),i.usage;await L(p,m);let r=await S(m,t,p);return r.status==="not_found"?(a.write(o(n.useNotFound,{keyId:t})+`
|
|
10
|
+
`),i.modelError):r.status==="corrupt"?(a.write(o(n.useCorrupt,{keyId:t})+`
|
|
11
|
+
`),i.modelError):(l.write(o(n.useDone,{name:r.summary.app.name!==""?r.summary.app.name:r.summary.keyId,keyId:r.summary.keyId})+`
|
|
12
|
+
`),i.ok)}return a.write(o(n.usage)+`
|
|
13
|
+
`),i.usage}export{R as runProfileEntry};
|
|
14
|
+
//# sourceMappingURL=tansr-run-profile-entry-PV6OO7FV.mjs.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{c as D,d as B,h as j,i as K,j as Y,k as q,l as z,m as Q,n as $}from"./tansr-chunk-V4HGMAJS.mjs";import{b as H}from"./tansr-chunk-2PB54HDR.mjs";import{a as N}from"./tansr-chunk-33QZBUL6.mjs";import"./tansr-chunk-C2NTVBEY.mjs";import{e as L,l as W,n as G,o as V}from"./tansr-chunk-SXNTYWJY.mjs";import{a as _}from"./tansr-chunk-AMMPDY4V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import{a as k,b}from"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import{Ma as M}from"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import{ka as R}from"./tansr-chunk-EFN24XG3.mjs";import{h as E}from"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import{k as I,m as p,o as U}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import de from"node:os";var h={invalidPort:"cli.serve.error.invalid_port",missingToken:"cli.serve.error.missing_token",startFailed:"cli.serve.error.start_failed",trustedHostRequired:"cli.serve.error.trusted_host_required",retiredLocalOption:"cli.serve.error.retired_local_option",stopping:"cli.serve.stopping",unknownProfile:"cli.serve.error.unknown_profile",approvalEndpointInvalid:"cli.serve.error.approval_endpoint_invalid",approvalPublishFailed:k.approvalPublishFailed,approvalOutcome:"cli.serve.approval_outcome",sessionPermissionMode:"cli.serve.session_permission_mode",profileModeClamped:"cli.serve.profile_mode_clamped",v2UnknownCapabilitiesProfile:"cli.serve.v2.error.unknown_capabilities_profile",v2ClientToolConflict:"cli.serve.v2.error.client_tool_conflict",v2MintFailed:"cli.serve.v2.error.mint_failed",runtimeOptionInvalid:"cli.serve.runtime_option_invalid",runtimeOptionV2Only:"cli.serve.runtime_option_v2_only",v2Mounted:"cli.serve.v2.mounted",v2StoreError:"cli.serve.v2.store_error",v1Disabled:"cli.serve.v1.disabled",v1LegacyKept:"cli.serve.v1.legacy_kept",v2NotifyEnabledSigned:"cli.serve.v2.notify_enabled_signed",v2NotifyEnabledUnsigned:"cli.serve.v2.notify_enabled_unsigned"},_e=Object.values(h);var re=7433,te="127.0.0.1",oe=new Set(["--port","--host","--token","--model","--lang","--cwd","--host-module","--host-module-sha256"]),ne=new Set(["--sessions-dir","--checkpoints-dir","--legacy-v1","--trust-project-hooks","--context-scheme"]);function J(e){let r={port:re,host:te};for(let d=0;d<e.length;d++){let n=e[d],s=n,t,l=n.indexOf("=");if(n.startsWith("--")&&l!==-1&&(s=n.slice(0,l),t=n.slice(l+1)),ne.has(s))return{ok:!1,error:{key:h.retiredLocalOption,params:{name:s}}};if(oe.has(s)){let i;if(t!==void 0)i=t;else{let o=e[d+1];if(o===void 0||o.startsWith("-")&&o!=="-")return{ok:!1,error:{key:b.missingValue,params:{flag:s}}};i=o,d++}switch(s){case"--port":{let o=/^\d+$/.test(i)?Number.parseInt(i,10):NaN;if(!Number.isInteger(o)||o<0||o>65535)return{ok:!1,error:{key:h.invalidPort,params:{value:i}}};r.port=o;break}case"--host":r.host=i;break;case"--token":r.token=i;break;case"--model":r.model=i;break;case"--cwd":r.cwd=i;break;case"--host-module":r.hostModule=i;break;case"--host-module-sha256":r.hostModuleSha256=i;break;default:r.lang=i}continue}if(s==="--v2"&&t===void 0){r.v2=!0;continue}return n.startsWith("-")?{ok:!1,error:{key:b.unknownFlag,params:{flag:s}}}:{ok:!1,error:{key:b.unexpectedArg,params:{arg:n}}}}return r.hostModule===void 0!=(r.hostModuleSha256===void 0)?{ok:!1,error:{key:b.missingValue,params:{flag:r.hostModule===void 0?"--host-module":"--host-module-sha256"}}}:{ok:!0,args:r}}import{createHash as se,timingSafeEqual as A}from"node:crypto";import{open as ae}from"node:fs/promises";import{createRequire as ie}from"node:module";import C from"node:path";import{compileFunction as le}from"node:vm";function X(e){let r=e.capacity?.snapshot().poolLimit??e.model.bulkhead?.maxConcurrent??256;if(!Number.isSafeInteger(r)||r<1)throw new RangeError(p(k.serveModelConcurrencyInvalid,{flag:"model.bulkhead.maxConcurrent",value:String(r)}));if((e.model.bulkhead?.maxQueue??0)!==0)throw new RangeError(p(k.serveModelQueueInvalid,{flag:"model.bulkhead.maxQueue",value:String(e.model.bulkhead?.maxQueue),expected:"0"}));let d={...e.model.bulkhead,maxConcurrent:r,maxQueue:0},n=M({connections:r,fetchImpl:e.fetchImpl,...e.capacity?{keepAliveMaxTimeout:6e4}:{}}),s=M({connections:e.control.bulkhead?.maxConcurrent??16,fetchImpl:e.fetchImpl}),t=R({...e.model,bulkhead:d,globalBulkhead:d,localCapacityFailFast:!0,fetch:n.fetch,...e.model.tokenBucket?{tokenBucket:{...e.model.tokenBucket,maxQueue:0}}:{},...e.capacity?{concurrencyLimit:()=>e.capacity.snapshot().modelLimit}:{}}),l=R({...e.control,globalBulkhead:e.control.bulkhead,fetch:s.fetch}),i=e.apiBaseUrl.replace(/\/$/,""),o=new Set([E.handshake,E.config,E.heartbeat,E.usage].map(a=>new URL(`${i}${a}`).href)),u=a=>{try{let v=new URL(typeof a=="string"?a:a instanceof URL?a.href:a.url);return v.search="",v.hash="",o.has(v.href)}catch{return!1}},f=(a,v)=>u(a)?l.fetch(a,v):t.fetch(a,v),S={...t,fetch:f,get closed(){return t.closed},wrapFetch:a=>a},m=e.capacity?.registerDemandSource(()=>{let a=t.stats();return{modelInflight:a.totals.inflight,modelRejected:a.totals.rejected.saturated,poolQueued:n.stats().origins.reduce((v,g)=>v+g.queued,0)}}),c;return{fetch:f,governor:S,controlGovernor:l,capacity:e.capacity,poolStats:()=>({model:n.stats(),control:s.stats()}),close(){return c!==void 0||(m?.(),e.capacity?.close(),t.close(),l.close(),c=(async()=>{let v=(await Promise.allSettled([n.close(),s.close()])).flatMap(g=>g.status==="rejected"?[g.reason]:[]);if(v.length>0)throw N(v,"Serve/transport")})()),c}}}async function ce(e,r){if(!(C.isAbsolute(e)&&!e.startsWith("\\\\")&&!e.startsWith("//")&&(process.platform!=="win32"||/^[a-z]:[\\/]/i.test(e)))||C.extname(e).toLowerCase()!==".cjs"||!/^[a-f0-9]{64}$/i.test(r))throw new TypeError("serve_host_module_invalid_reference");let n=await ae(e,"r"),s;try{let i=await n.stat();if(!i.isFile()||i.size>16*1024*1024)throw new TypeError("serve_host_module_invalid_file");let o=Buffer.alloc(i.size+1),u=0;for(;u<o.length;){let f=await n.read(o,u,o.length-u,u);if(f.bytesRead===0)break;u+=f.bytesRead}if(u!==i.size)throw new TypeError("serve_host_module_changed");s=o.subarray(0,u)}finally{await n.close()}if(!A(se("sha256").update(s).digest(),Buffer.from(r,"hex")))throw new TypeError("serve_host_module_digest_mismatch");let t={exports:{}};if(le(s.toString("utf8"),["exports","require","module","__filename","__dirname"],{filename:e})(t.exports,ie(e),t,e,C.dirname(e)),typeof t.exports!="function")throw new TypeError("serve_host_module_invalid_export");return t.exports}async function Z(e){let{args:r,env:d,logger:n}=e,s=r.token?.trim()||d.TANSR_SERVE_TOKEN?.trim();if(!s||!(r.v2||d.TANSR_SERVE_V2?.trim()==="1")||!r.hostModule||!r.hostModuleSha256)throw new TypeError("serve_host_module_missing_configuration");let t=new Set,l=m=>{if(!m||typeof m.close!="function")throw new TypeError("serve_host_module_invalid_resource");return t.add(m),m},i,o,u,f,S=()=>f??=(async()=>{let m=[];if(u){try{await u.drain({timeoutMs:e.drainTimeoutMs})}catch(c){m.push(c)}try{await u.settleResources?.()}catch(c){m.push(c)}}if(i)try{await i.flush()}catch(c){m.push(c)}if(o)try{await o.dispose()}catch(c){m.push(c)}for(let c of[...t].reverse())try{await c.close()}catch(a){m.push(a)}if(m.length)throw new AggregateError(m,"serve_host_module_cleanup_failed")})();try{let m=await ce(r.hostModule,r.hostModuleSha256),c=e.runtime.adaptiveCapacity===void 0?void 0:l(D(e.runtime.adaptiveCapacity)),a=await m(Object.freeze({cwd:e.cwd,env:Object.freeze({...d}),logger:n,serve:z,extensions:$,own:l,...c?{capacity:c}:{}}));if(!a||typeof a!="object")throw new TypeError("serve_host_module_invalid_configuration");for(let y of a.resources??[])l(y);if(!a.agent||typeof a.authenticate!="function"||Object.keys(a).some(y=>!["agent","authenticate","terminal","v2","archive","resources"].includes(y))||a.v2&&["authenticate","createSession","store"].some(y=>Object.hasOwn(a.v2,y)))throw new TypeError("serve_host_module_invalid_configuration");let v=B(a.agent.persistence),g=a.agent.platform,w=g?l(X({apiBaseUrl:g.apiBaseUrl,model:e.runtime.upstreamGovernor??{},control:e.runtime.upstreamControlGovernor??{},fetchImpl:j({governor:g.governor,fetchImpl:g.fetchImpl}),capacity:c})):void 0,O={...e.runtime.factory,...a.agent,cwd:e.cwd,persistence:v,...r.model===void 0?{}:{defaultModel:r.model},...g&&w?{platform:{...e.runtime.session,...g,fetchImpl:w.fetch,governor:w.governor}}:{}};a.archive?o=Q({...a.archive,agent:O}):i=q(O);let x=Buffer.from(`Bearer ${s}`),T={...e.runtime.server,disableV1:!0,host:r.host,port:r.port,token:s,version:e.version,logger:n,...c?{adaptiveCapacity:c}:{},...w?{governor:w.governor}:{},observability:{...e.runtime.server.observability,exposeHealth:!0},readyFrame:e.readyFrame,...a.terminal?{terminal:a.terminal}:{},v2:{...e.runtime.v2,...a.v2,authenticate:y=>{let P=y.headers.authorization,F=Buffer.from(typeof P=="string"?P.trim():"");return F.length!==x.length?(A(x,x),null):A(F,x)?a.authenticate(y):null}}};return u=o?await o.start(T):await(e.start??K)({...T,createSession:{create(){throw new Error("serve_host_module_v2_only")}},v2:{...T.v2,createSession:i.factory,...i.storeReader?{store:i.storeReader}:{}}}),{server:u,shutdown:S}}catch(m){try{await S()}catch(c){throw new AggregateError([m,c],"serve_host_module_start_failed")}throw new Error("serve_host_module_start_failed",{cause:m})}}var ue=3e4;function me(e){let r=ee(e);return r===void 0||!/^\d+$/.test(r)?ue:Number.parseInt(r,10)}var fe=18e5;function ve(e,r){return ee(e)==="0"?{maxTurnWallClockMs:void 0,disabled:!0}:r!==void 0&&Number.isFinite(r)&&r>0?{maxTurnWallClockMs:r,disabled:!1}:{maxTurnWallClockMs:fe,disabled:!1}}function ee(e){let r=e?.trim();return r===void 0||r===""?void 0:r}function pe(e,r,d,n){let s={info:t=>e.write(t+`
|
|
5
|
+
`),error:t=>r.write(t+`
|
|
6
|
+
`)};return d!=="json"?L(s,{level:n}):(s.log=(t,l,i)=>{let o;try{o=JSON.stringify({ts:new Date().toISOString(),level:t,event:l,...i})}catch{o=JSON.stringify({ts:new Date().toISOString(),level:t,event:l,fields:"[unserializable]"})}(t==="error"||t==="warn"?r:e).write(o+`
|
|
7
|
+
`)},L(s,{level:n}))}function ge(e,r,d){if(e==="none")return"none";let n=e==="stderr"?d:r;return s=>{n.write(s)}}async function qe(e,r={}){let d=r.stdout??process.stdout,n=r.stderr??process.stderr,s=r.env??process.env,t=J(e);if(!t.ok)return n.write(p(t.error.key,t.error.params)+`
|
|
8
|
+
`),_.usage;let l=t.args;if(I(U({cliLang:l.lang,env:s})),!l.hostModule||!l.hostModuleSha256)return n.write(p(h.trustedHostRequired)+`
|
|
9
|
+
`),_.usage;if(s.TANSR_SERVE_LEGACY_V1?.trim()==="1")return n.write(p(h.retiredLocalOption,{name:"TANSR_SERVE_LEGACY_V1"})+`
|
|
10
|
+
`),_.usage;if(!(l.token?.trim()||s.TANSR_SERVE_TOKEN?.trim()))return n.write(p(h.missingToken)+`
|
|
11
|
+
`),_.usage;let i=await H({requested:l.cwd,fallback:r.cwd??process.cwd(),homedir:de.homedir()});if(!i.ok)return n.write(p(i.key,i.params)+`
|
|
12
|
+
`),_.usage;let o=Y(s,{serviceDefaults:!0}),u=ve(s.TANSR_SERVE_TURN_WALL_CLOCK_MS,o.session.maxTurnWallClockMs);o.session={...o.session,...u.maxTurnWallClockMs===void 0?{}:{maxTurnWallClockMs:u.maxTurnWallClockMs}},u.disabled&&delete o.session.maxTurnWallClockMs;let f=pe(d,n,o.logFormat,o.logLevel);for(let c of o.warnings)u.disabled&&c.name==="TANSR_SERVE_TURN_WALL_CLOCK_MS"||n.write(p(h.runtimeOptionInvalid,{...c})+`
|
|
13
|
+
`);let S=me(s.TANSR_SERVE_DRAIN_TIMEOUT_MS),m;try{m=await Z({args:l,cwd:i.cwd,env:s,logger:f,runtime:o,drainTimeoutMs:S,version:r.version??"0.11.0",readyFrame:ge(o.server.readyFrame,d,n),...r.startServer===void 0?{}:{start:r.startServer}})}catch{return n.write(p(h.startFailed,{message:"serve_host_module_start_failed"})+`
|
|
14
|
+
`),_.usage}return he({shutdown:m.shutdown,logger:f,stderr:n,drainTimeoutMs:S,deps:r,onUnhandled:o.onUnhandled})}function he(e){let{shutdown:r,logger:d,stderr:n,drainTimeoutMs:s,deps:t}=e,l=W({logger:d,onFatal:e.onUnhandled??"drain-exit",drain:r,drainTimeoutMs:s+15e3,...t.processGuardTarget!==void 0?{target:t.processGuardTarget}:{},...t.processExit!==void 0?{exit:t.processExit}:{}}),i=V(n,{...d.log!==void 0?{log:(o,u)=>d.log?.("warn",o,u)}:{}});return new Promise((o,u)=>{let f=G({hardExitAfterMs:s+15e3,...t.processLifecycle,...t.onSigint!==void 0?{signalSource:t.onSigint}:{},drain:()=>(n.write(p(h.stopping)+`
|
|
15
|
+
`),r().then(()=>{f.dispose(),l(),o(_.ok)},S=>{f.dispose(),l(),u(S)})),exitCode:_.aborted,...t.processExit!==void 0?{exit:t.processExit}:{},onSecondSignal:i.onSecondSignal,onHardExit:i.onHardExit})})}export{fe as DEFAULT_SERVE_TURN_WALL_CLOCK_MS,ve as resolveServeTurnWallClockMs,qe as runServeEntry};
|
|
16
|
+
//# sourceMappingURL=tansr-run-serve-entry-GWZQZ37P.mjs.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{a as b,b as E,c as A,d as h,f as x,g as O}from"./tansr-chunk-SCFXBKV6.mjs";import{z as S}from"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import{b as f}from"./tansr-chunk-YOSRXZWY.mjs";import{o as s,p as w}from"./tansr-chunk-WAYVH5ON.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-RFH7OCN6.mjs";import"./tansr-chunk-SHLU4JN2.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import{k as y,m as a,o as k}from"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";import{lstat as P,readFile as D,writeFile as K}from"node:fs/promises";import L from"node:path";function C(o){let i=s.exportUsage,r,d,t=[];for(let l=0;l<o.length;l++){let p=o[l];if(p==="--format"||p==="--out"){let c=o[l+1];if(c===void 0||c.startsWith("-"))return{ok:!1,key:f.missingValue,params:{flag:p},usageKey:i};p==="--format"?r=c:d=c,l+=1;continue}if(p.startsWith("-"))return{ok:!1,key:f.unknownFlag,params:{flag:p},usageKey:i};t.push(p)}let[u,n]=t;if(u===void 0)return{ok:!1,key:s.exportUsage,usageKey:i};if(n!==void 0)return{ok:!1,key:f.unexpectedArg,params:{arg:n},usageKey:i};let e=r??"md";return e!=="md"&&e!=="json"?{ok:!1,key:s.exportUnknownFormat,params:{format:e},usageKey:i}:{ok:!0,action:"export",id:u,format:e,...d!==void 0?{out:d}:{}}}function U(o){let i=s.pruneUsage,r=!1,d=!1,t=A,u=h;for(let n=0;n<o.length;n++){let e=o[n];if(e==="--apply"){r=!0;continue}if(e==="--include-broken"){d=!0;continue}if(e==="--keep-days"||e==="--keep-last"){let l=o[n+1];if(l===void 0||l.startsWith("-"))return{ok:!1,key:f.missingValue,params:{flag:e},usageKey:i};if(!/^\d+$/.test(l))return{ok:!1,key:s.pruneInvalidNumber,params:{flag:e,value:l},usageKey:i};e==="--keep-days"?t=Number(l):u=Number(l),n+=1;continue}return e.startsWith("-")?{ok:!1,key:f.unknownFlag,params:{flag:e},usageKey:i}:{ok:!1,key:f.unexpectedArg,params:{arg:e},usageKey:i}}return{ok:!0,action:"prune",apply:r,keepDays:t,keepLast:u,includeBroken:d}}function W(o){let[i,...r]=o;if(i===void 0)return{ok:!1,key:s.usage,usageKey:s.usage};if(i==="export")return C(r);if(i==="prune")return U(r);if(i==="migrate"){let d=r[0]==="--inspect",t=d?r.slice(1):r;return t.length===2&&t[0]==="--request"&&t[1]&&!t[1].startsWith("-")?{ok:!0,action:"migrate",request:t[1],inspectOnly:d}:{ok:!1,key:s.migrateUsage,usageKey:s.migrateUsage}}return i.startsWith("-")?{ok:!1,key:f.unknownFlag,params:{flag:i},usageKey:s.usage}:{ok:!1,key:f.unexpectedArg,params:{arg:i},usageKey:s.usage}}function m(o){return new Date(o).toISOString()}async function v(o,i,r,d){let t=await x(i,{keepDays:o.keepDays,keepLast:o.keepLast});for(let n of t.candidates)r.write(a(s.pruneCandidate,{sessionId:n.sessionId,updatedAt:m(n.updatedAt),bytes:n.bytes})+`
|
|
5
|
+
`);for(let n of t.sidecarOnly)r.write(a(s.pruneSidecarOnlyEntry,{name:n.name,updatedAt:m(n.mtimeMs),bytes:n.bytes})+`
|
|
6
|
+
`);for(let n of t.broken)r.write(a(s.pruneBrokenEntry,{name:n.name,bytes:n.bytes})+`
|
|
7
|
+
`);if(t.broken.length>0&&!(o.apply&&o.includeBroken)&&r.write(a(s.pruneBrokenHint,{count:t.broken.length})+`
|
|
8
|
+
`),t.candidates.length>0){let n=t.candidates.reduce((e,l)=>e+l.bytes,0);r.write(a(s.pruneSummary,{count:t.candidates.length,bytes:n,oldest:m(t.candidates[0].updatedAt),newest:m(t.candidates[t.candidates.length-1].updatedAt)})+`
|
|
9
|
+
`)}else t.sidecarOnly.length===0&&r.write(a(s.pruneNothing)+`
|
|
10
|
+
`);if(t.totalSidecarOnly>0&&r.write(a(s.pruneSidecarOnlySummary,{count:t.sidecarOnly.length,bytes:t.sidecarOnly.reduce((n,e)=>n+e.bytes,0),kept:t.sidecarOnlyKeptCount})+`
|
|
11
|
+
`),r.write(a(s.pruneKept,{count:t.keptCount,days:o.keepDays,last:o.keepLast,inUse:t.inUseCount})+`
|
|
12
|
+
`),!o.apply)return r.write(a(s.pruneDryRunHint)+`
|
|
13
|
+
`),0;let u=await O(t,{includeBroken:o.includeBroken,onDeleted:n=>{r.write(a(s.pruneDeleted,{sessionId:n.name,bytes:n.bytes})+`
|
|
14
|
+
`)}});for(let n of u.skippedLocked)r.write(a(s.pruneSkippedLocked,{sessionId:n})+`
|
|
15
|
+
`);for(let n of u.skippedFresh)r.write(a(s.pruneSkippedFresh,{sessionId:n})+`
|
|
16
|
+
`);return u.aborted!==void 0?(d.write(a(s.pruneAborted,{name:u.aborted.name,message:u.aborted.message,deleted:u.deleted.length})+`
|
|
17
|
+
`),1):(r.write(a(s.pruneApplied,{count:u.deleted.length,bytes:u.deleted.reduce((n,e)=>n+e.bytes,0)})+`
|
|
18
|
+
`),0)}async function Y(o,i={}){let r=i.stdout??process.stdout,d=i.stderr??process.stderr,t=i.env??process.env,u=i.cwd??process.cwd(),n=await S({cwd:u,env:t,...i.loadOptions!==void 0?{loadOptions:i.loadOptions}:{}});y(k({configLocale:n.loaded.locale,env:t}));let e=W(o);if(!e.ok)return d.write(a(e.key,e.params)+`
|
|
19
|
+
`),e.key!==e.usageKey&&d.write(a(e.usageKey)+`
|
|
20
|
+
`),1;let l=w(t);if(e.action==="migrate")try{let c=L.resolve(u,e.request),g=await P(c);if(!g.isFile()||g.isSymbolicLink()||g.size>65536)throw new Error(a("cli.sessions.migration.invalidRequestFile"));let F=JSON.parse(await D(c,"utf8"));return r.write(JSON.stringify(await b(F,e.inspectOnly),null,2)+`
|
|
21
|
+
`),0}catch(c){return d.write(a(s.migrateFailed,{message:c instanceof Error?c.message:String(c)})+`
|
|
22
|
+
`),1}if(e.action==="prune")return v(e,l,r,d);let p=await E(l,e.id,e.format);if(!p.ok)return d.write((p.reason==="not_found"?a(s.exportNotFound,{sessionId:e.id}):a(s.exportFailed,{sessionId:e.id,detail:`${p.reason}: ${p.detail}`}))+`
|
|
23
|
+
`),1;if(e.out!==void 0){let c=L.resolve(u,e.out);return await K(c,p.text,"utf8"),r.write(a(s.exportWritten,{path:c})+`
|
|
24
|
+
`),0}return r.write(p.text),0}export{W as parseSessionsArgs,Y as runSessionsEntry};
|
|
25
|
+
//# sourceMappingURL=tansr-run-sessions-entry-WL7YLRJL.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{i as a,j as b,k as c}from"./tansr-chunk-IZZYKHSW.mjs";import"./tansr-chunk-SIV2666W.mjs";import"./tansr-chunk-Q3XDAUKT.mjs";import"./tansr-chunk-PIET7WB3.mjs";import"./tansr-chunk-C2NTVBEY.mjs";import"./tansr-chunk-4IWNKAT5.mjs";import"./tansr-chunk-YEYFEVYF.mjs";import"./tansr-chunk-OT4KIQLR.mjs";import"./tansr-chunk-2HZJSKHM.mjs";import"./tansr-chunk-F5STVU7J.mjs";import"./tansr-chunk-ECYZ457U.mjs";import"./tansr-chunk-2QKLANZQ.mjs";import"./tansr-chunk-OUOTEH4A.mjs";import"./tansr-chunk-N644DEOO.mjs";import"./tansr-chunk-546BDI3V.mjs";import"./tansr-chunk-OEHA7T4Q.mjs";import"./tansr-chunk-UVL2XWKL.mjs";import"./tansr-chunk-NQOYEFEE.mjs";import"./tansr-chunk-YOSRXZWY.mjs";import"./tansr-chunk-WAYVH5ON.mjs";import"./tansr-chunk-AHUB2IHT.mjs";import"./tansr-chunk-RFH7OCN6.mjs";import"./tansr-chunk-SHLU4JN2.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-O7P4OFK7.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-4YAEV3T6.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-DIT3PBNB.mjs";import"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";export{a as ALLOW_UNSIGNED_CONFIRM_TOKEN,b as parseUpdateArgs,c as runUpdateEntry};
|
|
5
|
+
//# sourceMappingURL=tansr-run-update-entry-YI47IPCC.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{o as a,p as b,q as c,r as d,s as e,t as f,u as g}from"./tansr-chunk-SHLU4JN2.mjs";import"./tansr-chunk-JIC3VWLQ.mjs";import"./tansr-chunk-C7GGA5ID.mjs";import"./tansr-chunk-6N333TUL.mjs";import"./tansr-chunk-EFN24XG3.mjs";import"./tansr-chunk-OKAA4BJC.mjs";import"./tansr-chunk-AOH7YPF3.mjs";import"./tansr-chunk-YK3CE3JM.mjs";import"./tansr-chunk-4DAH4AIH.mjs";import"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-LA3LGOYQ.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";export{b as addCompactionSpillAncestor,d as adoptSessionSpillRecovery,g as createPrunedPathResolver,a as createSessionSpillRecovery,f as createSessionSpillStore,c as sessionSpillAncestorAnchors,e as spillDirPath};
|
|
5
|
+
//# sourceMappingURL=tansr-spill-YVUTIFOS.mjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __tansrCreateRequire } from 'module';const require=__tansrCreateRequire(import.meta.url);
|
|
2
|
+
import { fileURLToPath as __tansrFileURLToPath } from 'url';import { dirname as __tansrDirname } from 'path';
|
|
3
|
+
const __filename=__tansrFileURLToPath(import.meta.url);const __dirname=__tansrDirname(__filename);
|
|
4
|
+
import{$,$a,A,Aa,Ab,B,Ba,Bb,C,Ca,Cb,D,Da,Db,E,Ea,Eb,F,Fa,Fb,G,Ga,Gb,H,Ha,Hb,I,Ia,Ib,J,Ja,Jb,K,Ka,Kb,L,La,Lb,M,Ma,Mb,N,Na,Nb,O,Oa,Ob,P,Pa,Pb,Q,Qa,Qb,R,Ra,Rb,S,Sa,Sb,T,Ta,Tb,U,Ua,Ub,V,Va,Vb,W,Wa,Wb,X,Xa,Y,Ya,Z,Za,_,_a,a,aa,ab,b,ba,bb,c,ca,cb,d,da,db,e,ea,eb,f,fa,fb,g,ga,gb,h,ha,hb,i,ia,ib,j,ja,jb,k,ka,kb,l,la,lb,m,ma,mb,n,na,nb,o,oa,ob,p,pa,pb,q,qa,qb,r,ra,rb,s,sa,sb,t,ta,tb,u,ua,ub,v,va,vb,w,wa,wb,x,xa,xb,y,ya,yb,z,za,zb}from"./tansr-chunk-ENRIN7EG.mjs";import"./tansr-chunk-MAMODDQN.mjs";import"./tansr-chunk-3YSQG6KY.mjs";import"./tansr-chunk-RRAMVVYF.mjs";export{wa as ASSET_ID_RE,xa as AgentProfileSchema,Ba as ApprovalDecisionViewSchema,Ca as ApprovalDelegationSchema,sa as ApprovalPolicySchema,Da as ApprovalRouteTraceSchema,Ja as ApprovalTicketSchema,Aa as ApprovalTicketStatusSchema,fb as AttachmentEntrySchema,wb as AudioTtsInputLimitSchema,_ as AuditSectionSchema,Y as BudgetSectionSchema,G as CapabilitySchema,eb as CheckpointEntrySchema,ib as ColdStorageManifestSchema,A as CompactBoundaryPayloadSchema,ta as CompensationBodySchema,Na as CostStatusSchema,q as DecisionSourceSchema,da as EffortLevelSchema,s as EventBodySchema,m as EventEnvelopeSchema,B as FileCheckpointSchema,z as ForkPayloadSchema,Gb as HISTORY_ARTIFACT_MAX_BYTES,ga as HeadlessResultRecordSchema,K as HookCommandExecutorSchema,M as HookExecutorConfigSchema,N as HookGroupSchema,L as HookHttpExecutorSchema,r as HookOutcomeStatusSchema,O as HooksSectionSchema,b as IRBlockSchema,k as IRErrorKindSchema,d as IRMessageMetaSchema,e as IRMessageSchema,i as IRRequestSchema,c as IRRoleSchema,l as IRStreamEventSchema,f as IRSystemSegmentSchema,a as IRToolContentSchema,g as IRToolDefSchema,j as IRUsageSchema,xb as ImageGenDataSchema,F as InputModalityModeSchema,w as IntegritySchema,x as JournalKindSchema,y as JournalRecordSchema,t as KernelEventSchema,ab as LEGACY_STORAGE_FORMAT_VERSION,oa as MAX_STEP_PAYLOAD_BYTES,S as McpHttpServerSchema,T as McpServerConfigSchema,U as McpServersSectionSchema,R as McpStdioServerSchema,za as ORCHESTRATION_LABEL_KEYS,ha as OrchestrationEnvelopeSchema,V as PERMISSION_MODES,kb as PERSISTENCE_CUSTODY_CAPABILITY,jb as PERSISTENCE_CUSTODY_CONTRACT,ob as PERSISTENCE_CUSTODY_DEFAULT_MIGRATION_BUDGET,mb as PERSISTENCE_CUSTODY_SCHEMA_REVISION,lb as PERSISTENCE_CUSTODY_SCHEMA_SHA256,pb as PERSISTENCE_CUSTODY_TOOL_DEFINITION_SHA256,nb as PERSISTENCE_CUSTODY_TOOL_NAME,Wb as PROTOCOL_VERSION,p as PermissionDecisionSchema,W as PermissionModeSchema,X as PermissionsSectionSchema,va as PlaybookSchema,Ea as PolicyBundleMetaSchema,Fa as PolicyBundleRulesSchema,Ha as PolicyBundleSchema,Ga as PolicyBundleSignatureSchema,aa as PolicySectionSchema,$ as PolicyTrustSchema,I as PricingSchema,H as PricingTierSchema,E as PromptCachingModeSchema,D as ProtocolKindSchema,J as ProviderProfileSchema,La as QuotaActionSchema,Ka as QuotaScopeSchema,Pa as QuotaStatusEntrySchema,Ra as RBAC_ROLES,Sa as RbacRoleSchema,h as ResolvedModelSchema,na as RetryPolicySchema,ja as RunRecordSchema,ia as RunStatusSchema,Rb as SECRET_KEY_RE,bb as SEGMENT_CODECS,pa as STEP_JOURNAL_TRUNCATION,$a as STORAGE_FORMAT_VERSION,ba as SandboxSectionSchema,cb as SegmentCodecSchema,db as SegmentEntrySchema,gb as SegmentManifestSchema,ea as SemanticIndexSectionSchema,Va as SessionInfoSchema,Ua as SessionInfoSessionSchema,Ta as SessionInfoStaticTokenSchema,ya as SessionLabelsSchema,hb as SessionLogFileManifestSchema,Bb as SpeechAudioSchema,Cb as SpeechDataSchema,ka as StepJournalKindSchema,la as StepJournalRecordSchema,ua as StepSchema,Xa as TANSRD_REPLAY_GAP_EVENT,_a as TANSRD_WS_BEARER_PROTOCOL_PREFIX,Za as TANSRD_WS_SUBPROTOCOL,Fb as TOOL_ARTIFACT_MAX_BYTES,Hb as TOOL_ARTIFACT_MAX_ITEMS,fa as TansrConfigSchema,Wa as TansrdEventSchema,Ya as TansrdReplayGapSchema,n as TerminalReasonSchema,P as ThemeNameSchema,ma as TimerRecordSchema,o as ToolErrorTypeSchema,Ib as ToolResultArtifactV1Schema,Ab as TranscriptDataSchema,zb as TranscriptSegmentSchema,qa as TriggerSchema,Q as UiSectionSchema,Oa as UsageAccumSchema,Ma as UsageGroupBySchema,Qa as UsageReportEntrySchema,Z as VerifySectionSchema,yb as VideoGenDataSchema,C as Visibilities,v as VisibilitySchema,ra as WEBHOOK_SIGNATURE_V2,Ia as WebhookEnvelopeSchema,ca as WorkspaceTrustSectionSchema,Pb as admitToolResultArtifacts,Jb as artifactJsonBytes,Kb as classifyToolResultArtifact,Lb as createToolResultArtifact,Tb as detectCredentialFamilies,Ob as hasToolResultArtifact,Db as isRenderableArtifact,u as makeEvent,Mb as modelViewMessage,Nb as modelViewMessages,Qb as pairHistoryToolResults,Eb as parseMediaArtifact,rb as persistenceCustodyInventorySeedBytes,tb as persistenceCustodyPrepareIntentBytes,sb as persistenceCustodyRecordBytes,qb as persistenceCustodySnapshotBytes,ub as persistenceCustodyWriterIntentBytes,vb as persistenceCustodyWriterOperationBytes,Vb as redactDeep,Ub as redactSecretValue,Sb as redactText};
|
|
5
|
+
//# sourceMappingURL=tansr-src-LPMSGRKO.mjs.map
|