zen-code 4.10.0 → 4.10.2

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.
Files changed (93) hide show
  1. package/dist/app.js +3 -3
  2. package/dist/chunk-0ddrb30y.js +1 -0
  3. package/dist/{chunk-gz7fz9fg.js → chunk-215an3fz.js} +1 -1
  4. package/dist/{chunk-5m4yb9av.js → chunk-40ht9pe1.js} +2 -2
  5. package/dist/{chunk-dx9k6sdd.js → chunk-4wnmk2tj.js} +1 -1
  6. package/dist/{chunk-e6ggkg36.js → chunk-4z0w0ng1.js} +1 -1
  7. package/dist/chunk-57bj89e2.js +1 -0
  8. package/dist/{chunk-54cdhhqm.js → chunk-5a5mepqj.js} +1 -1
  9. package/dist/{chunk-t0f66x64.js → chunk-5c3bpcpm.js} +1 -1
  10. package/dist/{chunk-8bs8r50r.js → chunk-7kw7ss8d.js} +1 -1
  11. package/dist/chunk-86m0rmtc.js +1 -0
  12. package/dist/{chunk-cef4vbtb.js → chunk-8f19qk9r.js} +1 -1
  13. package/dist/{chunk-yerf10k7.js → chunk-8tbtavry.js} +1 -1
  14. package/dist/{chunk-5yd4ntp6.js → chunk-9rayxazs.js} +2 -2
  15. package/dist/{chunk-1w19w1bm.js → chunk-a9gpb2tx.js} +1 -1
  16. package/dist/{chunk-d2770b2z.js → chunk-a9tw6d68.js} +1 -1
  17. package/dist/{chunk-r0cfe5c1.js → chunk-anbtppz1.js} +3 -3
  18. package/dist/chunk-bca8tkkr.js +1 -0
  19. package/dist/{chunk-bm7578sn.js → chunk-bdqds8vh.js} +1 -1
  20. package/dist/{chunk-gwf8b14k.js → chunk-bzgznka5.js} +1 -1
  21. package/dist/{chunk-1v863afn.js → chunk-c7kd2qrp.js} +3 -3
  22. package/dist/{chunk-vhn13anh.js → chunk-dvbb3dd1.js} +2 -2
  23. package/dist/{chunk-t01t72t2.js → chunk-e8kxa5vj.js} +2 -2
  24. package/dist/{chunk-7yzv6385.js → chunk-ehmmd8qc.js} +1 -1
  25. package/dist/{chunk-whdf0vbb.js → chunk-ejfa95sm.js} +1 -1
  26. package/dist/{chunk-hrcxdj3c.js → chunk-f0m4532p.js} +2 -2
  27. package/dist/{chunk-rtjytfhh.js → chunk-f7cps5x1.js} +1 -1
  28. package/dist/{chunk-7jatn15w.js → chunk-fbemqjck.js} +1 -1
  29. package/dist/{chunk-075hks9v.js → chunk-feeqtzv5.js} +1 -1
  30. package/dist/{chunk-8waww0j9.js → chunk-fzh0v6r0.js} +2 -2
  31. package/dist/{chunk-nm253hhf.js → chunk-g2zskge5.js} +2 -2
  32. package/dist/{chunk-875hayaj.js → chunk-g974hxbz.js} +1 -1
  33. package/dist/{chunk-4scrkcqv.js → chunk-g9911ymn.js} +1 -1
  34. package/dist/{chunk-bytq4kd1.js → chunk-gfhmzpy7.js} +2 -2
  35. package/dist/{chunk-wd3gkd45.js → chunk-gt8c6dne.js} +1 -1
  36. package/dist/{chunk-d72063sm.js → chunk-h8fdexm4.js} +1 -1
  37. package/dist/{chunk-k12y05c3.js → chunk-hnnwbfqk.js} +2 -2
  38. package/dist/{chunk-hz9yw7cs.js → chunk-hp2jzn9x.js} +2 -2
  39. package/dist/{chunk-arv4h3h1.js → chunk-hve2a279.js} +2 -2
  40. package/dist/{chunk-ws232ksq.js → chunk-js4qp900.js} +1 -1
  41. package/dist/{chunk-mv0xzmq8.js → chunk-k4q8j7pg.js} +1 -1
  42. package/dist/{chunk-kmxdq21k.js → chunk-m21hvv91.js} +1 -1
  43. package/dist/{chunk-prg6489q.js → chunk-mmx0k2yq.js} +1 -1
  44. package/dist/{chunk-3dnayvgx.js → chunk-mnnyjmgw.js} +2 -2
  45. package/dist/chunk-mw7x6xqp.js +1 -0
  46. package/dist/{chunk-0fj768k4.js → chunk-n7s6my89.js} +2 -2
  47. package/dist/{chunk-cnzhxgn5.js → chunk-n9rpnke9.js} +1 -1
  48. package/dist/{chunk-tn356gwf.js → chunk-nk62q95g.js} +2 -2
  49. package/dist/{chunk-n849zsd3.js → chunk-nmzx5nmt.js} +1 -1
  50. package/dist/{chunk-7w9y11hj.js → chunk-nqh1pptf.js} +1 -1
  51. package/dist/{chunk-qhzm2qw9.js → chunk-nsw5168d.js} +2 -2
  52. package/dist/{chunk-9tgp14v7.js → chunk-pe8mzxwn.js} +2 -2
  53. package/dist/{chunk-4hg13vwj.js → chunk-pg1ppq4y.js} +1 -1
  54. package/dist/{chunk-yzv3n8mw.js → chunk-pzb224c5.js} +1 -1
  55. package/dist/chunk-q1cxrg0x.js +2 -0
  56. package/dist/{chunk-k6fxqssr.js → chunk-qxebn3jw.js} +3 -3
  57. package/dist/{chunk-mm9w91rj.js → chunk-s1tbdcs8.js} +1 -1
  58. package/dist/{chunk-j4y5rjne.js → chunk-s5cqejr6.js} +1 -1
  59. package/dist/{chunk-qmxtys9q.js → chunk-spa69h7p.js} +1 -1
  60. package/dist/{chunk-znw7fpep.js → chunk-spx7nn8t.js} +2 -2
  61. package/dist/{chunk-wbm7rn9w.js → chunk-swc7se71.js} +1 -1
  62. package/dist/chunk-swyc15ym.js +1 -0
  63. package/dist/chunk-t2s3s6af.js +1 -0
  64. package/dist/{chunk-h0q3dvnv.js → chunk-t6440ajd.js} +2 -2
  65. package/dist/{chunk-vd8kwzra.js → chunk-tjg2e8v3.js} +2 -2
  66. package/dist/{chunk-d988tv30.js → chunk-tjvhqr94.js} +1 -1
  67. package/dist/{chunk-fjqtrakn.js → chunk-vbb3m0vz.js} +1 -1
  68. package/dist/{chunk-9czhw5k6.js → chunk-vdmq9d9x.js} +2 -2
  69. package/dist/{chunk-pxdgy0vr.js → chunk-vfxjbdz4.js} +1 -1
  70. package/dist/{chunk-mcb8rewr.js → chunk-vrnj0659.js} +2 -2
  71. package/dist/{chunk-6scjjkn3.js → chunk-wmyc17aa.js} +1 -1
  72. package/dist/{chunk-vnewbtjy.js → chunk-wt3p1w1g.js} +1 -1
  73. package/dist/{chunk-19mf2aa7.js → chunk-y5ry5c7v.js} +1 -1
  74. package/dist/{chunk-z3e4c424.js → chunk-y8qhrx11.js} +1 -1
  75. package/dist/{chunk-1mq2jmfy.js → chunk-yy8p9zph.js} +2 -2
  76. package/dist/chunk-z61m3anh.js +1 -0
  77. package/dist/{chunk-a239dn0b.js → chunk-zg54h6gy.js} +1 -1
  78. package/dist/chunk-zr90qp47.js +1 -0
  79. package/dist/{chunk-s7ttf0pm.js → chunk-zsa62xr0.js} +2 -2
  80. package/dist/cli.js +1 -1
  81. package/dist/nonInteractive.js +1 -1
  82. package/dist/zen-keyboard.js +1 -1
  83. package/package.json +1 -1
  84. package/dist/chunk-1vn8d8b8.js +0 -1
  85. package/dist/chunk-8ysg0rga.js +0 -1
  86. package/dist/chunk-b2551zfb.js +0 -2
  87. package/dist/chunk-b9emn03n.js +0 -1
  88. package/dist/chunk-c2wfgbj6.js +0 -1
  89. package/dist/chunk-gbfpab0j.js +0 -1
  90. package/dist/chunk-gkvx829z.js +0 -1
  91. package/dist/chunk-h0qb9jk1.js +0 -1
  92. package/dist/chunk-h9y136h8.js +0 -1
  93. package/dist/chunk-zq2g4rfd.js +0 -1
