iobroker.javascript 9.1.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +16 -8
  2. package/admin/assets/AiChatPanel-sgt697A2.js +296 -0
  3. package/admin/assets/AiDatapointProvider-B0i3I5Fm.js +2 -0
  4. package/admin/assets/AiDiffView-RPozjjHf.js +1 -0
  5. package/admin/assets/AiInlineProvider-Dd7eKxk4.js +7 -0
  6. package/admin/assets/{Save-Cld9qv9i.js → Save-CkuNSiWL.js} +1 -1
  7. package/admin/assets/{ScriptEditor-BVaX7Hcs.js → ScriptEditor-CH4qJzqq.js} +2 -2
  8. package/admin/assets/ScriptEditorVanillaMonaco-cB_90T0P.js +1 -0
  9. package/admin/assets/{createSvgIcon-DPvF8xqu.js → createSvgIcon-DYs_tNrE.js} +1 -1
  10. package/admin/assets/docs-compact-CKNGiYh2.js +336 -0
  11. package/admin/assets/index-BI3JsAz_.js +1 -0
  12. package/admin/assets/{index-D8iYqogF.js → index-DAkyON1r.js} +5 -5
  13. package/admin/assets/index-DW5CwIma.js +1256 -0
  14. package/admin/assets/index-SHs7_wDh.js +1 -0
  15. package/admin/assets/{index-DlDUIfpA.js → index-dN73sbyQ.js} +1 -1
  16. package/admin/assets/index-hwplVCgv.js +986 -0
  17. package/admin/assets/index-wHNMOf-c.js +5 -0
  18. package/admin/assets/inheritsLoose-CIXm_zPk.js +29 -0
  19. package/admin/assets/{iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js → iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-CV1_X-Lf.js} +1 -1
  20. package/admin/assets/{localSharedImportMap-AxgBkrOR.js → localSharedImportMap-CqvxvyGG.js} +1 -1
  21. package/admin/assets/useTheme-DuTJsNQ-.js +1 -0
  22. package/admin/assets/{virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-C9suQF96.js → virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-BJ03G6Pu.js} +2 -2
  23. package/admin/custom/assets/{Components-FfVbavBM.js → Components-B9ZyjeRI.js} +1 -1
  24. package/admin/custom/assets/{index-Be7j5wvd.js → index-BVwMgafs.js} +1 -1
  25. package/admin/custom/assets/index-CVIpIckw.js +960 -0
  26. package/admin/custom/assets/{index-DNdWk-cT.js → index-DsIn9jH_.js} +1 -1
  27. package/admin/custom/assets/{localSharedImportMap-BRxFonIn.js → localSharedImportMap-C4qXtGUd.js} +1 -1
  28. package/admin/custom/assets/{virtualExposes-DyedJotb.js → virtualExposes-jSvr-kK3.js} +1 -1
  29. package/admin/custom/assets/{virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BtJxKB87.js → virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-DFSXB0v2.js} +2 -2
  30. package/admin/custom/customComponents.js +1 -1
  31. package/admin/google-blockly/own/blocks_words.js +7 -0
  32. package/admin/google-blockly/own/field_oid.js +311 -37
  33. package/admin/i18n/de.json +8 -0
  34. package/admin/i18n/en.json +8 -0
  35. package/admin/i18n/es.json +8 -0
  36. package/admin/i18n/flat.txt +427 -0
  37. package/admin/i18n/fr.json +8 -0
  38. package/admin/i18n/it.json +8 -0
  39. package/admin/i18n/nl.json +8 -0
  40. package/admin/i18n/pl.json +8 -0
  41. package/admin/i18n/pt.json +8 -0
  42. package/admin/i18n/ru.json +8 -0
  43. package/admin/i18n/uk.json +8 -0
  44. package/admin/i18n/zh-cn.json +8 -0
  45. package/admin/img/anthropic.svg +1 -0
  46. package/admin/img/custom.svg +1 -0
  47. package/admin/img/deepseek.svg +1 -0
  48. package/admin/img/gemini.svg +1 -0
  49. package/admin/img/openai.svg +1 -0
  50. package/admin/jsonConfig.json +76 -14
  51. package/admin/mf-manifest.json +1 -1
  52. package/admin/remoteEntry.js +1 -1
  53. package/admin/tab.html +6 -6
  54. package/build/lib/debugger.js +2 -2
  55. package/build/lib/debugger.js.map +1 -1
  56. package/build/lib/inspect.js.map +1 -1
  57. package/build/lib/nodeModulesManagement.js +2 -2
  58. package/build/lib/nodeModulesManagement.js.map +1 -1
  59. package/build/lib/protectFs.js +5 -0
  60. package/build/lib/protectFs.js.map +1 -1
  61. package/build/lib/sandbox.js +2 -2
  62. package/build/lib/sandbox.js.map +1 -1
  63. package/build/main.js +72 -17
  64. package/build/main.js.map +1 -1
  65. package/build/types.d.ts +2 -0
  66. package/docs/de/README.md +21 -8
  67. package/docs/de/blockly.md +34 -0
  68. package/docs/en/README.md +21 -8
  69. package/docs/en/blockly.md +34 -0
  70. package/install/installTypings.js +1 -1
  71. package/io-package.json +27 -66
  72. package/package.json +7 -6
  73. package/admin/assets/OpenAiDialog-Dx-XNET0.js +0 -13
  74. package/admin/assets/ScriptEditorVanillaMonaco-yq11eIYC.js +0 -1
  75. package/admin/assets/docs-BrInh2Pn.js +0 -2036
  76. package/admin/assets/index-CLJ6-h9Q.js +0 -1
  77. package/admin/assets/index-COZhHfBn.js +0 -1230
  78. package/admin/assets/index-Cu-TydZj.js +0 -5
  79. package/admin/assets/index-Dnbw7_L3.js +0 -986
  80. package/admin/assets/index-gIA8x-8f.js +0 -1
  81. package/admin/assets/inheritsLoose-B0Ba5G9z.js +0 -29
  82. package/admin/assets/useTheme-hy6f3gra.js +0 -1
  83. package/admin/custom/assets/index-CYc31Gwg.js +0 -960
@@ -95,6 +95,13 @@
95
95
  "label": "Allow self-signed certificates for URL requests",
96
96
  "xs": 12,
97
97
  "sm": 12
98
+ },
99
+ "sortGlobalScriptsAlphabetically": {
100
+ "newLine": true,
101
+ "type": "checkbox",
102
+ "label": "Sort global scripts alphabetically",
103
+ "xs": 12,
104
+ "sm": 12
98
105
  }
99
106
  }
100
107
  },
