roku-debug 0.20.6 → 0.20.7

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 (211) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/CompileErrorProcessor.d.ts +7 -2
  3. package/dist/CompileErrorProcessor.js +64 -69
  4. package/dist/CompileErrorProcessor.js.map +1 -1
  5. package/dist/DeviceInfo.d.ts +1 -0
  6. package/dist/adapters/DebugProtocolAdapter.d.ts +64 -17
  7. package/dist/adapters/DebugProtocolAdapter.js +264 -157
  8. package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
  9. package/dist/adapters/TelnetAdapter.d.ts +8 -3
  10. package/dist/adapters/TelnetAdapter.js +14 -6
  11. package/dist/adapters/TelnetAdapter.js.map +1 -1
  12. package/dist/debugProtocol/Constants.d.ts +171 -81
  13. package/dist/debugProtocol/Constants.js +206 -126
  14. package/dist/debugProtocol/Constants.js.map +1 -1
  15. package/dist/debugProtocol/DebugProtocolClientReplaySession.d.ts +46 -0
  16. package/dist/debugProtocol/DebugProtocolClientReplaySession.js +278 -0
  17. package/dist/debugProtocol/DebugProtocolClientReplaySession.js.map +1 -0
  18. package/dist/debugProtocol/PluginInterface.d.ts +38 -0
  19. package/dist/debugProtocol/PluginInterface.js +86 -0
  20. package/dist/debugProtocol/PluginInterface.js.map +1 -0
  21. package/dist/debugProtocol/ProtocolUtil.d.ts +56 -0
  22. package/dist/debugProtocol/ProtocolUtil.js +164 -0
  23. package/dist/debugProtocol/ProtocolUtil.js.map +1 -0
  24. package/dist/debugProtocol/client/DebugProtocolClient.d.ts +310 -0
  25. package/dist/debugProtocol/client/DebugProtocolClient.js +1079 -0
  26. package/dist/debugProtocol/client/DebugProtocolClient.js.map +1 -0
  27. package/dist/debugProtocol/client/DebugProtocolClientPlugin.d.ts +44 -0
  28. package/dist/debugProtocol/client/DebugProtocolClientPlugin.js +3 -0
  29. package/dist/debugProtocol/client/DebugProtocolClientPlugin.js.map +1 -0
  30. package/dist/debugProtocol/events/ProtocolEvent.d.ts +66 -0
  31. package/dist/debugProtocol/events/ProtocolEvent.js +3 -0
  32. package/dist/debugProtocol/events/ProtocolEvent.js.map +1 -0
  33. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.d.ts +30 -0
  34. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js +63 -0
  35. package/dist/debugProtocol/events/requests/AddBreakpointsRequest.js.map +1 -0
  36. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.d.ts +48 -0
  37. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js +69 -0
  38. package/dist/debugProtocol/events/requests/AddConditionalBreakpointsRequest.js.map +1 -0
  39. package/dist/debugProtocol/events/requests/ContinueRequest.d.ts +20 -0
  40. package/dist/debugProtocol/events/requests/ContinueRequest.js +40 -0
  41. package/dist/debugProtocol/events/requests/ContinueRequest.js.map +1 -0
  42. package/dist/debugProtocol/events/requests/ExecuteRequest.d.ts +26 -0
  43. package/dist/debugProtocol/events/requests/ExecuteRequest.js +49 -0
  44. package/dist/debugProtocol/events/requests/ExecuteRequest.js.map +1 -0
  45. package/dist/debugProtocol/events/requests/ExitChannelRequest.d.ts +20 -0
  46. package/dist/debugProtocol/events/requests/ExitChannelRequest.js +40 -0
  47. package/dist/debugProtocol/events/requests/ExitChannelRequest.js.map +1 -0
  48. package/dist/debugProtocol/events/requests/HandshakeRequest.d.ts +26 -0
  49. package/dist/debugProtocol/events/requests/HandshakeRequest.js +47 -0
  50. package/dist/debugProtocol/events/requests/HandshakeRequest.js.map +1 -0
  51. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.d.ts +20 -0
  52. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js +40 -0
  53. package/dist/debugProtocol/events/requests/ListBreakpointsRequest.js.map +1 -0
  54. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.d.ts +29 -0
  55. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js +60 -0
  56. package/dist/debugProtocol/events/requests/RemoveBreakpointsRequest.js.map +1 -0
  57. package/dist/debugProtocol/events/requests/StackTraceRequest.d.ts +22 -0
  58. package/dist/debugProtocol/events/requests/StackTraceRequest.js +43 -0
  59. package/dist/debugProtocol/events/requests/StackTraceRequest.js.map +1 -0
  60. package/dist/debugProtocol/events/requests/StepRequest.d.ts +25 -0
  61. package/dist/debugProtocol/events/requests/StepRequest.js +46 -0
  62. package/dist/debugProtocol/events/requests/StepRequest.js.map +1 -0
  63. package/dist/debugProtocol/events/requests/StopRequest.d.ts +20 -0
  64. package/dist/debugProtocol/events/requests/StopRequest.js +39 -0
  65. package/dist/debugProtocol/events/requests/StopRequest.js.map +1 -0
  66. package/dist/debugProtocol/events/requests/ThreadsRequest.d.ts +20 -0
  67. package/dist/debugProtocol/events/requests/ThreadsRequest.js +40 -0
  68. package/dist/debugProtocol/events/requests/ThreadsRequest.js.map +1 -0
  69. package/dist/debugProtocol/events/requests/VariablesRequest.d.ts +59 -0
  70. package/dist/debugProtocol/events/requests/VariablesRequest.js +123 -0
  71. package/dist/debugProtocol/events/requests/VariablesRequest.js.map +1 -0
  72. package/dist/debugProtocol/events/responses/AddBreakpointsResponse.js.map +1 -0
  73. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.d.ts +3 -0
  74. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js +9 -0
  75. package/dist/debugProtocol/events/responses/AddConditionalBreakpointsResponse.js.map +1 -0
  76. package/dist/debugProtocol/events/responses/ExecuteV3Response.d.ts +42 -0
  77. package/dist/debugProtocol/events/responses/ExecuteV3Response.js +94 -0
  78. package/dist/debugProtocol/events/responses/ExecuteV3Response.js.map +1 -0
  79. package/dist/debugProtocol/events/responses/GenericResponse.d.ts +17 -0
  80. package/dist/debugProtocol/events/responses/GenericResponse.js +40 -0
  81. package/dist/debugProtocol/events/responses/GenericResponse.js.map +1 -0
  82. package/dist/debugProtocol/events/responses/GenericV3Response.d.ts +15 -0
  83. package/dist/debugProtocol/events/responses/GenericV3Response.js +38 -0
  84. package/dist/debugProtocol/events/responses/GenericV3Response.js.map +1 -0
  85. package/dist/debugProtocol/events/responses/HandshakeResponse.d.ts +28 -0
  86. package/dist/debugProtocol/events/responses/HandshakeResponse.js +69 -0
  87. package/dist/debugProtocol/events/responses/HandshakeResponse.js.map +1 -0
  88. package/dist/debugProtocol/events/responses/HandshakeV3Response.d.ts +42 -0
  89. package/dist/debugProtocol/events/responses/HandshakeV3Response.js +98 -0
  90. package/dist/debugProtocol/events/responses/HandshakeV3Response.js.map +1 -0
  91. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.d.ts +35 -0
  92. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js +68 -0
  93. package/dist/debugProtocol/events/responses/ListBreakpointsResponse.js.map +1 -0
  94. package/dist/debugProtocol/events/responses/RemoveBreakpointsResponse.js.map +1 -0
  95. package/dist/debugProtocol/events/responses/StackTraceResponse.d.ts +24 -0
  96. package/dist/debugProtocol/events/responses/StackTraceResponse.js +72 -0
  97. package/dist/debugProtocol/events/responses/StackTraceResponse.js.map +1 -0
  98. package/dist/debugProtocol/events/responses/StackTraceV3Response.d.ts +37 -0
  99. package/dist/debugProtocol/events/responses/StackTraceV3Response.js +67 -0
  100. package/dist/debugProtocol/events/responses/StackTraceV3Response.js.map +1 -0
  101. package/dist/debugProtocol/events/responses/ThreadsResponse.d.ts +54 -0
  102. package/dist/debugProtocol/events/responses/ThreadsResponse.js +80 -0
  103. package/dist/debugProtocol/events/responses/ThreadsResponse.js.map +1 -0
  104. package/dist/debugProtocol/events/responses/VariablesResponse.d.ts +117 -0
  105. package/dist/debugProtocol/events/responses/VariablesResponse.js +335 -0
  106. package/dist/debugProtocol/events/responses/VariablesResponse.js.map +1 -0
  107. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.d.ts +35 -0
  108. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js +58 -0
  109. package/dist/debugProtocol/events/updates/AllThreadsStoppedUpdate.js.map +1 -0
  110. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.d.ts +42 -0
  111. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js +97 -0
  112. package/dist/debugProtocol/events/updates/BreakpointErrorUpdate.js.map +1 -0
  113. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.d.ts +41 -0
  114. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js +74 -0
  115. package/dist/debugProtocol/events/updates/BreakpointVerifiedUpdate.js.map +1 -0
  116. package/dist/debugProtocol/events/updates/CompileErrorUpdate.d.ts +60 -0
  117. package/dist/debugProtocol/events/updates/CompileErrorUpdate.js +89 -0
  118. package/dist/debugProtocol/events/updates/CompileErrorUpdate.js.map +1 -0
  119. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.d.ts +23 -0
  120. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js +49 -0
  121. package/dist/debugProtocol/events/updates/IOPortOpenedUpdate.js.map +1 -0
  122. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.d.ts +26 -0
  123. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js +50 -0
  124. package/dist/debugProtocol/events/updates/ThreadAttachedUpdate.js.map +1 -0
  125. package/dist/debugProtocol/server/DebugProtocolServer.d.ts +110 -0
  126. package/dist/debugProtocol/server/DebugProtocolServer.js +306 -0
  127. package/dist/debugProtocol/server/DebugProtocolServer.js.map +1 -0
  128. package/dist/debugProtocol/server/DebugProtocolServerPlugin.d.ts +41 -0
  129. package/dist/debugProtocol/server/DebugProtocolServerPlugin.js +3 -0
  130. package/dist/debugProtocol/server/DebugProtocolServerPlugin.js.map +1 -0
  131. package/dist/debugSession/BrightScriptDebugSession.d.ts +9 -1
  132. package/dist/debugSession/BrightScriptDebugSession.js +178 -89
  133. package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
  134. package/dist/index.d.ts +2 -3
  135. package/dist/index.js +2 -3
  136. package/dist/index.js.map +1 -1
  137. package/dist/logging.d.ts +1 -0
  138. package/dist/logging.js +4 -2
  139. package/dist/logging.js.map +1 -1
  140. package/dist/managers/ActionQueue.d.ts +7 -1
  141. package/dist/managers/ActionQueue.js +27 -5
  142. package/dist/managers/ActionQueue.js.map +1 -1
  143. package/dist/managers/BreakpointManager.d.ts +82 -27
  144. package/dist/managers/BreakpointManager.js +168 -63
  145. package/dist/managers/BreakpointManager.js.map +1 -1
  146. package/dist/managers/ProjectManager.d.ts +3 -0
  147. package/dist/managers/ProjectManager.js +42 -36
  148. package/dist/managers/ProjectManager.js.map +1 -1
  149. package/dist/util.d.ts +8 -6
  150. package/dist/util.js +36 -19
  151. package/dist/util.js.map +1 -1
  152. package/package.json +14 -5
  153. package/roku-debug-0.20.7.tgz +0 -0
  154. package/dist/debugProtocol/Debugger.d.ts +0 -161
  155. package/dist/debugProtocol/Debugger.js +0 -635
  156. package/dist/debugProtocol/Debugger.js.map +0 -1
  157. package/dist/debugProtocol/responses/AddBreakpointsResponse.js.map +0 -1
  158. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.d.ts +0 -32
  159. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js +0 -67
  160. package/dist/debugProtocol/responses/BreakpointErrorUpdateResponse.js.map +0 -1
  161. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.d.ts +0 -32
  162. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js +0 -56
  163. package/dist/debugProtocol/responses/BreakpointVerifiedUpdateResponse.js.map +0 -1
  164. package/dist/debugProtocol/responses/ConnectIOPortResponse.d.ts +0 -10
  165. package/dist/debugProtocol/responses/ConnectIOPortResponse.js +0 -39
  166. package/dist/debugProtocol/responses/ConnectIOPortResponse.js.map +0 -1
  167. package/dist/debugProtocol/responses/ExecuteResponseV3.d.ts +0 -23
  168. package/dist/debugProtocol/responses/ExecuteResponseV3.js +0 -54
  169. package/dist/debugProtocol/responses/ExecuteResponseV3.js.map +0 -1
  170. package/dist/debugProtocol/responses/HandshakeResponse.d.ts +0 -12
  171. package/dist/debugProtocol/responses/HandshakeResponse.js +0 -39
  172. package/dist/debugProtocol/responses/HandshakeResponse.js.map +0 -1
  173. package/dist/debugProtocol/responses/HandshakeResponseV3.d.ts +0 -14
  174. package/dist/debugProtocol/responses/HandshakeResponseV3.js +0 -47
  175. package/dist/debugProtocol/responses/HandshakeResponseV3.js.map +0 -1
  176. package/dist/debugProtocol/responses/ListBreakpointsResponse.d.ts +0 -25
  177. package/dist/debugProtocol/responses/ListBreakpointsResponse.js +0 -65
  178. package/dist/debugProtocol/responses/ListBreakpointsResponse.js.map +0 -1
  179. package/dist/debugProtocol/responses/ProtocolEvent.d.ts +0 -11
  180. package/dist/debugProtocol/responses/ProtocolEvent.js +0 -38
  181. package/dist/debugProtocol/responses/ProtocolEvent.js.map +0 -1
  182. package/dist/debugProtocol/responses/ProtocolEventV3.d.ts +0 -11
  183. package/dist/debugProtocol/responses/ProtocolEventV3.js +0 -42
  184. package/dist/debugProtocol/responses/ProtocolEventV3.js.map +0 -1
  185. package/dist/debugProtocol/responses/RemoveBreakpointsResponse.js.map +0 -1
  186. package/dist/debugProtocol/responses/StackTraceResponse.d.ts +0 -18
  187. package/dist/debugProtocol/responses/StackTraceResponse.js +0 -58
  188. package/dist/debugProtocol/responses/StackTraceResponse.js.map +0 -1
  189. package/dist/debugProtocol/responses/StackTraceResponseV3.d.ts +0 -18
  190. package/dist/debugProtocol/responses/StackTraceResponseV3.js +0 -58
  191. package/dist/debugProtocol/responses/StackTraceResponseV3.js.map +0 -1
  192. package/dist/debugProtocol/responses/ThreadsResponse.d.ts +0 -22
  193. package/dist/debugProtocol/responses/ThreadsResponse.js +0 -63
  194. package/dist/debugProtocol/responses/ThreadsResponse.js.map +0 -1
  195. package/dist/debugProtocol/responses/UndefinedResponse.d.ts +0 -10
  196. package/dist/debugProtocol/responses/UndefinedResponse.js +0 -39
  197. package/dist/debugProtocol/responses/UndefinedResponse.js.map +0 -1
  198. package/dist/debugProtocol/responses/UpdateThreadsResponse.d.ts +0 -25
  199. package/dist/debugProtocol/responses/UpdateThreadsResponse.js +0 -91
  200. package/dist/debugProtocol/responses/UpdateThreadsResponse.js.map +0 -1
  201. package/dist/debugProtocol/responses/VariableResponse.d.ts +0 -27
  202. package/dist/debugProtocol/responses/VariableResponse.js +0 -141
  203. package/dist/debugProtocol/responses/VariableResponse.js.map +0 -1
  204. package/dist/debugProtocol/responses/index.d.ts +0 -11
  205. package/dist/debugProtocol/responses/index.js +0 -24
  206. package/dist/debugProtocol/responses/index.js.map +0 -1
  207. package/roku-debug-0.20.6.tgz +0 -0
  208. /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.d.ts +0 -0
  209. /package/dist/debugProtocol/{responses → events/responses}/AddBreakpointsResponse.js +0 -0
  210. /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.d.ts +0 -0
  211. /package/dist/debugProtocol/{responses → events/responses}/RemoveBreakpointsResponse.js +0 -0
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BreakpointErrorUpdate = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ /**
8
+ * Data sent as the data segment of message type: BREAKPOINT_ERROR
9
+ ```
10
+ struct BreakpointErrorUpdateData {
11
+ uint32 flags; // Always 0, reserved for future use
12
+ uint32 breakpoint_id;
13
+ uint32 num_compile_errors;
14
+ utf8z[num_compile_errors] compile_errors;
15
+ uint32 num_runtime_errors;
16
+ utf8z[num_runtime_errors] runtime_errors;
17
+ uint32 num_other_errors; // E.g., permissions errors
18
+ utf8z[num_other_errors] other_errors;
19
+ }
20
+ ```
21
+ */
22
+ class BreakpointErrorUpdate {
23
+ constructor() {
24
+ this.success = false;
25
+ /**
26
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
27
+ */
28
+ this.readOffset = undefined;
29
+ this.data = {
30
+ breakpointId: undefined,
31
+ compileErrors: undefined,
32
+ runtimeErrors: undefined,
33
+ otherErrors: undefined,
34
+ //common props
35
+ packetLength: undefined,
36
+ requestId: 0,
37
+ errorCode: Constants_1.ErrorCode.OK,
38
+ updateType: Constants_1.UpdateType.BreakpointError
39
+ };
40
+ }
41
+ static fromJson(data) {
42
+ var _a, _b, _c;
43
+ var _d, _e, _f;
44
+ const update = new BreakpointErrorUpdate();
45
+ ProtocolUtil_1.protocolUtil.loadJson(update, data);
46
+ (_a = (_d = update.data).compileErrors) !== null && _a !== void 0 ? _a : (_d.compileErrors = []);
47
+ (_b = (_e = update.data).runtimeErrors) !== null && _b !== void 0 ? _b : (_e.runtimeErrors = []);
48
+ (_c = (_f = update.data).otherErrors) !== null && _c !== void 0 ? _c : (_f.otherErrors = []);
49
+ return update;
50
+ }
51
+ static fromBuffer(buffer) {
52
+ const update = new BreakpointErrorUpdate();
53
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(update, buffer, 20, (smartBuffer) => {
54
+ ProtocolUtil_1.protocolUtil.loadCommonUpdateFields(update, smartBuffer, update.data.updateType);
55
+ smartBuffer.readUInt32LE(); // flags - always 0, reserved for future use
56
+ update.data.breakpointId = smartBuffer.readUInt32LE(); // breakpoint_id
57
+ const compileErrorCount = smartBuffer.readUInt32LE(); // num_compile_errors
58
+ update.data.compileErrors = [];
59
+ for (let i = 0; i < compileErrorCount; i++) {
60
+ update.data.compileErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
61
+ }
62
+ const runtimeErrorCount = smartBuffer.readUInt32LE(); // num_runtime_errors
63
+ update.data.runtimeErrors = [];
64
+ for (let i = 0; i < runtimeErrorCount; i++) {
65
+ update.data.runtimeErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
66
+ }
67
+ const otherErrorCount = smartBuffer.readUInt32LE(); // num_other_errors
68
+ update.data.otherErrors = [];
69
+ for (let i = 0; i < otherErrorCount; i++) {
70
+ update.data.otherErrors.push(ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer));
71
+ }
72
+ });
73
+ return update;
74
+ }
75
+ toBuffer() {
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
+ let smartBuffer = new smart_buffer_1.SmartBuffer();
78
+ smartBuffer.writeInt32LE(0); // flags - always 0, reserved for future use
79
+ smartBuffer.writeUInt32LE(this.data.breakpointId); // breakpoint_id
80
+ smartBuffer.writeUInt32LE((_b = (_a = this.data.compileErrors) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); // num_compile_errors
81
+ for (let error of (_c = this.data.compileErrors) !== null && _c !== void 0 ? _c : []) {
82
+ smartBuffer.writeStringNT(error);
83
+ }
84
+ smartBuffer.writeUInt32LE((_e = (_d = this.data.runtimeErrors) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0); // num_runtime_errors
85
+ for (let error of (_f = this.data.runtimeErrors) !== null && _f !== void 0 ? _f : []) {
86
+ smartBuffer.writeStringNT(error);
87
+ }
88
+ smartBuffer.writeUInt32LE((_h = (_g = this.data.otherErrors) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0); // num_other_errors
89
+ for (let error of (_j = this.data.otherErrors) !== null && _j !== void 0 ? _j : []) {
90
+ smartBuffer.writeStringNT(error);
91
+ }
92
+ ProtocolUtil_1.protocolUtil.insertCommonUpdateFields(this, smartBuffer);
93
+ return smartBuffer.toBuffer();
94
+ }
95
+ }
96
+ exports.BreakpointErrorUpdate = BreakpointErrorUpdate;
97
+ //# sourceMappingURL=BreakpointErrorUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BreakpointErrorUpdate.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/updates/BreakpointErrorUpdate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,+CAAwD;AACxD,qDAAkD;AAElD;;;;;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AEnE,WAAW,CAAC,aAAa,CAAC,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,0CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC,CAAC,qBAAqB;QACtF,KAAK,IAAI,KAAK,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,mCAAI,EAAE,EAAE;YAC7C,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpC;QAED,WAAW,CAAC,aAAa,CAAC,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,0CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC,CAAC,qBAAqB;QACtF,KAAK,IAAI,KAAK,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,mCAAI,EAAE,EAAE;YAC7C,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpC;QAED,WAAW,CAAC,aAAa,CAAC,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB;QAClF,KAAK,IAAI,KAAK,IAAI,MAAA,IAAI,CAAC,IAAI,CAAC,WAAW,mCAAI,EAAE,EAAE;YAC3C,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpC;QAED,2BAAY,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEzD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAoBJ;AA/FD,sDA+FC"}
@@ -0,0 +1,41 @@
1
+ /// <reference types="node" />
2
+ import { ErrorCode, UpdateType } from '../../Constants';
3
+ /**
4
+ ```
5
+ // Data sent as the data segment of message type: BREAKPOINT_VERIFIED
6
+ struct BreakpointVerifiedUpdateData {
7
+ uint32 flags // Always 0, reserved for future use
8
+ uint32 num_breakpoints
9
+ BreakpointVerifiedInfo[num_breakpoints] breakpoint_verified_info
10
+ }
11
+
12
+ struct BreakpointVerifiedInfo {
13
+ uint32 breakpoint_id
14
+ }
15
+ ```
16
+ */
17
+ export declare class BreakpointVerifiedUpdate {
18
+ static fromJson(data: {
19
+ breakpoints: VerifiedBreakpoint[];
20
+ }): BreakpointVerifiedUpdate;
21
+ static fromBuffer(buffer: Buffer): BreakpointVerifiedUpdate;
22
+ toBuffer(): Buffer;
23
+ success: boolean;
24
+ /**
25
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
26
+ */
27
+ readOffset: number;
28
+ data: {
29
+ /**
30
+ * The index of the primary thread that triggered the stop
31
+ */
32
+ breakpoints: VerifiedBreakpoint[];
33
+ packetLength: number;
34
+ requestId: number;
35
+ errorCode: ErrorCode;
36
+ updateType: UpdateType;
37
+ };
38
+ }
39
+ export interface VerifiedBreakpoint {
40
+ id: number;
41
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BreakpointVerifiedUpdate = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ /**
8
+ ```
9
+ // Data sent as the data segment of message type: BREAKPOINT_VERIFIED
10
+ struct BreakpointVerifiedUpdateData {
11
+ uint32 flags // Always 0, reserved for future use
12
+ uint32 num_breakpoints
13
+ BreakpointVerifiedInfo[num_breakpoints] breakpoint_verified_info
14
+ }
15
+
16
+ struct BreakpointVerifiedInfo {
17
+ uint32 breakpoint_id
18
+ }
19
+ ```
20
+ */
21
+ class BreakpointVerifiedUpdate {
22
+ constructor() {
23
+ this.success = false;
24
+ /**
25
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
26
+ */
27
+ this.readOffset = undefined;
28
+ this.data = {
29
+ /**
30
+ * The index of the primary thread that triggered the stop
31
+ */
32
+ breakpoints: undefined,
33
+ //common props
34
+ packetLength: undefined,
35
+ requestId: 0,
36
+ errorCode: Constants_1.ErrorCode.OK,
37
+ updateType: Constants_1.UpdateType.BreakpointVerified
38
+ };
39
+ }
40
+ static fromJson(data) {
41
+ const update = new BreakpointVerifiedUpdate();
42
+ ProtocolUtil_1.protocolUtil.loadJson(update, data);
43
+ return update;
44
+ }
45
+ static fromBuffer(buffer) {
46
+ const update = new BreakpointVerifiedUpdate();
47
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(update, buffer, 16, (smartBuffer) => {
48
+ ProtocolUtil_1.protocolUtil.loadCommonUpdateFields(update, smartBuffer, update.data.updateType);
49
+ const flags = smartBuffer.readUInt32LE(); // Always 0, reserved for future use
50
+ const breakpointCount = smartBuffer.readUInt32LE(); // num_breakpoints
51
+ update.data.breakpoints = [];
52
+ for (let i = 0; i < breakpointCount; i++) {
53
+ update.data.breakpoints.push({
54
+ id: smartBuffer.readUInt32LE() // uint32 breakpoint_id
55
+ });
56
+ }
57
+ });
58
+ return update;
59
+ }
60
+ toBuffer() {
61
+ var _a, _b, _c;
62
+ let smartBuffer = new smart_buffer_1.SmartBuffer();
63
+ smartBuffer.writeUInt32LE(0); // flags (Always 0, reserved for future use)
64
+ const breakpoints = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.breakpoints) !== null && _b !== void 0 ? _b : [];
65
+ smartBuffer.writeUInt32LE(breakpoints.length); // num_breakpoints
66
+ for (const breakpoint of breakpoints) {
67
+ smartBuffer.writeUInt32LE((_c = breakpoint.id) !== null && _c !== void 0 ? _c : 0); //breakpoint_id
68
+ }
69
+ ProtocolUtil_1.protocolUtil.insertCommonUpdateFields(this, smartBuffer);
70
+ return smartBuffer.toBuffer();
71
+ }
72
+ }
73
+ exports.BreakpointVerifiedUpdate = BreakpointVerifiedUpdate;
74
+ //# sourceMappingURL=BreakpointVerifiedUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BreakpointVerifiedUpdate.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/updates/BreakpointVerifiedUpdate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AA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B;iBACzD,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,QAAQ;;QACX,IAAI,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QAEpC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,4CAA4C;QAC1E,MAAM,WAAW,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,WAAW,mCAAI,EAAE,CAAC;QACjD,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB;QACjE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YAClC,WAAW,CAAC,aAAa,CAAC,MAAA,UAAU,CAAC,EAAE,mCAAI,CAAC,CAAC,CAAC,CAAC,eAAe;SACjE;QAED,2BAAY,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAoBJ;AA3DD,4DA2DC"}
@@ -0,0 +1,60 @@
1
+ /// <reference types="node" />
2
+ import { ErrorCode, UpdateType } from '../../Constants';
3
+ /**
4
+ * A COMPILE_ERROR is sent if a compilation error occurs. In this case, the update_type field in a DebuggerUpdate message is set to
5
+ * COMPILE_ERROR, and the data field contains a structure named CompileErrorUpdateData that provides the reason for the error.
6
+ * The CompileErrorUpdateData structure has the following syntax:
7
+ ```
8
+ struct CompileErrorUpdateData {
9
+ uint32 flags; // Always 0, reserved for future use
10
+ utf8z error_string;
11
+ utf8z file_spec;
12
+ uint32 line_number;
13
+ utf8z library_name;
14
+ }
15
+ ```
16
+ */
17
+ export declare class CompileErrorUpdate {
18
+ static fromJson(data: {
19
+ errorMessage: string;
20
+ filePath: string;
21
+ lineNumber: number;
22
+ libraryName: string;
23
+ }): CompileErrorUpdate;
24
+ static fromBuffer(buffer: Buffer): CompileErrorUpdate;
25
+ toBuffer(): Buffer;
26
+ success: boolean;
27
+ /**
28
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
29
+ */
30
+ readOffset: number;
31
+ data: {
32
+ flags: number;
33
+ /**
34
+ * A text message describing the compiler error.
35
+ *
36
+ * This is completely unrelated to the DebuggerUpdate.errorCode field.
37
+ */
38
+ errorMessage: string;
39
+ /**
40
+ * A simple file path indicating where the compiler error occurred. It maps to all matching file paths in the channel or its libraries
41
+ *
42
+ * `"pkg:/"` specifies a file in the channel
43
+ *
44
+ * `"lib:/<library_name>/"` specifies a file in a library.
45
+ */
46
+ filePath: string;
47
+ /**
48
+ * The 1-based line number where the compile error occurred.
49
+ */
50
+ lineNumber: number;
51
+ /**
52
+ * The name of the library where the compile error occurred.
53
+ */
54
+ libraryName: string;
55
+ packetLength: number;
56
+ requestId: number;
57
+ errorCode: ErrorCode;
58
+ updateType: UpdateType;
59
+ };
60
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompileErrorUpdate = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ /**
8
+ * A COMPILE_ERROR is sent if a compilation error occurs. In this case, the update_type field in a DebuggerUpdate message is set to
9
+ * COMPILE_ERROR, and the data field contains a structure named CompileErrorUpdateData that provides the reason for the error.
10
+ * The CompileErrorUpdateData structure has the following syntax:
11
+ ```
12
+ struct CompileErrorUpdateData {
13
+ uint32 flags; // Always 0, reserved for future use
14
+ utf8z error_string;
15
+ utf8z file_spec;
16
+ uint32 line_number;
17
+ utf8z library_name;
18
+ }
19
+ ```
20
+ */
21
+ class CompileErrorUpdate {
22
+ constructor() {
23
+ this.success = false;
24
+ /**
25
+ * How many bytes were read by the `fromBuffer` method. Only populated when constructed by `fromBuffer`
26
+ */
27
+ this.readOffset = undefined;
28
+ this.data = {
29
+ flags: undefined,
30
+ /**
31
+ * A text message describing the compiler error.
32
+ *
33
+ * This is completely unrelated to the DebuggerUpdate.errorCode field.
34
+ */
35
+ errorMessage: undefined,
36
+ /**
37
+ * A simple file path indicating where the compiler error occurred. It maps to all matching file paths in the channel or its libraries
38
+ *
39
+ * `"pkg:/"` specifies a file in the channel
40
+ *
41
+ * `"lib:/<library_name>/"` specifies a file in a library.
42
+ */
43
+ filePath: undefined,
44
+ /**
45
+ * The 1-based line number where the compile error occurred.
46
+ */
47
+ lineNumber: undefined,
48
+ /**
49
+ * The name of the library where the compile error occurred.
50
+ */
51
+ libraryName: undefined,
52
+ //common props
53
+ packetLength: undefined,
54
+ requestId: 0,
55
+ errorCode: Constants_1.ErrorCode.OK,
56
+ updateType: Constants_1.UpdateType.CompileError
57
+ };
58
+ }
59
+ static fromJson(data) {
60
+ const update = new CompileErrorUpdate();
61
+ ProtocolUtil_1.protocolUtil.loadJson(update, data);
62
+ return update;
63
+ }
64
+ static fromBuffer(buffer) {
65
+ const update = new CompileErrorUpdate();
66
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(update, buffer, 20, (smartBuffer) => {
67
+ ProtocolUtil_1.protocolUtil.loadCommonUpdateFields(update, smartBuffer, update.data.updateType);
68
+ update.data.flags = smartBuffer.readUInt32LE(); // flags - always 0, reserved for future use
69
+ update.data.errorMessage = ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer); // error_string
70
+ update.data.filePath = ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer); // file_spec
71
+ update.data.lineNumber = smartBuffer.readUInt32LE(); // line_number
72
+ update.data.libraryName = ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer); // library_name
73
+ });
74
+ return update;
75
+ }
76
+ toBuffer() {
77
+ var _a;
78
+ let smartBuffer = new smart_buffer_1.SmartBuffer();
79
+ smartBuffer.writeUInt32LE((_a = this.data.flags) !== null && _a !== void 0 ? _a : 0); // flags
80
+ smartBuffer.writeStringNT(this.data.errorMessage); // error_string
81
+ smartBuffer.writeStringNT(this.data.filePath); // file_spec
82
+ smartBuffer.writeUInt32LE(this.data.lineNumber); // line_number
83
+ smartBuffer.writeStringNT(this.data.libraryName); // library_name
84
+ ProtocolUtil_1.protocolUtil.insertCommonUpdateFields(this, smartBuffer);
85
+ return smartBuffer.toBuffer();
86
+ }
87
+ }
88
+ exports.CompileErrorUpdate = CompileErrorUpdate;
89
+ //# sourceMappingURL=CompileErrorUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompileErrorUpdate.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/updates/CompileErrorUpdate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,+CAAwD;AACxD,qDAAkD;AAElD;;;;;;;;;;;;;EAaE;AACF,MAAa,kBAAkB;IAA/B;QAwCW,YAAO,GAAG,KAAK,CAAC;QACvB;;WAEG;QACI,eAAU,GAAW,SAAS,CAAC;QAE/B,SAAI,GAAG;YACV,KAAK,EAAE,SAAmB;YAC1B;;;;eAIG;YACH,YAAY,EAAE,SAAmB;YACjC;;;;;;eAMG;YACH,QAAQ,EAAE,SAAmB;YAC7B;;eAEG;YACH,UAAU,EAAE,SAAmB;YAC/B;;eAEG;YACH,WAAW,EAAE,SAAmB;YAEhC,cAAc;YACd,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,qBAAS,CAAC,EAAE;YACvB,UAAU,EAAE,sBAAU,CAAC,YAAY;SACtC,CAAC;IACN,CAAC;IA3EU,MAAM,CAAC,QAAQ,CAAC,IAKtB;QACG,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACxC,2BAAY,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACxC,2BAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAA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CAAC;QAEzD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAuCJ;AA7ED,gDA6EC"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="node" />
2
+ import { ErrorCode, UpdateType } from '../../Constants';
3
+ import type { ProtocolUpdate, ProtocolResponse, ProtocolRequest } from '../ProtocolEvent';
4
+ export declare class IOPortOpenedUpdate {
5
+ static fromJson(data: {
6
+ port: number;
7
+ }): IOPortOpenedUpdate;
8
+ static fromBuffer(buffer: Buffer): IOPortOpenedUpdate;
9
+ toBuffer(): Buffer;
10
+ success: boolean;
11
+ readOffset: number;
12
+ data: {
13
+ /**
14
+ * The port number to which the debugging client should connect to read the script's output
15
+ */
16
+ port: number;
17
+ packetLength: number;
18
+ requestId: number;
19
+ errorCode: ErrorCode;
20
+ updateType: UpdateType;
21
+ };
22
+ }
23
+ export declare function isIOPortOpenedUpdate(event: ProtocolRequest | ProtocolResponse | ProtocolUpdate): event is IOPortOpenedUpdate;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isIOPortOpenedUpdate = exports.IOPortOpenedUpdate = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ class IOPortOpenedUpdate {
8
+ constructor() {
9
+ this.success = false;
10
+ this.readOffset = 0;
11
+ this.data = {
12
+ /**
13
+ * The port number to which the debugging client should connect to read the script's output
14
+ */
15
+ port: undefined,
16
+ //common props
17
+ packetLength: undefined,
18
+ requestId: 0,
19
+ errorCode: Constants_1.ErrorCode.OK,
20
+ updateType: Constants_1.UpdateType.IOPortOpened
21
+ };
22
+ }
23
+ static fromJson(data) {
24
+ const update = new IOPortOpenedUpdate();
25
+ ProtocolUtil_1.protocolUtil.loadJson(update, data);
26
+ return update;
27
+ }
28
+ static fromBuffer(buffer) {
29
+ const update = new IOPortOpenedUpdate();
30
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(update, buffer, 16, (smartBuffer) => {
31
+ ProtocolUtil_1.protocolUtil.loadCommonUpdateFields(update, smartBuffer, update.data.updateType);
32
+ update.data.port = smartBuffer.readInt32LE();
33
+ });
34
+ return update;
35
+ }
36
+ toBuffer() {
37
+ let smartBuffer = new smart_buffer_1.SmartBuffer();
38
+ smartBuffer.writeInt32LE(this.data.port); // primary_thread_index
39
+ ProtocolUtil_1.protocolUtil.insertCommonUpdateFields(this, smartBuffer);
40
+ return smartBuffer.toBuffer();
41
+ }
42
+ }
43
+ exports.IOPortOpenedUpdate = IOPortOpenedUpdate;
44
+ function isIOPortOpenedUpdate(event) {
45
+ var _a;
46
+ return ((_a = event === null || event === void 0 ? void 0 : event.constructor) === null || _a === void 0 ? void 0 : _a.name) === IOPortOpenedUpdate.name;
47
+ }
48
+ exports.isIOPortOpenedUpdate = isIOPortOpenedUpdate;
49
+ //# sourceMappingURL=IOPortOpenedUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IOPortOpenedUpdate.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/updates/IOPortOpenedUpdate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,+CAAwD;AACxD,qDAAkD;AAGlD,MAAa,kBAAkB;IAA/B;QA6BW,YAAO,GAAG,KAAK,CAAC;QAEhB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV;;eAEG;YACH,IAAI,EAAE,SAAmB;YAEzB,cAAc;YACd,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,qBAAS,CAAC,EAAE;YACvB,UAAU,EAAE,sBAAU,CAAC,YAAY;SACtC,CAAC;IACN,CAAC;IA3CU,MAAM,CAAC,QAAQ,CAAC,IAEtB;QACG,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACxC,2BAAY,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACxC,2BAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YAChE,2BAAY,CAAC,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAEjF,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,QAAQ;QACX,IAAI,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QAEpC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB;QAEjE,2BAAY,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAkBJ;AA7CD,gDA6CC;AAED,SAAgB,oBAAoB,CAAC,KAA0D;;IAC3F,OAAO,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,0CAAE,IAAI,MAAK,kBAAkB,CAAC,IAAI,CAAC;AAChE,CAAC;AAFD,oDAEC"}
@@ -0,0 +1,26 @@
1
+ /// <reference types="node" />
2
+ import type { StopReason } from '../../Constants';
3
+ import { ErrorCode, UpdateType } from '../../Constants';
4
+ export declare class ThreadAttachedUpdate {
5
+ static fromJson(data: {
6
+ threadIndex: number;
7
+ stopReason: StopReason;
8
+ stopReasonDetail: string;
9
+ }): ThreadAttachedUpdate;
10
+ static fromBuffer(buffer: Buffer): ThreadAttachedUpdate;
11
+ toBuffer(): Buffer;
12
+ success: boolean;
13
+ readOffset: number;
14
+ data: {
15
+ /**
16
+ * The index of the thread that was just attached
17
+ */
18
+ threadIndex: number;
19
+ stopReason: StopReason;
20
+ stopReasonDetail: string;
21
+ packetLength: number;
22
+ requestId: number;
23
+ errorCode: ErrorCode;
24
+ updateType: UpdateType;
25
+ };
26
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThreadAttachedUpdate = void 0;
4
+ const smart_buffer_1 = require("smart-buffer");
5
+ const Constants_1 = require("../../Constants");
6
+ const ProtocolUtil_1 = require("../../ProtocolUtil");
7
+ class ThreadAttachedUpdate {
8
+ constructor() {
9
+ this.success = false;
10
+ this.readOffset = 0;
11
+ this.data = {
12
+ /**
13
+ * The index of the thread that was just attached
14
+ */
15
+ threadIndex: undefined,
16
+ stopReason: undefined,
17
+ stopReasonDetail: undefined,
18
+ //common props
19
+ packetLength: undefined,
20
+ requestId: 0,
21
+ errorCode: Constants_1.ErrorCode.OK,
22
+ updateType: Constants_1.UpdateType.ThreadAttached
23
+ };
24
+ }
25
+ static fromJson(data) {
26
+ const update = new ThreadAttachedUpdate();
27
+ ProtocolUtil_1.protocolUtil.loadJson(update, data);
28
+ return update;
29
+ }
30
+ static fromBuffer(buffer) {
31
+ const update = new ThreadAttachedUpdate();
32
+ ProtocolUtil_1.protocolUtil.bufferLoaderHelper(update, buffer, 12, (smartBuffer) => {
33
+ ProtocolUtil_1.protocolUtil.loadCommonUpdateFields(update, smartBuffer, update.data.updateType);
34
+ update.data.threadIndex = smartBuffer.readInt32LE();
35
+ update.data.stopReason = Constants_1.StopReasonCode[smartBuffer.readUInt8()];
36
+ update.data.stopReasonDetail = ProtocolUtil_1.protocolUtil.readStringNT(smartBuffer);
37
+ });
38
+ return update;
39
+ }
40
+ toBuffer() {
41
+ const smartBuffer = new smart_buffer_1.SmartBuffer();
42
+ smartBuffer.writeInt32LE(this.data.threadIndex);
43
+ smartBuffer.writeUInt8(Constants_1.StopReasonCode[this.data.stopReason]);
44
+ smartBuffer.writeStringNT(this.data.stopReasonDetail);
45
+ ProtocolUtil_1.protocolUtil.insertCommonUpdateFields(this, smartBuffer);
46
+ return smartBuffer.toBuffer();
47
+ }
48
+ }
49
+ exports.ThreadAttachedUpdate = ThreadAttachedUpdate;
50
+ //# sourceMappingURL=ThreadAttachedUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadAttachedUpdate.js","sourceRoot":"","sources":["../../../../src/debugProtocol/events/updates/ThreadAttachedUpdate.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,+CAAwE;AACxE,qDAAkD;AAElD,MAAa,oBAAoB;IAAjC;QAmCW,YAAO,GAAG,KAAK,CAAC;QAChB,eAAU,GAAG,CAAC,CAAC;QAEf,SAAI,GAAG;YACV;;eAEG;YACH,WAAW,EAAE,SAAmB;YAChC,UAAU,EAAE,SAAuB;YACnC,gBAAgB,EAAE,SAAmB;YAErC,cAAc;YACd,YAAY,EAAE,SAAmB;YACjC,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,qBAAS,CAAC,EAAE;YACvB,UAAU,EAAE,sBAAU,CAAC,cAAc;SACxC,CAAC;IACN,CAAC;IAlDU,MAAM,CAAC,QAAQ,CAAC,IAItB;QACG,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC1C,2BAAY,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,MAAc;QACnC,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC1C,2BAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YAChE,2BAAY,CAAC,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACjF,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,0BAAc,CAAC,WAAW,CAAC,SAAS,EAAE,CAAe,CAAC;YAC/E,MAAM,CAAC,IAAI,CAAC,gBAAgB,GAAG,2BAAY,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,QAAQ;QACX,MAAM,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QAEtC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,WAAW,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7D,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEtD,2BAAY,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEzD,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CAmBJ;AApDD,oDAoDC"}
@@ -0,0 +1,110 @@
1
+ /// <reference types="node" />
2
+ import * as Net from 'net';
3
+ import type { ProtocolRequest, ProtocolResponse } from '../events/ProtocolEvent';
4
+ import PluginInterface from '../PluginInterface';
5
+ import type { ProtocolServerPlugin } from './DebugProtocolServerPlugin';
6
+ export declare const DEBUGGER_MAGIC = "bsdebug";
7
+ /**
8
+ * A class that emulates the way a Roku's DebugProtocol debug session/server works. This is mostly useful for unit testing,
9
+ * but might eventually be helpful for an off-device emulator as well
10
+ */
11
+ export declare class DebugProtocolServer {
12
+ options?: DebugProtocolServerOptions;
13
+ constructor(options?: DebugProtocolServerOptions);
14
+ private logger;
15
+ /**
16
+ * Indicates whether the client has sent the magic string to kick off the debug session.
17
+ */
18
+ private isHandshakeComplete;
19
+ private buffer;
20
+ /**
21
+ * The server
22
+ */
23
+ private server;
24
+ /**
25
+ * Once a client connects, this is a reference to that client
26
+ */
27
+ private client;
28
+ /**
29
+ * A collection of plugins that can interact with the server at lifecycle points
30
+ */
31
+ plugins: PluginInterface<ProtocolServerPlugin>;
32
+ /**
33
+ * A queue for processing the incoming buffer, every transmission at a time
34
+ */
35
+ private bufferQueue;
36
+ get controlPort(): number;
37
+ private _port;
38
+ /**
39
+ * Run the server. This opens a socket and listens for a connection.
40
+ * The promise resolves when the server has started listening. It does NOT wait for a client to connect
41
+ */
42
+ start(): Promise<unknown>;
43
+ stop(): Promise<void>;
44
+ destroy(): Promise<void>;
45
+ /**
46
+ * Given a buffer, find the request that matches it
47
+ */
48
+ static getRequest(buffer: Buffer, allowHandshake: boolean): ProtocolRequest;
49
+ private getResponse;
50
+ /**
51
+ * Process a single request.
52
+ * @returns true if successfully processed a request, and false if not
53
+ */
54
+ private process;
55
+ /**
56
+ * Send a response from the server to the client. This involves writing the response buffer to the client socket
57
+ */
58
+ private sendResponse;
59
+ /**
60
+ * Send an update from the server to the client. This can be things like ALL_THREADS_STOPPED
61
+ */
62
+ sendUpdate(update: ProtocolResponse): Promise<ProtocolResponse>;
63
+ /**
64
+ * An event emitter used for all of the events this server emitts
65
+ */
66
+ private emitter;
67
+ on<T = {
68
+ response: Response;
69
+ }>(eventName: 'before-send-response', callback: (event: T) => void): any;
70
+ on<T = {
71
+ response: Response;
72
+ }>(eventName: 'after-send-response', callback: (event: T) => void): any;
73
+ on<T = {
74
+ client: Net.Socket;
75
+ }>(eventName: 'client-connected', callback: (event: T) => void): any;
76
+ on<T = any>(eventName: string, callback: (data: T) => void): any;
77
+ /**
78
+ * Subscribe to an event exactly one time. This will fire the very next time an event happens,
79
+ * and then immediately unsubscribe
80
+ */
81
+ once<T>(eventName: string): Promise<T>;
82
+ emit<T = {
83
+ response: Response;
84
+ }>(eventName: 'before-send-response', event: T): T;
85
+ emit<T = {
86
+ response: Response;
87
+ }>(eventName: 'after-send-response', event: T): T;
88
+ emit<T = {
89
+ client: Net.Socket;
90
+ }>(eventName: 'client-connected', event: T): T;
91
+ /**
92
+ * The magic string used to kick off the debug session.
93
+ * @default "bsdebug"
94
+ */
95
+ private get magic();
96
+ }
97
+ export interface DebugProtocolServerOptions {
98
+ /**
99
+ * The magic that is sent as part of the handshake
100
+ */
101
+ magic?: string;
102
+ /**
103
+ * The port to use for the primary communication between this server and a client
104
+ */
105
+ controlPort?: number;
106
+ /**
107
+ * A specific host to listen on. If not specified, all hosts are used
108
+ */
109
+ host?: string;
110
+ }