@@ -0,0 +1 @@
1
+ import{gf as a}from"./chunk-spx7nn8t.js";import"./chunk-e8kxa5vj.js";import"./chunk-y8qhrx11.js";export{a as FileSystemSkillStore};
@@ -1 +1 @@
1
- import{U as R,W as v,X as _,Y as b}from"./chunk-dx9k6sdd.js";import{Be as J,Ce as W,Ke as q,Le as h,ye as S}from"./chunk-1v863afn.js";import{mf as U}from"./chunk-gwf8b14k.js";import{Fl as w}from"./chunk-z3e4c424.js";var G=w(S(),1);function M({limit:X=100,enabled:H=!0}={}){return v({queryKey:b.errors.list(),queryFn:async()=>{return U.getRecentErrors(X)},enabled:H,staleTime:5000,refetchInterval:5000})}function O(){let X=R();return _({mutationFn:async(H)=>{return U.deleteError(H)},onSuccess:()=>{X.invalidateQueries({queryKey:b.errors.all})}})}function Q(){let X=R();return _({mutationFn:async()=>{U.clearAll()},onSuccess:()=>{X.invalidateQueries({queryKey:b.errors.all})}})}var z=w(h(),1);import{join as B}from"node:path";var T={error:{emoji:"❌",color:"red",label:"错误"},warning:{emoji:"⚠️",color:"yellow",label:"警告"}},p={Agent:{emoji:"\uD83E\uDD16",label:"Agent"},Tool:{emoji:"\uD83D\uDD27",label:"Tool"},Terminal:{emoji:"\uD83D\uDCBB",label:"Terminal"},System:{emoji:"⚙️",label:"System"},Unknown:{emoji:"❓",label:"Unknown"}};function g(X){let H=new Date(X),Z=new Date,P=Z.getTime()-H.getTime();if(P<60000)return"刚刚";if(P<3600000)return`${Math.floor(P/60000)}分钟前`;if(H.toDateString()===Z.toDateString())return H.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return H.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function c(X,H=80){if(X.length<=H)return X;return X.slice(0,H-3)+"..."}var d=({onClose:X})=>{let{data:H=[],isLoading:Z}=M({limit:50}),P=O(),N=Q(),L=G.useCallback(async()=>{await N.mutateAsync()},[N]);q((Y,A)=>{if(A.escape)X();if(A.ctrl&&Y==="l")L()},{isActive:!0});let f=B(process.cwd(),".zen-code","errors.json"),F=G.default.useMemo(()=>{let Y=H.filter(($)=>$.level==="error").length,A=H.filter(($)=>$.level==="warning").length;return{errorCount:Y,warningCount:A}},[H]);return z.jsxDEV(J,{flexDirection:"column",paddingX:1,paddingY:1,children:[z.jsxDEV(J,{marginBottom:1,children:[z.jsxDEV(W,{bold:!0,color:"cyan",children:"\uD83D\uDCCB 错误日志"},void 0,!1,void 0,this),z.jsxDEV(J,{marginLeft:2,children:[z.jsxDEV(W,{color:"red",children:["❌ ",F.errorCount]},void 0,!0,void 0,this),z.jsxDEV(W,{children:" "},void 0,!1,void 0,this),z.jsxDEV(W,{color:"yellow",children:["⚠️ ",F.warningCount]},void 0,!0,void 0,this),z.jsxDEV(W,{dimColor:!0,children:["| Total: ",H.length]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z&&z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"加载中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!Z&&H.length>0&&z.jsxDEV(J,{flexDirection:"column",children:H.slice(0,20).map((Y,A)=>{let $=T[Y.level],K=p[Y.source]||p.Unknown,k=g(Y.timestamp),I=c(Y.message);return z.jsxDEV(J,{flexDirection:"column",marginBottom:1,children:[z.jsxDEV(J,{children:z.jsxDEV(W,{color:$.color,children:[$.emoji," ",I]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginLeft:2,children:[z.jsxDEV(W,{dimColor:!0,children:[K.emoji," ",K.label," | ",k]},void 0,!0,void 0,this),Y.file&&z.jsxDEV(W,{dimColor:!0,color:"gray",children:[" ","| \uD83D\uDCC4 ",Y.file,Y.line&&`:${Y.line}`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},Y.id,!0,void 0,this)})},void 0,!1,void 0,this),!Z&&H.length===0&&z.jsxDEV(J,{flexDirection:"column",marginBottom:1,children:[z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"暂无错误记录"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"错误将自动收集到:"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{color:"yellow",children:f},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(J,{marginTop:1,children:z.jsxDEV(W,{dimColor:!0,children:"按 ESC 返回 | Ctrl+L 清空所有"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E=d;export{E as default};
1
+ import{U as R,W as v,X as _,Y as b}from"./chunk-4wnmk2tj.js";import{Ae as W,Ie as q,Je as h,we as S,ze as J}from"./chunk-c7kd2qrp.js";import{kf as U}from"./chunk-bzgznka5.js";import{Dl as w}from"./chunk-y8qhrx11.js";var G=w(S(),1);function M({limit:X=100,enabled:H=!0}={}){return v({queryKey:b.errors.list(),queryFn:async()=>{return U.getRecentErrors(X)},enabled:H,staleTime:5000,refetchInterval:5000})}function O(){let X=R();return _({mutationFn:async(H)=>{return U.deleteError(H)},onSuccess:()=>{X.invalidateQueries({queryKey:b.errors.all})}})}function Q(){let X=R();return _({mutationFn:async()=>{U.clearAll()},onSuccess:()=>{X.invalidateQueries({queryKey:b.errors.all})}})}var z=w(h(),1);import{join as B}from"node:path";var T={error:{emoji:"❌",color:"red",label:"错误"},warning:{emoji:"⚠️",color:"yellow",label:"警告"}},p={Agent:{emoji:"\uD83E\uDD16",label:"Agent"},Tool:{emoji:"\uD83D\uDD27",label:"Tool"},Terminal:{emoji:"\uD83D\uDCBB",label:"Terminal"},System:{emoji:"⚙️",label:"System"},Unknown:{emoji:"❓",label:"Unknown"}};function g(X){let H=new Date(X),Z=new Date,P=Z.getTime()-H.getTime();if(P<60000)return"刚刚";if(P<3600000)return`${Math.floor(P/60000)}分钟前`;if(H.toDateString()===Z.toDateString())return H.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});return H.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function c(X,H=80){if(X.length<=H)return X;return X.slice(0,H-3)+"..."}var d=({onClose:X})=>{let{data:H=[],isLoading:Z}=M({limit:50}),P=O(),N=Q(),L=G.useCallback(async()=>{await N.mutateAsync()},[N]);q((Y,A)=>{if(A.escape)X();if(A.ctrl&&Y==="l")L()},{isActive:!0});let f=B(process.cwd(),".zen-code","errors.json"),F=G.default.useMemo(()=>{let Y=H.filter(($)=>$.level==="error").length,A=H.filter(($)=>$.level==="warning").length;return{errorCount:Y,warningCount:A}},[H]);return z.jsxDEV(J,{flexDirection:"column",paddingX:1,paddingY:1,children:[z.jsxDEV(J,{marginBottom:1,children:[z.jsxDEV(W,{bold:!0,color:"cyan",children:"\uD83D\uDCCB 错误日志"},void 0,!1,void 0,this),z.jsxDEV(J,{marginLeft:2,children:[z.jsxDEV(W,{color:"red",children:["❌ ",F.errorCount]},void 0,!0,void 0,this),z.jsxDEV(W,{children:" "},void 0,!1,void 0,this),z.jsxDEV(W,{color:"yellow",children:["⚠️ ",F.warningCount]},void 0,!0,void 0,this),z.jsxDEV(W,{dimColor:!0,children:["| Total: ",H.length]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z&&z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"加载中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),!Z&&H.length>0&&z.jsxDEV(J,{flexDirection:"column",children:H.slice(0,20).map((Y,A)=>{let $=T[Y.level],K=p[Y.source]||p.Unknown,k=g(Y.timestamp),I=c(Y.message);return z.jsxDEV(J,{flexDirection:"column",marginBottom:1,children:[z.jsxDEV(J,{children:z.jsxDEV(W,{color:$.color,children:[$.emoji," ",I]},void 0,!0,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginLeft:2,children:[z.jsxDEV(W,{dimColor:!0,children:[K.emoji," ",K.label," | ",k]},void 0,!0,void 0,this),Y.file&&z.jsxDEV(W,{dimColor:!0,color:"gray",children:[" ","| \uD83D\uDCC4 ",Y.file,Y.line&&`:${Y.line}`]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},Y.id,!0,void 0,this)})},void 0,!1,void 0,this),!Z&&H.length===0&&z.jsxDEV(J,{flexDirection:"column",marginBottom:1,children:[z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"暂无错误记录"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{dimColor:!0,children:"错误将自动收集到:"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV(J,{marginBottom:1,children:z.jsxDEV(W,{color:"yellow",children:f},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(J,{marginTop:1,children:z.jsxDEV(W,{dimColor:!0,children:"按 ESC 返回 | Ctrl+L 清空所有"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E=d;export{E as default};
@@ -1,3 +1,3 @@
1
1
  import{writeFileSync as B,readFileSync as C,existsSync as u,mkdirSync as G}from"node:fs";import{join as H,dirname as J}from"node:path";import{randomUUID as K}from"node:crypto";class z{errors=[];filePath;maxEntries;isLoaded=!1;constructor(b){this.filePath=b?.filePath||H(process.cwd(),".zen-code","errors.json"),this.maxEntries=b?.maxEntries||500,this.ensureDirectory()}ensureDirectory(){let b=J(this.filePath);if(!u(b))G(b,{recursive:!0})}loadFromFile(){if(this.isLoaded)return;try{if(u(this.filePath)){let b=C(this.filePath,"utf-8"),q=JSON.parse(b);if(Array.isArray(q))this.errors=q}}catch(b){this.errors=[]}this.isLoaded=!0}saveToFile(){try{let b=JSON.stringify(this.errors,null,2);B(this.filePath,b,"utf-8")}catch(b){process.stderr.write(`[ErrorStore] Failed to save errors: ${b}
2
2
  `)}}addError(b){this.loadFromFile();let q={...b,id:K(),timestamp:new Date().toISOString()};if(this.errors.unshift(q),this.errors.length>this.maxEntries)this.errors=this.errors.slice(0,this.maxEntries);return this.saveToFile(),q}getErrors(){return this.loadFromFile(),[...this.errors]}getRecentErrors(b=100){return this.loadFromFile(),this.errors.slice(0,b)}clearAll(){this.errors=[],this.saveToFile()}deleteError(b){this.loadFromFile();let q=this.errors.findIndex((A)=>A.id===b);if(q!==-1)return this.errors.splice(q,1),this.saveToFile(),!0;return!1}getStats(){return this.loadFromFile(),{total:this.errors.length,errors:this.errors.filter((b)=>b.level==="error").length,warnings:this.errors.filter((b)=>b.level==="warning").length}}}var O=new z;
3
- export{O as mf};
3
+ export{O as kf};
@@ -1,4 +1,4 @@
1
- import{Fl as GA,Hl as sI,Il as P7,Kl as p0}from"./chunk-z3e4c424.js";var aA=sI((J7,E8)=>{(function(){function Q(R,$){Object.defineProperty(G.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",$[0],$[1])}})}function C(R){if(R===null||typeof R!=="object")return null;return R=IB&&R[IB]||R["@@iterator"],typeof R==="function"?R:null}function F(R,$){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var s=R+"."+$;CA[s]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",$,R),CA[s]=!0)}function G(R,$,s){this.props=R,this.context=$,this.refs=VA,this.updater=s||DA}function H(){}function J(R,$,s){this.props=R,this.context=$,this.refs=VA,this.updater=s||DA}function M(){}function Y(R){return""+R}function X(R){try{Y(R);var $=!1}catch(UA){$=!0}if($){$=console;var s=$.error,e=typeof Symbol==="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return s.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",e),Y(R)}}function k(R){if(R==null)return null;if(typeof R==="function")return R.$$typeof===HI?null:R.displayName||R.name||null;if(typeof R==="string")return R;switch(R){case TA:return"Fragment";case qA:return"Profiler";case c:return"StrictMode";case qB:return"Suspense";case FB:return"SuspenseList";case _A:return"Activity"}if(typeof R==="object")switch(typeof R.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case XA:return"Portal";case AB:return R.displayName||"Context";case iA:return(R._context.displayName||"Context")+".Consumer";case ZB:var $=R.render;return R=R.displayName,R||(R=$.displayName||$.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case cB:return $=R.displayName||null,$!==null?$:k(R.type)||"Memo";case $B:$=R._payload,R=R._init;try{return k(R($))}catch(s){}}return null}function u(R){if(R===TA)return"<>";if(typeof R==="object"&&R!==null&&R.$$typeof===$B)return"<...>";try{var $=k(R);return $?"<"+$+">":"<...>"}catch(s){return"<...>"}}function p(){var R=OA.A;return R===null?null:R.getOwner()}function q(){return Error("react-stack-top-frame")}function T(R){if(oI.call(R,"key")){var $=Object.getOwnPropertyDescriptor(R,"key").get;if($&&$.isReactWarning)return!1}return R.key!==void 0}function x(R,$){function s(){qI||(qI=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}s.isReactWarning=!0,Object.defineProperty(R,"key",{get:s,configurable:!0})}function m(){var R=k(this.type);return bQ[R]||(bQ[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function _(R,$,s,e,UA,vA){var zA=s.ref;return R={$$typeof:NA,type:R,key:$,props:s,_owner:e},(zA!==void 0?zA:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:m}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:UA}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vA}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function JA(R,$){return $=_(R.type,$,R.props,R._owner,R._debugStack,R._debugTask),R._store&&($._store.validated=R._store.validated),$}function kA(R){wA(R)?R._store&&(R._store.validated=1):typeof R==="object"&&R!==null&&R.$$typeof===$B&&(R._payload.status==="fulfilled"?wA(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function wA(R){return typeof R==="object"&&R!==null&&R.$$typeof===NA}function L(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(s){return $[s]})}function y(R,$){return typeof R==="object"&&R!==null&&R.key!=null?(X(R.key),L(""+R.key)):$.toString(36)}function QA(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status==="string"?R.then(M,M):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function r(R,$,s,e,UA){var vA=typeof R;if(vA==="undefined"||vA==="boolean")R=null;var zA=!1;if(R===null)zA=!0;else switch(vA){case"bigint":case"string":case"number":zA=!0;break;case"object":switch(R.$$typeof){case NA:case XA:zA=!0;break;case $B:return zA=R._init,r(zA(R._payload),$,s,e,UA)}}if(zA){zA=R,UA=UA(zA);var EB=e===""?"."+y(zA,0):e;return XI(UA)?(s="",EB!=null&&(s=EB.replace($C,"$&/")+"/"),r(UA,$,s,"",function(EI){return EI})):UA!=null&&(wA(UA)&&(UA.key!=null&&(zA&&zA.key===UA.key||X(UA.key)),s=JA(UA,s+(UA.key==null||zA&&zA.key===UA.key?"":(""+UA.key).replace($C,"$&/")+"/")+EB),e!==""&&zA!=null&&wA(zA)&&zA.key==null&&zA._store&&!zA._store.validated&&(s._store.validated=2),UA=s),$.push(UA)),1}if(zA=0,EB=e===""?".":e+":",XI(R))for(var pA=0;pA<R.length;pA++)e=R[pA],vA=EB+y(e,pA),zA+=r(e,$,s,vA,UA);else if(pA=C(R),typeof pA==="function")for(pA===R.entries&&(UE||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),UE=!0),R=pA.call(R),pA=0;!(e=R.next()).done;)e=e.value,vA=EB+y(e,pA++),zA+=r(e,$,s,vA,UA);else if(vA==="object"){if(typeof R.then==="function")return r(QA(R),$,s,e,UA);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return zA}function EA(R,$,s){if(R==null)return R;var e=[],UA=0;return r(R,e,"","",function(vA){return $.call(s,vA,UA++)}),e}function BA(R){if(R._status===-1){var $=R._ioInfo;$!=null&&($.start=$.end=performance.now()),$=R._result;var s=$();if(s.then(function(UA){if(R._status===0||R._status===-1){R._status=1,R._result=UA;var vA=R._ioInfo;vA!=null&&(vA.end=performance.now()),s.status===void 0&&(s.status="fulfilled",s.value=UA)}},function(UA){if(R._status===0||R._status===-1){R._status=2,R._result=UA;var vA=R._ioInfo;vA!=null&&(vA.end=performance.now()),s.status===void 0&&(s.status="rejected",s.reason=UA)}}),$=R._ioInfo,$!=null){$.value=s;var e=s.displayName;typeof e==="string"&&($.name=e)}R._status===-1&&(R._status=0,R._result=s)}if(R._status===1)return $=R._result,$===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ import{Dl as GA,Fl as sI,Gl as P7,Il as p0}from"./chunk-y8qhrx11.js";var aA=sI((J7,E8)=>{(function(){function Q(R,$){Object.defineProperty(G.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",$[0],$[1])}})}function C(R){if(R===null||typeof R!=="object")return null;return R=IB&&R[IB]||R["@@iterator"],typeof R==="function"?R:null}function F(R,$){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var s=R+"."+$;CA[s]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",$,R),CA[s]=!0)}function G(R,$,s){this.props=R,this.context=$,this.refs=VA,this.updater=s||DA}function H(){}function J(R,$,s){this.props=R,this.context=$,this.refs=VA,this.updater=s||DA}function M(){}function Y(R){return""+R}function X(R){try{Y(R);var $=!1}catch(UA){$=!0}if($){$=console;var s=$.error,e=typeof Symbol==="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return s.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",e),Y(R)}}function k(R){if(R==null)return null;if(typeof R==="function")return R.$$typeof===HI?null:R.displayName||R.name||null;if(typeof R==="string")return R;switch(R){case TA:return"Fragment";case qA:return"Profiler";case c:return"StrictMode";case qB:return"Suspense";case FB:return"SuspenseList";case _A:return"Activity"}if(typeof R==="object")switch(typeof R.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case XA:return"Portal";case AB:return R.displayName||"Context";case iA:return(R._context.displayName||"Context")+".Consumer";case ZB:var $=R.render;return R=R.displayName,R||(R=$.displayName||$.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case cB:return $=R.displayName||null,$!==null?$:k(R.type)||"Memo";case $B:$=R._payload,R=R._init;try{return k(R($))}catch(s){}}return null}function u(R){if(R===TA)return"<>";if(typeof R==="object"&&R!==null&&R.$$typeof===$B)return"<...>";try{var $=k(R);return $?"<"+$+">":"<...>"}catch(s){return"<...>"}}function p(){var R=OA.A;return R===null?null:R.getOwner()}function q(){return Error("react-stack-top-frame")}function T(R){if(oI.call(R,"key")){var $=Object.getOwnPropertyDescriptor(R,"key").get;if($&&$.isReactWarning)return!1}return R.key!==void 0}function x(R,$){function s(){qI||(qI=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}s.isReactWarning=!0,Object.defineProperty(R,"key",{get:s,configurable:!0})}function m(){var R=k(this.type);return bQ[R]||(bQ[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function _(R,$,s,e,UA,vA){var zA=s.ref;return R={$$typeof:NA,type:R,key:$,props:s,_owner:e},(zA!==void 0?zA:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:m}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:UA}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vA}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function JA(R,$){return $=_(R.type,$,R.props,R._owner,R._debugStack,R._debugTask),R._store&&($._store.validated=R._store.validated),$}function kA(R){wA(R)?R._store&&(R._store.validated=1):typeof R==="object"&&R!==null&&R.$$typeof===$B&&(R._payload.status==="fulfilled"?wA(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function wA(R){return typeof R==="object"&&R!==null&&R.$$typeof===NA}function L(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(s){return $[s]})}function y(R,$){return typeof R==="object"&&R!==null&&R.key!=null?(X(R.key),L(""+R.key)):$.toString(36)}function QA(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status==="string"?R.then(M,M):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function r(R,$,s,e,UA){var vA=typeof R;if(vA==="undefined"||vA==="boolean")R=null;var zA=!1;if(R===null)zA=!0;else switch(vA){case"bigint":case"string":case"number":zA=!0;break;case"object":switch(R.$$typeof){case NA:case XA:zA=!0;break;case $B:return zA=R._init,r(zA(R._payload),$,s,e,UA)}}if(zA){zA=R,UA=UA(zA);var EB=e===""?"."+y(zA,0):e;return XI(UA)?(s="",EB!=null&&(s=EB.replace($C,"$&/")+"/"),r(UA,$,s,"",function(EI){return EI})):UA!=null&&(wA(UA)&&(UA.key!=null&&(zA&&zA.key===UA.key||X(UA.key)),s=JA(UA,s+(UA.key==null||zA&&zA.key===UA.key?"":(""+UA.key).replace($C,"$&/")+"/")+EB),e!==""&&zA!=null&&wA(zA)&&zA.key==null&&zA._store&&!zA._store.validated&&(s._store.validated=2),UA=s),$.push(UA)),1}if(zA=0,EB=e===""?".":e+":",XI(R))for(var pA=0;pA<R.length;pA++)e=R[pA],vA=EB+y(e,pA),zA+=r(e,$,s,vA,UA);else if(pA=C(R),typeof pA==="function")for(pA===R.entries&&(UE||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),UE=!0),R=pA.call(R),pA=0;!(e=R.next()).done;)e=e.value,vA=EB+y(e,pA++),zA+=r(e,$,s,vA,UA);else if(vA==="object"){if(typeof R.then==="function")return r(QA(R),$,s,e,UA);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return zA}function EA(R,$,s){if(R==null)return R;var e=[],UA=0;return r(R,e,"","",function(vA){return $.call(s,vA,UA++)}),e}function BA(R){if(R._status===-1){var $=R._ioInfo;$!=null&&($.start=$.end=performance.now()),$=R._result;var s=$();if(s.then(function(UA){if(R._status===0||R._status===-1){R._status=1,R._result=UA;var vA=R._ioInfo;vA!=null&&(vA.end=performance.now()),s.status===void 0&&(s.status="fulfilled",s.value=UA)}},function(UA){if(R._status===0||R._status===-1){R._status=2,R._result=UA;var vA=R._ioInfo;vA!=null&&(vA.end=performance.now()),s.status===void 0&&(s.status="rejected",s.reason=UA)}}),$=R._ioInfo,$!=null){$.value=s;var e=s.displayName;typeof e==="string"&&($.name=e)}R._status===-1&&(R._status=0,R._result=s)}if(R._status===1)return $=R._result,$===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
2
 
3
3
  Your code should look like:
4
4
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -227,7 +227,7 @@ React keys must be passed directly to JSX without using spread:
227
227
  `).map((G)=>pY(G,C,F)).join(`
228
228
  `)}import YD from"node:process";import{execFileSync as cY}from"node:child_process";import o0 from"node:fs";import dY from"node:tty";var XR=80,qR=24,QH=(Q,C,{shell:F,env:G}={})=>cY(Q,C,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:F,env:G}).trim(),L8=(Q,C)=>({columns:Number.parseInt(Q,10),rows:Number.parseInt(C,10)}),WR=(Q,C)=>{let{columns:F,rows:G}=L8(Q,C);if(Number.isNaN(F)||Number.isNaN(G))return;if(F===XR&&G===qR)return;return{columns:F,rows:G}},lY=()=>{if(YD.platform!=="linux")return!0;try{let Q=o0.readFileSync("/proc/self/stat","utf8"),C=Q.lastIndexOf(") ");if(C===-1)return!1;let F=Q.slice(C+2).trim().split(/\s+/),G=Number.parseInt(F[2],10),H=Number.parseInt(F[5],10);if(Number.isNaN(G)||Number.isNaN(H))return!1;if(H<=0)return!1;return G===H}catch{return!1}};function EH(){let{env:Q,stdout:C,stderr:F}=YD;if(C?.columns&&C?.rows)return L8(C.columns,C.rows);if(F?.columns&&F?.rows)return L8(F.columns,F.rows);if(Q.COLUMNS&&Q.LINES)return L8(Q.COLUMNS,Q.LINES);let G={columns:XR,rows:qR};if(YD.platform==="win32")return IH()??G;if(YD.platform==="darwin")return LR()??IH()??G;return LR()??IH()??aY()??G}var LR=()=>{try{let Q=YD.platform==="darwin"?o0.constants.O_EVTONLY|o0.constants.O_NONBLOCK:o0.constants.O_NONBLOCK,{columns:C,rows:F}=dY.WriteStream(o0.openSync("/dev/tty",Q));return{columns:C,rows:F}}catch{}},IH=()=>{try{let Q=QH("tput",["cols"],{env:{TERM:"dumb",...YD.env}}),C=QH("tput",["lines"],{env:{TERM:"dumb",...YD.env}});if(Q&&C)return WR(Q,C)}catch{}},aY=()=>{try{if(!lY())return;let Q=QH("resize",["-u"]).match(/\d+/g);if(Q.length===2)return WR(Q[0],Q[1])}catch{}};import iY from"node:process";var n0=()=>iY.env.DEV==="true";var xR=GA(OR(),1),QF=GA(J8(),1),OC=GA(CH(),1);var mR=GA(aA(),1);var oY=new Intl.Segmenter,nY=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,rY=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,tY=/^\p{RGI_Emoji}$/v,eY=/^[\d#*]\u20E3$/,A5=/\p{Extended_Pictographic}/gu;function B5(Q){if(Q.length>50)return!1;if(eY.test(Q))return!0;if(Q.includes("‍")){let C=Q.match(A5);return C!==null&&C.length>=2}return!1}function I5(Q){return Q.replace(rY,"")}function Q5(Q){return nY.test(Q)}function E5(Q,C){let F=0;if(Q.length>1){for(let G of Q.slice(1))if(G>="＀"&&G<="￯")F+=i0(G.codePointAt(0),C)}return F}function wE(Q,C={}){if(typeof Q!=="string"||Q.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:G=!1}=C,H=Q;if(!G&&(H.includes("\x1B")||H.includes("›")))H=KD(H);if(H.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(H))return H.length;let J=0,M={ambiguousAsWide:!F};for(let{segment:Y}of oY.segment(H)){if(Q5(Y))continue;if(tY.test(Y)||B5(Y)){J+=2;continue}let X=I5(Y).codePointAt(0);J+=i0(X,M),J+=E5(Y,M)}return J}function t0(Q){let C=0;for(let F of Q.split(`
229
229
  `))C=Math.max(C,wE(F));return C}var zR=new Map,C5=(Q)=>{if(Q.length===0)return{width:0,height:0};let C=zR.get(Q);if(C)return C;let F=t0(Q),G=Q.split(`
230
- `).length,H={width:F,height:G};return zR.set(Q,H),H},gH=C5;function WC(Q){if(!Number.isInteger(Q))return!1;return l0(Q)||a0(Q)}var D5=new Set([27,155]),g5="0".codePointAt(0),F5="9".codePointAt(0),G5=19,GH=new Set,FH=new Map;for(let[Q,C]of DB.codes)GH.add(DB.color.ansi(C)),FH.set(DB.color.ansi(Q),DB.color.ansi(C));function w5(Q){if(GH.has(Q))return Q;if(FH.has(Q))return FH.get(Q);if(Q=Q.slice(2),Q.includes(";"))Q=Q[0]+"0";let C=DB.codes.get(Number.parseInt(Q,10));if(C)return DB.color.ansi(C);return DB.reset.open}function H5(Q){for(let C=0;C<Q.length;C++){let F=Q.codePointAt(C);if(F>=g5&&F<=F5)return C}return-1}function U5(Q,C){Q=Q.slice(C,C+G5);let F=H5(Q);if(F!==-1){let G=Q.indexOf("m",F);if(G===-1)G=Q.length;return Q.slice(0,G+1)}}function J5(Q,C=Number.POSITIVE_INFINITY){let F=[],G=0,H=0;while(G<Q.length){let J=Q.codePointAt(G);if(D5.has(J)){let X=U5(Q,G);if(X){F.push({type:"ansi",code:X,endCode:w5(X)}),G+=X.length;continue}}let M=WC(J),Y=String.fromCodePoint(J);if(F.push({type:"character",value:Y,isFullWidth:M}),G+=Y.length,H+=M?2:Y.length,H>=C)break}return F}function SR(Q){let C=[];for(let F of Q)if(F.code===DB.reset.open)C=[];else if(GH.has(F.code))C=C.filter((G)=>G.endCode!==F.code);else C=C.filter((G)=>G.endCode!==F.endCode),C.push(F);return C}function M5(Q){return SR(Q).map(({endCode:G})=>G).reverse().join("")}function HE(Q,C,F){let G=J5(Q,F),H=[],J=0,M="",Y=!1;for(let X of G){if(F!==void 0&&J>=F)break;if(X.type==="ansi"){if(H.push(X),Y)M+=X.code}else{if(!Y&&J>=C)Y=!0,H=SR(H),M=H.map(({code:k})=>k).join("");if(Y)M+=X.value;J+=X.isFullWidth?2:X.value.length}}return M+=M5(H),M}function X8(Q,C,F){if(Q.charAt(C)===" ")return C;let G=F?1:-1;for(let H=0;H<=3;H++){let J=C+H*G;if(Q.charAt(J)===" ")return J}return C}function wH(Q,C,F={}){let{position:G="end",space:H=!1,preferTruncationOnSpace:J=!1}=F,{truncationCharacter:M="…"}=F;if(typeof Q!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof Q}`);if(typeof C!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof C}`);if(C<1)return"";let Y=wE(Q);if(Y<=C)return Q;if(C===1)return M;let X={ESC:27,LEFT_BRACKET:91,LETTER_M:109},k=(x)=>x>=48&&x<=57||x===59;function u(x){let m=0;while(m+2<x.length&&x.codePointAt(m)===X.ESC&&x.codePointAt(m+1)===X.LEFT_BRACKET){let _=m+2;while(_<x.length&&k(x.codePointAt(_)))_++;if(_<x.length&&x.codePointAt(_)===X.LETTER_M){m=_+1;continue}break}return m}function p(x){let m=x.length;while(m>1&&x.codePointAt(m-1)===X.LETTER_M){let _=m-2;while(_>=0&&k(x.codePointAt(_)))_--;if(_>=1&&x.codePointAt(_-1)===X.ESC&&x.codePointAt(_)===X.LEFT_BRACKET){m=_-1;continue}break}return m}function q(x,m){let _=p(x);if(_===x.length)return x+m;return x.slice(0,_)+m+x.slice(_)}function T(x,m){let _=u(m);if(_===0)return x+m;return m.slice(0,_)+x+m.slice(_)}if(G==="start"){if(J){let m=X8(Q,Y-C+1,!0),_=HE(Q,m,Y).trim();return T(M,_)}if(H)M+=" ";let x=HE(Q,Y-C+wE(M),Y);return T(M,x)}if(G==="middle"){if(H)M=` ${M} `;let x=Math.floor(C/2);if(J){let m=X8(Q,x),_=X8(Q,Y-(C-x)+1,!0);return HE(Q,0,m)+M+HE(Q,_,Y).trim()}return HE(Q,0,x)+M+HE(Q,Y-(C-x)+wE(M),Y)}if(G==="end"){if(J){let m=X8(Q,C-1),_=HE(Q,0,m);return q(_,M)}if(H)M=` ${M}`;let x=HE(Q,0,C-wE(M));return q(x,M)}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${G}`)}var kR={},R5=(Q,C,F)=>{let G=Q+String(C)+String(F),H=kR[G];if(H)return H;let J=Q;if(F==="wrap")J=s0(Q,C,{trim:!1,hard:!0});if(F.startsWith("truncate")){let M="end";if(F==="truncate-middle")M="middle";if(F==="truncate-start")M="start";J=wH(Q,C,{position:M})}return kR[G]=J,J},q8=R5;var K5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=48&&C<=63},N5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=32&&C<=47},Y5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=64&&C<=126},jR=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=32&&C<=47},Z5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=48&&C<=126},TR=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=128&&C<=159},VR=(Q,C)=>{let F=C;while(F<Q.length){let Y=Q[F];if(!K5(Y))break;F++}let G=Q.slice(C,F),H=F;while(F<Q.length){let Y=Q[F];if(!N5(Y))break;F++}let J=Q.slice(H,F),M=Q[F];if(M===void 0||!Y5(M))return;return{endIndex:F+1,parameterString:G,intermediateString:J,finalCharacter:M}},$R=(Q,C,F)=>{for(let G=C;G<Q.length;G++){let H=Q[G];if(F&&H==="\x07")return G+1;if(H==="œ")return G+1;if(H==="\x1B"){let J=Q[G+1];if(J==="\x1B"){G++;continue}if(J==="\\")return G+2}}return},L5=(Q,C)=>{let F=C;while(F<Q.length){let J=Q[F];if(!jR(J))break;F++}let G=Q.slice(C,F),H=Q[F];if(H===void 0||!Z5(H))return;return{endIndex:F+1,intermediateString:G,finalCharacter:H}},X5=(Q)=>{switch(Q){case"]":return{type:"osc",allowBellTerminator:!0};case"P":return{type:"dcs",allowBellTerminator:!1};case"^":return{type:"pm",allowBellTerminator:!1};case"_":return{type:"apc",allowBellTerminator:!1};case"X":return{type:"sos",allowBellTerminator:!1};default:return}},q5=(Q)=>{switch(Q){case"":return{type:"osc",allowBellTerminator:!0};case"":return{type:"dcs",allowBellTerminator:!1};case"ž":return{type:"pm",allowBellTerminator:!1};case"Ÿ":return{type:"apc",allowBellTerminator:!1};case"˜":return{type:"sos",allowBellTerminator:!1};default:return}},HH=(Q)=>{if(Q.includes("\x1B"))return!0;for(let C of Q)if(TR(C))return!0;return!1},Sg=(Q,C,F,G)=>{if(G>F)Q.push({type:"text",value:C.slice(F,G)});return Q.push({type:"invalid",value:C.slice(G)}),Q},yR=(Q)=>{if(!HH(Q))return[{type:"text",value:Q}];let C=[],F=0;for(let G=0;G<Q.length;){let H=Q[G];if(H===void 0)break;if(H==="\x1B"){let M=Q[G+1];if(M===void 0)return Sg(C,Q,F,G);if(M==="["){let k=VR(Q,G+2);if(k===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"csi",value:Q.slice(G,k.endIndex),parameterString:k.parameterString,intermediateString:k.intermediateString,finalCharacter:k.finalCharacter}),G=k.endIndex,F=G;continue}let Y=X5(M);if(Y!==void 0){let k=$R(Q,G+2,Y.allowBellTerminator);if(k===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:Y.type,value:Q.slice(G,k)}),G=k,F=G;continue}let X=L5(Q,G+1);if(X===void 0){if(jR(M))return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});G++,F=G;continue}if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"esc",value:Q.slice(G,X.endIndex),intermediateString:X.intermediateString,finalCharacter:X.finalCharacter}),G=X.endIndex,F=G;continue}if(H==="›"){let M=VR(Q,G+1);if(M===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"csi",value:Q.slice(G,M.endIndex),parameterString:M.parameterString,intermediateString:M.intermediateString,finalCharacter:M.finalCharacter}),G=M.endIndex,F=G;continue}let J=q5(H);if(J!==void 0){let M=$R(Q,G+1,J.allowBellTerminator);if(M===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:J.type,value:Q.slice(G,M)}),G=M,F=G;continue}if(H==="œ"){if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"st",value:H}),G++,F=G;continue}if(TR(H)){if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"c1",value:H}),G++,F=G;continue}G++}if(F<Q.length)C.push({type:"text",value:Q.slice(F)});return C};var W5=/^[\d:;]*$/,O5=(Q)=>{if(!HH(Q))return Q;let C="";for(let F of yR(Q)){if(F.type==="text"||F.type==="osc"){C+=F.value;continue}if(F.type==="csi"&&F.finalCharacter==="m"&&F.intermediateString===""&&W5.test(F.parameterString))C+=F.value}return C},PR=O5;var _R=(Q)=>{let C="";for(let F=0;F<Q.childNodes.length;F++){let G=Q.childNodes[F];if(G===void 0)continue;let H="";if(G.nodeName==="#text")H=G.nodeValue;else{if(G.nodeName==="ink-text"||G.nodeName==="ink-virtual-text")H=_R(G);if(H.length>0&&typeof G.internal_transform==="function")H=G.internal_transform(H,F)}C+=H}return PR(C)},e0=_R;var AF=(Q)=>{let C={nodeName:Q,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:Q==="ink-virtual-text"?void 0:RA.Node.create(),internal_accessibility:{}};if(Q==="ink-text")C.yogaNode?.setMeasureFunc(z5.bind(null,C));return C},W8=(Q,C)=>{if(C.parentNode)BF(C.parentNode,C);if(C.parentNode=Q,Q.childNodes.push(C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,Q.yogaNode.getChildCount());if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},UH=(Q,C,F)=>{if(C.parentNode)BF(C.parentNode,C);C.parentNode=Q;let G=Q.childNodes.indexOf(F);if(G>=0){if(Q.childNodes.splice(G,0,C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,G)}else if(Q.childNodes.push(C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,Q.yogaNode.getChildCount());if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},BF=(Q,C)=>{if(C.yogaNode)C.parentNode?.yogaNode?.removeChild(C.yogaNode);C.parentNode=void 0;let F=Q.childNodes.indexOf(C);if(F>=0)Q.childNodes.splice(F,1);if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},JH=(Q,C,F)=>{if(C==="internal_accessibility"){Q.internal_accessibility=F;return}Q.attributes[C]=F},MH=(Q,C)=>{Q.style=C},uR=(Q)=>{let C={nodeName:"#text",nodeValue:Q,yogaNode:void 0,parentNode:void 0,style:{}};return IF(C,Q),C},z5=function(Q,C){let F=Q.nodeName==="#text"?Q.nodeValue:e0(Q),G=gH(F);if(G.width<=C)return G;if(G.width>=1&&C>0&&C<1)return G;let H=Q.style?.textWrap??"wrap",J=q8(F,C,H);return gH(J)},hR=(Q)=>{if(!Q?.parentNode)return;return Q.yogaNode??hR(Q.parentNode)},O8=(Q)=>{hR(Q)?.markDirty()},IF=(Q,C)=>{if(typeof C!=="string")C=String(C);Q.nodeValue=C,O8(Q)};var k5=(Q,C)=>{if("position"in C)Q.setPositionType(C.position==="absolute"?RA.POSITION_TYPE_ABSOLUTE:RA.POSITION_TYPE_RELATIVE)},V5=(Q,C)=>{if("margin"in C)Q.setMargin(RA.EDGE_ALL,C.margin??0);if("marginX"in C)Q.setMargin(RA.EDGE_HORIZONTAL,C.marginX??0);if("marginY"in C)Q.setMargin(RA.EDGE_VERTICAL,C.marginY??0);if("marginLeft"in C)Q.setMargin(RA.EDGE_START,C.marginLeft||0);if("marginRight"in C)Q.setMargin(RA.EDGE_END,C.marginRight||0);if("marginTop"in C)Q.setMargin(RA.EDGE_TOP,C.marginTop||0);if("marginBottom"in C)Q.setMargin(RA.EDGE_BOTTOM,C.marginBottom||0)},$5=(Q,C)=>{if("padding"in C)Q.setPadding(RA.EDGE_ALL,C.padding??0);if("paddingX"in C)Q.setPadding(RA.EDGE_HORIZONTAL,C.paddingX??0);if("paddingY"in C)Q.setPadding(RA.EDGE_VERTICAL,C.paddingY??0);if("paddingLeft"in C)Q.setPadding(RA.EDGE_LEFT,C.paddingLeft||0);if("paddingRight"in C)Q.setPadding(RA.EDGE_RIGHT,C.paddingRight||0);if("paddingTop"in C)Q.setPadding(RA.EDGE_TOP,C.paddingTop||0);if("paddingBottom"in C)Q.setPadding(RA.EDGE_BOTTOM,C.paddingBottom||0)},j5=(Q,C)=>{if("flexGrow"in C)Q.setFlexGrow(C.flexGrow??0);if("flexShrink"in C)Q.setFlexShrink(typeof C.flexShrink==="number"?C.flexShrink:1);if("flexWrap"in C){if(C.flexWrap==="nowrap")Q.setFlexWrap(RA.WRAP_NO_WRAP);if(C.flexWrap==="wrap")Q.setFlexWrap(RA.WRAP_WRAP);if(C.flexWrap==="wrap-reverse")Q.setFlexWrap(RA.WRAP_WRAP_REVERSE)}if("flexDirection"in C){if(C.flexDirection==="row")Q.setFlexDirection(RA.FLEX_DIRECTION_ROW);if(C.flexDirection==="row-reverse")Q.setFlexDirection(RA.FLEX_DIRECTION_ROW_REVERSE);if(C.flexDirection==="column")Q.setFlexDirection(RA.FLEX_DIRECTION_COLUMN);if(C.flexDirection==="column-reverse")Q.setFlexDirection(RA.FLEX_DIRECTION_COLUMN_REVERSE)}if("flexBasis"in C)if(typeof C.flexBasis==="number")Q.setFlexBasis(C.flexBasis);else if(typeof C.flexBasis==="string")Q.setFlexBasisPercent(Number.parseInt(C.flexBasis,10));else Q.setFlexBasis(Number.NaN);if("alignItems"in C){if(C.alignItems==="stretch"||!C.alignItems)Q.setAlignItems(RA.ALIGN_STRETCH);if(C.alignItems==="flex-start")Q.setAlignItems(RA.ALIGN_FLEX_START);if(C.alignItems==="center")Q.setAlignItems(RA.ALIGN_CENTER);if(C.alignItems==="flex-end")Q.setAlignItems(RA.ALIGN_FLEX_END)}if("alignSelf"in C){if(C.alignSelf==="auto"||!C.alignSelf)Q.setAlignSelf(RA.ALIGN_AUTO);if(C.alignSelf==="flex-start")Q.setAlignSelf(RA.ALIGN_FLEX_START);if(C.alignSelf==="center")Q.setAlignSelf(RA.ALIGN_CENTER);if(C.alignSelf==="flex-end")Q.setAlignSelf(RA.ALIGN_FLEX_END)}if("justifyContent"in C){if(C.justifyContent==="flex-start"||!C.justifyContent)Q.setJustifyContent(RA.JUSTIFY_FLEX_START);if(C.justifyContent==="center")Q.setJustifyContent(RA.JUSTIFY_CENTER);if(C.justifyContent==="flex-end")Q.setJustifyContent(RA.JUSTIFY_FLEX_END);if(C.justifyContent==="space-between")Q.setJustifyContent(RA.JUSTIFY_SPACE_BETWEEN);if(C.justifyContent==="space-around")Q.setJustifyContent(RA.JUSTIFY_SPACE_AROUND);if(C.justifyContent==="space-evenly")Q.setJustifyContent(RA.JUSTIFY_SPACE_EVENLY)}},T5=(Q,C)=>{if("width"in C)if(typeof C.width==="number")Q.setWidth(C.width);else if(typeof C.width==="string")Q.setWidthPercent(Number.parseInt(C.width,10));else Q.setWidthAuto();if("height"in C)if(typeof C.height==="number")Q.setHeight(C.height);else if(typeof C.height==="string")Q.setHeightPercent(Number.parseInt(C.height,10));else Q.setHeightAuto();if("minWidth"in C)if(typeof C.minWidth==="string")Q.setMinWidthPercent(Number.parseInt(C.minWidth,10));else Q.setMinWidth(C.minWidth??0);if("minHeight"in C)if(typeof C.minHeight==="string")Q.setMinHeightPercent(Number.parseInt(C.minHeight,10));else Q.setMinHeight(C.minHeight??0)},y5=(Q,C)=>{if("display"in C)Q.setDisplay(C.display==="flex"?RA.DISPLAY_FLEX:RA.DISPLAY_NONE)},P5=(Q,C)=>{if("borderStyle"in C){let F=C.borderStyle?1:0;if(C.borderTop!==!1)Q.setBorder(RA.EDGE_TOP,F);if(C.borderBottom!==!1)Q.setBorder(RA.EDGE_BOTTOM,F);if(C.borderLeft!==!1)Q.setBorder(RA.EDGE_LEFT,F);if(C.borderRight!==!1)Q.setBorder(RA.EDGE_RIGHT,F)}},_5=(Q,C)=>{if("gap"in C)Q.setGap(RA.GUTTER_ALL,C.gap??0);if("columnGap"in C)Q.setGap(RA.GUTTER_COLUMN,C.columnGap??0);if("rowGap"in C)Q.setGap(RA.GUTTER_ROW,C.rowGap??0)},u5=(Q,C={})=>{k5(Q,C),V5(Q,C),$5(Q,C),j5(Q,C),T5(Q,C),y5(Q,C),P5(Q,C),_5(Q,C)},RH=u5;if(n0())try{await import("./chunk-j4y5rjne.js")}catch(Q){if(Q.code==="ERR_MODULE_NOT_FOUND")console.warn(`
230
+ `).length,H={width:F,height:G};return zR.set(Q,H),H},gH=C5;function WC(Q){if(!Number.isInteger(Q))return!1;return l0(Q)||a0(Q)}var D5=new Set([27,155]),g5="0".codePointAt(0),F5="9".codePointAt(0),G5=19,GH=new Set,FH=new Map;for(let[Q,C]of DB.codes)GH.add(DB.color.ansi(C)),FH.set(DB.color.ansi(Q),DB.color.ansi(C));function w5(Q){if(GH.has(Q))return Q;if(FH.has(Q))return FH.get(Q);if(Q=Q.slice(2),Q.includes(";"))Q=Q[0]+"0";let C=DB.codes.get(Number.parseInt(Q,10));if(C)return DB.color.ansi(C);return DB.reset.open}function H5(Q){for(let C=0;C<Q.length;C++){let F=Q.codePointAt(C);if(F>=g5&&F<=F5)return C}return-1}function U5(Q,C){Q=Q.slice(C,C+G5);let F=H5(Q);if(F!==-1){let G=Q.indexOf("m",F);if(G===-1)G=Q.length;return Q.slice(0,G+1)}}function J5(Q,C=Number.POSITIVE_INFINITY){let F=[],G=0,H=0;while(G<Q.length){let J=Q.codePointAt(G);if(D5.has(J)){let X=U5(Q,G);if(X){F.push({type:"ansi",code:X,endCode:w5(X)}),G+=X.length;continue}}let M=WC(J),Y=String.fromCodePoint(J);if(F.push({type:"character",value:Y,isFullWidth:M}),G+=Y.length,H+=M?2:Y.length,H>=C)break}return F}function SR(Q){let C=[];for(let F of Q)if(F.code===DB.reset.open)C=[];else if(GH.has(F.code))C=C.filter((G)=>G.endCode!==F.code);else C=C.filter((G)=>G.endCode!==F.endCode),C.push(F);return C}function M5(Q){return SR(Q).map(({endCode:G})=>G).reverse().join("")}function HE(Q,C,F){let G=J5(Q,F),H=[],J=0,M="",Y=!1;for(let X of G){if(F!==void 0&&J>=F)break;if(X.type==="ansi"){if(H.push(X),Y)M+=X.code}else{if(!Y&&J>=C)Y=!0,H=SR(H),M=H.map(({code:k})=>k).join("");if(Y)M+=X.value;J+=X.isFullWidth?2:X.value.length}}return M+=M5(H),M}function X8(Q,C,F){if(Q.charAt(C)===" ")return C;let G=F?1:-1;for(let H=0;H<=3;H++){let J=C+H*G;if(Q.charAt(J)===" ")return J}return C}function wH(Q,C,F={}){let{position:G="end",space:H=!1,preferTruncationOnSpace:J=!1}=F,{truncationCharacter:M="…"}=F;if(typeof Q!=="string")throw TypeError(`Expected \`input\` to be a string, got ${typeof Q}`);if(typeof C!=="number")throw TypeError(`Expected \`columns\` to be a number, got ${typeof C}`);if(C<1)return"";let Y=wE(Q);if(Y<=C)return Q;if(C===1)return M;let X={ESC:27,LEFT_BRACKET:91,LETTER_M:109},k=(x)=>x>=48&&x<=57||x===59;function u(x){let m=0;while(m+2<x.length&&x.codePointAt(m)===X.ESC&&x.codePointAt(m+1)===X.LEFT_BRACKET){let _=m+2;while(_<x.length&&k(x.codePointAt(_)))_++;if(_<x.length&&x.codePointAt(_)===X.LETTER_M){m=_+1;continue}break}return m}function p(x){let m=x.length;while(m>1&&x.codePointAt(m-1)===X.LETTER_M){let _=m-2;while(_>=0&&k(x.codePointAt(_)))_--;if(_>=1&&x.codePointAt(_-1)===X.ESC&&x.codePointAt(_)===X.LEFT_BRACKET){m=_-1;continue}break}return m}function q(x,m){let _=p(x);if(_===x.length)return x+m;return x.slice(0,_)+m+x.slice(_)}function T(x,m){let _=u(m);if(_===0)return x+m;return m.slice(0,_)+x+m.slice(_)}if(G==="start"){if(J){let m=X8(Q,Y-C+1,!0),_=HE(Q,m,Y).trim();return T(M,_)}if(H)M+=" ";let x=HE(Q,Y-C+wE(M),Y);return T(M,x)}if(G==="middle"){if(H)M=` ${M} `;let x=Math.floor(C/2);if(J){let m=X8(Q,x),_=X8(Q,Y-(C-x)+1,!0);return HE(Q,0,m)+M+HE(Q,_,Y).trim()}return HE(Q,0,x)+M+HE(Q,Y-(C-x)+wE(M),Y)}if(G==="end"){if(J){let m=X8(Q,C-1),_=HE(Q,0,m);return q(_,M)}if(H)M=` ${M}`;let x=HE(Q,0,C-wE(M));return q(x,M)}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${G}`)}var kR={},R5=(Q,C,F)=>{let G=Q+String(C)+String(F),H=kR[G];if(H)return H;let J=Q;if(F==="wrap")J=s0(Q,C,{trim:!1,hard:!0});if(F.startsWith("truncate")){let M="end";if(F==="truncate-middle")M="middle";if(F==="truncate-start")M="start";J=wH(Q,C,{position:M})}return kR[G]=J,J},q8=R5;var K5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=48&&C<=63},N5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=32&&C<=47},Y5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=64&&C<=126},jR=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=32&&C<=47},Z5=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=48&&C<=126},TR=(Q)=>{let C=Q.codePointAt(0);return C!==void 0&&C>=128&&C<=159},VR=(Q,C)=>{let F=C;while(F<Q.length){let Y=Q[F];if(!K5(Y))break;F++}let G=Q.slice(C,F),H=F;while(F<Q.length){let Y=Q[F];if(!N5(Y))break;F++}let J=Q.slice(H,F),M=Q[F];if(M===void 0||!Y5(M))return;return{endIndex:F+1,parameterString:G,intermediateString:J,finalCharacter:M}},$R=(Q,C,F)=>{for(let G=C;G<Q.length;G++){let H=Q[G];if(F&&H==="\x07")return G+1;if(H==="œ")return G+1;if(H==="\x1B"){let J=Q[G+1];if(J==="\x1B"){G++;continue}if(J==="\\")return G+2}}return},L5=(Q,C)=>{let F=C;while(F<Q.length){let J=Q[F];if(!jR(J))break;F++}let G=Q.slice(C,F),H=Q[F];if(H===void 0||!Z5(H))return;return{endIndex:F+1,intermediateString:G,finalCharacter:H}},X5=(Q)=>{switch(Q){case"]":return{type:"osc",allowBellTerminator:!0};case"P":return{type:"dcs",allowBellTerminator:!1};case"^":return{type:"pm",allowBellTerminator:!1};case"_":return{type:"apc",allowBellTerminator:!1};case"X":return{type:"sos",allowBellTerminator:!1};default:return}},q5=(Q)=>{switch(Q){case"":return{type:"osc",allowBellTerminator:!0};case"":return{type:"dcs",allowBellTerminator:!1};case"ž":return{type:"pm",allowBellTerminator:!1};case"Ÿ":return{type:"apc",allowBellTerminator:!1};case"˜":return{type:"sos",allowBellTerminator:!1};default:return}},HH=(Q)=>{if(Q.includes("\x1B"))return!0;for(let C of Q)if(TR(C))return!0;return!1},Sg=(Q,C,F,G)=>{if(G>F)Q.push({type:"text",value:C.slice(F,G)});return Q.push({type:"invalid",value:C.slice(G)}),Q},yR=(Q)=>{if(!HH(Q))return[{type:"text",value:Q}];let C=[],F=0;for(let G=0;G<Q.length;){let H=Q[G];if(H===void 0)break;if(H==="\x1B"){let M=Q[G+1];if(M===void 0)return Sg(C,Q,F,G);if(M==="["){let k=VR(Q,G+2);if(k===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"csi",value:Q.slice(G,k.endIndex),parameterString:k.parameterString,intermediateString:k.intermediateString,finalCharacter:k.finalCharacter}),G=k.endIndex,F=G;continue}let Y=X5(M);if(Y!==void 0){let k=$R(Q,G+2,Y.allowBellTerminator);if(k===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:Y.type,value:Q.slice(G,k)}),G=k,F=G;continue}let X=L5(Q,G+1);if(X===void 0){if(jR(M))return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});G++,F=G;continue}if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"esc",value:Q.slice(G,X.endIndex),intermediateString:X.intermediateString,finalCharacter:X.finalCharacter}),G=X.endIndex,F=G;continue}if(H==="›"){let M=VR(Q,G+1);if(M===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"csi",value:Q.slice(G,M.endIndex),parameterString:M.parameterString,intermediateString:M.intermediateString,finalCharacter:M.finalCharacter}),G=M.endIndex,F=G;continue}let J=q5(H);if(J!==void 0){let M=$R(Q,G+1,J.allowBellTerminator);if(M===void 0)return Sg(C,Q,F,G);if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:J.type,value:Q.slice(G,M)}),G=M,F=G;continue}if(H==="œ"){if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"st",value:H}),G++,F=G;continue}if(TR(H)){if(G>F)C.push({type:"text",value:Q.slice(F,G)});C.push({type:"c1",value:H}),G++,F=G;continue}G++}if(F<Q.length)C.push({type:"text",value:Q.slice(F)});return C};var W5=/^[\d:;]*$/,O5=(Q)=>{if(!HH(Q))return Q;let C="";for(let F of yR(Q)){if(F.type==="text"||F.type==="osc"){C+=F.value;continue}if(F.type==="csi"&&F.finalCharacter==="m"&&F.intermediateString===""&&W5.test(F.parameterString))C+=F.value}return C},PR=O5;var _R=(Q)=>{let C="";for(let F=0;F<Q.childNodes.length;F++){let G=Q.childNodes[F];if(G===void 0)continue;let H="";if(G.nodeName==="#text")H=G.nodeValue;else{if(G.nodeName==="ink-text"||G.nodeName==="ink-virtual-text")H=_R(G);if(H.length>0&&typeof G.internal_transform==="function")H=G.internal_transform(H,F)}C+=H}return PR(C)},e0=_R;var AF=(Q)=>{let C={nodeName:Q,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:Q==="ink-virtual-text"?void 0:RA.Node.create(),internal_accessibility:{}};if(Q==="ink-text")C.yogaNode?.setMeasureFunc(z5.bind(null,C));return C},W8=(Q,C)=>{if(C.parentNode)BF(C.parentNode,C);if(C.parentNode=Q,Q.childNodes.push(C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,Q.yogaNode.getChildCount());if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},UH=(Q,C,F)=>{if(C.parentNode)BF(C.parentNode,C);C.parentNode=Q;let G=Q.childNodes.indexOf(F);if(G>=0){if(Q.childNodes.splice(G,0,C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,G)}else if(Q.childNodes.push(C),C.yogaNode)Q.yogaNode?.insertChild(C.yogaNode,Q.yogaNode.getChildCount());if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},BF=(Q,C)=>{if(C.yogaNode)C.parentNode?.yogaNode?.removeChild(C.yogaNode);C.parentNode=void 0;let F=Q.childNodes.indexOf(C);if(F>=0)Q.childNodes.splice(F,1);if(Q.nodeName==="ink-text"||Q.nodeName==="ink-virtual-text")O8(Q)},JH=(Q,C,F)=>{if(C==="internal_accessibility"){Q.internal_accessibility=F;return}Q.attributes[C]=F},MH=(Q,C)=>{Q.style=C},uR=(Q)=>{let C={nodeName:"#text",nodeValue:Q,yogaNode:void 0,parentNode:void 0,style:{}};return IF(C,Q),C},z5=function(Q,C){let F=Q.nodeName==="#text"?Q.nodeValue:e0(Q),G=gH(F);if(G.width<=C)return G;if(G.width>=1&&C>0&&C<1)return G;let H=Q.style?.textWrap??"wrap",J=q8(F,C,H);return gH(J)},hR=(Q)=>{if(!Q?.parentNode)return;return Q.yogaNode??hR(Q.parentNode)},O8=(Q)=>{hR(Q)?.markDirty()},IF=(Q,C)=>{if(typeof C!=="string")C=String(C);Q.nodeValue=C,O8(Q)};var k5=(Q,C)=>{if("position"in C)Q.setPositionType(C.position==="absolute"?RA.POSITION_TYPE_ABSOLUTE:RA.POSITION_TYPE_RELATIVE)},V5=(Q,C)=>{if("margin"in C)Q.setMargin(RA.EDGE_ALL,C.margin??0);if("marginX"in C)Q.setMargin(RA.EDGE_HORIZONTAL,C.marginX??0);if("marginY"in C)Q.setMargin(RA.EDGE_VERTICAL,C.marginY??0);if("marginLeft"in C)Q.setMargin(RA.EDGE_START,C.marginLeft||0);if("marginRight"in C)Q.setMargin(RA.EDGE_END,C.marginRight||0);if("marginTop"in C)Q.setMargin(RA.EDGE_TOP,C.marginTop||0);if("marginBottom"in C)Q.setMargin(RA.EDGE_BOTTOM,C.marginBottom||0)},$5=(Q,C)=>{if("padding"in C)Q.setPadding(RA.EDGE_ALL,C.padding??0);if("paddingX"in C)Q.setPadding(RA.EDGE_HORIZONTAL,C.paddingX??0);if("paddingY"in C)Q.setPadding(RA.EDGE_VERTICAL,C.paddingY??0);if("paddingLeft"in C)Q.setPadding(RA.EDGE_LEFT,C.paddingLeft||0);if("paddingRight"in C)Q.setPadding(RA.EDGE_RIGHT,C.paddingRight||0);if("paddingTop"in C)Q.setPadding(RA.EDGE_TOP,C.paddingTop||0);if("paddingBottom"in C)Q.setPadding(RA.EDGE_BOTTOM,C.paddingBottom||0)},j5=(Q,C)=>{if("flexGrow"in C)Q.setFlexGrow(C.flexGrow??0);if("flexShrink"in C)Q.setFlexShrink(typeof C.flexShrink==="number"?C.flexShrink:1);if("flexWrap"in C){if(C.flexWrap==="nowrap")Q.setFlexWrap(RA.WRAP_NO_WRAP);if(C.flexWrap==="wrap")Q.setFlexWrap(RA.WRAP_WRAP);if(C.flexWrap==="wrap-reverse")Q.setFlexWrap(RA.WRAP_WRAP_REVERSE)}if("flexDirection"in C){if(C.flexDirection==="row")Q.setFlexDirection(RA.FLEX_DIRECTION_ROW);if(C.flexDirection==="row-reverse")Q.setFlexDirection(RA.FLEX_DIRECTION_ROW_REVERSE);if(C.flexDirection==="column")Q.setFlexDirection(RA.FLEX_DIRECTION_COLUMN);if(C.flexDirection==="column-reverse")Q.setFlexDirection(RA.FLEX_DIRECTION_COLUMN_REVERSE)}if("flexBasis"in C)if(typeof C.flexBasis==="number")Q.setFlexBasis(C.flexBasis);else if(typeof C.flexBasis==="string")Q.setFlexBasisPercent(Number.parseInt(C.flexBasis,10));else Q.setFlexBasis(Number.NaN);if("alignItems"in C){if(C.alignItems==="stretch"||!C.alignItems)Q.setAlignItems(RA.ALIGN_STRETCH);if(C.alignItems==="flex-start")Q.setAlignItems(RA.ALIGN_FLEX_START);if(C.alignItems==="center")Q.setAlignItems(RA.ALIGN_CENTER);if(C.alignItems==="flex-end")Q.setAlignItems(RA.ALIGN_FLEX_END)}if("alignSelf"in C){if(C.alignSelf==="auto"||!C.alignSelf)Q.setAlignSelf(RA.ALIGN_AUTO);if(C.alignSelf==="flex-start")Q.setAlignSelf(RA.ALIGN_FLEX_START);if(C.alignSelf==="center")Q.setAlignSelf(RA.ALIGN_CENTER);if(C.alignSelf==="flex-end")Q.setAlignSelf(RA.ALIGN_FLEX_END)}if("justifyContent"in C){if(C.justifyContent==="flex-start"||!C.justifyContent)Q.setJustifyContent(RA.JUSTIFY_FLEX_START);if(C.justifyContent==="center")Q.setJustifyContent(RA.JUSTIFY_CENTER);if(C.justifyContent==="flex-end")Q.setJustifyContent(RA.JUSTIFY_FLEX_END);if(C.justifyContent==="space-between")Q.setJustifyContent(RA.JUSTIFY_SPACE_BETWEEN);if(C.justifyContent==="space-around")Q.setJustifyContent(RA.JUSTIFY_SPACE_AROUND);if(C.justifyContent==="space-evenly")Q.setJustifyContent(RA.JUSTIFY_SPACE_EVENLY)}},T5=(Q,C)=>{if("width"in C)if(typeof C.width==="number")Q.setWidth(C.width);else if(typeof C.width==="string")Q.setWidthPercent(Number.parseInt(C.width,10));else Q.setWidthAuto();if("height"in C)if(typeof C.height==="number")Q.setHeight(C.height);else if(typeof C.height==="string")Q.setHeightPercent(Number.parseInt(C.height,10));else Q.setHeightAuto();if("minWidth"in C)if(typeof C.minWidth==="string")Q.setMinWidthPercent(Number.parseInt(C.minWidth,10));else Q.setMinWidth(C.minWidth??0);if("minHeight"in C)if(typeof C.minHeight==="string")Q.setMinHeightPercent(Number.parseInt(C.minHeight,10));else Q.setMinHeight(C.minHeight??0)},y5=(Q,C)=>{if("display"in C)Q.setDisplay(C.display==="flex"?RA.DISPLAY_FLEX:RA.DISPLAY_NONE)},P5=(Q,C)=>{if("borderStyle"in C){let F=C.borderStyle?1:0;if(C.borderTop!==!1)Q.setBorder(RA.EDGE_TOP,F);if(C.borderBottom!==!1)Q.setBorder(RA.EDGE_BOTTOM,F);if(C.borderLeft!==!1)Q.setBorder(RA.EDGE_LEFT,F);if(C.borderRight!==!1)Q.setBorder(RA.EDGE_RIGHT,F)}},_5=(Q,C)=>{if("gap"in C)Q.setGap(RA.GUTTER_ALL,C.gap??0);if("columnGap"in C)Q.setGap(RA.GUTTER_COLUMN,C.columnGap??0);if("rowGap"in C)Q.setGap(RA.GUTTER_ROW,C.rowGap??0)},u5=(Q,C={})=>{k5(Q,C),V5(Q,C),$5(Q,C),j5(Q,C),T5(Q,C),y5(Q,C),P5(Q,C),_5(Q,C)},RH=u5;if(n0())try{await import("./chunk-s5cqejr6.js")}catch(Q){if(Q.code==="ERR_MODULE_NOT_FOUND")console.warn(`
231
231
  The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,
232
232
  but this failed as it was not installed. Debugging with React Devtools requires it.
233
233
 
@@ -275,4 +275,4 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
275
275
  `)||L.includes("\r"))){let r=y.lines[y.cursorLine],EA=r.slice(0,y.cursorColumn)+L+r.slice(y.cursorColumn),BA=[...y.lines];return BA[y.cursorLine]=EA,{...y,lines:BA,cursorColumn:y.cursorColumn+L.length,desiredColumn:null}}else{let r=qK(L),EA=y.lines[y.cursorLine],BA=EA.slice(0,y.cursorColumn),LA=EA.slice(y.cursorColumn),fA=[...y.lines.slice(0,y.cursorLine),BA+r[0],...r.slice(1,-1),r[r.length-1]+LA,...y.lines.slice(y.cursorLine+1)],KA=y.cursorLine+r.length-1,UB=r[r.length-1].length;return{...y,lines:fA,cursorLine:KA,cursorColumn:UB,desiredColumn:null}}})},[]),x=sB.useCallback(()=>{F((L)=>{let y=L.lines[L.cursorLine],QA=y.slice(0,L.cursorColumn),r=y.slice(L.cursorColumn),EA=[...L.lines];return EA[L.cursorLine]=QA,EA.splice(L.cursorLine+1,0,r),{...L,lines:EA,cursorLine:L.cursorLine+1,cursorColumn:0,desiredColumn:null}})},[]),m=sB.useCallback(()=>{F((L)=>{if(L.cursorColumn>0){let y=L.lines[L.cursorLine],QA=y.slice(0,L.cursorColumn-1)+y.slice(L.cursorColumn),r=[...L.lines];return r[L.cursorLine]=QA,{...L,lines:r,cursorColumn:L.cursorColumn-1,desiredColumn:null}}else if(L.cursorLine>0){let y=L.lines[L.cursorLine-1],QA=L.lines[L.cursorLine],r=[...L.lines];return r[L.cursorLine-1]=y+QA,r.splice(L.cursorLine,1),{...L,lines:r,cursorLine:L.cursorLine-1,cursorColumn:y.length,desiredColumn:null}}return{...L,desiredColumn:null}})},[]),_=sB.useCallback(()=>{F((L)=>{let y=L.lines[L.cursorLine];if(L.cursorColumn<y.length){let QA=y.slice(0,L.cursorColumn)+y.slice(L.cursorColumn+1),r=[...L.lines];return r[L.cursorLine]=QA,{...L,lines:r,desiredColumn:null}}else if(L.cursorLine<L.lines.length-1){let QA=L.lines[L.cursorLine+1],r=[...L.lines];return r[L.cursorLine]=y+QA,r.splice(L.cursorLine+1,1),{...L,lines:r,desiredColumn:null}}return{...L,desiredColumn:null}})},[]),JA=sB.useCallback(()=>{F((L)=>{let y=L.lines[L.cursorLine];if(L.cursorColumn>0){let QA=ZF(y,L.cursorColumn,-1);if(QA<L.cursorColumn){let r=y.slice(0,QA)+y.slice(L.cursorColumn),EA=[...L.lines];return EA[L.cursorLine]=r,{...L,lines:EA,cursorColumn:QA,desiredColumn:null}}return{...L,desiredColumn:null}}else if(L.cursorLine>0){let QA=L.lines[L.cursorLine-1],r=[...L.lines];return r[L.cursorLine-1]=QA+y,r.splice(L.cursorLine,1),{...L,lines:r,cursorLine:L.cursorLine-1,cursorColumn:QA.length,desiredColumn:null}}return{...L,desiredColumn:null}})},[]),kA=sB.useCallback(()=>{F((L)=>{let y=L.lines[L.cursorLine];if(L.cursorColumn<y.length){let QA=ZF(y,L.cursorColumn,1);if(QA>L.cursorColumn){let r=y.slice(0,L.cursorColumn)+y.slice(QA),EA=[...L.lines];return EA[L.cursorLine]=r,{...L,lines:EA,desiredColumn:null}}return{...L,desiredColumn:null}}else if(L.cursorLine<L.lines.length-1){let QA=L.lines[L.cursorLine+1],r=[...L.lines];return r[L.cursorLine]=y+QA,r.splice(L.cursorLine+1,1),{...L,lines:r,desiredColumn:null}}return{...L,desiredColumn:null}})},[]);return{text:LK(C.lines),lines:C.lines,cursorLine:C.cursorLine,cursorColumn:C.cursorColumn,moveLeft:H,moveRight:J,moveUp:M,moveDown:Y,moveWordLeft:X,moveWordRight:k,moveToLineStart:u,moveToLineEnd:p,input:q,insertText:T,insertNewline:x,backspace:m,deleteChar:_,backspaceWord:JA,deleteWord:kA}}function OK(Q,C,F){let G=Math.max(0,C),H=Math.min(Q,G+F);return{start:G,end:H}}function zK(Q,C,F,G){if(Q<C)return Q;let H=C+F-1;if(Q>H)return Math.max(0,Q-F+1);return C}var Pg=GA(wI(),1),JX=mB.memo(function({content:C,lineNumber:F,showCursor:G,cursorColumn:H,isFocused:J,colorizeContent:M}){let Y=mB.useMemo(()=>{let X=Array.from(C);if(!G||!J)return M?M(C):C;let k=X.slice(0,H).join(""),u=X[H]??" ",p=X.slice(H+1).join("");if(M)k=M(k),p=M(p);return k+XB.inverse(u)+p},[C,G,H,J,M]);return Pg.jsxDEV(hA,{children:Y},void 0,!1,void 0,this)});function iH({id:Q,placeholder:C="",autoFocus:F=!0,showCursor:G=!0,value:H,onChange:J,onSubmit:M,onHotKey:Y,disabled:X=!1,maxVisibleLines:k,enableVirtualScroll:u=!0,colorizeContent:p}){let{isFocused:q}=MF({autoFocus:F,id:Q}),T=mB.useRef(!1),x=mB.useRef(H),{text:m,lines:_,cursorLine:JA,cursorColumn:kA,moveLeft:wA,moveRight:L,moveUp:y,moveDown:QA,moveWordLeft:r,moveWordRight:EA,moveToLineStart:BA,moveToLineEnd:LA,input:fA,insertText:KA,insertNewline:UB,backspace:RB,deleteChar:t,backspaceWord:HA,deleteWord:NA}=WK(H),XA=mB.useRef(0);mB.useEffect(()=>{if(H===x.current)return;if(H!==m)T.current=!0;x.current=H},[H]),mB.useEffect(()=>{if(T.current){T.current=!1;return}if(m!==x.current)J?.(m)},[m,J]);let TA=mB.useMemo(()=>{if(k)return k;return Math.min(10,_.length)},[k,_.length]);mB.useEffect(()=>{XA.current=zK(JA,XA.current,TA,_.length)},[JA,TA,_.length]);let{start:c,end:qA}=mB.useMemo(()=>OK(_.length,XA.current,TA),[_.length,XA.current,TA]),iA=mB.useCallback((CA)=>{fA(CA)},[fA]),AB=mB.useCallback(()=>{UB()},[UB]),ZB=mB.useCallback(()=>{RB()},[RB]),qB=mB.useCallback(()=>{t()},[t]),FB=mB.useCallback(()=>{HA()},[HA]),cB=mB.useCallback(()=>{NA()},[NA]),$B=mB.useCallback((CA)=>{KA(CA)},[KA]);ZK((CA,DA)=>{if(X||!q)return;if(Y){if(!Y(CA,DA))return}if(DA.ctrl&&CA==="c"||DA.tab||DA.shift&&DA.tab)return;if(DA.return){if(!DA.ctrl&&!DA.alt){M?.(m);return}AB();return}if(DA.leftArrow){if(!G)return;if(DA.ctrl||DA.alt)r();else wA();return}if(DA.rightArrow){if(!G)return;if(DA.ctrl||DA.alt)EA();else L();return}if(DA.upArrow){if(!G)return;if(DA.alt||DA.ctrl)BA();else y();return}if(DA.downArrow){if(!G)return;if(DA.alt||DA.ctrl)LA();else QA();return}if(DA.ctrl&&CA==="a"||DA.alt&&DA.leftArrow){if(!G)return;BA();return}if(DA.ctrl&&CA==="e"||DA.alt&&DA.rightArrow){if(!G)return;LA();return}if(DA.backspace){if(DA.ctrl||DA.alt)FB();else ZB();return}if(DA.delete){if(DA.ctrl||DA.alt)cB();else qB();return}if(CA)if(CA.length>1||CA.includes(`
276
276
  `))$B(CA);else iA(CA)});let _A=mB.useMemo(()=>{return _.slice(c,qA)},[_,c,qA]);if(_.length===0||_.every((CA)=>CA.length===0)){if(!q||!G)return Pg.jsxDEV(hA,{children:XB.grey(C)},void 0,!1,void 0,this);return Pg.jsxDEV(hA,{children:XB.inverse(C[0]||" ")+XB.grey(C.slice(1))},void 0,!1,void 0,this)}return Pg.jsxDEV(oA,{flexDirection:"column",children:_A.map((CA,DA)=>{let xA=c+DA;return Pg.jsxDEV(JX,{content:CA,lineNumber:xA,showCursor:G&&xA===JA,cursorColumn:kA,isFocused:q,colorizeContent:p},xA,!1,void 0,this)})},void 0,!1,void 0,this)}var LF=GA(wI(),1),SK=({searchTerm:Q,onSearchTermChange:C,placeholder:F})=>{return LF.jsxDEV(oA,{flexDirection:"column",width:"100%",children:LF.jsxDEV(oA,{gap:1,paddingX:1,width:"100%",children:[LF.jsxDEV(hA,{color:"cyan",children:"/"},void 0,!1,void 0,this),LF.jsxDEV(iH,{value:Q,onChange:C,placeholder:F,showCursor:!1,maxVisibleLines:1,enableVirtualScroll:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};var r8=GA(aA(),1);var XF=GA(wI(),1);function sH({items:Q,selectedIndex:C,itemHeight:F,visibleCount:G=8,renderItem:H,keyExtractor:J}){if(Q.length===0)return XF.jsxDEV(oA,{paddingX:1,paddingY:1,children:XF.jsxDEV(hA,{color:"gray",children:"暂无数据"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let M=G*F,Y=Q.length*F,X=r8.useMemo(()=>{let q=C*F,T=M/2;if(q<T)return 0;let x=Math.max(0,Y-M);return Math.min(q-T,x)},[C,F,M,Y]),k=Math.floor(X/F),u=Math.min(k+G+1,Q.length),p=Q.slice(k,u);return XF.jsxDEV(oA,{flexDirection:"column",width:"100%",gap:1,children:p.map((q,T)=>{let x=k+T,m=J?J(q,x):x;return XF.jsxDEV(r8.default.Fragment,{children:H(q,x,x===C)},m,!1,void 0,this)})},void 0,!1,void 0,this)}var _g=GA(aA(),1);function MX(Q,C){let F=Q.toLowerCase(),G=C.toLowerCase();if(G.includes(F))return!0;let H=0;for(let J of G)if(J===F[H]){if(H++,H===F.length)return!0}return!1}function kK(Q){let{items:C,searchFields:F,filters:G,defaultFilter:H="all"}=Q,[J,M]=_g.useState(""),[Y,X]=_g.useState(H),k=_g.useMemo(()=>{if(Y==="all"||!G||G.length===0)return C;let T=G.find((x)=>x.id===Y);return T?C.filter(T.predicate):C},[C,Y,G]),u=_g.useMemo(()=>{if(!J||!F||F.length===0)return k;return k.filter((T)=>{return F.some((x)=>{let m=T[x];if(typeof m==="string")return MX(J,m);return!1})})},[J,k,F]),p=Y!=="all",q=J.length>0;return{searchTerm:J,setSearchTerm:M,activeFilter:Y,setActiveFilter:X,filteredItems:u,hasActiveFilter:p,hasSearchTerm:q}}var ZQ=GA(aA(),1);function VK(Q){let{items:C,initialIndex:F=0,visibleCount:G=20,filteredItems:H=C,onSelect:J,onDelete:M,onClose:Y,onSearch:X,onFilter:k,keyMap:u={}}=Q,[p,q]=ZQ.useState(F),[T,x]=ZQ.useState(!1);ZQ.useEffect(()=>{q(F)},[F]);let m=ZQ.useRef(q),_=ZQ.useRef(Y);ZQ.useEffect(()=>{m.current=q},[q]),ZQ.useEffect(()=>{_.current=Y},[Y]);let JA=ZQ.useCallback(()=>{return{items:C,filteredItems:H,selectedIndex:p,setSelectedIndex:m.current,searchTerm:"",setSearchTerm:()=>{},activeFilter:"all",setActiveFilter:()=>{},onClose:_.current||(()=>{})}},[C,H,p]);return RF((kA,wA)=>{if(T){if(wA.escape)x(!1);else if(wA.return)x(!1);return}if(kA==="/"){X?.(),x(!0);return}if(wA.tab){k?.();return}if(wA.escape){Y?.();return}if(wA.upArrow&&u.upArrow){let y=JA();u.upArrow(y);return}if(wA.downArrow&&u.downArrow){let y=JA();u.downArrow(y);return}if(wA.leftArrow&&u.leftArrow){let y=JA();u.leftArrow(y);return}if(wA.rightArrow&&u.rightArrow){let y=JA();u.rightArrow(y);return}if(wA.pageUp&&u.pageUp){let y=JA();u.pageUp(y);return}if(wA.pageDown&&u.pageDown){let y=JA();u.pageDown(y);return}if(wA.home&&u.home){let y=JA();u.home(y);return}if(wA.end&&u.end){let y=JA();u.end(y);return}let L=u[kA];if(L){let y=JA();L(y);return}if(wA.ctrl||wA.meta){let y=`${wA.ctrl?"Ctrl":"Meta"}+${kA}`,QA=u[y];if(QA){let r=JA();QA(r);return}}if(H.length===0)return;switch(!0){case wA.upArrow:q((y)=>y>0?y-1:H.length-1);break;case wA.downArrow:q((y)=>y<H.length-1?y+1:0);break;case wA.pageUp:q((y)=>Math.max(0,y-G));break;case wA.pageDown:q((y)=>Math.min(H.length-1,y+G));break;case wA.home:q(0);break;case wA.end:q(H.length-1);break;case wA.return:if(J){let y=H[p];if(y)J(y)}break;case wA.backspace:case wA.delete:if(M){let y=H[p];if(y)M(y)}break}}),{selectedIndex:p,setSelectedIndex:q,searchMode:T,setSearchMode:x}}var pB=GA(wI(),1);function RX({config:Q,onClose:C}){let[F,G]=VB.useState([]),[H,J]=VB.useState(!0),M=VB.useMemo(()=>Q.dataSource,[Q.dataSource]),Y=VB.useMemo(()=>Q.id,[Q.id]),X=VB.useMemo(()=>Q.searchFields,[Q.searchFields]),k=VB.useMemo(()=>Q.filters,[Q.filters]),u=VB.useMemo(()=>Q.defaultFilter,[Q.defaultFilter]),p=VB.useMemo(()=>Q.isSelected,[Q.isSelected]),q=VB.useMemo(()=>Q.visibleCount,[Q.visibleCount]),T=VB.useMemo(()=>Q.itemHeight,[Q.itemHeight]),x=VB.useMemo(()=>Q.renderItem,[Q.renderItem]),m=VB.useMemo(()=>Q.keyExtractor,[Q.keyExtractor]),_=VB.useMemo(()=>Q.onSelect,[Q.onSelect]),JA=VB.useMemo(()=>Q.onDelete,[Q.onDelete]),kA=VB.useMemo(()=>Q.showCount,[Q.showCount]),wA=VB.useMemo(()=>Q.statusInfo,[Q.statusInfo]),L=VB.useMemo(()=>Q.searchable,[Q.searchable]),y=VB.useMemo(()=>Q.filterable,[Q.filterable]),QA=VB.useMemo(()=>Q.searchPlaceholder,[Q.searchPlaceholder]),r=VB.useMemo(()=>Q.keyMap,[Q.keyMap]);VB.useEffect(()=>{(async()=>{try{let TA=await M();G(TA||[])}catch(TA){console.error(`Failed to load data for panel ${Y}:`,TA),G([])}finally{J(!1)}})()},[M,Y]);let{searchTerm:EA,setSearchTerm:BA,activeFilter:LA,setActiveFilter:fA,filteredItems:KA}=kK({items:F||[],searchFields:X,filters:k,defaultFilter:u}),UB=VB.useMemo(()=>{let XA=KA||[];if(p&&XA.length>0){let TA=XA.findIndex(p);return TA>=0?TA:0}return 0},[KA,p]),{selectedIndex:RB}=VK({items:KA||[],initialIndex:UB,visibleCount:q,onSelect:_,onDelete:JA,onClose:C,onSearch:()=>BA(""),onFilter:()=>{if(k&&k.length>0){let XA=["all",...k.map((qA)=>qA.id)],c=(XA.indexOf(LA)+1)%XA.length;fA(XA[c])}},keyMap:r});if(H)return pB.jsxDEV(YF,{title:Q.title,icon:Q.icon,count:kA?F.length:void 0,children:pB.jsxDEV(hA,{color:"gray",children:"加载中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!F||F.length===0)return pB.jsxDEV(YF,{title:Q.title,icon:Q.icon,count:0,children:Q.renderEmpty?Q.renderEmpty():pB.jsxDEV(hA,{color:"gray",children:"暂无数据"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let t=q||8,HA=KA||[],NA=F||[];return pB.jsxDEV(YF,{title:Q.title,icon:Q.icon,count:kA?NA.length:void 0,statusInfo:wA?.(HA),children:[pB.jsxDEV(oA,{flexGrow:1,children:pB.jsxDEV(sH,{items:HA,selectedIndex:RB,itemHeight:T,visibleCount:t,renderItem:x,keyExtractor:m},void 0,!1,void 0,this)},void 0,!1,void 0,this),(L||y)&&pB.jsxDEV(oA,{marginTop:1,width:"100%",children:pB.jsxDEV(SK,{searchTerm:EA,onSearchTermChange:BA,activeFilter:LA,filters:k,onFilterChange:fA,placeholder:QA||"搜索...",filteredCount:HA.length,totalCount:NA.length},void 0,!1,void 0,this)},void 0,!1,void 0,this),pB.jsxDEV(oA,{gap:2,paddingY:1,children:pB.jsxDEV(hA,{color:"gray",children:[pB.jsxDEV(hA,{color:"cyan",bold:!0,children:"↑↓"},void 0,!1,void 0,this),":导航",pB.jsxDEV(hA,{color:"cyan",bold:!0,children:"Enter"},void 0,!1,void 0,this),":确认",JA&&pB.jsxDEV(pB.Fragment,{children:[pB.jsxDEV(hA,{color:"cyan",bold:!0,children:[" ","Backspace"]},void 0,!0,void 0,this),":删除"]},void 0,!0,void 0,this),pB.jsxDEV(hA,{color:"cyan",bold:!0,children:[" ","/"]},void 0,!0,void 0,this),":搜索",y&&pB.jsxDEV(pB.Fragment,{children:[pB.jsxDEV(hA,{color:"cyan",bold:!0,children:[" ","Tab"]},void 0,!0,void 0,this),":过滤"]},void 0,!0,void 0,this),pB.jsxDEV(hA,{color:"cyan",bold:!0,children:[" ","ESC"]},void 0,!0,void 0,this),":关闭"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var kC=GA(aA(),1);var CQ=GA(wI(),1),KX=({option:Q,isSelected:C,isHighlighted:F,isFocused:G,isComponentDisabled:H})=>{let J=!G||H,M="white";if(Q.disabled)M="gray";else if(C)M=G?"green":"gray";else if(F&&G)M="cyan";else if(J)M="gray";return CQ.jsxDEV(oA,{children:CQ.jsxDEV(hA,{color:M,children:[C?"◉ ":"○ ",Q.label]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},NX=({isSelected:Q})=>CQ.jsxDEV(hA,{color:Q?"green":"gray",children:Q?"◉":"○"},void 0,!1,void 0,this),YX=({values:Q})=>CQ.jsxDEV(CQ.Fragment,{},void 0,!1,void 0,this),ZX=({options:Q,values:C,defaultValues:F=[],onChange:G,onSubmit:H,disabled:J=!1,highlightText:M,itemComponent:Y=KX,indicatorComponent:X=NX,statusComponent:k=YX,autoFocus:u=!0,singleSelect:p=!1})=>{let{isFocused:q}=MF({autoFocus:u}),[T,x]=kC.useState(C||F),[m,_]=kC.useState(0);kC.useEffect(()=>{if(C!==void 0)x(C)},[C]);let JA=kC.useCallback((L)=>{if(J||Q[L].disabled)return;let y=Q[L],QA;if(p)QA=T.includes(y.value)?[]:[y.value];else QA=T.includes(y.value)?T.filter((r)=>r!==y.value):[...T,y.value];x(QA),G?.(QA)},[T,Q,J,G,p]),kA=kC.useCallback(()=>{if(J)return;if(T.length===0&&Q.length>0){let L=Q[m];if(L&&!L.disabled){G?.([L.value]),H?.([L.value]);return}}H?.(T)},[T,J,H,Q,m]);RF((L,y)=>{if(!q||J)return;if(y.upArrow)_((QA)=>Math.max(0,QA-1));else if(y.downArrow)_((QA)=>Math.min(Q.length-1,QA+1));else if(y.return)kA();else if(L===" ")JA(m)});let wA=M?Q.filter((L)=>L.label.toLowerCase().includes(M.toLowerCase())||L.value.toLowerCase().includes(M.toLowerCase())):Q;return CQ.jsxDEV(oA,{flexDirection:"column",children:[CQ.jsxDEV(oA,{marginBottom:1,children:CQ.jsxDEV(k,{values:T},void 0,!1,void 0,this)},void 0,!1,void 0,this),CQ.jsxDEV(oA,{flexDirection:"column",children:wA.map((L,y)=>{let QA=T.includes(L.value);return CQ.jsxDEV(oA,{children:CQ.jsxDEV(Y,{option:L,isSelected:QA,isHighlighted:y===m,isFocused:q,isComponentDisabled:J},void 0,!1,void 0,this)},L.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var t8=GA(aA(),1);var oH=GA(wI(),1),LX=(Q,C,F)=>{let G=parseInt(Q.slice(1,3),16),H=parseInt(Q.slice(3,5),16),J=parseInt(Q.slice(5,7),16),M=parseInt(C.slice(1,3),16),Y=parseInt(C.slice(3,5),16),X=parseInt(C.slice(5,7),16),k=Math.round(G+F*(M-G)),u=Math.round(H+F*(Y-H)),p=Math.round(J+F*(X-J));return`#${(16777216+(k<<16)+(u<<8)+p).toString(16).slice(1).toUpperCase()}`},_x=({text:Q,highlightColor:C="#00FFFF",baseColor:F="#003333",interval:G=20,spread:H=32,globalIndex:J})=>{let[M,Y]=t8.useState(0),X=J!==void 0?J:M;return t8.useEffect(()=>{if(J!==void 0)return;let k=setInterval(()=>{Y((u)=>(u+1)%(Q.length+H*2))},G);return()=>clearInterval(k)},[Q.length,H,G,J]),oH.jsxDEV(hA,{children:Q.split("").map((k,u)=>{let p=X-H,q=Math.abs(u-p),T=F,x=!1;if(q<H){let m=Math.cos(q/H*(Math.PI/2)),_=Math.pow(m,2);T=LX(F,C,_),x=q<1}return oH.jsxDEV(hA,{color:T,bold:x,children:k},u,!1,void 0,this)})},void 0,!1,void 0,this)};var qF=GA(wI(),1),fx=({content:Q,maxLines:C=10,borderColor:F="cyan",borderStyle:G="single",marginTop:H=0,paddingX:J=0,showOmittedInfo:M=!0,width:Y})=>{if(!Q)return null;let X=Q.split(`
277
277
  `),k=Y||(X.length>0?Math.max(...X.map((T)=>T.length))+10:80),u=X.map((T)=>T.slice(0,k-10)),p=Math.max(0,u.length-C),q=u.slice(-C).join(`
278
- `);return qF.jsxDEV(oA,{flexDirection:"column",width:k,children:qF.jsxDEV(oA,{borderStyle:G,borderColor:F,borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:J,marginTop:H,children:[M&&p>0&&qF.jsxDEV(hA,{color:"gray",dimColor:!0,children:["... ",p," lines omitted ..."]},void 0,!0,void 0,this),qF.jsxDEV(hA,{dimColor:!0,children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};export{aA as ye,CY as ze,XB as Ae,oA as Be,hA as Ce,dL as De,wK as Ee,GK as Fe,eL as Ge,BX as He,MF as Ie,CX as Je,RF as Ke,wI as Le,iH as Me,rb as Ne,ZX as Oe,RX as Pe,_x as Qe,fx as Re};
278
+ `);return qF.jsxDEV(oA,{flexDirection:"column",width:k,children:qF.jsxDEV(oA,{borderStyle:G,borderColor:F,borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:J,marginTop:H,children:[M&&p>0&&qF.jsxDEV(hA,{color:"gray",dimColor:!0,children:["... ",p," lines omitted ..."]},void 0,!0,void 0,this),qF.jsxDEV(hA,{dimColor:!0,children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};export{aA as we,CY as xe,XB as ye,oA as ze,hA as Ae,dL as Be,wK as Ce,GK as De,eL as Ee,BX as Fe,MF as Ge,CX as He,RF as Ie,wI as Je,iH as Ke,rb as Le,ZX as Me,RX as Ne,_x as Oe,fx as Pe};
@@ -1,4 +1,4 @@
1
- import{ef as y,gf as p}from"./chunk-mcb8rewr.js";import{xf as f}from"./chunk-1mq2jmfy.js";import{Lf as v,Nf as x}from"./chunk-3dnayvgx.js";import{Kl as s}from"./chunk-z3e4c424.js";async function w(e){let o=(t)=>{return t.stateSchema=f,t},a={id:"filesystem",name:"filesystem",description:"File and directory operations (read, write, search, glob)",execute:async()=>{return o(new y)}};await e.addMiddleware(a),e.middlewares.registerImplementation(a);let i={id:"terminal",name:"terminal",description:"Terminal command execution (Bash/CMD, background processes)",execute:async()=>{return o(new p)}};await e.addMiddleware(i),e.middlewares.registerImplementation(i);let r={id:"subagents",name:"subagents",description:"Task delegation to specialized agents",execute:async()=>{let{createSubAgentsMiddleware:t}=await import("./chunk-zq2g4rfd.js");return await t(e)}};await e.addMiddleware(r),e.middlewares.registerImplementation(r);let l={id:"skills",name:"skills",description:"Progressive skills disclosure",execute:async(t)=>{if(t.projectSkillsDir=t.projectSkillsDir||"./.claude/skills",!t.skillsDir){let R=await import("os"),Y=await import("path");t.skillsDir=Y.join(R.homedir(),".claude","skills")}let{SkillsMiddleware:n}=await import("./chunk-8bs8r50r.js");return new n(t)}};await e.addMiddleware(l),e.middlewares.registerImplementation(l);let u={id:"agents_md",name:"agents_md",description:"Inject agent documentation",execute:async(t)=>{let{AgentsMdMiddleware:n}=await import("./chunk-8bs8r50r.js");return new n({projectRoot:t?.projectRoot})}};await e.addMiddleware(u),e.middlewares.registerImplementation(u);let h={id:"interactive",name:"interactive",description:"User interaction for approval and input",execute:async()=>{let{InteractiveMiddleware:t}=await import("./chunk-7yzv6385.js");return t}};await e.addMiddleware(h),e.middlewares.registerImplementation(h);let c={id:"task",name:"task",description:"Task management for todo lists",execute:async()=>{let{taskMiddleware:t}=await import("./chunk-c2wfgbj6.js");return t}};await e.addMiddleware(c),e.middlewares.registerImplementation(c);let d={id:"mcp",name:"mcp",description:"Task management for todo lists",execute:async()=>{let{MCPWithConfigMiddleware:t}=await import("./chunk-1vn8d8b8.js");return new t}};await e.addMiddleware(d),e.middlewares.registerImplementation(d);let m={id:"web",name:"web",description:"Fetch and extract readable content from URLs",execute:async()=>{let{WebMiddleware:t}=await import("./chunk-8ysg0rga.js");return t}};await e.addMiddleware(m),e.middlewares.registerImplementation(m)}var g=`# 架构师 - 任务派发协调者
1
+ import{cf as y,ef as p}from"./chunk-vrnj0659.js";import{vf as f}from"./chunk-yy8p9zph.js";import{Jf as v,Lf as x}from"./chunk-mnnyjmgw.js";import{Il as s}from"./chunk-y8qhrx11.js";async function w(e){let o=(t)=>{return t.stateSchema=f,t},a={id:"filesystem",name:"filesystem",description:"File and directory operations (read, write, search, glob)",execute:async()=>{return o(new y)}};await e.addMiddleware(a),e.middlewares.registerImplementation(a);let i={id:"terminal",name:"terminal",description:"Terminal command execution (Bash/CMD, background processes)",execute:async()=>{return o(new p)}};await e.addMiddleware(i),e.middlewares.registerImplementation(i);let r={id:"subagents",name:"subagents",description:"Task delegation to specialized agents",execute:async()=>{let{createSubAgentsMiddleware:t}=await import("./chunk-swyc15ym.js");return await t(e)}};await e.addMiddleware(r),e.middlewares.registerImplementation(r);let l={id:"skills",name:"skills",description:"Progressive skills disclosure",execute:async(t)=>{if(t.projectSkillsDir=t.projectSkillsDir||"./.claude/skills",!t.skillsDir){let R=await import("os"),Y=await import("path");t.skillsDir=Y.join(R.homedir(),".claude","skills")}let{SkillsMiddleware:n}=await import("./chunk-7kw7ss8d.js");return new n(t)}};await e.addMiddleware(l),e.middlewares.registerImplementation(l);let u={id:"agents_md",name:"agents_md",description:"Inject agent documentation",execute:async(t)=>{let{AgentsMdMiddleware:n}=await import("./chunk-7kw7ss8d.js");return new n({projectRoot:t?.projectRoot})}};await e.addMiddleware(u),e.middlewares.registerImplementation(u);let h={id:"interactive",name:"interactive",description:"User interaction for approval and input",execute:async()=>{let{InteractiveMiddleware:t}=await import("./chunk-ehmmd8qc.js");return t}};await e.addMiddleware(h),e.middlewares.registerImplementation(h);let c={id:"task",name:"task",description:"Task management for todo lists",execute:async()=>{let{taskMiddleware:t}=await import("./chunk-zr90qp47.js");return t}};await e.addMiddleware(c),e.middlewares.registerImplementation(c);let d={id:"mcp",name:"mcp",description:"Task management for todo lists",execute:async()=>{let{MCPWithConfigMiddleware:t}=await import("./chunk-z61m3anh.js");return new t}};await e.addMiddleware(d),e.middlewares.registerImplementation(d);let m={id:"web",name:"web",description:"Fetch and extract readable content from URLs",execute:async()=>{let{WebMiddleware:t}=await import("./chunk-t2s3s6af.js");return t}};await e.addMiddleware(m),e.middlewares.registerImplementation(m)}var g=`# 架构师 - 任务派发协调者
2
2
 
3
3
  你是一位**任务派发架构师**,核心职责是将用户需求分析并拆解为子任务,然后委派给合适的子 agent 执行。
4
4
 
@@ -230,4 +230,4 @@ user: Where are errors from the client handled?
230
230
  assistant: Clients are marked as failed in the \`connectToServer\` function in src/services/process.ts:712.
231
231
  </example>
232
232
  `;async function T(){let e=new x,o=new v(e);return await o.addModel({id:"glm-4.7",model_name:"glm-4.7",provider_id:process.env.MODEL_PROVIDER||"openai",stream_usage:!0,enable_thinking:!0,temperature:0.7,max_tokens:4096,top_p:1,frequency_penalty:0,presence_penalty:0}),await o.addPrompt({id:"prompts/default",name:"default"},b({cwd:process.cwd(),env:{isGitRepo:!0,platform:process.platform,osVersion:process.version,date:new Date().toISOString().split("T")[0]}})),await o.addPrompt({id:"prompts/manager",name:"manager"},g),await w(o),await o.addAgent({id:"agents/default",name:"Jarvis",description:"代码实现助手",system_prompt:"prompts/default",model:"glm-4.7",middlewares:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,subagents:!0,interactive:!0,task:!0,mcp:!0,web:!0}}),await o.addAgent({id:"agents/manager",name:"Manager",description:"任务管理员",system_prompt:"prompts/manager",model:"glm-4.7",middlewares:{filesystem:!0,terminal:!0,agents_md:!0,skills:!0,subagents:!0,interactive:!0,task:!0,mcp:!0,web:!0}}),o}var N=await T(),B=N;
233
- export{B as Ve};
233
+ export{B as Te};
@@ -1,4 +1,4 @@
1
- import{Hl as O,Kl as n0}from"./chunk-z3e4c424.js";var w=O((q9)=>{var Nq=Symbol.for("yaml.alias"),k$=Symbol.for("yaml.document"),k0=Symbol.for("yaml.map"),v$=Symbol.for("yaml.pair"),bq=Symbol.for("yaml.scalar"),v0=Symbol.for("yaml.seq"),x=Symbol.for("yaml.node.type"),sU=(q)=>!!q&&typeof q==="object"&&q[x]===Nq,iU=(q)=>!!q&&typeof q==="object"&&q[x]===k$,rU=(q)=>!!q&&typeof q==="object"&&q[x]===k0,nU=(q)=>!!q&&typeof q==="object"&&q[x]===v$,m$=(q)=>!!q&&typeof q==="object"&&q[x]===bq,oU=(q)=>!!q&&typeof q==="object"&&q[x]===v0;function p$(q){if(q&&typeof q==="object")switch(q[x]){case k0:case v0:return!0}return!1}function tU(q){if(q&&typeof q==="object")switch(q[x]){case Nq:case k0:case bq:case v0:return!0}return!1}var eU=(q)=>(m$(q)||p$(q))&&!!q.anchor;q9.ALIAS=Nq;q9.DOC=k$;q9.MAP=k0;q9.NODE_TYPE=x;q9.PAIR=v$;q9.SCALAR=bq;q9.SEQ=v0;q9.hasAnchor=eU;q9.isAlias=sU;q9.isCollection=p$;q9.isDocument=iU;q9.isMap=rU;q9.isNode=tU;q9.isPair=nU;q9.isScalar=m$;q9.isSeq=oU});var W0=O((R9)=>{var j=w(),C=Symbol("break visit"),d$=Symbol("skip children"),h=Symbol("remove node");function m0(q,$){let U=l$($);if(j.isDocument(q)){if(X0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else X0(null,q,U,Object.freeze([]))}m0.BREAK=C;m0.SKIP=d$;m0.REMOVE=h;function X0(q,$,U,H){let X=a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),X0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=X0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=X0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=X0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}async function p0(q,$){let U=l$($);if(j.isDocument(q)){if(await Z0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else await Z0(null,q,U,Object.freeze([]))}p0.BREAK=C;p0.SKIP=d$;p0.REMOVE=h;async function Z0(q,$,U,H){let X=await a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),Z0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=await Z0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=await Z0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=await Z0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}function l$(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function a$(q,$,U,H){if(typeof U==="function")return U(q,$,H);if(j.isMap($))return U.Map?.(q,$,H);if(j.isSeq($))return U.Seq?.(q,$,H);if(j.isPair($))return U.Pair?.(q,$,H);if(j.isScalar($))return U.Scalar?.(q,$,H);if(j.isAlias($))return U.Alias?.(q,$,H);return}function c$(q,$,U){let H=$[$.length-1];if(j.isCollection(H))H.items[q]=U;else if(j.isPair(H))if(q==="key")H.key=U;else H.value=U;else if(j.isDocument(H))H.contents=U;else{let X=j.isAlias(H)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}R9.visit=m0;R9.visitAsync=p0});var Sq=O((A9)=>{var s$=w(),D9=W0(),P9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},F9=(q)=>q.replace(/[!,[\]{}]/g,($)=>P9[$]);class E{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E.defaultYaml,q),this.tags=Object.assign({},E.defaultTags,$)}clone(){let q=new E(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new E(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:E.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E.defaultTags),this.atNextDocument=!1;let U=q.trim().split(/[ \t]+/),H=U.shift();switch(H){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[X,Z]=U;return this.tags[X]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[X]=U;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let Z=/^\d+\.\d+$/.test(X);return $(6,`Unsupported YAML version ${X}`,Z),!1}}default:return $(0,`Unknown directive ${H}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Z=q.slice(2,-1);if(Z==="!"||Z==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return Z}let[,U,H]=q.match(/^(.*!)([^!]*)$/s);if(!H)$(`The ${q} tag has no suffix`);let X=this.tags[U];if(X)try{return X+decodeURIComponent(H)}catch(Z){return $(String(Z)),null}if(U==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,U]of Object.entries(this.tags))if(q.startsWith(U))return $+F9(q.substring(U.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),H;if(q&&U.length>0&&s$.isNode(q.contents)){let X={};D9.visit(q.contents,(Z,G)=>{if(s$.isNode(G)&&G.tag)X[G.tag]=!0}),H=Object.keys(X)}else H=[];for(let[X,Z]of U){if(X==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!q||H.some((G)=>G.startsWith(Z)))$.push(`%TAG ${X} ${Z}`)}return $.join(`
1
+ import{Fl as O,Il as n0}from"./chunk-y8qhrx11.js";var w=O((q9)=>{var Nq=Symbol.for("yaml.alias"),k$=Symbol.for("yaml.document"),k0=Symbol.for("yaml.map"),v$=Symbol.for("yaml.pair"),bq=Symbol.for("yaml.scalar"),v0=Symbol.for("yaml.seq"),x=Symbol.for("yaml.node.type"),sU=(q)=>!!q&&typeof q==="object"&&q[x]===Nq,iU=(q)=>!!q&&typeof q==="object"&&q[x]===k$,rU=(q)=>!!q&&typeof q==="object"&&q[x]===k0,nU=(q)=>!!q&&typeof q==="object"&&q[x]===v$,m$=(q)=>!!q&&typeof q==="object"&&q[x]===bq,oU=(q)=>!!q&&typeof q==="object"&&q[x]===v0;function p$(q){if(q&&typeof q==="object")switch(q[x]){case k0:case v0:return!0}return!1}function tU(q){if(q&&typeof q==="object")switch(q[x]){case Nq:case k0:case bq:case v0:return!0}return!1}var eU=(q)=>(m$(q)||p$(q))&&!!q.anchor;q9.ALIAS=Nq;q9.DOC=k$;q9.MAP=k0;q9.NODE_TYPE=x;q9.PAIR=v$;q9.SCALAR=bq;q9.SEQ=v0;q9.hasAnchor=eU;q9.isAlias=sU;q9.isCollection=p$;q9.isDocument=iU;q9.isMap=rU;q9.isNode=tU;q9.isPair=nU;q9.isScalar=m$;q9.isSeq=oU});var W0=O((R9)=>{var j=w(),C=Symbol("break visit"),d$=Symbol("skip children"),h=Symbol("remove node");function m0(q,$){let U=l$($);if(j.isDocument(q)){if(X0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else X0(null,q,U,Object.freeze([]))}m0.BREAK=C;m0.SKIP=d$;m0.REMOVE=h;function X0(q,$,U,H){let X=a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),X0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=X0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=X0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=X0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}async function p0(q,$){let U=l$($);if(j.isDocument(q)){if(await Z0(null,q.contents,U,Object.freeze([q]))===h)q.contents=null}else await Z0(null,q,U,Object.freeze([]))}p0.BREAK=C;p0.SKIP=d$;p0.REMOVE=h;async function Z0(q,$,U,H){let X=await a$(q,$,U,H);if(j.isNode(X)||j.isPair(X))return c$(q,H,X),Z0(q,X,U,H);if(typeof X!=="symbol"){if(j.isCollection($)){H=Object.freeze(H.concat($));for(let Z=0;Z<$.items.length;++Z){let G=await Z0(Z,$.items[Z],U,H);if(typeof G==="number")Z=G-1;else if(G===C)return C;else if(G===h)$.items.splice(Z,1),Z-=1}}else if(j.isPair($)){H=Object.freeze(H.concat($));let Z=await Z0("key",$.key,U,H);if(Z===C)return C;else if(Z===h)$.key=null;let G=await Z0("value",$.value,U,H);if(G===C)return C;else if(G===h)$.value=null}}return X}function l$(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function a$(q,$,U,H){if(typeof U==="function")return U(q,$,H);if(j.isMap($))return U.Map?.(q,$,H);if(j.isSeq($))return U.Seq?.(q,$,H);if(j.isPair($))return U.Pair?.(q,$,H);if(j.isScalar($))return U.Scalar?.(q,$,H);if(j.isAlias($))return U.Alias?.(q,$,H);return}function c$(q,$,U){let H=$[$.length-1];if(j.isCollection(H))H.items[q]=U;else if(j.isPair(H))if(q==="key")H.key=U;else H.value=U;else if(j.isDocument(H))H.contents=U;else{let X=j.isAlias(H)?"alias":"scalar";throw Error(`Cannot replace node with ${X} parent`)}}R9.visit=m0;R9.visitAsync=p0});var Sq=O((A9)=>{var s$=w(),D9=W0(),P9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},F9=(q)=>q.replace(/[!,[\]{}]/g,($)=>P9[$]);class E{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E.defaultYaml,q),this.tags=Object.assign({},E.defaultTags,$)}clone(){let q=new E(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new E(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:E.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E.defaultTags),this.atNextDocument=!1;let U=q.trim().split(/[ \t]+/),H=U.shift();switch(H){case"%TAG":{if(U.length!==2){if($(0,"%TAG directive should contain exactly two parts"),U.length<2)return!1}let[X,Z]=U;return this.tags[X]=Z,!0}case"%YAML":{if(this.yaml.explicit=!0,U.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[X]=U;if(X==="1.1"||X==="1.2")return this.yaml.version=X,!0;else{let Z=/^\d+\.\d+$/.test(X);return $(6,`Unsupported YAML version ${X}`,Z),!1}}default:return $(0,`Unknown directive ${H}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Z=q.slice(2,-1);if(Z==="!"||Z==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return Z}let[,U,H]=q.match(/^(.*!)([^!]*)$/s);if(!H)$(`The ${q} tag has no suffix`);let X=this.tags[U];if(X)try{return X+decodeURIComponent(H)}catch(Z){return $(String(Z)),null}if(U==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,U]of Object.entries(this.tags))if(q.startsWith(U))return $+F9(q.substring(U.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],U=Object.entries(this.tags),H;if(q&&U.length>0&&s$.isNode(q.contents)){let X={};D9.visit(q.contents,(Z,G)=>{if(s$.isNode(G)&&G.tag)X[G.tag]=!0}),H=Object.keys(X)}else H=[];for(let[X,Z]of U){if(X==="!!"&&Z==="tag:yaml.org,2002:")continue;if(!q||H.some((G)=>G.startsWith(Z)))$.push(`%TAG ${X} ${Z}`)}return $.join(`
2
2
  `)}}E.defaultYaml={explicit:!1,version:"1.2"};E.defaultTags={"!!":"tag:yaml.org,2002:"};A9.Directives=E});var d0=O((b9)=>{var i$=w(),w9=W0();function K9(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let U=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(U)}return!0}function r$(q){let $=new Set;return w9.visit(q,{Value(U,H){if(H.anchor)$.add(H.anchor)}}),$}function n$(q,$){for(let U=1;;++U){let H=`${q}${U}`;if(!$.has(H))return H}}function N9(q,$){let U=[],H=new Map,X=null;return{onAnchor:(Z)=>{U.push(Z),X??(X=r$(q));let G=n$($,X);return X.add(G),G},setAnchors:()=>{for(let Z of U){let G=H.get(Z);if(typeof G==="object"&&G.anchor&&(i$.isScalar(G.node)||i$.isCollection(G.node)))G.node.anchor=G.anchor;else{let z=Error("Failed to resolve repeated object (this should not happen)");throw z.source=Z,z}}},sourceObjects:H}}b9.anchorIsValid=K9;b9.anchorNames=r$;b9.createNodeAnchors=N9;b9.findNewAnchor=n$});var jq=O((g9)=>{function O0(q,$,U,H){if(H&&typeof H==="object")if(Array.isArray(H))for(let X=0,Z=H.length;X<Z;++X){let G=H[X],z=O0(q,H,String(X),G);if(z===void 0)delete H[X];else if(z!==G)H[X]=z}else if(H instanceof Map)for(let X of Array.from(H.keys())){let Z=H.get(X),G=O0(q,H,X,Z);if(G===void 0)H.delete(X);else if(G!==Z)H.set(X,G)}else if(H instanceof Set)for(let X of Array.from(H)){let Z=O0(q,H,X,X);if(Z===void 0)H.delete(X);else if(Z!==X)H.delete(X),H.add(Z)}else for(let[X,Z]of Object.entries(H)){let G=O0(q,H,X,Z);if(G===void 0)delete H[X];else if(G!==Z)H[X]=G}return q.call($,U,H)}g9.applyReviver=O0});var m=O((h9)=>{var y9=w();function o$(q,$,U){if(Array.isArray(q))return q.map((H,X)=>o$(H,String(X),U));if(q&&typeof q.toJSON==="function"){if(!U||!y9.hasAnchor(q))return q.toJSON($,U);let H={aliasCount:0,count:1,res:void 0};U.anchors.set(q,H),U.onCreate=(Z)=>{H.res=Z,delete U.onCreate};let X=q.toJSON($,U);if(U.onCreate)U.onCreate(X);return X}if(typeof q==="bigint"&&!U?.keep)return Number(q);return q}h9.toJS=o$});var l0=O((v9)=>{var x9=jq(),t$=w(),k9=m();class e${constructor(q){Object.defineProperty(this,t$.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:U,onAnchor:H,reviver:X}={}){if(!t$.isDocument(q))throw TypeError("A document argument is required");let Z={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof U==="number"?U:100},G=k9.toJS(this,"",Z);if(typeof H==="function")for(let{count:z,res:J}of Z.anchors.values())H(J,z);return typeof X==="function"?x9.applyReviver(X,{"":G},"",G):G}}v9.NodeBase=e$});var R0=O((c9)=>{var p9=d0(),d9=W0(),G0=w(),l9=l0(),a9=m();class q2 extends l9.NodeBase{constructor(q){super(G0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let U;if($?.aliasResolveCache)U=$.aliasResolveCache;else if(U=[],d9.visit(q,{Node:(X,Z)=>{if(G0.isAlias(Z)||G0.hasAnchor(Z))U.push(Z)}}),$)$.aliasResolveCache=U;let H=void 0;for(let X of U){if(X===this)break;if(X.anchor===this.source)H=X}return H}toJSON(q,$){if(!$)return{source:this.source};let{anchors:U,doc:H,maxAliasCount:X}=$,Z=this.resolve(H,$);if(!Z){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(z)}let G=U.get(Z);if(!G)a9.toJS(Z,null,$),G=U.get(Z);if(G?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(X>=0){if(G.count+=1,G.aliasCount===0)G.aliasCount=a0(H,Z,U);if(G.count*G.aliasCount>X)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return G.res}toString(q,$,U){let H=`*${this.source}`;if(q){if(p9.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let X=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(X)}if(q.implicitKey)return`${H} `}return H}}function a0(q,$,U){if(G0.isAlias($)){let H=$.resolve(q),X=U&&H&&U.get(H);return X?X.count*X.aliasCount:0}else if(G0.isCollection($)){let H=0;for(let X of $.items){let Z=a0(q,X,U);if(Z>H)H=Z}return H}else if(G0.isPair($)){let H=a0(q,$.key,U),X=a0(q,$.value,U);return Math.max(H,X)}return 1}c9.Alias=q2});var N=O((t9)=>{var i9=w(),r9=l0(),n9=m(),o9=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class n extends r9.NodeBase{constructor(q){super(i9.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:n9.toJS(this.value,q,$)}toString(){return String(this.value)}}n.BLOCK_FOLDED="BLOCK_FOLDED";n.BLOCK_LITERAL="BLOCK_LITERAL";n.PLAIN="PLAIN";n.QUOTE_DOUBLE="QUOTE_DOUBLE";n.QUOTE_SINGLE="QUOTE_SINGLE";t9.Scalar=n;t9.isScalarValue=o9});var _0=O((ZH)=>{var $H=R0(),o=w(),$2=N(),UH="tag:yaml.org,2002:";function HH(q,$,U){if($){let H=U.filter((Z)=>Z.tag===$),X=H.find((Z)=>!Z.format)??H[0];if(!X)throw Error(`Tag ${$} not found`);return X}return U.find((H)=>H.identify?.(q)&&!H.format)}function XH(q,$,U){if(o.isDocument(q))q=q.contents;if(o.isNode(q))return q;if(o.isPair(q)){let T=U.schema[o.MAP].createNode?.(U.schema,null,U);return T.items.push(q),T}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:H,onAnchor:X,onTagObj:Z,schema:G,sourceObjects:z}=U,J=void 0;if(H&&q&&typeof q==="object")if(J=z.get(q),J)return J.anchor??(J.anchor=X(q)),new $H.Alias(J.anchor);else J={anchor:null,node:null},z.set(q,J);if($?.startsWith("!!"))$=UH+$.slice(2);let Q=HH(q,$,G.tags);if(!Q){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let T=new $2.Scalar(q);if(J)J.node=T;return T}Q=q instanceof Map?G[o.MAP]:(Symbol.iterator in Object(q))?G[o.SEQ]:G[o.MAP]}if(Z)Z(Q),delete U.onTagObj;let V=Q?.createNode?Q.createNode(U.schema,q,U):typeof Q?.nodeClass?.from==="function"?Q.nodeClass.from(U.schema,q,U):new $2.Scalar(q);if($)V.tag=$;else if(!Q.default)V.tag=Q.tag;if(J)J.node=V;return V}ZH.createNode=XH});var c0=O((QH)=>{var zH=_0(),u=w(),JH=l0();function Cq(q,$,U){let H=U;for(let X=$.length-1;X>=0;--X){let Z=$[X];if(typeof Z==="number"&&Number.isInteger(Z)&&Z>=0){let G=[];G[Z]=H,H=G}else H=new Map([[Z,H]])}return zH.createNode(H,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var U2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class H2 extends JH.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((U)=>u.isNode(U)||u.isPair(U)?U.clone(q):U),this.range)$.range=this.range.slice();return $}addIn(q,$){if(U2(q))this.add($);else{let[U,...H]=q,X=this.get(U,!0);if(u.isCollection(X))X.addIn(H,$);else if(X===void 0&&this.schema)this.set(U,Cq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}deleteIn(q){let[$,...U]=q;if(U.length===0)return this.delete($);let H=this.get($,!0);if(u.isCollection(H))return H.deleteIn(U);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${U}`)}getIn(q,$){let[U,...H]=q,X=this.get(U,!0);if(H.length===0)return!$&&u.isScalar(X)?X.value:X;else return u.isCollection(X)?X.getIn(H,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!u.isPair($))return!1;let U=$.value;return U==null||q&&u.isScalar(U)&&U.value==null&&!U.commentBefore&&!U.comment&&!U.tag})}hasIn(q){let[$,...U]=q;if(U.length===0)return this.has($);let H=this.get($,!0);return u.isCollection(H)?H.hasIn(U):!1}setIn(q,$){let[U,...H]=q;if(H.length===0)this.set(U,$);else{let X=this.get(U,!0);if(u.isCollection(X))X.setIn(H,$);else if(X===void 0&&this.schema)this.set(U,Cq(this.schema,H,$));else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}}}QH.Collection=H2;QH.collectionFromPath=Cq;QH.isEmptyPath=U2});var L0=O((WH)=>{var VH=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function Eq(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var IH=(q,$,U)=>q.endsWith(`
3
3
  `)?Eq(U,$):U.includes(`
4
4
  `)?`
@@ -137,4 +137,4 @@ ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.pus
137
137
  `,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Array.prototype.push.apply(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let U=!this.onKeyLine&&this.indent===q.indent,H=U&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",X=[];if(H&&$.sep&&!$.value){let Z=[];for(let G=0;G<$.sep.length;++G){let z=$.sep[G];switch(z.type){case"newline":Z.push(G);break;case"space":break;case"comment":if(z.indent>q.indent)Z.length=0;break;default:Z.length=0}}if(Z.length>=2)X=$.sep.splice(Z[1])}switch(this.type){case"anchor":case"tag":if(H||$.value)X.push(this.sourceToken),q.items.push({start:X}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(H||$.value)X.push(this.sourceToken),q.items.push({start:X,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if($.explicitKey)if(!$.sep)if(i($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let Z=I0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]});else if(kU($.key)&&!i($.sep,"newline")){let Z=I0($.start),G=$.key,z=$.sep;z.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:G,sep:z}]})}else if(X.length>0)$.sep=$.sep.concat(X,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||H)q.items.push({start:X,key:null,sep:[this.sourceToken]});else if(i($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(H||$.value)q.items.push({start:X,key:Z,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(Z);else Object.assign($,{key:Z,sep:[]}),this.onKeyLine=!0;return}default:{let Z=this.startBlockValue(q);if(Z){if(Z.type==="block-seq"){if(!$.explicitKey&&$.sep&&!i($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(U)q.items.push({start:X});this.stack.push(Z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let U="end"in $.value?$.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let H=q.items[q.items.length-2]?.value?.end;if(Array.isArray(H)){Array.prototype.push.apply(H,$.start),H.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||i($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let U=this.startBlockValue(q);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:H,sep:[]});else if($.sep)this.stack.push(H);else Object.assign($,{key:H,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let U=this.startBlockValue(q);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===q.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let H=wq(U),X=I0(H);xU(q);let Z=q.end.splice(1,q.end.length);Z.push(this.sourceToken);let G={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
138
138
  `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
139
139
  `,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let $=wq(q),U=I0($);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=wq(q),U=I0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}l6.Parser=vU});var aU=O((e6)=>{var mU=w$(),c6=E0(),x0=g0(),s6=yq(),i6=w(),r6=y$(),pU=h$();function dU(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new r6.LineCounter||null,prettyErrors:$}}function n6(q,$={}){let{lineCounter:U,prettyErrors:H}=dU($),X=new pU.Parser(U?.addNewLine),Z=new mU.Composer($),G=Array.from(Z.compose(X.parse(q)));if(H&&U)for(let z of G)z.errors.forEach(x0.prettifyError(q,U)),z.warnings.forEach(x0.prettifyError(q,U));if(G.length>0)return G;return Object.assign([],{empty:!0},Z.streamInfo())}function lU(q,$={}){let{lineCounter:U,prettyErrors:H}=dU($),X=new pU.Parser(U?.addNewLine),Z=new mU.Composer($),G=null;for(let z of Z.compose(X.parse(q),!0,q.length))if(!G)G=z;else if(G.options.logLevel!=="silent"){G.errors.push(new x0.YAMLParseError(z.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(H&&U)G.errors.forEach(x0.prettifyError(q,U)),G.warnings.forEach(x0.prettifyError(q,U));return G}function o6(q,$,U){let H=void 0;if(typeof $==="function")H=$;else if(U===void 0&&$&&typeof $==="object")U=$;let X=lU(q,U);if(!X)return null;if(X.warnings.forEach((Z)=>s6.warn(X.options.logLevel,Z)),X.errors.length>0)if(X.options.logLevel!=="silent")throw X.errors[0];else X.errors=[];return X.toJS(Object.assign({reviver:H},U))}function t6(q,$,U){let H=null;if(typeof $==="function"||Array.isArray($))H=$;else if(U===void 0&&$)U=$;if(typeof U==="string")U=U.length;if(typeof U==="number"){let X=Math.round(U);U=X<1?void 0:X>8?{indent:8}:{indent:X}}if(q===void 0){let{keepUndefined:X}=U??$??{};if(!X)return}if(i6.isDocument(q)&&!H)return q.toString(U);return new c6.Document(q,H,U).toString(U)}e6.parse=o6;e6.parseAllDocuments=n6;e6.parseDocument=lU;e6.stringify=t6});var c8=O((O8)=>{var X8=w$(),Z8=E0(),G8=Q$(),u$=g0(),z8=R0(),r=w(),J8=l(),Q8=N(),T8=c(),B8=s(),Y8=Aq(),V8=f$(),I8=y$(),W8=h$(),Kq=aU(),cU=W0();O8.Composer=X8.Composer;O8.Document=Z8.Document;O8.Schema=G8.Schema;O8.YAMLError=u$.YAMLError;O8.YAMLParseError=u$.YAMLParseError;O8.YAMLWarning=u$.YAMLWarning;O8.Alias=z8.Alias;O8.isAlias=r.isAlias;O8.isCollection=r.isCollection;O8.isDocument=r.isDocument;O8.isMap=r.isMap;O8.isNode=r.isNode;O8.isPair=r.isPair;O8.isScalar=r.isScalar;O8.isSeq=r.isSeq;O8.Pair=J8.Pair;O8.Scalar=Q8.Scalar;O8.YAMLMap=T8.YAMLMap;O8.YAMLSeq=B8.YAMLSeq;O8.CST=Y8;O8.Lexer=V8.Lexer;O8.LineCounter=I8.LineCounter;O8.Parser=W8.Parser;O8.parse=Kq.parse;O8.parseAllDocuments=Kq.parseAllDocuments;O8.parseDocument=Kq.parseDocument;O8.stringify=Kq.stringify;O8.visit=cU.visit;O8.visitAsync=cU.visitAsync});
140
- export{c8 as Kk};
140
+ export{c8 as Ik};
@@ -1 +1 @@
1
- import"./chunk-hrcxdj3c.js";import"./chunk-9tgp14v7.js";import"./chunk-hz9yw7cs.js";import{Gk as t}from"./chunk-tn356gwf.js";import"./chunk-n849zsd3.js";import"./chunk-b2551zfb.js";import{vl as e}from"./chunk-vd8kwzra.js";import"./chunk-arv4h3h1.js";import"./chunk-z3e4c424.js";var o=e.object({label:e.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),i=e.object({description:e.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:e.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:e.array(o).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:e.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:e.string().optional().describe("自定义输入框的占位符文本")}),s=t(()=>{},{name:"ask_user_questions",description:"Ask the user a question with selectable options",schema:i});var m={name:"interactive",tools:[s]};export{m as InteractiveMiddleware};
1
+ import"./chunk-f0m4532p.js";import"./chunk-pe8mzxwn.js";import"./chunk-hp2jzn9x.js";import{Ek as t}from"./chunk-nk62q95g.js";import"./chunk-nmzx5nmt.js";import"./chunk-q1cxrg0x.js";import{tl as e}from"./chunk-tjg2e8v3.js";import"./chunk-hve2a279.js";import"./chunk-y8qhrx11.js";var o=e.object({label:e.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),i=e.object({description:e.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:e.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:e.array(o).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:e.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:e.string().optional().describe("自定义输入框的占位符文本")}),s=t(()=>{},{name:"ask_user_questions",description:"Ask the user a question with selectable options",schema:i});var m={name:"interactive",tools:[s]};export{m as InteractiveMiddleware};
@@ -1 +1 @@
1
- import{D as f}from"./chunk-4hg13vwj.js";import"./chunk-kmxdq21k.js";import{W as C,Y as _}from"./chunk-dx9k6sdd.js";import{Be as X,Ce as Y,Le as K,Pe as M,ye as g}from"./chunk-1v863afn.js";import{Sf as w,Uf as A}from"./chunk-3dnayvgx.js";import"./chunk-8waww0j9.js";import"./chunk-h0q3dvnv.js";import"./chunk-hrcxdj3c.js";import"./chunk-9tgp14v7.js";import"./chunk-hz9yw7cs.js";import"./chunk-tn356gwf.js";import"./chunk-n849zsd3.js";import"./chunk-t01t72t2.js";import"./chunk-b2551zfb.js";import"./chunk-vd8kwzra.js";import"./chunk-qhzm2qw9.js";import"./chunk-arv4h3h1.js";import{Fl as Q}from"./chunk-z3e4c424.js";var F=Q(g(),1);import{join as R}from"path";function $({type:G,enabled:J=!0}){return C({queryKey:G==="memories"?_.knowledge.memories():_.knowledge.skills(),queryFn:async()=>{let L=R(process.cwd(),".claude",G),N=R(process.env.HOME||"",".deepagents/code",G);try{if(G==="memories")return A(N,L).map((W)=>({...W,type:"memory"}));else return w(N,L).map((W)=>({...W,type:"skill"}))}catch(O){return console.warn(`Failed to load ${G}:`,O),[]}},enabled:J,staleTime:120000})}var H=Q(K(),1),S=(G)=>{return G.length>80?G.slice(0,80)+"...":G},v=({onClose:G})=>{let[J,L]=F.useState("memories"),N=F.useRef(L);F.default.useEffect(()=>{N.current=L},[L]);let{data:O=[]}=$({type:"memories",enabled:J==="memories"}),{data:W=[]}=$({type:"skills",enabled:J==="skills"}),U=F.useCallback(async()=>{return J==="memories"?O:W},[J,O,W]),I=F.useCallback((z,E,Z)=>{let V=S(z.description);return H.jsxDEV(X,{flexDirection:"column",paddingY:1,children:[H.jsxDEV(X,{children:H.jsxDEV(Y,{bold:!0,color:Z?"cyan":"gray",children:[E+1,". ",z.name]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{paddingY:1,children:H.jsxDEV(Y,{color:Z?"white":"gray",children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{children:H.jsxDEV(Y,{color:"cyan",dimColor:!Z,children:[f(z.path),z.category&&H.jsxDEV(Y,{color:"yellow",children:[" ",z.category]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},z.path,!0,void 0,this)},[]),P=F.useCallback((z)=>{console.log("Selected knowledge item:",z.name)},[]),q=F.useMemo(()=>[{id:"memory",label:"记忆",predicate:(z)=>z.type==="memory"},{id:"skill",label:"技能",predicate:(z)=>z.type==="skill"}],[]),B=F.useMemo(()=>({h:(z)=>{N.current("memories"),z.setActiveFilter("memory")},s:(z)=>{N.current("skills"),z.setActiveFilter("skill")}}),[]),h=F.useMemo(()=>({id:"knowledge",title:"知识库",icon:"\uD83D\uDCDA",dataSource:U,searchable:!0,searchFields:["name","description"],searchPlaceholder:"搜索知识库 (名称/描述/分类)...",filterable:!0,filters:q,defaultFilter:J==="memories"?"memory":"skill",itemHeight:8,visibleCount:3,renderItem:I,showCount:!0,onSelect:P,keyMap:B}),[U,q,I,P,B,J]);return H.jsxDEV(M,{config:h,onClose:G},void 0,!1,void 0,this)},m=v;export{m as default};
1
+ import{D as f}from"./chunk-pg1ppq4y.js";import"./chunk-m21hvv91.js";import{W as C,Y as _}from"./chunk-4wnmk2tj.js";import{Ae as Y,Je as K,Ne as M,we as g,ze as X}from"./chunk-c7kd2qrp.js";import{Qf as w,Sf as A}from"./chunk-mnnyjmgw.js";import"./chunk-fzh0v6r0.js";import"./chunk-t6440ajd.js";import"./chunk-f0m4532p.js";import"./chunk-pe8mzxwn.js";import"./chunk-hp2jzn9x.js";import"./chunk-nk62q95g.js";import"./chunk-nmzx5nmt.js";import"./chunk-e8kxa5vj.js";import"./chunk-q1cxrg0x.js";import"./chunk-tjg2e8v3.js";import"./chunk-nsw5168d.js";import"./chunk-hve2a279.js";import{Dl as Q}from"./chunk-y8qhrx11.js";var F=Q(g(),1);import{join as R}from"path";function $({type:G,enabled:J=!0}){return C({queryKey:G==="memories"?_.knowledge.memories():_.knowledge.skills(),queryFn:async()=>{let L=R(process.cwd(),".claude",G),N=R(process.env.HOME||"",".deepagents/code",G);try{if(G==="memories")return A(N,L).map((W)=>({...W,type:"memory"}));else return w(N,L).map((W)=>({...W,type:"skill"}))}catch(O){return console.warn(`Failed to load ${G}:`,O),[]}},enabled:J,staleTime:120000})}var H=Q(K(),1),S=(G)=>{return G.length>80?G.slice(0,80)+"...":G},v=({onClose:G})=>{let[J,L]=F.useState("memories"),N=F.useRef(L);F.default.useEffect(()=>{N.current=L},[L]);let{data:O=[]}=$({type:"memories",enabled:J==="memories"}),{data:W=[]}=$({type:"skills",enabled:J==="skills"}),U=F.useCallback(async()=>{return J==="memories"?O:W},[J,O,W]),I=F.useCallback((z,E,Z)=>{let V=S(z.description);return H.jsxDEV(X,{flexDirection:"column",paddingY:1,children:[H.jsxDEV(X,{children:H.jsxDEV(Y,{bold:!0,color:Z?"cyan":"gray",children:[E+1,". ",z.name]},void 0,!0,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{paddingY:1,children:H.jsxDEV(Y,{color:Z?"white":"gray",children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.jsxDEV(X,{children:H.jsxDEV(Y,{color:"cyan",dimColor:!Z,children:[f(z.path),z.category&&H.jsxDEV(Y,{color:"yellow",children:[" ",z.category]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},z.path,!0,void 0,this)},[]),P=F.useCallback((z)=>{console.log("Selected knowledge item:",z.name)},[]),q=F.useMemo(()=>[{id:"memory",label:"记忆",predicate:(z)=>z.type==="memory"},{id:"skill",label:"技能",predicate:(z)=>z.type==="skill"}],[]),B=F.useMemo(()=>({h:(z)=>{N.current("memories"),z.setActiveFilter("memory")},s:(z)=>{N.current("skills"),z.setActiveFilter("skill")}}),[]),h=F.useMemo(()=>({id:"knowledge",title:"知识库",icon:"\uD83D\uDCDA",dataSource:U,searchable:!0,searchFields:["name","description"],searchPlaceholder:"搜索知识库 (名称/描述/分类)...",filterable:!0,filters:q,defaultFilter:J==="memories"?"memory":"skill",itemHeight:8,visibleCount:3,renderItem:I,showCount:!0,onSelect:P,keyMap:B}),[U,q,I,P,B,J]);return H.jsxDEV(M,{config:h,onClose:G},void 0,!1,void 0,this)},m=v;export{m as default};
@@ -1,4 +1,4 @@
1
- import{Ag as w0,Bg as h8,lg as C8,mg as k,ng as M,og as T,pg as p,qg as e0,rg as R8,vg as e,wg as f0,xg as h,yg as R0,zg as D0}from"./chunk-9tgp14v7.js";import{Vg as C0}from"./chunk-hz9yw7cs.js";import{$j as b0,Aj as O0,Ej as D8,Hj as X0,Ij as O8,Qh as i0,Qj as a,Rj as W8,Tj as P8,Wj as E0,Yj as L8,Zi as d0,ai as P,dj as o,dk as P0,ej as V0,ek as i,hi as q,hj as b8,hk as K0,jj as T0,jk as x0,ki as g0,lj as s0,mh as h0,uh as E8,wj as z0,wk as n0,xj as I0,yi as u,yk as f8}from"./chunk-tn356gwf.js";import{Jk as $}from"./chunk-n849zsd3.js";import{Vk as K8,vl as c}from"./chunk-vd8kwzra.js";var _0=Symbol.for("AgentMiddleware");function S(X){return{[_0]:!0,name:X.name,stateSchema:X.stateSchema,contextSchema:X.contextSchema,wrapToolCall:X.wrapToolCall,wrapModelCall:X.wrapModelCall,beforeAgent:X.beforeAgent,beforeModel:X.beforeModel,afterModel:X.afterModel,afterAgent:X.afterAgent,tools:X.tools}}var v0={openai:{package:"@langchain/openai",className:"ChatOpenAI"},anthropic:{package:"@langchain/anthropic",className:"ChatAnthropic"},azure_openai:{package:"@langchain/openai",className:"AzureChatOpenAI"},cohere:{package:"@langchain/cohere",className:"ChatCohere"},"google-vertexai":{package:"@langchain/google-vertexai",className:"ChatVertexAI"},"google-vertexai-web":{package:"@langchain/google-vertexai-web",className:"ChatVertexAI"},"google-genai":{package:"@langchain/google-genai",className:"ChatGoogleGenerativeAI"},ollama:{package:"@langchain/ollama",className:"ChatOllama"},mistralai:{package:"@langchain/mistralai",className:"ChatMistralAI"},mistral:{package:"@langchain/mistralai",className:"ChatMistralAI"},groq:{package:"@langchain/groq",className:"ChatGroq"},cerebras:{package:"@langchain/cerebras",className:"ChatCerebras"},bedrock:{package:"@langchain/aws",className:"ChatBedrockConverse"},deepseek:{package:"@langchain/deepseek",className:"ChatDeepSeek"},xai:{package:"@langchain/xai",className:"ChatXAI"},fireworks:{package:"@langchain/community/chat_models/fireworks",className:"ChatFireworks",hasCircularDependency:!0},together:{package:"@langchain/community/chat_models/togetherai",className:"ChatTogetherAI",hasCircularDependency:!0},perplexity:{package:"@langchain/community/chat_models/perplexity",className:"ChatPerplexity",hasCircularDependency:!0}},t0=Object.keys(v0);async function c8(X,Q){let Z;if(Q)Z=v0[Q];else{let Y=Object.entries(v0).find(([,J])=>J.className===X);Z=Y?Y[1]:void 0}if(!Z)return;try{return(await import(Z.package))[Z.className]}catch(Y){let J=Y;if("code"in J&&J.code?.toString().includes("ERR_MODULE_NOT_FOUND")&&"message"in J&&typeof J.message==="string"){let K=(J.message.startsWith("Error: ")?J.message.slice(7):J.message).split("Cannot find package '")[1].split("'")[0];throw Error(`Unable to import ${K}. Please install with \`npm install ${K}\` or \`pnpm install ${K}\``)}throw Y}}async function g8(X,Q,Z={}){let Y=Q||m8(X);if(!Y)throw Error(`Unable to infer model provider for { model: ${X} }, please specify modelProvider directly.`);let J=v0[Y];if(!J){let V=t0.join(", ");throw Error(`Unsupported { modelProvider: ${Y} }.
1
+ import{jg as C8,kg as k,lg as M,mg as T,ng as p,og as e0,pg as R8,tg as e,ug as f0,vg as h,wg as R0,xg as D0,yg as w0,zg as h8}from"./chunk-pe8mzxwn.js";import{Tg as C0}from"./chunk-hp2jzn9x.js";import{Cj as D8,Fj as X0,Gj as O8,Oh as i0,Oj as a,Pj as W8,Rj as P8,Uj as E0,Wj as L8,Xi as d0,Zj as b0,_h as P,bj as o,bk as P0,cj as V0,ck as i,fi as q,fj as b8,fk as K0,hj as T0,hk as x0,ii as g0,jj as s0,kh as h0,sh as E8,uj as z0,uk as n0,vj as I0,wi as u,wk as f8,yj as O0}from"./chunk-nk62q95g.js";import{Hk as $}from"./chunk-nmzx5nmt.js";import{Tk as K8,tl as c}from"./chunk-tjg2e8v3.js";var _0=Symbol.for("AgentMiddleware");function S(X){return{[_0]:!0,name:X.name,stateSchema:X.stateSchema,contextSchema:X.contextSchema,wrapToolCall:X.wrapToolCall,wrapModelCall:X.wrapModelCall,beforeAgent:X.beforeAgent,beforeModel:X.beforeModel,afterModel:X.afterModel,afterAgent:X.afterAgent,tools:X.tools}}var v0={openai:{package:"@langchain/openai",className:"ChatOpenAI"},anthropic:{package:"@langchain/anthropic",className:"ChatAnthropic"},azure_openai:{package:"@langchain/openai",className:"AzureChatOpenAI"},cohere:{package:"@langchain/cohere",className:"ChatCohere"},"google-vertexai":{package:"@langchain/google-vertexai",className:"ChatVertexAI"},"google-vertexai-web":{package:"@langchain/google-vertexai-web",className:"ChatVertexAI"},"google-genai":{package:"@langchain/google-genai",className:"ChatGoogleGenerativeAI"},ollama:{package:"@langchain/ollama",className:"ChatOllama"},mistralai:{package:"@langchain/mistralai",className:"ChatMistralAI"},mistral:{package:"@langchain/mistralai",className:"ChatMistralAI"},groq:{package:"@langchain/groq",className:"ChatGroq"},cerebras:{package:"@langchain/cerebras",className:"ChatCerebras"},bedrock:{package:"@langchain/aws",className:"ChatBedrockConverse"},deepseek:{package:"@langchain/deepseek",className:"ChatDeepSeek"},xai:{package:"@langchain/xai",className:"ChatXAI"},fireworks:{package:"@langchain/community/chat_models/fireworks",className:"ChatFireworks",hasCircularDependency:!0},together:{package:"@langchain/community/chat_models/togetherai",className:"ChatTogetherAI",hasCircularDependency:!0},perplexity:{package:"@langchain/community/chat_models/perplexity",className:"ChatPerplexity",hasCircularDependency:!0}},t0=Object.keys(v0);async function c8(X,Q){let Z;if(Q)Z=v0[Q];else{let Y=Object.entries(v0).find(([,J])=>J.className===X);Z=Y?Y[1]:void 0}if(!Z)return;try{return(await import(Z.package))[Z.className]}catch(Y){let J=Y;if("code"in J&&J.code?.toString().includes("ERR_MODULE_NOT_FOUND")&&"message"in J&&typeof J.message==="string"){let K=(J.message.startsWith("Error: ")?J.message.slice(7):J.message).split("Cannot find package '")[1].split("'")[0];throw Error(`Unable to import ${K}. Please install with \`npm install ${K}\` or \`pnpm install ${K}\``)}throw Y}}async function g8(X,Q,Z={}){let Y=Q||m8(X);if(!Y)throw Error(`Unable to infer model provider for { model: ${X} }, please specify modelProvider directly.`);let J=v0[Y];if(!J){let V=t0.join(", ");throw Error(`Unsupported { modelProvider: ${Y} }.
2
2
 
3
3
  Supported model providers are: ${V}`)}let{modelProvider:K,...G}=Z;return new(await c8(J.className,Y))({model:X,...G})}function m8(X){if(X.startsWith("gpt-3")||X.startsWith("gpt-4")||X.startsWith("gpt-5")||X.startsWith("o1")||X.startsWith("o3")||X.startsWith("o4"))return"openai";else if(X.startsWith("claude"))return"anthropic";else if(X.startsWith("command"))return"cohere";else if(X.startsWith("accounts/fireworks"))return"fireworks";else if(X.startsWith("gemini"))return"google-vertexai";else if(X.startsWith("amazon."))return"bedrock";else if(X.startsWith("mistral"))return"mistralai";else if(X.startsWith("sonar")||X.startsWith("pplx"))return"perplexity";else return}var o0=class X extends C0{_llmType(){return"chat_model"}lc_namespace=["langchain","chat_models"];_defaultConfig={};_configurableFields="any";_configPrefix;_queuedMethodOperations={};_modelInstanceCache=new Map;_profile;constructor(Q){super(Q);if(this._defaultConfig=Q.defaultConfig??{},Q.configurableFields==="any")this._configurableFields="any";else this._configurableFields=Q.configurableFields??["model","modelProvider"];if(Q.configPrefix)this._configPrefix=Q.configPrefix.endsWith("_")?Q.configPrefix:`${Q.configPrefix}_`;else this._configPrefix="";this._queuedMethodOperations=Q.queuedMethodOperations??this._queuedMethodOperations,this._profile=Q.profile??void 0}async _getModelInstance(Q){let Z=this._getCacheKey(Q),Y=this._modelInstanceCache.get(Z);if(Y)return Y;let J={...this._defaultConfig,...this._modelParams(Q)},K=await g8(J.model,J.modelProvider,J);for(let[G,V]of Object.entries(this._queuedMethodOperations))if(G in K&&typeof K[G]==="function")K=await K[G](...V);return this._modelInstanceCache.set(Z,K),K}async _generate(Q,Z,Y){return(await this._getModelInstance(Z))._generate(Q,Z??{},Y)}bindTools(Q,Z){let Y={...this._queuedMethodOperations};return Y.bindTools=[Q,Z],new X({defaultConfig:this._defaultConfig,configurableFields:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:Y})}withStructuredOutput=(Q,...Z)=>{let Y={...this._queuedMethodOperations};return Y.withStructuredOutput=[Q,...Z],new X({defaultConfig:this._defaultConfig,configurableFields:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:Y})};_modelParams(Q){let Z=Q?.configurable??{},Y={};for(let[J,K]of Object.entries(Z))if(J.startsWith(this._configPrefix)){let G=this._removePrefix(J,this._configPrefix);Y[G]=K}if(this._configurableFields!=="any")Y=Object.fromEntries(Object.entries(Y).filter(([J])=>this._configurableFields.includes(J)));return Y}_removePrefix(Q,Z){return Q.startsWith(Z)?Q.slice(Z.length):Q}withConfig(Q){let Z={...Q||{}},Y=this._modelParams(Z),J=Object.fromEntries(Object.entries(Z).filter(([K])=>K!=="configurable"));return J.configurable=Object.fromEntries(Object.entries(Z.configurable||{}).filter(([K])=>this._configPrefix&&!Object.keys(Y).includes(this._removePrefix(K,this._configPrefix)))),new i({config:Z,bound:new X({defaultConfig:{...this._defaultConfig,...Y},configurableFields:Array.isArray(this._configurableFields)?[...this._configurableFields]:this._configurableFields,configPrefix:this._configPrefix,queuedMethodOperations:this._queuedMethodOperations})})}async invoke(Q,Z){let Y=await this._getModelInstance(Z),J=V0(Z);return Y.invoke(Q,J)}async stream(Q,Z){let Y=new s0({generator:await(await this._getModelInstance(Z)).stream(Q,Z),config:Z});return await Y.setup,T0.fromAsyncGenerator(Y)}async batch(Q,Z,Y){return super.batch(Q,Z,Y)}async*transform(Q,Z){let Y=await this._getModelInstance(Z),J=V0(Z);yield*Y.transform(Q,J)}async*streamLog(Q,Z,Y){let J=await this._getModelInstance(Z),K=V0(Z);yield*J.streamLog(Q,K,{...Y,_schemaFormat:"original",includeNames:Y?.includeNames,includeTypes:Y?.includeTypes,includeTags:Y?.includeTags,excludeNames:Y?.excludeNames,excludeTypes:Y?.excludeTypes,excludeTags:Y?.excludeTags})}streamEvents(Q,Z,Y){let J=this;async function*K(){let G=await J._getModelInstance(Z),V=V0(Z),U=G.streamEvents(Q,V,Y);for await(let W of U)yield W}return T0.fromAsyncGenerator(K())}get profile(){if(this._profile)return this._profile;let Q=this._getCacheKey({});return this._modelInstanceCache.get(Q)?.profile??{}}_getCacheKey(Q){let Z=Q??{};if(Z.configurable){let{configurable:Y}=Z,J={};for(let[K,G]of Object.entries(Y))if(!K.startsWith("__pregel_"))J[K]=G;Z={...Z,configurable:J}}return JSON.stringify(Z)}};async function s(X,Q){let{configurableFields:Z,configPrefix:Y,modelProvider:J,profile:K,...G}={configPrefix:"",...Q??{}};if(J===void 0&&X?.includes(":")){let[z,...F]=X.split(":"),j=F.length===0?[z]:[z,F.join(":")];if(t0.includes(j[0]))[J,X]=j}let V=Array.isArray(Z)?[...Z]:Z;if(!X&&V===void 0)V=["model","modelProvider"];if(Y&&V===void 0)console.warn(`{ configPrefix: ${Y} } has been set but no fields are configurable. Set { configurableFields: [...] } to specify the model params that are configurable.`);let U={...G},W;if(V===void 0)W=new o0({defaultConfig:{...U,model:X,modelProvider:J},configPrefix:Y,profile:K});else{if(X)U.model=X;if(J)U.modelProvider=J;W=new o0({defaultConfig:U,configPrefix:Y,configurableFields:V,profile:K})}return await W._getModelInstance(),W}var H0=class extends Error{constructor(){super("The provided LLM already has bound tools. Please provide an LLM without bound tools to createAgent. The agent will bind the tools provided in the 'tools' parameter.")}},U0=class extends Error{toolNames;constructor(X){super(`The model has called multiple tools: ${X.join(", ")} to return a structured output. This is not supported. Please provide a single structured output.`);this.toolNames=X}},F0=class extends Error{toolName;errors;constructor(X,Q){super(`Failed to parse structured output for tool '${X}':${Q.map((Z)=>`
4
4
  - ${Z}`).join("")}.`);this.toolName=X,this.errors=Q}},B0=class extends Error{toolCall;toolError;constructor(X,Q){let Z=X instanceof Error?X:Error(String(X)),Y=JSON.stringify(Q.args);super(`Error invoking tool '${Q.name}' with kwargs ${Y} with error: ${Z.stack}
@@ -51,4 +51,4 @@ Respond ONLY with the extracted context. Do not include any additional informati
51
51
  Messages to summarize:
52
52
  {messages}
53
53
  </messages>`;var z6=$.function().args($.array($.custom())).returns($.union([$.number(),$.promise($.number())])),L0=$.object({fraction:$.number().gt(0,"Fraction must be greater than 0").max(1,"Fraction must be less than or equal to 1").optional(),tokens:$.number().positive("Tokens must be greater than 0").optional(),messages:$.number().int("Messages must be an integer").positive("Messages must be greater than 0").optional()}).refine((X)=>{return[X.fraction,X.tokens,X.messages].filter((Q)=>Q!==void 0).length>=1},{message:"At least one of fraction, tokens, or messages must be provided"}),r0=$.object({fraction:$.number().min(0,"Messages must be non-negative").max(1,"Fraction must be less than or equal to 1").optional(),tokens:$.number().min(0,"Tokens must be greater than or equal to 0").optional(),messages:$.number().int("Messages must be an integer").min(0,"Messages must be non-negative").optional()}).refine((X)=>{return[X.fraction,X.tokens,X.messages].filter((Q)=>Q!==void 0).length===1},{message:"Exactly one of fraction, tokens, or messages must be provided"}),t1=$.object({model:$.custom(),trigger:$.union([L0,$.array(L0)]).optional(),keep:r0.optional(),tokenCounter:z6.optional(),summaryPrompt:$.string().default(j6),trimTokensToSummarize:$.number().optional(),summaryPrefix:$.string().optional(),maxTokensBeforeSummary:$.number().optional(),messagesToKeep:$.number().optional()});function a0(X){if("profile"in X&&typeof X.profile==="object"&&X.profile&&"maxInputTokens"in X.profile&&(typeof X.profile.maxInputTokens==="number"||X.profile.maxInputTokens==null))return X.profile.maxInputTokens??void 0;if("model"in X&&typeof X.model==="string")return n0(X.model);if("modelName"in X&&typeof X.modelName==="string")return n0(X.modelName)}var GX=$.object({model:$.string().or($.instanceof(f8)).optional(),systemPrompt:$.string().optional(),maxTools:$.number().optional(),alwaysInclude:$.array($.string()).optional()});var DX=$.object({applyToInput:$.boolean().optional(),applyToOutput:$.boolean().optional(),applyToToolResults:$.boolean().optional()});var vX=$.object({rules:$.record($.string(),$.instanceof(RegExp).describe("Regular expression pattern to match PII")).optional()});var D6="[cleared]",P6=1e5,A0=3,u8=class{#X;trigger;keep;clearToolInputs;excludeTools;placeholder;model;clearAtLeast;constructor(X={}){let Q=X.trigger;if(X.triggerTokens!==void 0){if(console.warn("triggerTokens is deprecated. Use `trigger: { tokens: value }` instead."),Q===void 0)Q={tokens:X.triggerTokens}}let Z=X.keep;if(X.keepMessages!==void 0){if(console.warn("keepMessages is deprecated. Use `keep: { messages: value }` instead."),Z===void 0)Z={messages:X.keepMessages}}if(Q===void 0)Q={tokens:P6};if(Z===void 0)Z={messages:A0};if(Array.isArray(Q))this.#X=Q.map((Y)=>L0.parse(Y)),this.trigger=this.#X;else{let Y=L0.parse(Q);this.#X=[Y],this.trigger=Y}if(this.keep=r0.parse(Z),X.clearAtLeast!==void 0)console.warn("clearAtLeast is deprecated and will be removed in a future version. It conflicts with the `keep` property. Use `keep: { tokens: value }` or `keep: { messages: value }` instead to control retention.");this.clearAtLeast=X.clearAtLeast??0,this.clearToolInputs=X.clearToolInputs??!1,this.excludeTools=new Set(X.excludeTools??[]),this.placeholder=X.placeholder??D6}async apply(X){let{messages:Q,model:Z,countTokens:Y}=X,J=await Y(Q),K=[];for(let j=0;j<Q.length;j++){let B=Q[j];if(P.isInstance(B)){let A=this.#Q(Q.slice(0,j),B.tool_call_id);if(!A)K.push(j);else if(!A.tool_calls?.find((E)=>E.id===B.tool_call_id))K.push(j)}}for(let j=K.length-1;j>=0;j--)Q.splice(K[j],1);let G=J;if(K.length>0)G=await Y(Q);if(!this.#Z(Q,G,Z))return;let V=[];for(let j=0;j<Q.length;j++){let B=Q[j];if(P.isInstance(B))V.push({idx:j,msg:B})}if(V.length===0)return;let U=await this.#J(V,Y,Z),W=U>=V.length?[]:U>0?V.slice(0,-U):V,z=0,F=[...W];for(let{idx:j,msg:B}of F){if(B.response_metadata?.context_editing?.cleared)continue;let A=this.#Q(Q.slice(0,j),B.tool_call_id);if(!A)continue;let E=A.tool_calls?.find((O)=>O.id===B.tool_call_id);if(!E)continue;let _=B.name||E.name;if(this.excludeTools.has(_))continue;if(Q[j]=new P({tool_call_id:B.tool_call_id,content:this.placeholder,name:B.name,artifact:void 0,response_metadata:{...B.response_metadata,context_editing:{cleared:!0,strategy:"clear_tool_uses"}}}),this.clearToolInputs){let O=Q.indexOf(A);if(O>=0)Q[O]=this.#Y(A,B.tool_call_id)}let R=await Y(Q);z=Math.max(0,G-R)}if(this.clearAtLeast>0&&z<this.clearAtLeast){let j=U>0&&U<V.length?V.slice(-U):[];for(let B=j.length-1;B>=0;B--){if(z>=this.clearAtLeast)break;let{idx:A,msg:E}=j[B];if(E.response_metadata?.context_editing?.cleared)continue;let _=this.#Q(Q.slice(0,A),E.tool_call_id);if(!_)continue;let R=_.tool_calls?.find((C)=>C.id===E.tool_call_id);if(!R)continue;let O=E.name||R.name;if(this.excludeTools.has(O))continue;if(Q[A]=new P({tool_call_id:E.tool_call_id,content:this.placeholder,name:E.name,artifact:void 0,response_metadata:{...E.response_metadata,context_editing:{cleared:!0,strategy:"clear_tool_uses"}}}),this.clearToolInputs){let C=Q.indexOf(_);if(C>=0)Q[C]=this.#Y(_,E.tool_call_id)}let m=await Y(Q);z=Math.max(0,G-m)}}}#Z(X,Q,Z){for(let Y of this.#X){let J=!0,K=!1;if(Y.messages!==void 0){if(K=!0,X.length<Y.messages)J=!1}if(Y.tokens!==void 0){if(K=!0,Q<Y.tokens)J=!1}if(Y.fraction!==void 0){if(K=!0,!Z)continue;let G=a0(Z);if(typeof G==="number"){let V=Math.floor(G*Y.fraction);if(V<=0)continue;if(Q<V)J=!1}else continue}if(K&&J)return!0}return!1}async#J(X,Q,Z){if("messages"in this.keep&&this.keep.messages!==void 0)return this.keep.messages;if("tokens"in this.keep&&this.keep.tokens!==void 0){let Y=this.keep.tokens,J=0,K=0;for(let G=X.length-1;G>=0;G--){let V=X[G],U=await Q([V.msg]);if(J+U<=Y)J+=U,K++;else break}return K}if("fraction"in this.keep&&this.keep.fraction!==void 0){if(!Z)return A0;let Y=a0(Z);if(typeof Y==="number"){let J=Math.floor(Y*this.keep.fraction);if(J<=0)return A0;let K=0,G=0;for(let V=X.length-1;V>=0;V--){let U=X[V],W=await Q([U.msg]);if(K+W<=J)K+=W,G++;else break}return G}}return A0}#Q(X,Q){for(let Z=X.length-1;Z>=0;Z--){let Y=X[Z];if(q.isInstance(Y)){if(Y.tool_calls?.some((J)=>J.id===Q))return Y}}return null}#Y(X,Q){let Z=X.tool_calls?.map((G)=>{if(G.id===Q)return{...G,args:{}};return G}),Y={...X.response_metadata},J={...Y.context_editing},K=new Set(J.cleared_tool_inputs);return K.add(Q),J.cleared_tool_inputs=Array.from(K).sort(),Y.context_editing=J,new q({content:X.content,tool_calls:Z,response_metadata:Y,id:X.id,name:X.name,additional_kwargs:X.additional_kwargs})}};var L6=["continue","error","end"],q6="continue";var _6=$.enum(L6).default(q6);var AX=$.object({toolName:$.string().optional(),threadLimit:$.number().optional(),runLimit:$.number().optional(),exitBehavior:_6}),NX=$.object({threadToolCallCount:$.record($.string(),$.number()).default({}),runToolCallCount:$.record($.string(),$.number()).default({})});var F6=$.enum(["pending","in_progress","completed"]).describe("Status of the todo"),b6=$.object({content:$.string().describe("Content of the todo item"),status:F6}),pX=$.object({todos:$.array(b6).default([])});var iX=$.object({threadLimit:$.number().optional(),runLimit:$.number().optional(),exitBehavior:$.enum(["error","end"]).optional()}),nX=$.object({threadModelCallCount:$.number().default(0),runModelCallCount:$.number().default(0)});var N0=$.object({maxRetries:$.number().min(0).default(2),retryOn:$.union([$.function().args($.instanceof(Error)).returns($.boolean()),$.array($.custom())]).default(()=>()=>!0),backoffFactor:$.number().min(0).default(2),initialDelayMs:$.number().min(0).default(1000),maxDelayMs:$.number().min(0).default(60000),jitter:$.boolean().default(!0)});var $Q=$.object({onFailure:$.union([$.literal("error"),$.literal("continue"),$.function().args($.instanceof(Error)).returns($.string())]).default("continue")}).merge(N0);var zQ=$.object({tools:$.array($.union([$.custom(),$.custom(),$.string()])).optional(),onFailure:$.union([$.literal("error"),$.literal("continue"),$.literal("raise"),$.literal("return_message"),$.function().args($.instanceof(Error)).returns($.string())]).default("continue")}).merge(N0);var EQ=$.object({enableCaching:$.boolean().optional(),ttl:$.enum(["5m","1h"]).optional(),minMessagesToCache:$.number().optional(),unsupportedModelBehavior:$.enum(["ignore","warn","raise"]).optional()});
54
- export{S as jg,$6 as kg};
54
+ export{S as hg,$6 as ig};
@@ -1 +1 @@
1
- import{a as A,b as W}from"./chunk-yerf10k7.js";import"./chunk-qmxtys9q.js";import{Fg as q,_g as R}from"./chunk-hz9yw7cs.js";import"./chunk-tn356gwf.js";import"./chunk-n849zsd3.js";import"./chunk-vd8kwzra.js";import"./chunk-arv4h3h1.js";import{Fl as V}from"./chunk-z3e4c424.js";var x=V(W(),1);function B(M){if(M===null||typeof M!=="object")return JSON.stringify(M);if(Array.isArray(M))return JSON.stringify(M.map((J)=>B(J)));let F={},G=Object.keys(M).sort();for(let J of G)F[J]=M[J];return JSON.stringify(F,(J,Q)=>{if(Q!==null&&typeof Q==="object"&&!Array.isArray(Q)){let X={},Y=Object.keys(Q).sort();for(let Z of Y)X[Z]=Q[Z];return X}return Q})}var P=[{index:"checkpoints",prefix:"checkpoint:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.parent_checkpoint_id":{type:"TAG",AS:"parent_checkpoint_id"},"$.checkpoint_ts":{type:"NUMERIC",AS:"checkpoint_ts"},"$.has_writes":{type:"TAG",AS:"has_writes"},"$.source":{type:"TAG",AS:"source"},"$.step":{type:"NUMERIC",AS:"step"}}},{index:"checkpoint_writes",prefix:"checkpoint_write:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.task_id":{type:"TAG",AS:"task_id"},"$.idx":{type:"NUMERIC",AS:"idx"},"$.channel":{type:"TAG",AS:"channel"},"$.type":{type:"TAG",AS:"type"}}}],N=class M extends R{client;ttlConfig;constructor(F,G){super();this.client=F,this.ttlConfig=G}static async fromUrl(F,G){let J=x.createClient({url:F});await J.connect();let Q=new M(J,G);return await Q.ensureIndexes(),Q}async get(F){return(await this.getTuple(F))?.checkpoint}async put(F,G,J,Q){await this.ensureIndexes();let X=F.configurable?.thread_id,Y=F.configurable?.checkpoint_ns??"",Z=F.configurable?.checkpoint_id;if(!X)throw Error("thread_id is required");let _=G.id||q(0),E=`checkpoint:${X}:${Y}:shallow`,H=null,$=null;try{if(H=await this.client.json.get(E),H&&typeof H==="object")$=H.checkpoint_id}catch(O){}if($&&$!==_)await this.cleanupOldCheckpoint(X,Y,$);let L={...G,channel_values:G.channel_values||{},channel_blobs:void 0},U={thread_id:X,checkpoint_ns:Y,checkpoint_id:_,parent_checkpoint_id:Z||null,checkpoint:L,metadata:this.sanitizeMetadata(J),checkpoint_ts:Date.now(),has_writes:"false"};if(this.addSearchableMetadataFields(U,J),await this.client.json.set(E,"$",U),this.ttlConfig?.defaultTTL)await this.applyTTL(E);return{configurable:{thread_id:X,checkpoint_ns:Y,checkpoint_id:_}}}async getTuple(F){let G=F.configurable?.thread_id,J=F.configurable?.checkpoint_ns??"",Q=F.configurable?.checkpoint_id;if(!G)return;let X=`checkpoint:${G}:${J}:shallow`,Y=await this.client.json.get(X);if(!Y)return;if(Q&&Y.checkpoint_id!==Q)return;if(this.ttlConfig?.refreshOnRead&&this.ttlConfig?.defaultTTL)await this.applyTTL(X);let Z=await this.serde.loadsTyped("json",JSON.stringify(Y.checkpoint)),_;if(Y.has_writes==="true")_=await this.loadPendingWrites(Y.thread_id,Y.checkpoint_ns,Y.checkpoint_id);return await this.createCheckpointTuple(Y,Z,_)}async*list(F,G){if(await this.ensureIndexes(),F?.configurable?.thread_id){let J=await this.getTuple(F);if(J)if(G?.filter){if(this.checkMetadataFilterMatch(J.metadata,G.filter))yield J}else yield J}else{let J=[];if(G?.filter){for(let[Y,Z]of Object.entries(G.filter))if(Z===void 0);else if(Z===null);else if(typeof Z==="string"){let _=A(Y),E=A(Z);J.push(`(@${_}:{${E}})`)}else if(typeof Z==="number"){let _=A(Y);J.push(`(@${_}:[${Z} ${Z}])`)}}if(J.length===0)J.push("*");let Q=J.join(" "),X=G?.limit??10;try{let Y=await this.client.ft.search("checkpoints",Q,{LIMIT:{from:0,size:X*2},SORTBY:{BY:"checkpoint_ts",DIRECTION:"DESC"}}),Z=new Set,_=0;for(let E of Y.documents){if(_>=X)break;let H=E.value,$=`${H.thread_id}:${H.checkpoint_ns}`;if(Z.has($))continue;if(Z.add($),G?.filter){if(!this.checkMetadataFilterMatch(H.metadata,G.filter))continue}let L=await this.serde.loadsTyped("json",JSON.stringify(H.checkpoint));yield await this.createCheckpointTuple(H,L),_++}}catch(Y){if(Y.message?.includes("no such index")){let Z=await this.client.keys("checkpoint:*:*:shallow");if(Z.length===0)return;Z.sort().reverse();let _=new Set,E=0,H=G?.limit??10;for(let $ of Z){if(E>=H)break;let L=await this.client.json.get($);if(!L)continue;let U=`${L.thread_id}:${L.checkpoint_ns}`;if(_.has(U))continue;if(_.add(U),G?.filter){if(!this.checkMetadataFilterMatch(L.metadata,G.filter))continue}let O=await this.serde.loadsTyped("json",JSON.stringify(L.checkpoint));yield await this.createCheckpointTuple(L,O),E++}return}throw Y}}}async putWrites(F,G,J){await this.ensureIndexes();let Q=F.configurable?.thread_id,X=F.configurable?.checkpoint_ns??"",Y=F.configurable?.checkpoint_id;if(!Q||!Y)throw Error("thread_id and checkpoint_id are required");let Z=`checkpoint_write:${Q}:${X}:${Y}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_);let E=[];for(let $=0;$<G.length;$++){let[L,U]=G[$],O=`checkpoint_write:${Q}:${X}:${Y}:${J}:${$}`;E.push(O);let T={thread_id:Q,checkpoint_ns:X,checkpoint_id:Y,task_id:J,idx:$,channel:L,type:typeof U==="object"?"json":"string",value:U};await this.client.json.set(O,"$",T)}if(E.length>0){let $=`write_keys_zset:${Q}:${X}:${Y}`,L={};if(E.forEach((U,O)=>{L[U]=O}),await this.client.zAdd($,Object.entries(L).map(([U,O])=>({score:O,value:U}))),this.ttlConfig?.defaultTTL)await this.applyTTL(...E,$)}let H=`checkpoint:${Q}:${X}:shallow`;if(await this.client.exists(H)){let $=await this.client.json.get(H);if($)$.has_writes="true",await this.client.json.set(H,"$",$)}}async deleteThread(F){let G=`checkpoint:${F}:*:shallow`,J=await this.client.keys(G);if(J.length>0)await this.client.del(J);let Q=`checkpoint_write:${F}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:*`,Z=await this.client.keys(Y);if(Z.length>0)await this.client.del(Z)}async end(){await this.client.quit()}addSearchableMetadataFields(F,G){if(!G)return;if("source"in G)F.source=G.source;if("step"in G)F.step=G.step;if("writes"in G)F.writes=typeof G.writes==="object"?JSON.stringify(G.writes):G.writes;if("score"in G)F.score=G.score}async createCheckpointTuple(F,G,J){let Q=await this.serde.loadsTyped("json",JSON.stringify(F.metadata));return{config:{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.checkpoint_id}},checkpoint:G,metadata:Q,parentConfig:F.parent_checkpoint_id?{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.parent_checkpoint_id}}:void 0,pendingWrites:J}}async applyTTL(...F){if(!this.ttlConfig?.defaultTTL)return;let G=Math.floor(this.ttlConfig.defaultTTL*60),J=await Promise.allSettled(F.map((Q)=>this.client.expire(Q,G)));for(let Q=0;Q<J.length;Q++)if(J[Q].status==="rejected")console.warn(`Failed to set TTL for key ${F[Q]}:`,J[Q].reason)}async loadPendingWrites(F,G,J){let Q=`write_keys_zset:${F}:${G}:${J}`,X=await this.client.zRange(Q,0,-1);if(X.length===0)return;let Y=[];for(let Z of X){let _=await this.client.json.get(Z);if(_){let E=await this.serde.loadsTyped("json",JSON.stringify(_.value));Y.push([_.task_id,_.channel,E])}}return Y}checkMetadataFilterMatch(F,G){for(let[J,Q]of Object.entries(G)){let X=F?.[J];if(Q===null){if(!(J in(F||{}))||X!==null)return!1}else if(typeof Q==="object"&&!Array.isArray(Q)){if(typeof X!=="object"||X===null)return!1;if(B(Q)!==B(X))return!1}else if(X!==Q)return!1}return!0}async cleanupOldCheckpoint(F,G,J){let Q=`checkpoint_write:${F}:${G}:${J}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:${G}:${J}`;await this.client.del(Y);let Z=`checkpoint_blob:${F}:${G}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_)}sanitizeMetadata(F){if(!F)return{};let G={};for(let[J,Q]of Object.entries(F)){let X=J.replace(/\x00/g,"");G[X]=typeof Q==="string"?Q.replace(/\x00/g,""):Q}return G}async ensureIndexes(){for(let F of P)try{await this.client.ft.create(F.index,F.schema,{ON:"JSON",PREFIX:F.prefix})}catch(G){if(!G.message?.includes("Index already exists"))console.error(`Failed to create index ${F.index}:`,G.message)}}};export{N as ShallowRedisSaver};
1
+ import{a as A,b as W}from"./chunk-8tbtavry.js";import"./chunk-spa69h7p.js";import{Dg as q,Yg as R}from"./chunk-hp2jzn9x.js";import"./chunk-nk62q95g.js";import"./chunk-nmzx5nmt.js";import"./chunk-tjg2e8v3.js";import"./chunk-hve2a279.js";import{Dl as V}from"./chunk-y8qhrx11.js";var x=V(W(),1);function B(M){if(M===null||typeof M!=="object")return JSON.stringify(M);if(Array.isArray(M))return JSON.stringify(M.map((J)=>B(J)));let F={},G=Object.keys(M).sort();for(let J of G)F[J]=M[J];return JSON.stringify(F,(J,Q)=>{if(Q!==null&&typeof Q==="object"&&!Array.isArray(Q)){let X={},Y=Object.keys(Q).sort();for(let Z of Y)X[Z]=Q[Z];return X}return Q})}var P=[{index:"checkpoints",prefix:"checkpoint:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.parent_checkpoint_id":{type:"TAG",AS:"parent_checkpoint_id"},"$.checkpoint_ts":{type:"NUMERIC",AS:"checkpoint_ts"},"$.has_writes":{type:"TAG",AS:"has_writes"},"$.source":{type:"TAG",AS:"source"},"$.step":{type:"NUMERIC",AS:"step"}}},{index:"checkpoint_writes",prefix:"checkpoint_write:",schema:{"$.thread_id":{type:"TAG",AS:"thread_id"},"$.checkpoint_ns":{type:"TAG",AS:"checkpoint_ns"},"$.checkpoint_id":{type:"TAG",AS:"checkpoint_id"},"$.task_id":{type:"TAG",AS:"task_id"},"$.idx":{type:"NUMERIC",AS:"idx"},"$.channel":{type:"TAG",AS:"channel"},"$.type":{type:"TAG",AS:"type"}}}],N=class M extends R{client;ttlConfig;constructor(F,G){super();this.client=F,this.ttlConfig=G}static async fromUrl(F,G){let J=x.createClient({url:F});await J.connect();let Q=new M(J,G);return await Q.ensureIndexes(),Q}async get(F){return(await this.getTuple(F))?.checkpoint}async put(F,G,J,Q){await this.ensureIndexes();let X=F.configurable?.thread_id,Y=F.configurable?.checkpoint_ns??"",Z=F.configurable?.checkpoint_id;if(!X)throw Error("thread_id is required");let _=G.id||q(0),E=`checkpoint:${X}:${Y}:shallow`,H=null,$=null;try{if(H=await this.client.json.get(E),H&&typeof H==="object")$=H.checkpoint_id}catch(O){}if($&&$!==_)await this.cleanupOldCheckpoint(X,Y,$);let L={...G,channel_values:G.channel_values||{},channel_blobs:void 0},U={thread_id:X,checkpoint_ns:Y,checkpoint_id:_,parent_checkpoint_id:Z||null,checkpoint:L,metadata:this.sanitizeMetadata(J),checkpoint_ts:Date.now(),has_writes:"false"};if(this.addSearchableMetadataFields(U,J),await this.client.json.set(E,"$",U),this.ttlConfig?.defaultTTL)await this.applyTTL(E);return{configurable:{thread_id:X,checkpoint_ns:Y,checkpoint_id:_}}}async getTuple(F){let G=F.configurable?.thread_id,J=F.configurable?.checkpoint_ns??"",Q=F.configurable?.checkpoint_id;if(!G)return;let X=`checkpoint:${G}:${J}:shallow`,Y=await this.client.json.get(X);if(!Y)return;if(Q&&Y.checkpoint_id!==Q)return;if(this.ttlConfig?.refreshOnRead&&this.ttlConfig?.defaultTTL)await this.applyTTL(X);let Z=await this.serde.loadsTyped("json",JSON.stringify(Y.checkpoint)),_;if(Y.has_writes==="true")_=await this.loadPendingWrites(Y.thread_id,Y.checkpoint_ns,Y.checkpoint_id);return await this.createCheckpointTuple(Y,Z,_)}async*list(F,G){if(await this.ensureIndexes(),F?.configurable?.thread_id){let J=await this.getTuple(F);if(J)if(G?.filter){if(this.checkMetadataFilterMatch(J.metadata,G.filter))yield J}else yield J}else{let J=[];if(G?.filter){for(let[Y,Z]of Object.entries(G.filter))if(Z===void 0);else if(Z===null);else if(typeof Z==="string"){let _=A(Y),E=A(Z);J.push(`(@${_}:{${E}})`)}else if(typeof Z==="number"){let _=A(Y);J.push(`(@${_}:[${Z} ${Z}])`)}}if(J.length===0)J.push("*");let Q=J.join(" "),X=G?.limit??10;try{let Y=await this.client.ft.search("checkpoints",Q,{LIMIT:{from:0,size:X*2},SORTBY:{BY:"checkpoint_ts",DIRECTION:"DESC"}}),Z=new Set,_=0;for(let E of Y.documents){if(_>=X)break;let H=E.value,$=`${H.thread_id}:${H.checkpoint_ns}`;if(Z.has($))continue;if(Z.add($),G?.filter){if(!this.checkMetadataFilterMatch(H.metadata,G.filter))continue}let L=await this.serde.loadsTyped("json",JSON.stringify(H.checkpoint));yield await this.createCheckpointTuple(H,L),_++}}catch(Y){if(Y.message?.includes("no such index")){let Z=await this.client.keys("checkpoint:*:*:shallow");if(Z.length===0)return;Z.sort().reverse();let _=new Set,E=0,H=G?.limit??10;for(let $ of Z){if(E>=H)break;let L=await this.client.json.get($);if(!L)continue;let U=`${L.thread_id}:${L.checkpoint_ns}`;if(_.has(U))continue;if(_.add(U),G?.filter){if(!this.checkMetadataFilterMatch(L.metadata,G.filter))continue}let O=await this.serde.loadsTyped("json",JSON.stringify(L.checkpoint));yield await this.createCheckpointTuple(L,O),E++}return}throw Y}}}async putWrites(F,G,J){await this.ensureIndexes();let Q=F.configurable?.thread_id,X=F.configurable?.checkpoint_ns??"",Y=F.configurable?.checkpoint_id;if(!Q||!Y)throw Error("thread_id and checkpoint_id are required");let Z=`checkpoint_write:${Q}:${X}:${Y}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_);let E=[];for(let $=0;$<G.length;$++){let[L,U]=G[$],O=`checkpoint_write:${Q}:${X}:${Y}:${J}:${$}`;E.push(O);let T={thread_id:Q,checkpoint_ns:X,checkpoint_id:Y,task_id:J,idx:$,channel:L,type:typeof U==="object"?"json":"string",value:U};await this.client.json.set(O,"$",T)}if(E.length>0){let $=`write_keys_zset:${Q}:${X}:${Y}`,L={};if(E.forEach((U,O)=>{L[U]=O}),await this.client.zAdd($,Object.entries(L).map(([U,O])=>({score:O,value:U}))),this.ttlConfig?.defaultTTL)await this.applyTTL(...E,$)}let H=`checkpoint:${Q}:${X}:shallow`;if(await this.client.exists(H)){let $=await this.client.json.get(H);if($)$.has_writes="true",await this.client.json.set(H,"$",$)}}async deleteThread(F){let G=`checkpoint:${F}:*:shallow`,J=await this.client.keys(G);if(J.length>0)await this.client.del(J);let Q=`checkpoint_write:${F}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:*`,Z=await this.client.keys(Y);if(Z.length>0)await this.client.del(Z)}async end(){await this.client.quit()}addSearchableMetadataFields(F,G){if(!G)return;if("source"in G)F.source=G.source;if("step"in G)F.step=G.step;if("writes"in G)F.writes=typeof G.writes==="object"?JSON.stringify(G.writes):G.writes;if("score"in G)F.score=G.score}async createCheckpointTuple(F,G,J){let Q=await this.serde.loadsTyped("json",JSON.stringify(F.metadata));return{config:{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.checkpoint_id}},checkpoint:G,metadata:Q,parentConfig:F.parent_checkpoint_id?{configurable:{thread_id:F.thread_id,checkpoint_ns:F.checkpoint_ns,checkpoint_id:F.parent_checkpoint_id}}:void 0,pendingWrites:J}}async applyTTL(...F){if(!this.ttlConfig?.defaultTTL)return;let G=Math.floor(this.ttlConfig.defaultTTL*60),J=await Promise.allSettled(F.map((Q)=>this.client.expire(Q,G)));for(let Q=0;Q<J.length;Q++)if(J[Q].status==="rejected")console.warn(`Failed to set TTL for key ${F[Q]}:`,J[Q].reason)}async loadPendingWrites(F,G,J){let Q=`write_keys_zset:${F}:${G}:${J}`,X=await this.client.zRange(Q,0,-1);if(X.length===0)return;let Y=[];for(let Z of X){let _=await this.client.json.get(Z);if(_){let E=await this.serde.loadsTyped("json",JSON.stringify(_.value));Y.push([_.task_id,_.channel,E])}}return Y}checkMetadataFilterMatch(F,G){for(let[J,Q]of Object.entries(G)){let X=F?.[J];if(Q===null){if(!(J in(F||{}))||X!==null)return!1}else if(typeof Q==="object"&&!Array.isArray(Q)){if(typeof X!=="object"||X===null)return!1;if(B(Q)!==B(X))return!1}else if(X!==Q)return!1}return!0}async cleanupOldCheckpoint(F,G,J){let Q=`checkpoint_write:${F}:${G}:${J}:*`,X=await this.client.keys(Q);if(X.length>0)await this.client.del(X);let Y=`write_keys_zset:${F}:${G}:${J}`;await this.client.del(Y);let Z=`checkpoint_blob:${F}:${G}:${J}:*`,_=await this.client.keys(Z);if(_.length>0)await this.client.del(_)}sanitizeMetadata(F){if(!F)return{};let G={};for(let[J,Q]of Object.entries(F)){let X=J.replace(/\x00/g,"");G[X]=typeof Q==="string"?Q.replace(/\x00/g,""):Q}return G}async ensureIndexes(){for(let F of P)try{await this.client.ft.create(F.index,F.schema,{ON:"JSON",PREFIX:F.prefix})}catch(G){if(!G.message?.includes("Index already exists"))console.error(`Failed to create index ${F.index}:`,G.message)}}};export{N as ShallowRedisSaver};