@github/copilot 0.0.332-1 → 0.0.332-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.
- package/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1905,7 +1905,7 @@ Would you like to add these directories to the allowed list?`;return i5.default.
|
|
|
1905
1905
|
`,l+="</function_results>",l}formatMessage(e,l){return!l||!l.trim()?"":`
|
|
1906
1906
|
${this.escapeXml(this.secretFilter.filterSecrets(l.trim()))}
|
|
1907
1907
|
`}escapeXml(e){return e}};var jAe=class{toolCalls={};trajectoryOutputFile;trajectoryStream;trajectoryFormatter=new DAe;logger;constructor(e,l){this.logger=e,this.trajectoryOutputFile=l,this.initTrajectoryOutputFileIfNeeded()}async progress(e){let l=e.kind==="log",I=e.kind==="message"&&e.message.role==="user",n=e.kind==="response";if(!(l||I||n||_at(e)||u3t(e))&&this.trajectoryStream){if(zM(e)){e.message.content&&this.handleAssistantMessageWithContent(e.message.content),e.message.reasoning_text&&this.handleAssistantMessageWithContent(e.message.reasoning_text),KZe(e)&&this.handleAssistantToolCalls(e.message.tool_calls);return}else if(qZe(e)){this.handleToolCallId(e.message.tool_call_id,e.message.content);return}}}partialResult(e){return Promise.resolve()}commentReply(e){return Promise.resolve()}async result(e){if(typeof e=="object"&&(e.blockedRequests=e.blockedRequests??await this.getBlockedRequests()),this.trajectoryStream)return await new Promise(l=>{this.trajectoryStream?.end(()=>{this.trajectoryStream=void 0,l()})})}async error(e){if(this.trajectoryStream)return await new Promise(l=>{this.trajectoryStream?.end(()=>{this.trajectoryStream=void 0,l()})})}handleAssistantMessageWithContent(e){this.trajectoryStream&&this.writeTrajectoryAssistantMessage(e)}handleAssistantToolCalls(e){for(let l of e){let I=l.id;this.toolCalls[I]=l,this.trajectoryStream&&this.writeTrajectoryToolCall(l)}}handleToolCallId(e,l){let I=this.toolCalls[e];I&&(delete this.toolCalls[e],I.type==="function"&&I.function.name&&this.trajectoryStream&&this.writeTrajectoryFunctionResult(l))}initTrajectoryOutputFileIfNeeded(){if(this.trajectoryOutputFile)try{let e=p3t.dirname(this.trajectoryOutputFile);Nj.existsSync(e)||Nj.mkdirSync(e,{recursive:!0}),this.trajectoryStream=Nj.createWriteStream(this.trajectoryOutputFile,{flags:"w"})}catch(e){let l={text:e instanceof Error?e.message:String(e),name:e instanceof Error?e.name:"Error",stack:e instanceof Error?e.stack:void 0};this.logger.error(`ERROR: ${JSON.stringify(l,null,2)}`),this.trajectoryStream=void 0}}writeTrajectoryAssistantMessage(e){let l=typeof e=="string"?e:JSON.stringify(e),I=this.trajectoryFormatter.formatMessage("assistant",l);I&&this.writeToTrajectoryFile(I)}writeTrajectoryToolCall(e){let l=this.trajectoryFormatter.formatToolCall(e);this.writeToTrajectoryFile(l)}writeTrajectoryFunctionResult(e){let l=typeof e=="string"?e:JSON.stringify(e),I=this.trajectoryFormatter.formatToolResult(l);this.writeToTrajectoryFile(I)}writeToTrajectoryFile(e){this.trajectoryStream&&this.trajectoryStream.write(e+`
|
|
1908
|
-
`)}async getBlockedRequests(){try{return await b3t()}catch(e){return this.logger.error(`Error parsing firewall logs: ${e}`),[]}}};c();var z3t=mt(_3t(),1);async function $II(t={}){let e=await W$e();return y$e((0,z3t.default)({},e,t))}async function bOe(t={}){if(jB())throw new Error("Settings have already been initialized");return $II(t)}c();c();var M3t=["grep","egrep","fgrep","rg"],D3t=["awk","gawk","mawk","nawk"];function enI(t){let e=new Set,l=!1,I=new Set,n=[];for(let r=1;r<t.length;r++){let a=t[r];if(a==="--")break;if(a==="-e"||a==="--regexp"){r+1<t.length&&(e.add(r+1),r++);continue}if(!(a.startsWith("-e")&&a.length>2)&&!a.startsWith("--regexp=")){if(a==="-f"||a==="--file"){l=!0,r+1<t.length&&r++;continue}if(a.startsWith("-f")&&a.length>2){let s=a.slice(2);s&&G1(s)&&n.push(s),l=!0;continue}if(a.startsWith("--file=")){let s=a.split("=",2)[1];s&&G1(s)&&n.push(s),l=!0;continue}if(a==="--include-dir"){if(r+1<t.length){let s=t[r+1];G1(s)&&n.push(s),r++}continue}if(a.startsWith("--include-dir=")){let s=a.split("=",2)[1];s&&G1(s)&&n.push(s);continue}if(a==="--include"||a==="--exclude"||a==="--exclude-dir"){r+1<t.length&&r++;continue}a.startsWith("--include=")||a.startsWith("--exclude=")||a.startsWith("--exclude-dir=")}}if(l)for(let r of e)I.add(r);else{let r=!1;for(let a=1;a<t.length;a++)if(!t[a].startsWith("-")){e.add(a),r=!0;break}if(r)for(let a of e)I.add(a)}return{skipIndexes:I,paths:n}}function tnI(t){let e=new Set,l=[],I=!1;for(let n=1;n<t.length;n++){let r=t[n];if(r==="--")break;if(r==="-f"||r==="--file"){I=!0,n+1<t.length&&n++;continue}if(r.startsWith("-f")&&r.length>2){let a=r.slice(2);a&&G1(a)&&l.push(a),I=!0;continue}if(r.startsWith("--file=")){let a=r.split("=",2)[1];a&&G1(a)&&l.push(a),I=!0;continue}if(r==="-v"||r==="-F"||r.startsWith("-v")||r.startsWith("-F")){(r==="-v"||r==="-F")&&n+1<t.length&&n++;continue}r.startsWith("--")}if(!I){for(let n=1;n<t.length;n++)if(!t[n].startsWith("-")){e.add(n);break}}return{skipIndexes:e,paths:l}}function lnI(t){let e=new Set,l=[],I=!1;for(let n=1;n<t.length;n++){let r=t[n];if(r==="--")break;if(r==="-e"||r==="--expression"){n+1<t.length&&(e.add(n+1),n++);continue}if(!(r.startsWith("-e")&&r.length>2)&&!r.startsWith("--expression=")){if(r==="-f"||r==="--file"){I=!0,n+1<t.length&&n++;continue}if(r.startsWith("-f")&&r.length>2){let a=r.slice(2);a&&G1(a)&&l.push(a),I=!0;continue}if(r.startsWith("--file=")){let a=r.split("=",2)[1];a&&G1(a)&&l.push(a),I=!0;continue}r==="-i"||r.startsWith("-i")||r.startsWith("--")}}if(!I){for(let n=1;n<t.length;n++)if(!t[n].startsWith("-")){e.add(n);break}}return{skipIndexes:e,paths:l}}function InI(t){let e=new Set,l=[],I=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-lname","-ilname","-user","-group","-type","-size","-perm","-mtime","-mmin","-maxdepth","-mindepth"]);for(let n=1;n<t.length;n++){let r=t[n];if(r){if(r==="--"){n++;continue}if(I.has(r)){n+1<t.length&&(e.add(n+1),n++);continue}for(let a of I)if(r.startsWith(a+"="))break}}return{skipIndexes:e,paths:l}}function j3t(t){let e=[],l=nnI(t);if(l.length===0)return[];let I=l[0],n=new Set;if(M3t.includes(I)){let{skipIndexes:r,paths:a}=enI(l);n=new Set([...n,...r]),e.push(...a)}if(D3t.includes(I)){let{skipIndexes:r,paths:a}=tnI(l);n=new Set([...n,...r]),e.push(...a)}if(I==="sed"){let{skipIndexes:r,paths:a}=lnI(l);n=new Set([...n,...r]),e.push(...a)}if(I==="find"&&process.platform!=="win32"){let{skipIndexes:r,paths:a}=InI(l);n=new Set([...n,...r]),e.push(...a)}if(I==="echo")for(let r=1;r<l.length;r++){let a=l[r];a&&(a===">"||a===">>"||a==="<"||a.includes(">")||a.includes("<")||a.startsWith("-")||n.add(r))}for(let r=0;r<l.length;r++){let a=l[r];if(!n.has(r)&&!a.startsWith("-")){if(G1(a)&&e.push(a),a.includes(">")||a.includes("<")){let s=a.match(/[0-9]*[><]+(.+)/);s&&s[1]&&e.push(s[1])}if((a===">"||a===">>"||a==="<")&&r+1<l.length){let s=l[r+1];G1(s)&&e.push(s)}}}return[...new Set(e)]}function nnI(t){let e=[],l="",I=!1,n="";for(let r=0;r<t.length;r++){let a=t[r];if(!I&&(a==='"'||a==="'"))I=!0,n=a;else if(I&&a===n)I=!1,n="";else if(!I&&/\s/.test(a)){l&&(e.push(l),l="");continue}else l+=a}return l&&e.push(l),e}function G1(t){if(t=t.replace(/^['"]|['"]$/g,""),!t)return!1;if(t.startsWith("/"))return!0;let e=process.platform==="win32";return e&&(t.startsWith("\\")||/^[a-zA-Z]:/.test(t))||t.startsWith("./")||t.startsWith("../")||t==="."||t===".."||/^(\.\.\/)+/.test(t)||e&&(t.startsWith(".\\")||t.startsWith("..\\"))||t.startsWith("~/")||t.includes("/")||new RegExp("\\.[a-zA-Z0-9]{1,10}$").test(t)?!0:t.length>2&&/^[a-zA-Z0-9_.-]+$/.test(t)?!["true","false","null","undefined","www","com","org","echo",...D3t,...M3t,"sed","find","sort","head","tail","touch","cat","and","or","not","if","then","else","fi","do","done","while","for","case","esac","function","return"].includes(t.toLowerCase()):!1}c();import bxt from"node:path";c();var rnI=Object.defineProperty,Wt=(t,e)=>rnI(t,"name",{value:e,configurable:!0}),P3t=2,KI=4,uOe=4*KI,ZN=5*KI,b1=2*KI,iae=2*KI+2*b1,m5={row:0,column:0},G5=Symbol("INTERNAL");function yj(t){if(t!==G5)throw new Error("Illegal constructor")}Wt(yj,"assertInternal");function cae(t){return!!t&&typeof t.row=="number"&&typeof t.column=="number"}Wt(cae,"isPoint");function q3t(t){we=t}Wt(q3t,"setModule");var we,anI=class{static{Wt(this,"LookaheadIterator")}0=0;language;constructor(t,e,l){yj(t),this[0]=e,this.language=l}get currentTypeId(){return we._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){we._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,e){return we._ts_lookahead_iterator_reset(this[0],t[0],e)?(this.language=t,!0):!1}resetState(t){return!!we._ts_lookahead_iterator_reset_state(this[0],t)}[Symbol.iterator](){return{next:Wt(()=>we._ts_lookahead_iterator_next(this[0])?{done:!1,value:this.currentType}:{done:!0,value:""},"next")}}};function WOe(t,e,l,I){let n=l-e,r=t.textCallback(e,I);if(r){for(e+=r.length;e<l;){let a=t.textCallback(e,I);if(a&&a.length>0)e+=a.length,r+=a;else break}e>l&&(r=r.slice(0,n))}return r??""}Wt(WOe,"getText");var snI=class ZOe{static{Wt(this,"Tree")}0=0;textCallback;language;constructor(e,l,I,n){yj(e),this[0]=l,this.language=I,this.textCallback=n}copy(){let e=we._ts_tree_copy(this[0]);return new ZOe(G5,e,this.language,this.textCallback)}delete(){we._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return we._ts_tree_root_node_wasm(this[0]),Qi(this)}rootNodeWithOffset(e,l){let I=OI+ZN;return we.setValue(I,e,"i32"),uy(I+KI,l),we._ts_tree_root_node_with_offset_wasm(this[0]),Qi(this)}edit(e){txt(e),we._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(e){if(!(e instanceof ZOe))throw new TypeError("Argument must be a Tree");we._ts_tree_get_changed_ranges_wasm(this[0],e[0]);let l=we.getValue(OI,"i32"),I=we.getValue(OI+KI,"i32"),n=new Array(l);if(l>0){let r=I;for(let a=0;a<l;a++)n[a]=rye(r),r+=iae;we._free(I)}return n}getIncludedRanges(){we._ts_tree_included_ranges_wasm(this[0]);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32"),I=new Array(e);if(e>0){let n=l;for(let r=0;r<e;r++)I[r]=rye(n),n+=iae;we._free(l)}return I}},onI=class $3t{static{Wt(this,"TreeCursor")}0=0;1=0;2=0;3=0;tree;constructor(e,l){yj(e),this.tree=l,tg(this)}copy(){let e=new $3t(G5,this.tree);return we._ts_tree_cursor_copy_wasm(this.tree[0]),tg(e),e}delete(){ic(this),we._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}get currentNode(){return ic(this),we._ts_tree_cursor_current_node_wasm(this.tree[0]),Qi(this.tree)}get currentFieldId(){return ic(this),we._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return ic(this),we._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return ic(this),we._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return ic(this),we._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return ic(this),we._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return ic(this),we._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return ic(this),we._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return ic(this),we._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){ic(this);let e=we._ts_tree_cursor_start_index_wasm(this.tree[0]),l=we._ts_tree_cursor_end_index_wasm(this.tree[0]);we._ts_tree_cursor_start_position_wasm(this.tree[0]);let I=l9(OI);return WOe(this.tree,e,l,I)}get startPosition(){return ic(this),we._ts_tree_cursor_start_position_wasm(this.tree[0]),l9(OI)}get endPosition(){return ic(this),we._ts_tree_cursor_end_position_wasm(this.tree[0]),l9(OI)}get startIndex(){return ic(this),we._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return ic(this),we._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){ic(this);let e=we._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return tg(this),e===1}gotoLastChild(){ic(this);let e=we._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return tg(this),e===1}gotoParent(){ic(this);let e=we._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return tg(this),e===1}gotoNextSibling(){ic(this);let e=we._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return tg(this),e===1}gotoPreviousSibling(){ic(this);let e=we._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return tg(this),e===1}gotoDescendant(e){ic(this),we._ts_tree_cursor_goto_descendant_wasm(this.tree[0],e),tg(this)}gotoFirstChildForIndex(e){ic(this),we.setValue(OI+uOe,e,"i32");let l=we._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return tg(this),l===1}gotoFirstChildForPosition(e){ic(this),uy(OI+uOe,e);let l=we._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return tg(this),l===1}reset(e){Er(e),ic(this,OI+ZN),we._ts_tree_cursor_reset_wasm(this.tree[0]),tg(this)}resetTo(e){ic(this,OI),ic(e,OI+uOe),we._ts_tree_cursor_reset_to_wasm(this.tree[0],e.tree[0]),tg(this)}},cnI=class{static{Wt(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:e,tree:l,startIndex:I,startPosition:n,other:r}){yj(t),this[0]=r,this.id=e,this.tree=l,this.startIndex=I,this.startPosition=n}id;startIndex;startPosition;tree;get typeId(){return Er(this),we._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return Er(this),we._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return Er(this),we._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return Er(this),we._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return Er(this),we._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return Er(this),we._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return Er(this),we._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return Er(this),we._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return Er(this),we._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return Er(this),we._ts_node_end_point_wasm(this.tree[0]),l9(OI)}get text(){return WOe(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return Er(this),we._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return Er(this),we._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return Er(this),we._ts_node_child_wasm(this.tree[0],t),Qi(this.tree)}namedChild(t){return Er(this),we._ts_node_named_child_wasm(this.tree[0],t),Qi(this.tree)}childForFieldId(t){return Er(this),we._ts_node_child_by_field_id_wasm(this.tree[0],t),Qi(this.tree)}childForFieldName(t){let e=this.tree.language.fields.indexOf(t);return e!==-1?this.childForFieldId(e):null}fieldNameForChild(t){Er(this);let e=we._ts_node_field_name_for_child_wasm(this.tree[0],t);return e?we.AsciiToString(e):null}fieldNameForNamedChild(t){Er(this);let e=we._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return e?we.AsciiToString(e):null}childrenForFieldName(t){let e=this.tree.language.fields.indexOf(t);return e!==-1&&e!==0?this.childrenForFieldId(e):[]}childrenForFieldId(t){Er(this),we._ts_node_children_by_field_id_wasm(this.tree[0],t);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32"),I=new Array(e);if(e>0){let n=l;for(let r=0;r<e;r++)I[r]=Qi(this.tree,n),n+=ZN;we._free(l)}return I}firstChildForIndex(t){Er(this);let e=OI+ZN;return we.setValue(e,t,"i32"),we._ts_node_first_child_for_byte_wasm(this.tree[0]),Qi(this.tree)}firstNamedChildForIndex(t){Er(this);let e=OI+ZN;return we.setValue(e,t,"i32"),we._ts_node_first_named_child_for_byte_wasm(this.tree[0]),Qi(this.tree)}get childCount(){return Er(this),we._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return Er(this),we._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){Er(this),we._ts_node_children_wasm(this.tree[0]);let t=we.getValue(OI,"i32"),e=we.getValue(OI+KI,"i32");if(this._children=new Array(t),t>0){let l=e;for(let I=0;I<t;I++)this._children[I]=Qi(this.tree,l),l+=ZN;we._free(e)}}return this._children}get namedChildren(){if(!this._namedChildren){Er(this),we._ts_node_named_children_wasm(this.tree[0]);let t=we.getValue(OI,"i32"),e=we.getValue(OI+KI,"i32");if(this._namedChildren=new Array(t),t>0){let l=e;for(let I=0;I<t;I++)this._namedChildren[I]=Qi(this.tree,l),l+=ZN;we._free(e)}}return this._namedChildren}descendantsOfType(t,e=m5,l=m5){Array.isArray(t)||(t=[t]);let I=[],n=this.tree.language.types;for(let d of t)d=="ERROR"&&I.push(65535);for(let d=0,G=n.length;d<G;d++)t.includes(n[d])&&I.push(d);let r=we._malloc(KI*I.length);for(let d=0,G=I.length;d<G;d++)we.setValue(r+d*KI,I[d],"i32");Er(this),we._ts_node_descendants_of_type_wasm(this.tree[0],r,I.length,e.row,e.column,l.row,l.column);let a=we.getValue(OI,"i32"),s=we.getValue(OI+KI,"i32"),o=new Array(a);if(a>0){let d=s;for(let G=0;G<a;G++)o[G]=Qi(this.tree,d),d+=ZN}return we._free(s),we._free(r),o}get nextSibling(){return Er(this),we._ts_node_next_sibling_wasm(this.tree[0]),Qi(this.tree)}get previousSibling(){return Er(this),we._ts_node_prev_sibling_wasm(this.tree[0]),Qi(this.tree)}get nextNamedSibling(){return Er(this),we._ts_node_next_named_sibling_wasm(this.tree[0]),Qi(this.tree)}get previousNamedSibling(){return Er(this),we._ts_node_prev_named_sibling_wasm(this.tree[0]),Qi(this.tree)}get descendantCount(){return Er(this),we._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return Er(this),we._ts_node_parent_wasm(this.tree[0]),Qi(this.tree)}childWithDescendant(t){return Er(this),Er(t,1),we._ts_node_child_with_descendant_wasm(this.tree[0]),Qi(this.tree)}descendantForIndex(t,e=t){if(typeof t!="number"||typeof e!="number")throw new Error("Arguments must be numbers");Er(this);let l=OI+ZN;return we.setValue(l,t,"i32"),we.setValue(l+KI,e,"i32"),we._ts_node_descendant_for_index_wasm(this.tree[0]),Qi(this.tree)}namedDescendantForIndex(t,e=t){if(typeof t!="number"||typeof e!="number")throw new Error("Arguments must be numbers");Er(this);let l=OI+ZN;return we.setValue(l,t,"i32"),we.setValue(l+KI,e,"i32"),we._ts_node_named_descendant_for_index_wasm(this.tree[0]),Qi(this.tree)}descendantForPosition(t,e=t){if(!cae(t)||!cae(e))throw new Error("Arguments must be {row, column} objects");Er(this);let l=OI+ZN;return uy(l,t),uy(l+b1,e),we._ts_node_descendant_for_position_wasm(this.tree[0]),Qi(this.tree)}namedDescendantForPosition(t,e=t){if(!cae(t)||!cae(e))throw new Error("Arguments must be {row, column} objects");Er(this);let l=OI+ZN;return uy(l,t),uy(l+b1,e),we._ts_node_named_descendant_for_position_wasm(this.tree[0]),Qi(this.tree)}walk(){return Er(this),we._ts_tree_cursor_new_wasm(this.tree[0]),new onI(G5,this.tree)}edit(t){if(this.startIndex>=t.oldEndIndex){this.startIndex=t.newEndIndex+(this.startIndex-t.oldEndIndex);let e,l;this.startPosition.row>t.oldEndPosition.row?(e=this.startPosition.row-t.oldEndPosition.row,l=this.startPosition.column):(e=0,l=this.startPosition.column,this.startPosition.column>=t.oldEndPosition.column&&(l=this.startPosition.column-t.oldEndPosition.column)),e>0?(this.startPosition.row+=e,this.startPosition.column=l):this.startPosition.column+=l}else this.startIndex>t.startIndex&&(this.startIndex=t.newEndIndex,this.startPosition.row=t.newEndPosition.row,this.startPosition.column=t.newEndPosition.column)}toString(){Er(this);let t=we._ts_node_to_string_wasm(this.tree[0]),e=we.AsciiToString(t);return we._free(t),e}};function NOe(t,e,l,I,n){for(let r=0,a=n.length;r<a;r++){let s=we.getValue(l,"i32");l+=KI;let o=Qi(e,l);l+=ZN,n[r]={patternIndex:I,name:t.captureNames[s],node:o}}return l}Wt(NOe,"unmarshalCaptures");function Er(t,e=0){let l=OI+e*ZN;we.setValue(l,t.id,"i32"),l+=KI,we.setValue(l,t.startIndex,"i32"),l+=KI,we.setValue(l,t.startPosition.row,"i32"),l+=KI,we.setValue(l,t.startPosition.column,"i32"),l+=KI,we.setValue(l,t[0],"i32")}Wt(Er,"marshalNode");function Qi(t,e=OI){let l=we.getValue(e,"i32");if(e+=KI,l===0)return null;let I=we.getValue(e,"i32");e+=KI;let n=we.getValue(e,"i32");e+=KI;let r=we.getValue(e,"i32");e+=KI;let a=we.getValue(e,"i32");return new cnI(G5,{id:l,tree:t,startIndex:I,startPosition:{row:n,column:r},other:a})}Wt(Qi,"unmarshalNode");function ic(t,e=OI){we.setValue(e+0*KI,t[0],"i32"),we.setValue(e+1*KI,t[1],"i32"),we.setValue(e+2*KI,t[2],"i32"),we.setValue(e+3*KI,t[3],"i32")}Wt(ic,"marshalTreeCursor");function tg(t){t[0]=we.getValue(OI+0*KI,"i32"),t[1]=we.getValue(OI+1*KI,"i32"),t[2]=we.getValue(OI+2*KI,"i32"),t[3]=we.getValue(OI+3*KI,"i32")}Wt(tg,"unmarshalTreeCursor");function uy(t,e){we.setValue(t,e.row,"i32"),we.setValue(t+KI,e.column,"i32")}Wt(uy,"marshalPoint");function l9(t){return{row:we.getValue(t,"i32")>>>0,column:we.getValue(t+KI,"i32")>>>0}}Wt(l9,"unmarshalPoint");function ext(t,e){uy(t,e.startPosition),t+=b1,uy(t,e.endPosition),t+=b1,we.setValue(t,e.startIndex,"i32"),t+=KI,we.setValue(t,e.endIndex,"i32"),t+=KI}Wt(ext,"marshalRange");function rye(t){let e={};return e.startPosition=l9(t),t+=b1,e.endPosition=l9(t),t+=b1,e.startIndex=we.getValue(t,"i32")>>>0,t+=KI,e.endIndex=we.getValue(t,"i32")>>>0,e}Wt(rye,"unmarshalRange");function txt(t,e=OI){uy(e,t.startPosition),e+=b1,uy(e,t.oldEndPosition),e+=b1,uy(e,t.newEndPosition),e+=b1,we.setValue(e,t.startIndex,"i32"),e+=KI,we.setValue(e,t.oldEndIndex,"i32"),e+=KI,we.setValue(e,t.newEndIndex,"i32"),e+=KI}Wt(txt,"marshalEdit");function lxt(t){let e=we.getValue(t,"i32"),l=we.getValue(t+=KI,"i32"),I=we.getValue(t+=KI,"i32");return{major_version:e,minor_version:l,patch_version:I}}Wt(lxt,"unmarshalLanguageMetadata");var inI=1,dnI=2,mnI=/[\w-]+/g,Xfr={Zero:0,ZeroOrOne:1,ZeroOrMore:2,One:3,OneOrMore:4},K3t=Wt(t=>t.type==="capture","isCaptureStep"),gOe=Wt(t=>t.type==="string","isStringStep"),B2={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},oae=class Ixt extends Error{constructor(e,l,I,n){super(Ixt.formatMessage(e,l)),this.kind=e,this.info=l,this.index=I,this.length=n,this.name="QueryError"}static{Wt(this,"QueryError")}static formatMessage(e,l){switch(e){case B2.NodeName:return`Bad node name '${l.word}'`;case B2.FieldName:return`Bad field name '${l.word}'`;case B2.CaptureName:return`Bad capture name @${l.word}`;case B2.PatternStructure:return`Bad pattern structure at offset ${l.suffix}`;case B2.Syntax:return`Bad syntax at offset ${l.suffix}`}}};function nxt(t,e,l,I){if(t.length!==3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 2, got ${t.length-1}`);if(!K3t(t[1]))throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}"`);let n=l==="eq?"||l==="any-eq?",r=!l.startsWith("any-");if(K3t(t[2])){let a=t[1].name,s=t[2].name;I[e].push(o=>{let d=[],G=[];for(let h of o)h.name===a&&d.push(h.node),h.name===s&&G.push(h.node);let u=Wt((h,g,y)=>y?h.text===g.text:h.text!==g.text,"compare");return r?d.every(h=>G.some(g=>u(h,g,n))):d.some(h=>G.some(g=>u(h,g,n)))})}else{let a=t[1].name,s=t[2].value,o=Wt(G=>G.text===s,"matches"),d=Wt(G=>G.text!==s,"doesNotMatch");I[e].push(G=>{let u=[];for(let g of G)g.name===a&&u.push(g.node);let h=n?o:d;return r?u.every(h):u.some(h)})}}Wt(nxt,"parseAnyPredicate");function rxt(t,e,l,I){if(t.length!==3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 2, got ${t.length-1}.`);if(t[1].type!=="capture")throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}".`);if(t[2].type!=="string")throw new Error(`Second argument of \`#${l}\` predicate must be a string. Got @${t[2].name}.`);let n=l==="match?"||l==="any-match?",r=!l.startsWith("any-"),a=t[1].name,s=new RegExp(t[2].value);I[e].push(o=>{let d=[];for(let u of o)u.name===a&&d.push(u.node.text);let G=Wt((u,h)=>h?s.test(u):!s.test(u),"test");return d.length===0?!n:r?d.every(u=>G(u,n)):d.some(u=>G(u,n))})}Wt(rxt,"parseMatchPredicate");function axt(t,e,l,I){if(t.length<2)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected at least 1. Got ${t.length-1}.`);if(t[1].type!=="capture")throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}".`);let n=l==="any-of?",r=t[1].name,a=t.slice(2);if(!a.every(gOe))throw new Error(`Arguments to \`#${l}\` predicate must be strings.".`);let s=a.map(o=>o.value);I[e].push(o=>{let d=[];for(let G of o)G.name===r&&d.push(G.node.text);return d.length===0?!n:d.every(G=>s.includes(G))===n})}Wt(axt,"parseAnyOfPredicate");function sxt(t,e,l,I,n){if(t.length<2||t.length>3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 1 or 2. Got ${t.length-1}.`);if(!t.every(gOe))throw new Error(`Arguments to \`#${l}\` predicate must be strings.".`);let r=l==="is?"?I:n;r[e]||(r[e]={}),r[e][t[1].value]=t[2]?.value??null}Wt(sxt,"parseIsPredicate");function oxt(t,e,l){if(t.length<2||t.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${t.length-1}.`);if(!t.every(gOe))throw new Error('Arguments to `#set!` predicate must be strings.".');l[e]||(l[e]={}),l[e][t[1].value]=t[2]?.value??null}Wt(oxt,"parseSetDirective");function cxt(t,e,l,I,n,r,a,s,o,d,G){if(e===inI){let u=I[l];r.push({type:"capture",name:u})}else if(e===dnI)r.push({type:"string",value:n[l]});else if(r.length>0){if(r[0].type!=="string")throw new Error("Predicates must begin with a literal value");let u=r[0].value;switch(u){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":nxt(r,t,u,a);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":rxt(r,t,u,a);break;case"not-any-of?":case"any-of?":axt(r,t,u,a);break;case"is?":case"is-not?":sxt(r,t,u,d,G);break;case"set!":oxt(r,t,o);break;default:s[t].push({operator:u,operands:r.slice(1)})}r.length=0}}Wt(cxt,"parsePattern");var GnI=class{static{Wt(this,"Query")}0=0;exceededMatchLimit;textPredicates;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(t,e){let l=we.lengthBytesUTF8(e),I=we._malloc(l+1);we.stringToUTF8(e,I,l+1);let n=we._ts_query_new(t[0],I,l,OI,OI+KI);if(!n){let V=we.getValue(OI+KI,"i32"),F=we.getValue(OI,"i32"),f=we.UTF8ToString(I,F).length,S=e.slice(f,f+100).split(`
|
|
1908
|
+
`)}async getBlockedRequests(){try{return await b3t()}catch(e){return this.logger.error(`Error parsing firewall logs: ${e}`),[]}}};c();var z3t=mt(_3t(),1);async function $II(t={}){let e=await W$e();return y$e((0,z3t.default)({},e,t))}async function bOe(t={}){if(jB())throw new Error("Settings have already been initialized");return $II(t)}c();c();var M3t=["grep","egrep","fgrep","rg"],D3t=["awk","gawk","mawk","nawk"];function enI(t){let e=new Set,l=!1,I=new Set,n=[];for(let r=1;r<t.length;r++){let a=t[r];if(a==="--")break;if(a==="-e"||a==="--regexp"){r+1<t.length&&(e.add(r+1),r++);continue}if(!(a.startsWith("-e")&&a.length>2)&&!a.startsWith("--regexp=")){if(a==="-f"||a==="--file"){l=!0,r+1<t.length&&r++;continue}if(a.startsWith("-f")&&a.length>2){let s=a.slice(2);s&&G1(s)&&n.push(s),l=!0;continue}if(a.startsWith("--file=")){let s=a.split("=",2)[1];s&&G1(s)&&n.push(s),l=!0;continue}if(a==="--include-dir"){if(r+1<t.length){let s=t[r+1];G1(s)&&n.push(s),r++}continue}if(a.startsWith("--include-dir=")){let s=a.split("=",2)[1];s&&G1(s)&&n.push(s);continue}if(a==="--include"||a==="--exclude"||a==="--exclude-dir"){r+1<t.length&&r++;continue}a.startsWith("--include=")||a.startsWith("--exclude=")||a.startsWith("--exclude-dir=")}}if(l)for(let r of e)I.add(r);else{let r=!1;for(let a=1;a<t.length;a++)if(!t[a].startsWith("-")){e.add(a),r=!0;break}if(r)for(let a of e)I.add(a)}return{skipIndexes:I,paths:n}}function tnI(t){let e=new Set,l=[],I=!1;for(let n=1;n<t.length;n++){let r=t[n];if(r==="--")break;if(r==="-f"||r==="--file"){I=!0,n+1<t.length&&n++;continue}if(r.startsWith("-f")&&r.length>2){let a=r.slice(2);a&&G1(a)&&l.push(a),I=!0;continue}if(r.startsWith("--file=")){let a=r.split("=",2)[1];a&&G1(a)&&l.push(a),I=!0;continue}if(r==="-v"||r==="-F"||r.startsWith("-v")||r.startsWith("-F")){(r==="-v"||r==="-F")&&n+1<t.length&&n++;continue}r.startsWith("--")}if(!I){for(let n=1;n<t.length;n++)if(!t[n].startsWith("-")){e.add(n);break}}return{skipIndexes:e,paths:l}}function lnI(t){let e=new Set,l=[],I=!1;for(let n=1;n<t.length;n++){let r=t[n];if(r==="--")break;if(r==="-e"||r==="--expression"){n+1<t.length&&(e.add(n+1),n++);continue}if(!(r.startsWith("-e")&&r.length>2)&&!r.startsWith("--expression=")){if(r==="-f"||r==="--file"){I=!0,n+1<t.length&&n++;continue}if(r.startsWith("-f")&&r.length>2){let a=r.slice(2);a&&G1(a)&&l.push(a),I=!0;continue}if(r.startsWith("--file=")){let a=r.split("=",2)[1];a&&G1(a)&&l.push(a),I=!0;continue}r==="-i"||r.startsWith("-i")||r.startsWith("--")}}if(!I){for(let n=1;n<t.length;n++)if(!t[n].startsWith("-")){e.add(n);break}}return{skipIndexes:e,paths:l}}function InI(t){let e=new Set,l=[],I=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-lname","-ilname","-user","-group","-type","-size","-perm","-mtime","-mmin","-maxdepth","-mindepth"]);for(let n=1;n<t.length;n++){let r=t[n];if(r){if(r==="--"){n++;continue}if(I.has(r)){n+1<t.length&&(e.add(n+1),n++);continue}for(let a of I)if(r.startsWith(a+"="))break}}return{skipIndexes:e,paths:l}}function j3t(t){let e=[],l=nnI(t);if(l.length===0)return[];let I=l[0],n=new Set,r=l.findIndex(s=>/^([;&|<]|\d*>)/.test(s)),a=r===-1?l:l.slice(0,r);if(M3t.includes(I)){let{skipIndexes:s,paths:o}=enI(a);n=new Set([...n,...s]),e.push(...o)}if(D3t.includes(I)){let{skipIndexes:s,paths:o}=tnI(a);n=new Set([...n,...s]),e.push(...o)}if(I==="sed"){let{skipIndexes:s,paths:o}=lnI(a);n=new Set([...n,...s]),e.push(...o)}if(I==="find"&&process.platform!=="win32"){let{skipIndexes:s,paths:o}=InI(a);n=new Set([...n,...s]),e.push(...o)}if(I==="echo")for(let s=1;s<a.length;s++){let o=a[s];o&&(o.startsWith("-")||n.add(s))}for(let s=0;s<l.length;s++){let o=l[s];if(!n.has(s)&&!o.startsWith("-")){if(G1(o)&&e.push(o),o.includes(">")||o.includes("<")){let d=o.match(/[0-9]*[><]+(.+)/);d&&d[1]&&e.push(d[1])}if((o===">"||o===">>"||o==="<")&&s+1<l.length){let d=l[s+1];G1(d)&&e.push(d)}}}return[...new Set(e)]}function nnI(t){let e=[],l=/(\s+|;|&+|\|+|>+|<+)/y,I="",n=!1,r="";for(let a=0;a<t.length;a++){let s=t[a];if(n)s===r?(n=!1,r=""):I+=s;else if(s==='"'||s==="'")n=!0,r=s;else{l.lastIndex=a;let o=l.exec(t);if(o){I&&(e.push(I),I="");let d=o[0];d.trim().length>0&&(e.push(d),a+=d.length-1)}else I+=s}}return I&&e.push(I),e}function G1(t){if(t=t.replace(/^['"]|['"]$/g,""),!t)return!1;if(t.startsWith("/"))return!0;let e=process.platform==="win32";return e&&(t.startsWith("\\")||/^[a-zA-Z]:/.test(t))||t.startsWith("./")||t.startsWith("../")||t==="."||t===".."||/^(\.\.\/)+/.test(t)||e&&(t.startsWith(".\\")||t.startsWith("..\\"))||t.startsWith("~/")||t==="~"||t.includes("/")||new RegExp("\\.[a-zA-Z0-9]{1,10}$").test(t)?!0:t.length>2&&/^[a-zA-Z0-9_.-\s]+$/.test(t)?!["true","false","null","undefined","www","com","org","echo",...D3t,...M3t,"sed","find","sort","head","tail","touch","cat","and","or","not","if","then","else","fi","do","done","while","for","case","esac","function","return"].includes(t.toLowerCase()):!1}c();import bxt from"node:path";c();var rnI=Object.defineProperty,Wt=(t,e)=>rnI(t,"name",{value:e,configurable:!0}),P3t=2,KI=4,uOe=4*KI,ZN=5*KI,b1=2*KI,iae=2*KI+2*b1,m5={row:0,column:0},G5=Symbol("INTERNAL");function yj(t){if(t!==G5)throw new Error("Illegal constructor")}Wt(yj,"assertInternal");function cae(t){return!!t&&typeof t.row=="number"&&typeof t.column=="number"}Wt(cae,"isPoint");function q3t(t){we=t}Wt(q3t,"setModule");var we,anI=class{static{Wt(this,"LookaheadIterator")}0=0;language;constructor(t,e,l){yj(t),this[0]=e,this.language=l}get currentTypeId(){return we._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){we._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,e){return we._ts_lookahead_iterator_reset(this[0],t[0],e)?(this.language=t,!0):!1}resetState(t){return!!we._ts_lookahead_iterator_reset_state(this[0],t)}[Symbol.iterator](){return{next:Wt(()=>we._ts_lookahead_iterator_next(this[0])?{done:!1,value:this.currentType}:{done:!0,value:""},"next")}}};function WOe(t,e,l,I){let n=l-e,r=t.textCallback(e,I);if(r){for(e+=r.length;e<l;){let a=t.textCallback(e,I);if(a&&a.length>0)e+=a.length,r+=a;else break}e>l&&(r=r.slice(0,n))}return r??""}Wt(WOe,"getText");var snI=class ZOe{static{Wt(this,"Tree")}0=0;textCallback;language;constructor(e,l,I,n){yj(e),this[0]=l,this.language=I,this.textCallback=n}copy(){let e=we._ts_tree_copy(this[0]);return new ZOe(G5,e,this.language,this.textCallback)}delete(){we._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return we._ts_tree_root_node_wasm(this[0]),Qi(this)}rootNodeWithOffset(e,l){let I=OI+ZN;return we.setValue(I,e,"i32"),uy(I+KI,l),we._ts_tree_root_node_with_offset_wasm(this[0]),Qi(this)}edit(e){txt(e),we._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(e){if(!(e instanceof ZOe))throw new TypeError("Argument must be a Tree");we._ts_tree_get_changed_ranges_wasm(this[0],e[0]);let l=we.getValue(OI,"i32"),I=we.getValue(OI+KI,"i32"),n=new Array(l);if(l>0){let r=I;for(let a=0;a<l;a++)n[a]=rye(r),r+=iae;we._free(I)}return n}getIncludedRanges(){we._ts_tree_included_ranges_wasm(this[0]);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32"),I=new Array(e);if(e>0){let n=l;for(let r=0;r<e;r++)I[r]=rye(n),n+=iae;we._free(l)}return I}},onI=class $3t{static{Wt(this,"TreeCursor")}0=0;1=0;2=0;3=0;tree;constructor(e,l){yj(e),this.tree=l,tg(this)}copy(){let e=new $3t(G5,this.tree);return we._ts_tree_cursor_copy_wasm(this.tree[0]),tg(e),e}delete(){ic(this),we._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}get currentNode(){return ic(this),we._ts_tree_cursor_current_node_wasm(this.tree[0]),Qi(this.tree)}get currentFieldId(){return ic(this),we._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return ic(this),we._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return ic(this),we._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return ic(this),we._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return ic(this),we._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return ic(this),we._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return ic(this),we._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return ic(this),we._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){ic(this);let e=we._ts_tree_cursor_start_index_wasm(this.tree[0]),l=we._ts_tree_cursor_end_index_wasm(this.tree[0]);we._ts_tree_cursor_start_position_wasm(this.tree[0]);let I=l9(OI);return WOe(this.tree,e,l,I)}get startPosition(){return ic(this),we._ts_tree_cursor_start_position_wasm(this.tree[0]),l9(OI)}get endPosition(){return ic(this),we._ts_tree_cursor_end_position_wasm(this.tree[0]),l9(OI)}get startIndex(){return ic(this),we._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return ic(this),we._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){ic(this);let e=we._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return tg(this),e===1}gotoLastChild(){ic(this);let e=we._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return tg(this),e===1}gotoParent(){ic(this);let e=we._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return tg(this),e===1}gotoNextSibling(){ic(this);let e=we._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return tg(this),e===1}gotoPreviousSibling(){ic(this);let e=we._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return tg(this),e===1}gotoDescendant(e){ic(this),we._ts_tree_cursor_goto_descendant_wasm(this.tree[0],e),tg(this)}gotoFirstChildForIndex(e){ic(this),we.setValue(OI+uOe,e,"i32");let l=we._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return tg(this),l===1}gotoFirstChildForPosition(e){ic(this),uy(OI+uOe,e);let l=we._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return tg(this),l===1}reset(e){Er(e),ic(this,OI+ZN),we._ts_tree_cursor_reset_wasm(this.tree[0]),tg(this)}resetTo(e){ic(this,OI),ic(e,OI+uOe),we._ts_tree_cursor_reset_to_wasm(this.tree[0],e.tree[0]),tg(this)}},cnI=class{static{Wt(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:e,tree:l,startIndex:I,startPosition:n,other:r}){yj(t),this[0]=r,this.id=e,this.tree=l,this.startIndex=I,this.startPosition=n}id;startIndex;startPosition;tree;get typeId(){return Er(this),we._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return Er(this),we._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return Er(this),we._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return Er(this),we._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return Er(this),we._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return Er(this),we._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return Er(this),we._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return Er(this),we._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return Er(this),we._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return Er(this),we._ts_node_end_point_wasm(this.tree[0]),l9(OI)}get text(){return WOe(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return Er(this),we._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return Er(this),we._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return Er(this),we._ts_node_child_wasm(this.tree[0],t),Qi(this.tree)}namedChild(t){return Er(this),we._ts_node_named_child_wasm(this.tree[0],t),Qi(this.tree)}childForFieldId(t){return Er(this),we._ts_node_child_by_field_id_wasm(this.tree[0],t),Qi(this.tree)}childForFieldName(t){let e=this.tree.language.fields.indexOf(t);return e!==-1?this.childForFieldId(e):null}fieldNameForChild(t){Er(this);let e=we._ts_node_field_name_for_child_wasm(this.tree[0],t);return e?we.AsciiToString(e):null}fieldNameForNamedChild(t){Er(this);let e=we._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return e?we.AsciiToString(e):null}childrenForFieldName(t){let e=this.tree.language.fields.indexOf(t);return e!==-1&&e!==0?this.childrenForFieldId(e):[]}childrenForFieldId(t){Er(this),we._ts_node_children_by_field_id_wasm(this.tree[0],t);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32"),I=new Array(e);if(e>0){let n=l;for(let r=0;r<e;r++)I[r]=Qi(this.tree,n),n+=ZN;we._free(l)}return I}firstChildForIndex(t){Er(this);let e=OI+ZN;return we.setValue(e,t,"i32"),we._ts_node_first_child_for_byte_wasm(this.tree[0]),Qi(this.tree)}firstNamedChildForIndex(t){Er(this);let e=OI+ZN;return we.setValue(e,t,"i32"),we._ts_node_first_named_child_for_byte_wasm(this.tree[0]),Qi(this.tree)}get childCount(){return Er(this),we._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return Er(this),we._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){Er(this),we._ts_node_children_wasm(this.tree[0]);let t=we.getValue(OI,"i32"),e=we.getValue(OI+KI,"i32");if(this._children=new Array(t),t>0){let l=e;for(let I=0;I<t;I++)this._children[I]=Qi(this.tree,l),l+=ZN;we._free(e)}}return this._children}get namedChildren(){if(!this._namedChildren){Er(this),we._ts_node_named_children_wasm(this.tree[0]);let t=we.getValue(OI,"i32"),e=we.getValue(OI+KI,"i32");if(this._namedChildren=new Array(t),t>0){let l=e;for(let I=0;I<t;I++)this._namedChildren[I]=Qi(this.tree,l),l+=ZN;we._free(e)}}return this._namedChildren}descendantsOfType(t,e=m5,l=m5){Array.isArray(t)||(t=[t]);let I=[],n=this.tree.language.types;for(let d of t)d=="ERROR"&&I.push(65535);for(let d=0,G=n.length;d<G;d++)t.includes(n[d])&&I.push(d);let r=we._malloc(KI*I.length);for(let d=0,G=I.length;d<G;d++)we.setValue(r+d*KI,I[d],"i32");Er(this),we._ts_node_descendants_of_type_wasm(this.tree[0],r,I.length,e.row,e.column,l.row,l.column);let a=we.getValue(OI,"i32"),s=we.getValue(OI+KI,"i32"),o=new Array(a);if(a>0){let d=s;for(let G=0;G<a;G++)o[G]=Qi(this.tree,d),d+=ZN}return we._free(s),we._free(r),o}get nextSibling(){return Er(this),we._ts_node_next_sibling_wasm(this.tree[0]),Qi(this.tree)}get previousSibling(){return Er(this),we._ts_node_prev_sibling_wasm(this.tree[0]),Qi(this.tree)}get nextNamedSibling(){return Er(this),we._ts_node_next_named_sibling_wasm(this.tree[0]),Qi(this.tree)}get previousNamedSibling(){return Er(this),we._ts_node_prev_named_sibling_wasm(this.tree[0]),Qi(this.tree)}get descendantCount(){return Er(this),we._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return Er(this),we._ts_node_parent_wasm(this.tree[0]),Qi(this.tree)}childWithDescendant(t){return Er(this),Er(t,1),we._ts_node_child_with_descendant_wasm(this.tree[0]),Qi(this.tree)}descendantForIndex(t,e=t){if(typeof t!="number"||typeof e!="number")throw new Error("Arguments must be numbers");Er(this);let l=OI+ZN;return we.setValue(l,t,"i32"),we.setValue(l+KI,e,"i32"),we._ts_node_descendant_for_index_wasm(this.tree[0]),Qi(this.tree)}namedDescendantForIndex(t,e=t){if(typeof t!="number"||typeof e!="number")throw new Error("Arguments must be numbers");Er(this);let l=OI+ZN;return we.setValue(l,t,"i32"),we.setValue(l+KI,e,"i32"),we._ts_node_named_descendant_for_index_wasm(this.tree[0]),Qi(this.tree)}descendantForPosition(t,e=t){if(!cae(t)||!cae(e))throw new Error("Arguments must be {row, column} objects");Er(this);let l=OI+ZN;return uy(l,t),uy(l+b1,e),we._ts_node_descendant_for_position_wasm(this.tree[0]),Qi(this.tree)}namedDescendantForPosition(t,e=t){if(!cae(t)||!cae(e))throw new Error("Arguments must be {row, column} objects");Er(this);let l=OI+ZN;return uy(l,t),uy(l+b1,e),we._ts_node_named_descendant_for_position_wasm(this.tree[0]),Qi(this.tree)}walk(){return Er(this),we._ts_tree_cursor_new_wasm(this.tree[0]),new onI(G5,this.tree)}edit(t){if(this.startIndex>=t.oldEndIndex){this.startIndex=t.newEndIndex+(this.startIndex-t.oldEndIndex);let e,l;this.startPosition.row>t.oldEndPosition.row?(e=this.startPosition.row-t.oldEndPosition.row,l=this.startPosition.column):(e=0,l=this.startPosition.column,this.startPosition.column>=t.oldEndPosition.column&&(l=this.startPosition.column-t.oldEndPosition.column)),e>0?(this.startPosition.row+=e,this.startPosition.column=l):this.startPosition.column+=l}else this.startIndex>t.startIndex&&(this.startIndex=t.newEndIndex,this.startPosition.row=t.newEndPosition.row,this.startPosition.column=t.newEndPosition.column)}toString(){Er(this);let t=we._ts_node_to_string_wasm(this.tree[0]),e=we.AsciiToString(t);return we._free(t),e}};function NOe(t,e,l,I,n){for(let r=0,a=n.length;r<a;r++){let s=we.getValue(l,"i32");l+=KI;let o=Qi(e,l);l+=ZN,n[r]={patternIndex:I,name:t.captureNames[s],node:o}}return l}Wt(NOe,"unmarshalCaptures");function Er(t,e=0){let l=OI+e*ZN;we.setValue(l,t.id,"i32"),l+=KI,we.setValue(l,t.startIndex,"i32"),l+=KI,we.setValue(l,t.startPosition.row,"i32"),l+=KI,we.setValue(l,t.startPosition.column,"i32"),l+=KI,we.setValue(l,t[0],"i32")}Wt(Er,"marshalNode");function Qi(t,e=OI){let l=we.getValue(e,"i32");if(e+=KI,l===0)return null;let I=we.getValue(e,"i32");e+=KI;let n=we.getValue(e,"i32");e+=KI;let r=we.getValue(e,"i32");e+=KI;let a=we.getValue(e,"i32");return new cnI(G5,{id:l,tree:t,startIndex:I,startPosition:{row:n,column:r},other:a})}Wt(Qi,"unmarshalNode");function ic(t,e=OI){we.setValue(e+0*KI,t[0],"i32"),we.setValue(e+1*KI,t[1],"i32"),we.setValue(e+2*KI,t[2],"i32"),we.setValue(e+3*KI,t[3],"i32")}Wt(ic,"marshalTreeCursor");function tg(t){t[0]=we.getValue(OI+0*KI,"i32"),t[1]=we.getValue(OI+1*KI,"i32"),t[2]=we.getValue(OI+2*KI,"i32"),t[3]=we.getValue(OI+3*KI,"i32")}Wt(tg,"unmarshalTreeCursor");function uy(t,e){we.setValue(t,e.row,"i32"),we.setValue(t+KI,e.column,"i32")}Wt(uy,"marshalPoint");function l9(t){return{row:we.getValue(t,"i32")>>>0,column:we.getValue(t+KI,"i32")>>>0}}Wt(l9,"unmarshalPoint");function ext(t,e){uy(t,e.startPosition),t+=b1,uy(t,e.endPosition),t+=b1,we.setValue(t,e.startIndex,"i32"),t+=KI,we.setValue(t,e.endIndex,"i32"),t+=KI}Wt(ext,"marshalRange");function rye(t){let e={};return e.startPosition=l9(t),t+=b1,e.endPosition=l9(t),t+=b1,e.startIndex=we.getValue(t,"i32")>>>0,t+=KI,e.endIndex=we.getValue(t,"i32")>>>0,e}Wt(rye,"unmarshalRange");function txt(t,e=OI){uy(e,t.startPosition),e+=b1,uy(e,t.oldEndPosition),e+=b1,uy(e,t.newEndPosition),e+=b1,we.setValue(e,t.startIndex,"i32"),e+=KI,we.setValue(e,t.oldEndIndex,"i32"),e+=KI,we.setValue(e,t.newEndIndex,"i32"),e+=KI}Wt(txt,"marshalEdit");function lxt(t){let e=we.getValue(t,"i32"),l=we.getValue(t+=KI,"i32"),I=we.getValue(t+=KI,"i32");return{major_version:e,minor_version:l,patch_version:I}}Wt(lxt,"unmarshalLanguageMetadata");var inI=1,dnI=2,mnI=/[\w-]+/g,Xfr={Zero:0,ZeroOrOne:1,ZeroOrMore:2,One:3,OneOrMore:4},K3t=Wt(t=>t.type==="capture","isCaptureStep"),gOe=Wt(t=>t.type==="string","isStringStep"),B2={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},oae=class Ixt extends Error{constructor(e,l,I,n){super(Ixt.formatMessage(e,l)),this.kind=e,this.info=l,this.index=I,this.length=n,this.name="QueryError"}static{Wt(this,"QueryError")}static formatMessage(e,l){switch(e){case B2.NodeName:return`Bad node name '${l.word}'`;case B2.FieldName:return`Bad field name '${l.word}'`;case B2.CaptureName:return`Bad capture name @${l.word}`;case B2.PatternStructure:return`Bad pattern structure at offset ${l.suffix}`;case B2.Syntax:return`Bad syntax at offset ${l.suffix}`}}};function nxt(t,e,l,I){if(t.length!==3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 2, got ${t.length-1}`);if(!K3t(t[1]))throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}"`);let n=l==="eq?"||l==="any-eq?",r=!l.startsWith("any-");if(K3t(t[2])){let a=t[1].name,s=t[2].name;I[e].push(o=>{let d=[],G=[];for(let h of o)h.name===a&&d.push(h.node),h.name===s&&G.push(h.node);let u=Wt((h,g,y)=>y?h.text===g.text:h.text!==g.text,"compare");return r?d.every(h=>G.some(g=>u(h,g,n))):d.some(h=>G.some(g=>u(h,g,n)))})}else{let a=t[1].name,s=t[2].value,o=Wt(G=>G.text===s,"matches"),d=Wt(G=>G.text!==s,"doesNotMatch");I[e].push(G=>{let u=[];for(let g of G)g.name===a&&u.push(g.node);let h=n?o:d;return r?u.every(h):u.some(h)})}}Wt(nxt,"parseAnyPredicate");function rxt(t,e,l,I){if(t.length!==3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 2, got ${t.length-1}.`);if(t[1].type!=="capture")throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}".`);if(t[2].type!=="string")throw new Error(`Second argument of \`#${l}\` predicate must be a string. Got @${t[2].name}.`);let n=l==="match?"||l==="any-match?",r=!l.startsWith("any-"),a=t[1].name,s=new RegExp(t[2].value);I[e].push(o=>{let d=[];for(let u of o)u.name===a&&d.push(u.node.text);let G=Wt((u,h)=>h?s.test(u):!s.test(u),"test");return d.length===0?!n:r?d.every(u=>G(u,n)):d.some(u=>G(u,n))})}Wt(rxt,"parseMatchPredicate");function axt(t,e,l,I){if(t.length<2)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected at least 1. Got ${t.length-1}.`);if(t[1].type!=="capture")throw new Error(`First argument of \`#${l}\` predicate must be a capture. Got "${t[1].value}".`);let n=l==="any-of?",r=t[1].name,a=t.slice(2);if(!a.every(gOe))throw new Error(`Arguments to \`#${l}\` predicate must be strings.".`);let s=a.map(o=>o.value);I[e].push(o=>{let d=[];for(let G of o)G.name===r&&d.push(G.node.text);return d.length===0?!n:d.every(G=>s.includes(G))===n})}Wt(axt,"parseAnyOfPredicate");function sxt(t,e,l,I,n){if(t.length<2||t.length>3)throw new Error(`Wrong number of arguments to \`#${l}\` predicate. Expected 1 or 2. Got ${t.length-1}.`);if(!t.every(gOe))throw new Error(`Arguments to \`#${l}\` predicate must be strings.".`);let r=l==="is?"?I:n;r[e]||(r[e]={}),r[e][t[1].value]=t[2]?.value??null}Wt(sxt,"parseIsPredicate");function oxt(t,e,l){if(t.length<2||t.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${t.length-1}.`);if(!t.every(gOe))throw new Error('Arguments to `#set!` predicate must be strings.".');l[e]||(l[e]={}),l[e][t[1].value]=t[2]?.value??null}Wt(oxt,"parseSetDirective");function cxt(t,e,l,I,n,r,a,s,o,d,G){if(e===inI){let u=I[l];r.push({type:"capture",name:u})}else if(e===dnI)r.push({type:"string",value:n[l]});else if(r.length>0){if(r[0].type!=="string")throw new Error("Predicates must begin with a literal value");let u=r[0].value;switch(u){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":nxt(r,t,u,a);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":rxt(r,t,u,a);break;case"not-any-of?":case"any-of?":axt(r,t,u,a);break;case"is?":case"is-not?":sxt(r,t,u,d,G);break;case"set!":oxt(r,t,o);break;default:s[t].push({operator:u,operands:r.slice(1)})}r.length=0}}Wt(cxt,"parsePattern");var GnI=class{static{Wt(this,"Query")}0=0;exceededMatchLimit;textPredicates;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(t,e){let l=we.lengthBytesUTF8(e),I=we._malloc(l+1);we.stringToUTF8(e,I,l+1);let n=we._ts_query_new(t[0],I,l,OI,OI+KI);if(!n){let V=we.getValue(OI+KI,"i32"),F=we.getValue(OI,"i32"),f=we.UTF8ToString(I,F).length,S=e.slice(f,f+100).split(`
|
|
1909
1909
|
`)[0],B=S.match(mnI)?.[0]??"";switch(we._free(I),V){case B2.Syntax:throw new oae(B2.Syntax,{suffix:`${f}: '${S}'...`},f,0);case B2.NodeName:throw new oae(V,{word:B},f,B.length);case B2.FieldName:throw new oae(V,{word:B},f,B.length);case B2.CaptureName:throw new oae(V,{word:B},f,B.length);case B2.PatternStructure:throw new oae(V,{suffix:`${f}: '${S}'...`},f,0)}}let r=we._ts_query_string_count(n),a=we._ts_query_capture_count(n),s=we._ts_query_pattern_count(n),o=new Array(a),d=new Array(s),G=new Array(r);for(let V=0;V<a;V++){let F=we._ts_query_capture_name_for_id(n,V,OI),f=we.getValue(OI,"i32");o[V]=we.UTF8ToString(F,f)}for(let V=0;V<s;V++){let F=new Array(a);for(let f=0;f<a;f++){let S=we._ts_query_capture_quantifier_for_id(n,V,f);F[f]=S}d[V]=F}for(let V=0;V<r;V++){let F=we._ts_query_string_value_for_id(n,V,OI),f=we.getValue(OI,"i32");G[V]=we.UTF8ToString(F,f)}let u=new Array(s),h=new Array(s),g=new Array(s),y=new Array(s),R=new Array(s);for(let V=0;V<s;V++){let F=we._ts_query_predicates_for_pattern(n,V,OI),f=we.getValue(OI,"i32");y[V]=[],R[V]=[];let S=new Array,B=F;for(let T=0;T<f;T++){let P=we.getValue(B,"i32");B+=KI;let le=we.getValue(B,"i32");B+=KI,cxt(V,P,le,o,G,S,R,y,u,h,g)}Object.freeze(R[V]),Object.freeze(y[V]),Object.freeze(u[V]),Object.freeze(h[V]),Object.freeze(g[V])}we._free(I),this[0]=n,this.captureNames=o,this.captureQuantifiers=d,this.textPredicates=R,this.predicates=y,this.setProperties=u,this.assertedProperties=h,this.refutedProperties=g,this.exceededMatchLimit=!1}delete(){we._ts_query_delete(this[0]),this[0]=0}matches(t,e={}){let l=e.startPosition??m5,I=e.endPosition??m5,n=e.startIndex??0,r=e.endIndex??0,a=e.matchLimit??4294967295,s=e.maxStartDepth??4294967295,o=e.timeoutMicros??0,d=e.progressCallback;if(typeof a!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=a,r!==0&&n>r)throw new Error("`startIndex` cannot be greater than `endIndex`");if(I!==m5&&(l.row>I.row||l.row===I.row&&l.column>I.column))throw new Error("`startPosition` cannot be greater than `endPosition`");d&&(we.currentQueryProgressCallback=d),Er(t),we._ts_query_matches_wasm(this[0],t.tree[0],l.row,l.column,I.row,I.column,n,r,a,s,o);let G=we.getValue(OI,"i32"),u=we.getValue(OI+KI,"i32"),h=we.getValue(OI+2*KI,"i32"),g=new Array(G);this.exceededMatchLimit=!!h;let y=0,R=u;for(let V=0;V<G;V++){let F=we.getValue(R,"i32");R+=KI;let f=we.getValue(R,"i32");R+=KI;let S=new Array(f);if(R=NOe(this,t.tree,R,F,S),this.textPredicates[F].every(B=>B(S))){g[y]={pattern:F,patternIndex:F,captures:S};let B=this.setProperties[F];g[y].setProperties=B;let T=this.assertedProperties[F];g[y].assertedProperties=T;let P=this.refutedProperties[F];g[y].refutedProperties=P,y++}}return g.length=y,we._free(u),we.currentQueryProgressCallback=null,g}captures(t,e={}){let l=e.startPosition??m5,I=e.endPosition??m5,n=e.startIndex??0,r=e.endIndex??0,a=e.matchLimit??4294967295,s=e.maxStartDepth??4294967295,o=e.timeoutMicros??0,d=e.progressCallback;if(typeof a!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=a,r!==0&&n>r)throw new Error("`startIndex` cannot be greater than `endIndex`");if(I!==m5&&(l.row>I.row||l.row===I.row&&l.column>I.column))throw new Error("`startPosition` cannot be greater than `endPosition`");d&&(we.currentQueryProgressCallback=d),Er(t),we._ts_query_captures_wasm(this[0],t.tree[0],l.row,l.column,I.row,I.column,n,r,a,s,o);let G=we.getValue(OI,"i32"),u=we.getValue(OI+KI,"i32"),h=we.getValue(OI+2*KI,"i32"),g=new Array;this.exceededMatchLimit=!!h;let y=new Array,R=u;for(let V=0;V<G;V++){let F=we.getValue(R,"i32");R+=KI;let f=we.getValue(R,"i32");R+=KI;let S=we.getValue(R,"i32");if(R+=KI,y.length=f,R=NOe(this,t.tree,R,F,y),this.textPredicates[F].every(B=>B(y))){let B=y[S],T=this.setProperties[F];B.setProperties=T;let P=this.assertedProperties[F];B.assertedProperties=P;let le=this.refutedProperties[F];B.refutedProperties=le,g.push(B)}}return we._free(u),we.currentQueryProgressCallback=null,g}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){let e=we.lengthBytesUTF8(t),l=we._malloc(e+1);we.stringToUTF8(t,l,e+1),we._ts_query_disable_capture(this[0],l,e),we._free(l)}disablePattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);we._ts_query_disable_pattern(this[0],t)}didExceedMatchLimit(){return this.exceededMatchLimit}startIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return we._ts_query_start_byte_for_pattern(this[0],t)}endIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return we._ts_query_end_byte_for_pattern(this[0],t)}patternCount(){return we._ts_query_pattern_count(this[0])}captureIndexForName(t){return this.captureNames.indexOf(t)}isPatternRooted(t){return we._ts_query_is_pattern_rooted(this[0],t)===1}isPatternNonLocal(t){return we._ts_query_is_pattern_non_local(this[0],t)===1}isPatternGuaranteedAtStep(t){return we._ts_query_is_pattern_guaranteed_at_step(this[0],t)===1}},bnI=/^tree_sitter_\w+$/,AOe=class ixt{static{Wt(this,"Language")}0=0;types;fields;constructor(e,l){yj(e),this[0]=l,this.types=new Array(we._ts_language_symbol_count(this[0]));for(let I=0,n=this.types.length;I<n;I++)we._ts_language_symbol_type(this[0],I)<2&&(this.types[I]=we.UTF8ToString(we._ts_language_symbol_name(this[0],I)));this.fields=new Array(we._ts_language_field_count(this[0])+1);for(let I=0,n=this.fields.length;I<n;I++){let r=we._ts_language_field_name_for_id(this[0],I);r!==0?this.fields[I]=we.UTF8ToString(r):this.fields[I]=null}}get name(){let e=we._ts_language_name(this[0]);return e===0?null:we.UTF8ToString(e)}get version(){return we._ts_language_version(this[0])}get abiVersion(){return we._ts_language_abi_version(this[0])}get metadata(){we._ts_language_metadata(this[0]);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32");return e===0?null:lxt(l)}get fieldCount(){return this.fields.length-1}get stateCount(){return we._ts_language_state_count(this[0])}fieldIdForName(e){let l=this.fields.indexOf(e);return l!==-1?l:null}fieldNameForId(e){return this.fields[e]??null}idForNodeType(e,l){let I=we.lengthBytesUTF8(e),n=we._malloc(I+1);we.stringToUTF8(e,n,I+1);let r=we._ts_language_symbol_for_name(this[0],n,I,l?1:0);return we._free(n),r||null}get nodeTypeCount(){return we._ts_language_symbol_count(this[0])}nodeTypeForId(e){let l=we._ts_language_symbol_name(this[0],e);return l?we.UTF8ToString(l):null}nodeTypeIsNamed(e){return!!we._ts_language_type_is_named_wasm(this[0],e)}nodeTypeIsVisible(e){return!!we._ts_language_type_is_visible_wasm(this[0],e)}get supertypes(){we._ts_language_supertypes_wasm(this[0]);let e=we.getValue(OI,"i32"),l=we.getValue(OI+KI,"i32"),I=new Array(e);if(e>0){let n=l;for(let r=0;r<e;r++)I[r]=we.getValue(n,"i16"),n+=P3t}return I}subtypes(e){we._ts_language_subtypes_wasm(this[0],e);let l=we.getValue(OI,"i32"),I=we.getValue(OI+KI,"i32"),n=new Array(l);if(l>0){let r=I;for(let a=0;a<l;a++)n[a]=we.getValue(r,"i16"),r+=P3t}return n}nextState(e,l){return we._ts_language_next_state(this[0],e,l)}lookaheadIterator(e){let l=we._ts_lookahead_iterator_new(this[0],e);return l?new anI(G5,l,this):null}query(e){return console.warn("Language.query is deprecated. Use new Query(language, source) instead."),new GnI(this,e)}static async load(e){let l;e instanceof Uint8Array?l=Promise.resolve(e):globalThis.process?.versions.node?l=(await import("fs/promises")).readFile(e):l=fetch(e).then(s=>s.arrayBuffer().then(o=>{if(s.ok)return new Uint8Array(o);{let d=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${s.status}.
|
|
1910
1910
|
|
|
1911
1911
|
${d}`)}}));let I=await we.loadWebAssemblyModule(await l,{loadAsync:!0}),n=Object.keys(I),r=n.find(s=>bnI.test(s)&&!s.includes("external_scanner_"));if(!r)throw console.log(`Couldn't find language function in WASM file. Symbols:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github/copilot",
|
|
3
3
|
"description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.",
|
|
4
|
-
"version": "0.0.332-
|
|
4
|
+
"version": "0.0.332-2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"tree-sitter-powershell.wasm"
|
|
27
27
|
],
|
|
28
28
|
"buildMetadata": {
|
|
29
|
-
"gitCommit": "
|
|
29
|
+
"gitCommit": "0a5549d"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"node-pty": "npm:@devm33/node-pty@^1.0.8",
|