@visulima/error 4.5.0 → 4.6.1
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 +25 -0
- package/README.md +148 -4
- package/dist/code-frame/index.cjs +6 -135
- package/dist/code-frame/index.mjs +6 -130
- package/dist/error/index.cjs +1 -18
- package/dist/error/index.d.cts +19 -1
- package/dist/error/index.d.mts +19 -1
- package/dist/error/index.d.ts +19 -1
- package/dist/error/index.mjs +1 -5
- package/dist/index.cjs +1 -36
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -13
- 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-DTyLJeCs.cjs +35 -0
- package/dist/packem_shared/ruleBasedFinder-W5UXhtHl.mjs +35 -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.d.cts +2 -2
- package/dist/solution/ai/index.d.mts +2 -2
- package/dist/solution/ai/index.d.ts +2 -2
- 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.d.cts +2 -2
- package/dist/stacktrace/index.d.mts +2 -2
- package/dist/stacktrace/index.d.ts +2 -2
- package/dist/stacktrace/index.mjs +1 -2
- package/package.json +1 -1
- package/dist/packem_shared/aiFinder-BGfwKKxE.cjs +0 -263
- package/dist/packem_shared/aiFinder-Bk1vt0_x.mjs +0 -261
- package/dist/packem_shared/aiSolutionResponse-BPckbL56.cjs +0 -37
- package/dist/packem_shared/aiSolutionResponse-bDi4ad8f.mjs +0 -35
- package/dist/packem_shared/captureRawStackTrace-ClSI1tHb.cjs +0 -14
- package/dist/packem_shared/captureRawStackTrace-Tl3Rqkat.mjs +0 -12
- 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/indexToLineColumn-DjmjeiIY.cjs +0 -56
- package/dist/packem_shared/indexToLineColumn-Dx91YDU1.mjs +0 -54
- package/dist/packem_shared/isVisulimaError-BVLWvREw.cjs +0 -45
- package/dist/packem_shared/isVisulimaError-H6TqEA42.mjs +0 -40
- package/dist/packem_shared/parseStacktrace-6pFoXW43.cjs +0 -282
- package/dist/packem_shared/parseStacktrace-BKGoWCwC.mjs +0 -280
- package/dist/packem_shared/renderError-BWpM2m6k.mjs +0 -165
- package/dist/packem_shared/renderError-CXZTAXig.cjs +0 -169
- package/dist/packem_shared/ruleBasedFinder-BYrndubA.mjs +0 -227
- package/dist/packem_shared/ruleBasedFinder-y_-5kbeT.cjs +0 -229
- package/dist/packem_shared/serializeError-CT7s0Ffk.cjs +0 -157
- package/dist/packem_shared/serializeError-DusTUACt.mjs +0 -153
package/dist/index.cjs
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const codeFrame_index = require('./code-frame/index.cjs');
|
|
6
|
-
const indexToLineColumn = require('./packem_shared/indexToLineColumn-DjmjeiIY.cjs');
|
|
7
|
-
const solution_ai_aiPrompt = require('./solution/ai/ai-prompt.cjs');
|
|
8
|
-
const aiSolutionResponse = require('./packem_shared/aiSolutionResponse-BPckbL56.cjs');
|
|
9
|
-
const errorHintFinder = require('./packem_shared/errorHintFinder-DZugFHq0.cjs');
|
|
10
|
-
const ruleBasedFinder = require('./packem_shared/ruleBasedFinder-y_-5kbeT.cjs');
|
|
11
|
-
const captureRawStackTrace = require('./packem_shared/captureRawStackTrace-ClSI1tHb.cjs');
|
|
12
|
-
const getErrorCauses = require('./packem_shared/getErrorCauses-miTeYJEG.cjs');
|
|
13
|
-
const parseStacktrace = require('./packem_shared/parseStacktrace-6pFoXW43.cjs');
|
|
14
|
-
const isVisulimaError = require('./packem_shared/isVisulimaError-BVLWvREw.cjs');
|
|
15
|
-
const renderError = require('./packem_shared/renderError-CXZTAXig.cjs');
|
|
16
|
-
const serializeError = require('./packem_shared/serializeError-CT7s0Ffk.cjs');
|
|
17
|
-
const formatStackFrameLine = require('./packem_shared/formatStackFrameLine-DcXSX--m.cjs');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exports.CODE_FRAME_POINTER = codeFrame_index.CODE_FRAME_POINTER;
|
|
22
|
-
exports.codeFrame = codeFrame_index.codeFrame;
|
|
23
|
-
exports.indexToLineColumn = indexToLineColumn;
|
|
24
|
-
exports.aiPrompt = solution_ai_aiPrompt;
|
|
25
|
-
exports.aiSolutionResponse = aiSolutionResponse;
|
|
26
|
-
exports.errorHintFinder = errorHintFinder;
|
|
27
|
-
exports.ruleBasedFinder = ruleBasedFinder;
|
|
28
|
-
exports.captureRawStackTrace = captureRawStackTrace;
|
|
29
|
-
exports.getErrorCauses = getErrorCauses;
|
|
30
|
-
exports.parseStacktrace = parseStacktrace;
|
|
31
|
-
exports.VisulimaError = isVisulimaError.VisulimaError;
|
|
32
|
-
exports.isVisulimaError = isVisulimaError.isVisulimaError;
|
|
33
|
-
exports.renderError = renderError.renderError;
|
|
34
|
-
exports.serializeError = serializeError.serialize;
|
|
35
|
-
exports.formatStackFrameLine = formatStackFrameLine.formatStackFrameLine;
|
|
36
|
-
exports.formatStacktrace = formatStackFrameLine.formatStacktrace;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./code-frame/index.cjs"),a=require("./packem_shared/indexToLineColumn-C_v57REF.cjs"),t=require("./solution/ai/ai-prompt.cjs"),u=require("./packem_shared/aiSolutionResponse-C5apAmTu.cjs"),n=require("./packem_shared/errorHintFinder-DRCn1Ysx.cjs"),s=require("./packem_shared/ruleBasedFinder-DTyLJeCs.cjs"),E=require("./packem_shared/captureRawStackTrace-B9d1821F.cjs"),c=require("./packem_shared/deserializeError-2C6o7QF7.cjs"),d=require("./packem_shared/getErrorCauses-B7_Z_gEF.cjs"),l=require("./packem_shared/NonError-CQn4sdxd.cjs"),m=require("./packem_shared/parseStacktrace-MW4-SLXl.cjs"),e=require("./packem_shared/addKnownErrorConstructor-B5dNFGsR.cjs"),i=require("./packem_shared/isVisulimaError-CrvBm0kw.cjs"),q=require("./packem_shared/renderError-D8XJnkIF.cjs"),S=require("./packem_shared/serializeError-7S1IG6zs.cjs"),o=require("./packem_shared/formatStackFrameLine-DD2DUdW0.cjs");exports.CODE_FRAME_POINTER=r.CODE_FRAME_POINTER;exports.codeFrame=r.codeFrame;exports.indexToLineColumn=a;exports.aiPrompt=t;exports.aiSolutionResponse=u;exports.errorHintFinder=n;exports.ruleBasedFinder=s;exports.captureRawStackTrace=E;exports.deserializeError=c;exports.getErrorCauses=d;exports.NonError=l;exports.parseStacktrace=m;exports.addKnownErrorConstructor=e.addKnownErrorConstructor;exports.isErrorLike=e.isErrorLike;exports.VisulimaError=i.VisulimaError;exports.isVisulimaError=i.isVisulimaError;exports.renderError=q.renderError;exports.serializeError=S.serialize;exports.formatStackFrameLine=o.formatStackFrameLine;exports.formatStacktrace=o.formatStacktrace;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { default as aiPrompt } from './solution/ai/ai-prompt.cjs';
|
|
|
3
3
|
export { a as aiSolutionResponse } from './packem_shared/ai-solution-response-BuaDQAEU.cjs';
|
|
4
4
|
export { errorHintFinder, ruleBasedFinder } from './solution/index.cjs';
|
|
5
5
|
export { S as Solution, a as SolutionError, b as SolutionFinder, c as SolutionFinderFile } from './packem_shared/types-BtQS7FHG.cjs';
|
|
6
|
-
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, RenderErrorOptions, SerializedError, VisulimaError, captureRawStackTrace, getErrorCauses, isVisulimaError, renderError, serializeError } from './error/index.cjs';
|
|
6
|
+
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, NonError, RenderErrorOptions, SerializedError, VisulimaError, addKnownErrorConstructor, captureRawStackTrace, deserializeError, getErrorCauses, isErrorLike, isVisulimaError, renderError, serializeError } from './error/index.cjs';
|
|
7
7
|
export { Trace, TraceType, formatStackFrameLine, formatStacktrace, parseStacktrace } from './stacktrace/index.cjs';
|
|
8
8
|
export { C as CodeFrameLocation, a as CodeFrameNodeLocation, b as CodeFrameOptions, c as ColorizeMethod } from './packem_shared/types-CrVmNoPV.cjs';
|
|
9
9
|
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ export { default as aiPrompt } from './solution/ai/ai-prompt.mjs';
|
|
|
3
3
|
export { a as aiSolutionResponse } from './packem_shared/ai-solution-response-BuaDQAEU.mjs';
|
|
4
4
|
export { errorHintFinder, ruleBasedFinder } from './solution/index.mjs';
|
|
5
5
|
export { S as Solution, a as SolutionError, b as SolutionFinder, c as SolutionFinderFile } from './packem_shared/types-BtQS7FHG.mjs';
|
|
6
|
-
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, RenderErrorOptions, SerializedError, VisulimaError, captureRawStackTrace, getErrorCauses, isVisulimaError, renderError, serializeError } from './error/index.mjs';
|
|
6
|
+
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, NonError, RenderErrorOptions, SerializedError, VisulimaError, addKnownErrorConstructor, captureRawStackTrace, deserializeError, getErrorCauses, isErrorLike, isVisulimaError, renderError, serializeError } from './error/index.mjs';
|
|
7
7
|
export { Trace, TraceType, formatStackFrameLine, formatStacktrace, parseStacktrace } from './stacktrace/index.mjs';
|
|
8
8
|
export { C as CodeFrameLocation, a as CodeFrameNodeLocation, b as CodeFrameOptions, c as ColorizeMethod } from './packem_shared/types-CrVmNoPV.mjs';
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { default as aiPrompt } from './solution/ai/ai-prompt.js';
|
|
|
3
3
|
export { a as aiSolutionResponse } from './packem_shared/ai-solution-response-BuaDQAEU.js';
|
|
4
4
|
export { errorHintFinder, ruleBasedFinder } from './solution/index.js';
|
|
5
5
|
export { S as Solution, a as SolutionError, b as SolutionFinder, c as SolutionFinderFile } from './packem_shared/types-BtQS7FHG.js';
|
|
6
|
-
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, RenderErrorOptions, SerializedError, VisulimaError, captureRawStackTrace, getErrorCauses, isVisulimaError, renderError, serializeError } from './error/index.js';
|
|
6
|
+
export { ErrorHint, ErrorLocation, ErrorProperties, ErrorWithCauseSerializerOptions, NonError, RenderErrorOptions, SerializedError, VisulimaError, addKnownErrorConstructor, captureRawStackTrace, deserializeError, getErrorCauses, isErrorLike, isVisulimaError, renderError, serializeError } from './error/index.js';
|
|
7
7
|
export { Trace, TraceType, formatStackFrameLine, formatStacktrace, parseStacktrace } from './stacktrace/index.js';
|
|
8
8
|
export { C as CodeFrameLocation, a as CodeFrameNodeLocation, b as CodeFrameOptions, c as ColorizeMethod } from './packem_shared/types-CrVmNoPV.js';
|
|
9
9
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as indexToLineColumn } from './packem_shared/indexToLineColumn-Dx91YDU1.mjs';
|
|
3
|
-
export { default as aiPrompt } from './solution/ai/ai-prompt.mjs';
|
|
4
|
-
export { default as aiSolutionResponse } from './packem_shared/aiSolutionResponse-bDi4ad8f.mjs';
|
|
5
|
-
export { default as errorHintFinder } from './packem_shared/errorHintFinder-CQy_qIK3.mjs';
|
|
6
|
-
export { default as ruleBasedFinder } from './packem_shared/ruleBasedFinder-BYrndubA.mjs';
|
|
7
|
-
export { default as captureRawStackTrace } from './packem_shared/captureRawStackTrace-Tl3Rqkat.mjs';
|
|
8
|
-
export { default as getErrorCauses } from './packem_shared/getErrorCauses-CG_JRE6j.mjs';
|
|
9
|
-
export { default as parseStacktrace } from './packem_shared/parseStacktrace-BKGoWCwC.mjs';
|
|
10
|
-
export { VisulimaError, isVisulimaError } from './packem_shared/isVisulimaError-H6TqEA42.mjs';
|
|
11
|
-
export { renderError } from './packem_shared/renderError-BWpM2m6k.mjs';
|
|
12
|
-
export { serialize as serializeError } from './packem_shared/serializeError-DusTUACt.mjs';
|
|
13
|
-
export { formatStackFrameLine, formatStacktrace } from './packem_shared/formatStackFrameLine-DqkmKWH3.mjs';
|
|
1
|
+
import{CODE_FRAME_POINTER as o,codeFrame as a}from"./code-frame/index.mjs";import{default as f}from"./packem_shared/indexToLineColumn-B1F7aNZh.mjs";import{default as m}from"./solution/ai/ai-prompt.mjs";import{default as p}from"./packem_shared/aiSolutionResponse-RD0AK1jh.mjs";import{default as l}from"./packem_shared/errorHintFinder-C_g0nvml.mjs";import{default as x}from"./packem_shared/ruleBasedFinder-W5UXhtHl.mjs";import{default as E}from"./packem_shared/captureRawStackTrace-CQPNHvBG.mjs";import{default as k}from"./packem_shared/deserializeError-tzZhIV70.mjs";import{default as S}from"./packem_shared/getErrorCauses-D025FGyO.mjs";import{default as R}from"./packem_shared/NonError-CS10kwil.mjs";import{default as L}from"./packem_shared/parseStacktrace-Dnxnc4PL.mjs";import{addKnownErrorConstructor as w,isErrorLike as N}from"./packem_shared/addKnownErrorConstructor-BqqnTSZp.mjs";import{VisulimaError as P,isVisulimaError as V}from"./packem_shared/isVisulimaError-jVZgumOU.mjs";import{renderError as g}from"./packem_shared/renderError-D7R71d_7.mjs";import{serialize as B}from"./packem_shared/serializeError-Bc-QciX0.mjs";import{formatStackFrameLine as H,formatStacktrace as I}from"./packem_shared/formatStackFrameLine-iU54KA81.mjs";export{o as CODE_FRAME_POINTER,R as NonError,P as VisulimaError,w as addKnownErrorConstructor,m as aiPrompt,p as aiSolutionResponse,E as captureRawStackTrace,a as codeFrame,k as deserializeError,l as errorHintFinder,H as formatStackFrameLine,I as formatStacktrace,S as getErrorCauses,f as indexToLineColumn,N as isErrorLike,V as isVisulimaError,L as parseStacktrace,g as renderError,x as ruleBasedFinder,B as serializeError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var t=(e,r)=>s(e,"name",{value:r,configurable:!0});var o=Object.defineProperty,a=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"s");class n extends Error{static{t(this,"e")}static{a(this,"NonError")}constructor(r){super(r),this.name="NonError"}}module.exports=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});var o=Object.defineProperty,s=t((e,r)=>o(e,"name",{value:r,configurable:!0}),"s");class c extends Error{static{t(this,"e")}static{s(this,"NonError")}constructor(r){super(r),this.name="NonError"}}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var s=(r,o)=>g(r,"name",{value:o,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var u=Object.defineProperty,t=s((r,o)=>u(r,"name",{value:o,configurable:!0}),"n");const e=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&e.set("AggregateError",AggregateError);const i=t((r,o)=>{let a;try{a=new r}catch(c){throw new Error(`The error constructor "${r.name}" is not compatible`,{cause:c})}const n=o??a.name;if(e.has(n))throw new Error(`The error constructor "${n}" is already known.`);e.set(n,r)},"addKnownErrorConstructor"),l=t(()=>new Map(e),"getKnownErrorConstructors"),E=t(r=>e.get(r),"getErrorConstructor"),w=t(r=>r!==null&&typeof r=="object"&&typeof r.name=="string"&&typeof r.message=="string"&&(E(r.name)!==void 0||r.name==="Error"),"isErrorLike");exports.addKnownErrorConstructor=i;exports.getErrorConstructor=E;exports.getKnownErrorConstructors=l;exports.isErrorLike=w;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var E=(r,o)=>c(r,"name",{value:o,configurable:!0});var g=Object.defineProperty,t=E((r,o)=>g(r,"name",{value:o,configurable:!0}),"n");const e=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&e.set("AggregateError",AggregateError);const w=t((r,o)=>{let a;try{a=new r}catch(s){throw new Error(`The error constructor "${r.name}" is not compatible`,{cause:s})}const n=o??a.name;if(e.has(n))throw new Error(`The error constructor "${n}" is already known.`);e.set(n,r)},"addKnownErrorConstructor"),p=t(()=>new Map(e),"getKnownErrorConstructors"),u=t(r=>e.get(r),"getErrorConstructor"),y=t(r=>r!==null&&typeof r=="object"&&typeof r.name=="string"&&typeof r.message=="string"&&(u(r.name)!==void 0||r.name==="Error"),"isErrorLike");export{w as addKnownErrorConstructor,u as getErrorConstructor,p as getKnownErrorConstructors,y as isErrorLike};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Pt=Object.defineProperty;var W=(n,o)=>Pt(n,"name",{value:o,configurable:!0});import{createHash as _t}from"node:crypto";import{existsSync as xe,readFileSync as It,mkdirSync as Zt,writeFileSync as Dt}from"node:fs";import{tmpdir as Et}from"node:os";import{generateText as Ft}from"ai";import Nt from"../solution/ai/ai-prompt.mjs";import J from"./aiSolutionResponse-RD0AK1jh.mjs";var Bt=Object.defineProperty,H=W((n,o)=>Bt(n,"name",{value:o,configurable:!0}),"I"),Rt=Object.defineProperty,u=H((n,o)=>Rt(n,"name",{value:o,configurable:!0}),"__name$2");let de=u(()=>{var n=(()=>{var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,m=u((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},"J"),b=u((e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&o(e,i,{get:u(()=>t[i],"get"),enumerable:!(s=a(t,i))||s.enumerable});return e},"T"),g=u(e=>b(o({},"__esModule",{value:!0}),e),"W"),C={};m(C,{zeptomatch:u(()=>Mt,"zeptomatch")});var w=u(e=>Array.isArray(e),"k"),x=u(e=>typeof e=="function","x"),O=u(e=>e.length===0,"K"),_=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return r=>(r.length===0||r.length===1)&&t.test(e.call(r))})(),we=u(e=>typeof e=="number","Y"),je=u(e=>typeof e=="object"&&e!==null,"rr"),Ae=u(e=>e instanceof RegExp,"er"),Oe=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Me=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),Y=u(e=>typeof e=="string","M"),M=u(e=>e===void 0,"f"),ze=u(e=>{const t=new Map;return r=>{const s=t.get(r);if(s!==void 0)return s;const i=e(r);return t.set(r,i),i}},"ar"),ke=u((e,t,r={})=>{const s={cache:{},input:e,index:0,indexBacktrackMax:0,options:r,output:[]},i=z(t)(s),f=Math.max(s.index,s.indexBacktrackMax);if(i&&s.index===e.length)return s.output;throw new Error(`Failed to parse at index ${f}`)},"or"),c=u((e,t)=>w(e)?Ce(e,t):Y(e)?Q(e,t):Se(e,t),"o"),Ce=u((e,t)=>{const r={};for(const s of e){if(s.length!==1)throw new Error(`Invalid character: "${s}"`);const i=s.charCodeAt(0);r[i]=!0}return s=>{const i=s.input;let f=s.index,p=f;for(;p<i.length&&i.charCodeAt(p)in r;)p+=1;if(p>f){if(!M(t)&&!s.options.silent){const h=i.slice(f,p),y=x(t)?t(h,i,`${f}`):t;M(y)||s.output.push(y)}s.index=p}return!0}},"ir"),Se=u((e,t)=>{if(Me(e))return Q(e.source,t);{const r=e.source,s=e.flags.replace(/y|$/,"y"),i=new RegExp(r,s);return Oe(e)&&x(t)&&!_(t)?Pe(i,t):_e(i,t)}},"ur"),Pe=u((e,t)=>r=>{const s=r.index,i=r.input;e.lastIndex=s;const f=e.exec(i);if(f){const p=e.lastIndex;if(!r.options.silent){const h=t(...f,i,`${s}`);M(h)||r.output.push(h)}return r.index=p,!0}else return!1},"sr"),_e=u((e,t)=>r=>{const s=r.index,i=r.input;if(e.lastIndex=s,e.test(i)){const f=e.lastIndex;if(!M(t)&&!r.options.silent){const p=x(t)?t(i.slice(s,f),i,`${s}`):t;M(p)||r.output.push(p)}return r.index=f,!0}else return!1},"cr"),Q=u((e,t)=>r=>{const s=r.index,i=r.input;if(i.startsWith(e,s)){if(!M(t)&&!r.options.silent){const f=x(t)?t(e,i,`${s}`):t;M(f)||r.output.push(f)}return r.index+=e.length,!0}else return!1},"R"),V=u((e,t,r,s)=>{const i=z(e),f=t>1;return B(N(X(p=>{let h=0;for(;h<r;){const y=p.index;if(!i(p)||(h+=1,p.index===y))break}return h>=t},f),s))},"O"),Ie=u((e,t)=>V(e,0,1,t),"lr"),D=u((e,t)=>V(e,0,1/0,t),"m"),E=u((e,t)=>{const r=e.map(z);return B(N(X(s=>{for(let i=0,f=r.length;i<f;i++)if(!r[i](s))return!1;return!0}),t))},"_"),j=u((e,t)=>{const r=e.map(z);return B(N(s=>{for(let i=0,f=r.length;i<f;i++)if(r[i](s))return!0;return!1},t))},"p"),X=u((e,t=!0,r=!1)=>{const s=z(e);return t?i=>{const f=i.index,p=i.output.length,h=s(i);return!h&&!r&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!h||r)&&(i.index=f,i.output.length!==p&&(i.output.length=p)),h}:s},"P"),N=u((e,t)=>{const r=z(e);return t?s=>{if(s.options.silent)return r(s);const i=s.output.length;if(r(s)){const f=s.output.splice(i,1/0),p=t(f);return M(p)||s.output.push(p),!0}else return!1}:r},"C"),B=(()=>{let e=0;return t=>{const r=z(t),s=e+=1;return i=>{var f;if(i.options.memoization===!1)return r(i);const p=i.index,h=(f=i.cache)[s]||(f[s]={indexMax:-1,queue:[]}),y=h.queue;if(p<=h.indexMax){const I=h.store||(h.store=new Map);if(y.length){for(let P=0,kt=y.length;P<kt;P+=2){const Ct=y[P*2],St=y[P*2+1];I.set(Ct,St)}y.length=0}const v=I.get(p);if(v===!1)return!1;if(we(v))return i.index=v,!0;if(v)return i.index=v.index,v.output?.length&&i.output.push(...v.output),!0}const pe=i.output.length,zt=r(i);if(h.indexMax=Math.max(h.indexMax,p),zt){const I=i.index,v=i.output.length;if(v>pe){const P=i.output.slice(pe,v);y.push(p,{index:I,output:P})}else y.push(p,I);return!0}else return y.push(p,!1),!1}}})(),ee=u(e=>{let t;return r=>(t||(t=z(e())),t(r))},"A"),z=ze(e=>{if(x(e))return O(e)?ee(e):e;if(Y(e)||Ae(e))return c(e);if(w(e))return E(e);if(je(e))return j(Object.values(e));throw new Error("Invalid rule")}),A=u(e=>e,"v"),te=u(e=>t=>ke(t,e,{memoization:!1}).join(""),"z"),Ze=u(e=>{const t={};return r=>t[r]??(t[r]=e(r))},"pr"),ne="abcdefghijklmnopqrstuvwxyz",De=u(e=>{let t="";for(;e>0;){const r=(e-1)%26;t=ne[r]+t,e=Math.floor((e-1)/26)}return t},"vr"),re=u(e=>{let t=0;for(let r=0,s=e.length;r<s;r++)t=t*26+ne.indexOf(e[r])+1;return t},"N"),R=u((e,t)=>{if(t<e)return R(t,e);const r=[];for(;e<=t;)r.push(e++);return r},"$"),Ee=u((e,t,r)=>R(e,t).map(s=>String(s).padStart(r,"0")),"fr"),oe=u((e,t)=>R(re(e),re(t)).map(De),"j"),T=c(/\\./,A),Fe=c(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),Ne=c(/./,A),Be=c(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${fe(t)}$).*?`),Re=c(/^(!!)+/,""),Te=j([Be,Re]),We=c(/\/(\*\*\/)+/,"(?:[\\\\/].+[\\\\/]|[\\\\/])"),Je=c(/^(\*\*\/)+/,"(?:^|.*[\\\\/])"),Le=c(/\/(\*\*)$/,"(?:[\\\\/].*|$)"),qe=c(/\*\*/,".*"),ie=j([We,Je,Le,qe]),Ke=c(/\*\/(?!\*\*\/|\*$)/,"[^\\\\/]*[\\\\/]"),Ue=c(/\*/,"[^\\\\/]*"),ae=j([Ke,Ue]),se=c("?","[^\\\\/]"),Ge=c("[",A),He=c("]",A),Ye=c(/[!^]/,"^\\\\/"),Qe=c(/[a-z]-[a-z]|[0-9]-[0-9]/i,A),Ve=c(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Xe=c(/[^\]]/,A),et=j([T,Ve,Qe,Xe]),le=E([Ge,Ie(Ye),D(et),He]),tt=c("{","(?:"),nt=c("}",")"),rt=c(/(\d+)\.\.(\d+)/,(e,t,r)=>Ee(+t,+r,Math.min(t.length,r.length)).join("|")),ot=c(/([a-z]+)\.\.([a-z]+)/,(e,t,r)=>oe(t,r).join("|")),it=c(/([A-Z]+)\.\.([A-Z]+)/,(e,t,r)=>oe(t.toLowerCase(),r.toLowerCase()).join("|").toUpperCase()),at=j([rt,ot,it]),ue=E([tt,at,nt]),st=c("{","(?:"),lt=c("}",")"),ut=c(",","|"),ct=c(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),ft=c(/[^}]/,A),pt=ee(()=>ce),dt=j([ie,ae,se,le,ue,pt,T,ct,ut,ft]),ce=E([st,D(dt),lt]),ht=D(j([Te,ie,ae,se,le,ue,ce,T,Fe,Ne])),gt=ht,mt=te(gt),fe=mt,xt=c(/\\./,A),$t=c(/./,A),yt=c(/\*\*\*+/,"*"),bt=c(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),vt=c(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),wt=D(j([xt,yt,bt,vt,$t])),jt=wt,At=te(jt),Ot=At,F=u((e,t)=>Array.isArray(e)?e.map(F.compile).some(r=>r.test(t)):F.compile(e).test(t),"S");F.compile=Ze(e=>new RegExp(`^${fe(Ot(e))}[\\\\/]?$`,"s"));var Mt=F;return g(C)})();return n.default||n},"_lazyMatch"),L;const Tt=u((n,o)=>(L||(L=de(),de=null),L(n,o)),"default");var Wt=Object.defineProperty,Jt=H((n,o)=>Wt(n,"name",{value:o,configurable:!0}),"__name$1");const Lt=/^[A-Z]:\//i,S=Jt((n="")=>n&&n.replaceAll("\\","/").replace(Lt,o=>o.toUpperCase()),"normalizeWindowsPath");var qt=Object.defineProperty,$=H((n,o)=>qt(n,"name",{value:o,configurable:!0}),"__name");const Kt=/^[/\\]{2}/,Ut=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,$e=/^[A-Z]:$/i,he=/^\/([A-Z]:)?$/i,Gt=/.(\.[^./]+)$/,Ht=/^[/\\]|^[a-z]:[/\\]/i,Yt=$(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),ye=$((n,o)=>{let a="",l=0,d=-1,m=0,b=null;for(let g=0;g<=n.length;++g){if(g<n.length)b=n[g];else{if(b==="/")break;b="/"}if(b==="/"){if(!(d===g-1||m===1))if(m===2){if(a.length<2||l!==2||!a.endsWith(".")||a.at(-2)!=="."){if(a.length>2){const C=a.lastIndexOf("/");C===-1?(a="",l=0):(a=a.slice(0,C),l=a.length-1-a.lastIndexOf("/")),d=g,m=0;continue}else if(a.length>0){a="",l=0,d=g,m=0;continue}}o&&(a+=a.length>0?"/..":"..",l=2)}else a.length>0?a+=`/${n.slice(d+1,g)}`:a=n.slice(d+1,g),l=g-d-1;d=g,m=0}else b==="."&&m!==-1?++m:m=-1}return a},"normalizeString"),Z=$(n=>Ut.test(n),"isAbsolute"),be=$(function(n){if(n.length===0)return".";n=S(n);const o=Kt.exec(n),a=Z(n),l=n.at(-1)==="/";return n=ye(n,!a),n.length===0?a?"/":l?"./":".":(l&&(n+="/"),$e.test(n)&&(n+="/"),o?a?`//${n}`:`//./${n}`:a&&!Z(n)?`/${n}`:n)},"normalize"),ve=$((...n)=>{let o="";for(const a of n)if(a)if(o.length>0){const l=o[o.length-1]==="/",d=a[0]==="/";l&&d?o+=a.slice(1):o+=l||d?a:`/${a}`}else o+=a;return be(o)},"join"),G=$(function(...n){n=n.map(l=>S(l));let o="",a=!1;for(let l=n.length-1;l>=-1&&!a;l--){const d=l>=0?n[l]:Yt();!d||d.length===0||(o=`${d}/${o}`,a=Z(d))}return o=ye(o,!a),a&&!Z(o)?`/${o}`:o.length>0?o:"."},"resolve");$(function(n){return S(n)},"toNamespacedPath");const Qt=$(function(n){return Gt.exec(S(n))?.[1]??""},"extname");$(function(n,o){const a=G(n).replace(he,"$1").split("/"),l=G(o).replace(he,"$1").split("/");if(l[0][1]===":"&&a[0][1]===":"&&a[0]!==l[0])return l.join("/");const d=[...a];for(const m of d){if(l[0]!==m)break;a.shift(),l.shift()}return[...a.map(()=>".."),...l].join("/")},"relative");const Vt=$(n=>{const o=S(n).replace(/\/$/,"").split("/").slice(0,-1);return o.length===1&&$e.test(o[0])&&(o[0]+="/"),o.join("/")||(Z(n)?"/":".")},"dirname");$(function(n){const o=[n.root,n.dir,n.base??n.name+n.ext].filter(Boolean);return S(n.root?G(...o):o.join("/"))},"format");const Xt=$((n,o)=>{const a=S(n).split("/").pop();return o&&a.endsWith(o)?a.slice(0,-o.length):a},"basename");$(function(n){const o=Ht.exec(n)?.[0]?.replace(/\\/g,"/")??"",a=Xt(n),l=Qt(a);return{base:a,dir:Vt(n),ext:l,name:a.slice(0,a.length-l.length),root:o}},"parse");$((n,o)=>Tt(o,be(n)),"matchesGlob");var en=Object.defineProperty,k=W((n,o)=>en(n,"name",{value:o,configurable:!0}),"i");const q="## Ai Generated Solution",ge="Creation of a AI solution failed.",K=k((n,o,a)=>{const l={error:{message:n.message,name:n.name,stack:n.stack},file:{file:o.file,language:o.language,line:o.line,snippet:o.snippet},temperature:a};return _t("sha256").update(JSON.stringify(l)).digest("hex")},"generateCacheKey"),tn=k(n=>n||ve(Et(),"visulima-error-cache"),"getCacheDirectory"),nn=k(n=>{xe(n)||Zt(n,{recursive:!0})},"ensureCacheDirectory"),U=k((n,o)=>ve(n,`${o}.json`),"getCacheFilePath"),rn=k((n,o)=>{try{if(!xe(n))return;const a=It(n,"utf8"),l=JSON.parse(a);return Date.now()-l.timestamp>o?void 0:l.solution}catch{return}},"readFromCache"),me=k((n,o,a)=>{try{const l={solution:o,timestamp:Date.now(),ttl:a};Dt(n,JSON.stringify(l,null,2),"utf8")}catch{}},"writeToCache"),pn=k((n,o)=>({handle:k(async(a,l)=>{const d=o?.cache,m=o?.temperature??0,b=d?.ttl??1440*60*1e3,g=tn(d?.directory);if(d?.enabled!==!1){const w=K(a,l,m),x=U(g,w),O=rn(x,b);if(O)return O;nn(g)}const C=Nt({applicationType:void 0,error:a,file:l});try{const w=(await Ft({model:n,prompt:C,temperature:m})).text;let x;if(w?x={body:J(w),header:q}:x={body:J(ge),header:q},d?.enabled!==!1){const O=K(a,l,m),_=U(g,O);me(_,x,b)}return x}catch(w){console.error(w);const x={body:J(ge),header:q};if(d?.enabled!==!1){const O=K(a,l,m),_=U(g,O);me(_,x,b)}return x}},"handle"),name:"AI SDK",priority:99}),"aiFinder");export{pn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Ct=Object.defineProperty;var W=(n,o)=>Ct(n,"name",{value:o,configurable:!0});const Pt=require("node:crypto"),Z=require("node:fs"),It=require("node:os"),Zt=require("ai"),qt=require("../solution/ai/ai-prompt.cjs"),J=require("./aiSolutionResponse-C5apAmTu.cjs");var Dt=Object.defineProperty,Y=W((n,o)=>Dt(n,"name",{value:o,configurable:!0}),"I"),Et=Object.defineProperty,l=Y((n,o)=>Et(n,"name",{value:o,configurable:!0}),"__name$2");let he=l(()=>{var n=(()=>{var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,m=l((e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},"J"),b=l((e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!d.call(e,i)&&i!==r&&o(e,i,{get:l(()=>t[i],"get"),enumerable:!(a=s(t,i))||a.enumerable});return e},"T"),g=l(e=>b(o({},"__esModule",{value:!0}),e),"W"),k={};m(k,{zeptomatch:l(()=>Mt,"zeptomatch")});var w=l(e=>Array.isArray(e),"k"),x=l(e=>typeof e=="function","x"),O=l(e=>e.length===0,"K"),P=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return r=>(r.length===0||r.length===1)&&t.test(e.call(r))})(),we=l(e=>typeof e=="number","Y"),je=l(e=>typeof e=="object"&&e!==null,"rr"),Ae=l(e=>e instanceof RegExp,"er"),Oe=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Me=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),Q=l(e=>typeof e=="string","M"),M=l(e=>e===void 0,"f"),ze=l(e=>{const t=new Map;return r=>{const a=t.get(r);if(a!==void 0)return a;const i=e(r);return t.set(r,i),i}},"ar"),_e=l((e,t,r={})=>{const a={cache:{},input:e,index:0,indexBacktrackMax:0,options:r,output:[]},i=z(t)(a),f=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===e.length)return a.output;throw new Error(`Failed to parse at index ${f}`)},"or"),c=l((e,t)=>w(e)?ke(e,t):Q(e)?V(e,t):Se(e,t),"o"),ke=l((e,t)=>{const r={};for(const a of e){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);r[i]=!0}return a=>{const i=a.input;let f=a.index,p=f;for(;p<i.length&&i.charCodeAt(p)in r;)p+=1;if(p>f){if(!M(t)&&!a.options.silent){const h=i.slice(f,p),$=x(t)?t(h,i,`${f}`):t;M($)||a.output.push($)}a.index=p}return!0}},"ir"),Se=l((e,t)=>{if(Me(e))return V(e.source,t);{const r=e.source,a=e.flags.replace(/y|$/,"y"),i=new RegExp(r,a);return Oe(e)&&x(t)&&!P(t)?Ce(i,t):Pe(i,t)}},"ur"),Ce=l((e,t)=>r=>{const a=r.index,i=r.input;e.lastIndex=a;const f=e.exec(i);if(f){const p=e.lastIndex;if(!r.options.silent){const h=t(...f,i,`${a}`);M(h)||r.output.push(h)}return r.index=p,!0}else return!1},"sr"),Pe=l((e,t)=>r=>{const a=r.index,i=r.input;if(e.lastIndex=a,e.test(i)){const f=e.lastIndex;if(!M(t)&&!r.options.silent){const p=x(t)?t(i.slice(a,f),i,`${a}`):t;M(p)||r.output.push(p)}return r.index=f,!0}else return!1},"cr"),V=l((e,t)=>r=>{const a=r.index,i=r.input;if(i.startsWith(e,a)){if(!M(t)&&!r.options.silent){const f=x(t)?t(e,i,`${a}`):t;M(f)||r.output.push(f)}return r.index+=e.length,!0}else return!1},"R"),X=l((e,t,r,a)=>{const i=z(e),f=t>1;return R(N(ee(p=>{let h=0;for(;h<r;){const $=p.index;if(!i(p)||(h+=1,p.index===$))break}return h>=t},f),a))},"O"),Ie=l((e,t)=>X(e,0,1,t),"lr"),D=l((e,t)=>X(e,0,1/0,t),"m"),E=l((e,t)=>{const r=e.map(z);return R(N(ee(a=>{for(let i=0,f=r.length;i<f;i++)if(!r[i](a))return!1;return!0}),t))},"_"),j=l((e,t)=>{const r=e.map(z);return R(N(a=>{for(let i=0,f=r.length;i<f;i++)if(r[i](a))return!0;return!1},t))},"p"),ee=l((e,t=!0,r=!1)=>{const a=z(e);return t?i=>{const f=i.index,p=i.output.length,h=a(i);return!h&&!r&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!h||r)&&(i.index=f,i.output.length!==p&&(i.output.length=p)),h}:a},"P"),N=l((e,t)=>{const r=z(e);return t?a=>{if(a.options.silent)return r(a);const i=a.output.length;if(r(a)){const f=a.output.splice(i,1/0),p=t(f);return M(p)||a.output.push(p),!0}else return!1}:r},"C"),R=(()=>{let e=0;return t=>{const r=z(t),a=e+=1;return i=>{var f;if(i.options.memoization===!1)return r(i);const p=i.index,h=(f=i.cache)[a]||(f[a]={indexMax:-1,queue:[]}),$=h.queue;if(p<=h.indexMax){const I=h.store||(h.store=new Map);if($.length){for(let C=0,_t=$.length;C<_t;C+=2){const kt=$[C*2],St=$[C*2+1];I.set(kt,St)}$.length=0}const v=I.get(p);if(v===!1)return!1;if(we(v))return i.index=v,!0;if(v)return i.index=v.index,v.output?.length&&i.output.push(...v.output),!0}const de=i.output.length,zt=r(i);if(h.indexMax=Math.max(h.indexMax,p),zt){const I=i.index,v=i.output.length;if(v>de){const C=i.output.slice(de,v);$.push(p,{index:I,output:C})}else $.push(p,I);return!0}else return $.push(p,!1),!1}}})(),te=l(e=>{let t;return r=>(t||(t=z(e())),t(r))},"A"),z=ze(e=>{if(x(e))return O(e)?te(e):e;if(Q(e)||Ae(e))return c(e);if(w(e))return E(e);if(je(e))return j(Object.values(e));throw new Error("Invalid rule")}),A=l(e=>e,"v"),ne=l(e=>t=>_e(t,e,{memoization:!1}).join(""),"z"),Ze=l(e=>{const t={};return r=>t[r]??(t[r]=e(r))},"pr"),re="abcdefghijklmnopqrstuvwxyz",qe=l(e=>{let t="";for(;e>0;){const r=(e-1)%26;t=re[r]+t,e=Math.floor((e-1)/26)}return t},"vr"),oe=l(e=>{let t=0;for(let r=0,a=e.length;r<a;r++)t=t*26+re.indexOf(e[r])+1;return t},"N"),B=l((e,t)=>{if(t<e)return B(t,e);const r=[];for(;e<=t;)r.push(e++);return r},"$"),De=l((e,t,r)=>B(e,t).map(a=>String(a).padStart(r,"0")),"fr"),ie=l((e,t)=>B(oe(e),oe(t)).map(qe),"j"),T=c(/\\./,A),Ee=c(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),Fe=c(/./,A),Ne=c(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${pe(t)}$).*?`),Re=c(/^(!!)+/,""),Be=j([Ne,Re]),Te=c(/\/(\*\*\/)+/,"(?:[\\\\/].+[\\\\/]|[\\\\/])"),We=c(/^(\*\*\/)+/,"(?:^|.*[\\\\/])"),Je=c(/\/(\*\*)$/,"(?:[\\\\/].*|$)"),Le=c(/\*\*/,".*"),se=j([Te,We,Je,Le]),Ke=c(/\*\/(?!\*\*\/|\*$)/,"[^\\\\/]*[\\\\/]"),Ue=c(/\*/,"[^\\\\/]*"),ae=j([Ke,Ue]),ue=c("?","[^\\\\/]"),Ge=c("[",A),He=c("]",A),Ye=c(/[!^]/,"^\\\\/"),Qe=c(/[a-z]-[a-z]|[0-9]-[0-9]/i,A),Ve=c(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Xe=c(/[^\]]/,A),et=j([T,Ve,Qe,Xe]),le=E([Ge,Ie(Ye),D(et),He]),tt=c("{","(?:"),nt=c("}",")"),rt=c(/(\d+)\.\.(\d+)/,(e,t,r)=>De(+t,+r,Math.min(t.length,r.length)).join("|")),ot=c(/([a-z]+)\.\.([a-z]+)/,(e,t,r)=>ie(t,r).join("|")),it=c(/([A-Z]+)\.\.([A-Z]+)/,(e,t,r)=>ie(t.toLowerCase(),r.toLowerCase()).join("|").toUpperCase()),st=j([rt,ot,it]),ce=E([tt,st,nt]),at=c("{","(?:"),ut=c("}",")"),lt=c(",","|"),ct=c(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),ft=c(/[^}]/,A),pt=te(()=>fe),dt=j([se,ae,ue,le,ce,pt,T,ct,lt,ft]),fe=E([at,D(dt),ut]),ht=D(j([Be,se,ae,ue,le,ce,fe,T,Ee,Fe])),gt=ht,mt=ne(gt),pe=mt,xt=c(/\\./,A),yt=c(/./,A),$t=c(/\*\*\*+/,"*"),bt=c(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),vt=c(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),wt=D(j([xt,$t,bt,vt,yt])),jt=wt,At=ne(jt),Ot=At,F=l((e,t)=>Array.isArray(e)?e.map(F.compile).some(r=>r.test(t)):F.compile(e).test(t),"S");F.compile=Ze(e=>new RegExp(`^${pe(Ot(e))}[\\\\/]?$`,"s"));var Mt=F;return g(k)})();return n.default||n},"_lazyMatch"),L;const Ft=l((n,o)=>(L||(L=he(),he=null),L(n,o)),"default");var Nt=Object.defineProperty,Rt=Y((n,o)=>Nt(n,"name",{value:o,configurable:!0}),"__name$1");const Bt=/^[A-Z]:\//i,S=Rt((n="")=>n&&n.replaceAll("\\","/").replace(Bt,o=>o.toUpperCase()),"normalizeWindowsPath");var Tt=Object.defineProperty,y=Y((n,o)=>Tt(n,"name",{value:o,configurable:!0}),"__name");const Wt=/^[/\\]{2}/,Jt=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,ye=/^[A-Z]:$/i,ge=/^\/([A-Z]:)?$/i,Lt=/.(\.[^./]+)$/,Kt=/^[/\\]|^[a-z]:[/\\]/i,Ut=y(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),$e=y((n,o)=>{let s="",u=0,d=-1,m=0,b=null;for(let g=0;g<=n.length;++g){if(g<n.length)b=n[g];else{if(b==="/")break;b="/"}if(b==="/"){if(!(d===g-1||m===1))if(m===2){if(s.length<2||u!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const k=s.lastIndexOf("/");k===-1?(s="",u=0):(s=s.slice(0,k),u=s.length-1-s.lastIndexOf("/")),d=g,m=0;continue}else if(s.length>0){s="",u=0,d=g,m=0;continue}}o&&(s+=s.length>0?"/..":"..",u=2)}else s.length>0?s+=`/${n.slice(d+1,g)}`:s=n.slice(d+1,g),u=g-d-1;d=g,m=0}else b==="."&&m!==-1?++m:m=-1}return s},"normalizeString"),q=y(n=>Jt.test(n),"isAbsolute"),be=y(function(n){if(n.length===0)return".";n=S(n);const o=Wt.exec(n),s=q(n),u=n.at(-1)==="/";return n=$e(n,!s),n.length===0?s?"/":u?"./":".":(u&&(n+="/"),ye.test(n)&&(n+="/"),o?s?`//${n}`:`//./${n}`:s&&!q(n)?`/${n}`:n)},"normalize"),ve=y((...n)=>{let o="";for(const s of n)if(s)if(o.length>0){const u=o[o.length-1]==="/",d=s[0]==="/";u&&d?o+=s.slice(1):o+=u||d?s:`/${s}`}else o+=s;return be(o)},"join"),H=y(function(...n){n=n.map(u=>S(u));let o="",s=!1;for(let u=n.length-1;u>=-1&&!s;u--){const d=u>=0?n[u]:Ut();!d||d.length===0||(o=`${d}/${o}`,s=q(d))}return o=$e(o,!s),s&&!q(o)?`/${o}`:o.length>0?o:"."},"resolve");y(function(n){return S(n)},"toNamespacedPath");const Gt=y(function(n){return Lt.exec(S(n))?.[1]??""},"extname");y(function(n,o){const s=H(n).replace(ge,"$1").split("/"),u=H(o).replace(ge,"$1").split("/");if(u[0][1]===":"&&s[0][1]===":"&&s[0]!==u[0])return u.join("/");const d=[...s];for(const m of d){if(u[0]!==m)break;s.shift(),u.shift()}return[...s.map(()=>".."),...u].join("/")},"relative");const Ht=y(n=>{const o=S(n).replace(/\/$/,"").split("/").slice(0,-1);return o.length===1&&ye.test(o[0])&&(o[0]+="/"),o.join("/")||(q(n)?"/":".")},"dirname");y(function(n){const o=[n.root,n.dir,n.base??n.name+n.ext].filter(Boolean);return S(n.root?H(...o):o.join("/"))},"format");const Yt=y((n,o)=>{const s=S(n).split("/").pop();return o&&s.endsWith(o)?s.slice(0,-o.length):s},"basename");y(function(n){const o=Kt.exec(n)?.[0]?.replace(/\\/g,"/")??"",s=Yt(n),u=Gt(s);return{base:s,dir:Ht(n),ext:u,name:s.slice(0,s.length-u.length),root:o}},"parse");y((n,o)=>Ft(o,be(n)),"matchesGlob");var Qt=Object.defineProperty,_=W((n,o)=>Qt(n,"name",{value:o,configurable:!0}),"i");const K="## Ai Generated Solution",me="Creation of a AI solution failed.",U=_((n,o,s)=>{const u={error:{message:n.message,name:n.name,stack:n.stack},file:{file:o.file,language:o.language,line:o.line,snippet:o.snippet},temperature:s};return Pt.createHash("sha256").update(JSON.stringify(u)).digest("hex")},"generateCacheKey"),Vt=_(n=>n||ve(It.tmpdir(),"visulima-error-cache"),"getCacheDirectory"),Xt=_(n=>{Z.existsSync(n)||Z.mkdirSync(n,{recursive:!0})},"ensureCacheDirectory"),G=_((n,o)=>ve(n,`${o}.json`),"getCacheFilePath"),en=_((n,o)=>{try{if(!Z.existsSync(n))return;const s=Z.readFileSync(n,"utf8"),u=JSON.parse(s);return Date.now()-u.timestamp>o?void 0:u.solution}catch{return}},"readFromCache"),xe=_((n,o,s)=>{try{const u={solution:o,timestamp:Date.now(),ttl:s};Z.writeFileSync(n,JSON.stringify(u,null,2),"utf8")}catch{}},"writeToCache"),tn=_((n,o)=>({handle:_(async(s,u)=>{const d=o?.cache,m=o?.temperature??0,b=d?.ttl??1440*60*1e3,g=Vt(d?.directory);if(d?.enabled!==!1){const w=U(s,u,m),x=G(g,w),O=en(x,b);if(O)return O;Xt(g)}const k=qt({applicationType:void 0,error:s,file:u});try{const w=(await Zt.generateText({model:n,prompt:k,temperature:m})).text;let x;if(w?x={body:J(w),header:K}:x={body:J(me),header:K},d?.enabled!==!1){const O=U(s,u,m),P=G(g,O);xe(P,x,b)}return x}catch(w){console.error(w);const x={body:J(me),header:K};if(d?.enabled!==!1){const O=U(s,u,m),P=G(g,O);xe(P,x,b)}return x}},"handle"),name:"AI SDK",priority:99}),"aiFinder");module.exports=tn;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var o=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=Object.defineProperty,l=o((e,r)=>c(e,"name",{value:r,configurable:!0}),"i");const a=l((e,r,n)=>{const t=n.indexOf(e);if(t===-1)return"";const s=t+e.length,i=n.indexOf(r,s);return i===-1?"":n.slice(s,i).trim()},"between"),p=l(e=>{const r=a("FIX","ENDFIX",e);if(!r)return["No solution found.",'Provide this response to the Maintainer of <a href="https://github.com/visulima/visulima/issues/new?assignees=&labels=s%3A+pending+triage%2Cc%3A+bug&projects=&template=bug_report.yml" target="_blank" rel="noopener noreferrer" class="text-blue-500 hover:underline inline-flex items-center text-sm">@visulima/error</a>.',`"${e}"`].join("</br></br>");const n=a("LINKS","ENDLINKS",e).split(`
|
|
2
|
+
`).map(t=>JSON.parse(t));return`${r.replaceAll(/"([^"]*)"(\s|\.)/g,"<code>$1</code> ")}
|
|
3
|
+
|
|
4
|
+
## Links
|
|
5
|
+
|
|
6
|
+
${n.map(t=>`- <a href="${t.url}" target="_blank" rel="noopener noreferrer">${t.title}</a>`).join(`
|
|
7
|
+
`)}
|
|
8
|
+
|
|
9
|
+
--------------------
|
|
10
|
+
This solution was generated with the <a href="https://sdk.vercel.ai/" target="_blank" rel="noopener noreferrer">AI SDK</a> and may not be 100% accurate.`},"aiSolutionResponse");module.exports=p;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var u=Object.defineProperty;var i=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=Object.defineProperty,l=i((e,r)=>c(e,"name",{value:r,configurable:!0}),"i");const s=l((e,r,n)=>{const t=n.indexOf(e);if(t===-1)return"";const a=t+e.length,o=n.indexOf(r,a);return o===-1?"":n.slice(a,o).trim()},"between"),f=l(e=>{const r=s("FIX","ENDFIX",e);if(!r)return["No solution found.",'Provide this response to the Maintainer of <a href="https://github.com/visulima/visulima/issues/new?assignees=&labels=s%3A+pending+triage%2Cc%3A+bug&projects=&template=bug_report.yml" target="_blank" rel="noopener noreferrer" class="text-blue-500 hover:underline inline-flex items-center text-sm">@visulima/error</a>.',`"${e}"`].join("</br></br>");const n=s("LINKS","ENDLINKS",e).split(`
|
|
2
|
+
`).map(t=>JSON.parse(t));return`${r.replaceAll(/"([^"]*)"(\s|\.)/g,"<code>$1</code> ")}
|
|
3
|
+
|
|
4
|
+
## Links
|
|
5
|
+
|
|
6
|
+
${n.map(t=>`- <a href="${t.url}" target="_blank" rel="noopener noreferrer">${t.title}</a>`).join(`
|
|
7
|
+
`)}
|
|
8
|
+
|
|
9
|
+
--------------------
|
|
10
|
+
This solution was generated with the <a href="https://sdk.vercel.ai/" target="_blank" rel="noopener noreferrer">AI SDK</a> and may not be 100% accurate.`},"aiSolutionResponse");export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var a=(r,e)=>t(r,"name",{value:e,configurable:!0});var c=Object.defineProperty,u=a((r,e)=>c(r,"name",{value:e,configurable:!0}),"e");const n=u(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");module.exports=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var a=(r,e)=>t(r,"name",{value:e,configurable:!0});var c=Object.defineProperty,u=a((r,e)=>c(r,"name",{value:e,configurable:!0}),"e");const o=u(()=>{if(!Error.captureStackTrace)return;const r=new Error;return Error.captureStackTrace(r),r.stack},"captureRawStackTrace");export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var p=(e,r)=>w(e,"name",{value:r,configurable:!0});const O=require("./index-CqSGigts.cjs"),m=require("./addKnownErrorConstructor-B5dNFGsR.cjs"),d=require("./NonError-CQn4sdxd.cjs");var A=Object.defineProperty,n=p((e,r)=>A(e,"name",{value:r,configurable:!0}),"o");const N={maxDepth:Number.POSITIVE_INFINITY},b=n((e,r,t=0)=>m.isErrorLike(e)?y(e,r,t):r.maxDepth!==void 0&&t>=r.maxDepth?new d(JSON.stringify(e)):new d(JSON.stringify(e)),"deserializePlainObject"),P=n((e,r,t,o,i)=>{const s=r.map(a=>f(a,o,i+1));return new e(s,t)},"reconstructAggregateError"),y=n((e,r,t)=>{if(r.maxDepth!==void 0&&t>=r.maxDepth)return new d(JSON.stringify(e));const{cause:o,errors:i,message:s,name:a,stack:u,...g}=e,l=m.getErrorConstructor(a)||Error,c=a==="AggregateError"&&Array.isArray(i)?P(l,i,s,r,t):new l(s);return!c.name&&a&&(c.name=a),s!==void 0&&(c.message=s),u&&(c.stack=u),v(c,g,o,a,r,t),o!==void 0&&(c.cause=f(o,r,t+1)),h(c,e),c},"reconstructError"),f=n((e,r,t)=>O.r(e)?b(e,r,t):Array.isArray(e)?e.map(o=>f(o,r,t)):e,"deserializeValue"),v=n((e,r,t,o,i,s)=>{const a=e;for(const[u,g]of Object.entries(r))if(!(u==="cause"&&t!==void 0)){if(u==="errors"&&o==="AggregateError")continue;a[u]=f(g,i,s+1)}},"restoreErrorProperties"),h=n((e,r)=>{const t=new Set;t.add("name"),t.add("message"),t.add("stack");for(const o of Object.keys(r))t.add(o);for(const o of t)if(o in e){const i=Object.getOwnPropertyDescriptor(e,o);i&&!i.enumerable&&Object.defineProperty(e,o,{...i,enumerable:!0})}},"makePropertiesEnumerable"),E=n(e=>new d(JSON.stringify(e)),"handlePrimitive"),k=n(e=>new d(JSON.stringify(e)),"handleArray"),S=n((e,r)=>m.isErrorLike(e)?y(e,r,0):b(e,r),"handlePlainObject"),j=n((e,r={})=>{const t={...N,...r};return e instanceof Error?e:e===null?E(null):typeof e=="string"||typeof e=="number"||typeof e=="boolean"?E(e):Array.isArray(e)?k(e):m.isErrorLike(e)?y(e,t,0):O.r(e)?S(e,t):new d(JSON.stringify(e))},"deserialize");module.exports=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var p=(e,r)=>w(e,"name",{value:r,configurable:!0});import{r as b}from"./index-CLFYRLyq.mjs";import{isErrorLike as g,getErrorConstructor as A}from"./addKnownErrorConstructor-BqqnTSZp.mjs";import f from"./NonError-CS10kwil.mjs";var N=Object.defineProperty,i=p((e,r)=>N(e,"name",{value:r,configurable:!0}),"o");const P={maxDepth:Number.POSITIVE_INFINITY},E=i((e,r,t=0)=>g(e)?l(e,r,t):r.maxDepth!==void 0&&t>=r.maxDepth?new f(JSON.stringify(e)):new f(JSON.stringify(e)),"deserializePlainObject"),v=i((e,r,t,o,a)=>{const s=r.map(n=>u(n,o,a+1));return new e(s,t)},"reconstructAggregateError"),l=i((e,r,t)=>{if(r.maxDepth!==void 0&&t>=r.maxDepth)return new f(JSON.stringify(e));const{cause:o,errors:a,message:s,name:n,stack:m,...d}=e,y=A(n)||Error,c=n==="AggregateError"&&Array.isArray(a)?v(y,a,s,r,t):new y(s);return!c.name&&n&&(c.name=n),s!==void 0&&(c.message=s),m&&(c.stack=m),h(c,d,o,n,r,t),o!==void 0&&(c.cause=u(o,r,t+1)),S(c,e),c},"reconstructError"),u=i((e,r,t)=>b(e)?E(e,r,t):Array.isArray(e)?e.map(o=>u(o,r,t)):e,"deserializeValue"),h=i((e,r,t,o,a,s)=>{const n=e;for(const[m,d]of Object.entries(r))if(!(m==="cause"&&t!==void 0)){if(m==="errors"&&o==="AggregateError")continue;n[m]=u(d,a,s+1)}},"restoreErrorProperties"),S=i((e,r)=>{const t=new Set;t.add("name"),t.add("message"),t.add("stack");for(const o of Object.keys(r))t.add(o);for(const o of t)if(o in e){const a=Object.getOwnPropertyDescriptor(e,o);a&&!a.enumerable&&Object.defineProperty(e,o,{...a,enumerable:!0})}},"makePropertiesEnumerable"),O=i(e=>new f(JSON.stringify(e)),"handlePrimitive"),j=i(e=>new f(JSON.stringify(e)),"handleArray"),D=i((e,r)=>g(e)?l(e,r,0):E(e,r),"handlePlainObject"),z=i((e,r={})=>{const t={...P,...r};return e instanceof Error?e:e===null?O(null):typeof e=="string"||typeof e=="number"||typeof e=="boolean"?O(e):Array.isArray(e)?j(e):g(e)?l(e,t,0):b(e)?D(e,t):new f(JSON.stringify(e))},"deserialize");export{z as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty;var r=(t,i)=>e(t,"name",{value:i,configurable:!0});var n=Object.defineProperty,o=r((t,i)=>n(t,"name",{value:i,configurable:!0}),"i");const h={handle:o(async t=>{if(!(t.hint===void 0||t.hint===null)){if(typeof t.hint=="string"&&t.hint!=="")return{body:t.hint};if(typeof t.hint=="object"&&typeof t.hint.body=="string")return t.hint;if(Array.isArray(t.hint))return{body:t.hint.join(`
|
|
2
|
+
`)}}},"handle"),name:"errorHint",priority:1};export{h as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var r=(t,i)=>e(t,"name",{value:i,configurable:!0});var n=Object.defineProperty,o=r((t,i)=>n(t,"name",{value:i,configurable:!0}),"i");const h={handle:o(async t=>{if(!(t.hint===void 0||t.hint===null)){if(typeof t.hint=="string"&&t.hint!=="")return{body:t.hint};if(typeof t.hint=="object"&&typeof t.hint.body=="string")return t.hint;if(Array.isArray(t.hint))return{body:t.hint.join(`
|
|
2
|
+
`)}}},"handle"),name:"errorHint",priority:1};module.exports=h;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var n=(e,t)=>i(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var s=Object.defineProperty,m=n((e,t)=>s(e,"name",{value:t,configurable:!0}),"s");const c=m(e=>{const t=e.methodName&&e.methodName!=="<unknown>"?`${e.methodName} `:"",a=e.file??"<unknown>",r=e.line??0,o=e.column??0;return t.trim()?` at ${t}(${a}:${r}:${o})`:` at ${a}:${r}:${o}`},"formatStackFrameLine"),u=m((e,t)=>{const a=[];if(t?.header&&(t.header.name||t.header.message)){const r=String(t.header.name||"Error"),o=String(t.header.message||"");a.push(`${r}${o?": ":""}${o}`)}for(const r of e)a.push(c(r));return a.join(`
|
|
2
|
+
`)},"formatStacktrace");exports.formatStackFrameLine=c;exports.formatStacktrace=u;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=Object.defineProperty;var n=(e,a)=>c(e,"name",{value:a,configurable:!0});var s=Object.defineProperty,m=n((e,a)=>s(e,"name",{value:a,configurable:!0}),"s");const i=m(e=>{const a=e.methodName&&e.methodName!=="<unknown>"?`${e.methodName} `:"",r=e.file??"<unknown>",t=e.line??0,o=e.column??0;return a.trim()?` at ${a}(${r}:${t}:${o})`:` at ${r}:${t}:${o}`},"formatStackFrameLine"),f=m((e,a)=>{const r=[];if(a?.header&&(a.header.name||a.header.message)){const t=String(a.header.name||"Error"),o=String(a.header.message||"");r.push(`${t}${o?": ":""}${o}`)}for(const t of e)r.push(i(t));return r.join(`
|
|
2
|
+
`)},"formatStacktrace");export{i as formatStackFrameLine,f as formatStacktrace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(r,t)=>c(r,"name",{value:t,configurable:!0});const o=require("node:util");var n=Object.defineProperty,u=a((r,t)=>n(r,"name",{value:t,configurable:!0}),"a");const i=u(r=>{const t=new Set,s=[];let e=r;for(;e;){if(t.has(e)){console.error(`Circular reference detected in error causes: ${o.inspect(r)}`);break}if(s.push(e),t.add(e),!e.cause)break;e=e.cause}return s},"getErrorCauses");module.exports=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,a)=>s(r,"name",{value:a,configurable:!0});import{inspect as c}from"node:util";var n=Object.defineProperty,u=o((r,a)=>n(r,"name",{value:a,configurable:!0}),"a");const d=u(r=>{const a=new Set,t=[];let e=r;for(;e;){if(a.has(e)){console.error(`Circular reference detected in error causes: ${c(r)}`);break}if(t.push(e),a.add(e),!e.cause)break;e=e.cause}return t},"getErrorCauses");export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=Object.defineProperty;var o=(e,t)=>r(e,"name",{value:t,configurable:!0});var n=Object.defineProperty,l=o((e,t)=>n(e,"name",{value:t,configurable:!0}),"e");function i(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}o(i,"r");l(i,"isPlainObject");export{i as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var l=Object.defineProperty,i=r((e,t)=>l(e,"name",{value:t,configurable:!0}),"e");function o(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}r(o,"r");i(o,"isPlainObject");exports.r=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var o=(n,t)=>c(n,"name",{value:t,configurable:!0});var f=Object.defineProperty,s=o((n,t)=>f(n,"name",{value:t,configurable:!0}),"l");const u=s((n,t)=>{let e=0,i=t.length-2;for(;e<i;){const r=e+(i-e>>1);if(n<t[r])i=r-1;else if(n>=t[r+1])e=r+1;else{e=r;break}}return e},"binarySearch"),y=s(n=>n.split(/\n|\r(?!\n)/).reduce((t,e)=>(t.push(t.at(-1)+e.length+1),t),[0]),"getLineStartIndexes"),p=s((n,t,e)=>{const i=e?.skipChecks??!1;if(!i&&(!Array.isArray(n)&&typeof n!="string"||(typeof n=="string"||Array.isArray(n))&&n.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof n=="string"&&t>=n.length||Array.isArray(n)&&t+1>=n.at(-1)))return{column:0,line:0};if(typeof n=="string"){const l=y(n),a=u(t,l);return{column:t-l[a]+1,line:a+1}}const r=u(t,n);return{column:t-n[r]+1,line:r+1}},"indexToLineColumn");export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var a=(n,t)=>c(n,"name",{value:t,configurable:!0});var f=Object.defineProperty,s=a((n,t)=>f(n,"name",{value:t,configurable:!0}),"l");const u=s((n,t)=>{let e=0,i=t.length-2;for(;e<i;){const r=e+(i-e>>1);if(n<t[r])i=r-1;else if(n>=t[r+1])e=r+1;else{e=r;break}}return e},"binarySearch"),y=s(n=>n.split(/\n|\r(?!\n)/).reduce((t,e)=>(t.push(t.at(-1)+e.length+1),t),[0]),"getLineStartIndexes"),g=s((n,t,e)=>{const i=e?.skipChecks??!1;if(!i&&(!Array.isArray(n)&&typeof n!="string"||(typeof n=="string"||Array.isArray(n))&&n.length===0))return{column:0,line:0};if(!i&&(typeof t!="number"||typeof n=="string"&&t>=n.length||Array.isArray(n)&&t+1>=n.at(-1)))return{column:0,line:0};if(typeof n=="string"){const l=y(n),o=u(t,l);return{column:t-l[o]+1,line:o+1}}const r=u(t,n);return{column:t-n[r]+1,line:r+1}},"indexToLineColumn");module.exports=g;
|
|
@@ -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,35 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var m=(e,t)=>p(e,"name",{value:t,configurable:!0});var u=Object.defineProperty,n=m((e,t)=>u(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:"react-hydration-mismatch",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"hydration failed","did not match","expected server html","text content does not match"))return{md:["Client and server rendered markup differ.","","Checklist:","- Avoid non-deterministic rendering during SSR (dates, random, locale).","- Ensure feature flags / env checks are consistent between server and client.","- Wrap browser-only code with guards (e.g., check `typeof window !== 'undefined'`).","- Ensure data used on server matches client rehydration data."].join(`
|
|
28
|
+
`),title:"React hydration mismatch"}},"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(`
|
|
29
|
+
`),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,c)=>(o.match.priority||0)-(c.match.priority||0)).map(o=>`#### ${o.match.title}
|
|
30
|
+
|
|
31
|
+
${o.match.md}`).join(`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
`);return s===""?void 0:{body:s,header:"### Potential fixes detected"}}catch{return}},"handle"),name:"ruleBasedHints",priority:0};module.exports=g;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var p=Object.defineProperty;var m=(e,t)=>p(e,"name",{value:t,configurable:!0});var u=Object.defineProperty,n=m((e,t)=>u(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:"react-hydration-mismatch",test:n(e=>{const t=(e?.message||String(e||"")).toString();if(r(t,"hydration failed","did not match","expected server html","text content does not match"))return{md:["Client and server rendered markup differ.","","Checklist:","- Avoid non-deterministic rendering during SSR (dates, random, locale).","- Ensure feature flags / env checks are consistent between server and client.","- Wrap browser-only code with guards (e.g., check `typeof window !== 'undefined'`).","- Ensure data used on server matches client rehydration data."].join(`
|
|
28
|
+
`),title:"React hydration mismatch"}},"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(`
|
|
29
|
+
`),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,c)=>(o.match.priority||0)-(c.match.priority||0)).map(o=>`#### ${o.match.title}
|
|
30
|
+
|
|
31
|
+
${o.match.md}`).join(`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
`);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-BGfwKKxE.cjs');
|
|
6
|
-
const solution_ai_aiPrompt = require('./ai-prompt.cjs');
|
|
7
|
-
const aiSolutionResponse = require('../../packem_shared/aiSolutionResponse-BPckbL56.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;
|