iobroker.javascript 10.2.3 → 10.2.4
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/README.md +2 -1
- package/admin/assets/{AiChatPanel-DsQB1Hb5.js → AiChatPanel-AZko1BsN.js} +2 -2
- package/admin/assets/Debugger-CVDh3kgz.js +15 -0
- package/admin/assets/RulesEditor-D3kTbD_T.css +1 -0
- package/admin/assets/RulesEditor-DsO4cKIk.js +1 -0
- package/admin/assets/{ScriptEditor-BkuL2lZ1.js → ScriptEditor-BCGahS47.js} +1 -1
- package/admin/assets/{ScriptEditorVanillaMonaco-DYNr4-5w.js → ScriptEditorVanillaMonaco-BDAw2Bw6.js} +2 -2
- package/admin/assets/aiPromptBuilder-aJfHa-eU.js +1 -0
- package/admin/assets/{blocks_action-EYzXGRHi.js → blocks_action-DS28sNfo.js} +1 -1
- package/admin/assets/{blocks_convert-BewF036e.js → blocks_convert-CLb0DLyc.js} +1 -1
- package/admin/assets/{blocks_logic-BEcVdiZ4.js → blocks_logic-Dpp2fwlu.js} +1 -1
- package/admin/assets/{blocks_number-Cp7J-juL.js → blocks_number-N4IfHvYD.js} +1 -1
- package/admin/assets/{blocks_object-CCe0acSu.js → blocks_object-uK7FHVhS.js} +1 -1
- package/admin/assets/{blocks_procedures-BzFeWYcX.js → blocks_procedures-C_KD0Bm6.js} +1 -1
- package/admin/assets/{blocks_sendto-EBwcaHpm.js → blocks_sendto-BxCMg9X4.js} +1 -1
- package/admin/assets/{blocks_switch-CjohzLLS.js → blocks_switch-C8Rls5pK.js} +1 -1
- package/admin/assets/{blocks_system-D9V3f3Vv.js → blocks_system-CEQnj5fY.js} +1 -1
- package/admin/assets/{blocks_text-CnEbzx6V.js → blocks_text-BDEWxu0P.js} +1 -1
- package/admin/assets/{blocks_time-B5OcgKMo.js → blocks_time-aHQQK1Uz.js} +1 -1
- package/admin/assets/{blocks_timeout-ONu3mIX3.js → blocks_timeout-C2L93TLJ.js} +1 -1
- package/admin/assets/{blocks_trigger-3DujkROX.js → blocks_trigger-XivsIDE5.js} +1 -1
- package/admin/assets/{helpers-BiP5KGR8.js → helpers-DiwtLpXM.js} +1 -1
- package/admin/assets/{index-CRX4LAhD.js → index-B0FfAYMN.js} +6 -6
- package/admin/assets/{mf-entry-bootstrap-0-4b82aeb4.js → mf-entry-bootstrap-0-019228a5.js} +1 -1
- package/admin/mf-stats.json +1 -1
- package/admin/tab.html +2 -2
- package/build/lib/inspect.js +547 -632
- package/build/lib/inspect.js.map +1 -1
- package/build/main.js +8 -13
- package/build/main.js.map +1 -1
- package/io-package.json +14 -14
- package/package.json +1 -1
- package/admin/assets/Debugger-CcDNCkmw.js +0 -15
- package/admin/assets/RulesEditor-B6YQNZfq.js +0 -1
- package/admin/assets/RulesEditor-BwQ6Bo1V.css +0 -1
- package/admin/assets/aiPromptBuilder-db3Z4xhV.js +0 -1
- package/build/lib/debugger.js +0 -1135
- package/build/lib/debugger.js.map +0 -1
package/build/lib/inspect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/lib/inspect.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2DAAgF;AAChF,6CAA2C;AAC3C,uCAAmC;AACnC,yCAA2F;AAC3F,yCAA4C;AAC5C,qCAAqC;AAGrC,sCAAsC;AACtC,8FAAqE;AAGrE,0DAAoC;AAgBpC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE7D,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,SAAS,CAAC,CAAC;AACzC,IAAI,SAAwB,CAAC;AAC7B,IAAI,aAAa,GAAG,EAAE,CAAC,CAAC,eAAe;AACvC,IAAI,eAAe,GAAG,EAAE,CAAC,CAAC,YAAY;AACtC,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,MAAM,Y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AE,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;IACL,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright Node.js contributors. All rights reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nimport { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process';\nimport { EventEmitter } from 'node:events';\nimport { connect } from 'node:net';\nimport { debuglog as utilDebugLog, inspect, type InspectOptionsStylized } from 'node:util';\nimport { normalize, join } from 'node:path';\nimport { existsSync } from 'node:fs';\nimport type { WriteStream, ReadStream } from 'node:tty';\n\n// @ts-expect-error no types available\nimport InspectClient from 'node-inspect/lib/internal/inspect_client';\nimport type { Debugger, Runtime } from 'node:inspector';\nimport type { REPLServer } from 'node:repl';\nimport createRepl from './debugger';\n// const runAsStandalone = typeof __dirname !== 'undefined';\n\ninterface DebugValue {\n type: 'function' | 'string' | 'boolean' | 'number' | 'object' | 'undefined' | 'null' | 'bigint' | 'symbol';\n description: string;\n value: any;\n}\ninterface DebugVariable {\n name: string;\n value: DebugValue;\n configurable?: boolean;\n enumerable?: boolean;\n isOwn?: boolean;\n writable?: boolean;\n}\nconst breakOnStart = process.argv.includes('--breakOnStart');\n\nconst debuglog = utilDebugLog('inspect');\nlet inspector: NodeInspector;\nlet scriptToDebug = ''; // script.js.yy\nlet instanceToDebug = ''; // adapter.X\nlet alreadyPausedOnFirstLine = false;\n\nclass StartupError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StartupError';\n }\n}\n\nfunction portIsFree(host: string, port: number, timeout: number = 9999): Promise<void> {\n if (port === 0) {\n // Binding to a random port.\n return Promise.resolve();\n }\n\n const retryDelay = 150;\n let didTimeOut = false;\n\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n didTimeOut = true;\n reject(new StartupError(`Timeout (${timeout}) waiting for ${host}:${port} to be free`));\n }, timeout);\n\n function pingPort(): void {\n if (didTimeOut) {\n return;\n }\n\n const socket = connect(port, host);\n let didRetry = false;\n function retry(): void {\n if (!didRetry && !didTimeOut) {\n didRetry = true;\n setTimeout(pingPort, retryDelay);\n }\n }\n\n socket.on('error', (error: Error) => {\n if ((error as any).code === 'ECONNREFUSED') {\n resolve();\n } else {\n retry();\n }\n });\n socket.on('connect', () => {\n socket.destroy();\n retry();\n });\n }\n pingPort();\n });\n}\n\nfunction runScript(\n script: string,\n scriptArgs: string[] | undefined,\n inspectHost: string,\n inspectPort: number,\n childPrint: (text: string, isError?: boolean) => void,\n): Promise<[ChildProcessWithoutNullStreams, number, string]> {\n script = normalize(script);\n return portIsFree(inspectHost, inspectPort).then(() => {\n return new Promise(resolve => {\n const args = [breakOnStart ? `--inspect-brk=${inspectPort}` : `--inspect=${inspectPort}`].concat(\n [script],\n scriptArgs || [],\n );\n const child = spawn(process.execPath, args);\n child.stdout.setEncoding('utf8');\n child.stderr.setEncoding('utf8');\n child.stdout.on('data', childPrint);\n child.stderr.on('data', text => childPrint(text, true));\n\n let output = '';\n function waitForListenHint(text: string): void {\n output += text;\n const res = /Debugger listening on ws:\\/\\/\\[?(.+?)]?:(\\d+)\\//.exec(output);\n if (res) {\n const host = res[1];\n const port = Number.parseInt(res[2]);\n child.stderr.removeListener('data', waitForListenHint);\n resolve([child, port, host]);\n }\n }\n\n child.stderr.on('data', waitForListenHint);\n });\n });\n}\n\nfunction createAgentProxy(domain: string, client: InspectClient): ProxyConstructor {\n const agent: any = new EventEmitter();\n\n agent.then = (...args: any[]) => {\n // TODO: potentially fetch the protocol and pretty-print it here.\n const descriptor = {\n [inspect.custom](_depth: number, { stylize }: InspectOptionsStylized): string {\n return stylize(`[Agent ${domain}]`, 'special');\n },\n };\n return Promise.resolve(descriptor).then(...args);\n };\n\n return new Proxy(agent, {\n get(target, name: string) {\n if (name in target) {\n return target[name];\n }\n return function callVirtualMethod(params: any) {\n return client.callMethod(`${domain}.${name}`, params);\n };\n },\n });\n}\n\ntype CommandToHostType =\n | 'log'\n | 'paused'\n | 'resumed'\n | 'setValue'\n | 'scope'\n | 'cb'\n | 'sb'\n | 'script'\n | 'ready'\n | 'readyToDebug'\n | 'error'\n | 'finished'\n | 'expressions'\n | 'stopOnException'\n | 'getPossibleBreakpoints';\n\ntype DebuggerContext = {\n url: string;\n scriptId: Runtime.ScriptId;\n reason: string;\n executionContextId: number;\n type: string;\n id: number;\n args: { value: any }[];\n};\n\ntype CommandToHost = {\n cmd: CommandToHostType;\n text?: string;\n expr?: { name: string };\n bp?: Debugger.Location;\n context?: DebuggerContext | null | string;\n error?: Error | string;\n errorContext?: Error;\n id?: Debugger.BreakpointId; // breakpoint ID\n breakpoints?: Debugger.Location[];\n scriptId?: Runtime.ScriptId;\n scopes?: Debugger.Scope[];\n variableName?: string;\n scopeNumber?: number;\n newValue?: string;\n callFrameId?: string;\n expressions?: { name: string; result: any }[];\n script?: string;\n url?: string;\n severity?: 'warn' | 'error';\n ts?: number;\n};\n\ninterface NodeInspectorOptions {\n script?: string | null;\n scriptArgs?: string[];\n isRemote?: boolean;\n host: string;\n port: number;\n}\n\nexport class NodeInspector {\n options: NodeInspectorOptions;\n stdin: ReadStream;\n stdout: WriteStream;\n scripts: Record<string, Promise<{ script: string; scriptId: Runtime.ScriptId }> | null>;\n delayedContext: DebuggerContext | null;\n paused: boolean;\n child: ChildProcessWithoutNullStreams | null;\n _runScript: () => Promise<[ChildProcessWithoutNullStreams | null, number, string]>;\n\n client: InspectClient;\n\n Debugger: InspectClient;\n HeapProfiler: InspectClient;\n Profiler: InspectClient;\n Runtime: InspectClient;\n\n handleDebugEvent: (fullName: string, params: DebuggerContext) => void;\n mainScriptId: Runtime.ScriptId | undefined;\n mainFile: string | undefined;\n repl: REPLServer | undefined;\n\n constructor(options: NodeInspectorOptions, stdin: ReadStream, stdout: WriteStream) {\n this.options = options;\n this.stdin = stdin;\n this.stdout = stdout;\n this.scripts = {};\n this.delayedContext = null;\n\n this.paused = true;\n this.child = null;\n\n if (options.script) {\n this._runScript = runScript.bind(\n null,\n options.script,\n options.scriptArgs,\n options.host,\n options.port,\n this.childPrint.bind(this),\n );\n } else {\n this._runScript = () => Promise.resolve([null, options.port, options.host]);\n }\n\n this.client = new InspectClient();\n\n this.Debugger = createAgentProxy('Debugger', this.client);\n this.HeapProfiler = createAgentProxy('HeapProfiler', this.client);\n this.Profiler = createAgentProxy('Profiler', this.client);\n this.Runtime = createAgentProxy('Runtime', this.client);\n\n this.handleDebugEvent = (\n fullName: string,\n params: {\n url: string;\n scriptId: Runtime.ScriptId;\n reason: string;\n executionContextId: number;\n type: string;\n id: number;\n args: { value: any }[];\n },\n ): void => {\n const [domain, name] = fullName.split('.');\n\n if (domain === 'Debugger' && name === 'scriptParsed') {\n // console.log(`Parsed: ${params.url}`);\n if (\n (scriptToDebug && params.url.includes(scriptToDebug)) ||\n (instanceToDebug && params.url.includes(instanceToDebug))\n ) {\n console.log(`My scriptID: ${params.scriptId}`);\n this.mainScriptId = params.scriptId;\n this.mainFile = params.url.replace('file:///', '');\n // load text of a script\n this.scripts[this.mainScriptId] = this.Debugger.getScriptSource({\n scriptId: this.mainScriptId,\n }).then((script: Debugger.GetScriptSourceReturnType) => ({\n script: script.scriptSource,\n scriptId: this.mainScriptId,\n }));\n\n // sometimes the pause event comes before scriptParsed\n if (this.delayedContext) {\n console.log('Send to debugger: readyToDebug');\n void this.scripts[this.mainScriptId]?.then(data => {\n // console.log(`Send to debugger: readyToDebug ${JSON.stringify(data)}`);\n sendToHost({\n cmd: 'readyToDebug',\n scriptId: this.mainScriptId,\n script: data.script,\n context: this.delayedContext,\n url: this.mainFile,\n });\n this.delayedContext = null;\n });\n }\n }\n return;\n } else if (domain === 'Debugger' && name === 'resumed') {\n this.Debugger.emit(name, params);\n sendToHost({ cmd: 'resumed', context: params });\n return;\n } else if (domain === 'Debugger' && name === 'paused') {\n console.log(`PAUSED!! ${alreadyPausedOnFirstLine}`);\n if (!alreadyPausedOnFirstLine && params.reason === 'exception') {\n // ignore all exceptions by start\n this.Debugger.resume();\n return;\n }\n //console.warn(`${fullName}: => \\n${JSON.stringify(params, null, 2)}`);\n this.Debugger.emit(name, params);\n\n if (!alreadyPausedOnFirstLine) {\n alreadyPausedOnFirstLine = true;\n // sometimes the pause event comes before scriptParsed\n if (this.mainScriptId && this.scripts[this.mainScriptId]) {\n void this.scripts[this.mainScriptId]?.then(data =>\n sendToHost({\n cmd: 'readyToDebug',\n scriptId: data.scriptId,\n script: data.script,\n context: params,\n url: this.mainFile,\n }),\n );\n } else {\n // store context to send it later when script ID will be known\n this.delayedContext = params;\n console.log('PAUSED, but no scriptId');\n }\n } else {\n // this.scripts[params.loca]\n // .then(data =>\n sendToHost({ cmd: 'paused', context: params });\n }\n return;\n }\n\n if (domain === 'Runtime') {\n //console.warn(`${fullName}: => \\n${JSON.stringify(params, null, 2)}`);\n }\n if (domain === 'Runtime' && name === 'consoleAPICalled') {\n const text = params.args[0].value;\n if (instanceToDebug) {\n sendToHost({\n cmd: 'log',\n severity: params.type === 'warning' ? 'warn' : 'error',\n text,\n ts: Date.now(),\n });\n } else if (text.includes(`$$${scriptToDebug}$$`)) {\n console.log(`${fullName} [${params.executionContextId}]: => ${text}`);\n const [severity, _text] = text.split(`$$${scriptToDebug}$$`);\n sendToHost({\n cmd: 'log',\n severity: severity as 'warn' | 'error',\n text: _text,\n ts: params.args[1] && params.args[1].value ? (params.args[1].value as number) : Date.now(),\n });\n } else if (params.type === 'warning' || params.type === 'error') {\n sendToHost({\n cmd: 'log',\n severity: params.type === 'warning' ? 'warn' : 'error',\n text,\n ts: Date.now(),\n });\n }\n return;\n } else if (domain === 'Runtime' && (params.id === 2 || params.executionContextId === 2)) {\n if (name === 'executionContextCreated') {\n console.warn(`${fullName}: =>\\n${JSON.stringify(params, null, 2)}`);\n } else if (name === 'executionContextDestroyed') {\n console.warn(`${fullName}: =>\\n${JSON.stringify(params, null, 2)}`);\n sendToHost({ cmd: 'finished', context: params });\n }\n return;\n } else if (\n domain === 'Runtime' &&\n name === 'executionContextDestroyed' &&\n params.executionContextId === 1\n ) {\n sendToHost({ cmd: 'finished', context: params });\n console.log('Exited!');\n setTimeout(() => process.exit(125), 200);\n } else if (domain === 'Debugger' && name === 'scriptFailedToParse') {\n // ignore\n return;\n }\n\n console.warn(`${fullName}: =>\\n${JSON.stringify(params, null, 2)}`);\n\n /*if (domain in this) {\n this[domain].emit(name, params);\n }*/\n };\n this.client.on('debugEvent', this.handleDebugEvent);\n const startRepl: () => REPLServer = createRepl(this);\n\n // Handle all possible exits\n process.on('exit', () => this.killChild());\n process.once('SIGTERM', process.exit.bind(process, 0));\n process.once('SIGHUP', process.exit.bind(process, 0));\n\n this.run()\n .then(() => startRepl())\n .then(repl => {\n this.repl = repl;\n this.repl.on('exit', () => process.exit(0));\n this.paused = false;\n })\n .then(null, error =>\n process.nextTick(() => {\n throw error;\n }),\n );\n }\n\n suspendReplWhile(fn: () => any): Promise<void> {\n if (this.repl) {\n this.repl.pause();\n }\n this.stdin.pause();\n this.paused = true;\n\n return new Promise(resolve => resolve(fn()))\n .then(() => {\n this.paused = false;\n if (this.repl) {\n this.repl.resume();\n this.repl.displayPrompt();\n }\n this.stdin.resume();\n })\n .then(null, error =>\n process.nextTick(() => {\n throw error;\n }),\n );\n }\n\n killChild(): void {\n this.client.reset();\n if (this.child) {\n this.child.kill();\n this.child = null;\n }\n }\n\n run(): Promise<void> {\n this.killChild();\n\n return this._runScript().then(([child, port, host]) => {\n this.child = child;\n\n let connectionAttempts = 0;\n const attemptConnect = (): void => {\n ++connectionAttempts;\n debuglog('connection attempt #%d', connectionAttempts);\n this.stdout.write('.');\n return this.client.connect(port, host).then(\n () => {\n debuglog('connection established');\n this.stdout.write(' ok');\n },\n (error: unknown): Promise<void> => {\n debuglog('connect failed', error);\n // If it's failed to connect 10 times, then print a failed message\n if (connectionAttempts >= 10) {\n this.stdout.write(' failed to connect, please retry\\n');\n process.exit(1);\n }\n\n return new Promise(resolve => setTimeout(resolve, 500)).then(attemptConnect);\n },\n );\n };\n\n this.print(`connecting to ${host}:${port} ..`, true);\n return attemptConnect();\n });\n }\n\n clearLine(): void {\n if (this.stdout.isTTY) {\n this.stdout.cursorTo(0);\n this.stdout.clearLine(1);\n } else {\n this.stdout.write('\\b');\n }\n }\n\n print(text: string, oneLine: boolean = false): void {\n this.clearLine();\n this.stdout.write(oneLine ? text : `${text}\\n`);\n }\n\n childPrint(text: string, isError?: boolean): void {\n isError &&\n this.print(\n text\n .toString()\n .split(/\\r\\n|\\r|\\n/g)\n .filter((chunk: string) => !!chunk)\n .map((chunk: string) => `< ${chunk}`)\n .join('\\n'),\n );\n if (!this.paused) {\n this.repl?.displayPrompt(true);\n }\n if (/Waiting for the debugger to disconnect\\.\\.\\.\\n$/.test(text)) {\n this.killChild();\n sendToHost({ cmd: 'finished', text });\n }\n }\n}\n\nfunction parseArgv([target, ...args]: string[]): NodeInspectorOptions {\n let host = '127.0.0.1';\n let port = 9229;\n let isRemote = false;\n let script: string | null = target;\n let scriptArgs = args;\n\n const hostMatch = target.match(/^([^:]+):(\\d+)$/);\n const portMatch = target.match(/^--port=(\\d+)$/);\n\n if (hostMatch) {\n // Connecting to remote debugger\n // `node-inspect localhost:9229`\n host = hostMatch[1];\n port = parseInt(hostMatch[2], 10);\n isRemote = true;\n script = null;\n } else if (portMatch) {\n // start debugee on custom port\n // `node inspect --port=9230 script.js`\n port = parseInt(portMatch[1], 10);\n script = args[0];\n scriptArgs = args.slice(1);\n } else if (args.length === 1 && /^\\d+$/.test(args[0]) && target === '-p') {\n // Start debugger against a given pid\n const pid = parseInt(args[0], 10);\n try {\n // Windows does not support UNIX signals. To enable debugging, you can use an undocumented API function\n // https://github.com/node-inspector/node-inspector?tab=readme-ov-file#windows\n // @ts-expect-error undocumented function\n process._debugProcess(pid);\n } catch (e: unknown) {\n if (e && (e as any).code === 'ESRCH') {\n console.error(`Target process: ${pid} doesn't exist.`);\n process.exit(1);\n }\n throw e;\n }\n script = null;\n isRemote = true;\n }\n\n return {\n host,\n port,\n isRemote,\n script,\n scriptArgs,\n };\n}\n\nfunction startInspect(\n argv: string[] = process.argv.slice(2),\n stdin: ReadStream = process.stdin,\n stdout: WriteStream = process.stdout,\n): void {\n /*\n if (argv.length < 1) {\n const invokedAs = runAsStandalone ? 'node-inspect' : `${process.argv0} ${process.argv[1]}`;\n\n console.error(`Usage: ${invokedAs} script.js`);\n console.error(` ${invokedAs} <host>:<port>`);\n console.error(` ${invokedAs} -p <pid>`);\n process.exit(1);\n }\n */\n\n const options = parseArgv(argv);\n inspector = new NodeInspector(options, stdin, stdout);\n\n stdin.resume();\n\n function handleUnexpectedError(e: Error): void {\n if (!(e instanceof StartupError)) {\n console.error('There was an internal error in node-inspect. Please report this bug.');\n console.error(e.message);\n console.error(e.stack);\n } else {\n console.error(e.message);\n }\n inspector.child?.kill();\n process.exit(1);\n }\n\n process.on('uncaughtException', handleUnexpectedError);\n}\n\nfunction extractErrorMessage(stack: string | undefined): string {\n if (!stack) {\n return '<unknown>';\n }\n const m = stack.match(/^\\w+: ([^\\n]+)/);\n return m ? m[1] : stack;\n}\n\nfunction convertResultToError(result: Runtime.RemoteObject): Error {\n const { className, description } = result;\n const err = new Error(extractErrorMessage(description));\n err.stack = description;\n Object.defineProperty(err, 'name', { value: className });\n return err;\n}\n\nprocess.on('message', (message: DebugCommand | string): void => {\n if (typeof message === 'string') {\n try {\n message = JSON.parse(message) as DebugCommand;\n } catch {\n return console.error(`Cannot parse: ${JSON.stringify(message)}`);\n }\n }\n processCommand(message);\n});\n\nsendToHost({ cmd: 'ready' });\n\n// possible commands\n// start - {cmd: 'start', scriptName: 'script.js.myName'} - start the debugging\n// end - {cmd: 'end'} - end the debugging and stop process\n// source - {cmd: 'source', scriptId} - read text of script by id\n// watch - {cmd: 'watch', expressions: ['i']} - add to watch the variable\n// unwatch - {cmd: 'unwatch', expressions: ['i']} - add to watch the variable\n\n// sb - {cmd: 'sb', breakpoints: [{scriptId: 50, lineNumber: 4, columnNumber: 0}]} - set breakpoint\n// cb - {cmd: 'cb', breakpoints: [{scriptId: 50, lineNumber: 4, columnNumber: 0}]} - clear breakpoint\n\n// pause - {cmd: 'pause'} - pause execution\n// cont - {cmd: 'cont'} - resume execution\n// next - {cmd: 'next'} - Continue to next line in current file\n// step - {cmd: 'step'} - Step into, potentially entering a function\n// out - {cmd: 'step'} - Step out, leaving the current function\n\ntype DebugCommandType =\n | 'start'\n | 'end'\n | 'source'\n | 'watch'\n | 'unwatch'\n | 'sb'\n | 'cb'\n | 'pause'\n | 'cont'\n | 'next'\n | 'step'\n | 'out'\n | 'scope'\n | 'setValue'\n | 'expressions'\n | 'stopOnException'\n | 'getPossibleBreakpoints'\n | 'error';\n\ntype DebugCommand = {\n cmd: DebugCommandType;\n scriptName?: string;\n scriptId?: Runtime.ScriptId;\n instance?: number;\n adapterInstance?: string;\n breakpoints?: Debugger.Location[] | Debugger.BreakpointId[];\n expressions?: { name: string }[];\n scopes?: Debugger.Scope[];\n\n variableName?: string;\n scopeNumber?: number;\n newValue?: string;\n callFrameId?: string;\n state?: boolean;\n\n start?: number;\n end?: number;\n};\n\nfunction processCommand(data: DebugCommand): void {\n console.log(`[DEBUGGER]: processCommand: ${JSON.stringify(data)}`);\n\n if (data.cmd === 'start') {\n scriptToDebug = data.scriptName as string;\n // we can request the script by name or iobroker instance to debug\n if (scriptToDebug) {\n startInspect([\n `${__dirname}/../main.js`,\n (data.instance || 0).toString(),\n '--debug',\n '--debugScript',\n scriptToDebug,\n ]);\n } else {\n instanceToDebug = data.adapterInstance as string;\n const [adapter, instance] = instanceToDebug.split('.');\n let file: string | undefined;\n try {\n file = require.resolve(`iobroker.${adapter}`);\n } catch (e: unknown) {\n // try to locate in the same dir\n const dir = normalize(join(__dirname, '..', `iobroker.${adapter}`));\n if (existsSync(dir)) {\n const pack = require(join(dir, 'package.json'));\n if (existsSync(join(dir, pack.main || `${adapter}.js`))) {\n file = join(dir, pack.main || `${adapter}.js`);\n }\n }\n\n if (!file) {\n sendToHost({ cmd: 'error', error: `Cannot locate iobroker.${adapter}`, errorContext: e as Error });\n setTimeout(() => {\n sendToHost({ cmd: 'finished', context: `Cannot locate iobroker.${adapter}` });\n setTimeout(() => process.exit(124), 500);\n }, 200);\n return;\n }\n }\n file = file.replace(/\\\\/g, '/');\n instanceToDebug = file;\n console.log(`Start ${file} ${instance} --debug`);\n startInspect([file, instance, '--debug']);\n }\n } else if (data.cmd === 'end') {\n process.exit();\n } else if (data.cmd === 'source') {\n inspector.Debugger.getScriptSource({ scriptId: data.scriptId }).then(\n (script: Debugger.GetScriptSourceReturnType) =>\n sendToHost({ cmd: 'script', scriptId: data.scriptId, text: script.scriptSource }),\n );\n } else if (data.cmd === 'cont') {\n inspector.Debugger.resume().catch((e: unknown) => sendToHost({ cmd: 'error', error: e as Error }));\n } else if (data.cmd === 'next') {\n inspector.Debugger.stepOver().catch((e: unknown) => sendToHost({ cmd: 'error', error: e as Error }));\n } else if (data.cmd === 'pause') {\n inspector.Debugger.pause().catch((e: unknown) => sendToHost({ cmd: 'error', error: e as Error }));\n } else if (data.cmd === 'step') {\n inspector.Debugger.stepInto().catch((e: unknown) => sendToHost({ cmd: 'error', error: e as Error }));\n } else if (data.cmd === 'out') {\n inspector.Debugger.stepOut().catch((e: unknown) => sendToHost({ cmd: 'error', error: e as Error }));\n } else if (data.cmd === 'sb') {\n console.log(JSON.stringify(data));\n\n void Promise.all(\n (data.breakpoints as Debugger.Location[])?.map((bp: Debugger.Location) =>\n inspector.Debugger.setBreakpoint({\n location: {\n scriptId: bp.scriptId,\n lineNumber: bp.lineNumber,\n columnNumber: bp.columnNumber,\n },\n })\n .then((result: Debugger.SetBreakpointReturnType) => ({\n id: result.breakpointId,\n location: result.actualLocation,\n }))\n .catch((e: unknown) =>\n sendToHost({\n cmd: 'error',\n error: `Cannot set breakpoint: ${e as Error}`,\n errorContext: e as Error,\n bp,\n }),\n ),\n ) || [],\n ).then(breakpoints => sendToHost({ cmd: 'sb', breakpoints }));\n } else if (data.cmd === 'cb') {\n void Promise.all(\n (data.breakpoints as Debugger.BreakpointId[])?.map(breakpointId =>\n inspector.Debugger.removeBreakpoint({ breakpointId })\n .then(() => breakpointId)\n .catch((e: unknown) => {\n console.error(`[DEBUGGER]: Cannot clear breakpoint: ${e as Error}`);\n sendToHost({\n cmd: 'error',\n error: `Cannot clear breakpoint: ${e as Error}`,\n errorContext: e as Error,\n id: breakpointId,\n });\n }),\n ) || [],\n ).then(breakpoints => {\n console.error(`[DEBUGGER]: sent breakpoints ${JSON.stringify(breakpoints)}`);\n sendToHost({ cmd: 'cb', breakpoints });\n });\n } else if (data.cmd === 'watch') {\n void Promise.all(\n data.expressions?.map(expr =>\n inspector.Debugger.watch(expr).catch((e: unknown) =>\n sendToHost({\n cmd: 'error',\n error: `Cannot watch expr: ${e as Error}`,\n errorContext: e as Error,\n expr,\n }),\n ),\n ) || [],\n ).then(() => console.log('Watch done'));\n } else if (data.cmd === 'unwatch') {\n void Promise.all(\n data.expressions?.map(expr =>\n inspector.Debugger.unwatch(expr).catch((e: unknown) =>\n sendToHost({\n cmd: 'error',\n error: `Cannot unwatch expr: ${e as Error}`,\n errorContext: e as Error,\n expr,\n }),\n ),\n ) || [],\n ).then(() => console.log('Watch done'));\n } else if (data.cmd === 'scope') {\n void Promise.all(\n data.scopes\n ?.filter(scope => scope?.object?.objectId)\n .map(scope =>\n inspector.Runtime.getProperties({\n objectId: scope.object.objectId,\n generatePreview: true,\n })\n .then((result: { result: DebugVariable[] }) => {\n return { type: scope.type, properties: result };\n })\n .catch((e: unknown) =>\n sendToHost({\n cmd: 'error',\n error: `Cannot get scopes expr: ${e as Error}`,\n errorContext: e as Error,\n }),\n ),\n ) || [],\n ).then(scopes => sendToHost({ cmd: 'scope', scopes }));\n } else if (data.cmd === 'setValue') {\n inspector.Debugger.setVariableValue({\n variableName: data.variableName,\n scopeNumber: data.scopeNumber,\n newValue: data.newValue,\n callFrameId: data.callFrameId,\n })\n .catch((e: unknown) => {\n console.error(`Cannot setValue \"${data.variableName}\": ${e as Error}`);\n sendToHost({\n cmd: 'setValue',\n variableName: `Cannot setValue: ${e as Error}`,\n errorContext: e as Error,\n });\n })\n .then(() => {\n console.log(`setValue \"${data.variableName}\" successful`);\n sendToHost({\n cmd: 'setValue',\n variableName: data.variableName,\n scopeNumber: data.scopeNumber,\n newValue: data.newValue,\n callFrameId: data.callFrameId,\n });\n });\n } else if (data.cmd === 'expressions') {\n void Promise.all(\n data.expressions?.map(item =>\n inspector.Debugger.evaluateOnCallFrame({\n callFrameId: data.callFrameId,\n expression: item.name,\n objectGroup: 'node-inspect',\n returnByValue: true,\n generatePreview: true,\n })\n // @ts-expect-error fix later\n .then(({ result, wasThrown }: Debugger.EvaluateOnCallFrameReturnType) => {\n if (wasThrown) {\n return { name: item.name, result: convertResultToError(result) };\n }\n return { name: item.name, result };\n })\n .catch((e: unknown) =>\n sendToHost({\n cmd: 'expressions',\n variableName: `Cannot setValue: ${e as Error}`,\n errorContext: e as Error,\n }),\n ),\n ) || [],\n ).then(expressions => {\n sendToHost({ cmd: 'expressions', expressions });\n });\n } else if (data.cmd === 'stopOnException') {\n inspector.Debugger.setPauseOnExceptions({\n state: data.state ? 'all' : 'none',\n }).catch((e: unknown) =>\n sendToHost({\n cmd: 'stopOnException',\n variableName: `Cannot stopOnException: ${e as Error}`,\n errorContext: e as Error,\n }),\n );\n } else if (data.cmd === 'getPossibleBreakpoints') {\n inspector.Debugger.getPossibleBreakpoints({ start: data.start, end: data.end })\n .then((breakpoints: Debugger.GetPossibleBreakpointsReturnType) =>\n sendToHost({ cmd: 'getPossibleBreakpoints', breakpoints: breakpoints.locations }),\n )\n .catch((e: unknown) =>\n sendToHost({\n cmd: 'getPossibleBreakpoints',\n variableName: `Cannot getPossibleBreakpoints: ${e as Error}`,\n errorContext: e as Error,\n }),\n );\n } else {\n console.error(`Unknown command: ${JSON.stringify(data)}`);\n }\n}\n\nfunction sendToHost(data: CommandToHost): void {\n if (data.cmd === 'error') {\n console.error(data.text);\n if (data.expr) {\n console.error(`[EXPRESSION] ${JSON.stringify(data.expr)}`);\n }\n if (data.bp) {\n console.error(`[BP] ${JSON.stringify(data.bp)}`);\n }\n }\n\n if (process.send) {\n process.send(JSON.stringify(data));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/lib/inspect.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;AAEH;;;;;;;;GAQG;AACH,2DAAgF;AAChF,qCAAmD;AAEnD,yCAA4C;AAC5C,uCAAyC;AACzC,yCAAqD;AAErD,sCAAsC;AACtC,8FAAqE;AAErE,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,SAAS,CAAC,CAAC;AAEzC,0GAA0G;AAC1G,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE7D;;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AAC;AAEH,UAAU,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC","sourcesContent":["/*\n * Copyright Node.js contributors. All rights reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/*\n * The inspector process. It is forked by the adapter (see `debugStart` in main.ts) and starts the process to debug -\n * the javascript adapter itself with `--debugScript <scriptId>` or another adapter - with an enabled inspector.\n * It connects to it via the DevTools protocol and translates the commands of the GUI into protocol calls and back.\n *\n * The communication with the host happens via IPC with JSON strings:\n * - host -> inspector: `DebugCommand`\n * - inspector -> host: `CommandToHost`\n */\nimport { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process';\nimport { existsSync, readFileSync } from 'node:fs';\nimport type { Debugger, Runtime } from 'node:inspector';\nimport { join, normalize } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { debuglog as utilDebugLog } from 'node:util';\n\n// @ts-expect-error no types available\nimport InspectClient from 'node-inspect/lib/internal/inspect_client';\n\nconst debuglog = utilDebugLog('inspect');\n\n/** Stay paused on the first line of the debugged process (used for the debugging of adapter instances) */\nconst breakOnStart = process.argv.includes('--breakOnStart');\n\n/**\n * By debugging of a script, stepping and \"stop on exception\" should not stop in the node internals,\n * in 3rd party modules and in the adapter itself (e.g., in sandbox.js)\n */\nconst SCRIPT_BLACKBOX_PATTERNS = ['^node:', '/node_modules/', '[iI]o[bB]roker\\\\.javascript/build/'];\n\ninterface InspectClientType {\n connect(port: number, host: string): Promise<void>;\n callMethod(method: string, params?: Record<string, unknown>): Promise<any>;\n reset(): void;\n on(event: 'debugEvent', listener: (method: string, params: DebugEventParams | undefined) => void): void;\n}\n\ntype ProtocolDomain = Record<string, (params?: Record<string, unknown>) => Promise<any>>;\n\n/** Parameters of the protocol events, which are processed here */\ninterface DebugEventParams {\n /** Debugger.scriptParsed */\n scriptId?: Runtime.ScriptId;\n url?: string;\n /** Debugger.paused */\n reason?: string;\n callFrames?: Debugger.CallFrame[];\n /** Runtime.consoleAPICalled */\n type?: string;\n args?: Runtime.RemoteObject[];\n /** Runtime.executionContextDestroyed */\n executionContextId?: number;\n /** Runtime.executionContextCreated */\n context?: { id: number; name: string };\n}\n\ninterface CommandToHost {\n cmd:\n | 'ready'\n | 'readyToDebug'\n | 'paused'\n | 'resumed'\n | 'script'\n | 'log'\n | 'error'\n | 'finished'\n | 'sb'\n | 'cb'\n | 'scope'\n | 'setValue'\n | 'expressions'\n | 'getPossibleBreakpoints';\n [attr: string]: unknown;\n}\n\ninterface DebugCommand {\n cmd:\n | 'start'\n | 'end'\n | 'source'\n | 'sb'\n | 'cb'\n | 'pause'\n | 'cont'\n | 'next'\n | 'step'\n | 'out'\n | 'scope'\n | 'setValue'\n | 'expressions'\n | 'stopOnException'\n | 'getPossibleBreakpoints';\n /** start: ID of the script to debug, like `script.js.myScript` */\n scriptName?: string;\n /** start: instance number of the javascript adapter */\n instance?: number;\n /** start: adapter instance to debug, like `hm-rpc.0`, if no script name is given */\n adapterInstance?: string;\n /** source */\n scriptId?: Runtime.ScriptId;\n /** sb: locations, cb: breakpoint IDs */\n breakpoints?: (Debugger.Location | Debugger.BreakpointId)[];\n /** scope: scopes of the current call frame with their index in the scope chain */\n scopes?: (Debugger.Scope & { index?: number })[];\n /** setValue */\n variableName?: string;\n scopeNumber?: number;\n newValue?: { value?: unknown };\n /** setValue, expressions */\n callFrameId?: Debugger.CallFrameId;\n /** expressions */\n expressions?: { name: string }[];\n /** stopOnException */\n state?: boolean;\n /** getPossibleBreakpoints */\n start?: Debugger.Location;\n end?: Debugger.Location;\n}\n\nclass StartupError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StartupError';\n }\n}\n\nlet inspector: NodeInspector | undefined;\n/** ID of the debugged script, like `script.js.myScript` */\nlet scriptToDebug = '';\n/** Main file of the debugged adapter */\nlet instanceToDebug = '';\n\nfunction sendToHost(data: CommandToHost): void {\n if (data.cmd === 'error') {\n console.error(`[DEBUGGER] ${data.error as string}`);\n }\n try {\n process.send?.(JSON.stringify(data));\n } catch (e) {\n // The host is not reachable anymore\n console.error(`[DEBUGGER] Cannot send to host: ${e as Error}`);\n }\n}\n\nfunction errorToString(e: unknown): string {\n if (e instanceof Error) {\n return e.message;\n }\n return typeof e === 'string' ? e : JSON.stringify(e);\n}\n\nfunction reportError(text: string, e?: unknown): void {\n sendToHost({ cmd: 'error', error: e === undefined ? text : `${text}: ${errorToString(e)}` });\n}\n\nfunction remoteObjectToString(obj: Runtime.RemoteObject | undefined): string {\n if (!obj) {\n return '';\n }\n if (obj.value !== undefined) {\n return typeof obj.value === 'string' ? obj.value : JSON.stringify(obj.value);\n }\n return obj.unserializableValue || obj.description || obj.type;\n}\n\nfunction consoleTypeToSeverity(type: string | undefined): ioBroker.LogLevel {\n switch (type) {\n case 'warning':\n return 'warn';\n case 'error':\n case 'assert':\n return 'error';\n case 'debug':\n return 'debug';\n default:\n return 'info';\n }\n}\n\n/** Values like NaN, Infinity, -0 or BigInt cannot be transferred as JSON value */\nfunction toCallArgument(value: unknown): Runtime.CallArgument {\n if (typeof value === 'number' && (!Number.isFinite(value) || Object.is(value, -0))) {\n return { unserializableValue: Object.is(value, -0) ? '-0' : String(value) };\n }\n if (typeof value === 'bigint') {\n return { unserializableValue: `${value}n` };\n }\n return value === undefined ? {} : { value };\n}\n\nfunction isUrlOfFile(url: string, file: string): boolean {\n let path = url;\n if (url.startsWith('file://')) {\n try {\n path = fileURLToPath(url);\n } catch {\n return false;\n }\n }\n path = normalize(path);\n file = normalize(file);\n return process.platform === 'win32' ? path.toLowerCase() === file.toLowerCase() : path === file;\n}\n\nfunction createDomain(domain: string, client: InspectClientType): ProtocolDomain {\n return new Proxy<ProtocolDomain>(\n {},\n {\n get: (_target, method: string | symbol) =>\n // the object must not look like a promise\n typeof method === 'string' && method !== 'then'\n ? (params?: Record<string, unknown>): Promise<any> =>\n client.callMethod(`${domain}.${method}`, params)\n : undefined,\n },\n );\n}\n\nfunction runScript(\n script: string,\n scriptArgs: string[],\n childPrint: (text: string, isError?: boolean) => void,\n): Promise<[ChildProcessWithoutNullStreams, number, string]> {\n return new Promise((resolve, reject) => {\n // Always break on start: the process must not run before the debugger is connected, else it could\n // execute the `debugger;` statement of the script before. Port 0 means any free port.\n const child = spawn(process.execPath, ['--inspect-brk=127.0.0.1:0', normalize(script), ...scriptArgs]);\n child.stdout.setEncoding('utf8');\n child.stderr.setEncoding('utf8');\n child.stdout.on('data', (text: string) => childPrint(text));\n child.stderr.on('data', (text: string) => childPrint(text, true));\n\n let output = '';\n const timeout = setTimeout(() => {\n child.stderr.removeListener('data', waitForListenHint);\n child.kill();\n reject(new StartupError('Timeout by starting of the process to debug'));\n }, 10_000);\n\n function waitForListenHint(text: string): void {\n output += text;\n const res = /Debugger listening on ws:\\/\\/\\[?(.+?)]?:(\\d+)\\//.exec(output);\n if (res) {\n clearTimeout(timeout);\n child.stderr.removeListener('data', waitForListenHint);\n resolve([child, parseInt(res[2], 10), res[1]]);\n }\n }\n\n child.stderr.on('data', waitForListenHint);\n child.on('error', error => {\n clearTimeout(timeout);\n reject(new StartupError(`Cannot start the process to debug: ${error.message}`));\n });\n });\n}\n\nclass NodeInspector {\n readonly Debugger: ProtocolDomain;\n readonly Runtime: ProtocolDomain;\n\n private readonly client: InspectClientType = new InspectClient();\n private readonly file: string;\n private readonly args: string[];\n private child: ChildProcessWithoutNullStreams | null = null;\n /** The protocol does not deliver the URLs in the call frames anymore, so remember them */\n private readonly scriptUrls: Record<Runtime.ScriptId, string> = {};\n private mainScriptId: Runtime.ScriptId | undefined;\n private mainFile = '';\n private mainScriptSource: Promise<string> | null = null;\n /** Sometimes the first pause comes before the main script is parsed */\n private delayedContext: DebugEventParams | null = null;\n private pausedOnFirstLine = false;\n /** Execution context of the debugged script */\n private scriptContextId: number | undefined;\n private finished = false;\n\n constructor(file: string, args: string[]) {\n this.file = file;\n this.args = args;\n this.Debugger = createDomain('Debugger', this.client);\n this.Runtime = createDomain('Runtime', this.client);\n this.client.on('debugEvent', (fullName, params) => this.handleDebugEvent(fullName, params || {}));\n }\n\n async start(): Promise<void> {\n const [child, port, host] = await runScript(this.file, this.args, (text, isError) =>\n this.childPrint(text, isError),\n );\n this.child = child;\n child.on('exit', code => this.finish(`Process exited with code ${code}`));\n\n for (let attempt = 1; ; attempt++) {\n try {\n await this.client.connect(port, host);\n break;\n } catch (e) {\n debuglog(`Connection attempt #${attempt} failed: ${e as Error}`);\n if (attempt >= 10) {\n throw new StartupError(`Cannot connect to the debugger on ${host}:${port}`);\n }\n await new Promise(resolve => setTimeout(resolve, 500));\n }\n }\n\n await Promise.all([\n this.Runtime.enable(),\n this.Debugger.enable(),\n this.Debugger.setPauseOnExceptions({ state: 'none' }),\n this.Debugger.setAsyncCallStackDepth({ maxDepth: 1 }),\n this.Debugger.setBlackboxPatterns({ patterns: scriptToDebug ? SCRIPT_BLACKBOX_PATTERNS : [] }),\n this.Runtime.runIfWaitingForDebugger(),\n ]);\n }\n\n killChild(): void {\n this.client.reset();\n if (this.child) {\n this.child.kill();\n this.child = null;\n }\n }\n\n private finish(reason: string): void {\n if (this.finished) {\n return;\n }\n this.finished = true;\n debuglog(reason);\n sendToHost({ cmd: 'finished', text: reason });\n this.killChild();\n setTimeout(() => process.exit(0), 200);\n }\n\n private childPrint(text: string, isError?: boolean): void {\n if (isError) {\n const lines = text\n .split(/\\r\\n|\\r|\\n/g)\n .filter(line => !!line)\n .map(line => `< ${line}`);\n lines.length && process.stdout.write(`${lines.join('\\n')}\\n`);\n }\n // The debugged process ended, but it waits till the debugger disconnects\n if (text.includes('Waiting for the debugger to disconnect')) {\n this.finish('Process finished');\n }\n }\n\n private handleDebugEvent(fullName: string, params: DebugEventParams): void {\n switch (fullName) {\n case 'Debugger.scriptParsed':\n this.onScriptParsed(params);\n break;\n\n case 'Debugger.paused':\n this.onPaused(params);\n break;\n\n case 'Debugger.resumed':\n sendToHost({ cmd: 'resumed', context: params });\n break;\n\n case 'Runtime.consoleAPICalled':\n this.onConsoleApiCalled(params);\n break;\n\n case 'Runtime.executionContextCreated':\n // main.ts gives the context of a script the name of the script\n if (scriptToDebug && params.context?.name === scriptToDebug) {\n this.scriptContextId = params.context.id;\n }\n break;\n\n case 'Runtime.executionContextDestroyed':\n if (params.executionContextId === 1) {\n // the main context of the debugged process is gone\n this.finish('Process finished');\n } else if (this.scriptContextId !== undefined && params.executionContextId === this.scriptContextId) {\n // the script was stopped, but the process is still running\n sendToHost({ cmd: 'finished', context: params });\n }\n break;\n\n default:\n debuglog(`${fullName}: ${JSON.stringify(params)}`);\n break;\n }\n }\n\n private onScriptParsed(params: DebugEventParams): void {\n const { scriptId, url } = params;\n if (!scriptId || !url) {\n return;\n }\n this.scriptUrls[scriptId] = url;\n\n const isMain = scriptToDebug ? url === scriptToDebug : !!instanceToDebug && isUrlOfFile(url, instanceToDebug);\n if (!isMain) {\n return;\n }\n debuglog(`Script to debug parsed: ${scriptId}`);\n this.mainScriptId = scriptId;\n this.mainFile = url.replace('file:///', '');\n this.mainScriptSource = this.Debugger.getScriptSource({ scriptId }).then(\n (result: Debugger.GetScriptSourceReturnType) => result.scriptSource,\n );\n\n if (this.delayedContext) {\n const context = this.delayedContext;\n this.delayedContext = null;\n void this.sendReadyToDebug(context);\n }\n }\n\n private onPaused(params: DebugEventParams): void {\n if (!this.pausedOnFirstLine) {\n if (params.reason === 'Break on start' && !breakOnStart) {\n // the process was started with --inspect-brk only to have time to set up the debugger\n this.Debugger.resume().catch(e => reportError('Cannot resume', e));\n return;\n }\n if (params.reason === 'exception') {\n // ignore all exceptions till the start of the script\n this.Debugger.resume().catch(e => reportError('Cannot resume', e));\n return;\n }\n }\n\n this.enrichCallFrames(params);\n\n if (\n this.pausedOnFirstLine &&\n scriptToDebug &&\n params.reason === 'step' &&\n !params.callFrames?.[0]?.url?.startsWith('script.js.')\n ) {\n // Stepping left the script, e.g., at the end of a callback. The blackbox patterns do not cover\n // all internals of node.js, so continue the execution instead of stopping there\n this.Debugger.resume().catch(e => reportError('Cannot resume', e));\n return;\n }\n\n if (this.pausedOnFirstLine) {\n sendToHost({ cmd: 'paused', context: params });\n } else {\n this.pausedOnFirstLine = true;\n if (this.mainScriptSource) {\n void this.sendReadyToDebug(params);\n } else {\n // store the context to send it, when the main script is parsed\n this.delayedContext = params;\n }\n }\n }\n\n private async sendReadyToDebug(context: DebugEventParams): Promise<void> {\n try {\n const script = await this.mainScriptSource;\n this.enrichCallFrames(context);\n sendToHost({\n cmd: 'readyToDebug',\n scriptId: this.mainScriptId,\n script,\n context,\n url: this.mainFile,\n });\n } catch (e) {\n reportError('Cannot read the source of the script to debug', e);\n }\n }\n\n private enrichCallFrames(context: DebugEventParams): void {\n context.callFrames?.forEach(frame => {\n if (!frame.url) {\n frame.url = this.scriptUrls[frame.location.scriptId] || '';\n }\n });\n }\n\n private onConsoleApiCalled(params: DebugEventParams): void {\n const args = params.args || [];\n if (instanceToDebug) {\n sendToHost({\n cmd: 'log',\n severity: consoleTypeToSeverity(params.type),\n text: args.map(arg => remoteObjectToString(arg)).join(' '),\n ts: Date.now(),\n });\n return;\n }\n\n // The sandbox logs in debug mode as `console.log(`${severity}$$${scriptName}$$${message}`, Date.now())`\n const text = remoteObjectToString(args[0]);\n const marker = `$$${scriptToDebug}$$`;\n const pos = text.indexOf(marker);\n if (pos !== -1) {\n sendToHost({\n cmd: 'log',\n severity: text.substring(0, pos),\n text: text.substring(pos + marker.length),\n ts: typeof args[1]?.value === 'number' ? args[1].value : Date.now(),\n });\n } else if (params.type === 'warning' || params.type === 'error') {\n sendToHost({\n cmd: 'log',\n severity: consoleTypeToSeverity(params.type),\n text: args.map(arg => remoteObjectToString(arg)).join(' '),\n ts: Date.now(),\n });\n }\n }\n}\n\nfunction resolveAdapterMainFile(adapter: string): string | undefined {\n try {\n return require.resolve(`iobroker.${adapter}`);\n } catch {\n // try to locate it in the same node_modules directory as this adapter\n const dir = normalize(join(__dirname, '..', '..', '..', `iobroker.${adapter}`));\n if (existsSync(join(dir, 'package.json'))) {\n try {\n const pack = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));\n const main = join(dir, pack.main || `${adapter}.js`);\n if (existsSync(main)) {\n return main;\n }\n } catch {\n // ignore\n }\n }\n }\n return undefined;\n}\n\nfunction startDebugging(data: DebugCommand): void {\n if (inspector) {\n reportError('The debugger is already started');\n return;\n }\n\n if (data.scriptName) {\n scriptToDebug = data.scriptName;\n inspector = new NodeInspector(join(__dirname, '..', 'main.js'), [\n (data.instance || 0).toString(),\n '--debug',\n '--debugScript',\n scriptToDebug,\n ]);\n } else {\n const [adapter, instance] = (data.adapterInstance || '').split('.');\n const file = resolveAdapterMainFile(adapter);\n if (!file) {\n reportError(`Cannot locate iobroker.${adapter}`);\n setTimeout(() => {\n sendToHost({ cmd: 'finished', context: `Cannot locate iobroker.${adapter}` });\n setTimeout(() => process.exit(0), 500);\n }, 200);\n return;\n }\n instanceToDebug = file;\n inspector = new NodeInspector(file, [instance || '0', '--debug']);\n }\n\n inspector.start().catch((e: unknown) => {\n reportError(\n e instanceof StartupError\n ? e.message\n : `Internal error in inspector: ${e instanceof Error ? e.stack : errorToString(e)}`,\n );\n inspector?.killChild();\n setTimeout(() => process.exit(1), 200);\n });\n}\n\nasync function processCommand(data: DebugCommand): Promise<void> {\n debuglog(`processCommand: ${JSON.stringify(data)}`);\n\n if (data.cmd === 'start') {\n startDebugging(data);\n return;\n }\n if (data.cmd === 'end') {\n process.exit(0);\n }\n if (!inspector) {\n reportError(`Cannot process \"${data.cmd}\": the debugger is not started`);\n return;\n }\n const { Debugger, Runtime } = inspector;\n\n switch (data.cmd) {\n case 'source':\n try {\n const { scriptSource } = (await Debugger.getScriptSource({\n scriptId: data.scriptId,\n })) as Debugger.GetScriptSourceReturnType;\n sendToHost({ cmd: 'script', scriptId: data.scriptId, text: scriptSource });\n } catch (e) {\n reportError(`Cannot read the source of script ${data.scriptId}`, e);\n }\n break;\n\n case 'cont':\n case 'next':\n case 'step':\n case 'out':\n case 'pause': {\n const method = { cont: 'resume', next: 'stepOver', step: 'stepInto', out: 'stepOut', pause: 'pause' }[\n data.cmd\n ];\n try {\n await Debugger[method]();\n } catch (e) {\n reportError(`Cannot execute \"${data.cmd}\"`, e);\n }\n break;\n }\n\n case 'sb': {\n const breakpoints = await Promise.all(\n ((data.breakpoints || []) as Debugger.Location[]).map(async bp => {\n try {\n const result = (await Debugger.setBreakpoint({\n location: {\n scriptId: bp.scriptId,\n lineNumber: bp.lineNumber,\n columnNumber: bp.columnNumber,\n },\n })) as Debugger.SetBreakpointReturnType;\n return { id: result.breakpointId, location: result.actualLocation };\n } catch (e) {\n reportError(`Cannot set breakpoint on line ${bp.lineNumber + 1}`, e);\n return null;\n }\n }),\n );\n sendToHost({ cmd: 'sb', breakpoints: breakpoints.filter(bp => bp) });\n break;\n }\n\n case 'cb': {\n const breakpointIds = await Promise.all(\n ((data.breakpoints || []) as Debugger.BreakpointId[]).map(async breakpointId => {\n try {\n await Debugger.removeBreakpoint({ breakpointId });\n } catch (e) {\n // The breakpoint does not exist (anymore), so it is removed anyway\n debuglog(`Cannot clear breakpoint ${breakpointId}: ${e as Error}`);\n }\n return breakpointId;\n }),\n );\n sendToHost({ cmd: 'cb', breakpoints: breakpointIds });\n break;\n }\n\n case 'scope': {\n const scopes = await Promise.all(\n (data.scopes || [])\n .filter(scope => scope?.object?.objectId)\n .map(async scope => {\n try {\n const properties = (await Runtime.getProperties({\n objectId: scope.object.objectId,\n generatePreview: true,\n })) as Runtime.GetPropertiesReturnType;\n return { type: scope.type, name: scope.name, index: scope.index, properties };\n } catch (e) {\n // e.g., the execution was resumed in the meantime\n debuglog(`Cannot read scope: ${e as Error}`);\n return null;\n }\n }),\n );\n sendToHost({ cmd: 'scope', scopes: scopes.filter(scope => scope) });\n break;\n }\n\n case 'setValue':\n try {\n await Debugger.setVariableValue({\n variableName: data.variableName,\n scopeNumber: data.scopeNumber,\n newValue: toCallArgument(data.newValue?.value),\n callFrameId: data.callFrameId,\n });\n sendToHost({\n cmd: 'setValue',\n variableName: data.variableName,\n scopeNumber: data.scopeNumber,\n newValue: data.newValue,\n callFrameId: data.callFrameId,\n });\n } catch (e) {\n reportError(`Cannot set value of \"${data.variableName}\"`, e);\n }\n break;\n\n case 'expressions': {\n const expressions = await Promise.all(\n (data.expressions || []).map(async item => {\n try {\n const { result } = (await Debugger.evaluateOnCallFrame({\n callFrameId: data.callFrameId,\n expression: item.name,\n objectGroup: 'node-inspect',\n generatePreview: true,\n })) as Debugger.EvaluateOnCallFrameReturnType;\n return { name: item.name, result };\n } catch (e) {\n return {\n name: item.name,\n result: {\n type: 'object',\n subtype: 'error',\n className: 'Error',\n description: errorToString(e),\n },\n };\n }\n }),\n );\n sendToHost({ cmd: 'expressions', expressions });\n break;\n }\n\n case 'stopOnException':\n try {\n await Debugger.setPauseOnExceptions({ state: data.state ? 'all' : 'none' });\n } catch (e) {\n reportError('Cannot change \"stop on exception\"', e);\n }\n break;\n\n case 'getPossibleBreakpoints':\n try {\n const { locations } = (await Debugger.getPossibleBreakpoints({\n start: data.start,\n end: data.end,\n })) as Debugger.GetPossibleBreakpointsReturnType;\n sendToHost({ cmd: 'getPossibleBreakpoints', breakpoints: locations });\n } catch (e) {\n reportError('Cannot get possible breakpoints', e);\n }\n break;\n\n default:\n console.error(`[DEBUGGER] Unknown command: ${JSON.stringify(data)}`);\n break;\n }\n}\n\nprocess.on('message', (message: unknown): void => {\n let command: DebugCommand;\n try {\n command = typeof message === 'string' ? (JSON.parse(message) as DebugCommand) : (message as DebugCommand);\n } catch {\n console.error(`[DEBUGGER] Cannot parse: ${JSON.stringify(message)}`);\n return;\n }\n processCommand(command).catch(e => reportError(`Cannot process \"${command?.cmd}\"`, e));\n});\n\n// Handle all possible exits and never leave the debugged process behind\nprocess.on('exit', () => inspector?.killChild());\nprocess.on('disconnect', () => process.exit(0));\nprocess.once('SIGTERM', () => process.exit(0));\nprocess.once('SIGHUP', () => process.exit(0));\nprocess.on('uncaughtException', (e: Error) => {\n reportError(`Internal error in inspector: ${e.stack || e.message}`);\n inspector?.killChild();\n process.exit(1);\n});\n\nsendToHost({ cmd: 'ready' });\n"]}
|
package/build/main.js
CHANGED
|
@@ -1864,7 +1864,8 @@ class JavaScript extends adapter_core_1.Adapter {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
}
|
|
1866
1866
|
}
|
|
1867
|
-
|
|
1867
|
+
// The process started for debugging of one script must not synchronize the scripts with the disk
|
|
1868
|
+
if (this.config.mirrorPath?.trim() && !this.context.debugMode) {
|
|
1868
1869
|
this.config.mirrorInstance = parseInt(this.config.mirrorInstance, 10) || 0;
|
|
1869
1870
|
if (this.instance === this.config.mirrorInstance) {
|
|
1870
1871
|
const ioBDataDir = (0, adapter_core_1.getAbsoluteDefaultDataDir)() + node_path_1.sep;
|
|
@@ -2618,6 +2619,8 @@ class JavaScript extends adapter_core_1.Adapter {
|
|
|
2618
2619
|
try {
|
|
2619
2620
|
script.script.runInNewContext(sandbox, {
|
|
2620
2621
|
filename: name,
|
|
2622
|
+
// The debugger recognizes the context of the debugged script by this name
|
|
2623
|
+
contextName: name,
|
|
2621
2624
|
displayErrors: true,
|
|
2622
2625
|
// lineOffset: this.globalScriptLines
|
|
2623
2626
|
});
|
|
@@ -3514,11 +3517,12 @@ class JavaScript extends adapter_core_1.Adapter {
|
|
|
3514
3517
|
debugSendToInspector(message) {
|
|
3515
3518
|
if (this.debugState.child) {
|
|
3516
3519
|
try {
|
|
3517
|
-
this.log.
|
|
3520
|
+
this.log.debug(`send to debugger: ${typeof message === 'string' ? message : JSON.stringify(message)}`);
|
|
3518
3521
|
this.debugState.child.send(message);
|
|
3519
3522
|
}
|
|
3520
|
-
catch {
|
|
3521
|
-
|
|
3523
|
+
catch (e) {
|
|
3524
|
+
const scriptName = this.debugState.scriptName;
|
|
3525
|
+
void this.debugStop().then(() => this.log.warn(`${scriptName}: Debugging was stopped, because the inspector is not reachable: ${e.message}`));
|
|
3522
3526
|
}
|
|
3523
3527
|
}
|
|
3524
3528
|
else {
|
|
@@ -3591,7 +3595,6 @@ class JavaScript extends adapter_core_1.Adapter {
|
|
|
3591
3595
|
}
|
|
3592
3596
|
case 'paused': {
|
|
3593
3597
|
this.debugState.paused = true;
|
|
3594
|
-
console.log(`host: PAUSED`);
|
|
3595
3598
|
break;
|
|
3596
3599
|
}
|
|
3597
3600
|
case 'resumed': {
|
|
@@ -3599,14 +3602,6 @@ class JavaScript extends adapter_core_1.Adapter {
|
|
|
3599
3602
|
//console.log(`STARTED`);
|
|
3600
3603
|
break;
|
|
3601
3604
|
}
|
|
3602
|
-
case 'log': {
|
|
3603
|
-
console.log(`[${oMessage.severity}] ${oMessage.text}`);
|
|
3604
|
-
break;
|
|
3605
|
-
}
|
|
3606
|
-
case 'readyToDebug': {
|
|
3607
|
-
console.log(`host: readyToDebug (set breakpoints): [${oMessage.scriptId}] ${oMessage.script}`);
|
|
3608
|
-
break;
|
|
3609
|
-
}
|
|
3610
3605
|
}
|
|
3611
3606
|
});
|
|
3612
3607
|
this.debugState.child?.on('error', error => {
|