@visulima/error 4.4.17 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE.md +125 -0
  3. package/README.md +118 -0
  4. package/dist/index.cjs +11 -0
  5. package/dist/index.d.cts +5 -1
  6. package/dist/index.d.mts +5 -1
  7. package/dist/index.d.ts +5 -1
  8. package/dist/index.mjs +5 -0
  9. package/dist/packem_shared/ai-solution-response-BuaDQAEU.d.cts +3 -0
  10. package/dist/packem_shared/ai-solution-response-BuaDQAEU.d.mts +3 -0
  11. package/dist/packem_shared/ai-solution-response-BuaDQAEU.d.ts +3 -0
  12. package/dist/packem_shared/aiFinder-BGfwKKxE.cjs +263 -0
  13. package/dist/packem_shared/aiFinder-Bk1vt0_x.mjs +261 -0
  14. package/dist/packem_shared/aiSolutionResponse-BPckbL56.cjs +37 -0
  15. package/dist/packem_shared/aiSolutionResponse-bDi4ad8f.mjs +35 -0
  16. package/dist/packem_shared/errorHintFinder-CQy_qIK3.mjs +23 -0
  17. package/dist/packem_shared/errorHintFinder-DZugFHq0.cjs +25 -0
  18. package/dist/packem_shared/formatStackFrameLine-DcXSX--m.cjs +31 -0
  19. package/dist/packem_shared/formatStackFrameLine-DqkmKWH3.mjs +26 -0
  20. package/dist/packem_shared/ruleBasedFinder-BYrndubA.mjs +227 -0
  21. package/dist/packem_shared/ruleBasedFinder-y_-5kbeT.cjs +229 -0
  22. package/dist/packem_shared/types-BtQS7FHG.d.cts +20 -0
  23. package/dist/packem_shared/types-BtQS7FHG.d.mts +20 -0
  24. package/dist/packem_shared/types-BtQS7FHG.d.ts +20 -0
  25. package/dist/solution/ai/ai-prompt.cjs +42 -0
  26. package/dist/solution/ai/ai-prompt.d.cts +9 -0
  27. package/dist/solution/ai/ai-prompt.d.mts +9 -0
  28. package/dist/solution/ai/ai-prompt.d.ts +9 -0
  29. package/dist/solution/ai/ai-prompt.mjs +40 -0
  30. package/dist/solution/ai/index.cjs +13 -0
  31. package/dist/solution/ai/index.d.cts +16 -0
  32. package/dist/solution/ai/index.d.mts +16 -0
  33. package/dist/solution/ai/index.d.ts +16 -0
  34. package/dist/solution/ai/index.mjs +3 -0
  35. package/dist/solution/index.cjs +11 -0
  36. package/dist/solution/index.d.cts +8 -0
  37. package/dist/solution/index.d.mts +8 -0
  38. package/dist/solution/index.d.ts +8 -0
  39. package/dist/solution/index.mjs +2 -0
  40. package/dist/stacktrace/index.cjs +3 -0
  41. package/dist/stacktrace/index.d.cts +9 -1
  42. package/dist/stacktrace/index.d.mts +9 -1
  43. package/dist/stacktrace/index.d.ts +9 -1
  44. package/dist/stacktrace/index.mjs +1 -0
  45. package/package.json +63 -16
