@oxog/devinspector 1.4.0 → 1.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.
- package/CHANGELOG.md +27 -0
- package/dist/chunk-5QIYNQ4C.js +19 -0
- package/dist/chunk-5QIYNQ4C.js.map +1 -0
- package/dist/{chunk-LNBLBFDA.js → chunk-NP2SAIEA.js} +23 -19
- package/dist/chunk-NP2SAIEA.js.map +1 -0
- package/dist/{chunk-VZORB655.js → chunk-WUYUDBSC.js} +6 -2
- package/dist/chunk-WUYUDBSC.js.map +1 -0
- package/dist/{console-monitor-AVTNZCED.js → console-monitor-AO67CSAK.js} +17 -10
- package/dist/console-monitor-AO67CSAK.js.map +1 -0
- package/dist/devinspector.umd.cjs +766 -489
- package/dist/devinspector.umd.cjs.map +1 -1
- package/dist/devinspector.umd.js +766 -489
- package/dist/devinspector.umd.js.map +1 -1
- package/dist/devinspector.umd.min.cjs +2 -2
- package/dist/devinspector.umd.min.cjs.map +1 -1
- package/dist/devinspector.umd.min.js +2 -2
- package/dist/devinspector.umd.min.js.map +1 -1
- package/dist/{dom-monitor-JHJVZYS4.js → dom-monitor-D6GHCDBP.js} +1 -1
- package/dist/{dom-monitor-JHJVZYS4.js.map → dom-monitor-D6GHCDBP.js.map} +1 -1
- package/dist/{error-monitor-3CRFREH3.js → error-monitor-AVTYBTS7.js} +27 -52
- package/dist/error-monitor-AVTYBTS7.js.map +1 -0
- package/dist/index.cjs +513 -286
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +268 -98
- package/dist/index.js.map +1 -1
- package/dist/{inspector-ui-475ZNEHC.js → inspector-ui-TEAZXDPM.js} +17 -7
- package/dist/inspector-ui-TEAZXDPM.js.map +1 -0
- package/dist/{network-monitor-WNRL2JI7.js → network-monitor-6XRFHXMV.js} +152 -114
- package/dist/network-monitor-6XRFHXMV.js.map +1 -0
- package/dist/{performance-monitor-UKQFA7ZR.js → performance-monitor-ULNHXBYX.js} +8 -6
- package/dist/performance-monitor-ULNHXBYX.js.map +1 -0
- package/dist/{state-monitor-JGJLBAD7.js → state-monitor-UNAVEOGH.js} +1 -1
- package/dist/{state-monitor-JGJLBAD7.js.map → state-monitor-UNAVEOGH.js.map} +1 -1
- package/dist/{storage-monitor-3NPTWRTY.js → storage-monitor-5RCRXYMX.js} +1 -1
- package/dist/{storage-monitor-3NPTWRTY.js.map → storage-monitor-5RCRXYMX.js.map} +1 -1
- package/package.json +6 -3
- package/dist/chunk-LNBLBFDA.js.map +0 -1
- package/dist/chunk-VZORB655.js.map +0 -1
- package/dist/console-monitor-AVTNZCED.js.map +0 -1
- package/dist/error-monitor-3CRFREH3.js.map +0 -1
- package/dist/inspector-ui-475ZNEHC.js.map +0 -1
- package/dist/network-monitor-WNRL2JI7.js.map +0 -1
- package/dist/performance-monitor-UKQFA7ZR.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.5.0] - 2026-12-02
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- A plugin whose `install()` had not finished when `destroy()` ran (a plugin from the `plugins` option with `destroy()` in the same tick, as in React StrictMode or HMR cleanup, or an un-awaited `use()`) was never uninstalled, so its listeners and timers outlived the inspector. It is now uninstalled as soon as `install()` finishes, and that `use()` call rejects with "DevInspector has been destroyed".
|
|
14
|
+
- An `XMLHttpRequest` `send()` that throws (a second `send()` on a request in flight, or a synchronous request's network error) left the real request stuck as "pending" and gave its status to a phantom entry. The failed `send()` is now recorded as its own error entry and the request in flight keeps its own result.
|
|
15
|
+
- Destroying several inspectors in an order other than the reverse of creation left `window.fetch`, the `console` methods and `XMLHttpRequest.prototype.open/send` wrapped by a dead inspector after the last one was destroyed. `destroy()` now skips over such leftover wrappers, so the original APIs come back in any order.
|
|
16
|
+
- Calling `open()` again on an `XMLHttpRequest` whose request was still in flight (which cancels it without `abort`/`loadend` events) left that request "pending" forever, or gave it the status of the next request. It is now recorded as "Request aborted".
|
|
17
|
+
- Legacy `OriginalDevInspector` / `FetchInterceptor`: a `Request` with a body was only passed to the real `fetch` after the inspector had read a preview of it, so a streaming upload (`ReadableStream` body, `duplex: 'half'`) whose next chunk was not ready yet never started. The real `fetch` is now called immediately and the preview is read from a clone in the background; it stops when the request fails, and bodies that are not previewed (binary, multipart) are no longer cloned.
|
|
18
|
+
- Legacy `OriginalDevInspector`: `class X extends WebSocket` created plain sockets (without `X`'s methods) while the inspector was running.
|
|
19
|
+
- Legacy `OriginalDevInspector`: after `destroy()`, `fetch`, `XMLHttpRequest` and `WebSocket` wrappers that another script had wrapped in the meantime kept reporting traffic to the destroyed inspector; they now pass straight through.
|
|
20
|
+
- Legacy `OriginalDevInspector`: each uncaught error or unhandled rejection was reported several times (once by the inspector, once or twice by its error monitor through both `window.onerror`/`onunhandledrejection` and an event listener, and again when the monitor's own `console.error` echo was captured), and `destroy()` replaced a `window.onerror` / `window.onunhandledrejection` handler the app had set after the inspector started. Each is now reported once (see Changed).
|
|
21
|
+
- Legacy `OriginalDevInspector`: `destroy()` did not uninstall plugins. It now disables and uninstalls them (failures are logged), including a plugin whose `install()` finishes after `destroy()`; `use()` then rejects with "DevInspector has been destroyed".
|
|
22
|
+
- Legacy `XHRInterceptor`: every `send()` on a reused `XMLHttpRequest` added another set of listeners, so the n-th request on the same object was reported n times; a request cancelled by calling `open()` again was never reported; a second `send()` while in flight was reported as a new request. Each request now has its own listeners, removed when it ends, a request cancelled by `open()` is reported as "Request aborted", and a throwing `send()` is reported as an error.
|
|
23
|
+
- Legacy monitors (`FetchInterceptor`, `XHRInterceptor`, `WebSocketMonitor`, `ConsoleInterceptor`) uninstalled in an order other than the reverse of installation left a dead wrapper on `fetch`, `XMLHttpRequest`, `WebSocket` or `console`; the original APIs now come back in any order (also when mixed with the default inspector).
|
|
24
|
+
- `CircularStorage.removeExpired()` returned 0 when no `onEvict` callback was set, even though it removed the expired entries.
|
|
25
|
+
- `PluginSystem.unregister()` (used by `destroy()`) left a plugin registered and active when its `disable()` or `uninstall()` threw, so it could neither be removed nor registered again. The plugin is now removed and the error is still passed on (and reported by `destroy()`).
|
|
26
|
+
- `CircularStorage` with `maxSize: 0` wrote entries to a `NaN` index and kept them in memory; it now stores nothing. Negative, `NaN` or infinite sizes throw a clear `RangeError`, and fractional sizes are rounded down. The legacy `OriginalDevInspector` threw "Invalid array length" for a negative or `NaN` `maxNetworkEntries` / `maxConsoleEntries` / `maxErrorEntries`; like `DevInspector`, it now falls back to the default limit.
|
|
27
|
+
- Legacy error tracking threw a `ReferenceError` for unhandled-rejection events in environments without a `PromiseRejectionEvent` class (e.g. jsdom); such events are now recorded.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Legacy `OriginalDevInspector`: uncaught errors and unhandled rejections are emitted once, as `error:uncaught` with the error monitor's payload (`message`, `stack`, `source`, `lineno`, `colno`, ...). Previously an uncaught error produced a raw `error:uncaught` (`{ message, filename, lineno, colno, error }`) plus an `error:caught`, and a rejection produced two `error:uncaught` events. `error:caught` now only comes from `console.error` and the error monitor's `trackError()`. The inspector no longer sets `window.onerror` / `window.onunhandledrejection` (the browser console shows uncaught errors as usual again) and no longer logs `[DevInspector] Error captured:` for each captured error.
|
|
31
|
+
|
|
32
|
+
## [1.4.1] - 2026-12-02
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
- The ESM and CommonJS builds (`dist/index.js`, `dist/index.cjs`) had `process.env.NODE_ENV` replaced with `"development"` at build time, so the `enabled` default ignored the consumer's `NODE_ENV` and the inspector stayed on in production builds. The builds read `process.env.NODE_ENV` again (bundlers replace it as usual); the UMD builds were not affected.
|
|
36
|
+
|
|
10
37
|
## [1.4.0] - 2026-12-02
|
|
11
38
|
|
|
12
39
|
### Fixed
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/core/patches.ts
|
|
2
|
+
var retired = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function unwrapRetired(value) {
|
|
4
|
+
let current = value;
|
|
5
|
+
while (current !== null && typeof current === "function" && retired.has(current))
|
|
6
|
+
current = retired.get(current);
|
|
7
|
+
return current;
|
|
8
|
+
}
|
|
9
|
+
function restorePatch(target, key, replacement, original) {
|
|
10
|
+
const record = target;
|
|
11
|
+
if (record[key] === replacement) record[key] = unwrapRetired(original);
|
|
12
|
+
else if (replacement !== null && typeof replacement === "function")
|
|
13
|
+
retired.set(replacement, original);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
restorePatch
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-5QIYNQ4C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/patches.ts"],"sourcesContent":["/**\n * Restoring monkey patches when several wrappers are stacked on one API.\n *\n * A wrapper that cannot be removed (something else wrapped it since) stays in\n * place and passes straight through; it is remembered here with the value it\n * wraps, so whoever restores the wrapper on top of it skips over it. Destroying\n * inspectors or monitors in any order then still ends at the original API.\n */\nconst retired = new WeakMap<object, unknown>();\n\nfunction unwrapRetired(value: unknown): unknown {\n let current = value;\n while (current !== null && typeof current === 'function' && retired.has(current))\n current = retired.get(current);\n return current;\n}\n\n/** Puts `original` back on `target[key]` if `replacement` is still installed there. */\nexport function restorePatch(\n target: object,\n key: string,\n replacement: unknown,\n original: unknown\n): void {\n const record = target as Record<string, unknown>;\n if (record[key] === replacement) record[key] = unwrapRetired(original);\n else if (replacement !== null && typeof replacement === 'function')\n retired.set(replacement, original);\n}\n"],"mappings":";AAQA,IAAM,UAAU,oBAAI,QAAyB;AAE7C,SAAS,cAAc,OAAyB;AAC9C,MAAI,UAAU;AACd,SAAO,YAAY,QAAQ,OAAO,YAAY,cAAc,QAAQ,IAAI,OAAO;AAC7E,cAAU,QAAQ,IAAI,OAAO;AAC/B,SAAO;AACT;AAGO,SAAS,aACd,QACA,KACA,aACA,UACM;AACN,QAAM,SAAS;AACf,MAAI,OAAO,GAAG,MAAM,YAAa,QAAO,GAAG,IAAI,cAAc,QAAQ;AAAA,WAC5D,gBAAgB,QAAQ,OAAO,gBAAgB;AACtD,YAAQ,IAAI,aAAa,QAAQ;AACrC;","names":[]}
|
|
@@ -44,25 +44,29 @@ function generateId() {
|
|
|
44
44
|
}
|
|
45
45
|
function safeStringify(obj, indent) {
|
|
46
46
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
47
|
-
return JSON.stringify(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
return JSON.stringify(
|
|
48
|
+
obj,
|
|
49
|
+
(key, value) => {
|
|
50
|
+
if (typeof value === "object" && value !== null) {
|
|
51
|
+
if (seen.has(value)) {
|
|
52
|
+
return "[Circular]";
|
|
53
|
+
}
|
|
54
|
+
seen.add(value);
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
if (typeof value === "function") {
|
|
57
|
+
return value.toString();
|
|
58
|
+
}
|
|
59
|
+
if (value instanceof Error) {
|
|
60
|
+
return {
|
|
61
|
+
name: value.name,
|
|
62
|
+
message: value.message,
|
|
63
|
+
stack: value.stack
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return value;
|
|
67
|
+
},
|
|
68
|
+
indent
|
|
69
|
+
);
|
|
66
70
|
}
|
|
67
71
|
function getStackTrace(error) {
|
|
68
72
|
const stack = (error || new Error()).stack || "";
|
|
@@ -89,4 +93,4 @@ export {
|
|
|
89
93
|
getStackTrace,
|
|
90
94
|
parseStackFrame
|
|
91
95
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-NP2SAIEA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/utils.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number,\n options: { leading?: boolean; trailing?: boolean } = {}\n): (...args: Parameters<T>) => void {\n let timeout: ReturnType<typeof setTimeout> | null = null;\n let result: any;\n let lastCallTime: number | null = null;\n let lastThis: any;\n let lastArgs: any[] | null = null;\n\n const { leading = false, trailing = true } = options;\n\n const invokeFunc = (time: number) => {\n const args = lastArgs!;\n const thisArg = lastThis;\n\n lastArgs = lastThis = null;\n lastCallTime = time;\n result = func.apply(thisArg, args);\n return result;\n };\n\n const leadingEdge = (time: number) => {\n lastCallTime = time;\n timeout = setTimeout(timerExpired, wait);\n return leading ? invokeFunc(time) : result;\n };\n\n const timerExpired = () => {\n timeout = null;\n\n if (trailing && lastArgs) {\n return invokeFunc(Date.now());\n }\n lastArgs = lastThis = null;\n };\n\n return function debounced(this: any, ...args: Parameters<T>) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n\n if (isInvoking) {\n if (timeout === null) {\n return leadingEdge(time);\n }\n }\n\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(timerExpired, wait);\n return result;\n };\n\n function shouldInvoke(time: number): boolean {\n return lastCallTime === null || time - lastCallTime >= wait;\n }\n}\n\nexport function throttle<T extends (...args: any[]) => any>(\n func: T,\n wait: number,\n options: { leading?: boolean; trailing?: boolean } = {}\n): (...args: Parameters<T>) => void {\n let timeout: ReturnType<typeof setTimeout> | null = null;\n let lastCallTime = 0;\n let lastThis: any;\n let lastArgs: any[] | null = null;\n let result: any;\n\n const { leading = true, trailing = true } = options;\n\n const invokeFunc = () => {\n const args = lastArgs!;\n const thisArg = lastThis;\n\n lastArgs = lastThis = null;\n result = func.apply(thisArg, args);\n return result;\n };\n\n return function throttled(this: any, ...args: Parameters<T>) {\n const now = Date.now();\n const remaining = wait - (now - lastCallTime);\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n lastArgs = args;\n\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n lastCallTime = now;\n if (leading) {\n result = invokeFunc();\n }\n } else if (!timeout && trailing) {\n timeout = setTimeout(() => {\n lastCallTime = Date.now();\n timeout = null;\n if (trailing && lastArgs) {\n invokeFunc();\n }\n }, remaining);\n }\n\n return result;\n };\n}\n\nexport function deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as any;\n }\n\n if (obj instanceof Array) {\n return obj.map((item) => deepClone(item)) as any;\n }\n\n if (obj instanceof Set) {\n return new Set(Array.from(obj).map((item) => deepClone(item))) as any;\n }\n\n if (obj instanceof Map) {\n return new Map(\n Array.from(obj.entries()).map(([key, value]) => [deepClone(key), deepClone(value)])\n ) as any;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as any;\n }\n\n const clonedObj = Object.create(Object.getPrototypeOf(obj));\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n clonedObj[key] = deepClone(obj[key]);\n }\n }\n\n return clonedObj;\n}\n\nexport function formatBytes(bytes: number, precision: number = 2): string {\n const units = ['B', 'KB', 'MB', 'GB', 'TB'];\n\n if (bytes === 0) return '0 B';\n if (bytes < 0) throw new Error('formatBytes: negative values not supported');\n\n const k = 1024;\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return parseFloat((bytes / Math.pow(k, i)).toFixed(precision)) + ' ' + units[i];\n}\n\nexport function formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`;\n if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;\n if (ms < 3600000) return `${Math.floor(ms / 60000)}m ${Math.floor((ms % 60000) / 1000)}s`;\n return `${Math.floor(ms / 3600000)}h ${Math.floor((ms % 3600000) / 60000)}m`;\n}\n\nexport function generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;\n}\n\nexport function isCircularReference(obj: any, seen = new WeakSet()): boolean {\n if (obj === null || typeof obj !== 'object') {\n return false;\n }\n\n if (seen.has(obj)) {\n return true;\n }\n\n seen.add(obj);\n\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && isCircularReference(obj[key], seen)) {\n return true;\n }\n }\n\n seen.delete(obj);\n return false;\n}\n\nexport function safeStringify(obj: any, indent?: number): string {\n const seen = new WeakSet();\n\n return JSON.stringify(\n obj,\n (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n\n if (typeof value === 'function') {\n return value.toString();\n }\n\n if (value instanceof Error) {\n return {\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n }\n\n return value;\n },\n indent\n );\n}\n\nexport function getStackTrace(error?: Error): string[] {\n const stack = (error || new Error()).stack || '';\n return stack\n .split('\\n')\n .slice(1)\n .map((line) => line.trim())\n .filter((line) => line.startsWith('at '));\n}\n\nexport function parseStackFrame(frame: string): {\n functionName?: string;\n fileName?: string;\n lineNumber?: number;\n columnNumber?: number;\n} | null {\n const match = frame.match(/at\\s+(?:(.+?)\\s+\\()?(.+?):(\\d+):(\\d+)\\)?$/);\n\n if (!match) {\n return null;\n }\n\n const [, functionName, fileName, lineNumber, columnNumber] = match;\n\n return {\n functionName: functionName || '<anonymous>',\n fileName: fileName || '<unknown>',\n lineNumber: parseInt(lineNumber || '0', 10),\n columnNumber: parseInt(columnNumber || '0', 10),\n };\n}\n\nexport function memoize<T extends (...args: any[]) => any>(\n fn: T,\n options: {\n maxSize?: number;\n ttl?: number;\n keyResolver?: (...args: Parameters<T>) => string;\n } = {}\n): T {\n const { maxSize = 100, ttl, keyResolver = (...args) => JSON.stringify(args) } = options;\n const cache = new Map<string, { value: ReturnType<T>; timestamp: number }>();\n\n return ((...args: Parameters<T>): ReturnType<T> => {\n const key = keyResolver(...args);\n const cached = cache.get(key);\n\n if (cached) {\n if (!ttl || Date.now() - cached.timestamp < ttl) {\n return cached.value;\n }\n cache.delete(key);\n }\n\n // Evict oldest entry BEFORE adding if at capacity\n if (cache.size >= maxSize) {\n const firstKey = cache.keys().next().value;\n if (firstKey !== undefined) {\n cache.delete(firstKey);\n }\n }\n\n const result = fn(...args);\n cache.set(key, { value: result, timestamp: Date.now() });\n\n return result;\n }) as T;\n}\n\nexport function createWorkerScript(fn: (...args: any[]) => any): string {\n return `\n self.addEventListener('message', async (event) => {\n try {\n const result = await (${fn.toString()})(event.data);\n self.postMessage({ type: 'result', data: result });\n } catch (error) {\n self.postMessage({\n type: 'error',\n error: {\n message: error instanceof Error ? error.message : String(error),\n stack: error instanceof Error ? error.stack : undefined\n }\n });\n }\n });\n `;\n}\n\nexport function createObjectURL(content: string, type = 'application/javascript'): string {\n const blob = new Blob([content], { type });\n return URL.createObjectURL(blob);\n}\n\nexport class Deferred<T> {\n promise: Promise<T>;\n resolve!: (value: T | PromiseLike<T>) => void;\n reject!: (reason?: any) => void;\n\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\n"],"mappings":";AAgEO,SAAS,SACd,MACA,MACA,UAAqD,CAAC,GACpB;AAClC,MAAI,UAAgD;AACpD,MAAI,eAAe;AACnB,MAAI;AACJ,MAAI,WAAyB;AAC7B,MAAI;AAEJ,QAAM,EAAE,UAAU,MAAM,WAAW,KAAK,IAAI;AAE5C,QAAM,aAAa,MAAM;AACvB,UAAM,OAAO;AACb,UAAM,UAAU;AAEhB,eAAW,WAAW;AACtB,aAAS,KAAK,MAAM,SAAS,IAAI;AACjC,WAAO;AAAA,EACT;AAEA,SAAO,SAAS,aAAwB,MAAqB;AAC3D,UAAM,MAAM,KAAK,IAAI;AACrB,UAA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AS,KAAK,WAAW,KAAK,CAAC;AAC5C;AAEO,SAAS,gBAAgB,OAKvB;AACP,QAAM,QAAQ,MAAM,MAAM,2CAA2C;AAErE,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,EAAE,cAAc,UAAU,YAAY,YAAY,IAAI;AAE7D,SAAO;AAAA,IACL,cAAc,gBAAgB;AAAA,IAC9B,UAAU,YAAY;AAAA,IACtB,YAAY,SAAS,cAAc,KAAK,EAAE;AAAA,IAC1C,cAAc,SAAS,gBAAgB,KAAK,EAAE;AAAA,EAChD;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/core/env.ts
|
|
2
2
|
function readNodeEnv() {
|
|
3
3
|
try {
|
|
4
|
-
return
|
|
4
|
+
return process.env.NODE_ENV;
|
|
5
5
|
} catch (e) {
|
|
6
6
|
return void 0;
|
|
7
7
|
}
|
|
@@ -9,6 +9,9 @@ function readNodeEnv() {
|
|
|
9
9
|
function defaultEnabled() {
|
|
10
10
|
return readNodeEnv() !== "production";
|
|
11
11
|
}
|
|
12
|
+
function normalizeLimit(value, fallback) {
|
|
13
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;
|
|
14
|
+
}
|
|
12
15
|
function hasDom() {
|
|
13
16
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
14
17
|
}
|
|
@@ -26,7 +29,8 @@ function escapeHtml(value) {
|
|
|
26
29
|
|
|
27
30
|
export {
|
|
28
31
|
defaultEnabled,
|
|
32
|
+
normalizeLimit,
|
|
29
33
|
hasDom,
|
|
30
34
|
escapeHtml
|
|
31
35
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-WUYUDBSC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/env.ts"],"sourcesContent":["/**\n * Helpers shared by every inspector variant.\n */\n\n/**\n * Reads `process.env.NODE_ENV` without assuming `process` exists.\n *\n * The expression is written out literally so bundlers (webpack DefinePlugin,\n * Vite, esbuild `define`, Rollup replace) substitute it at build time. In a\n * browser without such substitution, `process` is undefined and the access\n * throws, which is caught here.\n */\nexport function readNodeEnv(): string | undefined {\n try {\n return process.env.NODE_ENV;\n } catch {\n return undefined;\n }\n}\n\n/** Default for the `enabled` option: on everywhere except production builds. */\nexport function defaultEnabled(): boolean {\n return readNodeEnv() !== 'production';\n}\n\n/**\n * A size limit from user config: non-negative finite numbers are floored (0 keeps\n * nothing); anything else falls back to the default.\n */\nexport function normalizeLimit(value: unknown, fallback: number): number {\n return typeof value === 'number' && Number.isFinite(value) && value >= 0\n ? Math.floor(value)\n : fallback;\n}\n\n/** True when a DOM is available (browser, jsdom), false during SSR/Node. */\nexport function hasDom(): boolean {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\nconst HTML_ESCAPES: Record<string, string> = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`',\n};\n\n/** Escapes a value for use in HTML text or a quoted attribute. */\nexport function escapeHtml(value: unknown): string {\n return String(value).replace(/[&<>\"'`]/g, (ch) => HTML_ESCAPES[ch] as string);\n}\n"],"mappings":";AAYO,SAAS,cAAkC;AAChD,MAAI;AACF,WAAO,QAAQ,IAAI;AAAA,EACrB,SAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,iBAA0B;AACxC,SAAO,YAAY,MAAM;AAC3B;AAMO,SAAS,eAAe,OAAgB,UAA0B;AACvE,SAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,SAAS,IACnE,KAAK,MAAM,KAAK,IAChB;AACN;AAGO,SAAS,SAAkB;AAChC,SAAO,OAAO,WAAW,eAAe,OAAO,aAAa;AAC9D;AAEA,IAAM,eAAuC;AAAA,EAC3C,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;AAGO,SAAS,WAAW,OAAwB;AACjD,SAAO,OAAO,KAAK,EAAE,QAAQ,aAAa,CAAC,OAAO,aAAa,EAAE,CAAW;AAC9E;","names":[]}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
restorePatch
|
|
3
|
+
} from "./chunk-5QIYNQ4C.js";
|
|
1
4
|
import {
|
|
2
5
|
generateId,
|
|
3
6
|
getStackTrace,
|
|
4
7
|
safeStringify
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NP2SAIEA.js";
|
|
6
9
|
|
|
7
10
|
// src/monitors/console/console-interceptor.ts
|
|
8
11
|
var ConsoleInterceptor = class {
|
|
@@ -49,9 +52,7 @@ var ConsoleInterceptor = class {
|
|
|
49
52
|
}
|
|
50
53
|
uninstall() {
|
|
51
54
|
this.originalMethods.forEach((original, method) => {
|
|
52
|
-
|
|
53
|
-
console[method] = original;
|
|
54
|
-
}
|
|
55
|
+
restorePatch(console, method, this.wrappers.get(method), original);
|
|
55
56
|
});
|
|
56
57
|
this.originalMethods.clear();
|
|
57
58
|
this.wrappers.clear();
|
|
@@ -413,7 +414,10 @@ var LogFormatter = class {
|
|
|
413
414
|
"default"
|
|
414
415
|
];
|
|
415
416
|
let highlighted = code;
|
|
416
|
-
highlighted = highlighted.replace(
|
|
417
|
+
highlighted = highlighted.replace(
|
|
418
|
+
/(["'`])(?:(?=(\\?))\2.)*?\1/g,
|
|
419
|
+
'<span class="string">$&</span>'
|
|
420
|
+
);
|
|
417
421
|
highlighted = highlighted.replace(/\b(\d+)\b/g, '<span class="number">$1</span>');
|
|
418
422
|
keywords.forEach((keyword) => {
|
|
419
423
|
const regex = new RegExp(`\\b${keyword}\\b`, "g");
|
|
@@ -433,10 +437,13 @@ var ConsoleMonitor = class {
|
|
|
433
437
|
this.historyIndex = -1;
|
|
434
438
|
this.inspector = inspector;
|
|
435
439
|
this.formatter = new LogFormatter();
|
|
436
|
-
this.interceptor = new ConsoleInterceptor(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
+
this.interceptor = new ConsoleInterceptor(
|
|
441
|
+
{
|
|
442
|
+
onLog: this.handleLog.bind(this),
|
|
443
|
+
onClear: this.handleClear.bind(this)
|
|
444
|
+
},
|
|
445
|
+
inspector.getConfig().captureStackTraces
|
|
446
|
+
);
|
|
440
447
|
}
|
|
441
448
|
start() {
|
|
442
449
|
if (this.isActive) return;
|
|
@@ -568,4 +575,4 @@ var ConsoleMonitor = class {
|
|
|
568
575
|
export {
|
|
569
576
|
ConsoleMonitor
|
|
570
577
|
};
|
|
571
|
-
//# sourceMappingURL=console-monitor-
|
|
578
|
+
//# sourceMappingURL=console-monitor-AO67CSAK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/monitors/console/console-interceptor.ts","../src/monitors/console/log-formatter.ts","../src/monitors/console/console-monitor.ts"],"sourcesContent":["import { restorePatch } from '../../core/patches';\nimport { generateId, getStackTrace, safeStringify } from '../../core/utils';\n\nexport type ConsoleLevel =\n | 'log'\n | 'info'\n | 'warn'\n | 'error'\n | 'debug'\n | 'trace'\n | 'table'\n | 'group'\n | 'groupCollapsed'\n | 'groupEnd'\n | 'clear'\n | 'count'\n | 'countReset'\n | 'time'\n | 'timeEnd'\n | 'timeLog'\n | 'assert'\n | 'dir'\n | 'dirxml'\n | 'profile'\n | 'profileEnd';\n\nexport interface ConsoleEntry {\n id: string;\n level: ConsoleLevel;\n args: any[];\n formattedArgs: any[];\n timestamp: number;\n stack?: string[];\n groupLevel: number;\n source?: {\n file?: string;\n line?: number;\n column?: number;\n };\n}\n\nexport interface ConsoleEventHandler {\n onLog?: (entry: ConsoleEntry) => void;\n onClear?: () => void;\n}\n\nexport class ConsoleInterceptor {\n private originalMethods: Map<ConsoleLevel, (...args: any[]) => void> = new Map();\n private handlers: ConsoleEventHandler;\n private groupLevel: number = 0;\n private counters: Map<string, number> = new Map();\n private timers: Map<string, number> = new Map();\n private captureStackTraces: boolean;\n private wrappers: Map<ConsoleLevel, (...args: any[]) => void> = new Map();\n private handling = false;\n\n constructor(handlers: ConsoleEventHandler = {}, captureStackTraces: boolean = true) {\n this.handlers = handlers;\n this.captureStackTraces = captureStackTraces;\n }\n\n install(): void {\n const methods: ConsoleLevel[] = [\n 'log',\n 'info',\n 'warn',\n 'error',\n 'debug',\n 'trace',\n 'table',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n 'clear',\n 'count',\n 'countReset',\n 'time',\n 'timeEnd',\n 'timeLog',\n 'assert',\n 'dir',\n 'dirxml',\n 'profile',\n 'profileEnd',\n ];\n\n if (this.originalMethods.size > 0) return;\n methods.forEach((method) => {\n if (typeof (console as any)[method] !== 'function') return;\n this.originalMethods.set(method, (console as any)[method]);\n this.interceptMethod(method);\n });\n }\n\n uninstall(): void {\n this.originalMethods.forEach((original, method) => {\n // Leave methods alone that someone else has wrapped since; ours pass through once uninstalled.\n restorePatch(console, method, this.wrappers.get(method), original);\n });\n this.originalMethods.clear();\n this.wrappers.clear();\n this.counters.clear();\n this.timers.clear();\n this.groupLevel = 0;\n }\n\n private interceptMethod(method: ConsoleLevel): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const self = this;\n const original = this.originalMethods.get(method)!;\n\n const wrapper = function (...args: any[]) {\n // Call original method first\n const result = original.apply(console, args);\n\n // Uninstalled (but still wrapped by someone else), or logging from inside one\n // of our own handlers: pass through without capturing, which also prevents\n // infinite recursion when a 'console:log' listener logs.\n if (self.handling || !self.wrappers.has(method)) return result;\n self.handling = true;\n try {\n self.capture(method, args);\n } finally {\n self.handling = false;\n }\n return result;\n };\n this.wrappers.set(method, wrapper);\n (console as any)[method] = wrapper;\n }\n\n private capture(method: ConsoleLevel, args: any[]): void {\n // Handle special methods\n switch (method) {\n case 'clear':\n this.handlers.onClear?.();\n return;\n\n case 'group':\n case 'groupCollapsed':\n this.groupLevel++;\n break;\n\n case 'groupEnd':\n this.groupLevel = Math.max(0, this.groupLevel - 1);\n break;\n\n case 'count':\n this.handleCount(args[0]);\n return;\n\n case 'countReset':\n this.counters.delete(args[0] || 'default');\n return;\n\n case 'time':\n this.timers.set(args[0] || 'default', performance.now());\n return;\n\n case 'timeEnd':\n this.handleTimeEnd(args[0], 'timeEnd');\n return;\n\n case 'timeLog':\n this.handleTimeEnd(args[0], 'timeLog');\n break;\n\n case 'assert':\n if (args[0]) return; // Don't log if assertion passes\n args = args.slice(1); // Remove condition\n break;\n }\n\n // Create log entry\n const entry: ConsoleEntry = {\n id: generateId(),\n level: method,\n args: args,\n formattedArgs: this.formatArgs(args),\n timestamp: Date.now(),\n groupLevel: this.groupLevel,\n };\n\n // Capture stack trace if enabled\n if (\n this.captureStackTraces &&\n (method === 'error' || method === 'warn' || method === 'trace')\n ) {\n // Drop the getStackTrace, capture and console wrapper frames so the first frame is the caller.\n const stack = getStackTrace().slice(3);\n entry.stack = stack;\n entry.source = this.extractSourceFromStack(stack[0]);\n }\n\n this.handlers.onLog?.(entry);\n }\n\n private handleCount(label?: string): void {\n const key = label || 'default';\n const count = (this.counters.get(key) || 0) + 1;\n this.counters.set(key, count);\n\n const entry: ConsoleEntry = {\n id: generateId(),\n level: 'log',\n args: [`${key}: ${count}`],\n formattedArgs: [`${key}: ${count}`],\n timestamp: Date.now(),\n groupLevel: this.groupLevel,\n };\n\n this.handlers.onLog?.(entry);\n }\n\n private handleTimeEnd(label: string | undefined, method: 'timeEnd' | 'timeLog'): void {\n const key = label || 'default';\n const startTime = this.timers.get(key);\n\n if (startTime === undefined) {\n const entry: ConsoleEntry = {\n id: generateId(),\n level: 'warn',\n args: [`Timer '${key}' does not exist`],\n formattedArgs: [`Timer '${key}' does not exist`],\n timestamp: Date.now(),\n groupLevel: this.groupLevel,\n };\n this.handlers.onLog?.(entry);\n return;\n }\n\n const duration = performance.now() - startTime;\n\n if (method === 'timeEnd') {\n this.timers.delete(key);\n }\n\n const entry: ConsoleEntry = {\n id: generateId(),\n level: 'log',\n args: [`${key}: ${duration.toFixed(3)}ms`],\n formattedArgs: [`${key}: ${duration.toFixed(3)}ms`],\n timestamp: Date.now(),\n groupLevel: this.groupLevel,\n };\n\n this.handlers.onLog?.(entry);\n }\n\n private formatArgs(args: any[]): any[] {\n return args.map((arg) => this.formatValue(arg));\n }\n\n private formatValue(value: any): any {\n if (value === null) return 'null';\n if (value === undefined) return 'undefined';\n\n const type = typeof value;\n\n if (type === 'string' || type === 'number' || type === 'boolean') {\n return value;\n }\n\n if (value instanceof Error) {\n return {\n type: 'error',\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n }\n\n if (value instanceof Date) {\n return {\n type: 'date',\n value: value.toISOString(),\n };\n }\n\n if (value instanceof RegExp) {\n return {\n type: 'regexp',\n value: value.toString(),\n };\n }\n\n if (typeof value === 'function') {\n return {\n type: 'function',\n name: value.name || '<anonymous>',\n value: value.toString().substring(0, 100),\n };\n }\n\n if (Array.isArray(value)) {\n return {\n type: 'array',\n length: value.length,\n value: value.slice(0, 100).map((v) => this.formatValue(v)),\n };\n }\n\n if (type === 'object') {\n try {\n // Check for circular references\n const stringified = safeStringify(value, 2);\n return {\n type: 'object',\n value: JSON.parse(stringified),\n };\n } catch (error) {\n return {\n type: 'object',\n value: '[Complex Object]',\n };\n }\n }\n\n return String(value);\n }\n\n private extractSourceFromStack(stackFrame?: string): ConsoleEntry['source'] | undefined {\n if (!stackFrame) return undefined;\n\n // Match patterns like \"at functionName (file:line:column)\" or \"at file:line:column\"\n const match = stackFrame.match(/at\\s+(?:(.+?)\\s+\\()?(.+?):(\\d+):(\\d+)\\)?$/);\n\n if (!match) return undefined;\n\n const [, , file, line, column] = match as unknown as [\n string,\n string | undefined,\n string,\n string,\n string,\n ];\n\n return {\n file: file.replace(/^.*\\//, ''), // Get just filename\n line: parseInt(line, 10),\n column: parseInt(column, 10),\n };\n }\n}\n","export class LogFormatter {\n formatArgs(args: any[]): any[] {\n return args.map((arg) => this.formatValue(arg));\n }\n\n formatArgsAsText(args: any[]): string {\n return args.map((arg) => this.formatValueAsText(arg)).join(' ');\n }\n\n private formatValue(value: any): any {\n if (value === null) return 'null';\n if (value === undefined) return 'undefined';\n\n const type = typeof value;\n\n if (type === 'string' || type === 'number' || type === 'boolean') {\n return value;\n }\n\n if (value instanceof Error) {\n return {\n type: 'error',\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n }\n\n if (value instanceof Date) {\n return {\n type: 'date',\n value: value.toISOString(),\n };\n }\n\n if (value instanceof RegExp) {\n return {\n type: 'regexp',\n value: value.toString(),\n };\n }\n\n if (value instanceof Set) {\n return {\n type: 'set',\n size: value.size,\n values: Array.from(value).slice(0, 100),\n };\n }\n\n if (value instanceof Map) {\n return {\n type: 'map',\n size: value.size,\n entries: Array.from(value.entries()).slice(0, 100),\n };\n }\n\n if (value instanceof WeakSet || value instanceof WeakMap) {\n return {\n type: value instanceof WeakSet ? 'weakset' : 'weakmap',\n value: '[WeakCollection]',\n };\n }\n\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {\n return {\n type: 'arraybuffer',\n byteLength: value.byteLength,\n };\n }\n\n if (typeof value === 'function') {\n return {\n type: 'function',\n name: value.name || '<anonymous>',\n value: value.toString().substring(0, 100),\n };\n }\n\n if (Array.isArray(value)) {\n return {\n type: 'array',\n length: value.length,\n value: value.slice(0, 100).map((v) => this.formatValue(v)),\n };\n }\n\n if (type === 'object') {\n // Check if it's a formatted object from interceptor\n if (value.type && typeof value.value !== 'undefined') {\n return value;\n }\n\n try {\n const proto = Object.getPrototypeOf(value);\n const constructorName = proto?.constructor?.name || 'Object';\n\n const entries = Object.entries(value).slice(0, 100);\n const formatted: any = {\n type: 'object',\n constructor: constructorName,\n value: {},\n };\n\n for (const [key, val] of entries) {\n formatted.value[key] = this.formatValue(val);\n }\n\n if (Object.keys(value).length > 100) {\n formatted.truncated = true;\n formatted.totalKeys = Object.keys(value).length;\n }\n\n return formatted;\n } catch (error) {\n return {\n type: 'object',\n value: '[Complex Object]',\n };\n }\n }\n\n return String(value);\n }\n\n private formatValueAsText(value: any): string {\n if (value === null) return 'null';\n if (value === undefined) return 'undefined';\n\n const type = typeof value;\n\n if (type === 'string') return `\"${value}\"`;\n if (type === 'number' || type === 'boolean') return String(value);\n\n if (value.type) {\n switch (value.type) {\n case 'error':\n return `${value.name}: ${value.message}`;\n case 'date':\n return value.value;\n case 'regexp':\n return value.value;\n case 'function':\n return `[Function: ${value.name}]`;\n case 'array':\n return `Array(${value.length})`;\n case 'object':\n return value.constructor ? `${value.constructor} {...}` : 'Object {...}';\n case 'set':\n return `Set(${value.size})`;\n case 'map':\n return `Map(${value.size})`;\n default:\n return JSON.stringify(value.value);\n }\n }\n\n return JSON.stringify(value);\n }\n\n formatStackTrace(stack: string[]): string {\n return stack\n .map((frame, index) => {\n // Remove leading \"at \" if present\n const cleanFrame = frame.replace(/^\\s*at\\s+/, '');\n\n // Add indentation\n return ' '.repeat(index) + cleanFrame;\n })\n .join('\\n');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n highlightSyntax(code: string, language: 'javascript' | 'json' = 'javascript'): string {\n // Simple syntax highlighting for console display\n // In a real implementation, you might use a proper syntax highlighter\n\n const keywords = [\n 'const',\n 'let',\n 'var',\n 'function',\n 'class',\n 'if',\n 'else',\n 'for',\n 'while',\n 'return',\n 'new',\n 'this',\n 'typeof',\n 'instanceof',\n 'try',\n 'catch',\n 'finally',\n 'throw',\n 'async',\n 'await',\n 'import',\n 'export',\n 'default',\n ];\n\n let highlighted = code;\n\n // Highlight strings\n highlighted = highlighted.replace(\n /([\"'`])(?:(?=(\\\\?))\\2.)*?\\1/g,\n '<span class=\"string\">$&</span>'\n );\n\n // Highlight numbers\n highlighted = highlighted.replace(/\\b(\\d+)\\b/g, '<span class=\"number\">$1</span>');\n\n // Highlight keywords\n keywords.forEach((keyword) => {\n const regex = new RegExp(`\\\\b${keyword}\\\\b`, 'g');\n highlighted = highlighted.replace(regex, `<span class=\"keyword\">${keyword}</span>`);\n });\n\n // Highlight comments\n highlighted = highlighted.replace(/(\\/\\/.*$)/gm, '<span class=\"comment\">$1</span>');\n highlighted = highlighted.replace(/(\\/\\*[\\s\\S]*?\\*\\/)/g, '<span class=\"comment\">$1</span>');\n\n return highlighted;\n }\n}\n","import { type DevInspector } from '../../core/inspector';\nimport { ConsoleInterceptor, type ConsoleEntry } from './console-interceptor';\nimport { LogFormatter } from './log-formatter';\n\nexport interface ConsoleFilter {\n levels?: string[];\n search?: string;\n source?: string;\n}\n\nexport class ConsoleMonitor {\n private inspector: DevInspector;\n private interceptor: ConsoleInterceptor;\n private formatter: LogFormatter;\n private isActive: boolean = false;\n private commandHistory: string[] = [];\n private historyIndex: number = -1;\n\n constructor(inspector: DevInspector) {\n this.inspector = inspector;\n this.formatter = new LogFormatter();\n\n this.interceptor = new ConsoleInterceptor(\n {\n onLog: this.handleLog.bind(this),\n onClear: this.handleClear.bind(this),\n },\n inspector.getConfig().captureStackTraces\n );\n }\n\n start(): void {\n if (this.isActive) return;\n\n this.interceptor.install();\n this.setupCommandExecution();\n\n this.isActive = true;\n }\n\n stop(): void {\n if (!this.isActive) return;\n\n this.interceptor.uninstall();\n\n this.isActive = false;\n }\n\n private handleLog(entry: ConsoleEntry): void {\n const storage = this.inspector.getStorage('console');\n storage.push(entry);\n\n this.inspector.getEvents().emit('console:log', entry);\n\n // Check for errors\n if (entry.level === 'error') {\n this.inspector.getEvents().emit('error:caught', {\n message: this.formatter.formatArgs(entry.args),\n stack: entry.stack,\n timestamp: entry.timestamp,\n source: 'console',\n });\n }\n }\n\n private handleClear(): void {\n const storage = this.inspector.getStorage('console');\n storage.clear();\n\n this.inspector.getEvents().emit('console:clear');\n }\n\n private setupCommandExecution(): void {\n // This would be called by the UI to execute commands\n this.inspector.on('console:execute', (command: string) => {\n void this.executeCommand(command);\n });\n }\n\n async executeCommand(command: string): Promise<void> {\n // Add to history\n this.commandHistory.push(command);\n this.historyIndex = this.commandHistory.length;\n\n // Log the command\n const commandEntry: ConsoleEntry = {\n id: `cmd-${Date.now()}`,\n level: 'log',\n args: [`> ${command}`],\n formattedArgs: [`> ${command}`],\n timestamp: Date.now(),\n groupLevel: 0,\n };\n\n this.handleLog(commandEntry);\n\n // Execute the command\n try {\n // SECURITY WARNING: Executing arbitrary code. This should only be used in development.\n // Use Function constructor instead of eval for better security and scope control\n // Note: This still allows code execution - ensure this feature is properly controlled\n const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;\n const executionFn = new AsyncFunction('return (' + command + ')');\n const result = await executionFn.call(window);\n\n if (result !== undefined) {\n const resultEntry: ConsoleEntry = {\n id: `result-${Date.now()}`,\n level: 'log',\n args: [result],\n formattedArgs: this.formatter.formatArgs([result]),\n timestamp: Date.now(),\n groupLevel: 0,\n };\n\n this.handleLog(resultEntry);\n }\n } catch (error: any) {\n const errorEntry: ConsoleEntry = {\n id: `error-${Date.now()}`,\n level: 'error',\n args: [error],\n formattedArgs: this.formatter.formatArgs([error]),\n timestamp: Date.now(),\n groupLevel: 0,\n stack: error.stack?.split('\\n'),\n };\n\n this.handleLog(errorEntry);\n }\n }\n\n getHistory(): string[] {\n return [...this.commandHistory];\n }\n\n navigateHistory(direction: 'up' | 'down'): string | undefined {\n if (this.commandHistory.length === 0) return undefined;\n\n if (direction === 'up') {\n this.historyIndex = Math.max(0, this.historyIndex - 1);\n } else {\n this.historyIndex = Math.min(this.commandHistory.length, this.historyIndex + 1);\n }\n\n return this.commandHistory[this.historyIndex];\n }\n\n filterLogs(filter: ConsoleFilter): ConsoleEntry[] {\n const storage = this.inspector.getStorage('console');\n const logs = storage.getAll() as ConsoleEntry[];\n\n return logs.filter((log) => {\n // Filter by level\n if (filter.levels && filter.levels.length > 0) {\n if (!filter.levels.includes(log.level)) {\n return false;\n }\n }\n\n // Filter by search\n if (filter.search) {\n const searchLower = filter.search.toLowerCase();\n const argsString = JSON.stringify(log.formattedArgs).toLowerCase();\n if (!argsString.includes(searchLower)) {\n return false;\n }\n }\n\n // Filter by source\n if (filter.source && log.source?.file) {\n if (!log.source.file.includes(filter.source)) {\n return false;\n }\n }\n\n return true;\n });\n }\n\n exportLogs(format: 'json' | 'text' = 'json'): string {\n const logs = this.inspector.getStorage('console').getAll() as ConsoleEntry[];\n\n if (format === 'json') {\n return JSON.stringify(logs, null, 2);\n }\n\n // Text format\n return logs\n .map((log) => {\n const timestamp = new Date(log.timestamp).toISOString();\n const level = log.level.toUpperCase().padEnd(5);\n const args = this.formatter.formatArgsAsText(log.formattedArgs);\n const source = log.source ? ` [${log.source.file}:${log.source.line}]` : '';\n\n return `[${timestamp}] ${level} ${args}${source}`;\n })\n .join('\\n');\n }\n}\n"],"mappings":";;;;;;;;;;AA8CO,IAAM,qBAAN,MAAyB;AAAA,EAU9B,YAAY,WAAgC,CAAC,GAAG,qBAA8B,MAAM;AATpF,SAAQ,kBAA+D,oBAAI,IAAI;AAE/E,SAAQ,aAAqB;AAC7B,SAAQ,WAAgC,oBAAI,IAAI;AAChD,SAAQ,SAA8B,oBAAI,IAAI;AAE9C,SAAQ,WAAwD,oBAAI,IAAI;AACxE,SAAQ,WAAW;AAGjB,SAAK,WAAW;AAChB,SAAK,qBAAqB;AAAA,EAC5B;AAAA,EAEA,UAAgB;AACd,UAAM,UAA0B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,QAAI,KAAK,gBAAgB,OAAO,EAAG;AACnC,YAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAI,OAAQ,QAAgB,MAAM,MAAM,WAAY;AACpD,WAAK,gBAAgB,IAAI,QAAS,QAAgB,MAAM,CAAC;AACzD,WAAK,gBAAgB,MAAM;AAAA,IAC7B,CAAC;AAAA,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