@@ -126,7 +133,7 @@
126
133
  "_ai": {
127
134
  "type": "panel",
128
135
  "label": "AI settings",
129
- "icon": "data:image/svg+xml;base64,",
136
+ "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJNNy41IDUuNkwxMCA3IDguNiA0LjUgMTAgMiA3LjUgMy40IDUgMmwxLjQgMi41TDUgN3ptMTIgOS44TDE3IDE0bDEuNCAyLjVMMTcgMTlsMi41LTEuNEwyMiAxOWwtMS40LTIuNUwyMiAxNHpNMjIgMmwtMi41IDEuNEwxNyAybDEuNCAyLjVMMTcgN2wyLjUtMS40TDIyIDdsLTEuNC0yLjV6bS03LjYzIDUuMjlhLjk5Ni45OTYgMCAwMC0xLjQxIDBMMS4yOSAxOC45NmEuOTk2Ljk5NiAwIDAwMCAxLjQxbDIuMzQgMi4zNGMuMzkuMzkgMS4wMi4zOSAxLjQxIDBMMTYuNyAxMS4wNWEuOTk2Ljk5NiAwIDAwMC0xLjQxbC0yLjMzLTIuMzV6TTUuMDQgMTguOTZsLTEuNDEtMS40MSA4LjY5LTguNjkgMS40MSAxLjQxLTguNjkgOC42OXoiLz48L3N2Zz4=",
130
137
  "items": {
131
138
  "_aiDescription": {
132
139
  "type": "staticText",
@@ -142,58 +149,113 @@
142
149
  "type": "text",
143
150
  "label": "ChatGPT API key",
144
151
  "xs": 12,
145
- "sm": 12,
152
+ "sm": 9,
146
153
  "help": "platform.openai.com",
147
154
  "helpLink": "https://platform.openai.com/api-keys"
148
155
  },
156
+ "_testOpenAi": {
157
+ "type": "sendTo",
158
+ "label": "Test OpenAI",
159
+ "icon": "img/openai.svg",
160
+ "command": "testApiConnection",
161
+ "jsonData": "{\"apiKey\": \"${data.gptKey}\", \"provider\": \"openai\"}",
162
+ "variant": "outlined",
163
+ "disabled": "!data.gptKey",
164
+ "xs": 12,
165
+ "sm": 3,
166
+ "showProcess": true
167
+ },
149
168
  "claudeKey": {
150
169
  "newLine": true,
151
170
  "type": "text",
152
171
  "label": "Anthropic API key",
153
172
  "xs": 12,
154
- "sm": 12,
173
+ "sm": 9,
155
174
  "help": "console.anthropic.com",
156
175
  "helpLink": "https://console.anthropic.com/settings/keys"
157
176
  },
177
+ "_testClaude": {
178
+ "type": "sendTo",
179
+ "label": "Test Anthropic",
180
+ "icon": "img/anthropic.svg",
181
+ "command": "testApiConnection",
182
+ "jsonData": "{\"apiKey\": \"${data.claudeKey}\", \"provider\": \"anthropic\"}",
183
+ "variant": "outlined",
184
+ "disabled": "!data.claudeKey",
185
+ "xs": 12,
186
+ "sm": 3,
187
+ "showProcess": true
188
+ },
158
189
  "geminiKey": {
159
190
  "newLine": true,
160
191
  "type": "text",
161
192
  "label": "Gemini API key",
162
193
  "xs": 12,
163
- "sm": 12,
194
+ "sm": 9,
164
195
  "help": "aistudio.google.com",
165
196
  "helpLink": "https://aistudio.google.com/apikey"
166
197
  },
198
+ "_testGemini": {
199
+ "type": "sendTo",
200
+ "label": "Test Gemini",
201
+ "icon": "img/gemini.svg",
202
+ "command": "testApiConnection",
203
+ "jsonData": "{\"apiKey\": \"${data.geminiKey}\", \"provider\": \"gemini\"}",
204
+ "variant": "outlined",
205
+ "disabled": "!data.geminiKey",
206
+ "xs": 12,
207
+ "sm": 3,
208
+ "showProcess": true
209
+ },
167
210
  "deepseekKey": {
168
211
  "newLine": true,
169
212
  "type": "text",
170
213
  "label": "DeepSeek API key",
171
214
  "xs": 12,
172
- "sm": 12,
215
+ "sm": 9,
173
216
  "help": "platform.deepseek.com",
174
217
  "helpLink": "https://platform.deepseek.com/api_keys"
175
218
  },
219
+ "_testDeepseek": {
220
+ "type": "sendTo",
221
+ "label": "Test DeepSeek",
222
+ "icon": "img/deepseek.svg",
223
+ "command": "testApiConnection",
224
+ "jsonData": "{\"apiKey\": \"${data.deepseekKey}\", \"provider\": \"deepseek\"}",
225
+ "variant": "outlined",
226
+ "disabled": "!data.deepseekKey",
227
+ "xs": 12,
228
+ "sm": 3,
229
+ "showProcess": true
230
+ },
176
231
  "gptBaseUrl": {
177
232
  "newLine": true,
178
233
  "type": "text",
179
234
  "label": "Custom API Base URL",
180
235
  "xs": 12,
181
- "sm": 12,
236
+ "sm": 5,
182
237
  "help": "Custom API Base URL help",
183
238
  "placeholder": "https://api.openai.com/v1"
184
239
  },
185
- "_testApiConnection": {
186
- "newLine": true,
240
+ "gptBaseUrlKey": {
241
+ "type": "text",
242
+ "label": "Custom API key",
243
+ "xs": 12,
244
+ "sm": 4,
245
+ "help": "Custom API key help",
246
+ "placeholder": "optional"
247
+ },
248
+ "_testCustom": {
187
249
  "type": "sendTo",
188
- "label": "Test API connection",
250
+ "label": "Test Custom API",
251
+ "icon": "img/custom.svg",
189
252
  "command": "testApiConnection",
190
- "jsonData": "{\"apiKey\": \"${data.gptKey}\", \"baseUrl\": \"${data.gptBaseUrl}\"}",
253
+ "jsonData": "{\"apiKey\": \"${data.gptBaseUrlKey}\", \"baseUrl\": \"${data.gptBaseUrl}\", \"provider\": \"openai\"}",
191
254
  "variant": "outlined",
255
+ "disabled": "!data.gptBaseUrl",
192
256
  "xs": 12,
193
- "sm": 6,
194
- "alsoDependsOn": ["gptKey", "gptBaseUrl"],
195
- "showProcess": true,
196
- "resultStringToError": "error"
257
+ "sm": 3,
258
+ "showProcess": true
197
259
  }
198
260
  }
199
261
  }
@@ -1 +1 @@
1
- {"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Dsh1HfIY.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-BkyLyaYT.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"6.5.0","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-DlDUIfpA.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-CVZSzCXy.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/adapter-react-v5","name":"@iobroker/adapter-react-v5","version":"8.1.3","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Dnbw7_L3.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
1
+ {"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Dsh1HfIY.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-BkyLyaYT.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"6.5.0","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-dN73sbyQ.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-CVZSzCXy.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/adapter-react-v5","name":"@iobroker/adapter-react-v5","version":"8.1.8","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-hwplVCgv.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
@@ -1 +1 @@
1
- import"./assets/preload-helper-BDBacUwf.js";import{g as r,i as a}from"./assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-C9suQF96.js";export{r as get,a as init};
1
+ import"./assets/preload-helper-BDBacUwf.js";import{g as r,i as a}from"./assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-BJ03G6Pu.js";export{r as get,a as init};
package/admin/tab.html CHANGED
@@ -115,19 +115,19 @@
115
115
  type="text/javascript"
116
116
  src="google-blockly/own/blocks_object.js"
117
117
  ></script>
118
- <script type="module" crossorigin src="./assets/index-COZhHfBn.js"></script>
118
+ <script type="module" crossorigin src="./assets/index-DW5CwIma.js"></script>
119
119
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-BDBacUwf.js">
120
- <link rel="modulepreload" crossorigin href="./assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-C9suQF96.js">
120
+ <link rel="modulepreload" crossorigin href="./assets/virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-BJ03G6Pu.js">
121
121
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js">
122
122
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js">
123
123
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js">
124
- <link rel="modulepreload" crossorigin href="./assets/createSvgIcon-DPvF8xqu.js">
124
+ <link rel="modulepreload" crossorigin href="./assets/createSvgIcon-DYs_tNrE.js">
125
125
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js">
126
126
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js">
127
- <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js">
127
+ <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-CV1_X-Lf.js">
128
128
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js">
129
- <link rel="modulepreload" crossorigin href="./assets/index-Cu-TydZj.js">
130
- <link rel="modulepreload" crossorigin href="./assets/inheritsLoose-B0Ba5G9z.js">
129
+ <link rel="modulepreload" crossorigin href="./assets/index-wHNMOf-c.js">
130
+ <link rel="modulepreload" crossorigin href="./assets/inheritsLoose-CIXm_zPk.js">
131
131
  <link rel="stylesheet" crossorigin href="./assets/index-BTsjunTt.css">
132
132
  </head>
133
133
  <body>
@@ -23,7 +23,7 @@ exports.default = createRepl;
23
23
  * IN THE SOFTWARE.
24
24
  */
25
25
  const node_path_1 = require("node:path");
26
- const repl_1 = require("repl");
26
+ const node_repl_1 = require("node:repl");
27
27
  const node_util_1 = require("node:util");
28
28
  const node_vm_1 = require("node:vm");
29
29
  const node_url_1 = require("node:url");
@@ -1118,7 +1118,7 @@ function createRepl(inspector) {
1118
1118
  useGlobal: false,
1119
1119
  ignoreUndefined: true,
1120
1120
  };
1121
- repl = (0, repl_1.start)(replOptions);
1121
+ repl = (0, node_repl_1.start)(replOptions);
1122
1122
  initializeContext(repl.context);
1123
1123
  repl.on('reset', initializeContext);
1124
1124
  repl.defineCommand('interrupt', () => {
@@ -1 +1 @@
1
- {"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src/lib/debugger.ts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YACzB,KAAK,CAAC,6BAA6B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,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 { join, resolve } from 'node:path';\nimport { type ReplOptions, type REPLServer, start } from 'repl';\nimport {\n debuglog as debuglogUtil,\n inspect as inspectUtil,\n type InspectOptions,\n type InspectOptionsStylized,\n type Style,\n} from 'node:util';\nimport { type Context, runInContext } from 'node:vm';\nimport { fileURLToPath } from 'node:url';\nimport { builtinModules as PUBLIC_BUILTINS } from 'node:module';\nimport type { Debugger, Runtime } from 'node:inspector';\n\nimport type { NodeInspector } from './inspect';\n\nconst debuglog = debuglogUtil('inspect');\n\ninterface PropertyPreview {\n /**\n * Property name.\n */\n name: string;\n /**\n * Object type. Accessor means that the property itself is an accessor property.\n */\n type: string;\n /**\n * User-friendly property value string.\n */\n value?: string | undefined;\n /**\n * Object subtype hint. Specified for <code>object</code> type values only.\n */\n subtype?: string | undefined;\n}\n/*const SHORTCUTS = {\n cont: 'c',\n next: 'n',\n step: 's',\n out: 'o',\n backtrace: 'bt',\n setBreakpoint: 'sb',\n clearBreakpoint: 'cb',\n run: 'r',\n};\n\nconst HELP = `\nrun, restart, r Run the application or reconnect\nkill Kill a running application or disconnect\n\ncont, c Resume execution\nnext, n Continue to next line in current file\nstep, s Step into, potentially entering a function\nout, o Step out, leaving the current function\nbacktrace, bt Print the current backtrace\nlist Print the source around the current line where execution\n is currently paused\n\nsetBreakpoint, sb Set a breakpoint\nclearBreakpoint, cb Clear a breakpoint\nbreakpoints List all known breakpoints\nbreakOnException Pause execution whenever an exception is thrown\nbreakOnUncaught Pause execution whenever an exception isn't caught\nbreakOnNone Don't pause on exceptions (this is the default)\n\nwatch(expr) Start watching the given expression\nunwatch(expr) Stop watching an expression\nwatchers Print all watched expressions and their current values\n\nexec(expr) Evaluate the expression and print the value\nrepl Enter a debug repl that works like exec\n\nscripts List application scripts that are currently loaded\nscripts(true) List all scripts (including node-internals)\n\nprofile Start CPU profiling session.\nprofileEnd Stop current CPU profiling session.\nprofiles Array of completed CPU profiling sessions.\nprofiles[n].save(filepath = 'node.cpuprofile')\n Save CPU profiling session to disk as JSON.\n\ntakeHeapSnapshot(filepath = 'node.heapsnapshot')\n Take a heap snapshot and save to disk as JSON.\n`.trim();*/\n\nconst FUNCTION_NAME_PATTERN = /^(?:function\\*? )?([^(\\s]+)\\(/;\nfunction extractFunctionName(description: string | undefined): string {\n const fnNameMatch = description?.match(FUNCTION_NAME_PATTERN);\n return fnNameMatch ? `: ${fnNameMatch[1]}` : '';\n}\n\n// process.binding is a method available on the process object, which allows you to load internal modules written in C++\n// @ts-expect-error binding is internal function\nconst NATIVES = PUBLIC_BUILTINS ? process.binding('natives') : {};\n\nfunction isNativeUrl(url: string): boolean {\n url = url.replace(/\\.js$/, '');\n if (PUBLIC_BUILTINS) {\n if (url.startsWith('internal/') || PUBLIC_BUILTINS.includes(url)) {\n return true;\n }\n }\n\n return url in NATIVES || url === 'bootstrap_node';\n}\n\nfunction getRelativePath(filenameOrURL: string): string {\n const dir = join(resolve(), 'x').slice(0, -1);\n\n const filename = filenameOrURL.startsWith('file://') ? fileURLToPath(filenameOrURL) : filenameOrURL;\n\n // Change a path to relative, if possible\n if (filename.indexOf(dir) === 0) {\n return filename.slice(dir.length);\n }\n return filename;\n}\n\nfunction toCallback(promise: Promise<any>, callback: (...args: any[]) => void): void {\n function forward(...args: any[]): void {\n process.nextTick(() => callback(...args));\n }\n\n promise.then(forward.bind(null, null), forward);\n}\n\n// Adds spaces and prefix to number\n// maxN is a maximum number we should have space for\nfunction leftPad(n: number, prefix: string, maxN: number): string {\n const s = n.toString();\n const nchars = Math.max(2, String(maxN).length) + 1;\n const nspaces = nchars - s.length - 1;\n\n return prefix + ' '.repeat(nspaces) + s;\n}\n\nfunction markSourceColumn(sourceText: string, position: number, useColors?: boolean): string {\n if (!sourceText) {\n return '';\n }\n\n const head = sourceText.slice(0, position);\n let tail = sourceText.slice(position);\n\n // Colorize char if stdout supports colours\n if (useColors) {\n tail = tail.replace(/(.+?)([^\\w]|$)/, '\\u001b[32m$1\\u001b[39m$2');\n }\n\n // Return source line with coloured char at `position`\n return [head, tail].join('');\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\nclass RemoteObject implements Runtime.RemoteObject {\n type: string;\n subtype?: string | undefined;\n className?: string | undefined;\n\n value: any;\n unserializableValue?: Runtime.UnserializableValue | undefined;\n description: string | undefined;\n objectId?: Runtime.RemoteObjectId | undefined;\n preview?: Runtime.ObjectPreview | undefined;\n customPreview?: Runtime.CustomPreview | undefined;\n\n constructor(attributes: Runtime.RemoteObject | undefined) {\n this.type = 'undefined';\n Object.assign(this, attributes);\n if (this.type === 'number') {\n this.value = this.unserializableValue ? +this.unserializableValue : +this.value;\n }\n }\n\n [inspectUtil.custom](_depth: number, opts: InspectOptionsStylized): string {\n function formatProperty(prop: PropertyPreview): any {\n switch (prop.type) {\n case 'string':\n case 'undefined':\n return inspectUtil(prop.value, opts);\n\n case 'number':\n case 'boolean':\n return opts.stylize(prop.value as string, prop.type);\n\n case 'object':\n case 'symbol':\n if (prop.subtype === 'date') {\n return inspectUtil(new Date(prop.value as string), opts);\n }\n if (prop.subtype === 'array') {\n return opts.stylize(prop.value as string, 'special');\n }\n return opts.stylize(prop.value as string, (prop.subtype as Style) || 'special');\n\n default:\n return prop.value;\n }\n }\n\n switch (this.type) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'undefined':\n return inspectUtil(this.value, opts);\n\n case 'symbol':\n return opts.stylize(this.description as string, 'special');\n\n case 'function': {\n const fnName = extractFunctionName(this.description);\n const formatted = `[${this.className}${fnName}]`;\n return opts.stylize(formatted, 'special');\n }\n\n case 'object':\n switch (this.subtype) {\n case 'date':\n return inspectUtil(new Date(this.description as string), opts);\n\n case 'null':\n return inspectUtil(null, opts);\n\n case 'regexp':\n return opts.stylize(this.description as string, 'regexp');\n\n default:\n break;\n }\n if (this.preview) {\n const props: any[] = this.preview.properties.map((prop, idx) => {\n const value = formatProperty(prop);\n if (prop.name === `${idx}`) {\n return value;\n }\n return `${prop.name}: ${value}`;\n });\n if (this.preview.overflow) {\n props.push('...');\n }\n const singleLine = props.join(', ');\n const propString = singleLine.length > 60 ? props.join(',\\n ') : singleLine;\n\n return this.subtype === 'array' ? `[ ${propString} ]` : `{ ${propString} }`;\n }\n return this.description || '';\n\n default:\n return this.description || '';\n }\n }\n\n static fromEvalResult({ result, wasThrown }: { result: RemoteObject; wasThrown?: boolean }): RemoteObject | Error {\n if (wasThrown) {\n return convertResultToError(result);\n }\n return new RemoteObject(result);\n }\n}\n\nclass ScopeSnapshot implements Debugger.Scope {\n /**\n * Scope type.\n */\n type: string;\n /**\n * Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.\n */\n object: Runtime.RemoteObject;\n\n name?: string | undefined;\n /**\n * Location in the source code where scope starts\n */\n startLocation?: Debugger.Location | undefined;\n /**\n * Location in the source code where scope ends\n */\n endLocation?: Debugger.Location | undefined;\n\n properties: Map<string, RemoteObject>;\n\n completionGroup: string[];\n\n constructor(scope: Debugger.Scope, properties: Runtime.PropertyDescriptor[]) {\n this.type = scope.type;\n this.object = scope.object;\n\n Object.assign(this, scope);\n\n this.properties = new Map(\n properties.map(prop => {\n const value = new RemoteObject(prop.value);\n return [prop.name, value];\n }),\n );\n\n this.completionGroup = properties.map(prop => prop.name);\n }\n\n [inspectUtil.custom](_depth: number, opts: InspectOptions): string {\n const type = `${this.type[0].toUpperCase()}${this.type.slice(1)}`;\n const name = this.name ? `<${this.name}>` : '';\n const prefix = `${type}${name} `;\n return inspectUtil(this.properties, opts).replace(/^Map /, prefix);\n }\n}\n/*\nfunction copyOwnProperties(target: any, source: any): void {\n Object.getOwnPropertyNames(source).forEach(prop => {\n const descriptor = Object.getOwnPropertyDescriptor(source, prop);\n if (descriptor) {\n Object.defineProperty(target, prop, descriptor);\n }\n });\n}\n\nfunction aliasProperties(target, mapping) {\n Object.keys(mapping).forEach((key) => {\n const descriptor = Object.getOwnPropertyDescriptor(target, key);\n Object.defineProperty(target, mapping[key], descriptor);\n });\n}\n*/\nexport default function createRepl(inspector: NodeInspector): () => REPLServer {\n const { Debugger, /*HeapProfiler, Profiler,*/ Runtime } = inspector;\n\n let repl: REPLServer;\n\n // Things we want to keep around\n // const history = { control: [], debug: [] };\n // const watchedExpressions = [];\n // const knownBreakpoints = [];\n // let pauseOnExceptionState = 'none';\n let lastCommand: string;\n\n // Things we need to reset when the app restarts\n let knownScripts: Record<string, Debugger.ScriptParsedEventDataType & { isNative: boolean }> = {};\n let currentBacktrace: CallFrame[] | undefined;\n let selectedFrame: CallFrame | undefined;\n let exitDebugRepl: undefined | (() => void);\n\n function resetOnStart(): void {\n knownScripts = {};\n currentBacktrace = undefined;\n selectedFrame = undefined;\n\n if (exitDebugRepl) {\n exitDebugRepl();\n }\n exitDebugRepl = undefined;\n }\n\n resetOnStart();\n\n const INSPECT_OPTIONS: InspectOptions = { colors: inspector.stdout.isTTY };\n function inspect(value: any): string {\n return inspectUtil(value, INSPECT_OPTIONS);\n }\n\n function print(value: any, oneline = false): void {\n const text = typeof value === 'string' ? value : inspect(value);\n return inspector.print(text, oneline);\n }\n\n function getCurrentLocation(): Debugger.Location {\n if (!selectedFrame) {\n throw new Error('Requires execution to be paused');\n }\n return selectedFrame.location;\n }\n\n function isCurrentScript(script: Debugger.ScriptParsedEventDataType & { isNative: boolean }): boolean {\n return !!selectedFrame && getCurrentLocation().scriptId === script.scriptId;\n }\n\n function formatScripts(displayNatives = false): string {\n function isVisible(script: Debugger.ScriptParsedEventDataType & { isNative: boolean }): boolean {\n if (displayNatives) {\n return true;\n }\n return !script.isNative || isCurrentScript(script);\n }\n\n return Object.keys(knownScripts)\n .map(scriptId => knownScripts[scriptId])\n .filter(isVisible)\n .map(script => {\n const isCurrent = isCurrentScript(script);\n const { isNative, url } = script;\n const name = `${getRelativePath(url)}${isNative ? ' <native>' : ''}`;\n return `${isCurrent ? '*' : ' '} ${script.scriptId}: ${name}`;\n })\n .join('\\n');\n }\n function listScripts(displayNatives = false): void {\n print(formatScripts(displayNatives));\n }\n // @ts-expect-error no idea what this is\n listScripts[inspectUtil.custom] = function listWithoutInternal(): string {\n return formatScripts();\n };\n /*\n const profiles = [];\n class Profile {\n constructor(data) {\n this.data = data;\n }\n\n static createAndRegister({ profile }) {\n const p = new Profile(profile);\n profiles.push(p);\n return p;\n }\n\n [util.inspect.custom](depth, { stylize }) {\n const { startTime, endTime } = this.data;\n return stylize(`[Profile ${endTime - startTime}μs]`, 'special');\n }\n\n save(filename = 'node.cpuprofile') {\n const absoluteFile = Path.resolve(filename);\n const json = JSON.stringify(this.data);\n FS.writeFileSync(absoluteFile, json);\n print('Saved profile to ' + absoluteFile);\n }\n }\n*/\n class SourceSnippet {\n scriptSource: string;\n /**\n * Script identifier as reported in the <code>Debugger.scriptParsed</code>.\n */\n scriptId: Runtime.ScriptId;\n /**\n * Line number in the script (0-based).\n */\n lineNumber: number;\n /**\n * Column number in the script (0-based).\n */\n columnNumber: number;\n delta: number;\n constructor(location: Debugger.Location, delta: number, scriptSource: string) {\n this.lineNumber = location.lineNumber;\n this.columnNumber = location.columnNumber || 0;\n this.scriptId = location.scriptId;\n this.scriptSource = scriptSource;\n this.delta = delta;\n Object.assign(this, location);\n }\n\n [inspectUtil.custom](_depth: number, options: InspectOptions): string {\n const { /* scriptId, */ lineNumber, columnNumber, delta, scriptSource } = this;\n const start = Math.max(1, lineNumber - delta + 1);\n const end = lineNumber + delta + 1;\n\n const lines = scriptSource.split('\\n');\n return lines\n .slice(start - 1, end)\n .map((lineText, offset) => {\n const i = start + offset;\n const isCurrent = i === lineNumber + 1;\n\n const markedLine = isCurrent ? markSourceColumn(lineText, columnNumber, options.colors) : lineText;\n\n /*\n let isBreakpoint = false;\n knownBreakpoints.forEach(({ location }) => {\n if (!location) return;\n if (scriptId === location.scriptId &&\n i === (location.lineNumber + 1)) {\n isBreakpoint = true;\n }\n });\n */\n\n let prefixChar = ' ';\n if (isCurrent) {\n prefixChar = '>';\n } /*else if (isBreakpoint) {\n prefixChar = '*';\n }*/\n return `${leftPad(i, prefixChar, end)} ${markedLine}`;\n })\n .join('\\n');\n }\n }\n\n function getSourceSnippet(location: Debugger.Location, delta: number = 5): SourceSnippet {\n const { scriptId } = location;\n return Debugger.getScriptSource({ scriptId }).then(\n ({ scriptSource }: Debugger.GetScriptSourceReturnType) => new SourceSnippet(location, delta, scriptSource),\n );\n }\n\n class CallFrame implements Debugger.CallFrame {\n /**\n * Call frame identifier. This identifier is only valid while the virtual machine is paused.\n */\n callFrameId: Debugger.CallFrameId;\n /**\n * Name of the JavaScript function called on this call frame.\n */\n functionName: string;\n /**\n * Location in the source code.\n */\n functionLocation?: Debugger.Location | undefined;\n /**\n * Location in the source code.\n */\n location: Debugger.Location;\n /**\n * JavaScript script name or url.\n */\n url: string;\n /**\n * Scope chain for this call frame.\n */\n scopeChain: Debugger.Scope[];\n /**\n * <code>this</code> object for this call frame.\n */\n this: Runtime.RemoteObject;\n /**\n * The value being returned if the function is at return point.\n */\n returnValue?: Runtime.RemoteObject | undefined;\n\n constructor(callFrame: Debugger.CallFrame) {\n this.functionName = callFrame.functionName;\n this.url = callFrame.url;\n this.scopeChain = callFrame.scopeChain;\n this.this = callFrame.this;\n this.returnValue = callFrame.returnValue;\n this.location = callFrame.location;\n this.callFrameId = callFrame.callFrameId;\n\n Object.assign(this, callFrame);\n }\n\n loadScopes(): Promise<ScopeSnapshot[]> {\n return Promise.all(\n this.scopeChain\n .filter(scope => scope.type !== 'global')\n .map(scope => {\n const { objectId } = scope.object;\n return Runtime.getProperties({\n objectId,\n generatePreview: true,\n } as Runtime.GetPropertiesParameterType).then(({ result }: Runtime.GetPropertiesReturnType) => {\n return new ScopeSnapshot(scope, result);\n });\n }),\n );\n }\n\n list(delta: number = 5): SourceSnippet {\n return getSourceSnippet(this.location, delta);\n }\n }\n\n class Backtrace extends Array {\n [inspectUtil.custom](): string {\n return this.map((callFrame, idx) => {\n const {\n location: { scriptId, lineNumber, columnNumber },\n functionName,\n } = callFrame;\n const name = functionName || '(anonymous)';\n\n const script = knownScripts[scriptId];\n const relativeUrl = (script && getRelativePath(script.url)) || '<unknown>';\n const frameLocation = `${relativeUrl}:${lineNumber + 1}:${columnNumber}`;\n\n return `#${idx} ${name} ${frameLocation}`;\n }).join('\\n');\n }\n\n static from(callFrames: CallFrame[]): CallFrame[] {\n return super.from(\n Array.from(callFrames).map(callFrame => {\n if (callFrame instanceof CallFrame) {\n return callFrame;\n }\n return new CallFrame(callFrame);\n }),\n );\n }\n }\n\n function prepareControlCode(input: string): string {\n if (input === '\\n') {\n return lastCommand;\n }\n // exec process.title => exec(\"process.title\");\n const match = input.match(/^\\s*exec\\s+([^\\n]*)/);\n if (match) {\n lastCommand = `exec(${JSON.stringify(match[1])})`;\n } else {\n lastCommand = input;\n }\n return lastCommand;\n }\n\n // function evalInCurrentContext(code) {\n // // Repl asked for scope variables\n // if (code === '.scope') {\n // if (!selectedFrame) {\n // return Promise.reject(new Error('Requires execution to be paused'));\n // }\n // return selectedFrame.loadScopes().then((scopes) => {\n // return scopes.map((scope) => scope.completionGroup);\n // });\n // }\n //\n // if (selectedFrame) {\n // return Debugger.evaluateOnCallFrame({\n // callFrameId: selectedFrame.callFrameId,\n // expression: code,\n // objectGroup: 'node-inspect',\n // generatePreview: true,\n // }).then(RemoteObject.fromEvalResult);\n // }\n // return Runtime.evaluate({\n // expression: code,\n // objectGroup: 'node-inspect',\n // generatePreview: true,\n // }).then(RemoteObject.fromEvalResult);\n // }\n\n function controlEval(\n input: string,\n context: Context,\n filename: string,\n callback: (error: Error | null, result?: any) => void,\n ): void {\n debuglog('eval:', input);\n function returnToCallback(error: Error | null, result?: any): void {\n debuglog('end-eval:', input, error);\n callback(error, result);\n }\n\n try {\n const code = prepareControlCode(input);\n const result = runInContext(code, context, filename);\n\n if (result && typeof result.then === 'function') {\n toCallback(result, returnToCallback);\n return;\n }\n returnToCallback(null, result);\n } catch (e: any) {\n returnToCallback(e as Error);\n }\n }\n\n // function debugEval(input, context, filename, callback) {\n // debuglog('eval:', input);\n // function returnToCallback(error, result) {\n // debuglog('end-eval:', input, error);\n // callback(error, result);\n // }\n //\n // try {\n // const result = evalInCurrentContext(input);\n //\n // if (result && typeof result.then === 'function') {\n // toCallback(result, returnToCallback);\n // return;\n // }\n // returnToCallback(null, result);\n // } catch (e) {\n // returnToCallback(e);\n // }\n // }\n\n /*function formatWatchers(verbose = false) {\n if (!watchedExpressions.length) {\n return Promise.resolve('');\n }\n\n const inspectValue = (expr) =>\n evalInCurrentContext(expr)\n // .then(formatValue)\n .catch((error) => `<${error.message}>`);\n const lastIndex = watchedExpressions.length - 1;\n\n return Promise.all(watchedExpressions.map(inspectValue))\n .then((values) => {\n const lines = watchedExpressions\n .map((expr, idx) => {\n const prefix = `${leftPad(idx, ' ', lastIndex)}: ${expr} =`;\n const value = inspect(values[idx], { colors: true });\n if (value.indexOf('\\n') === -1) {\n return `${prefix} ${value}`;\n }\n return `${prefix}\\n ${value.split('\\n').join('\\n ')}`;\n });\n return lines.join('\\n');\n })\n .then((valueList) => {\n return verbose ? `Watchers:\\n${valueList}\\n` : valueList;\n });\n }*/\n\n //function watchers(verbose = false) {\n // return formatWatchers(verbose).then(print);\n //}\n\n // List source code\n // function list(delta = 5) {\n // return selectedFrame.list(delta)\n // .then(null, (error) => {\n // print('You can\\'t list source code right now');\n // throw error;\n // });\n // }\n\n //function handleBreakpointResolved({ breakpointId, location }) {\n // const script = knownScripts[location.scriptId];\n // const scriptUrl = script && script.url;\n // if (scriptUrl) {\n // Object.assign(location, { scriptUrl });\n // }\n // const isExisting = knownBreakpoints.some((bp) => {\n // if (bp.breakpointId === breakpointId) {\n // Object.assign(bp, { location });\n // return true;\n // }\n // return false;\n // });\n // if (!isExisting) {\n // knownBreakpoints.push({ breakpointId, location });\n // }\n //}\n\n // function listBreakpoints() {\n // if (!knownBreakpoints.length) {\n // print('No breakpoints yet');\n // return;\n // }\n //\n // function formatLocation(location) {\n // if (!location) return '<unknown location>';\n // const script = knownScripts[location.scriptId];\n // const scriptUrl = script ? script.url : location.scriptUrl;\n // return `${getRelativePath(scriptUrl)}:${location.lineNumber + 1}`;\n // }\n // const breaklist = knownBreakpoints\n // .map((bp, idx) => `#${idx} ${formatLocation(bp.location)}`)\n // .join('\\n');\n // print(breaklist);\n // }\n\n // function setBreakpoint(script, line, condition, silent) {\n // function registerBreakpoint({ breakpointId, actualLocation }) {\n // handleBreakpointResolved({ breakpointId, location: actualLocation });\n // if (actualLocation && actualLocation.scriptId) {\n // if (!silent) return getSourceSnippet(actualLocation, 5);\n // } else {\n // print(`Warning: script '${script}' was not loaded yet.`);\n // }\n // return undefined;\n // }\n //\n // // setBreakpoint(): set breakpoint at current location\n // if (script === undefined) {\n // return Debugger\n // .setBreakpoint({ location: getCurrentLocation(), condition })\n // .then(registerBreakpoint);\n // }\n //\n // // setBreakpoint(line): set breakpoint in current script at specific line\n // if (line === undefined && typeof script === 'number') {\n // const location = {\n // scriptId: getCurrentLocation().scriptId,\n // lineNumber: script - 1,\n // };\n // return Debugger.setBreakpoint({ location, condition })\n // .then(registerBreakpoint);\n // }\n //\n // if (typeof script !== 'string') {\n // throw new TypeError(`setBreakpoint() expects a string, got ${script}`);\n // }\n //\n // // setBreakpoint('fn()'): Break when a function is called\n // if (script.endsWith('()')) {\n // const debugExpr = `debug(${script.slice(0, -2)})`;\n // const debugCall = selectedFrame\n // ? Debugger.evaluateOnCallFrame({\n // callFrameId: selectedFrame.callFrameId,\n // expression: debugExpr,\n // includeCommandLineAPI: true,\n // })\n // : Runtime.evaluate({\n // expression: debugExpr,\n // includeCommandLineAPI: true,\n // });\n // return debugCall.then(({ result, wasThrown }) => {\n // if (wasThrown) return convertResultToError(result);\n // return undefined; // This breakpoint can't be removed the same way\n // });\n // }\n //\n // // setBreakpoint('scriptname')\n // let scriptId = null;\n // let ambiguous = false;\n // if (knownScripts[script]) {\n // scriptId = script;\n // } else {\n // for (const id of Object.keys(knownScripts)) {\n // const scriptUrl = knownScripts[id].url;\n // if (scriptUrl && scriptUrl.indexOf(script) !== -1) {\n // if (scriptId !== null) {\n // ambiguous = true;\n // }\n // scriptId = id;\n // }\n // }\n // }\n //\n // if (ambiguous) {\n // print('Script name is ambiguous');\n // return undefined;\n // }\n // if (line <= 0) {\n // print('Line should be a positive value');\n // return undefined;\n // }\n //\n // if (scriptId !== null) {\n // const location = { scriptId, lineNumber: line - 1 };\n // return Debugger.setBreakpoint({ location, condition })\n // .then(registerBreakpoint);\n // }\n //\n // const escapedPath = script.replace(/([/\\\\.?*()^${}|[\\]])/g, '\\\\$1');\n // const urlRegex = `^(.*[\\\\/\\\\\\\\])?${escapedPath}$`;\n //\n // return Debugger\n // .setBreakpointByUrl({ urlRegex, lineNumber: line - 1, condition })\n // .then((bp) => {\n // // TODO: handle bp.locations in case the regex matches existing files\n // if (!bp.location) { // Fake it for now.\n // Object.assign(bp, {\n // actualLocation: {\n // scriptUrl: `.*/${script}$`,\n // lineNumber: line - 1,\n // },\n // });\n // }\n // return registerBreakpoint(bp);\n // });\n // }\n //\n // function clearBreakpoint(url, line) {\n // const breakpoint = knownBreakpoints.find(({ location }) => {\n // if (!location) return false;\n // const script = knownScripts[location.scriptId];\n // if (!script) return false;\n // return (\n // script.url.indexOf(url) !== -1 && (location.lineNumber + 1) === line\n // );\n // });\n // if (!breakpoint) {\n // print(`Could not find breakpoint at ${url}:${line}`);\n // return Promise.resolve();\n // }\n // return Debugger.removeBreakpoint({ breakpointId: breakpoint.breakpointId })\n // .then(() => {\n // const idx = knownBreakpoints.indexOf(breakpoint);\n // knownBreakpoints.splice(idx, 1);\n // });\n // }\n //\n // function restoreBreakpoints() {\n // const lastBreakpoints = knownBreakpoints.slice();\n // knownBreakpoints.length = 0;\n // const newBreakpoints = lastBreakpoints\n // .filter(({ location }) => !!location.scriptUrl)\n // .map(({ location }) =>\n // setBreakpoint(location.scriptUrl, location.lineNumber + 1));\n // if (!newBreakpoints.length) return Promise.resolve();\n // return Promise.all(newBreakpoints).then((results) => {\n // print(`${results.length} breakpoints restored.`);\n // });\n // }\n\n // function setPauseOnExceptions(state) {\n // return Debugger.setPauseOnExceptions({ state })\n // .then(() => {\n // pauseOnExceptionState = state;\n // });\n // }\n\n Debugger.on('paused', (data: Debugger.PausedEventDataType): void => {\n const callFrames: CallFrame[] = data.callFrames as CallFrame[];\n const reason: string = data.reason;\n\n if (process.env.NODE_INSPECT_RESUME_ON_START === '1' && reason === 'Break on start') {\n debuglog('Paused on start, but NODE_INSPECT_RESUME_ON_START environment variable is set to 1, resuming');\n inspector.client.callMethod('Debugger.resume');\n return;\n }\n\n // Save execution context's data\n currentBacktrace = Backtrace.from(callFrames);\n selectedFrame = currentBacktrace[0];\n // const { scriptId, lineNumber } = selectedFrame.location;\n\n // const breakType = reason === 'other' ? 'break' : reason;\n // const script = knownScripts[scriptId];\n // const scriptUrl = script ? getRelativePath(script.url) : '[unknown]';\n\n // const header = `${breakType} in ${scriptUrl}:${lineNumber + 1}`;\n\n void inspector.suspendReplWhile(() => {\n const context = selectedFrame?.list(3);\n inspect(context);\n });\n });\n\n function handleResumed(): void {\n currentBacktrace = undefined;\n selectedFrame = undefined;\n }\n\n Debugger.on('resumed', handleResumed);\n\n //Debugger.on('breakpointResolved', handleBreakpointResolved);\n\n Debugger.on('scriptParsed', (script: Debugger.ScriptParsedEventDataType) => {\n const { scriptId, url } = script;\n if (url) {\n knownScripts[scriptId] = Object.assign(\n {\n isNative: isNativeUrl(url),\n },\n script,\n );\n }\n });\n\n /*Profiler.on('consoleProfileFinished', ({ profile }) => {\n Profile.createAndRegister({ profile });\n print([\n 'Captured new CPU profile.',\n `Access it with profiles[${profiles.length - 1}]`\n ].join('\\n'));\n });*/\n\n function initializeContext(context: Context): void {\n Object.defineProperty(context, 'Debugger', {\n value: inspector.Debugger,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'HeapProfiler', {\n value: inspector.HeapProfiler,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'Profiler', {\n value: inspector.Profiler,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'Runtime', {\n value: inspector.Runtime,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n\n /*copyOwnProperties(context, {\n get help() {\n print(HELP);\n },\n\n get run() {\n return inspector.run();\n },\n\n get kill() {\n return inspector.killChild();\n },\n\n get restart() {\n return inspector.run();\n },\n\n get cont() {\n handleResumed();\n return Debugger.resume();\n },\n\n get next() {\n handleResumed();\n return Debugger.stepOver();\n },\n\n get step() {\n handleResumed();\n return Debugger.stepInto();\n },\n\n get out() {\n handleResumed();\n return Debugger.stepOut();\n },\n\n get pause() {\n return Debugger.pause();\n },\n\n get backtrace() {\n return currentBacktrace;\n },\n\n get breakpoints() {\n return listBreakpoints();\n },\n\n exec(expr) {\n return evalInCurrentContext(expr);\n },\n\n get profile() {\n return Profiler.start();\n },\n\n get profileEnd() {\n return Profiler.stop()\n .then(Profile.createAndRegister);\n },\n\n get profiles() {\n return profiles;\n },\n\n takeHeapSnapshot(filename = 'node.heapsnapshot') {\n return new Promise((resolve, reject) => {\n const absoluteFile = Path.resolve(filename);\n const writer = FS.createWriteStream(absoluteFile);\n let sizeWritten = 0;\n function onProgress({ done, total, finished }) {\n if (finished) {\n print('Heap snaphost prepared.');\n } else {\n print(`Heap snapshot: ${done}/${total}`, true);\n }\n }\n function onChunk({ chunk }) {\n sizeWritten += chunk.length;\n writer.write(chunk);\n print(`Writing snapshot: ${sizeWritten}`, true);\n }\n function onResolve() {\n writer.end(() => {\n teardown();\n print(`Wrote snapshot: ${absoluteFile}`);\n resolve();\n });\n }\n function onReject(error) {\n teardown();\n reject(error);\n }\n function teardown() {\n HeapProfiler.removeListener(\n 'reportHeapSnapshotProgress', onProgress);\n HeapProfiler.removeListener('addHeapSnapshotChunk', onChunk);\n }\n\n HeapProfiler.on('reportHeapSnapshotProgress', onProgress);\n HeapProfiler.on('addHeapSnapshotChunk', onChunk);\n\n print('Heap snapshot: 0/0', true);\n HeapProfiler.takeHeapSnapshot({ reportProgress: true })\n .then(onResolve, onReject);\n });\n },\n\n get watchers() {\n return watchers();\n },\n\n watch(expr) {\n watchedExpressions.push(expr);\n },\n\n unwatch(expr) {\n const index = watchedExpressions.indexOf(expr);\n\n // Unwatch by expression\n // or\n // Unwatch by watcher number\n watchedExpressions.splice(index !== -1 ? index : +expr, 1);\n },\n\n get repl() {\n // Don't display any default messages\n const listeners = repl.listeners('SIGINT').slice(0);\n repl.removeAllListeners('SIGINT');\n\n const oldContext = repl.context;\n\n exitDebugRepl = () => {\n // Restore all listeners\n process.nextTick(() => {\n listeners.forEach((listener) => {\n repl.on('SIGINT', listener);\n });\n });\n\n // Exit debug repl\n repl.eval = controlEval;\n\n // Swap history\n history.debug = repl.history;\n repl.history = history.control;\n\n repl.context = oldContext;\n repl.setPrompt('debug> ');\n repl.displayPrompt();\n\n repl.removeListener('SIGINT', exitDebugRepl);\n repl.removeListener('exit', exitDebugRepl);\n\n exitDebugRepl = null;\n };\n\n // Exit debug repl on SIGINT\n repl.on('SIGINT', exitDebugRepl);\n\n // Exit debug repl on repl exit\n repl.on('exit', exitDebugRepl);\n\n // Set new\n repl.eval = debugEval;\n repl.context = {};\n\n // Swap history\n history.control = repl.history;\n repl.history = history.debug;\n\n repl.setPrompt('> ');\n\n print('Press Ctrl + C to leave debug repl');\n repl.displayPrompt();\n },\n\n get version() {\n return Runtime.evaluate({\n expression: 'process.versions.v8',\n contextId: 1,\n returnByValue: true,\n }).then(({ result }) => {\n print(result.value);\n });\n },\n\n scripts: listScripts,\n\n //setBreakpoint,\n //clearBreakpoint,\n setPauseOnExceptions,\n get breakOnException() {\n return setPauseOnExceptions('all');\n },\n get breakOnUncaught() {\n return setPauseOnExceptions('uncaught');\n },\n get breakOnNone() {\n return setPauseOnExceptions('none');\n },\n\n list,\n });*/\n //aliasProperties(context, SHORTCUTS);\n }\n\n function initAfterStart(): Promise<void> {\n const setupTasks = [\n Runtime.enable(),\n //Profiler.enable(),\n //Profiler.setSamplingInterval({ interval: 100 }),\n Debugger.enable(),\n Debugger.setPauseOnExceptions({ state: 'none' }),\n Debugger.setAsyncCallStackDepth({ maxDepth: 1 }),\n Debugger.setBlackboxPatterns({ patterns: [] }),\n // Debugger.setPauseOnExceptions({ state: 'all' }),\n //restoreBreakpoints(),\n Runtime.runIfWaitingForDebugger(),\n ];\n return Promise.all(setupTasks);\n }\n\n return function startRepl(): REPLServer {\n inspector.client.on('close', () => resetOnStart());\n inspector.client.on('ready', () => {\n initAfterStart().catch(err => {\n print(`Error starting inspector: ${err.message}`);\n });\n });\n\n const replOptions: ReplOptions = {\n prompt: 'debug> ',\n input: inspector.stdin,\n output: inspector.stdout,\n eval: controlEval,\n useGlobal: false,\n ignoreUndefined: true,\n };\n\n repl = start(replOptions);\n initializeContext(repl.context);\n repl.on('reset', initializeContext);\n\n repl.defineCommand('interrupt', () => {\n // We want this for testing purposes where sending CTRL-C can be tricky.\n repl.emit('SIGINT');\n });\n\n // Init once for the initial connection\n initAfterStart().catch(err => {\n print(`Error starting inspector: ${err.message}`);\n });\n\n return repl;\n };\n}\n"]}
1
+ {"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src/lib/debugger.ts"],"names":[],"mappings":";;AA0WA,6BAq5BC;AA/vCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yCAA0C;AAC1C,yCAAqE;AACrE,yCAMmB;AACnB,qCAAqD;AACrD,uCAAyC;AACzC,6CAAgE;AAKhE,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,SAAS,CAAC,CAAC;AAoBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAgDW;AAEX,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAC9D,SAAS,mBAAmB,CAAC,WAA+B;IACxD,MAAM,WAAW,GAAG,WAAW,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC9D,OAAO,WAAW,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,wHAAwH;AACxH,gDAAgD;AAChD,MAAM,OAAO,GAAG,4BAAe,CAAC,CAAC,CAAC,OAAO,CAAC,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;QAEH,MAAM,WAAW,GAAgB;YAC7B,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,KAAK;YAChB,eAAe,EAAE,IAAI;SACxB,CAAC;QAEF,IAAI,GAAG,IAAA,iBAAK,EAAC,WAAW,CAAC,CAAC;QAC1B,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAEpC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE;YACjC,wEAAwE;YACxE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,uCAAuC;QACvC,cAAc,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACzB,KAAK,CAAC,6BAA6B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,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 { join, resolve } from 'node:path';\nimport { type ReplOptions, type REPLServer, start } from 'node:repl';\nimport {\n debuglog as debuglogUtil,\n inspect as inspectUtil,\n type InspectOptions,\n type InspectOptionsStylized,\n type Style,\n} from 'node:util';\nimport { type Context, runInContext } from 'node:vm';\nimport { fileURLToPath } from 'node:url';\nimport { builtinModules as PUBLIC_BUILTINS } from 'node:module';\nimport type { Debugger, Runtime } from 'node:inspector';\n\nimport type { NodeInspector } from './inspect';\n\nconst debuglog = debuglogUtil('inspect');\n\ninterface PropertyPreview {\n /**\n * Property name.\n */\n name: string;\n /**\n * Object type. Accessor means that the property itself is an accessor property.\n */\n type: string;\n /**\n * User-friendly property value string.\n */\n value?: string | undefined;\n /**\n * Object subtype hint. Specified for <code>object</code> type values only.\n */\n subtype?: string | undefined;\n}\n/*const SHORTCUTS = {\n cont: 'c',\n next: 'n',\n step: 's',\n out: 'o',\n backtrace: 'bt',\n setBreakpoint: 'sb',\n clearBreakpoint: 'cb',\n run: 'r',\n};\n\nconst HELP = `\nrun, restart, r Run the application or reconnect\nkill Kill a running application or disconnect\n\ncont, c Resume execution\nnext, n Continue to next line in current file\nstep, s Step into, potentially entering a function\nout, o Step out, leaving the current function\nbacktrace, bt Print the current backtrace\nlist Print the source around the current line where execution\n is currently paused\n\nsetBreakpoint, sb Set a breakpoint\nclearBreakpoint, cb Clear a breakpoint\nbreakpoints List all known breakpoints\nbreakOnException Pause execution whenever an exception is thrown\nbreakOnUncaught Pause execution whenever an exception isn't caught\nbreakOnNone Don't pause on exceptions (this is the default)\n\nwatch(expr) Start watching the given expression\nunwatch(expr) Stop watching an expression\nwatchers Print all watched expressions and their current values\n\nexec(expr) Evaluate the expression and print the value\nrepl Enter a debug repl that works like exec\n\nscripts List application scripts that are currently loaded\nscripts(true) List all scripts (including node-internals)\n\nprofile Start CPU profiling session.\nprofileEnd Stop current CPU profiling session.\nprofiles Array of completed CPU profiling sessions.\nprofiles[n].save(filepath = 'node.cpuprofile')\n Save CPU profiling session to disk as JSON.\n\ntakeHeapSnapshot(filepath = 'node.heapsnapshot')\n Take a heap snapshot and save to disk as JSON.\n`.trim();*/\n\nconst FUNCTION_NAME_PATTERN = /^(?:function\\*? )?([^(\\s]+)\\(/;\nfunction extractFunctionName(description: string | undefined): string {\n const fnNameMatch = description?.match(FUNCTION_NAME_PATTERN);\n return fnNameMatch ? `: ${fnNameMatch[1]}` : '';\n}\n\n// process.binding is a method available on the process object, which allows you to load internal modules written in C++\n// @ts-expect-error binding is internal function\nconst NATIVES = PUBLIC_BUILTINS ? process.binding('natives') : {};\n\nfunction isNativeUrl(url: string): boolean {\n url = url.replace(/\\.js$/, '');\n if (PUBLIC_BUILTINS) {\n if (url.startsWith('internal/') || PUBLIC_BUILTINS.includes(url)) {\n return true;\n }\n }\n\n return url in NATIVES || url === 'bootstrap_node';\n}\n\nfunction getRelativePath(filenameOrURL: string): string {\n const dir = join(resolve(), 'x').slice(0, -1);\n\n const filename = filenameOrURL.startsWith('file://') ? fileURLToPath(filenameOrURL) : filenameOrURL;\n\n // Change a path to relative, if possible\n if (filename.indexOf(dir) === 0) {\n return filename.slice(dir.length);\n }\n return filename;\n}\n\nfunction toCallback(promise: Promise<any>, callback: (...args: any[]) => void): void {\n function forward(...args: any[]): void {\n process.nextTick(() => callback(...args));\n }\n\n promise.then(forward.bind(null, null), forward);\n}\n\n// Adds spaces and prefix to number\n// maxN is a maximum number we should have space for\nfunction leftPad(n: number, prefix: string, maxN: number): string {\n const s = n.toString();\n const nchars = Math.max(2, String(maxN).length) + 1;\n const nspaces = nchars - s.length - 1;\n\n return prefix + ' '.repeat(nspaces) + s;\n}\n\nfunction markSourceColumn(sourceText: string, position: number, useColors?: boolean): string {\n if (!sourceText) {\n return '';\n }\n\n const head = sourceText.slice(0, position);\n let tail = sourceText.slice(position);\n\n // Colorize char if stdout supports colours\n if (useColors) {\n tail = tail.replace(/(.+?)([^\\w]|$)/, '\\u001b[32m$1\\u001b[39m$2');\n }\n\n // Return source line with coloured char at `position`\n return [head, tail].join('');\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\nclass RemoteObject implements Runtime.RemoteObject {\n type: string;\n subtype?: string | undefined;\n className?: string | undefined;\n\n value: any;\n unserializableValue?: Runtime.UnserializableValue | undefined;\n description: string | undefined;\n objectId?: Runtime.RemoteObjectId | undefined;\n preview?: Runtime.ObjectPreview | undefined;\n customPreview?: Runtime.CustomPreview | undefined;\n\n constructor(attributes: Runtime.RemoteObject | undefined) {\n this.type = 'undefined';\n Object.assign(this, attributes);\n if (this.type === 'number') {\n this.value = this.unserializableValue ? +this.unserializableValue : +this.value;\n }\n }\n\n [inspectUtil.custom](_depth: number, opts: InspectOptionsStylized): string {\n function formatProperty(prop: PropertyPreview): any {\n switch (prop.type) {\n case 'string':\n case 'undefined':\n return inspectUtil(prop.value, opts);\n\n case 'number':\n case 'boolean':\n return opts.stylize(prop.value as string, prop.type);\n\n case 'object':\n case 'symbol':\n if (prop.subtype === 'date') {\n return inspectUtil(new Date(prop.value as string), opts);\n }\n if (prop.subtype === 'array') {\n return opts.stylize(prop.value as string, 'special');\n }\n return opts.stylize(prop.value as string, (prop.subtype as Style) || 'special');\n\n default:\n return prop.value;\n }\n }\n\n switch (this.type) {\n case 'boolean':\n case 'number':\n case 'string':\n case 'undefined':\n return inspectUtil(this.value, opts);\n\n case 'symbol':\n return opts.stylize(this.description as string, 'special');\n\n case 'function': {\n const fnName = extractFunctionName(this.description);\n const formatted = `[${this.className}${fnName}]`;\n return opts.stylize(formatted, 'special');\n }\n\n case 'object':\n switch (this.subtype) {\n case 'date':\n return inspectUtil(new Date(this.description as string), opts);\n\n case 'null':\n return inspectUtil(null, opts);\n\n case 'regexp':\n return opts.stylize(this.description as string, 'regexp');\n\n default:\n break;\n }\n if (this.preview) {\n const props: any[] = this.preview.properties.map((prop, idx) => {\n const value = formatProperty(prop);\n if (prop.name === `${idx}`) {\n return value;\n }\n return `${prop.name}: ${value}`;\n });\n if (this.preview.overflow) {\n props.push('...');\n }\n const singleLine = props.join(', ');\n const propString = singleLine.length > 60 ? props.join(',\\n ') : singleLine;\n\n return this.subtype === 'array' ? `[ ${propString} ]` : `{ ${propString} }`;\n }\n return this.description || '';\n\n default:\n return this.description || '';\n }\n }\n\n static fromEvalResult({ result, wasThrown }: { result: RemoteObject; wasThrown?: boolean }): RemoteObject | Error {\n if (wasThrown) {\n return convertResultToError(result);\n }\n return new RemoteObject(result);\n }\n}\n\nclass ScopeSnapshot implements Debugger.Scope {\n /**\n * Scope type.\n */\n type: string;\n /**\n * Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.\n */\n object: Runtime.RemoteObject;\n\n name?: string | undefined;\n /**\n * Location in the source code where scope starts\n */\n startLocation?: Debugger.Location | undefined;\n /**\n * Location in the source code where scope ends\n */\n endLocation?: Debugger.Location | undefined;\n\n properties: Map<string, RemoteObject>;\n\n completionGroup: string[];\n\n constructor(scope: Debugger.Scope, properties: Runtime.PropertyDescriptor[]) {\n this.type = scope.type;\n this.object = scope.object;\n\n Object.assign(this, scope);\n\n this.properties = new Map(\n properties.map(prop => {\n const value = new RemoteObject(prop.value);\n return [prop.name, value];\n }),\n );\n\n this.completionGroup = properties.map(prop => prop.name);\n }\n\n [inspectUtil.custom](_depth: number, opts: InspectOptions): string {\n const type = `${this.type[0].toUpperCase()}${this.type.slice(1)}`;\n const name = this.name ? `<${this.name}>` : '';\n const prefix = `${type}${name} `;\n return inspectUtil(this.properties, opts).replace(/^Map /, prefix);\n }\n}\n/*\nfunction copyOwnProperties(target: any, source: any): void {\n Object.getOwnPropertyNames(source).forEach(prop => {\n const descriptor = Object.getOwnPropertyDescriptor(source, prop);\n if (descriptor) {\n Object.defineProperty(target, prop, descriptor);\n }\n });\n}\n\nfunction aliasProperties(target, mapping) {\n Object.keys(mapping).forEach((key) => {\n const descriptor = Object.getOwnPropertyDescriptor(target, key);\n Object.defineProperty(target, mapping[key], descriptor);\n });\n}\n*/\nexport default function createRepl(inspector: NodeInspector): () => REPLServer {\n const { Debugger, /*HeapProfiler, Profiler,*/ Runtime } = inspector;\n\n let repl: REPLServer;\n\n // Things we want to keep around\n // const history = { control: [], debug: [] };\n // const watchedExpressions = [];\n // const knownBreakpoints = [];\n // let pauseOnExceptionState = 'none';\n let lastCommand: string;\n\n // Things we need to reset when the app restarts\n let knownScripts: Record<string, Debugger.ScriptParsedEventDataType & { isNative: boolean }> = {};\n let currentBacktrace: CallFrame[] | undefined;\n let selectedFrame: CallFrame | undefined;\n let exitDebugRepl: undefined | (() => void);\n\n function resetOnStart(): void {\n knownScripts = {};\n currentBacktrace = undefined;\n selectedFrame = undefined;\n\n if (exitDebugRepl) {\n exitDebugRepl();\n }\n exitDebugRepl = undefined;\n }\n\n resetOnStart();\n\n const INSPECT_OPTIONS: InspectOptions = { colors: inspector.stdout.isTTY };\n function inspect(value: any): string {\n return inspectUtil(value, INSPECT_OPTIONS);\n }\n\n function print(value: any, oneline = false): void {\n const text = typeof value === 'string' ? value : inspect(value);\n return inspector.print(text, oneline);\n }\n\n function getCurrentLocation(): Debugger.Location {\n if (!selectedFrame) {\n throw new Error('Requires execution to be paused');\n }\n return selectedFrame.location;\n }\n\n function isCurrentScript(script: Debugger.ScriptParsedEventDataType & { isNative: boolean }): boolean {\n return !!selectedFrame && getCurrentLocation().scriptId === script.scriptId;\n }\n\n function formatScripts(displayNatives = false): string {\n function isVisible(script: Debugger.ScriptParsedEventDataType & { isNative: boolean }): boolean {\n if (displayNatives) {\n return true;\n }\n return !script.isNative || isCurrentScript(script);\n }\n\n return Object.keys(knownScripts)\n .map(scriptId => knownScripts[scriptId])\n .filter(isVisible)\n .map(script => {\n const isCurrent = isCurrentScript(script);\n const { isNative, url } = script;\n const name = `${getRelativePath(url)}${isNative ? ' <native>' : ''}`;\n return `${isCurrent ? '*' : ' '} ${script.scriptId}: ${name}`;\n })\n .join('\\n');\n }\n function listScripts(displayNatives = false): void {\n print(formatScripts(displayNatives));\n }\n // @ts-expect-error no idea what this is\n listScripts[inspectUtil.custom] = function listWithoutInternal(): string {\n return formatScripts();\n };\n /*\n const profiles = [];\n class Profile {\n constructor(data) {\n this.data = data;\n }\n\n static createAndRegister({ profile }) {\n const p = new Profile(profile);\n profiles.push(p);\n return p;\n }\n\n [util.inspect.custom](depth, { stylize }) {\n const { startTime, endTime } = this.data;\n return stylize(`[Profile ${endTime - startTime}μs]`, 'special');\n }\n\n save(filename = 'node.cpuprofile') {\n const absoluteFile = Path.resolve(filename);\n const json = JSON.stringify(this.data);\n FS.writeFileSync(absoluteFile, json);\n print('Saved profile to ' + absoluteFile);\n }\n }\n*/\n class SourceSnippet {\n scriptSource: string;\n /**\n * Script identifier as reported in the <code>Debugger.scriptParsed</code>.\n */\n scriptId: Runtime.ScriptId;\n /**\n * Line number in the script (0-based).\n */\n lineNumber: number;\n /**\n * Column number in the script (0-based).\n */\n columnNumber: number;\n delta: number;\n constructor(location: Debugger.Location, delta: number, scriptSource: string) {\n this.lineNumber = location.lineNumber;\n this.columnNumber = location.columnNumber || 0;\n this.scriptId = location.scriptId;\n this.scriptSource = scriptSource;\n this.delta = delta;\n Object.assign(this, location);\n }\n\n [inspectUtil.custom](_depth: number, options: InspectOptions): string {\n const { /* scriptId, */ lineNumber, columnNumber, delta, scriptSource } = this;\n const start = Math.max(1, lineNumber - delta + 1);\n const end = lineNumber + delta + 1;\n\n const lines = scriptSource.split('\\n');\n return lines\n .slice(start - 1, end)\n .map((lineText, offset) => {\n const i = start + offset;\n const isCurrent = i === lineNumber + 1;\n\n const markedLine = isCurrent ? markSourceColumn(lineText, columnNumber, options.colors) : lineText;\n\n /*\n let isBreakpoint = false;\n knownBreakpoints.forEach(({ location }) => {\n if (!location) return;\n if (scriptId === location.scriptId &&\n i === (location.lineNumber + 1)) {\n isBreakpoint = true;\n }\n });\n */\n\n let prefixChar = ' ';\n if (isCurrent) {\n prefixChar = '>';\n } /*else if (isBreakpoint) {\n prefixChar = '*';\n }*/\n return `${leftPad(i, prefixChar, end)} ${markedLine}`;\n })\n .join('\\n');\n }\n }\n\n function getSourceSnippet(location: Debugger.Location, delta: number = 5): SourceSnippet {\n const { scriptId } = location;\n return Debugger.getScriptSource({ scriptId }).then(\n ({ scriptSource }: Debugger.GetScriptSourceReturnType) => new SourceSnippet(location, delta, scriptSource),\n );\n }\n\n class CallFrame implements Debugger.CallFrame {\n /**\n * Call frame identifier. This identifier is only valid while the virtual machine is paused.\n */\n callFrameId: Debugger.CallFrameId;\n /**\n * Name of the JavaScript function called on this call frame.\n */\n functionName: string;\n /**\n * Location in the source code.\n */\n functionLocation?: Debugger.Location | undefined;\n /**\n * Location in the source code.\n */\n location: Debugger.Location;\n /**\n * JavaScript script name or url.\n */\n url: string;\n /**\n * Scope chain for this call frame.\n */\n scopeChain: Debugger.Scope[];\n /**\n * <code>this</code> object for this call frame.\n */\n this: Runtime.RemoteObject;\n /**\n * The value being returned if the function is at return point.\n */\n returnValue?: Runtime.RemoteObject | undefined;\n\n constructor(callFrame: Debugger.CallFrame) {\n this.functionName = callFrame.functionName;\n this.url = callFrame.url;\n this.scopeChain = callFrame.scopeChain;\n this.this = callFrame.this;\n this.returnValue = callFrame.returnValue;\n this.location = callFrame.location;\n this.callFrameId = callFrame.callFrameId;\n\n Object.assign(this, callFrame);\n }\n\n loadScopes(): Promise<ScopeSnapshot[]> {\n return Promise.all(\n this.scopeChain\n .filter(scope => scope.type !== 'global')\n .map(scope => {\n const { objectId } = scope.object;\n return Runtime.getProperties({\n objectId,\n generatePreview: true,\n } as Runtime.GetPropertiesParameterType).then(({ result }: Runtime.GetPropertiesReturnType) => {\n return new ScopeSnapshot(scope, result);\n });\n }),\n );\n }\n\n list(delta: number = 5): SourceSnippet {\n return getSourceSnippet(this.location, delta);\n }\n }\n\n class Backtrace extends Array {\n [inspectUtil.custom](): string {\n return this.map((callFrame, idx) => {\n const {\n location: { scriptId, lineNumber, columnNumber },\n functionName,\n } = callFrame;\n const name = functionName || '(anonymous)';\n\n const script = knownScripts[scriptId];\n const relativeUrl = (script && getRelativePath(script.url)) || '<unknown>';\n const frameLocation = `${relativeUrl}:${lineNumber + 1}:${columnNumber}`;\n\n return `#${idx} ${name} ${frameLocation}`;\n }).join('\\n');\n }\n\n static from(callFrames: CallFrame[]): CallFrame[] {\n return super.from(\n Array.from(callFrames).map(callFrame => {\n if (callFrame instanceof CallFrame) {\n return callFrame;\n }\n return new CallFrame(callFrame);\n }),\n );\n }\n }\n\n function prepareControlCode(input: string): string {\n if (input === '\\n') {\n return lastCommand;\n }\n // exec process.title => exec(\"process.title\");\n const match = input.match(/^\\s*exec\\s+([^\\n]*)/);\n if (match) {\n lastCommand = `exec(${JSON.stringify(match[1])})`;\n } else {\n lastCommand = input;\n }\n return lastCommand;\n }\n\n // function evalInCurrentContext(code) {\n // // Repl asked for scope variables\n // if (code === '.scope') {\n // if (!selectedFrame) {\n // return Promise.reject(new Error('Requires execution to be paused'));\n // }\n // return selectedFrame.loadScopes().then((scopes) => {\n // return scopes.map((scope) => scope.completionGroup);\n // });\n // }\n //\n // if (selectedFrame) {\n // return Debugger.evaluateOnCallFrame({\n // callFrameId: selectedFrame.callFrameId,\n // expression: code,\n // objectGroup: 'node-inspect',\n // generatePreview: true,\n // }).then(RemoteObject.fromEvalResult);\n // }\n // return Runtime.evaluate({\n // expression: code,\n // objectGroup: 'node-inspect',\n // generatePreview: true,\n // }).then(RemoteObject.fromEvalResult);\n // }\n\n function controlEval(\n input: string,\n context: Context,\n filename: string,\n callback: (error: Error | null, result?: any) => void,\n ): void {\n debuglog('eval:', input);\n function returnToCallback(error: Error | null, result?: any): void {\n debuglog('end-eval:', input, error);\n callback(error, result);\n }\n\n try {\n const code = prepareControlCode(input);\n const result = runInContext(code, context, filename);\n\n if (result && typeof result.then === 'function') {\n toCallback(result, returnToCallback);\n return;\n }\n returnToCallback(null, result);\n } catch (e: any) {\n returnToCallback(e as Error);\n }\n }\n\n // function debugEval(input, context, filename, callback) {\n // debuglog('eval:', input);\n // function returnToCallback(error, result) {\n // debuglog('end-eval:', input, error);\n // callback(error, result);\n // }\n //\n // try {\n // const result = evalInCurrentContext(input);\n //\n // if (result && typeof result.then === 'function') {\n // toCallback(result, returnToCallback);\n // return;\n // }\n // returnToCallback(null, result);\n // } catch (e) {\n // returnToCallback(e);\n // }\n // }\n\n /*function formatWatchers(verbose = false) {\n if (!watchedExpressions.length) {\n return Promise.resolve('');\n }\n\n const inspectValue = (expr) =>\n evalInCurrentContext(expr)\n // .then(formatValue)\n .catch((error) => `<${error.message}>`);\n const lastIndex = watchedExpressions.length - 1;\n\n return Promise.all(watchedExpressions.map(inspectValue))\n .then((values) => {\n const lines = watchedExpressions\n .map((expr, idx) => {\n const prefix = `${leftPad(idx, ' ', lastIndex)}: ${expr} =`;\n const value = inspect(values[idx], { colors: true });\n if (value.indexOf('\\n') === -1) {\n return `${prefix} ${value}`;\n }\n return `${prefix}\\n ${value.split('\\n').join('\\n ')}`;\n });\n return lines.join('\\n');\n })\n .then((valueList) => {\n return verbose ? `Watchers:\\n${valueList}\\n` : valueList;\n });\n }*/\n\n //function watchers(verbose = false) {\n // return formatWatchers(verbose).then(print);\n //}\n\n // List source code\n // function list(delta = 5) {\n // return selectedFrame.list(delta)\n // .then(null, (error) => {\n // print('You can\\'t list source code right now');\n // throw error;\n // });\n // }\n\n //function handleBreakpointResolved({ breakpointId, location }) {\n // const script = knownScripts[location.scriptId];\n // const scriptUrl = script && script.url;\n // if (scriptUrl) {\n // Object.assign(location, { scriptUrl });\n // }\n // const isExisting = knownBreakpoints.some((bp) => {\n // if (bp.breakpointId === breakpointId) {\n // Object.assign(bp, { location });\n // return true;\n // }\n // return false;\n // });\n // if (!isExisting) {\n // knownBreakpoints.push({ breakpointId, location });\n // }\n //}\n\n // function listBreakpoints() {\n // if (!knownBreakpoints.length) {\n // print('No breakpoints yet');\n // return;\n // }\n //\n // function formatLocation(location) {\n // if (!location) return '<unknown location>';\n // const script = knownScripts[location.scriptId];\n // const scriptUrl = script ? script.url : location.scriptUrl;\n // return `${getRelativePath(scriptUrl)}:${location.lineNumber + 1}`;\n // }\n // const breaklist = knownBreakpoints\n // .map((bp, idx) => `#${idx} ${formatLocation(bp.location)}`)\n // .join('\\n');\n // print(breaklist);\n // }\n\n // function setBreakpoint(script, line, condition, silent) {\n // function registerBreakpoint({ breakpointId, actualLocation }) {\n // handleBreakpointResolved({ breakpointId, location: actualLocation });\n // if (actualLocation && actualLocation.scriptId) {\n // if (!silent) return getSourceSnippet(actualLocation, 5);\n // } else {\n // print(`Warning: script '${script}' was not loaded yet.`);\n // }\n // return undefined;\n // }\n //\n // // setBreakpoint(): set breakpoint at current location\n // if (script === undefined) {\n // return Debugger\n // .setBreakpoint({ location: getCurrentLocation(), condition })\n // .then(registerBreakpoint);\n // }\n //\n // // setBreakpoint(line): set breakpoint in current script at specific line\n // if (line === undefined && typeof script === 'number') {\n // const location = {\n // scriptId: getCurrentLocation().scriptId,\n // lineNumber: script - 1,\n // };\n // return Debugger.setBreakpoint({ location, condition })\n // .then(registerBreakpoint);\n // }\n //\n // if (typeof script !== 'string') {\n // throw new TypeError(`setBreakpoint() expects a string, got ${script}`);\n // }\n //\n // // setBreakpoint('fn()'): Break when a function is called\n // if (script.endsWith('()')) {\n // const debugExpr = `debug(${script.slice(0, -2)})`;\n // const debugCall = selectedFrame\n // ? Debugger.evaluateOnCallFrame({\n // callFrameId: selectedFrame.callFrameId,\n // expression: debugExpr,\n // includeCommandLineAPI: true,\n // })\n // : Runtime.evaluate({\n // expression: debugExpr,\n // includeCommandLineAPI: true,\n // });\n // return debugCall.then(({ result, wasThrown }) => {\n // if (wasThrown) return convertResultToError(result);\n // return undefined; // This breakpoint can't be removed the same way\n // });\n // }\n //\n // // setBreakpoint('scriptname')\n // let scriptId = null;\n // let ambiguous = false;\n // if (knownScripts[script]) {\n // scriptId = script;\n // } else {\n // for (const id of Object.keys(knownScripts)) {\n // const scriptUrl = knownScripts[id].url;\n // if (scriptUrl && scriptUrl.indexOf(script) !== -1) {\n // if (scriptId !== null) {\n // ambiguous = true;\n // }\n // scriptId = id;\n // }\n // }\n // }\n //\n // if (ambiguous) {\n // print('Script name is ambiguous');\n // return undefined;\n // }\n // if (line <= 0) {\n // print('Line should be a positive value');\n // return undefined;\n // }\n //\n // if (scriptId !== null) {\n // const location = { scriptId, lineNumber: line - 1 };\n // return Debugger.setBreakpoint({ location, condition })\n // .then(registerBreakpoint);\n // }\n //\n // const escapedPath = script.replace(/([/\\\\.?*()^${}|[\\]])/g, '\\\\$1');\n // const urlRegex = `^(.*[\\\\/\\\\\\\\])?${escapedPath}$`;\n //\n // return Debugger\n // .setBreakpointByUrl({ urlRegex, lineNumber: line - 1, condition })\n // .then((bp) => {\n // // TODO: handle bp.locations in case the regex matches existing files\n // if (!bp.location) { // Fake it for now.\n // Object.assign(bp, {\n // actualLocation: {\n // scriptUrl: `.*/${script}$`,\n // lineNumber: line - 1,\n // },\n // });\n // }\n // return registerBreakpoint(bp);\n // });\n // }\n //\n // function clearBreakpoint(url, line) {\n // const breakpoint = knownBreakpoints.find(({ location }) => {\n // if (!location) return false;\n // const script = knownScripts[location.scriptId];\n // if (!script) return false;\n // return (\n // script.url.indexOf(url) !== -1 && (location.lineNumber + 1) === line\n // );\n // });\n // if (!breakpoint) {\n // print(`Could not find breakpoint at ${url}:${line}`);\n // return Promise.resolve();\n // }\n // return Debugger.removeBreakpoint({ breakpointId: breakpoint.breakpointId })\n // .then(() => {\n // const idx = knownBreakpoints.indexOf(breakpoint);\n // knownBreakpoints.splice(idx, 1);\n // });\n // }\n //\n // function restoreBreakpoints() {\n // const lastBreakpoints = knownBreakpoints.slice();\n // knownBreakpoints.length = 0;\n // const newBreakpoints = lastBreakpoints\n // .filter(({ location }) => !!location.scriptUrl)\n // .map(({ location }) =>\n // setBreakpoint(location.scriptUrl, location.lineNumber + 1));\n // if (!newBreakpoints.length) return Promise.resolve();\n // return Promise.all(newBreakpoints).then((results) => {\n // print(`${results.length} breakpoints restored.`);\n // });\n // }\n\n // function setPauseOnExceptions(state) {\n // return Debugger.setPauseOnExceptions({ state })\n // .then(() => {\n // pauseOnExceptionState = state;\n // });\n // }\n\n Debugger.on('paused', (data: Debugger.PausedEventDataType): void => {\n const callFrames: CallFrame[] = data.callFrames as CallFrame[];\n const reason: string = data.reason;\n\n if (process.env.NODE_INSPECT_RESUME_ON_START === '1' && reason === 'Break on start') {\n debuglog('Paused on start, but NODE_INSPECT_RESUME_ON_START environment variable is set to 1, resuming');\n inspector.client.callMethod('Debugger.resume');\n return;\n }\n\n // Save execution context's data\n currentBacktrace = Backtrace.from(callFrames);\n selectedFrame = currentBacktrace[0];\n // const { scriptId, lineNumber } = selectedFrame.location;\n\n // const breakType = reason === 'other' ? 'break' : reason;\n // const script = knownScripts[scriptId];\n // const scriptUrl = script ? getRelativePath(script.url) : '[unknown]';\n\n // const header = `${breakType} in ${scriptUrl}:${lineNumber + 1}`;\n\n void inspector.suspendReplWhile(() => {\n const context = selectedFrame?.list(3);\n inspect(context);\n });\n });\n\n function handleResumed(): void {\n currentBacktrace = undefined;\n selectedFrame = undefined;\n }\n\n Debugger.on('resumed', handleResumed);\n\n //Debugger.on('breakpointResolved', handleBreakpointResolved);\n\n Debugger.on('scriptParsed', (script: Debugger.ScriptParsedEventDataType) => {\n const { scriptId, url } = script;\n if (url) {\n knownScripts[scriptId] = Object.assign(\n {\n isNative: isNativeUrl(url),\n },\n script,\n );\n }\n });\n\n /*Profiler.on('consoleProfileFinished', ({ profile }) => {\n Profile.createAndRegister({ profile });\n print([\n 'Captured new CPU profile.',\n `Access it with profiles[${profiles.length - 1}]`\n ].join('\\n'));\n });*/\n\n function initializeContext(context: Context): void {\n Object.defineProperty(context, 'Debugger', {\n value: inspector.Debugger,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'HeapProfiler', {\n value: inspector.HeapProfiler,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'Profiler', {\n value: inspector.Profiler,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n Object.defineProperty(context, 'Runtime', {\n value: inspector.Runtime,\n enumerable: true,\n configurable: true,\n // @ts-expect-error fix later\n writeable: false,\n });\n\n /*copyOwnProperties(context, {\n get help() {\n print(HELP);\n },\n\n get run() {\n return inspector.run();\n },\n\n get kill() {\n return inspector.killChild();\n },\n\n get restart() {\n return inspector.run();\n },\n\n get cont() {\n handleResumed();\n return Debugger.resume();\n },\n\n get next() {\n handleResumed();\n return Debugger.stepOver();\n },\n\n get step() {\n handleResumed();\n return Debugger.stepInto();\n },\n\n get out() {\n handleResumed();\n return Debugger.stepOut();\n },\n\n get pause() {\n return Debugger.pause();\n },\n\n get backtrace() {\n return currentBacktrace;\n },\n\n get breakpoints() {\n return listBreakpoints();\n },\n\n exec(expr) {\n return evalInCurrentContext(expr);\n },\n\n get profile() {\n return Profiler.start();\n },\n\n get profileEnd() {\n return Profiler.stop()\n .then(Profile.createAndRegister);\n },\n\n get profiles() {\n return profiles;\n },\n\n takeHeapSnapshot(filename = 'node.heapsnapshot') {\n return new Promise((resolve, reject) => {\n const absoluteFile = Path.resolve(filename);\n const writer = FS.createWriteStream(absoluteFile);\n let sizeWritten = 0;\n function onProgress({ done, total, finished }) {\n if (finished) {\n print('Heap snaphost prepared.');\n } else {\n print(`Heap snapshot: ${done}/${total}`, true);\n }\n }\n function onChunk({ chunk }) {\n sizeWritten += chunk.length;\n writer.write(chunk);\n print(`Writing snapshot: ${sizeWritten}`, true);\n }\n function onResolve() {\n writer.end(() => {\n teardown();\n print(`Wrote snapshot: ${absoluteFile}`);\n resolve();\n });\n }\n function onReject(error) {\n teardown();\n reject(error);\n }\n function teardown() {\n HeapProfiler.removeListener(\n 'reportHeapSnapshotProgress', onProgress);\n HeapProfiler.removeListener('addHeapSnapshotChunk', onChunk);\n }\n\n HeapProfiler.on('reportHeapSnapshotProgress', onProgress);\n HeapProfiler.on('addHeapSnapshotChunk', onChunk);\n\n print('Heap snapshot: 0/0', true);\n HeapProfiler.takeHeapSnapshot({ reportProgress: true })\n .then(onResolve, onReject);\n });\n },\n\n get watchers() {\n return watchers();\n },\n\n watch(expr) {\n watchedExpressions.push(expr);\n },\n\n unwatch(expr) {\n const index = watchedExpressions.indexOf(expr);\n\n // Unwatch by expression\n // or\n // Unwatch by watcher number\n watchedExpressions.splice(index !== -1 ? index : +expr, 1);\n },\n\n get repl() {\n // Don't display any default messages\n const listeners = repl.listeners('SIGINT').slice(0);\n repl.removeAllListeners('SIGINT');\n\n const oldContext = repl.context;\n\n exitDebugRepl = () => {\n // Restore all listeners\n process.nextTick(() => {\n listeners.forEach((listener) => {\n repl.on('SIGINT', listener);\n });\n });\n\n // Exit debug repl\n repl.eval = controlEval;\n\n // Swap history\n history.debug = repl.history;\n repl.history = history.control;\n\n repl.context = oldContext;\n repl.setPrompt('debug> ');\n repl.displayPrompt();\n\n repl.removeListener('SIGINT', exitDebugRepl);\n repl.removeListener('exit', exitDebugRepl);\n\n exitDebugRepl = null;\n };\n\n // Exit debug repl on SIGINT\n repl.on('SIGINT', exitDebugRepl);\n\n // Exit debug repl on repl exit\n repl.on('exit', exitDebugRepl);\n\n // Set new\n repl.eval = debugEval;\n repl.context = {};\n\n // Swap history\n history.control = repl.history;\n repl.history = history.debug;\n\n repl.setPrompt('> ');\n\n print('Press Ctrl + C to leave debug repl');\n repl.displayPrompt();\n },\n\n get version() {\n return Runtime.evaluate({\n expression: 'process.versions.v8',\n contextId: 1,\n returnByValue: true,\n }).then(({ result }) => {\n print(result.value);\n });\n },\n\n scripts: listScripts,\n\n //setBreakpoint,\n //clearBreakpoint,\n setPauseOnExceptions,\n get breakOnException() {\n return setPauseOnExceptions('all');\n },\n get breakOnUncaught() {\n return setPauseOnExceptions('uncaught');\n },\n get breakOnNone() {\n return setPauseOnExceptions('none');\n },\n\n list,\n });*/\n //aliasProperties(context, SHORTCUTS);\n }\n\n function initAfterStart(): Promise<void> {\n const setupTasks = [\n Runtime.enable(),\n //Profiler.enable(),\n //Profiler.setSamplingInterval({ interval: 100 }),\n Debugger.enable(),\n Debugger.setPauseOnExceptions({ state: 'none' }),\n Debugger.setAsyncCallStackDepth({ maxDepth: 1 }),\n Debugger.setBlackboxPatterns({ patterns: [] }),\n // Debugger.setPauseOnExceptions({ state: 'all' }),\n //restoreBreakpoints(),\n Runtime.runIfWaitingForDebugger(),\n ];\n return Promise.all(setupTasks);\n }\n\n return function startRepl(): REPLServer {\n inspector.client.on('close', () => resetOnStart());\n inspector.client.on('ready', () => {\n initAfterStart().catch(err => {\n print(`Error starting inspector: ${err.message}`);\n });\n });\n\n const replOptions: ReplOptions = {\n prompt: 'debug> ',\n input: inspector.stdin,\n output: inspector.stdout,\n eval: controlEval,\n useGlobal: false,\n ignoreUndefined: true,\n };\n\n repl = start(replOptions);\n initializeContext(repl.context);\n repl.on('reset', initializeContext);\n\n repl.defineCommand('interrupt', () => {\n // We want this for testing purposes where sending CTRL-C can be tricky.\n repl.emit('SIGINT');\n });\n\n // Init once for the initial connection\n initAfterStart().catch(err => {\n print(`Error starting inspector: ${err.message}`);\n });\n\n return repl;\n };\n}\n"]}