@@ -0,0 +1,229 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ const code = /* @__PURE__ */ __name((s) => `\`\`\`
6
+ ${s.trim()}
7
+ \`\`\``, "code");
8
+ const bash = /* @__PURE__ */ __name((s) => `\`\`\`bash
9
+ ${s.trim()}
10
+ \`\`\``, "bash");
11
+ const ts = /* @__PURE__ */ __name((s) => `\`\`\`ts
12
+ ${s.trim()}
13
+ \`\`\``, "ts");
14
+ const js = /* @__PURE__ */ __name((s) => `\`\`\`js
15
+ ${s.trim()}
16
+ \`\`\``, "js");
17
+ const has = /* @__PURE__ */ __name((message, ...needles) => {
18
+ const lower = message.toLowerCase();
19
+ return needles.some((n) => lower.includes(n.toLowerCase()));
20
+ }, "has");
21
+ const rules = [
22
+ {
23
+ name: "esm-cjs-interop",
24
+ test: /* @__PURE__ */ __name((error) => {
25
+ const message = (error?.message || String(error || "")).toString();
26
+ if (has(
27
+ message,
28
+ "err_require_esm",
29
+ "cannot use import statement outside a module",
30
+ "must use import to load es module",
31
+ "require() of es module",
32
+ "does not provide an export named"
33
+ )) {
34
+ return {
35
+ md: [
36
+ "Your project or a dependency may be mixing CommonJS and ES Modules.",
37
+ "",
38
+ "Try:",
39
+ "- Ensure package.json has the correct `type` (either `module` or `commonjs`).",
40
+ "- Use dynamic `import()` when requiring ESM from CJS.",
41
+ "- Prefer ESM-compatible entrypoints from dependencies.",
42
+ "- In Node, align `module` resolution with your bundler config.",
43
+ "",
44
+ "Check Node resolution:",
45
+ bash("node -v\ncat package.json | jq .type"),
46
+ "",
47
+ "Example dynamic import in CJS:",
48
+ js("(async () => { const mod = await import('some-esm'); mod.default(); })();")
49
+ ].join("\n"),
50
+ title: "ESM/CJS interop"
51
+ };
52
+ }
53
+ return void 0;
54
+ }, "test")
55
+ },
56
+ {
57
+ name: "missing-default-export",
58
+ test: /* @__PURE__ */ __name((error) => {
59
+ const message = (error?.message || String(error || "")).toString();
60
+ if (has(message, "default export not found", "has no default export", "does not provide an export named 'default'", "is not exported from")) {
61
+ return {
62
+ md: [
63
+ "Verify your import/export shapes.",
64
+ "",
65
+ "Default export example:",
66
+ ts("export default function Component() {}\n// import Component from './file'"),
67
+ "",
68
+ "Named export example:",
69
+ ts("export function Component() {}\n// import { Component } from './file'")
70
+ ].join("\n"),
71
+ title: "Export mismatch (default vs named)"
72
+ };
73
+ }
74
+ return void 0;
75
+ }, "test")
76
+ },
77
+ {
78
+ name: "port-in-use",
79
+ test: /* @__PURE__ */ __name((error) => {
80
+ const message = (error?.message || String(error || "")).toString();
81
+ if (has(message, "eaddrinuse", "address already in use", "listen eaddrinuse")) {
82
+ return {
83
+ md: [
84
+ "Another process is using the port.",
85
+ "",
86
+ "Change the port or stop the other process.",
87
+ "",
88
+ "On macOS/Linux:",
89
+ bash("lsof -i :3000\nkill -9 <PID>"),
90
+ "",
91
+ "On Windows (PowerShell):",
92
+ bash("netstat -ano | findstr :3000\ntaskkill /PID <PID> /F")
93
+ ].join("\n"),
94
+ title: "Port already in use"
95
+ };
96
+ }
97
+ return void 0;
98
+ }, "test")
99
+ },
100
+ {
101
+ name: "file-not-found-or-case",
102
+ test: /* @__PURE__ */ __name((error, file) => {
103
+ const message = (error?.message || String(error || "")).toString();
104
+ if (has(message, "enoent", "module not found", "cannot find module")) {
105
+ return {
106
+ md: [
107
+ "Check the import path and filename case (Linux/macOS are case-sensitive).",
108
+ "If using TS path aliases, verify `tsconfig.paths` and bundler aliases.",
109
+ "",
110
+ "Current file:",
111
+ code(`${file.file}:${file.line}`)
112
+ ].join("\n"),
113
+ title: "Missing file or path case mismatch"
114
+ };
115
+ }
116
+ return void 0;
117
+ }, "test")
118
+ },
119
+ {
120
+ name: "ts-path-mapping",
121
+ test: /* @__PURE__ */ __name((error) => {
122
+ const message = (error?.message || String(error || "")).toString();
123
+ if (has(message, "ts2307", "cannot find module") || message.includes("TS2307")) {
124
+ return {
125
+ md: [
126
+ "If you use path aliases, align TS `paths` with Vite/Webpack resolve aliases.",
127
+ "Ensure file extensions are correct and included in resolver.",
128
+ "",
129
+ "tsconfig.json excerpt:",
130
+ ts(`{
131
+ "compilerOptions": {
132
+ "baseUrl": ".",
133
+ "paths": { "@/*": ["src/*"] }
134
+ }
135
+ }`)
136
+ ].join("\n"),
137
+ title: "TypeScript path mapping / resolution"
138
+ };
139
+ }
140
+ return void 0;
141
+ }, "test")
142
+ },
143
+ {
144
+ name: "network-dns-enotfound",
145
+ test: /* @__PURE__ */ __name((error) => {
146
+ const message = (error?.message || String(error || "")).toString();
147
+ if (has(message, "enotfound", "getaddrinfo enotfound", "dns", "fetch failed", "ecconnrefused", "econnrefused")) {
148
+ return {
149
+ md: [
150
+ "The host may be unreachable or misconfigured.",
151
+ "",
152
+ "Try:",
153
+ "- Verify the hostname and protocol (http/https).",
154
+ "- Check VPN/proxy and firewall.",
155
+ "- Confirm the service is running and listening on the expected port.",
156
+ "",
157
+ bash("ping <host>\nnslookup <host>\ncurl -v http://<host>:<port>")
158
+ ].join("\n"),
159
+ title: "Network/DNS connection issue"
160
+ };
161
+ }
162
+ return void 0;
163
+ }, "test")
164
+ },
165
+ {
166
+ name: "react-hydration-mismatch",
167
+ test: /* @__PURE__ */ __name((error) => {
168
+ const message = (error?.message || String(error || "")).toString();
169
+ if (has(message, "hydration failed", "did not match", "expected server html", "text content does not match")) {
170
+ return {
171
+ md: [
172
+ "Client and server rendered markup differ.",
173
+ "",
174
+ "Checklist:",
175
+ "- Avoid non-deterministic rendering during SSR (dates, random, locale).",
176
+ "- Ensure feature flags / env checks are consistent between server and client.",
177
+ "- Wrap browser-only code with guards (e.g., check `typeof window !== 'undefined'`).",
178
+ "- Ensure data used on server matches client rehydration data."
179
+ ].join("\n"),
180
+ title: "React hydration mismatch"
181
+ };
182
+ }
183
+ return void 0;
184
+ }, "test")
185
+ },
186
+ {
187
+ name: "undefined-property",
188
+ test: /* @__PURE__ */ __name((error) => {
189
+ const message = (error?.message || String(error || "")).toString();
190
+ if (has(message, "cannot read properties of undefined", "reading '")) {
191
+ return {
192
+ md: [
193
+ "A variable or function returned `undefined`.",
194
+ "",
195
+ "Mitigations:",
196
+ "- Add nullish checks before property access.",
197
+ "- Validate function return values and input props/state.",
198
+ "",
199
+ ts("const value = maybe?.prop; // or: if (maybe) { use(maybe.prop) }")
200
+ ].join("\n"),
201
+ title: "Accessing property of undefined"
202
+ };
203
+ }
204
+ return void 0;
205
+ }, "test")
206
+ }
207
+ ];
208
+ const ruleBasedFinder = {
209
+ handle: /* @__PURE__ */ __name(async (error, file) => {
210
+ try {
211
+ const matches = rules.map((r) => {
212
+ return { match: r.test(error, file), rule: r };
213
+ }).filter((x) => Boolean(x.match));
214
+ if (matches.length === 0) {
215
+ return void 0;
216
+ }
217
+ const sections = matches.sort((a, b) => (a.match.priority || 0) - (b.match.priority || 0)).map((m) => `#### ${m.match.title}
218
+
219
+ ${m.match.md}`).join("\n\n---\n\n");
220
+ return { body: sections, header: "### Potential fixes detected" };
221
+ } catch {
222
+ return void 0;
223
+ }
224
+ }, "handle"),
225
+ name: "ruleBasedHints",
226
+ priority: 0
227
+ };
228
+
229
+ module.exports = ruleBasedFinder;
@@ -0,0 +1,20 @@
1
+ type Solution = {
2
+ body: string;
3
+ header?: string;
4
+ };
5
+ type SolutionFinderFile = {
6
+ file: string;
7
+ language?: string;
8
+ line: number;
9
+ snippet?: string | undefined;
10
+ };
11
+ type SolutionFinder = {
12
+ handle: (error: any, file: SolutionFinderFile) => Promise<Solution | undefined>;
13
+ name: string;
14
+ priority: number;
15
+ };
16
+ type SolutionError = Error & {
17
+ hint?: Solution;
18
+ };
19
+
20
+ export type { Solution as S, SolutionError as a, SolutionFinder as b, SolutionFinderFile as c };
@@ -0,0 +1,20 @@
1
+ type Solution = {
2
+ body: string;
3
+ header?: string;
4
+ };
5
+ type SolutionFinderFile = {
6
+ file: string;
7
+ language?: string;
8
+ line: number;
9
+ snippet?: string | undefined;
10
+ };
11
+ type SolutionFinder = {
12
+ handle: (error: any, file: SolutionFinderFile) => Promise<Solution | undefined>;
13
+ name: string;
14
+ priority: number;
15
+ };
16
+ type SolutionError = Error & {
17
+ hint?: Solution;
18
+ };
19
+
20
+ export type { Solution as S, SolutionError as a, SolutionFinder as b, SolutionFinderFile as c };
@@ -0,0 +1,20 @@
1
+ type Solution = {
2
+ body: string;
3
+ header?: string;
4
+ };
5
+ type SolutionFinderFile = {
6
+ file: string;
7
+ language?: string;
8
+ line: number;
9
+ snippet?: string | undefined;
10
+ };
11
+ type SolutionFinder = {
12
+ handle: (error: any, file: SolutionFinderFile) => Promise<Solution | undefined>;
13
+ name: string;
14
+ priority: number;
15
+ };
16
+ type SolutionError = Error & {
17
+ hint?: Solution;
18
+ };
19
+
20
+ export type { Solution as S, SolutionError as a, SolutionFinder as b, SolutionFinderFile as c };
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
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.` : ""}
12
+
13
+ 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
+
15
+ Use this format in your answer, make sure links are json:
16
+
17
+ FIX
18
+ insert the possible fix here
19
+ ENDFIX
20
+ LINKS
21
+ {"title": "Title link 1", "url": "URL link 1"}
22
+ {"title": "Title link 2", "url": "URL link 2"}
23
+ ENDLINKS
24
+ ---
25
+
26
+ Here comes the context and the exception message:
27
+
28
+ Line: ${file.line}
29
+
30
+ File:
31
+ ${file.file}
32
+
33
+ Snippet including line numbers:
34
+ ${file.snippet}
35
+
36
+ Exception class:
37
+ ${error.name}
38
+
39
+ Exception message:
40
+ ${error.message}`, "aiPrompt");
41
+
42
+ module.exports = aiPrompt;
@@ -0,0 +1,9 @@
1
+ import { c as SolutionFinderFile } from '../../packem_shared/types-BtQS7FHG.cjs';
2
+
3
+ declare const aiPrompt: ({ applicationType, error, file, }: {
4
+ applicationType: string | undefined;
5
+ error: Error;
6
+ file: SolutionFinderFile;
7
+ }) => string;
8
+
9
+ export = aiPrompt;
@@ -0,0 +1,9 @@
1
+ import { c as SolutionFinderFile } from '../../packem_shared/types-BtQS7FHG.mjs';
2
+
3
+ declare const aiPrompt: ({ applicationType, error, file, }: {
4
+ applicationType: string | undefined;
5
+ error: Error;
6
+ file: SolutionFinderFile;
7
+ }) => string;
8
+
9
+ export { aiPrompt as default };
@@ -0,0 +1,9 @@
1
+ import { c as SolutionFinderFile } from '../../packem_shared/types-BtQS7FHG.js';
2
+
3
+ declare const aiPrompt: ({ applicationType, error, file, }: {
4
+ applicationType: string | undefined;
5
+ error: Error;
6
+ file: SolutionFinderFile;
7
+ }) => string;
8
+
9
+ export = aiPrompt;
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
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.
8
+
9
+ ${applicationType ? `You are working on a ${applicationType} application.` : ""}
10
+
11
+ 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
+
13
+ Use this format in your answer, make sure links are json:
14
+
15
+ FIX
16
+ insert the possible fix here
17
+ ENDFIX
18
+ LINKS
19
+ {"title": "Title link 1", "url": "URL link 1"}
20
+ {"title": "Title link 2", "url": "URL link 2"}
21
+ ENDLINKS
22
+ ---
23
+
24
+ Here comes the context and the exception message:
25
+
26
+ Line: ${file.line}
27
+
28
+ File:
29
+ ${file.file}
30
+
31
+ Snippet including line numbers:
32
+ ${file.snippet}
33
+
34
+ Exception class:
35
+ ${error.name}
36
+
37
+ Exception message:
38
+ ${error.message}`, "aiPrompt");
39
+
40
+ export { aiPrompt as default };
@@ -0,0 +1,13 @@
1
+ 'use strict';
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;
@@ -0,0 +1,16 @@
1
+ import { LanguageModel } from 'ai';
2
+ import { b as SolutionFinder } from '../../packem_shared/types-BtQS7FHG.cjs';
3
+ export { default as aiPrompt } from './ai-prompt.cjs';
4
+ export { a as aiSolutionResponse } from '../../packem_shared/ai-solution-response-BuaDQAEU.cjs';
5
+
6
+ interface CacheOptions {
7
+ enabled?: boolean;
8
+ directory?: string;
9
+ ttl?: number;
10
+ }
11
+ declare const aiFinder: (model: LanguageModel, options?: {
12
+ temperature?: number;
13
+ cache?: CacheOptions;
14
+ }) => SolutionFinder;
15
+
16
+ export { aiFinder };
@@ -0,0 +1,16 @@
1
+ import { LanguageModel } from 'ai';
2
+ import { b as SolutionFinder } from '../../packem_shared/types-BtQS7FHG.mjs';
3
+ export { default as aiPrompt } from './ai-prompt.mjs';
4
+ export { a as aiSolutionResponse } from '../../packem_shared/ai-solution-response-BuaDQAEU.mjs';
5
+
6
+ interface CacheOptions {
7
+ enabled?: boolean;
8
+ directory?: string;
9
+ ttl?: number;
10
+ }
11
+ declare const aiFinder: (model: LanguageModel, options?: {
12
+ temperature?: number;
13
+ cache?: CacheOptions;
14
+ }) => SolutionFinder;
15
+
16
+ export { aiFinder };
@@ -0,0 +1,16 @@
1
+ import { LanguageModel } from 'ai';
2
+ import { b as SolutionFinder } from '../../packem_shared/types-BtQS7FHG.js';
3
+ export { default as aiPrompt } from './ai-prompt.js';
4
+ export { a as aiSolutionResponse } from '../../packem_shared/ai-solution-response-BuaDQAEU.js';
5
+
6
+ interface CacheOptions {
7
+ enabled?: boolean;
8
+ directory?: string;
9
+ ttl?: number;
10
+ }
11
+ declare const aiFinder: (model: LanguageModel, options?: {
12
+ temperature?: number;
13
+ cache?: CacheOptions;
14
+ }) => SolutionFinder;
15
+
16
+ export { aiFinder };
@@ -0,0 +1,3 @@
1
+ export { default as aiFinder } from '../../packem_shared/aiFinder-Bk1vt0_x.mjs';
2
+ export { default as aiPrompt } from './ai-prompt.mjs';
3
+ export { default as aiSolutionResponse } from '../../packem_shared/aiSolutionResponse-bDi4ad8f.mjs';
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+
5
+ const errorHintFinder = require('../packem_shared/errorHintFinder-DZugFHq0.cjs');
6
+ const ruleBasedFinder = require('../packem_shared/ruleBasedFinder-y_-5kbeT.cjs');
7
+
8
+
9
+
10
+ exports.errorHintFinder = errorHintFinder;
11
+ exports.ruleBasedFinder = ruleBasedFinder;
@@ -0,0 +1,8 @@
1
+ import { b as SolutionFinder } from '../packem_shared/types-BtQS7FHG.cjs';
2
+ export { S as Solution, a as SolutionError, c as SolutionFinderFile } from '../packem_shared/types-BtQS7FHG.cjs';
3
+
4
+ declare const errorHintFinder: SolutionFinder;
5
+
6
+ declare const ruleBasedFinder: SolutionFinder;
7
+
8
+ export { SolutionFinder, errorHintFinder, ruleBasedFinder };
@@ -0,0 +1,8 @@
1
+ import { b as SolutionFinder } from '../packem_shared/types-BtQS7FHG.mjs';
2
+ export { S as Solution, a as SolutionError, c as SolutionFinderFile } from '../packem_shared/types-BtQS7FHG.mjs';
3
+
4
+ declare const errorHintFinder: SolutionFinder;
5
+
6
+ declare const ruleBasedFinder: SolutionFinder;
7
+
8
+ export { SolutionFinder, errorHintFinder, ruleBasedFinder };
@@ -0,0 +1,8 @@
1
+ import { b as SolutionFinder } from '../packem_shared/types-BtQS7FHG.js';
2
+ export { S as Solution, a as SolutionError, c as SolutionFinderFile } from '../packem_shared/types-BtQS7FHG.js';
3
+
4
+ declare const errorHintFinder: SolutionFinder;
5
+
6
+ declare const ruleBasedFinder: SolutionFinder;
7
+
8
+ export { SolutionFinder, errorHintFinder, ruleBasedFinder };
@@ -0,0 +1,2 @@
1
+ export { default as errorHintFinder } from '../packem_shared/errorHintFinder-CQy_qIK3.mjs';
2
+ export { default as ruleBasedFinder } from '../packem_shared/ruleBasedFinder-BYrndubA.mjs';
@@ -3,7 +3,10 @@
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
4
 
5
5
  const parseStacktrace = require('../packem_shared/parseStacktrace-6pFoXW43.cjs');
6
+ const formatStackFrameLine = require('../packem_shared/formatStackFrameLine-DcXSX--m.cjs');
6
7
 
7
8
 
8
9
 
9
10
  exports.parseStacktrace = parseStacktrace;
11
+ exports.formatStackFrameLine = formatStackFrameLine.formatStackFrameLine;
12
+ exports.formatStacktrace = formatStackFrameLine.formatStacktrace;
@@ -14,4 +14,12 @@ declare const parse: (error: Error, { filter, frameLimit }?: Partial<{
14
14
  frameLimit: number;
15
15
  }>) => Trace[];
16
16
 
17
- export { type Trace, type TraceType, parse as parseStacktrace };
17
+ declare const formatStackFrameLine: (frame: Trace) => string;
18
+ declare const formatStacktrace: (frames: Trace[], options?: {
19
+ header?: {
20
+ message?: string;
21
+ name?: string;
22
+ };
23
+ }) => string;
24
+
25
+ export { type Trace, type TraceType, formatStackFrameLine, formatStacktrace, parse as parseStacktrace };
@@ -14,4 +14,12 @@ declare const parse: (error: Error, { filter, frameLimit }?: Partial<{
14
14
  frameLimit: number;
15
15
  }>) => Trace[];
16
16
 
17
- export { type Trace, type TraceType, parse as parseStacktrace };
17
+ declare const formatStackFrameLine: (frame: Trace) => string;
18
+ declare const formatStacktrace: (frames: Trace[], options?: {
19
+ header?: {
20
+ message?: string;
21
+ name?: string;
22
+ };
23
+ }) => string;
24
+
25
+ export { type Trace, type TraceType, formatStackFrameLine, formatStacktrace, parse as parseStacktrace };
@@ -14,4 +14,12 @@ declare const parse: (error: Error, { filter, frameLimit }?: Partial<{
14
14
  frameLimit: number;
15
15
  }>) => Trace[];
16
16
 
17
- export { type Trace, type TraceType, parse as parseStacktrace };
17
+ declare const formatStackFrameLine: (frame: Trace) => string;
18
+ declare const formatStacktrace: (frames: Trace[], options?: {
19
+ header?: {
20
+ message?: string;
21
+ name?: string;
22
+ };
23
+ }) => string;
24
+
25
+ export { type Trace, type TraceType, formatStackFrameLine, formatStacktrace, parse as parseStacktrace };
@@ -1 +1,2 @@
1
1
  export { default as parseStacktrace } from '../packem_shared/parseStacktrace-BKGoWCwC.mjs';
2
+ export { formatStackFrameLine, formatStacktrace } from '../packem_shared/formatStackFrameLine-DqkmKWH3.mjs';