@hermenics/deepseek-code 0.2.1 → 0.2.3

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 (2) hide show
  1. package/dist/cli.mjs +3 -7
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1017,7 +1017,7 @@ ${f}`,w++}else Fe0(B,C,y)?O=B.slice(B.charCodeAt(C+6)===AX?C+7:C+6,I)||void 0:V(
1017
1017
  `,C),v=-1;if(I!==-1&&y!==-1?v=I<y?I:y:I!==-1?I===B.length-1?v=-1:v=I:y!==-1&&(v=y),v===-1)break;V(B,C,v),C=v+1,B.charCodeAt(C-1)===PW1&&B.charCodeAt(C)===Te0&&C++}return B.slice(C)}function V(B,C,I){if(C===I){_();return}let y=B.charCodeAt(C);if(_e0(B,C,y)){let K0=B.charCodeAt(C+5)===AX?C+6:C+5,c=B.slice(K0,I);H=w===0?c:`${H}
1018
1018
  ${c}`,w++;return}if(Fe0(B,C,y)){O=B.slice(B.charCodeAt(C+6)===AX?C+7:C+6,I)||void 0;return}if(y===105&&B.charCodeAt(C+1)===100&&B.charCodeAt(C+2)===58){let K0=B.slice(B.charCodeAt(C+3)===AX?C+4:C+3,I);W=K0.includes("\x00")?void 0:K0;return}if(y===58){if(J){let K0=B.slice(C,I);J(K0.slice(B.charCodeAt(C+1)===AX?2:1))}return}let v=B.slice(C,I),f=v.indexOf(":");if(f===-1){T(v,"",v);return}let m=v.slice(0,f),u=v.charCodeAt(f+1)===AX?2:1,g=v.slice(f+u);T(m,g,v)}function T(B,C,I){switch(B){case"event":O=C||void 0;break;case"data":H=w===0?C:`${H}
1019
1019
  ${C}`,w++;break;case"id":W=C.includes("\x00")?void 0:C;break;case"retry":/^\d+$/.test(C)?z(parseInt(C,10)):K(new N80(`Invalid \`retry\` value: "${C}"`,{type:"invalid-retry",value:C,line:I}));break;default:K(new N80(`Unknown field "${B.length>20?`${B.slice(0,20)}\u2026`:B}"`,{type:"unknown-field",field:B,value:C,line:I}));break}}function _(){w>0&&$({id:W,event:O,data:H}),W=void 0,H="",w=0,O=void 0}function F(B={}){if(B.consume&&q.length>0){let C=q.join("");V(C,0,C.length)}X=!0,W=void 0,H="",w=0,O=void 0,q.length=0}return{feed:N,reset:F}}function _e0(D,$,K){return K===100&&D.charCodeAt($+1)===97&&D.charCodeAt($+2)===116&&D.charCodeAt($+3)===97&&D.charCodeAt($+4)===58}function Fe0(D,$,K){return K===101&&D.charCodeAt($+1)===118&&D.charCodeAt($+2)===101&&D.charCodeAt($+3)===110&&D.charCodeAt($+4)===116&&D.charCodeAt($+5)===58}var N80,Te0=10,PW1=13,AX=32;var Be0=j(()=>{N80=class N80 extends Error{constructor(D,$){super(D),this.name="ParseError",this.type=$.type,this.field=$.field,this.value=$.value,this.line=$.line}}});var M80;var je0=j(()=>{Be0();M80=class M80 extends TransformStream{constructor({onError:D,onRetry:$,onComment:K}={}){let z;super({start(J){z=Ee0({onEvent:(q)=>{J.enqueue(q)},onError(q){D==="terminate"?J.error(q):typeof D=="function"&&D(q)},onRetry:$,onComment:K})},transform(J){z.feed(J)}})}}});class A80{constructor(D,$){this._hasCompletedAuthFlow=!1,this._url=D,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=$?.requestInit,this._authProvider=$?.authProvider,this._fetch=$?.fetch,this._fetchWithInit=Ke0($?.fetch,$?.requestInit),this._sessionId=$?.sessionId,this._reconnectionOptions=$?.reconnectionOptions??LW1}async _authThenStart(){if(!this._authProvider)throw new Cq("No auth provider");let D;try{D=await fP(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch($){throw this.onerror?.($),$}if(D!=="AUTHORIZED")throw new Cq;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let D={};if(this._authProvider){let K=await this._authProvider.tokens();if(K)D.Authorization=`Bearer ${K.access_token}`}if(this._sessionId)D["mcp-session-id"]=this._sessionId;if(this._protocolVersion)D["mcp-protocol-version"]=this._protocolVersion;let $=SI(this._requestInit?.headers);return new Headers({...D,...$})}async _startOrAuthSse(D){let{resumptionToken:$}=D;try{let K=await this._commonHeaders();if(K.set("Accept","text/event-stream"),$)K.set("last-event-id",$);let z=await(this._fetch??fetch)(this._url,{method:"GET",headers:K,signal:this._abortController?.signal});if(!z.ok){if(await z.body?.cancel(),z.status===401&&this._authProvider)return await this._authThenStart();if(z.status===405)return;throw new VX(z.status,`Failed to open SSE stream: ${z.statusText}`)}this._handleSseStream(z.body,D,!0)}catch(K){throw this.onerror?.(K),K}}_getNextReconnectionDelay(D){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let $=this._reconnectionOptions.initialReconnectionDelay,K=this._reconnectionOptions.reconnectionDelayGrowFactor,z=this._reconnectionOptions.maxReconnectionDelay;return Math.min($*Math.pow(K,D),z)}_scheduleReconnection(D,$=0){let K=this._reconnectionOptions.maxRetries;if($>=K){this.onerror?.(Error(`Maximum reconnection attempts (${K}) exceeded.`));return}let z=this._getNextReconnectionDelay($);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(D).catch((J)=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${J instanceof Error?J.message:String(J)}`)),this._scheduleReconnection(D,$+1)})},z)}_handleSseStream(D,$,K){if(!D)return;let{onresumptiontoken:z,replayMessageId:J}=$,q,X=!1,W=!1;(async()=>{try{let w=D.pipeThrough(new TextDecoderStream).pipeThrough(new M80({onRetry:(A)=>{this._serverRetryMs=A}})).getReader();while(!0){let{value:A,done:V}=await w.read();if(V)break;if(A.id)q=A.id,X=!0,z?.(A.id);if(!A.data)continue;if(!A.event||A.event==="message")try{let T=NG.parse(JSON.parse(A.data));if(qX(T)){if(W=!0,J!==void 0)T.id=J}this.onmessage?.(T)}catch(T){this.onerror?.(T)}}if((K||X)&&!W&&this._abortController&&!this._abortController.signal.aborted)this._scheduleReconnection({resumptionToken:q,onresumptiontoken:z,replayMessageId:J},0)}catch(w){if(this.onerror?.(Error(`SSE stream disconnected: ${w}`)),(K||X)&&!W&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:q,onresumptiontoken:z,replayMessageId:J},0)}catch(A){this.onerror?.(Error(`Failed to reconnect: ${A instanceof Error?A.message:String(A)}`))}}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(D){if(!this._authProvider)throw new Cq("No auth provider");if(await fP(this._authProvider,{serverUrl:this._url,authorizationCode:D,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Cq("Failed to authorize")}async close(){if(this._reconnectionTimeout)clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0;this._abortController?.abort(),this.onclose?.()}async send(D,$){try{let{resumptionToken:K,onresumptiontoken:z}=$||{};if(K){this._startOrAuthSse({resumptionToken:K,replayMessageId:KP(D)?D.id:void 0}).catch((N)=>this.onerror?.(N));return}let J=await this._commonHeaders();J.set("content-type","application/json"),J.set("accept","application/json, text/event-stream");let q={...this._requestInit,method:"POST",headers:J,body:JSON.stringify(D),signal:this._abortController?.signal},X=await(this._fetch??fetch)(this._url,q),W=X.headers.get("mcp-session-id");if(W)this._sessionId=W;if(!X.ok){let N=await X.text().catch(()=>null);if(X.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new VX(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:A,scope:V}=G80(X);if(this._resourceMetadataUrl=A,this._scope=V,await fP(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Cq;return this._hasCompletedAuthFlow=!0,this.send(D)}if(X.status===403&&this._authProvider){let{resourceMetadataUrl:A,scope:V,error:T}=G80(X);if(T==="insufficient_scope"){let _=X.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===_)throw new VX(403,"Server returned 403 after trying upscoping");if(V)this._scope=V;if(A)this._resourceMetadataUrl=A;if(this._lastUpscopingHeader=_??void 0,await fP(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Cq;return this.send(D)}}throw new VX(X.status,`Error POSTing to endpoint: ${N}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,X.status===202){if(await X.body?.cancel(),ri0(D))this._startOrAuthSse({resumptionToken:void 0}).catch((N)=>this.onerror?.(N));return}let w=(Array.isArray(D)?D:[D]).filter((N)=>("method"in N)&&("id"in N)&&N.id!==void 0).length>0,O=X.headers.get("content-type");if(w)if(O?.includes("text/event-stream"))this._handleSseStream(X.body,{onresumptiontoken:z},!1);else if(O?.includes("application/json")){let N=await X.json(),A=Array.isArray(N)?N.map((V)=>NG.parse(V)):[NG.parse(N)];for(let V of A)this.onmessage?.(V)}else throw await X.body?.cancel(),new VX(-1,`Unexpected content type: ${O}`);else await X.body?.cancel()}catch(K){throw this.onerror?.(K),K}}get sessionId(){return this._sessionId}async terminateSession(){if(!this._sessionId)return;try{let D=await this._commonHeaders(),$={...this._requestInit,method:"DELETE",headers:D,signal:this._abortController?.signal},K=await(this._fetch??fetch)(this._url,$);if(await K.body?.cancel(),!K.ok&&K.status!==405)throw new VX(K.status,`Failed to terminate session: ${K.statusText}`);this._sessionId=void 0}catch(D){throw this.onerror?.(D),D}}setProtocolVersion(D){this._protocolVersion=D}get protocolVersion(){return this._protocolVersion}async resumeStream(D,$){await this._startOrAuthSse({resumptionToken:D,onresumptiontoken:$?.onresumptiontoken})}}var LW1,VX;var Re0=j(()=>{ZX();Le0();je0();LW1={initialReconnectionDelay:1000,maxReconnectionDelay:30000,reconnectionDelayGrowFactor:1.5,maxRetries:2};VX=class VX extends Error{constructor(D,$){super(`Streamable HTTP error: ${$}`);this.code=D}}});import{readFile as TW1,writeFile as Qe0,readdir as _W1}from"fs/promises";async function a4(D){return JSON.parse(await TW1(D,"utf-8"))}async function xG(D,$){await Qe0(D,JSON.stringify($,null,2),"utf-8")}async function Uq(D,$){await Qe0(D,$,"utf-8")}async function lI(D,$){try{return(await _W1($)).filter((z)=>D.test(z))}catch{return[]}}var oD=()=>{};import{join as Ue0}from"path";import{homedir as FW1}from"os";import{mkdir as EW1,appendFile as BW1}from"fs/promises";import{randomBytes as jW1}from"crypto";async function CW1(){if(Ce0)return;await EW1(Ie0,{recursive:!0}),Ce0=!0}async function w9(D){try{await CW1();let $=JSON.stringify({ts:new Date().toISOString(),...D})+`
1020
- `;await BW1(QW1,$,"utf-8")}catch{}}var Ie0,RW1,QW1,Ce0=!1;var V80=j(()=>{Ie0=Ue0(FW1(),".deepseek","logs"),RW1=`${Date.now()}-${jW1(3).toString("hex")}`,QW1=Ue0(Ie0,`session-${RW1}.jsonl`)});var g7;var bG=j(()=>{g7={name:"@hermenics/deepseek-code",version:"0.2.1",description:"An AI-powered coding assistant that lives in your terminal",keywords:["ai","cli","deepseek","coding-assistant","terminal","tui"],license:"Apache-2.0",type:"module",bin:{deepseek:"dist/deepseek"},files:["dist/","README.md","LICENSE"],repository:{type:"git",url:"git+https://github.com/Hermenics/deepseek-code.git"},bugs:{url:"https://github.com/Hermenics/deepseek-code/issues"},homepage:"https://github.com/Hermenics/deepseek-code#readme",publishConfig:{access:"public"},engines:{node:">=18",bun:">=1.0"},scripts:{start:"NODE_ENV=development bun src/index.tsx",dev:"NODE_ENV=development bun --watch src/index.tsx",build:"bun run build.ts",typecheck:"bunx tsc --noEmit",test:"bun test"},dependencies:{"@alcalzone/ansi-tokenize":"^0.3.0","@aws-crypto/sha256-js":"^5.2.0","@aws-sdk/client-bedrock":"^3.1048.0","@aws-sdk/credential-providers":"^3.1048.0","@modelcontextprotocol/sdk":"^1.29.0","@smithy/protocol-http":"^5.3.14","@smithy/signature-v4":"^5.3.14","@types/semver":"^7.7.1","auto-bind":"^5.0.1","bidi-js":"^1.0.3",chalk:"^5.6.2","cli-boxes":"^4.0.1","code-excerpt":"^4.0.0","emoji-regex":"^10.6.0",execa:"^9.6.1","fast-glob":"^3.3.3","fuse.js":"^7.0.0","get-east-asian-width":"^1.6.0","google-auth-library":"^10.6.2","indent-string":"^5.0.0","lodash-es":"^4.18.1",openai:"^6.34.0",react:"^19.2.0","react-reconciler":"^0.33.0",semver:"^7.8.1","signal-exit":"^4.1.0","stack-utils":"^2.0.6","strip-ansi":"^7.2.0","supports-hyperlinks":"^4.4.0","type-fest":"^5.6.0","usehooks-ts":"^3.1.1","wrap-ansi":"^10.0.0"},devDependencies:{"@types/bun":"^1.3.12","@types/react":"^19.2.0","@types/stack-utils":"^2.0.3","react-devtools-core":"^7.0.1",typescript:"^5.9.3",vitest:"^4.1.6"}}});import{join as IW1}from"path";function xW1(D,$){let K={...D};for(let[z,J]of Object.entries($)){if(SW1.has(z))continue;K[z]=J}return K}function bW1(D){if(D.trim()==="")throw Error("MCP command cannot be empty");if(fW1.test(D))throw Error(`MCP command contains path traversal: ${D}`);if(kW1.test(D))throw Error(`MCP command contains shell injection characters: ${D}`)}function hW1(D,$){return{type:"mcp_server_load",serverName:D,transport:$}}async function vW1(){let D=IW1(process.cwd(),".deepseek","mcp.json");try{return await a4(D)}catch{return null}}async function Se0(){let D=await vW1();if(!D?.servers)return{tools:[],errors:[]};let $=[],K=[];for(let[z,J]of Object.entries(D.servers))try{if(J.transport==="stdio")bW1(J.command);let q=new e00({name:"deepseek-code",version:g7.version}),X=J.transport==="stdio"?new K80({command:J.command,args:J.args??[],env:xW1(Object.fromEntries(Object.entries(process.env).filter((H)=>H[1]!==void 0)),J.env??{})}):new A80(new URL(J.url));await q.connect(X),await w9(hW1(z,J.transport));let{tools:W}=await q.listTools();for(let H of W)$.push({name:`${z}__${H.name}`,description:`[MCP:${z}] ${H.description??""}`,parameters:H.inputSchema,async execute(w){return(await Promise.race([q.callTool({name:H.name,arguments:w}),new Promise((V,T)=>setTimeout(()=>T(Error(`MCP tool '${H.name}' timed out after 30s`)),30000))])).content.filter((V)=>V.type==="text"&&V.text).map((V)=>V.text).join(`
1020
+ `;await BW1(QW1,$,"utf-8")}catch{}}var Ie0,RW1,QW1,Ce0=!1;var V80=j(()=>{Ie0=Ue0(FW1(),".deepseek","logs"),RW1=`${Date.now()}-${jW1(3).toString("hex")}`,QW1=Ue0(Ie0,`session-${RW1}.jsonl`)});var g7;var bG=j(()=>{g7={name:"@hermenics/deepseek-code",version:"0.2.3",description:"An AI-powered coding assistant that lives in your terminal",keywords:["ai","cli","deepseek","coding-assistant","terminal","tui"],license:"Apache-2.0",type:"module",bin:{deepseek:"dist/deepseek"},files:["dist/","README.md","LICENSE"],repository:{type:"git",url:"git+https://github.com/Hermenics/deepseek-code.git"},bugs:{url:"https://github.com/Hermenics/deepseek-code/issues"},homepage:"https://github.com/Hermenics/deepseek-code#readme",publishConfig:{access:"public"},engines:{node:">=18",bun:">=1.0"},scripts:{start:"NODE_ENV=development bun src/index.tsx",dev:"NODE_ENV=development bun --watch src/index.tsx",build:"bun run build.ts",typecheck:"bunx tsc --noEmit",test:"bun test"},dependencies:{"@alcalzone/ansi-tokenize":"^0.3.0","@aws-crypto/sha256-js":"^5.2.0","@aws-sdk/client-bedrock":"^3.1048.0","@aws-sdk/credential-providers":"^3.1048.0","@modelcontextprotocol/sdk":"^1.29.0","@smithy/protocol-http":"^5.3.14","@smithy/signature-v4":"^5.3.14","@types/semver":"^7.7.1","auto-bind":"^5.0.1","bidi-js":"^1.0.3",chalk:"^5.6.2","cli-boxes":"^4.0.1","code-excerpt":"^4.0.0","emoji-regex":"^10.6.0",execa:"^9.6.1","fast-glob":"^3.3.3","fuse.js":"^7.0.0","get-east-asian-width":"^1.6.0","google-auth-library":"^10.6.2","indent-string":"^5.0.0","lodash-es":"^4.18.1",openai:"^6.34.0",react:"^19.2.0","react-reconciler":"^0.33.0",semver:"^7.8.1","signal-exit":"^4.1.0","stack-utils":"^2.0.6","strip-ansi":"^7.2.0","supports-hyperlinks":"^4.4.0","type-fest":"^5.6.0","usehooks-ts":"^3.1.1","wrap-ansi":"^10.0.0"},devDependencies:{"@types/bun":"^1.3.12","@types/react":"^19.2.0","@types/stack-utils":"^2.0.3","react-devtools-core":"^7.0.1",typescript:"^5.9.3",vitest:"^4.1.6"}}});import{join as IW1}from"path";function xW1(D,$){let K={...D};for(let[z,J]of Object.entries($)){if(SW1.has(z))continue;K[z]=J}return K}function bW1(D){if(D.trim()==="")throw Error("MCP command cannot be empty");if(fW1.test(D))throw Error(`MCP command contains path traversal: ${D}`);if(kW1.test(D))throw Error(`MCP command contains shell injection characters: ${D}`)}function hW1(D,$){return{type:"mcp_server_load",serverName:D,transport:$}}async function vW1(){let D=IW1(process.cwd(),".deepseek","mcp.json");try{return await a4(D)}catch{return null}}async function Se0(){let D=await vW1();if(!D?.servers)return{tools:[],errors:[]};let $=[],K=[];for(let[z,J]of Object.entries(D.servers))try{if(J.transport==="stdio")bW1(J.command);let q=new e00({name:"deepseek-code",version:g7.version}),X=J.transport==="stdio"?new K80({command:J.command,args:J.args??[],env:xW1(Object.fromEntries(Object.entries(process.env).filter((H)=>H[1]!==void 0)),J.env??{})}):new A80(new URL(J.url));await q.connect(X),await w9(hW1(z,J.transport));let{tools:W}=await q.listTools();for(let H of W)$.push({name:`${z}__${H.name}`,description:`[MCP:${z}] ${H.description??""}`,parameters:H.inputSchema,async execute(w){return(await Promise.race([q.callTool({name:H.name,arguments:w}),new Promise((V,T)=>setTimeout(()=>T(Error(`MCP tool '${H.name}' timed out after 30s`)),30000))])).content.filter((V)=>V.type==="text"&&V.text).map((V)=>V.text).join(`
1021
1021
  `)}})}catch(q){let X=`MCP server '${z}': ${q.message}`;K.push(X)}return{tools:$,errors:K}}var SW1,kW1,fW1;var ke0=j(()=>{as0();$e0();Re0();oD();V80();bG();SW1=new Set(["PATH","LD_PRELOAD","LD_LIBRARY_PATH","DYLD_INSERT_LIBRARIES","DYLD_LIBRARY_PATH","HOME","USER","SHELL","PYTHONPATH","NODE_OPTIONS","NODE_PATH","BUN_INSTALL"]),kW1=/[;|`<>]|&&|\|\||\$\(|>>|<</,fW1=/\.\.[/\\]/});import{readFile as yW1}from"fs/promises";async function xe0(D){if(!D.length)return"";let $=await fe0.default(D,{cwd:process.cwd(),ignore:["**/node_modules/**","**/.git/**"],dot:!0,absolute:!0}),K=[];for(let z of $)try{let J=await yW1(z,"utf-8"),X=J.length>P80?J.slice(0,P80)+`
1022
1022
 
1023
1023
  ...(truncated \u2014 file exceeds ${P80} chars)`:J;K.push(`// File: ${z}
@@ -1219,11 +1219,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
1219
1219
  `),J=z.length-1,q=z[J]??"";return{line:J,column:t9(q)}}getOffsetFromPosition(D){let $=this.getWrappedText(),K=Math.max(0,Math.min(D.line,$.length-1)),z=$.slice(0,K),J=0;for(let X of z)J+=X.length;if(K<$.length-1||this.text.includes(`
1220
1220
  `)){let X=this.text.split(`
1221
1221
  `);J=0;for(let H=0;H<K;H++)J+=(X[H]??"").length+1;let W=X[K]??"";return J+this.displayWidthToStringIndex(W,D.column)}let q=$[K]??"";return J+this.displayWidthToStringIndex(q,D.column)}getLineLength(D){let K=this.getWrappedText()[D]??"";return t9(K)}}var Sq=[],yH1=0,m80=!1,uH1=0,gH1=0,p08=!1;function Iz(D,$="append"){if(D.length===0)return;if(m80&&Sq.length>0)Sq[0]=$==="prepend"?D+Sq[0]:Sq[0]+D;else if(Sq.unshift(D),Sq.length>10)Sq.pop();m80=!0,p08=!1}function l08(){return Sq[0]??""}function d08(){m80=!1}function n08(D,$){uH1=D,gH1=$,p08=!0,yH1=0}class a1{offset;measuredText;constructor(D,$=0){this.measuredText=D,this.offset=Math.max(0,Math.min(this.text.length,$))}static fromText(D,$,K=0){return new a1(new Iq(D,Math.max(1,$-1)),K)}get text(){return this.measuredText.text}left(){if(this.offset<=0)return this;return new a1(this.measuredText,this.measuredText.prevOffset(this.offset))}right(){if(this.offset>=this.text.length)return this;return new a1(this.measuredText,this.measuredText.nextOffset(this.offset))}up(){let D=this.getPosition();if(D.line<=0)return this;return new a1(this.measuredText,this.measuredText.getOffsetFromPosition({line:D.line-1,column:D.column}))}down(){let D=this.getPosition();if(D.line>=this.measuredText.lineCount-1)return this;return new a1(this.measuredText,this.measuredText.getOffsetFromPosition({line:D.line+1,column:D.column}))}prevWord(){if(this.offset<=0)return this;let D=this.measuredText.getWordBoundaries(),$=0;for(let K=D.length-1;K>=0;K--){let z=D[K];if(!z.isWordLike)continue;if(z.start<this.offset&&this.offset<=z.end){$=z.start;break}if(z.end<=this.offset){$=z.start;break}}return new a1(this.measuredText,$)}nextWord(){if(this.offset>=this.text.length)return this;let D=this.measuredText.getWordBoundaries();for(let $ of D){if(!$.isWordLike)continue;if($.start>this.offset)return new a1(this.measuredText,$.start);if(this.offset>=$.start&&this.offset<$.end)continue}return new a1(this.measuredText,this.text.length)}startOfLine(){let D=this.getPosition();return new a1(this.measuredText,this.measuredText.getOffsetFromPosition({line:D.line,column:0}))}endOfLine(){let D=this.getPosition(),$=this.measuredText.getLineLength(D.line);return new a1(this.measuredText,this.measuredText.getOffsetFromPosition({line:D.line,column:$}))}insert(D){let $=this.text.slice(0,this.offset)+D+this.text.slice(this.offset);return a1.fromText($,this.measuredText.columns+1,this.offset+D.length)}backspace(){if(this.offset===0)return this;let D=this.measuredText.prevOffset(this.offset),$=this.text.slice(0,D)+this.text.slice(this.offset);return a1.fromText($,this.measuredText.columns+1,D)}del(){if(this.offset>=this.text.length)return this;let D=this.measuredText.nextOffset(this.offset),$=this.text.slice(0,this.offset)+this.text.slice(D);return a1.fromText($,this.measuredText.columns+1,this.offset)}deleteToLineEnd(){let D=this.endOfLine().offset,$=D===this.offset&&this.text[this.offset]===`
1222
- `?this.offset+1:D,K=this.text.slice(this.offset,$);if(K)Iz(K,"append");let z=this.text.slice(0,this.offset)+this.text.slice($);return{cursor:a1.fromText(z,this.measuredText.columns+1,this.offset),killed:K}}deleteToLineStart(){let D=this.startOfLine().offset,$=this.text.slice(D,this.offset);if($)Iz($,"prepend");let K=this.text.slice(0,D)+this.text.slice(this.offset);return{cursor:a1.fromText(K,this.measuredText.columns+1,D),killed:$}}deleteWordBefore(){let D=this.prevWord().offset,$=this.text.slice(D,this.offset);if($)Iz($,"prepend");let K=this.text.slice(0,D)+this.text.slice(this.offset);return{cursor:a1.fromText(K,this.measuredText.columns+1,D),killed:$}}deleteWordAfter(){let D=this.nextWord().offset;if(D<=this.offset)return this;let $=this.text.slice(this.offset,D);if($)Iz($,"append");let K=this.text.slice(0,this.offset)+this.text.slice(D);return a1.fromText(K,this.measuredText.columns+1,this.offset)}nextVimWord(){return this.nextWord()}prevVimWord(){return this.prevWord()}endOfVimWord(){return this.nextWord().left()}isAtStart(){return this.offset===0}isAtEnd(){return this.offset===this.text.length}equals(D){return this.offset===D.offset&&this.text===D.text}getPosition(){return this.measuredText.getPositionFromOffset(this.offset)}}function i08(D,$,K){if(!($.ctrl&&($.name==="k"||$.name==="u"||$.name==="w")))d08();if($.ctrl)switch($.name){case"a":return{type:"cursor",cursor:D.startOfLine()};case"e":return{type:"cursor",cursor:D.endOfLine()};case"b":return{type:"cursor",cursor:D.left()};case"f":return{type:"cursor",cursor:D.right()};case"k":{let J=D.deleteToLineEnd();return Iz(J.killed,"append"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"u":{let J=D.deleteToLineStart();return Iz(J.killed,"prepend"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"w":{let J=D.deleteWordBefore();return Iz(J.killed,"prepend"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"y":{let J=l08();if(!J)return{type:"cursor",cursor:D};let q=D.offset,X=D.insert(J);return n08(q,J.length),{type:"cursor",cursor:X}}}if($.meta||$.option)switch($.name){case"b":return{type:"cursor",cursor:D.prevWord()};case"f":return{type:"cursor",cursor:D.nextWord()};case"d":return{type:"cursor",cursor:D.deleteWordAfter()}}switch($.name){case"backspace":return{type:"cursor",cursor:D.backspace()};case"delete":return{type:"cursor",cursor:D.del()};case"left":return{type:"cursor",cursor:D.left()};case"right":return{type:"cursor",cursor:D.right()};case"home":return{type:"cursor",cursor:D.startOfLine()};case"end":return{type:"cursor",cursor:D.endOfLine()};case"up":if(K?.multiline&&D.text.includes(`
1223
- `)){let J=D.text.indexOf(`
1224
- `);if(D.offset<=J)return{type:"action",action:"historyUp"};return{type:"cursor",cursor:D.up()}}return{type:"action",action:"historyUp"};case"down":if(K?.multiline&&D.text.includes(`
1225
- `)){let J=D.text.lastIndexOf(`
1226
- `);if(D.offset>J)return{type:"action",action:"historyDown"};return{type:"cursor",cursor:D.down()}}return{type:"action",action:"historyDown"};case"return":case"enter":if(K?.multiline&&$.shift)return{type:"cursor",cursor:D.insert(`
1222
+ `?this.offset+1:D,K=this.text.slice(this.offset,$);if(K)Iz(K,"append");let z=this.text.slice(0,this.offset)+this.text.slice($);return{cursor:a1.fromText(z,this.measuredText.columns+1,this.offset),killed:K}}deleteToLineStart(){let D=this.startOfLine().offset,$=this.text.slice(D,this.offset);if($)Iz($,"prepend");let K=this.text.slice(0,D)+this.text.slice(this.offset);return{cursor:a1.fromText(K,this.measuredText.columns+1,D),killed:$}}deleteWordBefore(){let D=this.prevWord().offset,$=this.text.slice(D,this.offset);if($)Iz($,"prepend");let K=this.text.slice(0,D)+this.text.slice(this.offset);return{cursor:a1.fromText(K,this.measuredText.columns+1,D),killed:$}}deleteWordAfter(){let D=this.nextWord().offset;if(D<=this.offset)return this;let $=this.text.slice(this.offset,D);if($)Iz($,"append");let K=this.text.slice(0,this.offset)+this.text.slice(D);return a1.fromText(K,this.measuredText.columns+1,this.offset)}nextVimWord(){return this.nextWord()}prevVimWord(){return this.prevWord()}endOfVimWord(){return this.nextWord().left()}isAtStart(){return this.offset===0}isAtEnd(){return this.offset===this.text.length}equals(D){return this.offset===D.offset&&this.text===D.text}getPosition(){return this.measuredText.getPositionFromOffset(this.offset)}}function i08(D,$,K){if(!($.ctrl&&($.name==="k"||$.name==="u"||$.name==="w")))d08();if($.ctrl)switch($.name){case"a":return{type:"cursor",cursor:D.startOfLine()};case"e":return{type:"cursor",cursor:D.endOfLine()};case"b":return{type:"cursor",cursor:D.left()};case"f":return{type:"cursor",cursor:D.right()};case"k":{let J=D.deleteToLineEnd();return Iz(J.killed,"append"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"u":{let J=D.deleteToLineStart();return Iz(J.killed,"prepend"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"w":{let J=D.deleteWordBefore();return Iz(J.killed,"prepend"),{type:"cursor",cursor:J.cursor,killed:J.killed}}case"y":{let J=l08();if(!J)return{type:"cursor",cursor:D};let q=D.offset,X=D.insert(J);return n08(q,J.length),{type:"cursor",cursor:X}}}if($.meta||$.option)switch($.name){case"b":return{type:"cursor",cursor:D.prevWord()};case"f":return{type:"cursor",cursor:D.nextWord()};case"d":return{type:"cursor",cursor:D.deleteWordAfter()}}switch($.name){case"backspace":return{type:"cursor",cursor:D.backspace()};case"delete":return{type:"cursor",cursor:D.del()};case"left":return{type:"cursor",cursor:D.left()};case"right":return{type:"cursor",cursor:D.right()};case"home":return{type:"cursor",cursor:D.startOfLine()};case"end":return{type:"cursor",cursor:D.endOfLine()};case"up":if(K?.multiline&&D.measuredText.lineCount>1){if(D.getPosition().line===0)return{type:"action",action:"historyUp"};return{type:"cursor",cursor:D.up()}}return{type:"action",action:"historyUp"};case"down":if(K?.multiline&&D.measuredText.lineCount>1){if(D.getPosition().line>=D.measuredText.lineCount-1)return{type:"action",action:"historyDown"};return{type:"cursor",cursor:D.down()}}return{type:"action",action:"historyDown"};case"return":case"enter":if(K?.multiline&&$.shift)return{type:"cursor",cursor:D.insert(`
1227
1223
  `)};return{type:"action",action:"submit"}}if($.raw&&!$.ctrl&&!$.meta)return{type:"cursor",cursor:D.insert($.raw)};return{type:"cursor",cursor:D}}function r08(D,$,K){if(K.mode==="insert"){if($.name==="escape")return{type:"modeChange",mode:"normal",cursor:D};if($.name==="return"||$.name==="enter")return{type:"action",action:"submit"};return{type:"noop"}}switch($.name){case"h":case"left":return{type:"cursor",cursor:D.left()};case"l":case"right":return{type:"cursor",cursor:D.right()};case"0":case"home":return{type:"cursor",cursor:D.startOfLine()};case"$":case"end":return{type:"cursor",cursor:D.endOfLine()};case"w":return{type:"cursor",cursor:D.nextWord()};case"b":return{type:"cursor",cursor:D.prevWord()};case"x":return{type:"cursor",cursor:D.del()};case"D":return{type:"cursor",cursor:D.deleteToLineEnd().cursor};case"i":return{type:"modeChange",mode:"insert",cursor:D};case"a":return{type:"modeChange",mode:"insert",cursor:D.right()};case"I":return{type:"modeChange",mode:"insert",cursor:D.startOfLine()};case"A":return{type:"modeChange",mode:"insert",cursor:D.endOfLine()};case"k":case"up":return{type:"action",action:"historyUp"};case"j":case"down":return{type:"action",action:"historyDown"};case"return":case"enter":return{type:"action",action:"submit"};default:return{type:"noop"}}}class c80{maxSize;entries=[];currentIndex=-1;constructor(D){this.maxSize=D?.maxSize??50}push(D,$){let K={text:D,cursorOffset:$,timestamp:Date.now()};if(this.currentIndex<this.entries.length-1)this.entries=this.entries.slice(0,this.currentIndex+1);if(this.entries.push(K),this.entries.length>this.maxSize){let z=this.entries.length-this.maxSize;this.entries.splice(0,z)}this.currentIndex=this.entries.length-1}undo(){if(!this.canUndo)return;return this.currentIndex-=1,this.entries[this.currentIndex]}redo(){if(!this.canRedo)return;return this.currentIndex+=1,this.entries[this.currentIndex]}get canUndo(){return this.currentIndex>0}get canRedo(){return this.currentIndex>=0&&this.currentIndex<this.entries.length-1}clear(){this.entries=[],this.currentIndex=-1}}var _X=k(t1(),1);function p80(D){let{timeout:$=800,onFirstPress:K,onDoublePress:z}=D,[J,q]=_X.useState(!1),X=_X.useRef(null),W=_X.useCallback(()=>{if(q(!1),X.current)clearTimeout(X.current),X.current=null},[]),H=_X.useCallback(()=>{if(J)W(),z();else q(!0),K?.(),X.current=setTimeout(()=>{q(!1)},$)},[J,$,K,z,W]);return{armed:J,trigger:H,reset:W}}class l80{_entries=[];index=null;draft=null;get entries(){return[...this._entries]}constructor(){}setHistory(D){this._entries=[...D],this.reset()}up(D){if(this._entries.length===0)return;if(this.index===null)return this.index=this._entries.length-1,this.draft=D,this._entries[this.index];if(this.index===0)return;return this.index-=1,this._entries[this.index]}down(){if(this.index===null)return;if(this.index<this._entries.length-1)return this.index+=1,this._entries[this.index];let D=this.draft??"";return this.reset(),D}reset(){this.index=null,this.draft=null}get isNavigating(){return this.index!==null}}function kq(D){return!Array.isArray?K88(D)==="[object Array]":Array.isArray(D)}function mH1(D){if(typeof D=="string")return D;if(typeof D==="bigint")return D.toString();let $=D+"";return $=="0"&&1/D==-1/0?"-0":$}function d80(D){return D==null?"":mH1(D)}function u9(D){return typeof D==="string"}function WS(D){return typeof D==="number"}function cH1(D){return D===!0||D===!1||pH1(D)&&K88(D)=="[object Boolean]"}function $88(D){return typeof D==="object"}function pH1(D){return $88(D)&&D!==null}function V3(D){return D!==void 0&&D!==null}function ZS(D){return!D.trim().length}function K88(D){return D==null?D===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(D)}var lH1="Incorrect 'index' type",dH1=(D)=>`Invalid value for key ${D}`,nH1=(D)=>`Pattern length exceeds max of ${D}.`,iH1=(D)=>`Missing ${D} property in key`,rH1=(D)=>`Property 'weight' in key '${D}' must be a positive integer`,o08=Object.prototype.hasOwnProperty;class z88{constructor(D){this._keys=[],this._keyMap={};let $=0;D.forEach((K)=>{let z=J88(K);this._keys.push(z),this._keyMap[z.id]=z,$+=z.weight}),this._keys.forEach((K)=>{K.weight/=$})}get(D){return this._keyMap[D]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function J88(D){let $=null,K=null,z=null,J=1,q=null;if(u9(D)||kq(D))z=D,$=t08(D),K=n80(D);else{if(!o08.call(D,"name"))throw Error(iH1("name"));let X=D.name;if(z=X,o08.call(D,"weight")){if(J=D.weight,J<=0)throw Error(rH1(X))}$=t08(X),K=n80(X),q=D.getFn}return{path:$,id:K,weight:J,src:z,getFn:q}}function t08(D){return kq(D)?D:D.split(".")}function n80(D){return kq(D)?D.join("."):D}function oH1(D,$){let K=[],z=!1,J=(q,X,W,H)=>{if(!V3(q))return;if(!X[W])K.push(H!==void 0?{v:q,i:H}:q);else{let w=X[W],O=q[w];if(!V3(O))return;if(W===X.length-1&&(u9(O)||WS(O)||cH1(O)||typeof O==="bigint"))K.push(H!==void 0?{v:d80(O),i:H}:d80(O));else if(kq(O)){z=!0;for(let N=0,A=O.length;N<A;N+=1)J(O[N],X,W+1,N)}else if(X.length)J(O,X,W+1,H)}};return J(D,u9($)?$.split("."):$,0),z?K:K[0]}var tH1={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},aH1={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(D,$)=>D.score===$.score?D.idx<$.idx?-1:1:D.score<$.score?-1:1},sH1={location:0,threshold:0.6,distance:100},eH1={useExtendedSearch:!1,useTokenSearch:!1,getFn:oH1,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},z1=Object.freeze({...aH1,...tH1,...sH1,...eH1}),DG1=/[^ ]+/g;function $G1(D=1,$=3){let K=new Map,z=Math.pow(10,$);return{get(J){let q=J.match(DG1).length;if(K.has(q))return K.get(q);let X=1/Math.pow(q,0.5*D),W=parseFloat(Math.round(X*z)/z);return K.set(q,W),W},clear(){K.clear()}}}class wS{constructor({getFn:D=z1.getFn,fieldNormWeight:$=z1.fieldNormWeight}={}){this.norm=$G1($,3),this.getFn=D,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(D=[]){this.docs=D}setIndexRecords(D=[]){this.records=D}setKeys(D=[]){this.keys=D,this._keysMap={},D.forEach(($,K)=>{this._keysMap[$.id]=K})}create(){if(this.isCreated||!this.docs.length)return;if(this.isCreated=!0,u9(this.docs[0]))this.docs.forEach((D,$)=>{this._addString(D,$)});else this.docs.forEach((D,$)=>{this._addObject(D,$)});this.norm.clear()}add(D){let $=this.size();if(u9(D))this._addString(D,$);else this._addObject(D,$)}removeAt(D){this.records.splice(D,1);for(let $=D,K=this.size();$<K;$+=1)this.records[$].i-=1}removeAll(D){for(let $=D.length-1;$>=0;$-=1)this.records.splice(D[$],1);for(let $=0,K=this.records.length;$<K;$+=1)this.records[$].i=$}getValueForItemAtKeyId(D,$){return D[this._keysMap[$]]}size(){return this.records.length}_addString(D,$){if(!V3(D)||ZS(D))return;let K={v:D,i:$,n:this.norm.get(D)};this.records.push(K)}_addObject(D,$){let K={i:$,$:{}};this.keys.forEach((z,J)=>{let q=z.getFn?z.getFn(D):this.getFn(D,z.path);if(!V3(q))return;if(kq(q)){let X=[];for(let W=0,H=q.length;W<H;W+=1){let w=q[W];if(!V3(w))continue;if(u9(w)){if(!ZS(w)){let O={v:w,i:W,n:this.norm.get(w)};X.push(O)}}else if(V3(w.v)){let O=u9(w.v)?w.v:d80(w.v);if(!ZS(O)){let N={v:O,i:w.i,n:this.norm.get(O)};X.push(N)}}}K.$[J]=X}else if(u9(q)&&!ZS(q)){let X={v:q,n:this.norm.get(q)};K.$[J]=X}}),this.records.push(K)}toJSON(){return{keys:this.keys.map(({getFn:D,...$})=>$),records:this.records}}}function q88(D,$,{getFn:K=z1.getFn,fieldNormWeight:z=z1.fieldNormWeight}={}){let J=new wS({getFn:K,fieldNormWeight:z});return J.setKeys(D.map(J88)),J.setSources($),J.create(),J}function KG1(D,{getFn:$=z1.getFn,fieldNormWeight:K=z1.fieldNormWeight}={}){let{keys:z,records:J}=D,q=new wS({getFn:$,fieldNormWeight:K});return q.setKeys(z),q.setIndexRecords(J),q}function zG1(D=[],$=z1.minMatchCharLength){let K=[],z=-1,J=-1,q=0;for(let X=D.length;q<X;q+=1){let W=D[q];if(W&&z===-1)z=q;else if(!W&&z!==-1){if(J=q-1,J-z+1>=$)K.push([z,J]);z=-1}}if(D[q-1]&&q-z>=$)K.push([z,q-1]);return K}var FX=32;function JG1(D,$,K,{location:z=z1.location,distance:J=z1.distance,threshold:q=z1.threshold,findAllMatches:X=z1.findAllMatches,minMatchCharLength:W=z1.minMatchCharLength,includeMatches:H=z1.includeMatches,ignoreLocation:w=z1.ignoreLocation}={}){if($.length>FX)throw Error(nH1(FX));let O=$.length,N=D.length,A=Math.max(0,Math.min(z,N)),V=q,T=A,_=(u,g)=>{let K0=u/O;if(w)return K0;let c=Math.abs(A-g);if(!J)return c?1:K0;return K0+c/J},F=W>1||H,B=F?Array(N):[],C;while((C=D.indexOf($,T))>-1){let u=_(0,C);if(V=Math.min(u,V),T=C+O,F){let g=0;while(g<O)B[C+g]=1,g+=1}}T=-1;let I=[],y=1,v=O+N,f=1<<O-1;for(let u=0;u<O;u+=1){let g=0,K0=v;while(g<K0){if(_(u,A+K0)<=V)g=K0;else v=K0;K0=Math.floor((v-g)/2+g)}v=K0;let c=Math.max(1,A-K0+1),s=X?N:Math.min(A+K0,N)+O,B0=Array(s+2);B0[s+1]=(1<<u)-1;for(let t=s;t>=c;t-=1){let e=t-1,g0=K[D[e]];if(F)B[e]=+!!g0;if(B0[t]=(B0[t+1]<<1|1)&g0,u)B0[t]|=(I[t+1]|I[t])<<1|1|I[t+1];if(B0[t]&f){if(y=_(u,e),y<=V){if(V=y,T=e,T<=A)break;c=Math.max(1,2*A-T)}}}if(_(u+1,A)>V)break;I=B0}let m={isMatch:T>=0,score:Math.max(0.001,y)};if(F){let u=zG1(B,W);if(!u.length)m.isMatch=!1;else if(H)m.indices=u}return m}function qG1(D){let $={};for(let K=0,z=D.length;K<z;K+=1){let J=D.charAt(K);$[J]=($[J]||0)|1<<z-K-1}return $}function e80(D){if(D.length<=1)return D;D.sort((K,z)=>K[0]-z[0]||K[1]-z[1]);let $=[D[0]];for(let K=1,z=D.length;K<z;K+=1){let J=$[$.length-1],q=D[K];if(q[0]<=J[1]+1)J[1]=Math.max(J[1],q[1]);else $.push(q)}return $}var Y88={"\u0142":"l","\u0141":"L","\u0111":"d","\u0110":"D","\xF8":"o","\xD8":"O","\u0127":"h","\u0126":"H","\u0167":"t","\u0166":"T","\u0131":"i","\xDF":"ss"},YG1=new RegExp("["+Object.keys(Y88).join("")+"]","g"),cP=String.prototype.normalize?(D)=>D.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(YG1,($)=>Y88[$]):(D)=>D;class OS{constructor(D,{location:$=z1.location,threshold:K=z1.threshold,distance:z=z1.distance,includeMatches:J=z1.includeMatches,findAllMatches:q=z1.findAllMatches,minMatchCharLength:X=z1.minMatchCharLength,isCaseSensitive:W=z1.isCaseSensitive,ignoreDiacritics:H=z1.ignoreDiacritics,ignoreLocation:w=z1.ignoreLocation}={}){if(this.options={location:$,threshold:K,distance:z,includeMatches:J,findAllMatches:q,minMatchCharLength:X,isCaseSensitive:W,ignoreDiacritics:H,ignoreLocation:w},D=W?D:D.toLowerCase(),D=H?cP(D):D,this.pattern=D,this.chunks=[],!this.pattern.length)return;let O=(A,V)=>{this.chunks.push({pattern:A,alphabet:qG1(A),startIndex:V})},N=this.pattern.length;if(N>FX){let A=0,V=N%FX,T=N-V;while(A<T)O(this.pattern.substr(A,FX),A),A+=FX;if(V){let _=N-FX;O(this.pattern.substr(_),_)}}else O(this.pattern,0)}searchIn(D){let{isCaseSensitive:$,ignoreDiacritics:K,includeMatches:z}=this.options;if(D=$?D:D.toLowerCase(),D=K?cP(D):D,this.pattern===D){let T={isMatch:!0,score:0};if(z)T.indices=[[0,D.length-1]];return T}let{location:J,distance:q,threshold:X,findAllMatches:W,minMatchCharLength:H,ignoreLocation:w}=this.options,O=[],N=0,A=!1;this.chunks.forEach(({pattern:T,alphabet:_,startIndex:F})=>{let{isMatch:B,score:C,indices:I}=JG1(D,T,_,{location:J+F,distance:q,threshold:X,findAllMatches:W,minMatchCharLength:H,includeMatches:z,ignoreLocation:w});if(B)A=!0;if(N+=C,B&&I)O.push(...I)});let V={isMatch:A,score:A?N/this.chunks.length:1};if(A&&z)V.indices=e80(O);return V}}class Sz{constructor(D){this.pattern=D}static isMultiMatch(D){return a08(D,this.multiRegex)}static isSingleMatch(D){return a08(D,this.singleRegex)}search(D){return{isMatch:!1,score:1}}}function a08(D,$){let K=D.match($);return K?K[1]:null}class X88 extends Sz{constructor(D){super(D)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(D){let $=D===this.pattern;return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}}class Z88 extends Sz{constructor(D){super(D)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(D){let K=D.indexOf(this.pattern)===-1;return{isMatch:K,score:K?0:1,indices:[0,D.length-1]}}}class W88 extends Sz{constructor(D){super(D)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(D){let $=D.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,this.pattern.length-1]}}}class H88 extends Sz{constructor(D){super(D)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(D){let $=!D.startsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,D.length-1]}}}class G88 extends Sz{constructor(D){super(D)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(D){let $=D.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[D.length-this.pattern.length,D.length-1]}}}class w88 extends Sz{constructor(D){super(D)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(D){let $=!D.endsWith(this.pattern);return{isMatch:$,score:$?0:1,indices:[0,D.length-1]}}}class D10 extends Sz{constructor(D,{location:$=z1.location,threshold:K=z1.threshold,distance:z=z1.distance,includeMatches:J=z1.includeMatches,findAllMatches:q=z1.findAllMatches,minMatchCharLength:X=z1.minMatchCharLength,isCaseSensitive:W=z1.isCaseSensitive,ignoreDiacritics:H=z1.ignoreDiacritics,ignoreLocation:w=z1.ignoreLocation}={}){super(D);this._bitapSearch=new OS(D,{location:$,threshold:K,distance:z,includeMatches:J,findAllMatches:q,minMatchCharLength:X,isCaseSensitive:W,ignoreDiacritics:H,ignoreLocation:w})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(D){return this._bitapSearch.searchIn(D)}}class $10 extends Sz{constructor(D){super(D)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(D){let $=0,K,z=[],J=this.pattern.length;while((K=D.indexOf(this.pattern,$))>-1)$=K+J,z.push([K,$-1]);let q=!!z.length;return{isMatch:q,score:q?0:1,indices:z}}}var i80=[X88,$10,W88,H88,w88,G88,Z88,D10],s08=i80.length,XG1="\x00",ZG1="|";function WG1(D){let $=[],K=D.length,z=0;while(z<K){while(z<K&&D[z]===" ")z++;if(z>=K)break;let J=z;while(J<K&&D[J]!==" "&&D[J]!=='"')J++;if(J<K&&D[J]==='"'){J++;while(J<K){if(D[J]==='"'){let q=J+1;if(q>=K||D[q]===" "){J++;break}if(D[q]==="$"&&(q+1>=K||D[q+1]===" ")){J+=2;break}}J++}$.push(D.substring(z,J)),z=J}else{while(J<K&&D[J]!==" ")J++;$.push(D.substring(z,J)),z=J}}return $}function HG1(D,$={}){return D.replace(/\\\|/g,XG1).split(ZG1).map((z)=>{let J=z.replace(/\u0000/g,"|"),q=WG1(J.trim()).filter((W)=>W&&!!W.trim()),X=[];for(let W=0,H=q.length;W<H;W+=1){let w=q[W],O=!1,N=-1;while(!O&&++N<s08){let A=i80[N],V=A.isMultiMatch(w);if(V)X.push(new A(V,$)),O=!0}if(O)continue;N=-1;while(++N<s08){let A=i80[N],V=A.isSingleMatch(w);if(V){X.push(new A(V,$));break}}}return X})}var GG1=new Set([D10.type,$10.type]);class O88{constructor(D,{isCaseSensitive:$=z1.isCaseSensitive,ignoreDiacritics:K=z1.ignoreDiacritics,includeMatches:z=z1.includeMatches,minMatchCharLength:J=z1.minMatchCharLength,ignoreLocation:q=z1.ignoreLocation,findAllMatches:X=z1.findAllMatches,location:W=z1.location,threshold:H=z1.threshold,distance:w=z1.distance}={}){this.query=null,this.options={isCaseSensitive:$,ignoreDiacritics:K,includeMatches:z,minMatchCharLength:J,findAllMatches:X,ignoreLocation:q,location:W,threshold:H,distance:w},D=$?D:D.toLowerCase(),D=K?cP(D):D,this.pattern=D,this.query=HG1(this.pattern,this.options)}static condition(D,$){return $.useExtendedSearch}searchIn(D){let $=this.query;if(!$)return{isMatch:!1,score:1};let{includeMatches:K,isCaseSensitive:z,ignoreDiacritics:J}=this.options;D=z?D:D.toLowerCase(),D=J?cP(D):D;let q=0,X=[],W=0,H=!1;for(let w=0,O=$.length;w<O;w+=1){let N=$[w];X.length=0,q=0,H=!1;for(let A=0,V=N.length;A<V;A+=1){let T=N[A],{isMatch:_,indices:F,score:B}=T.search(D);if(_){q+=1,W+=B;let C=T.constructor.type;if(C.startsWith("inverse"))H=!0;if(K)if(GG1.has(C))X.push(...F);else X.push(F)}else{W=0,q=0,X.length=0,H=!1;break}}if(q){let A={isMatch:!0,score:W/q};if(H)A.hasInverse=!0;if(K)A.indices=e80(X);return A}}return{isMatch:!1,score:1}}}var r80=[];function K10(...D){r80.push(...D)}function HS(D,$){for(let K=0,z=r80.length;K<z;K+=1){let J=r80[K];if(J.condition(D,$))return new J(D,$)}return new OS(D,$)}var GS={AND:"$and",OR:"$or"},o80={PATH:"$path",PATTERN:"$val"},t80=(D)=>!!(D[GS.AND]||D[GS.OR]),wG1=(D)=>!!D[o80.PATH],OG1=(D)=>!kq(D)&&$88(D)&&!t80(D),e08=(D)=>({[GS.AND]:Object.keys(D).map(($)=>({[$]:D[$]}))});function N88(D,$,{auto:K=!0}={}){let z=(J)=>{if(u9(J)){let H={keyId:null,pattern:J};if(K)H.searcher=HS(J,$);return H}let q=Object.keys(J),X=wG1(J);if(!X&&q.length>1&&!t80(J))return z(e08(J));if(OG1(J)){let H=X?J[o80.PATH]:q[0],w=X?J[o80.PATTERN]:J[H];if(!u9(w))throw Error(dH1(H));let O={keyId:n80(H),pattern:w};if(K)O.searcher=HS(w,$);return O}let W={children:[],operator:q[0]};return q.forEach((H)=>{let w=J[H];if(kq(w))w.forEach((O)=>{W.children.push(z(O))})}),W};if(!t80(D))D=e08(D);return z(D)}function a80(D,{ignoreFieldNorm:$=z1.ignoreFieldNorm}){let K=1;return D.forEach(({key:z,norm:J,score:q})=>{let X=z?z.weight:null;K*=Math.pow(q===0&&X?Number.EPSILON:q,(X||1)*($?1:J))}),K}function NG1(D,{ignoreFieldNorm:$=z1.ignoreFieldNorm}){D.forEach((K)=>{K.score=a80(K.matches,{ignoreFieldNorm:$})})}class M88{constructor(D){this.limit=D,this.heap=[]}get size(){return this.heap.length}shouldInsert(D){return this.size<this.limit||D<this.heap[0].score}insert(D){if(this.size<this.limit)this.heap.push(D),this._bubbleUp(this.size-1);else if(D.score<this.heap[0].score)this.heap[0]=D,this._sinkDown(0)}extractSorted(D){return this.heap.sort(D)}_bubbleUp(D){let $=this.heap;while(D>0){let K=D-1>>1;if($[D].score<=$[K].score)break;let z=$[D];$[D]=$[K],$[K]=z,D=K}}_sinkDown(D){let $=this.heap,K=$.length,z=D;do{D=z;let J=2*D+1,q=2*D+2;if(J<K&&$[J].score>$[z].score)z=J;if(q<K&&$[q].score>$[z].score)z=q;if(z!==D){let X=$[D];$[D]=$[z],$[z]=X}}while(z!==D)}}function MG1(D,$){let K=D.matches;if($.matches=[],!V3(K))return;K.forEach((z)=>{if(!V3(z.indices)||!z.indices.length)return;let{indices:J,value:q}=z,X={indices:J,value:q};if(z.key)X.key=z.key.src;if(z.idx>-1)X.refIndex=z.idx;$.matches.push(X)})}function AG1(D,$){$.score=D.score}function VG1(D,$,{includeMatches:K=z1.includeMatches,includeScore:z=z1.includeScore}={}){let J=[];if(K)J.push(MG1);if(z)J.push(AG1);return D.map((q)=>{let{idx:X}=q,W={item:$[X],refIndex:X};if(J.length)J.forEach((H)=>{H(q,W)});return W})}var PG1=/\b\w+\b/g;function s80({isCaseSensitive:D=!1,ignoreDiacritics:$=!1}={}){return{tokenize(K){if(!D)K=K.toLowerCase();if($)K=cP(K);return K.match(PG1)||[]}}}function LG1(D,$,K){let z=new Map,J=new Map,q=0;function X(W,H,w,O){let N=K.tokenize(W);if(!N.length)return;q++;let A=new Map;for(let V of N)A.set(V,(A.get(V)||0)+1);for(let[V,T]of A){let _={docIdx:H,keyIdx:w,subIdx:O,tf:T},F=z.get(V);if(!F)F=[],z.set(V,F);F.push(_),J.set(V,(J.get(V)||0)+1)}}for(let W of D){let{i:H,v:w,$:O}=W;if(w!==void 0){X(w,H,-1,-1);continue}if(O)for(let N=0;N<$;N++){let A=O[N];if(!A)continue;if(Array.isArray(A))for(let V of A)X(V.v,H,N,V.i??-1);else X(A.v,H,N,-1)}}return{terms:z,fieldCount:q,df:J}}function TG1(D,$,K,z){let{i:J,v:q,$:X}=$;function W(H,w,O){let N=z.tokenize(H);if(!N.length)return;D.fieldCount++;let A=new Map;for(let V of N)A.set(V,(A.get(V)||0)+1);for(let[V,T]of A){let _={docIdx:J,keyIdx:w,subIdx:O,tf:T},F=D.terms.get(V);if(!F)F=[],D.terms.set(V,F);F.push(_),D.df.set(V,(D.df.get(V)||0)+1)}}if(q!==void 0){W(q,-1,-1);return}if(X)for(let H=0;H<K;H++){let w=X[H];if(!w)continue;if(Array.isArray(w))for(let O of w)W(O.v,H,O.i??-1);else W(w.v,H,-1)}}function D88(D,$){for(let[K,z]of D.terms){let J=z.filter((X)=>X.docIdx!==$),q=z.length-J.length;if(q>0)if(D.fieldCount-=q,D.df.set(K,(D.df.get(K)||0)-q),J.length===0)D.terms.delete(K),D.df.delete(K);else D.terms.set(K,J)}}class s${constructor(D,$,K){this.options={...z1,...$},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new z88(this.options.keys),this._docs=D,this._myIndex=null,this._invertedIndex=null,this.setCollection(D,K),this._lastQuery=null,this._lastSearcher=null}_getSearcher(D){if(this._lastQuery===D)return this._lastSearcher;let $=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,K=HS(D,$);return this._lastQuery=D,this._lastSearcher=K,K}setCollection(D,$){if(this._docs=D,$&&!($ instanceof wS))throw Error(lH1);if(this._myIndex=$||q88(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let K=s80({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=LG1(this._myIndex.records,this._myIndex.keys.length,K)}}add(D){if(!V3(D))return;if(this._docs.push(D),this._myIndex.add(D),this._invertedIndex){let $=this._myIndex.records[this._myIndex.records.length-1],K=s80({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});TG1(this._invertedIndex,$,this._myIndex.keys.length,K)}}remove(D=()=>!1){let $=[],K=[];for(let z=0,J=this._docs.length;z<J;z+=1)if(D(this._docs[z],z))$.push(this._docs[z]),K.push(z);if(K.length){if(this._invertedIndex)for(let z of K)D88(this._invertedIndex,z);for(let z=K.length-1;z>=0;z-=1)this._docs.splice(K[z],1);this._myIndex.removeAll(K)}return $}removeAt(D){if(this._invertedIndex)D88(this._invertedIndex,D);let $=this._docs.splice(D,1)[0];return this._myIndex.removeAt(D),$}getIndex(){return this._myIndex}search(D,$){let{limit:K=-1}=$||{},{includeMatches:z,includeScore:J,shouldSort:q,sortFn:X,ignoreFieldNorm:W}=this.options;if(u9(D)&&!D.trim()){let O=this._docs.map((N,A)=>({item:N,refIndex:A}));if(WS(K)&&K>-1)O=O.slice(0,K);return O}let H=WS(K)&&K>0&&u9(D),w;if(H){let O=new M88(K);if(u9(this._docs[0]))this._searchStringList(D,{heap:O,ignoreFieldNorm:W});else this._searchObjectList(D,{heap:O,ignoreFieldNorm:W});w=O.extractSorted(X)}else{if(w=u9(D)?u9(this._docs[0])?this._searchStringList(D):this._searchObjectList(D):this._searchLogical(D),NG1(w,{ignoreFieldNorm:W}),q)w.sort(X);if(WS(K)&&K>-1)w=w.slice(0,K)}return VG1(w,this._docs,{includeMatches:z,includeScore:J})}_searchStringList(D,{heap:$,ignoreFieldNorm:K}={}){let z=this._getSearcher(D),{records:J}=this._myIndex,q=$?null:[];return J.forEach(({v:X,i:W,n:H})=>{if(!V3(X))return;let{isMatch:w,score:O,indices:N}=z.searchIn(X);if(w){let A={item:X,idx:W,matches:[{score:O,value:X,norm:H,indices:N}]};if($){if(A.score=a80(A.matches,{ignoreFieldNorm:K}),$.shouldInsert(A.score))$.insert(A)}else q.push(A)}}),q}_searchLogical(D){let $=N88(D,this.options),K=(X,W,H)=>{if(!("children"in X)){let{keyId:A,searcher:V}=X,T;if(A===null)T=[],this._myIndex.keys.forEach((_,F)=>{T.push(...this._findMatches({key:_,value:W[F],searcher:V}))});else T=this._findMatches({key:this._keyStore.get(A),value:this._myIndex.getValueForItemAtKeyId(W,A),searcher:V});if(T&&T.length)return[{idx:H,item:W,matches:T}];return[]}let{children:w,operator:O}=X,N=[];for(let A=0,V=w.length;A<V;A+=1){let T=w[A],_=K(T,W,H);if(_.length)N.push(..._);else if(O===GS.AND)return[]}return N},z=this._myIndex.records,J=new Map,q=[];return z.forEach(({$:X,i:W})=>{if(V3(X)){let H=K($,X,W);if(H.length){if(!J.has(W))J.set(W,{idx:W,item:X,matches:[]}),q.push(J.get(W));H.forEach(({matches:w})=>{J.get(W).matches.push(...w)})}}}),q}_searchObjectList(D,{heap:$,ignoreFieldNorm:K}={}){let z=this._getSearcher(D),{keys:J,records:q}=this._myIndex,X=$?null:[];return q.forEach(({$:W,i:H})=>{if(!V3(W))return;let w=[],O=!1,N=!1;if(J.forEach((A,V)=>{let T=this._findMatches({key:A,value:W[V],searcher:z});if(T.length){if(w.push(...T),T[0].hasInverse)N=!0}else O=!0}),N&&O)return;if(w.length){let A={idx:H,item:W,matches:w};if($){if(A.score=a80(A.matches,{ignoreFieldNorm:K}),$.shouldInsert(A.score))$.insert(A)}else X.push(A)}}),X}_findMatches({key:D,value:$,searcher:K}){if(!V3($))return[];let z=[];if(kq($))$.forEach(({v:J,i:q,n:X})=>{if(!V3(J))return;let{isMatch:W,score:H,indices:w,hasInverse:O}=K.searchIn(J);if(W)z.push({score:H,key:D,value:J,idx:q,norm:X,indices:w,hasInverse:O})});else{let{v:J,n:q}=$,{isMatch:X,score:W,indices:H,hasInverse:w}=K.searchIn(J);if(X)z.push({score:W,key:D,value:J,norm:q,indices:H,hasInverse:w})}return z}}class A88{static condition(D,$){return $.useTokenSearch}constructor(D,$){this.options=$,this.analyzer=s80({isCaseSensitive:$.isCaseSensitive,ignoreDiacritics:$.ignoreDiacritics});let K=this.analyzer.tokenize(D),z=$._invertedIndex,{df:J,fieldCount:q}=z;this.termSearchers=[],this.idfWeights=[];for(let X of K){this.termSearchers.push(new OS(X,{location:$.location,threshold:$.threshold,distance:$.distance,includeMatches:$.includeMatches,findAllMatches:$.findAllMatches,minMatchCharLength:$.minMatchCharLength,isCaseSensitive:$.isCaseSensitive,ignoreDiacritics:$.ignoreDiacritics,ignoreLocation:!0}));let W=J.get(X)||0,H=Math.log(1+(q-W+0.5)/(W+0.5));this.idfWeights.push(H)}}searchIn(D){if(!this.termSearchers.length)return{isMatch:!1,score:1};let $=[],K=0,z=0,J=0;for(let W=0;W<this.termSearchers.length;W++){let H=this.termSearchers[W].searchIn(D),w=this.idfWeights[W];if(z+=w,H.isMatch){if(J++,K+=w*(1-H.score),H.indices)$.push(...H.indices)}}if(J===0)return{isMatch:!1,score:1};let q=z>0?1-K/z:0,X={isMatch:!0,score:Math.max(0.001,q)};if(this.options.includeMatches&&$.length)X.indices=e80($);return X}}s$.version="7.3.0";s$.createIndex=q88;s$.parseIndex=KG1;s$.config=z1;s$.match=function(D,$,K){return HS(D,{...z1,...K}).searchIn($)};s$.parseQuery=N88;K10(O88);K10(A88);s$.use=function(...D){D.forEach(($)=>K10($))};var _G1={name:"help",aliases:[],description:"Show available commands",parse(){return{type:"help"}}},z10=`Commands:
1228
1224
  /agent <name> load a custom agent
1229
1225
  /agents list available agents
@@ -1273,7 +1269,7 @@ Analyze and report:
1273
1269
  4. **Security** \u2014 unvalidated inputs, data exposure
1274
1270
  5. **Suggested improvements** \u2014 refactors worth doing
1275
1271
 
1276
- For each issue found, show the problematic snippet and the suggested fix. Be direct and objective.`,F88=RG1;var QG1={name:"theme",aliases:[],description:"Change color theme",parse(){return{type:"theme"}}},E88=QG1;var CG1={name:"agent",aliases:[],description:"Load a custom agent",parse(D){let $=D[0];if($)return{type:"agent",name:$};return{type:"unknown",input:"Usage: /agent <name>"}}},B88=CG1;var UG1={name:"agents",aliases:[],description:"List available agents",parse(){return{type:"agents"}}},j88=UG1;var IG1={name:"vim",aliases:[],description:"Toggle vim keybindings",parse(){return{type:"vim"}}},R88=IG1;var SG1={name:"quit",aliases:["q"],description:"Exit application",parse(){return{type:"quit"}}},Q88=SG1;var kG1={name:"checkpoint",aliases:[],description:"Manage checkpoints",parse(D){let $=D[0];if(!$||$==="save")return{type:"checkpoint",action:"save",label:D.slice(1).join(" ")||void 0};if($==="list")return{type:"checkpoint",action:"list"};if($==="restore"){let K=D[1];if(K)return{type:"checkpoint",action:"restore",id:K};return{type:"unknown",input:"Usage: /checkpoint restore <id>"}}return{type:"unknown",input:"Usage: /checkpoint [save [label] | list | restore <id>]"}}},C88=kG1;var fG1={name:"sessions",aliases:[],description:"List recent sessions",parse(){return{type:"sessions"}}},U88=fG1;var xG1={name:"language",aliases:[],description:"Change preferred language",parse(){return{type:"language"}}},I88=xG1;var bG1={name:"undo",aliases:[],description:"Restore last file modified by agent (all | list)",parse(D){let $=D[0];if($==="all")return{type:"undo",action:"all"};if($==="list")return{type:"undo",action:"list"};return{type:"undo"}}},S88=bG1;var hG1={name:"retry",aliases:[],description:"Re-run last message",parse(){return{type:"retry"}}},k88=hG1;var vG1={name:"cost",aliases:[],description:"Show estimated session cost",parse(){return{type:"cost"}}},f88=vG1;var yG1={name:"files",aliases:[],description:"List modified files this session",parse(){return{type:"files"}}},x88=yG1;var uG1={name:"tools",aliases:[],description:"List available tools",parse(){return{type:"tools"}}},b88=uG1;var gG1={name:"system",aliases:[],description:"Show active system prompt",parse(){return{type:"system"}}},h88=gG1;var mG1={name:"permissions",aliases:[],description:"Show tool permission settings",parse(){return{type:"permissions"}}},v88=mG1;var cG1={name:"msg",aliases:["btw"],description:"Add a note without interrupting the agent",parse(D){let $=D.join(" ");if(!$)return{type:"unknown",input:"Usage: /msg <note> \u2014 add a note without interrupting the agent"};return{type:"msg",note:$}}},y88=cG1;var pG1={name:"stats",aliases:[],description:"Show session statistics",parse(){return{type:"stats"}}},u88=pG1;var lG1={name:"models",aliases:[],description:"Switch model interactively",parse(){return{type:"models"}}},g88=lG1;var dG1={name:"memory",aliases:["mem"],description:"View or clear persistent memory",parse(D){if(D[0]==="clear")return{type:"memory",action:"clear",target:D[1]};return{type:"memory",action:"show"}}},m88=dG1;var nG1={name:"effort",aliases:[],description:"Set reasoning effort level",parse(D){let $=D[0]?.toLowerCase();if(!$)return{type:"effort",action:"status"};if($==="status"||$==="current")return{type:"effort",action:"status"};if($==="auto"||$==="unset")return{type:"effort",action:"set",level:"high"};if(["low","high","max"].includes($))return{type:"effort",action:"set",level:$};return{type:"unknown",input:`Invalid effort level: "${$}". Use: /effort [low|high|max|auto]`}}},c88=nG1;var iG1={name:"enchant-prompt",aliases:["enchant"],description:"Toggle prompt enchantment (AI prompt refinement)",parse(){return{type:"enchant-prompt"}}},p88=iG1;var rG1=/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/,l88=/^[a-z0-9]+(-[a-z0-9]+)*$/;function oG1(D){let $=D[0]?.toLowerCase();if(!$)return{type:"skill",action:"help"};switch($){case"install":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill install <owner/repo>"};if(!rG1.test(K))return{type:"skill",action:"error",message:`Invalid repo format: "${K}". Expected: owner/repo`};return{type:"skill",action:"install",repo:K}}case"list":return{type:"skill",action:"list"};case"remove":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill remove <name>"};if(!l88.test(K))return{type:"skill",action:"error",message:`Invalid skill name: "${K}". Must be kebab-case (lowercase letters, numbers, hyphens)`};return{type:"skill",action:"remove",name:K}}case"update":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill update <name>"};if(!l88.test(K))return{type:"skill",action:"error",message:`Invalid skill name: "${K}". Must be kebab-case (lowercase letters, numbers, hyphens)`};return{type:"skill",action:"update",name:K}}default:return{type:"skill",action:"help"}}}var tG1={name:"skill",aliases:["skills"],description:"Manage skills (install, list, remove, update)",parse(D){return oG1(D)}},d88=tG1;var n88=[V88,P88,L88,T88,_88,F88,E88,B88,j88,R88,Q88,C88,U88,I88,S88,k88,f88,x88,b88,h88,v88,y88,u88,g88,m88,c88,p88,d88];function i88(D){let $=D.trim();if(!$.startsWith("/"))return null;let[K,...z]=$.slice(1).split(/\s+/);for(let J of n88)if(J.name===K||J.aliases.includes(K))return J.parse(z);return{type:"unknown",input:`Unknown command: /${K}. Use /help to see available commands.`}}var mG=n88.flatMap((D)=>[`/${D.name}`,...D.aliases.map(($)=>`/${$}`)]);var Y10=null;function aG1(){if(!Y10)Y10=new s$(mG,{threshold:0.4,distance:100,includeScore:!0,minMatchCharLength:2});return Y10}function X10(D){if(!D.startsWith("/"))return[];if(D==="/")return mG;if(D.length<2)return[];let $=mG.filter((J)=>J.startsWith(D));if($.length>0)return $;let K=D.slice(1);return aG1().search(K).slice(0,8).map((J)=>J.item)}function Z10(D,$){if(!D.startsWith("/")||D.length<2)return null;let K=$.find((z)=>z.startsWith(D)&&z!==D);if(!K)return null;return{text:K.slice(D.length),fullCommand:K,insertPosition:D.length}}function W10(D,$){if(D.length<2)return null;for(let K=$.length-1;K>=0;K--){let z=$[K];if(z.startsWith(D)&&z!==D&&z.length>D.length)return{text:z.slice(D.length),fullCommand:z,insertPosition:D.length}}return null}var sG1={"/agent":"<name>","/model":"<model-name>","/plan":"<task description>","/review":"<file or description>","/msg":"<note>","/language":"<language>","/theme":"<theme>","/checkpoint":"<name>","/effort":"[low/high/max]","/sessions":"","/files":""};function r88(D){let $=D.trimEnd();if(!$.startsWith("/"))return null;if(!D.endsWith(" "))return null;let K=sG1[$];if(!K)return null;return{text:K,fullCommand:D,insertPosition:D.length}}function o88(D,$,K,z){if($!==D.length)return null;if(D.length===0)return null;if(D.startsWith("/")){let q=Z10(D,K);if(q)return q}let J=r88(D);if(J)return J;return W10(D,z)}n6();Y4();var I6=k(f8(),1);function eG1(D,$){if($<=0)$=80;if(D.length<=$)return[{text:D,startOffset:0}];let K=[],z=0;while(z<D.length){let J=D.slice(z,z+$);K.push({text:J,startOffset:z}),z+=J.length}return K}function t88({cursor:D,columns:$,placeholder:K="What do you want me to do? \u21B5",ghostText:z,maxVisibleLines:J,prefix:q="",prefixColor:X="cyan"}){let{text:W,offset:H}=D,w=q.length,O=Math.max(20,$-4-w);if(W==="")return I6.jsxDEV(I6.Fragment,{children:[q&&I6.jsxDEV(o,{color:X,children:q},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"white",backgroundColor:"white",children:" "},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"#888888",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let N=W.split(`
1272
+ For each issue found, show the problematic snippet and the suggested fix. Be direct and objective.`,F88=RG1;var QG1={name:"theme",aliases:[],description:"Change color theme",parse(){return{type:"theme"}}},E88=QG1;var CG1={name:"agent",aliases:[],description:"Load a custom agent",parse(D){let $=D[0];if($)return{type:"agent",name:$};return{type:"unknown",input:"Usage: /agent <name>"}}},B88=CG1;var UG1={name:"agents",aliases:[],description:"List available agents",parse(){return{type:"agents"}}},j88=UG1;var IG1={name:"vim",aliases:[],description:"Toggle vim keybindings",parse(){return{type:"vim"}}},R88=IG1;var SG1={name:"quit",aliases:["q"],description:"Exit application",parse(){return{type:"quit"}}},Q88=SG1;var kG1={name:"checkpoint",aliases:[],description:"Manage checkpoints",parse(D){let $=D[0];if(!$||$==="save")return{type:"checkpoint",action:"save",label:D.slice(1).join(" ")||void 0};if($==="list")return{type:"checkpoint",action:"list"};if($==="restore"){let K=D[1];if(K)return{type:"checkpoint",action:"restore",id:K};return{type:"unknown",input:"Usage: /checkpoint restore <id>"}}return{type:"unknown",input:"Usage: /checkpoint [save [label] | list | restore <id>]"}}},C88=kG1;var fG1={name:"sessions",aliases:[],description:"List recent sessions",parse(){return{type:"sessions"}}},U88=fG1;var xG1={name:"language",aliases:[],description:"Change preferred language",parse(){return{type:"language"}}},I88=xG1;var bG1={name:"undo",aliases:[],description:"Restore last file modified by agent (all | list)",parse(D){let $=D[0];if($==="all")return{type:"undo",action:"all"};if($==="list")return{type:"undo",action:"list"};return{type:"undo"}}},S88=bG1;var hG1={name:"retry",aliases:[],description:"Re-run last message",parse(){return{type:"retry"}}},k88=hG1;var vG1={name:"cost",aliases:[],description:"Show estimated session cost",parse(){return{type:"cost"}}},f88=vG1;var yG1={name:"files",aliases:[],description:"List modified files this session",parse(){return{type:"files"}}},x88=yG1;var uG1={name:"tools",aliases:[],description:"List available tools",parse(){return{type:"tools"}}},b88=uG1;var gG1={name:"system",aliases:[],description:"Show active system prompt",parse(){return{type:"system"}}},h88=gG1;var mG1={name:"permissions",aliases:[],description:"Show tool permission settings",parse(){return{type:"permissions"}}},v88=mG1;var cG1={name:"msg",aliases:["btw"],description:"Add a note without interrupting the agent",parse(D){let $=D.join(" ");if(!$)return{type:"unknown",input:"Usage: /msg <note> \u2014 add a note without interrupting the agent"};return{type:"msg",note:$}}},y88=cG1;var pG1={name:"stats",aliases:[],description:"Show session statistics",parse(){return{type:"stats"}}},u88=pG1;var lG1={name:"models",aliases:[],description:"Switch model interactively",parse(){return{type:"models"}}},g88=lG1;var dG1={name:"memory",aliases:["mem"],description:"View or clear persistent memory",parse(D){if(D[0]==="clear")return{type:"memory",action:"clear",target:D[1]};return{type:"memory",action:"show"}}},m88=dG1;var nG1={name:"effort",aliases:[],description:"Set reasoning effort level",parse(D){let $=D[0]?.toLowerCase();if(!$)return{type:"effort",action:"status"};if($==="status"||$==="current")return{type:"effort",action:"status"};if($==="auto"||$==="unset")return{type:"effort",action:"set",level:"high"};if(["low","high","max"].includes($))return{type:"effort",action:"set",level:$};return{type:"unknown",input:`Invalid effort level: "${$}". Use: /effort [low|high|max|auto]`}}},c88=nG1;var iG1={name:"enchant-prompt",aliases:["enchant"],description:"Toggle prompt enchantment (AI prompt refinement)",parse(){return{type:"enchant-prompt"}}},p88=iG1;var rG1=/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/,l88=/^[a-z0-9]+(-[a-z0-9]+)*$/;function oG1(D){let $=D[0]?.toLowerCase();if(!$)return{type:"skill",action:"help"};switch($){case"install":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill install <owner/repo>"};if(!rG1.test(K))return{type:"skill",action:"error",message:`Invalid repo format: "${K}". Expected: owner/repo`};return{type:"skill",action:"install",repo:K}}case"list":return{type:"skill",action:"list"};case"remove":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill remove <name>"};if(!l88.test(K))return{type:"skill",action:"error",message:`Invalid skill name: "${K}". Must be kebab-case (lowercase letters, numbers, hyphens)`};return{type:"skill",action:"remove",name:K}}case"update":{let K=D[1];if(!K)return{type:"skill",action:"error",message:"Usage: /skill update <name>"};if(!l88.test(K))return{type:"skill",action:"error",message:`Invalid skill name: "${K}". Must be kebab-case (lowercase letters, numbers, hyphens)`};return{type:"skill",action:"update",name:K}}default:return{type:"skill",action:"help"}}}var tG1={name:"skill",aliases:["skills"],description:"Manage skills (install, list, remove, update)",parse(D){return oG1(D)}},d88=tG1;var n88=[V88,P88,L88,T88,_88,F88,E88,B88,j88,R88,Q88,C88,U88,I88,S88,k88,f88,x88,b88,h88,v88,y88,u88,g88,m88,c88,p88,d88];function i88(D){let $=D.trim();if(!$.startsWith("/"))return null;let[K,...z]=$.slice(1).split(/\s+/);for(let J of n88)if(J.name===K||J.aliases.includes(K))return J.parse(z);return{type:"unknown",input:`Unknown command: /${K}. Use /help to see available commands.`}}var mG=n88.flatMap((D)=>[`/${D.name}`,...D.aliases.map(($)=>`/${$}`)]);var Y10=null;function aG1(){if(!Y10)Y10=new s$(mG,{threshold:0.4,distance:100,includeScore:!0,minMatchCharLength:2});return Y10}function X10(D){if(!D.startsWith("/"))return[];if(D==="/")return mG;if(D.length<2)return[];let $=mG.filter((J)=>J.startsWith(D));if($.length>0)return $;let K=D.slice(1);return aG1().search(K).slice(0,8).map((J)=>J.item)}function Z10(D,$){if(!D.startsWith("/")||D.length<2)return null;let K=$.find((z)=>z.startsWith(D)&&z!==D);if(!K)return null;return{text:K.slice(D.length),fullCommand:K,insertPosition:D.length}}function W10(D,$){if(D.length<2)return null;for(let K=$.length-1;K>=0;K--){let z=$[K];if(z.startsWith(D)&&z!==D&&z.length>D.length)return{text:z.slice(D.length),fullCommand:z,insertPosition:D.length}}return null}var sG1={"/agent":"<name>","/model":"<model-name>","/plan":"<task description>","/review":"<file or description>","/msg":"<note>","/language":"<language>","/theme":"<theme>","/checkpoint":"<name>","/effort":"[low/high/max]","/sessions":"","/files":""};function r88(D){let $=D.trimEnd();if(!$.startsWith("/"))return null;if(!D.endsWith(" "))return null;let K=sG1[$];if(!K)return null;return{text:K,fullCommand:D,insertPosition:D.length}}function o88(D,$,K,z){if($!==D.length)return null;if(D.length===0)return null;if(D.startsWith("/")){let q=Z10(D,K);if(q)return q}let J=r88(D);if(J)return J;return W10(D,z)}n6();Y4();var I6=k(f8(),1);function eG1(D,$){if($<=0)$=80;if(D.length<=$)return[{text:D,startOffset:0}];let K=[],z=0;while(z<D.length){if(z+$>=D.length){K.push({text:D.slice(z),startOffset:z});break}let J=D.lastIndexOf(" ",z+$);if(J<=z)J=z+$;K.push({text:D.slice(z,J),startOffset:z}),z=D[J]===" "?J+1:J}return K}function t88({cursor:D,columns:$,placeholder:K="What do you want me to do? \u21B5",ghostText:z,maxVisibleLines:J,prefix:q="",prefixColor:X="cyan"}){let{text:W,offset:H}=D,w=q.length,O=Math.max(20,$-4-w);if(W==="")return I6.jsxDEV(I6.Fragment,{children:[q&&I6.jsxDEV(o,{color:X,children:q},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"white",backgroundColor:"white",children:" "},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"#888888",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let N=W.split(`
1277
1273
  `),A=J??10,V=[],T=0;for(let f=0;f<N.length;f++){let m=N[f],u=eG1(m,O);for(let g of u)V.push({text:g.text,hardLineIdx:f,offsetInValue:T+g.startOffset});T+=m.length+1}if(V.length===1&&!W.includes(`
1278
1274
  `)){let f=W.slice(0,H),m=W.slice(H,H+1)||" ",u=W.slice(H+1);return I6.jsxDEV(I6.Fragment,{children:[q&&I6.jsxDEV(o,{color:X,children:q},void 0,!1,void 0,this),I6.jsxDEV(o,{children:f},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"black",backgroundColor:"white",children:m},void 0,!1,void 0,this),I6.jsxDEV(o,{children:u},void 0,!1,void 0,this),z&&I6.jsxDEV(o,{color:"#555555",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}let _=V.length-1;for(let f=0;f<V.length;f++){let m=V[f],u=f+1<V.length?V[f+1].offsetInValue:W.length+1;if(H>=m.offsetInValue&&H<u){_=f;break}}let F=Math.floor(A/2),B=Math.max(0,Math.min(_-F,V.length-A)),C=Math.min(V.length,B+A),I=B,y=V.length-C,v=V.slice(B,C);return I6.jsxDEV(U0,{flexDirection:"column",children:[I>0&&I6.jsxDEV(o,{color:"#888888",children:` \u2191 ${I} more line${I>1?"s":""}`},void 0,!1,void 0,this),v.map((f,m)=>{let u=B+m,g=f.offsetInValue+f.text.length,K0=H>=f.offsetInValue&&H<=g,c=u===0?q:" ".repeat(w),s=u===0&&q?X:void 0;if(!K0)return I6.jsxDEV(U0,{flexDirection:"row",children:[c&&I6.jsxDEV(o,{color:s,children:c},void 0,!1,void 0,this),I6.jsxDEV(o,{children:f.text||" "},void 0,!1,void 0,this)]},u,!0,void 0,this);let B0=H-f.offsetInValue,r0=f.text.slice(0,B0),t=f.text.slice(B0,B0+1)||" ",e=f.text.slice(B0+1),g0=u===V.length-1;return I6.jsxDEV(U0,{flexDirection:"row",children:[c&&I6.jsxDEV(o,{color:s,children:c},void 0,!1,void 0,this),I6.jsxDEV(o,{children:r0},void 0,!1,void 0,this),I6.jsxDEV(o,{color:"black",backgroundColor:"white",children:t},void 0,!1,void 0,this),I6.jsxDEV(o,{children:e},void 0,!1,void 0,this),g0&&z&&I6.jsxDEV(o,{color:"#555555",children:z},void 0,!1,void 0,this)]},u,!0,void 0,this)}),y>0&&I6.jsxDEV(o,{color:"#888888",children:` \u2193 ${y} more line${y>1?"s":""}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}n6();Y4();var cG=k(f8(),1);function a88({matches:D,selectedIdx:$,columns:K,descriptions:z={}}){let q=D.length,X=22,W=Math.max(10,K-22-4),H=Math.floor(3),w=Math.max(0,$-H),O=Math.min(q,w+6);if(O-w<6)w=Math.max(0,O-6);let N=D.slice(w,O);return cG.jsxDEV(U0,{flexDirection:"column",children:N.map((A,V)=>{let _=w+V===$,F=z[A]??"",B=F.length>W?F.slice(0,W-1)+"\u2026":F;return cG.jsxDEV(U0,{flexDirection:"row",children:[cG.jsxDEV(o,{color:"#888888",children:"\u2502 "},void 0,!1,void 0,this),cG.jsxDEV(o,{color:_?"cyan":void 0,children:A.padEnd(22)},void 0,!1,void 0,this),cG.jsxDEV(o,{color:_?"cyan":"#888888",children:B},void 0,!1,void 0,this)]},A,!0,void 0,this)})},void 0,!1,void 0,this)}a$();LX();n6();Y4();var i5=k(f8(),1);function s88({columns:D,agentLabel:$="deepseek",interactionMode:K,modeLabel:z,modeColor:J,vimEnabled:q=!1,vimMode:X="insert",contextPct:W=0,hasExclamation:H=!1,theme:w="dark",children:O}){let N=R4(w),A=z||hG[K],V=J||vG[K],T=q?X==="normal"?" [N]":" [I]":"",_=` ${A} `,F=` ${$} `,B=_+F,C=Math.max(0,D-4-B.length),I=uP.repeat(C),y=H?u4.bash:u4.user,v=H?N.bashBorder:N.promptBorder;return i5.jsxDEV(U0,{flexDirection:"column",children:[i5.jsxDEV(U0,{flexDirection:"row",children:[i5.jsxDEV(o,{color:N.promptBorder,children:I},void 0,!1,void 0,this),i5.jsxDEV(o,{color:V,children:_},void 0,!1,void 0,this),q&&i5.jsxDEV(o,{color:X==="normal"?N.warning:N.textDim,children:T},void 0,!1,void 0,this),i5.jsxDEV(o,{color:N.textDim,children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i5.jsxDEV(U0,{flexDirection:"row",gap:1,children:[i5.jsxDEV(o,{color:v,children:y},void 0,!1,void 0,this),W>0&&i5.jsxDEV(o,{color:W>=90?N.error:W>=70?N.warning:N.primary,children:W+"%"},void 0,!1,void 0,this),i5.jsxDEV(U0,{flexGrow:1,children:O},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i5.jsxDEV(o,{color:N.promptBorder,children:uP.repeat(Math.max(0,D-4))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}n6();Y4();var lP=k(t1(),1);n6();Y4();var pP=k(f8(),1),e88=["\u273B","\u273C","\u273D","\u273E","\u273F","\u2740","\u273F","\u273E","\u273D","\u273D","\u273C"],H10=["Prompt-engineering your prompt...","Distilling the essence of the problem...","Translating human to AI...","Calibrating artificial neurons...","Applying elite prompt engineering...","Atomizing the problem...","Scalpel-sharpening your question...","Untangling chaos into clarity...","Pre-thinking the thinking...","Consulting the engineering oracle...","Reverse-engineering your intent...","Assembling the perfect prompt..."],G10=["Consulting the code gods...","Pretending to understand the problem...","Zigzagging through Stack Overflow...","Compiling excuses...","Training artificial neurons...","Reading the docs (not really)...","Calculating the wrong answer...","Sipping virtual coffee...","Debugging the universe...","Definitely not asking ChatGPT...","Inventing an elegant solution...","Praying for no segfault...","Ignoring the warnings...","Running git blame on you...","Simulating intelligence...","Asking the rubber duck...","Reticulating splines...","Centering the div...","Questioning life choices...","Hoping the tests pass..."];function w10({toolCallCount:D,phase:$}){let K=uG(),[z,J]=lP.useState(()=>Math.floor(Math.random()*G10.length)),[q]=lP.useState(()=>Math.floor(Math.random()*H10.length));lP.useEffect(()=>{J(Math.floor(Math.random()*G10.length))},[D]);let X=$==="refining",W=X?H10[q%H10.length]:G10[z];return pP.jsxDEV(U0,{flexDirection:"row",gap:1,paddingLeft:1,children:[pP.jsxDEV(o,{color:X?"magenta":"cyan",children:e88[K%e88.length]},void 0,!1,void 0,this),pP.jsxDEV(o,{color:"#888888",children:W},void 0,!1,void 0,this),pP.jsxDEV(o,{color:"#888888",children:" \xB7 Ctrl+C to cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var kz=k(f8(),1);function $w1(D,$){let K,z=!1;if(D.upArrow)K="up",z=!0;else if(D.downArrow)K="down",z=!0;else if(D.leftArrow)K="left",z=!0;else if(D.rightArrow)K="right",z=!0;else if(D.return)K="return",z=!0;else if(D.escape)K="escape",z=!0;else if(D.backspace)K="backspace",z=!0;else if(D.delete)K="delete",z=!0;else if(D.tab)K="tab",z=!0;else if(D.home)K="home",z=!0;else if(D.end)K="end",z=!0;else if(D.pageUp)K="pageup",z=!0;else if(D.pageDown)K="pagedown",z=!0;else if(D.ctrl&&$.length===1)K=$.toLowerCase(),z=!0;return{name:K,ctrl:D.ctrl,meta:D.meta,shift:D.shift,option:D.meta,raw:!z&&!D.ctrl&&!D.meta&&$.length===1?$:void 0,sequence:$}}var Kw1={"/quit":"Exit DeepSeek Code","/q":"Exit DeepSeek Code","/clear":"Clear chat history","/compact":"Summarize history to save context","/help":"Show available commands","/agent":"Load a custom agent","/agents":"List available agents","/model deepseek-v4-flash":"Switch to DeepSeek V4 Flash","/model deepseek-v4-pro":"Switch to DeepSeek V4 Pro","/model deepseek-reasoner":"Switch to DeepSeek R1","/models":"Switch model interactively","/language":"Change preferred language","/theme":"Change color theme","/undo":"Restore last file modified by agent","/retry":"Re-run last message","/cost":"Show estimated session cost","/files":"List files modified this session","/tools":"List all available tools","/system":"Show active system prompt","/sessions":"List recent sessions","/checkpoint":"Save current state","/checkpoint list":"List saved checkpoints","/plan":"Plan implementation of a task","/review":"Review code in the project","/msg":"Add a note without interrupting the agent","/vim":"Toggle vim keybindings (normal/insert mode)","/stats":"Show session statistics","/effort":"Set reasoning effort level","/effort low":"Quick responses","/effort high":"Comprehensive thinking","/effort max":"Maximum reasoning depth","/enchant-prompt":"Toggle prompt enchantment (AI refinement)","/enchant":"Toggle prompt enchantment (AI refinement)"};function D18({onSubmit:D,isLoading:$,toolCallCount:K,onAbort:z,onQueue:J,phase:q="idle",contextPct:X=0,agentLabel:W="deepseek",interactionMode:H="build",onModeChange:w,sessionId:O,vimEnabled:N=!1}){let A=process.stdout.columns??80,[V,T]=tD.useState(()=>a1.fromText("",A)),[_,F]=tD.useState([]),[B,C]=tD.useState(0),[I,y]=tD.useState("insert"),v=tD.useRef(new l80),f=tD.useRef(new c80),m=p80({timeout:800,onDoublePress:()=>process.exit(0)}),u=p80({timeout:800,onDoublePress:()=>{T(a1.fromText("",A)),F([]),C(0),v.current.reset()}});tD.useEffect(()=>{g80().then((e)=>v.current.setHistory(e))},[O]),tD.useEffect(()=>{f.current.push(V.text,V.offset)},[V]);let g=(e)=>{let g0=e.replace(/\r\n/g,`
1279
1275
  `);if(g0.length>60){let L0=0;F((i0)=>{return L0=i0.length,[...i0,g0]}),T((i0)=>i0.insert(`[Text #${L0+1}]`)),C(0),v.current.reset();return}let e0=g0.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hermenics/deepseek-code",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "An AI-powered coding assistant that lives in your terminal",
5
5
  "keywords": [
6
6
  "ai",