@visulima/error 4.6.0 → 4.6.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/CHANGELOG.md +20 -0
- package/dist/code-frame/index.cjs +6 -136
- package/dist/code-frame/index.mjs +6 -131
- package/dist/error/index.cjs +1 -25
- package/dist/error/index.mjs +1 -8
- package/dist/index.cjs +1 -43
- package/dist/index.mjs +1 -16
- package/dist/packem_shared/NonError-CQn4sdxd.cjs +1 -0
- package/dist/packem_shared/NonError-CS10kwil.mjs +1 -0
- package/dist/packem_shared/addKnownErrorConstructor-B5dNFGsR.cjs +1 -0
- package/dist/packem_shared/addKnownErrorConstructor-BqqnTSZp.mjs +1 -0
- package/dist/packem_shared/aiFinder-Be-xHFVO.mjs +1 -0
- package/dist/packem_shared/aiFinder-CN0pneE2.cjs +1 -0
- package/dist/packem_shared/aiSolutionResponse-C5apAmTu.cjs +10 -0
- package/dist/packem_shared/aiSolutionResponse-RD0AK1jh.mjs +10 -0
- package/dist/packem_shared/captureRawStackTrace-B9d1821F.cjs +1 -0
- package/dist/packem_shared/captureRawStackTrace-CQPNHvBG.mjs +1 -0
- package/dist/packem_shared/deserializeError-2C6o7QF7.cjs +1 -0
- package/dist/packem_shared/deserializeError-tzZhIV70.mjs +1 -0
- package/dist/packem_shared/errorHintFinder-C_g0nvml.mjs +2 -0
- package/dist/packem_shared/errorHintFinder-DRCn1Ysx.cjs +2 -0
- package/dist/packem_shared/formatStackFrameLine-DD2DUdW0.cjs +2 -0
- package/dist/packem_shared/formatStackFrameLine-iU54KA81.mjs +2 -0
- package/dist/packem_shared/getErrorCauses-B7_Z_gEF.cjs +1 -0
- package/dist/packem_shared/getErrorCauses-D025FGyO.mjs +1 -0
- package/dist/packem_shared/index-CLFYRLyq.mjs +1 -0
- package/dist/packem_shared/index-CqSGigts.cjs +1 -0
- package/dist/packem_shared/indexToLineColumn-B1F7aNZh.mjs +1 -0
- package/dist/packem_shared/indexToLineColumn-C_v57REF.cjs +1 -0
- package/dist/packem_shared/isVisulimaError-CrvBm0kw.cjs +1 -0
- package/dist/packem_shared/isVisulimaError-jVZgumOU.mjs +1 -0
- package/dist/packem_shared/parseStacktrace-Dnxnc4PL.mjs +2 -0
- package/dist/packem_shared/parseStacktrace-MW4-SLXl.cjs +2 -0
- package/dist/packem_shared/renderError-D7R71d_7.mjs +18 -0
- package/dist/packem_shared/renderError-D8XJnkIF.cjs +18 -0
- package/dist/packem_shared/ruleBasedFinder-B1jRHBM_.cjs +34 -0
- package/dist/packem_shared/ruleBasedFinder-P88d0gpK.mjs +34 -0
- package/dist/packem_shared/serializeError-7S1IG6zs.cjs +1 -0
- package/dist/packem_shared/serializeError-Bc-QciX0.mjs +1 -0
- package/dist/solution/ai/ai-prompt.cjs +7 -17
- package/dist/solution/ai/ai-prompt.mjs +7 -15
- package/dist/solution/ai/index.cjs +1 -13
- package/dist/solution/ai/index.mjs +1 -3
- package/dist/solution/index.cjs +1 -11
- package/dist/solution/index.mjs +1 -2
- package/dist/stacktrace/index.cjs +1 -12
- package/dist/stacktrace/index.mjs +1 -2
- package/package.json +1 -1
- package/dist/packem_shared/NonError-BrwMc2LE.mjs +0 -13
- package/dist/packem_shared/NonError-DqwGL5Cy.cjs +0 -15
- package/dist/packem_shared/addKnownErrorConstructor-DBmmT2OF.mjs +0 -32
- package/dist/packem_shared/addKnownErrorConstructor-J1_ZUURa.cjs +0 -39
- package/dist/packem_shared/aiFinder-BR9Pq804.cjs +0 -259
- package/dist/packem_shared/aiFinder-CFHvOjD8.mjs +0 -257
- package/dist/packem_shared/aiSolutionResponse-BaN1M990.mjs +0 -36
- package/dist/packem_shared/aiSolutionResponse-Cqi0mFxy.cjs +0 -38
- package/dist/packem_shared/captureRawStackTrace-ClSI1tHb.cjs +0 -14
- package/dist/packem_shared/captureRawStackTrace-Tl3Rqkat.mjs +0 -12
- package/dist/packem_shared/deserializeError-Be3qOGBQ.cjs +0 -120
- package/dist/packem_shared/deserializeError-DuzHucBb.mjs +0 -118
- package/dist/packem_shared/errorHintFinder-CQy_qIK3.mjs +0 -23
- package/dist/packem_shared/errorHintFinder-DZugFHq0.cjs +0 -25
- package/dist/packem_shared/formatStackFrameLine-DcXSX--m.cjs +0 -31
- package/dist/packem_shared/formatStackFrameLine-DqkmKWH3.mjs +0 -26
- package/dist/packem_shared/getErrorCauses-CG_JRE6j.mjs +0 -24
- package/dist/packem_shared/getErrorCauses-miTeYJEG.cjs +0 -26
- package/dist/packem_shared/index-BmoOJLvu.mjs +0 -12
- package/dist/packem_shared/index-C53Tqb7g.cjs +0 -14
- package/dist/packem_shared/indexToLineColumn-CKQKtKEK.mjs +0 -52
- package/dist/packem_shared/indexToLineColumn-Cro5eT8v.cjs +0 -54
- package/dist/packem_shared/isVisulimaError-Bb1_TB6w.cjs +0 -44
- package/dist/packem_shared/isVisulimaError-zyd80Gui.mjs +0 -39
- package/dist/packem_shared/parseStacktrace-BlguTUcF.mjs +0 -275
- package/dist/packem_shared/parseStacktrace-woJgU2XY.cjs +0 -277
- package/dist/packem_shared/renderError-Cn8M0fQ3.mjs +0 -180
- package/dist/packem_shared/renderError-n3kXGdYj.cjs +0 -184
- package/dist/packem_shared/ruleBasedFinder-Cbmc6N7f.mjs +0 -227
- package/dist/packem_shared/ruleBasedFinder-CkybTSHw.cjs +0 -229
- package/dist/packem_shared/serializeError-DHIelq5o.mjs +0 -144
- package/dist/packem_shared/serializeError-Dt7oFM2R.cjs +0 -148
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var i=(s,t)=>n(s,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var m=Object.defineProperty,e=i((s,t)=>m(s,"name",{value:t,configurable:!0}),"t");const h=e(s=>s instanceof Error&&s.type==="VisulimaError","isVisulimaError");class E extends Error{static{i(this,"VisulimaError")}static{e(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:t,hint:r,location:a,message:o,name:l,stack:u,title:c}){super(o,{cause:t}),this.title=c,this.name=l,this.stack=u??this.stack,this.loc=a,this.hint=r}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}}exports.VisulimaError=E;exports.isVisulimaError=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var i=(s,t)=>h(s,"name",{value:t,configurable:!0});var m=Object.defineProperty,e=i((s,t)=>m(s,"name",{value:t,configurable:!0}),"t");const E=e(s=>s instanceof Error&&s.type==="VisulimaError","isVisulimaError");class V extends Error{static{i(this,"VisulimaError")}static{e(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:t,hint:r,location:a,message:o,name:c,stack:n,title:l}){super(o,{cause:t}),this.title=l,this.name=c,this.stack=n??this.stack,this.loc=a,this.hint=r}setLocation(t){this.loc=t}setName(t){this.name=t}setMessage(t){this.message=t}setHint(t){this.hint=t}}export{V as VisulimaError,E as isVisulimaError};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var x=Object.defineProperty;var v=(i,e)=>x(i,"name",{value:e,configurable:!0});var N=Object.defineProperty,d=v((i,e)=>N(i,"name",{value:e,configurable:!0}),"u");const u=d((i,...e)=>{process.env.DEBUG&&String(process.env.DEBUG)==="true"&&console.debug(`error:parse-stacktrace: ${i}`,...e)},"debugLog"),f="<unknown>",g=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,S=/(.*?):(\d+):(\d+)(\s<-\s(.+):(\d+):(\d+))?/,k=/(eval)\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*(<anonymous>)?:(\d+)?:(\d+)/,w=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,b=/in\s(.*)\s\(at\s(.+)\)\sat/,O=/^(?:.*@)?(.*):(\d+):(\d+)$/,E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,J=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,A=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,p=/\(error: (.*)\)/,$=d((i,e)=>{const n=i.includes("safari-extension"),t=i.includes("safari-web-extension");return n||t?[i.includes("@")?i.split("@")[0]:f,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[i,e]},"extractSafariExtensionDetails"),y=d((i,e)=>{const n=S.exec(e);n&&(i.file=n[1],i.line=+n[2],i.column=+n[3])},"parseMapped"),G=d(i=>{const e=b.exec(i);if(e){u(`parse nested node error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const t=e[2].split(":");return{column:t[2]?+t[2]:void 0,file:t[0],line:t[1]?+t[1]:void 0,methodName:e[1]||f,raw:i,type:void 0}}const n=w.exec(i);if(n){u(`parse node error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const t={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(/at\s/,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]||f,raw:i,type:i.startsWith("internal")?"internal":void 0};return y(t,`${n[2]}:${n[3]}:${n[4]}`),t}},"parseNode"),W=d(i=>{const e=g.exec(i);if(e){u(`parse chrome error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),t=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let o,a;if(t){const s=h.exec(i);if(s){const r=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/.exec(s[1]);r?(e[2]=r[4]??r[1],e[3]=r[5]??r[2],e[4]=r[3]):s[2]&&(e[2]=s[1]),s[2]&&(o={column:s[4]?+s[4]:void 0,file:s[2],line:s[3]?+s[3]:void 0,methodName:"eval",raw:i,type:"eval"})}else{const r=k.exec(i);r&&(a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0},o={column:r[8]?+r[8]:void 0,file:r[2],line:r[7]?+r[7]:void 0,methodName:"eval",raw:r[0],type:"eval"})}}const[m,c]=$(e[1]?e[1].replace(/^Anonymous function$/,"<anonymous>"):f,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:o,file:c,line:e[3]?+e[3]:void 0,methodName:m,raw:i,type:t?"eval":n?"native":void 0};return a?(l.column=a.column,l.file=a.file,l.line=a.line):y(l,`${c}:${e[3]}:${e[4]}`),l}},"parseChromium"),D=d((i,e)=>{const n=E.exec(i);if(n){u(`parse gecko error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const t=n[3]?.includes(" > eval"),o=t&&n[3]&&J.exec(n[3]);let a;t&&o&&(n[3]=o[1],a={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:i,type:"eval"},n[4]=o[2]);const[m,c]=$(n[1]?n[1].replace(/^Anonymous function$/,"<anonymous>"):f,n[3]);let l;(e?.type==="safari"||!t&&e?.type==="firefox")&&e.column?l=e.column:!t&&n[5]&&(l=+n[5]);let s;return(e?.type==="safari"||!t&&e?.type==="firefox")&&e.line?s=e.line:n[4]&&(s=+n[4]),{column:l,evalOrigin:a,file:c,line:s,methodName:m,raw:i,type:t?"eval":c.includes("[native code]")?"native":void 0}}},"parseGecko"),j=d((i,e)=>{const n=A.exec(i);if(!(n&&n[2].includes(" > eval"))&&n)return u(`parse firefox error stack line: "${i}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||f,raw:i,type:void 0}},"parseFirefox"),z=d(i=>{const e=O.exec(i);if(e)return u(`parse react android native error stack line: "${i}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:f,raw:i,type:void 0}},"parseReactAndroidNative"),L=d((i,{filter:e,frameLimit:n=50}={})=>{let t=(i.stacktrace??i.stack??"").split(`
|
|
2
|
+
`).map(o=>(p.test(o)?o.replace(p,"$1"):o).replace(/^\s+|\s+$/g,"")).filter(o=>!/\S*(?:Error: |AggregateError:)/.test(o)&&o!=="eval code");return e&&(t=t.filter(o=>e(o))),t=t.slice(0,n),t.reduce((o,a,m)=>{if(!a||a.length>1024)return o;let c;if(/^\s*in\s.*/.test(a))c=G(a);else if(/^.*?\s*at\s.*/.test(a))c=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),c=j(a,l)||D(a,l)}else c=z(a);return c?o.push(c):u(`parse error stack line: "${a}"`,"not parser found"),o},[])},"parseStacktrace");export{L as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var v=(i,e)=>x(i,"name",{value:e,configurable:!0});var N=Object.defineProperty,d=v((i,e)=>N(i,"name",{value:e,configurable:!0}),"u");const u=d((i,...e)=>{process.env.DEBUG&&String(process.env.DEBUG)==="true"&&console.debug(`error:parse-stacktrace: ${i}`,...e)},"debugLog"),f="<unknown>",g=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,h=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,S=/(.*?):(\d+):(\d+)(\s<-\s(.+):(\d+):(\d+))?/,k=/(eval)\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*(<anonymous>)?:(\d+)?:(\d+)/,w=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,b=/in\s(.*)\s\(at\s(.+)\)\sat/,O=/^(?:.*@)?(.*):(\d+):(\d+)$/,E=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,J=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,A=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,p=/\(error: (.*)\)/,$=d((i,e)=>{const n=i.includes("safari-extension"),t=i.includes("safari-web-extension");return n||t?[i.includes("@")?i.split("@")[0]:f,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[i,e]},"extractSafariExtensionDetails"),y=d((i,e)=>{const n=S.exec(e);n&&(i.file=n[1],i.line=+n[2],i.column=+n[3])},"parseMapped"),G=d(i=>{const e=b.exec(i);if(e){u(`parse nested node error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const t=e[2].split(":");return{column:t[2]?+t[2]:void 0,file:t[0],line:t[1]?+t[1]:void 0,methodName:e[1]||f,raw:i,type:void 0}}const n=w.exec(i);if(n){u(`parse node error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const t={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(/at\s/,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]||f,raw:i,type:i.startsWith("internal")?"internal":void 0};return y(t,`${n[2]}:${n[3]}:${n[4]}`),t}},"parseNode"),W=d(i=>{const e=g.exec(i);if(e){u(`parse chrome error stack line: "${i}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),t=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let o,a;if(t){const s=h.exec(i);if(s){const r=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/.exec(s[1]);r?(e[2]=r[4]??r[1],e[3]=r[5]??r[2],e[4]=r[3]):s[2]&&(e[2]=s[1]),s[2]&&(o={column:s[4]?+s[4]:void 0,file:s[2],line:s[3]?+s[3]:void 0,methodName:"eval",raw:i,type:"eval"})}else{const r=k.exec(i);r&&(a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0},o={column:r[8]?+r[8]:void 0,file:r[2],line:r[7]?+r[7]:void 0,methodName:"eval",raw:r[0],type:"eval"})}}const[m,c]=$(e[1]?e[1].replace(/^Anonymous function$/,"<anonymous>"):f,e[2]),l={column:e[4]?+e[4]:void 0,evalOrigin:o,file:c,line:e[3]?+e[3]:void 0,methodName:m,raw:i,type:t?"eval":n?"native":void 0};return a?(l.column=a.column,l.file=a.file,l.line=a.line):y(l,`${c}:${e[3]}:${e[4]}`),l}},"parseChromium"),D=d((i,e)=>{const n=E.exec(i);if(n){u(`parse gecko error stack line: "${i}"`,`found: ${JSON.stringify(n)}`);const t=n[3]?.includes(" > eval"),o=t&&n[3]&&J.exec(n[3]);let a;t&&o&&(n[3]=o[1],a={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:i,type:"eval"},n[4]=o[2]);const[m,c]=$(n[1]?n[1].replace(/^Anonymous function$/,"<anonymous>"):f,n[3]);let l;(e?.type==="safari"||!t&&e?.type==="firefox")&&e.column?l=e.column:!t&&n[5]&&(l=+n[5]);let s;return(e?.type==="safari"||!t&&e?.type==="firefox")&&e.line?s=e.line:n[4]&&(s=+n[4]),{column:l,evalOrigin:a,file:c,line:s,methodName:m,raw:i,type:t?"eval":c.includes("[native code]")?"native":void 0}}},"parseGecko"),j=d((i,e)=>{const n=A.exec(i);if(!(n&&n[2].includes(" > eval"))&&n)return u(`parse firefox error stack line: "${i}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||f,raw:i,type:void 0}},"parseFirefox"),z=d(i=>{const e=O.exec(i);if(e)return u(`parse react android native error stack line: "${i}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:f,raw:i,type:void 0}},"parseReactAndroidNative"),B=d((i,{filter:e,frameLimit:n=50}={})=>{let t=(i.stacktrace??i.stack??"").split(`
|
|
2
|
+
`).map(o=>(p.test(o)?o.replace(p,"$1"):o).replace(/^\s+|\s+$/g,"")).filter(o=>!/\S*(?:Error: |AggregateError:)/.test(o)&&o!=="eval code");return e&&(t=t.filter(o=>e(o))),t=t.slice(0,n),t.reduce((o,a,m)=>{if(!a||a.length>1024)return o;let c;if(/^\s*in\s.*/.test(a))c=G(a);else if(/^.*?\s*at\s.*/.test(a))c=W(a);else if(/^.*?\s*@.*|\[native code\]/.test(a)){let l;m===0&&(i.columnNumber||i.lineNumber?l={column:i.columnNumber,line:i.lineNumber,type:"firefox"}:(i.line||i.column)&&(l={column:i.column,line:i.line,type:"safari"})),c=j(a,l)||D(a,l)}else c=z(a);return c?o.push(c):u(`parse error stack line: "${a}"`,"not parser found"),o},[])},"parseStacktrace");module.exports=B;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var L=Object.defineProperty;var u=(e,r)=>L(e,"name",{value:r,configurable:!0});import{existsSync as C,readFileSync as S}from"node:fs";import{relative as M}from"node:path";import{cwd as y}from"node:process";import{fileURLToPath as A}from"node:url";import{codeFrame as T}from"../code-frame/index.mjs";import g from"./parseStacktrace-Dnxnc4PL.mjs";var V=Object.defineProperty,s=u((e,r)=>V(e,"name",{value:r,configurable:!0}),"o");const f=s((e,r,i)=>i===0?e.toString():r===" "?e+" ".repeat(i):e+" ".repeat(r*i),"getPrefix"),N=s((e,r)=>{const i=e.replace("async file:","file:");return M(r,i.startsWith("file:")?A(i):i)},"getRelativePath"),P=s((e,r,i)=>{if(r)return i.title(e.message);const t=e.message?`: ${e.message}`:"";return i.title(e.name+t)},"getTitleText"),p=s((e,{color:r,hideErrorTitle:i,indentation:t,prefix:n},a)=>`${f(n,t,a)}${P(e,i,r)}
|
|
2
|
+
`,"getMessage"),v=s((e,{color:r,indentation:i,prefix:t},n)=>{if(e.hint===void 0)return;const a=f(t,i,n);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${(a+l).toString()}
|
|
3
|
+
`;else o+=a+e.hint;return r.hint(o)},"getHint"),c=s((e,{color:r,cwd:i,displayShortPath:t,indentation:n,prefix:a},o=0)=>{const l=t?N(e.file,i):e.file,{fileLine:d,method:m}=r;return`${f(a,n,o)}at ${e.methodName?`${m(e.methodName)} `:""}${d(l)}:${d(e.line?.toString()??"")}`.toString()},"getMainFrame"),w=s((e,{color:r,indentation:i,linesAbove:t,linesBelow:n,prefix:a,showGutter:o,showLineNumbers:l,tabWidth:d},m)=>{if(e.file===void 0)return;const h=e.file.replace("file://","");if(!C(h))return;const b=S(h,"utf8");return T(b,{start:{column:e.column,line:e.line}},{color:r,linesAbove:t,linesBelow:n,prefix:f(a,i,m),showGutter:o,showLineNumbers:l,tabWidth:d})},"getCode"),E=s((e,r,i)=>{if(e.errors.length===0)return;let t=`${f(r.prefix,r.indentation,i)}Errors:
|
|
4
|
+
|
|
5
|
+
`,n=!0;for(const a of e.errors)n?n=!1:t+=`
|
|
6
|
+
|
|
7
|
+
`,t+=$(a,{...r,framesMaxLimit:1,hideErrorCodeView:r.hideErrorErrorsCodeView},i+1);return`
|
|
8
|
+
${t}`},"getErrors"),x=s((e,r,i)=>{let t=`${f(r.prefix,r.indentation,i)}Caused by:
|
|
9
|
+
|
|
10
|
+
`;const n=e.cause;t+=p(n,r,i);const a=g(n).shift(),o=v(n,r,i);if(o&&(t+=`${o}
|
|
11
|
+
`),a&&(t+=c(a,r,i),!r.hideErrorCauseCodeView)){const l=w(a,r,i);l!==void 0&&(t+=`
|
|
12
|
+
${l}`)}if(n.cause)t+=`
|
|
13
|
+
${x(n,r,i+1)}`;else if(n instanceof AggregateError){const l=E(n,r,i);l!==void 0&&(t+=`
|
|
14
|
+
${l}`)}return`
|
|
15
|
+
${t}`},"getCause"),k=s((e,r)=>(e.length>0?`
|
|
16
|
+
`:"")+e.map(i=>c(i,r)).join(`
|
|
17
|
+
`),"getStacktrace"),$=s((e,r,i)=>{const t={cwd:y(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...r,color:{fileLine:s(o=>o,"fileLine"),gutter:s(o=>o,"gutter"),hint:s(o=>o,"hint"),marker:s(o=>o,"marker"),message:s(o=>o,"message"),method:s(o=>o,"method"),title:s(o=>o,"title"),...r.color}},n=g(e,{filter:r.filterStacktrace,frameLimit:t.framesMaxLimit}),a=n.shift();return[r.hideMessage?void 0:p(e,t,i),v(e,t,i),a?c(a,t,i):void 0,a&&!t.hideErrorCodeView?w(a,t,i):void 0,e instanceof AggregateError?E(e,t,i):void 0,e.cause===void 0?void 0:x(e,t,i),n.length>0?k(n,t):void 0].filter(Boolean).join(`
|
|
18
|
+
`).replaceAll("\\","/")},"internalRenderError"),O=s((e,r={})=>{if(r.framesMaxLimit!==void 0&&r.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return $(e,r,0)},"renderError");export{O as renderError};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var L=Object.defineProperty;var m=(e,r)=>L(e,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("node:fs"),C=require("node:path"),M=require("node:process"),y=require("node:url"),T=require("../code-frame/index.cjs"),p=require("./parseStacktrace-MW4-SLXl.cjs");var A=Object.defineProperty,s=m((e,r)=>A(e,"name",{value:r,configurable:!0}),"o");const d=s((e,r,i)=>i===0?e.toString():r===" "?e+" ".repeat(i):e+" ".repeat(r*i),"getPrefix"),P=s((e,r)=>{const i=e.replace("async file:","file:");return C.relative(r,i.startsWith("file:")?y.fileURLToPath(i):i)},"getRelativePath"),V=s((e,r,i)=>{if(r)return i.title(e.message);const t=e.message?`: ${e.message}`:"";return i.title(e.name+t)},"getTitleText"),v=s((e,{color:r,hideErrorTitle:i,indentation:t,prefix:n},a)=>`${d(n,t,a)}${V(e,i,r)}
|
|
2
|
+
`,"getMessage"),w=s((e,{color:r,indentation:i,prefix:t},n)=>{if(e.hint===void 0)return;const a=d(t,i,n);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${(a+l).toString()}
|
|
3
|
+
`;else o+=a+e.hint;return r.hint(o)},"getHint"),c=s((e,{color:r,cwd:i,displayShortPath:t,indentation:n,prefix:a},o=0)=>{const l=t?P(e.file,i):e.file,{fileLine:f,method:u}=r;return`${d(a,n,o)}at ${e.methodName?`${u(e.methodName)} `:""}${f(l)}:${f(e.line?.toString()??"")}`.toString()},"getMainFrame"),E=s((e,{color:r,indentation:i,linesAbove:t,linesBelow:n,prefix:a,showGutter:o,showLineNumbers:l,tabWidth:f},u)=>{if(e.file===void 0)return;const h=e.file.replace("file://","");if(!g.existsSync(h))return;const S=g.readFileSync(h,"utf8");return T.codeFrame(S,{start:{column:e.column,line:e.line}},{color:r,linesAbove:t,linesBelow:n,prefix:d(a,i,u),showGutter:o,showLineNumbers:l,tabWidth:f})},"getCode"),b=s((e,r,i)=>{if(e.errors.length===0)return;let t=`${d(r.prefix,r.indentation,i)}Errors:
|
|
4
|
+
|
|
5
|
+
`,n=!0;for(const a of e.errors)n?n=!1:t+=`
|
|
6
|
+
|
|
7
|
+
`,t+=$(a,{...r,framesMaxLimit:1,hideErrorCodeView:r.hideErrorErrorsCodeView},i+1);return`
|
|
8
|
+
${t}`},"getErrors"),x=s((e,r,i)=>{let t=`${d(r.prefix,r.indentation,i)}Caused by:
|
|
9
|
+
|
|
10
|
+
`;const n=e.cause;t+=v(n,r,i);const a=p(n).shift(),o=w(n,r,i);if(o&&(t+=`${o}
|
|
11
|
+
`),a&&(t+=c(a,r,i),!r.hideErrorCauseCodeView)){const l=E(a,r,i);l!==void 0&&(t+=`
|
|
12
|
+
${l}`)}if(n.cause)t+=`
|
|
13
|
+
${x(n,r,i+1)}`;else if(n instanceof AggregateError){const l=b(n,r,i);l!==void 0&&(t+=`
|
|
14
|
+
${l}`)}return`
|
|
15
|
+
${t}`},"getCause"),N=s((e,r)=>(e.length>0?`
|
|
16
|
+
`:"")+e.map(i=>c(i,r)).join(`
|
|
17
|
+
`),"getStacktrace"),$=s((e,r,i)=>{const t={cwd:M.cwd(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...r,color:{fileLine:s(o=>o,"fileLine"),gutter:s(o=>o,"gutter"),hint:s(o=>o,"hint"),marker:s(o=>o,"marker"),message:s(o=>o,"message"),method:s(o=>o,"method"),title:s(o=>o,"title"),...r.color}},n=p(e,{filter:r.filterStacktrace,frameLimit:t.framesMaxLimit}),a=n.shift();return[r.hideMessage?void 0:v(e,t,i),w(e,t,i),a?c(a,t,i):void 0,a&&!t.hideErrorCodeView?E(a,t,i):void 0,e instanceof AggregateError?b(e,t,i):void 0,e.cause===void 0?void 0:x(e,t,i),n.length>0?N(n,t):void 0].filter(Boolean).join(`
|
|
18
|
+
`).replaceAll("\\","/")},"internalRenderError"),_=s((e,r={})=>{if(r.framesMaxLimit!==void 0&&r.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return $(e,r,0)},"renderError");exports.renderError=_;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var m=(e,t)=>u(e,"name",{value:t,configurable:!0});var c=Object.defineProperty,n=m((e,t)=>c(e,"name",{value:t,configurable:!0}),"t");const l=n(e=>`\`\`\`
|
|
2
|
+
${e.trim()}
|
|
3
|
+
\`\`\``,"code"),a=n(e=>`\`\`\`bash
|
|
4
|
+
${e.trim()}
|
|
5
|
+
\`\`\``,"bash"),d=n(e=>`\`\`\`ts
|
|
6
|
+
${e.trim()}
|
|
7
|
+
\`\`\``,"ts"),f=n(e=>`\`\`\`js
|
|
8
|
+
${e.trim()}
|
|
9
|
+
\`\`\``,"js"),r=n((e,...t)=>{const i=e.toLowerCase();return t.some(s=>i.includes(s.toLowerCase()))},"has"),h=[{name:"esm-cjs-interop",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"err_require_esm","cannot use import statement outside a module","must use import to load es module","require() of es module","does not provide an export named"))return{md:["Your project or a dependency may be mixing CommonJS and ES Modules.","","Try:","- Ensure package.json has the correct `type` (either `module` or `commonjs`).","- Use dynamic `import()` when requiring ESM from CJS.","- Prefer ESM-compatible entrypoints from dependencies.","- In Node, align `module` resolution with your bundler config.","","Check Node resolution:",a(`node -v
|
|
10
|
+
cat package.json | jq .type`),"","Example dynamic import in CJS:",f("(async () => { const mod = await import('some-esm'); mod.default(); })();")].join(`
|
|
11
|
+
`),title:"ESM/CJS interop"}},"test")},{name:"missing-default-export",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"default export not found","has no default export","does not provide an export named 'default'","is not exported from"))return{md:["Verify your import/export shapes.","","Default export example:",d(`export default function Component() {}
|
|
12
|
+
// import Component from './file'`),"","Named export example:",d(`export function Component() {}
|
|
13
|
+
// import { Component } from './file'`)].join(`
|
|
14
|
+
`),title:"Export mismatch (default vs named)"}},"test")},{name:"port-in-use",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"eaddrinuse","address already in use","listen eaddrinuse"))return{md:["Another process is using the port.","","Change the port or stop the other process.","","On macOS/Linux:",a(`lsof -i :3000
|
|
15
|
+
kill -9 <PID>`),"","On Windows (PowerShell):",a(`netstat -ano | findstr :3000
|
|
16
|
+
taskkill /PID <PID> /F`)].join(`
|
|
17
|
+
`),title:"Port already in use"}},"test")},{name:"file-not-found-or-case",test:n((e,t)=>{const i=(e?.message||String(e||"")).toString();if(r(i,"enoent","module not found","cannot find module"))return{md:["Check the import path and filename case (Linux/macOS are case-sensitive).","If using TS path aliases, verify `tsconfig.paths` and bundler aliases.","","Current file:",l(`${t.file}:${t.line}`)].join(`
|
|
18
|
+
`),title:"Missing file or path case mismatch"}},"test")},{name:"ts-path-mapping",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"ts2307","cannot find module")||t.includes("TS2307"))return{md:["If you use path aliases, align TS `paths` with Vite/Webpack resolve aliases.","Ensure file extensions are correct and included in resolver.","","tsconfig.json excerpt:",d(`{
|
|
19
|
+
"compilerOptions": {
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": { "@/*": ["src/*"] }
|
|
22
|
+
}
|
|
23
|
+
}`)].join(`
|
|
24
|
+
`),title:"TypeScript path mapping / resolution"}},"test")},{name:"network-dns-enotfound",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"enotfound","getaddrinfo enotfound","dns","fetch failed","ecconnrefused","econnrefused"))return{md:["The host may be unreachable or misconfigured.","","Try:","- Verify the hostname and protocol (http/https).","- Check VPN/proxy and firewall.","- Confirm the service is running and listening on the expected port.","",a(`ping <host>
|
|
25
|
+
nslookup <host>
|
|
26
|
+
curl -v http://<host>:<port>`)].join(`
|
|
27
|
+
`),title:"Network/DNS connection issue"}},"test")},{name:"undefined-property",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"cannot read properties of undefined","reading '"))return{md:["A variable or function returned `undefined`.","","Mitigations:","- Add nullish checks before property access.","- Validate function return values and input props/state.","",d("const value = maybe?.prop; // or: if (maybe) { use(maybe.prop) }")].join(`
|
|
28
|
+
`),title:"Accessing property of undefined"}},"test")}],g={handle:n(async(e,t)=>{try{const i=h.map(o=>({match:o.test(e,t),rule:o})).filter(o=>!!o.match);if(i.length===0)return;const s=i.toSorted((o,p)=>(o.match.priority||0)-(p.match.priority||0)).map(o=>`#### ${o.match.title}
|
|
29
|
+
|
|
30
|
+
${o.match.md}`).join(`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
`);return s===""?void 0:{body:s,header:"### Potential fixes detected"}}catch{return}},"handle"),name:"ruleBasedHints",priority:0};module.exports=g;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var u=Object.defineProperty;var m=(e,t)=>u(e,"name",{value:t,configurable:!0});var c=Object.defineProperty,n=m((e,t)=>c(e,"name",{value:t,configurable:!0}),"t");const l=n(e=>`\`\`\`
|
|
2
|
+
${e.trim()}
|
|
3
|
+
\`\`\``,"code"),a=n(e=>`\`\`\`bash
|
|
4
|
+
${e.trim()}
|
|
5
|
+
\`\`\``,"bash"),d=n(e=>`\`\`\`ts
|
|
6
|
+
${e.trim()}
|
|
7
|
+
\`\`\``,"ts"),f=n(e=>`\`\`\`js
|
|
8
|
+
${e.trim()}
|
|
9
|
+
\`\`\``,"js"),r=n((e,...t)=>{const i=e.toLowerCase();return t.some(s=>i.includes(s.toLowerCase()))},"has"),h=[{name:"esm-cjs-interop",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"err_require_esm","cannot use import statement outside a module","must use import to load es module","require() of es module","does not provide an export named"))return{md:["Your project or a dependency may be mixing CommonJS and ES Modules.","","Try:","- Ensure package.json has the correct `type` (either `module` or `commonjs`).","- Use dynamic `import()` when requiring ESM from CJS.","- Prefer ESM-compatible entrypoints from dependencies.","- In Node, align `module` resolution with your bundler config.","","Check Node resolution:",a(`node -v
|
|
10
|
+
cat package.json | jq .type`),"","Example dynamic import in CJS:",f("(async () => { const mod = await import('some-esm'); mod.default(); })();")].join(`
|
|
11
|
+
`),title:"ESM/CJS interop"}},"test")},{name:"missing-default-export",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"default export not found","has no default export","does not provide an export named 'default'","is not exported from"))return{md:["Verify your import/export shapes.","","Default export example:",d(`export default function Component() {}
|
|
12
|
+
// import Component from './file'`),"","Named export example:",d(`export function Component() {}
|
|
13
|
+
// import { Component } from './file'`)].join(`
|
|
14
|
+
`),title:"Export mismatch (default vs named)"}},"test")},{name:"port-in-use",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"eaddrinuse","address already in use","listen eaddrinuse"))return{md:["Another process is using the port.","","Change the port or stop the other process.","","On macOS/Linux:",a(`lsof -i :3000
|
|
15
|
+
kill -9 <PID>`),"","On Windows (PowerShell):",a(`netstat -ano | findstr :3000
|
|
16
|
+
taskkill /PID <PID> /F`)].join(`
|
|
17
|
+
`),title:"Port already in use"}},"test")},{name:"file-not-found-or-case",test:n((e,t)=>{const i=(e?.message||String(e||"")).toString();if(r(i,"enoent","module not found","cannot find module"))return{md:["Check the import path and filename case (Linux/macOS are case-sensitive).","If using TS path aliases, verify `tsconfig.paths` and bundler aliases.","","Current file:",l(`${t.file}:${t.line}`)].join(`
|
|
18
|
+
`),title:"Missing file or path case mismatch"}},"test")},{name:"ts-path-mapping",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"ts2307","cannot find module")||t.includes("TS2307"))return{md:["If you use path aliases, align TS `paths` with Vite/Webpack resolve aliases.","Ensure file extensions are correct and included in resolver.","","tsconfig.json excerpt:",d(`{
|
|
19
|
+
"compilerOptions": {
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": { "@/*": ["src/*"] }
|
|
22
|
+
}
|
|
23
|
+
}`)].join(`
|
|
24
|
+
`),title:"TypeScript path mapping / resolution"}},"test")},{name:"network-dns-enotfound",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"enotfound","getaddrinfo enotfound","dns","fetch failed","ecconnrefused","econnrefused"))return{md:["The host may be unreachable or misconfigured.","","Try:","- Verify the hostname and protocol (http/https).","- Check VPN/proxy and firewall.","- Confirm the service is running and listening on the expected port.","",a(`ping <host>
|
|
25
|
+
nslookup <host>
|
|
26
|
+
curl -v http://<host>:<port>`)].join(`
|
|
27
|
+
`),title:"Network/DNS connection issue"}},"test")},{name:"undefined-property",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"cannot read properties of undefined","reading '"))return{md:["A variable or function returned `undefined`.","","Mitigations:","- Add nullish checks before property access.","- Validate function return values and input props/state.","",d("const value = maybe?.prop; // or: if (maybe) { use(maybe.prop) }")].join(`
|
|
28
|
+
`),title:"Accessing property of undefined"}},"test")}],y={handle:n(async(e,t)=>{try{const i=h.map(o=>({match:o.test(e,t),rule:o})).filter(o=>!!o.match);if(i.length===0)return;const s=i.toSorted((o,p)=>(o.match.priority||0)-(p.match.priority||0)).map(o=>`#### ${o.match.title}
|
|
29
|
+
|
|
30
|
+
${o.match.md}`).join(`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
`);return s===""?void 0:{body:s,header:"### Potential fixes detected"}}catch{return}},"handle"),name:"ruleBasedHints",priority:0};export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var l=(e,t)=>b(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("./index-CqSGigts.cjs"),d=Object.create({},{cause:{enumerable:!0,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!0,value:void 0,writable:!0},message:{enumerable:!0,value:void 0,writable:!0},name:{enumerable:!0,value:void 0,writable:!0},stack:{enumerable:!0,value:void 0,writable:!0}});var p=Object.defineProperty,s=l((e,t)=>p(e,"name",{value:t,configurable:!0}),"c");const c=new WeakSet,v=s(e=>{c.add(e);const t=e.toJSON();return c.delete(e),t},"toJSON"),f=s((e,t,n,u)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return t.includes(e)?"[Circular]":(n+=1,i(e,u,t,n));if(u.useToJSON&&typeof e.toJSON=="function")return e.toJSON();if(typeof e=="object"&&e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(m.r(e)){if(n+=1,u.maxDepth&&n>=u.maxDepth)return{};const r={};for(const o in e)r[o]=f(e[o],t,n,u);return r}try{return e}catch{return"[Not Available]"}},"serializeValue"),i=s((e,t,n,u)=>{if(n.push(e),t.maxDepth===0)return{};if(t.useToJSON&&typeof e.toJSON=="function"&&!c.has(e))return v(e);const r=Object.create(d);if(r.name=Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,r.message=e.message,r.stack=e.stack,Array.isArray(e.errors)){const o=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.includes(a))return r.errors=[],r;o.push(i(a,t,n,u))}r.errors=o}e.cause instanceof Error&&!n.includes(e.cause)&&(r.cause=i(e.cause,t,n,u));for(const o in e)if(r[o]===void 0){const a=e[o];r[o]=f(a,n,u,t)}if(Array.isArray(t.exclude)&&t.exclude.length>0)for(const o of t.exclude)try{delete r[o]}catch{}return r},"_serialize"),y=s((e,t={})=>i(e,{exclude:t.exclude??[],maxDepth:t.maxDepth??Number.POSITIVE_INFINITY,useToJSON:t.useToJSON??!1},[],0),"serialize");exports.serialize=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var f=(e,t)=>m(e,"name",{value:t,configurable:!0});import{r as b}from"./index-CLFYRLyq.mjs";const p=Object.create({},{cause:{enumerable:!0,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!0,value:void 0,writable:!0},message:{enumerable:!0,value:void 0,writable:!0},name:{enumerable:!0,value:void 0,writable:!0},stack:{enumerable:!0,value:void 0,writable:!0}});var d=Object.defineProperty,i=f((e,t)=>d(e,"name",{value:t,configurable:!0}),"c");const s=new WeakSet,y=i(e=>{s.add(e);const t=e.toJSON();return s.delete(e),t},"toJSON"),l=i((e,t,n,u)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return t.includes(e)?"[Circular]":(n+=1,c(e,u,t,n));if(u.useToJSON&&typeof e.toJSON=="function")return e.toJSON();if(typeof e=="object"&&e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(b(e)){if(n+=1,u.maxDepth&&n>=u.maxDepth)return{};const r={};for(const o in e)r[o]=l(e[o],t,n,u);return r}try{return e}catch{return"[Not Available]"}},"serializeValue"),c=i((e,t,n,u)=>{if(n.push(e),t.maxDepth===0)return{};if(t.useToJSON&&typeof e.toJSON=="function"&&!s.has(e))return y(e);const r=Object.create(p);if(r.name=Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,r.message=e.message,r.stack=e.stack,Array.isArray(e.errors)){const o=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.includes(a))return r.errors=[],r;o.push(c(a,t,n,u))}r.errors=o}e.cause instanceof Error&&!n.includes(e.cause)&&(r.cause=c(e.cause,t,n,u));for(const o in e)if(r[o]===void 0){const a=e[o];r[o]=l(a,n,u,t)}if(Array.isArray(t.exclude)&&t.exclude.length>0)for(const o of t.exclude)try{delete r[o]}catch{}return r},"_serialize"),S=i((e,t={})=>c(e,{exclude:t.exclude??[],maxDepth:t.maxDepth??Number.POSITIVE_INFINITY,useToJSON:t.useToJSON??!1},[],0),"serialize");export{S as serialize};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=(e,i)=>o(e,"name",{value:i,configurable:!0});var s=Object.defineProperty,a=n((e,i)=>s(e,"name",{value:i,configurable:!0}),"t");const r=a(({applicationType:e,error:i,file:t})=>`You are a very skilled ${t.language} programmer.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
const aiPrompt = /* @__PURE__ */ __name(({
|
|
6
|
-
applicationType,
|
|
7
|
-
error,
|
|
8
|
-
file
|
|
9
|
-
}) => `You are a very skilled ${file.language} programmer.
|
|
10
|
-
|
|
11
|
-
${applicationType ? `You are working on a ${applicationType} application.` : ""}
|
|
3
|
+
${e?`You are working on a ${e} application.`:""}
|
|
12
4
|
|
|
13
5
|
Use the following context to find a possible fix for the exception message at the end. Limit your answer to 4 or 5 sentences. Also include a few links to documentation that might help.
|
|
14
6
|
|
|
@@ -25,18 +17,16 @@ ENDLINKS
|
|
|
25
17
|
|
|
26
18
|
Here comes the context and the exception message:
|
|
27
19
|
|
|
28
|
-
Line: ${
|
|
20
|
+
Line: ${t.line}
|
|
29
21
|
|
|
30
22
|
File:
|
|
31
|
-
${
|
|
23
|
+
${t.file}
|
|
32
24
|
|
|
33
25
|
Snippet including line numbers:
|
|
34
|
-
${
|
|
26
|
+
${t.snippet}
|
|
35
27
|
|
|
36
28
|
Exception class:
|
|
37
|
-
${
|
|
29
|
+
${i.name}
|
|
38
30
|
|
|
39
31
|
Exception message:
|
|
40
|
-
${
|
|
41
|
-
|
|
42
|
-
module.exports = aiPrompt;
|
|
32
|
+
${i.message}`,"aiPrompt");module.exports=r;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const aiPrompt = /* @__PURE__ */ __name(({
|
|
4
|
-
applicationType,
|
|
5
|
-
error,
|
|
6
|
-
file
|
|
7
|
-
}) => `You are a very skilled ${file.language} programmer.
|
|
1
|
+
var o=Object.defineProperty;var n=(e,i)=>o(e,"name",{value:i,configurable:!0});var a=Object.defineProperty,l=n((e,i)=>a(e,"name",{value:i,configurable:!0}),"t");const r=l(({applicationType:e,error:i,file:t})=>`You are a very skilled ${t.language} programmer.
|
|
8
2
|
|
|
9
|
-
${
|
|
3
|
+
${e?`You are working on a ${e} application.`:""}
|
|
10
4
|
|
|
11
5
|
Use the following context to find a possible fix for the exception message at the end. Limit your answer to 4 or 5 sentences. Also include a few links to documentation that might help.
|
|
12
6
|
|
|
@@ -23,18 +17,16 @@ ENDLINKS
|
|
|
23
17
|
|
|
24
18
|
Here comes the context and the exception message:
|
|
25
19
|
|
|
26
|
-
Line: ${
|
|
20
|
+
Line: ${t.line}
|
|
27
21
|
|
|
28
22
|
File:
|
|
29
|
-
${
|
|
23
|
+
${t.file}
|
|
30
24
|
|
|
31
25
|
Snippet including line numbers:
|
|
32
|
-
${
|
|
26
|
+
${t.snippet}
|
|
33
27
|
|
|
34
28
|
Exception class:
|
|
35
|
-
${
|
|
29
|
+
${i.name}
|
|
36
30
|
|
|
37
31
|
Exception message:
|
|
38
|
-
${
|
|
39
|
-
|
|
40
|
-
export { aiPrompt as default };
|
|
32
|
+
${i.message}`,"aiPrompt");export{r as default};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const aiFinder = require('../../packem_shared/aiFinder-BR9Pq804.cjs');
|
|
6
|
-
const solution_ai_aiPrompt = require('./ai-prompt.cjs');
|
|
7
|
-
const aiSolutionResponse = require('../../packem_shared/aiSolutionResponse-Cqi0mFxy.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.aiFinder = aiFinder;
|
|
12
|
-
exports.aiPrompt = solution_ai_aiPrompt;
|
|
13
|
-
exports.aiSolutionResponse = aiSolutionResponse;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../packem_shared/aiFinder-CN0pneE2.cjs"),i=require("./ai-prompt.cjs"),o=require("../../packem_shared/aiSolutionResponse-C5apAmTu.cjs");exports.aiFinder=e;exports.aiPrompt=i;exports.aiSolutionResponse=o;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as aiPrompt } from './ai-prompt.mjs';
|
|
3
|
-
export { default as aiSolutionResponse } from '../../packem_shared/aiSolutionResponse-BaN1M990.mjs';
|
|
1
|
+
import{default as e}from"../../packem_shared/aiFinder-Be-xHFVO.mjs";import{default as t}from"./ai-prompt.mjs";import{default as i}from"../../packem_shared/aiSolutionResponse-RD0AK1jh.mjs";export{e as aiFinder,t as aiPrompt,i as aiSolutionResponse};
|
package/dist/solution/index.cjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const errorHintFinder = require('../packem_shared/errorHintFinder-DZugFHq0.cjs');
|
|
6
|
-
const ruleBasedFinder = require('../packem_shared/ruleBasedFinder-CkybTSHw.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.errorHintFinder = errorHintFinder;
|
|
11
|
-
exports.ruleBasedFinder = ruleBasedFinder;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../packem_shared/errorHintFinder-DRCn1Ysx.cjs"),r=require("../packem_shared/ruleBasedFinder-B1jRHBM_.cjs");exports.errorHintFinder=e;exports.ruleBasedFinder=r;
|
package/dist/solution/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as ruleBasedFinder } from '../packem_shared/ruleBasedFinder-Cbmc6N7f.mjs';
|
|
1
|
+
import{default as a}from"../packem_shared/errorHintFinder-C_g0nvml.mjs";import{default as o}from"../packem_shared/ruleBasedFinder-P88d0gpK.mjs";export{a as errorHintFinder,o as ruleBasedFinder};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const parseStacktrace = require('../packem_shared/parseStacktrace-woJgU2XY.cjs');
|
|
6
|
-
const formatStackFrameLine = require('../packem_shared/formatStackFrameLine-DcXSX--m.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.parseStacktrace = parseStacktrace;
|
|
11
|
-
exports.formatStackFrameLine = formatStackFrameLine.formatStackFrameLine;
|
|
12
|
-
exports.formatStacktrace = formatStackFrameLine.formatStacktrace;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../packem_shared/parseStacktrace-MW4-SLXl.cjs"),e=require("../packem_shared/formatStackFrameLine-DD2DUdW0.cjs");exports.parseStacktrace=a;exports.formatStackFrameLine=e.formatStackFrameLine;exports.formatStacktrace=e.formatStacktrace;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { formatStackFrameLine, formatStacktrace } from '../packem_shared/formatStackFrameLine-DqkmKWH3.mjs';
|
|
1
|
+
import{default as t}from"../packem_shared/parseStacktrace-Dnxnc4PL.mjs";import{formatStackFrameLine as o,formatStacktrace as c}from"../packem_shared/formatStackFrameLine-iU54KA81.mjs";export{o as formatStackFrameLine,c as formatStacktrace,t as parseStacktrace};
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
class NonError extends Error {
|
|
4
|
-
static {
|
|
5
|
-
__name(this, "NonError");
|
|
6
|
-
}
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "NonError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { NonError as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
class NonError extends Error {
|
|
6
|
-
static {
|
|
7
|
-
__name(this, "NonError");
|
|
8
|
-
}
|
|
9
|
-
constructor(message) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.name = "NonError";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = NonError;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const defaultErrorConstructors = /* @__PURE__ */ new Map([
|
|
4
|
-
["Error", Error],
|
|
5
|
-
["EvalError", EvalError],
|
|
6
|
-
["RangeError", RangeError],
|
|
7
|
-
["ReferenceError", ReferenceError],
|
|
8
|
-
["SyntaxError", SyntaxError],
|
|
9
|
-
["TypeError", TypeError],
|
|
10
|
-
["URIError", URIError]
|
|
11
|
-
]);
|
|
12
|
-
if (typeof AggregateError !== "undefined") {
|
|
13
|
-
defaultErrorConstructors.set("AggregateError", AggregateError);
|
|
14
|
-
}
|
|
15
|
-
const addKnownErrorConstructor = /* @__PURE__ */ __name((constructor, name) => {
|
|
16
|
-
let instance;
|
|
17
|
-
try {
|
|
18
|
-
instance = new constructor();
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw new Error(`The error constructor "${constructor.name}" is not compatible`, { cause: error });
|
|
21
|
-
}
|
|
22
|
-
const resolvedName = name ?? instance.name;
|
|
23
|
-
if (defaultErrorConstructors.has(resolvedName)) {
|
|
24
|
-
throw new Error(`The error constructor "${resolvedName}" is already known.`);
|
|
25
|
-
}
|
|
26
|
-
defaultErrorConstructors.set(resolvedName, constructor);
|
|
27
|
-
}, "addKnownErrorConstructor");
|
|
28
|
-
const getKnownErrorConstructors = /* @__PURE__ */ __name(() => new Map(defaultErrorConstructors), "getKnownErrorConstructors");
|
|
29
|
-
const getErrorConstructor = /* @__PURE__ */ __name((name) => defaultErrorConstructors.get(name), "getErrorConstructor");
|
|
30
|
-
const isErrorLike = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && typeof value.name === "string" && typeof value.message === "string" && (getErrorConstructor(value.name) !== void 0 || value.name === "Error"), "isErrorLike");
|
|
31
|
-
|
|
32
|
-
export { addKnownErrorConstructor, getErrorConstructor, getKnownErrorConstructors, isErrorLike };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
const defaultErrorConstructors = /* @__PURE__ */ new Map([
|
|
8
|
-
["Error", Error],
|
|
9
|
-
["EvalError", EvalError],
|
|
10
|
-
["RangeError", RangeError],
|
|
11
|
-
["ReferenceError", ReferenceError],
|
|
12
|
-
["SyntaxError", SyntaxError],
|
|
13
|
-
["TypeError", TypeError],
|
|
14
|
-
["URIError", URIError]
|
|
15
|
-
]);
|
|
16
|
-
if (typeof AggregateError !== "undefined") {
|
|
17
|
-
defaultErrorConstructors.set("AggregateError", AggregateError);
|
|
18
|
-
}
|
|
19
|
-
const addKnownErrorConstructor = /* @__PURE__ */ __name((constructor, name) => {
|
|
20
|
-
let instance;
|
|
21
|
-
try {
|
|
22
|
-
instance = new constructor();
|
|
23
|
-
} catch (error) {
|
|
24
|
-
throw new Error(`The error constructor "${constructor.name}" is not compatible`, { cause: error });
|
|
25
|
-
}
|
|
26
|
-
const resolvedName = name ?? instance.name;
|
|
27
|
-
if (defaultErrorConstructors.has(resolvedName)) {
|
|
28
|
-
throw new Error(`The error constructor "${resolvedName}" is already known.`);
|
|
29
|
-
}
|
|
30
|
-
defaultErrorConstructors.set(resolvedName, constructor);
|
|
31
|
-
}, "addKnownErrorConstructor");
|
|
32
|
-
const getKnownErrorConstructors = /* @__PURE__ */ __name(() => new Map(defaultErrorConstructors), "getKnownErrorConstructors");
|
|
33
|
-
const getErrorConstructor = /* @__PURE__ */ __name((name) => defaultErrorConstructors.get(name), "getErrorConstructor");
|
|
34
|
-
const isErrorLike = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && typeof value.name === "string" && typeof value.message === "string" && (getErrorConstructor(value.name) !== void 0 || value.name === "Error"), "isErrorLike");
|
|
35
|
-
|
|
36
|
-
exports.addKnownErrorConstructor = addKnownErrorConstructor;
|
|
37
|
-
exports.getErrorConstructor = getErrorConstructor;
|
|
38
|
-
exports.getKnownErrorConstructors = getKnownErrorConstructors;
|
|
39
|
-
exports.isErrorLike = isErrorLike;
|