@ledgerhq/device-management-kit-devtools-core 1.1.1

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 (96) hide show
  1. package/LICENSE.MD +202 -0
  2. package/README.md +193 -0
  3. package/lib/cjs/index.js +2 -0
  4. package/lib/cjs/index.js.map +7 -0
  5. package/lib/cjs/package.json +56 -0
  6. package/lib/cjs/src/index.js +2 -0
  7. package/lib/cjs/src/index.js.map +7 -0
  8. package/lib/cjs/src/inspector/DevToolsDmkInspector.js +2 -0
  9. package/lib/cjs/src/inspector/DevToolsDmkInspector.js.map +7 -0
  10. package/lib/cjs/src/inspector/DiscoveryHandler.js +2 -0
  11. package/lib/cjs/src/inspector/DiscoveryHandler.js.map +7 -0
  12. package/lib/cjs/src/inspector/commandHandlers.js +2 -0
  13. package/lib/cjs/src/inspector/commandHandlers.js.map +7 -0
  14. package/lib/cjs/src/inspector/constants.js +2 -0
  15. package/lib/cjs/src/inspector/constants.js.map +7 -0
  16. package/lib/cjs/src/inspector/deviceObserver.js +2 -0
  17. package/lib/cjs/src/inspector/deviceObserver.js.map +7 -0
  18. package/lib/cjs/src/inspector/discoveryObserver.js +2 -0
  19. package/lib/cjs/src/inspector/discoveryObserver.js.map +7 -0
  20. package/lib/cjs/src/inspector/serialization.js +2 -0
  21. package/lib/cjs/src/inspector/serialization.js.map +7 -0
  22. package/lib/cjs/src/logger/DevToolsLog.js +2 -0
  23. package/lib/cjs/src/logger/DevToolsLog.js.map +7 -0
  24. package/lib/cjs/src/logger/DevToolsLogger.js +2 -0
  25. package/lib/cjs/src/logger/DevToolsLogger.js.map +7 -0
  26. package/lib/cjs/src/logger/constants.js +2 -0
  27. package/lib/cjs/src/logger/constants.js.map +7 -0
  28. package/lib/cjs/src/logger/mapDmkLogToDevToolsLog.js +2 -0
  29. package/lib/cjs/src/logger/mapDmkLogToDevToolsLog.js.map +7 -0
  30. package/lib/cjs/src/modules.js +2 -0
  31. package/lib/cjs/src/modules.js.map +7 -0
  32. package/lib/cjs/src/types.js +2 -0
  33. package/lib/cjs/src/types.js.map +7 -0
  34. package/lib/esm/index.js +2 -0
  35. package/lib/esm/index.js.map +7 -0
  36. package/lib/esm/package.json +56 -0
  37. package/lib/esm/src/index.js +2 -0
  38. package/lib/esm/src/index.js.map +7 -0
  39. package/lib/esm/src/inspector/DevToolsDmkInspector.js +2 -0
  40. package/lib/esm/src/inspector/DevToolsDmkInspector.js.map +7 -0
  41. package/lib/esm/src/inspector/DiscoveryHandler.js +2 -0
  42. package/lib/esm/src/inspector/DiscoveryHandler.js.map +7 -0
  43. package/lib/esm/src/inspector/commandHandlers.js +2 -0
  44. package/lib/esm/src/inspector/commandHandlers.js.map +7 -0
  45. package/lib/esm/src/inspector/constants.js +2 -0
  46. package/lib/esm/src/inspector/constants.js.map +7 -0
  47. package/lib/esm/src/inspector/deviceObserver.js +2 -0
  48. package/lib/esm/src/inspector/deviceObserver.js.map +7 -0
  49. package/lib/esm/src/inspector/discoveryObserver.js +2 -0
  50. package/lib/esm/src/inspector/discoveryObserver.js.map +7 -0
  51. package/lib/esm/src/inspector/serialization.js +2 -0
  52. package/lib/esm/src/inspector/serialization.js.map +7 -0
  53. package/lib/esm/src/logger/DevToolsLog.js +1 -0
  54. package/lib/esm/src/logger/DevToolsLog.js.map +7 -0
  55. package/lib/esm/src/logger/DevToolsLogger.js +2 -0
  56. package/lib/esm/src/logger/DevToolsLogger.js.map +7 -0
  57. package/lib/esm/src/logger/constants.js +2 -0
  58. package/lib/esm/src/logger/constants.js.map +7 -0
  59. package/lib/esm/src/logger/mapDmkLogToDevToolsLog.js +2 -0
  60. package/lib/esm/src/logger/mapDmkLogToDevToolsLog.js.map +7 -0
  61. package/lib/esm/src/modules.js +2 -0
  62. package/lib/esm/src/modules.js.map +7 -0
  63. package/lib/esm/src/types.js +1 -0
  64. package/lib/esm/src/types.js.map +7 -0
  65. package/lib/types/index.d.ts +2 -0
  66. package/lib/types/index.d.ts.map +1 -0
  67. package/lib/types/src/index.d.ts +10 -0
  68. package/lib/types/src/index.d.ts.map +1 -0
  69. package/lib/types/src/inspector/DevToolsDmkInspector.d.ts +39 -0
  70. package/lib/types/src/inspector/DevToolsDmkInspector.d.ts.map +1 -0
  71. package/lib/types/src/inspector/DiscoveryHandler.d.ts +67 -0
  72. package/lib/types/src/inspector/DiscoveryHandler.d.ts.map +1 -0
  73. package/lib/types/src/inspector/commandHandlers.d.ts +34 -0
  74. package/lib/types/src/inspector/commandHandlers.d.ts.map +1 -0
  75. package/lib/types/src/inspector/constants.d.ts +39 -0
  76. package/lib/types/src/inspector/constants.d.ts.map +1 -0
  77. package/lib/types/src/inspector/deviceObserver.d.ts +16 -0
  78. package/lib/types/src/inspector/deviceObserver.d.ts.map +1 -0
  79. package/lib/types/src/inspector/discoveryObserver.d.ts +34 -0
  80. package/lib/types/src/inspector/discoveryObserver.d.ts.map +1 -0
  81. package/lib/types/src/inspector/serialization.d.ts +15 -0
  82. package/lib/types/src/inspector/serialization.d.ts.map +1 -0
  83. package/lib/types/src/logger/DevToolsLog.d.ts +9 -0
  84. package/lib/types/src/logger/DevToolsLog.d.ts.map +1 -0
  85. package/lib/types/src/logger/DevToolsLogger.d.ts +8 -0
  86. package/lib/types/src/logger/DevToolsLogger.d.ts.map +1 -0
  87. package/lib/types/src/logger/constants.d.ts +8 -0
  88. package/lib/types/src/logger/constants.d.ts.map +1 -0
  89. package/lib/types/src/logger/mapDmkLogToDevToolsLog.d.ts +4 -0
  90. package/lib/types/src/logger/mapDmkLogToDevToolsLog.d.ts.map +1 -0
  91. package/lib/types/src/modules.d.ts +14 -0
  92. package/lib/types/src/modules.d.ts.map +1 -0
  93. package/lib/types/src/types.d.ts +7 -0
  94. package/lib/types/src/types.d.ts.map +1 -0
  95. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  96. package/package.json +56 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/discoveryObserver.ts"],
4
+ "sourcesContent": ["import {\n type DeviceManagementKit,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Subscription } from \"rxjs\";\n\nimport { type Connector } from \"../types\";\nimport { INSPECTOR_MESSAGE_TYPES } from \"./constants\";\nimport { serializeDiscoveredDevice } from \"./serialization\";\n\n/**\n * Callback type for when discovered devices are updated.\n */\nexport type OnDiscoveredDevicesUpdate = (devices: DiscoveredDevice[]) => void;\n\n/**\n * Sends the list of discovered devices to the dashboard.\n */\nexport function sendDiscoveredDevicesUpdate(\n devices: DiscoveredDevice[],\n connector: Connector,\n): void {\n connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.DISCOVERED_DEVICES_UPDATE,\n JSON.stringify(devices.map(serializeDiscoveredDevice)),\n );\n}\n\n/**\n * Starts listening to available devices (passive discovery).\n * Uses listenToAvailableDevices which returns the current list of known devices.\n * Does NOT trigger permission prompts - works with already-paired devices.\n *\n * @param dmk - The Device Management Kit instance\n * @param connector - The connector to send messages to the dashboard\n * @param onDevicesUpdate - Optional callback when devices are updated (used to track current devices)\n * @returns A cleanup function to stop listening\n */\nexport function startListeningObserver(\n dmk: DeviceManagementKit,\n connector: Connector,\n onDevicesUpdate?: OnDiscoveredDevicesUpdate,\n): () => void {\n let subscription: Subscription | null = null;\n\n subscription = dmk.listenToAvailableDevices({}).subscribe({\n next: (devices: DiscoveredDevice[]) => {\n sendDiscoveredDevicesUpdate(devices, connector);\n onDevicesUpdate?.(devices);\n },\n error: (err) => {\n console.error(\n \"[DevToolsDmkInspector] listenToAvailableDevices error\",\n err,\n );\n },\n });\n\n // Return cleanup function\n return () => {\n if (subscription) {\n subscription.unsubscribe();\n subscription = null;\n }\n };\n}\n\n/**\n * Starts active device discovery.\n * Uses startDiscovering which triggers permission prompts in web apps.\n * NOTE: In web apps (WebHID/WebBLE), this requires a user gesture in the app context.\n * Calling this from the dashboard will NOT work for web apps.\n *\n * @param dmk - The Device Management Kit instance\n * @param connector - The connector to send messages to the dashboard\n * @param onDevicesUpdate - Optional callback when devices are updated (used to track current devices)\n * @returns A cleanup function to stop discovering\n */\nexport function startDiscoveringObserver(\n dmk: DeviceManagementKit,\n connector: Connector,\n onDevicesUpdate?: OnDiscoveredDevicesUpdate,\n): () => void {\n let subscription: Subscription | null = null;\n const discoveredDevices: DiscoveredDevice[] = [];\n\n subscription = dmk.startDiscovering({}).subscribe({\n next: (device: DiscoveredDevice) => {\n // Accumulate devices (avoid duplicates by id)\n const existingIndex = discoveredDevices.findIndex(\n (d) => d.id === device.id,\n );\n if (existingIndex >= 0) {\n discoveredDevices[existingIndex] = device;\n } else {\n discoveredDevices.push(device);\n }\n sendDiscoveredDevicesUpdate([...discoveredDevices], connector);\n onDevicesUpdate?.([...discoveredDevices]);\n },\n error: (err) => {\n console.error(\"[DevToolsDmkInspector] startDiscovering error\", err);\n },\n complete: () => {\n // Discovery completed (user closed picker or similar)\n },\n });\n\n // Return cleanup function\n return () => {\n if (subscription) {\n subscription.unsubscribe();\n subscription = null;\n }\n void dmk.stopDiscovering();\n };\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,EAAA,6BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAL,GAOA,IAAAM,EAAwC,uBACxCC,EAA0C,2BAUnC,SAASL,EACdM,EACAC,EACM,CACNA,EAAU,YACR,0BAAwB,0BACxB,KAAK,UAAUD,EAAQ,IAAI,2BAAyB,CAAC,CACvD,CACF,CAYO,SAASJ,EACdM,EACAD,EACAE,EACY,CACZ,IAAIC,EAAoC,KAExC,OAAAA,EAAeF,EAAI,yBAAyB,CAAC,CAAC,EAAE,UAAU,CACxD,KAAOF,GAAgC,CACrCN,EAA4BM,EAASC,CAAS,EAC9CE,IAAkBH,CAAO,CAC3B,EACA,MAAQK,GAAQ,CACd,QAAQ,MACN,wDACAA,CACF,CACF,CACF,CAAC,EAGM,IAAM,CACPD,IACFA,EAAa,YAAY,EACzBA,EAAe,KAEnB,CACF,CAaO,SAAST,EACdO,EACAD,EACAE,EACY,CACZ,IAAIC,EAAoC,KACxC,MAAME,EAAwC,CAAC,EAE/C,OAAAF,EAAeF,EAAI,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAChD,KAAOK,GAA6B,CAElC,MAAMC,EAAgBF,EAAkB,UACrCG,GAAMA,EAAE,KAAOF,EAAO,EACzB,EACIC,GAAiB,EACnBF,EAAkBE,CAAa,EAAID,EAEnCD,EAAkB,KAAKC,CAAM,EAE/Bb,EAA4B,CAAC,GAAGY,CAAiB,EAAGL,CAAS,EAC7DE,IAAkB,CAAC,GAAGG,CAAiB,CAAC,CAC1C,EACA,MAAQD,GAAQ,CACd,QAAQ,MAAM,gDAAiDA,CAAG,CACpE,EACA,SAAU,IAAM,CAEhB,CACF,CAAC,EAGM,IAAM,CACPD,IACFA,EAAa,YAAY,EACzBA,EAAe,MAEZF,EAAI,gBAAgB,CAC3B,CACF",
6
+ "names": ["discoveryObserver_exports", "__export", "sendDiscoveredDevicesUpdate", "startDiscoveringObserver", "startListeningObserver", "__toCommonJS", "import_constants", "import_serialization", "devices", "connector", "dmk", "onDevicesUpdate", "subscription", "err", "discoveredDevices", "device", "existingIndex", "d"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var S=(e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})},a=(e,i,t,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of v(i))!D.call(e,s)&&s!==t&&n(e,s,{get:()=>i[s],enumerable:!(c=r(i,s))||c.enumerable});return e};var p=e=>a(n({},"__esModule",{value:!0}),e);var u={};S(u,{serializeConnectedDevice:()=>d,serializeDeviceSessionState:()=>y,serializeDiscoveredDevice:()=>f});module.exports=p(u);var o=require("@ledgerhq/device-management-kit");function d(e){return JSON.parse(JSON.stringify(e))}function y(e){const i=JSON.parse(JSON.stringify(e));return i.sessionStateType=o.DeviceSessionStateType[e.sessionStateType],i}function f(e){return JSON.parse(JSON.stringify(e))}0&&(module.exports={serializeConnectedDevice,serializeDeviceSessionState,serializeDiscoveredDevice});
2
+ //# sourceMappingURL=serialization.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/serialization.ts"],
4
+ "sourcesContent": ["import {\n type ConnectedDevice,\n type DeviceSessionState,\n DeviceSessionStateType,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\n\n/**\n * Serialize a ConnectedDevice to a plain object for JSON transmission.\n */\nexport function serializeConnectedDevice(\n device: ConnectedDevice,\n): ConnectedDevice {\n return JSON.parse(JSON.stringify(device)) as ConnectedDevice;\n}\n\n/**\n * Serialize a DeviceSessionState to a plain object for JSON transmission.\n * Converts enum values to their string names for readability.\n */\nexport function serializeDeviceSessionState(\n state: DeviceSessionState,\n): DeviceSessionState {\n const serialized = JSON.parse(JSON.stringify(state)) as Record<\n string,\n unknown\n >;\n // Convert enum to string name for readability\n serialized[\"sessionStateType\"] =\n DeviceSessionStateType[state.sessionStateType];\n return serialized as DeviceSessionState;\n}\n\n/**\n * Serialize a DiscoveredDevice to a plain object for JSON transmission.\n */\nexport function serializeDiscoveredDevice(\n device: DiscoveredDevice,\n): DiscoveredDevice {\n return JSON.parse(JSON.stringify(device)) as DiscoveredDevice;\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,EAAA,gCAAAC,EAAA,8BAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAKO,2CAKA,SAASJ,EACdK,EACiB,CACjB,OAAO,KAAK,MAAM,KAAK,UAAUA,CAAM,CAAC,CAC1C,CAMO,SAASJ,EACdK,EACoB,CACpB,MAAMC,EAAa,KAAK,MAAM,KAAK,UAAUD,CAAK,CAAC,EAKnD,OAAAC,EAAW,iBACT,yBAAuBD,EAAM,gBAAgB,EACxCC,CACT,CAKO,SAASL,EACdG,EACkB,CAClB,OAAO,KAAK,MAAM,KAAK,UAAUA,CAAM,CAAC,CAC1C",
6
+ "names": ["serialization_exports", "__export", "serializeConnectedDevice", "serializeDeviceSessionState", "serializeDiscoveredDevice", "__toCommonJS", "import_device_management_kit", "device", "state", "serialized"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var p=(r,t,a,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of o(t))!n.call(r,e)&&e!==a&&s(r,e,{get:()=>t[e],enumerable:!(g=i(t,e))||g.enumerable});return r};var l=r=>p(s({},"__esModule",{value:!0}),r);var m={};module.exports=l(m);
2
+ //# sourceMappingURL=DevToolsLog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/DevToolsLog.ts"],
4
+ "sourcesContent": ["export type DevToolsLog = {\n /** ISO 8601 timestamp */\n timestamp: string;\n tag: string;\n verbosity: \"debug\" | \"info\" | \"warning\" | \"error\" | \"fatal\";\n message: string;\n payloadJSON: string; // extra data, can be an empty string\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["DevToolsLog_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var S=(r,o)=>{for(var t in o)i(r,t,{get:o[t],enumerable:!0})},p=(r,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of E(o))!L.call(r,e)&&e!==t&&i(r,e,{get:()=>o[e],enumerable:!(m=g(o,e))||m.enumerable});return r};var a=r=>p(i({},"__esModule",{value:!0}),r);var D={};S(D,{DevToolsLogger:()=>O});module.exports=a(D);var s=require("../modules"),n=require("./constants"),c=require("./mapDmkLogToDevToolsLog");class O{constructor(o){this.connector=o;this.connector.sendMessage(s.MODULE_CONNECTED_MESSAGE_TYPE,JSON.stringify({module:s.DEVTOOLS_MODULES.LOGGER}))}log(...o){this.connector.sendMessage(n.LOGGER_MESSAGE_TYPES.ADD_LOG,JSON.stringify((0,c.mapDmkLogToDevToolsLog)(o)))}}0&&(module.exports={DevToolsLogger});
2
+ //# sourceMappingURL=DevToolsLogger.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/DevToolsLogger.ts"],
4
+ "sourcesContent": ["import {\n type LoggerSubscriberService,\n type LogParams,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DEVTOOLS_MODULES, MODULE_CONNECTED_MESSAGE_TYPE } from \"../modules\";\nimport { type Connector } from \"../types\";\nimport { LOGGER_MESSAGE_TYPES } from \"./constants\";\nimport { mapDmkLogToDevToolsLog } from \"./mapDmkLogToDevToolsLog\";\n\nexport class DevToolsLogger implements LoggerSubscriberService {\n constructor(private readonly connector: Connector) {\n // Send handshake to identify this module to the dashboard\n this.connector.sendMessage(\n MODULE_CONNECTED_MESSAGE_TYPE,\n JSON.stringify({ module: DEVTOOLS_MODULES.LOGGER }),\n );\n }\n\n log(...logParams: LogParams): void {\n this.connector.sendMessage(\n LOGGER_MESSAGE_TYPES.ADD_LOG,\n JSON.stringify(mapDmkLogToDevToolsLog(logParams)),\n );\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAKA,IAAAI,EAAgE,sBAEhEC,EAAqC,uBACrCC,EAAuC,oCAEhC,MAAMJ,CAAkD,CAC7D,YAA6BK,EAAsB,CAAtB,eAAAA,EAE3B,KAAK,UAAU,YACb,gCACA,KAAK,UAAU,CAAE,OAAQ,mBAAiB,MAAO,CAAC,CACpD,CACF,CAEA,OAAOC,EAA4B,CACjC,KAAK,UAAU,YACb,uBAAqB,QACrB,KAAK,aAAU,0BAAuBA,CAAS,CAAC,CAClD,CACF,CACF",
6
+ "names": ["DevToolsLogger_exports", "__export", "DevToolsLogger", "__toCommonJS", "import_modules", "import_constants", "import_mapDmkLogToDevToolsLog", "connector", "logParams"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(E,o)=>{for(var s in o)t(E,s,{get:o[s],enumerable:!0})},d=(E,o,s,L)=>{if(o&&typeof o=="object"||typeof o=="function")for(let G of _(o))!a.call(E,G)&&G!==s&&t(E,G,{get:()=>o[G],enumerable:!(L=S(o,G))||L.enumerable});return E};var n=E=>d(t({},"__esModule",{value:!0}),E);var D={};c(D,{LOGGER_MESSAGE_TYPES:()=>A});module.exports=n(D);const A={ADD_LOG:"addLog"};0&&(module.exports={LOGGER_MESSAGE_TYPES});
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/constants.ts"],
4
+ "sourcesContent": ["/**\n * Message types sent from logger to dashboard\n */\nexport const LOGGER_MESSAGE_TYPES = {\n /** A new log entry */\n ADD_LOG: \"addLog\",\n} as const;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAGO,MAAME,EAAuB,CAElC,QAAS,QACX",
6
+ "names": ["constants_exports", "__export", "LOGGER_MESSAGE_TYPES", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var p=(e,o)=>{for(var r in o)g(e,r,{get:o[r],enumerable:!0})},v=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of m(o))!L.call(e,t)&&t!==r&&g(e,t,{get:()=>o[t],enumerable:!(a=l(o,t))||a.enumerable});return e};var f=e=>v(g({},"__esModule",{value:!0}),e);var c={};p(c,{mapDmkLogToDevToolsLog:()=>y});module.exports=f(c);var s=require("@ledgerhq/device-management-kit");function y(e){const[o,r,a]=e,t={[s.LogLevel.Debug]:"debug",[s.LogLevel.Info]:"info",[s.LogLevel.Warning]:"warning",[s.LogLevel.Error]:"error",[s.LogLevel.Fatal]:"fatal"};let i="";try{i=JSON.stringify(a.data||{},null)}catch(n){console.error("Failed to stringify log data",n)}return{timestamp:new Date(a.timestamp).toISOString(),tag:a.tag,message:r,verbosity:t[o],payloadJSON:i}}0&&(module.exports={mapDmkLogToDevToolsLog});
2
+ //# sourceMappingURL=mapDmkLogToDevToolsLog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/mapDmkLogToDevToolsLog.ts"],
4
+ "sourcesContent": ["import { LogLevel, type LogParams } from \"@ledgerhq/device-management-kit\";\n\nimport { type DevToolsLog } from \"./DevToolsLog\";\n\nexport function mapDmkLogToDevToolsLog(dmkLog: LogParams): DevToolsLog {\n const [level, message, options] = dmkLog;\n\n const verbosities: Record<LogLevel, DevToolsLog[\"verbosity\"]> = {\n [LogLevel.Debug]: \"debug\",\n [LogLevel.Info]: \"info\",\n [LogLevel.Warning]: \"warning\",\n [LogLevel.Error]: \"error\",\n [LogLevel.Fatal]: \"fatal\",\n };\n\n let payloadJSON = \"\";\n try {\n payloadJSON = JSON.stringify(options.data || {}, null);\n } catch (e) {\n console.error(\"Failed to stringify log data\", e);\n }\n\n return {\n timestamp: new Date(options.timestamp).toISOString(),\n tag: options.tag,\n message: message,\n verbosity: verbosities[level],\n payloadJSON,\n };\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyC,2CAIlC,SAASF,EAAuBG,EAAgC,CACrE,KAAM,CAACC,EAAOC,EAASC,CAAO,EAAIH,EAE5BI,EAA0D,CAC9D,CAAC,WAAS,KAAK,EAAG,QAClB,CAAC,WAAS,IAAI,EAAG,OACjB,CAAC,WAAS,OAAO,EAAG,UACpB,CAAC,WAAS,KAAK,EAAG,QAClB,CAAC,WAAS,KAAK,EAAG,OACpB,EAEA,IAAIC,EAAc,GAClB,GAAI,CACFA,EAAc,KAAK,UAAUF,EAAQ,MAAQ,CAAC,EAAG,IAAI,CACvD,OAASG,EAAG,CACV,QAAQ,MAAM,+BAAgCA,CAAC,CACjD,CAEA,MAAO,CACL,UAAW,IAAI,KAAKH,EAAQ,SAAS,EAAE,YAAY,EACnD,IAAKA,EAAQ,IACb,QAASD,EACT,UAAWE,EAAYH,CAAK,EAC5B,YAAAI,CACF,CACF",
6
+ "names": ["mapDmkLogToDevToolsLog_exports", "__export", "mapDmkLogToDevToolsLog", "__toCommonJS", "import_device_management_kit", "dmkLog", "level", "message", "options", "verbosities", "payloadJSON", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var M=(e,o)=>{for(var O in o)t(e,O,{get:o[O],enumerable:!0})},T=(e,o,O,D)=>{if(o&&typeof o=="object"||typeof o=="function")for(let E of L(o))!p.call(e,E)&&E!==O&&t(e,E,{get:()=>o[E],enumerable:!(D=S(o,E))||D.enumerable});return e};var _=e=>T(t({},"__esModule",{value:!0}),e);var c={};M(c,{DEVTOOLS_MODULES:()=>n,MODULE_CONNECTED_MESSAGE_TYPE:()=>s});module.exports=_(c);const n={LOGGER:"logger",DMK_INSPECTOR:"dmk-inspector"},s="moduleConnected";0&&(module.exports={DEVTOOLS_MODULES,MODULE_CONNECTED_MESSAGE_TYPE});
2
+ //# sourceMappingURL=modules.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/modules.ts"],
4
+ "sourcesContent": ["/**\n * Module identifiers for devtools handshake.\n * Used by both client modules and dashboard UI to track which modules are connected.\n */\nexport const DEVTOOLS_MODULES = {\n LOGGER: \"logger\",\n DMK_INSPECTOR: \"dmk-inspector\",\n} as const;\n\nexport type DevToolsModule =\n (typeof DEVTOOLS_MODULES)[keyof typeof DEVTOOLS_MODULES];\n\n/**\n * Message type for module connection handshake.\n */\nexport const MODULE_CONNECTED_MESSAGE_TYPE = \"moduleConnected\";\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,kCAAAC,IAAA,eAAAC,EAAAJ,GAIO,MAAME,EAAmB,CAC9B,OAAQ,SACR,cAAe,eACjB,EAQaC,EAAgC",
6
+ "names": ["modules_exports", "__export", "DEVTOOLS_MODULES", "MODULE_CONNECTED_MESSAGE_TYPE", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=(s,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a(e))!d.call(s,i)&&i!==o&&t(s,i,{get:()=>e[i],enumerable:!(n=r(e,i))||n.enumerable});return s};var p=s=>g(t({},"__esModule",{value:!0}),s);var l={};module.exports=p(l);
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["export interface Connector {\n sendMessage: (type: string, payload: string) => void;\n listenToMessages: (listener: (type: string, payload: string) => void) => {\n unsubscribe: () => void;\n };\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["types_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export*from"./src";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../index.ts"],
4
+ "sourcesContent": ["export * from \"./src\";\n"],
5
+ "mappings": "AAAA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "dependencies": {},
3
+ "devDependencies": {
4
+ "@ledgerhq/device-management-kit": "workspace:^",
5
+ "@ledgerhq/eslint-config-dsdk": "workspace:^",
6
+ "@ledgerhq/ldmk-tool": "workspace:^",
7
+ "@ledgerhq/prettier-config-dsdk": "workspace:^",
8
+ "@ledgerhq/tsconfig-dsdk": "workspace:^",
9
+ "@ledgerhq/vitest-config-dmk": "workspace:^",
10
+ "rxjs": "catalog:"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": "./lib/esm/index.js",
15
+ "require": "./lib/cjs/index.js",
16
+ "types": "./lib/types/index.d.ts"
17
+ },
18
+ "./*": {
19
+ "import": "./lib/esm/*",
20
+ "require": "./lib/cjs/*",
21
+ "types": "./lib/types/*"
22
+ }
23
+ },
24
+ "files": [
25
+ "./lib"
26
+ ],
27
+ "license": "Apache-2.0",
28
+ "main": "lib/index.js",
29
+ "name": "@ledgerhq/device-management-kit-devtools-core",
30
+ "peerDependencies": {
31
+ "@ledgerhq/device-management-kit": "^1.2.0",
32
+ "rxjs": "catalog:"
33
+ },
34
+ "private": false,
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/LedgerHQ/device-sdk-ts.git"
38
+ },
39
+ "scripts": {
40
+ "build": "pnpm ldmk-tool build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
41
+ "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
42
+ "lint": "eslint",
43
+ "lint:fix": "pnpm lint --fix",
44
+ "prebuild": "rimraf lib",
45
+ "prettier": "prettier . --check",
46
+ "prettier:fix": "prettier . --write",
47
+ "test": "vitest run",
48
+ "test:coverage": "vitest run --coverage",
49
+ "test:watch": "vitest",
50
+ "typecheck": "tsc --noEmit",
51
+ "watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
52
+ "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
53
+ },
54
+ "types": "lib/index.d.ts",
55
+ "version": "1.1.1"
56
+ }
@@ -0,0 +1,2 @@
1
+ import{INSPECTOR_COMMAND_TYPES as r,INSPECTOR_MESSAGE_TYPES as t}from"./inspector/constants";import{DevToolsDmkInspector as S}from"./inspector/DevToolsDmkInspector";import{serializeConnectedDevice as D,serializeDeviceSessionState as m,serializeDiscoveredDevice as T}from"./inspector/serialization";import{LOGGER_MESSAGE_TYPES as s}from"./logger/constants";import{DevToolsLogger as _}from"./logger/DevToolsLogger";import{DEVTOOLS_MODULES as l,MODULE_CONNECTED_MESSAGE_TYPE as n}from"./modules";export{l as DEVTOOLS_MODULES,S as DevToolsDmkInspector,_ as DevToolsLogger,r as INSPECTOR_COMMAND_TYPES,t as INSPECTOR_MESSAGE_TYPES,s as LOGGER_MESSAGE_TYPES,n as MODULE_CONNECTED_MESSAGE_TYPE,D as serializeConnectedDevice,m as serializeDeviceSessionState,T as serializeDiscoveredDevice};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/index.ts"],
4
+ "sourcesContent": ["// Inspector module\nexport { type CommandHandlerContext } from \"./inspector/commandHandlers\";\nexport {\n INSPECTOR_COMMAND_TYPES,\n INSPECTOR_MESSAGE_TYPES,\n} from \"./inspector/constants\";\nexport { DevToolsDmkInspector } from \"./inspector/DevToolsDmkInspector\";\nexport {\n serializeConnectedDevice,\n serializeDeviceSessionState,\n serializeDiscoveredDevice,\n} from \"./inspector/serialization\";\n\n// Logger module\nexport { LOGGER_MESSAGE_TYPES } from \"./logger/constants\";\nexport { type DevToolsLog } from \"./logger/DevToolsLog\";\nexport { DevToolsLogger } from \"./logger/DevToolsLogger\";\n\n// Shared\nexport {\n DEVTOOLS_MODULES,\n type DevToolsModule,\n MODULE_CONNECTED_MESSAGE_TYPE,\n} from \"./modules\";\nexport { type Connector } from \"./types\";\n"],
5
+ "mappings": "AAEA,OACE,2BAAAA,EACA,2BAAAC,MACK,wBACP,OAAS,wBAAAC,MAA4B,mCACrC,OACE,4BAAAC,EACA,+BAAAC,EACA,6BAAAC,MACK,4BAGP,OAAS,wBAAAC,MAA4B,qBAErC,OAAS,kBAAAC,MAAsB,0BAG/B,OACE,oBAAAC,EAEA,iCAAAC,MACK",
6
+ "names": ["INSPECTOR_COMMAND_TYPES", "INSPECTOR_MESSAGE_TYPES", "DevToolsDmkInspector", "serializeConnectedDevice", "serializeDeviceSessionState", "serializeDiscoveredDevice", "LOGGER_MESSAGE_TYPES", "DevToolsLogger", "DEVTOOLS_MODULES", "MODULE_CONNECTED_MESSAGE_TYPE"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{DEVTOOLS_MODULES as n,MODULE_CONNECTED_MESSAGE_TYPE as o}from"../modules";import{handleConnectDevice as a,handleDisconnect as c,handleGetProvider as d,handleSendApdu as v,handleSetProvider as m}from"./commandHandlers";import{INSPECTOR_COMMAND_TYPES as e}from"./constants";import{createDeviceObserver as D}from"./deviceObserver";import{DiscoveryHandler as l}from"./DiscoveryHandler";class T{ctx;destroyDeviceObserver;discoveryHandler;commandListenerUnsubscribe=null;constructor(r,s){this.ctx={connector:r,dmk:s},r.sendMessage(o,JSON.stringify({module:n.DMK_INSPECTOR})),this.destroyDeviceObserver=D(s,r),this.discoveryHandler=new l(s,r),this.setupCommandListener()}destroy(){this.destroyDeviceObserver(),this.discoveryHandler.destroy(),this.commandListenerUnsubscribe&&(this.commandListenerUnsubscribe(),this.commandListenerUnsubscribe=null)}setupCommandListener(){const{unsubscribe:r}=this.ctx.connector.listenToMessages(async(s,t)=>{try{switch(s){case e.DISCONNECT:await c(this.ctx,t);break;case e.SEND_APDU:await v(this.ctx,t);break;case e.GET_PROVIDER:d(this.ctx);break;case e.SET_PROVIDER:m(this.ctx,t);break;case e.START_LISTENING_DEVICES:this.discoveryHandler.startListening();break;case e.STOP_LISTENING_DEVICES:this.discoveryHandler.stopListening();break;case e.START_DISCOVERING:this.discoveryHandler.startDiscovering();break;case e.STOP_DISCOVERING:this.discoveryHandler.stopDiscovering();break;case e.CONNECT_DEVICE:await a(this.ctx,t,this.discoveryHandler.discoveredDevices);break}}catch(i){console.error(`[DevToolsDmkInspector] Error handling command ${s}`,i)}});this.commandListenerUnsubscribe=r}}export{T as DevToolsDmkInspector};
2
+ //# sourceMappingURL=DevToolsDmkInspector.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/DevToolsDmkInspector.ts"],
4
+ "sourcesContent": ["import { type DeviceManagementKit } from \"@ledgerhq/device-management-kit\";\n\nimport { DEVTOOLS_MODULES, MODULE_CONNECTED_MESSAGE_TYPE } from \"../modules\";\nimport { type Connector } from \"../types\";\nimport {\n type CommandHandlerContext,\n handleConnectDevice,\n handleDisconnect,\n handleGetProvider,\n handleSendApdu,\n handleSetProvider,\n} from \"./commandHandlers\";\nimport { INSPECTOR_COMMAND_TYPES } from \"./constants\";\nimport { createDeviceObserver } from \"./deviceObserver\";\nimport { DiscoveryHandler } from \"./DiscoveryHandler\";\n\n/**\n * DevToolsDmkInspector enables the devtools dashboard to inspect and interact\n * with the Device Management Kit.\n *\n * Features:\n * - Device sessions: list connected devices, observe session states\n * - Actions: disconnect sessions, send APDUs\n * - Configuration: get/set provider\n *\n * @example\n * ```ts\n * const connector = DevToolsWebSocketConnector.getInstance().connect({ url });\n * const dmk = new DeviceManagementKitBuilder().build();\n *\n * // Enable inspector after DMK is built\n * const inspector = new DevToolsDmkInspector(connector, dmk);\n *\n * // Clean up when done\n * inspector.destroy();\n * ```\n */\nexport class DevToolsDmkInspector {\n private readonly ctx: CommandHandlerContext;\n private readonly destroyDeviceObserver: () => void;\n private readonly discoveryHandler: DiscoveryHandler;\n private commandListenerUnsubscribe: (() => void) | null = null;\n\n constructor(connector: Connector, dmk: DeviceManagementKit) {\n this.ctx = { connector, dmk };\n\n // Send handshake\n connector.sendMessage(\n MODULE_CONNECTED_MESSAGE_TYPE,\n JSON.stringify({ module: DEVTOOLS_MODULES.DMK_INSPECTOR }),\n );\n\n // Start observing devices\n this.destroyDeviceObserver = createDeviceObserver(dmk, connector);\n\n // Initialize discovery handler\n this.discoveryHandler = new DiscoveryHandler(dmk, connector);\n\n // Listen for commands from dashboard\n this.setupCommandListener();\n }\n\n /**\n * Clean up subscriptions and listeners.\n */\n destroy(): void {\n this.destroyDeviceObserver();\n this.discoveryHandler.destroy();\n\n if (this.commandListenerUnsubscribe) {\n this.commandListenerUnsubscribe();\n this.commandListenerUnsubscribe = null;\n }\n }\n\n /**\n * Listen for commands from the dashboard.\n */\n private setupCommandListener(): void {\n const { unsubscribe } = this.ctx.connector.listenToMessages(\n async (type, payload) => {\n try {\n switch (type) {\n case INSPECTOR_COMMAND_TYPES.DISCONNECT:\n await handleDisconnect(this.ctx, payload);\n break;\n case INSPECTOR_COMMAND_TYPES.SEND_APDU:\n await handleSendApdu(this.ctx, payload);\n break;\n case INSPECTOR_COMMAND_TYPES.GET_PROVIDER:\n handleGetProvider(this.ctx);\n break;\n case INSPECTOR_COMMAND_TYPES.SET_PROVIDER:\n handleSetProvider(this.ctx, payload);\n break;\n case INSPECTOR_COMMAND_TYPES.START_LISTENING_DEVICES:\n this.discoveryHandler.startListening();\n break;\n case INSPECTOR_COMMAND_TYPES.STOP_LISTENING_DEVICES:\n this.discoveryHandler.stopListening();\n break;\n case INSPECTOR_COMMAND_TYPES.START_DISCOVERING:\n this.discoveryHandler.startDiscovering();\n break;\n case INSPECTOR_COMMAND_TYPES.STOP_DISCOVERING:\n this.discoveryHandler.stopDiscovering();\n break;\n case INSPECTOR_COMMAND_TYPES.CONNECT_DEVICE:\n await handleConnectDevice(\n this.ctx,\n payload,\n this.discoveryHandler.discoveredDevices,\n );\n break;\n }\n } catch (error) {\n console.error(\n `[DevToolsDmkInspector] Error handling command ${type}`,\n error,\n );\n }\n },\n );\n this.commandListenerUnsubscribe = unsubscribe;\n }\n}\n"],
5
+ "mappings": "AAEA,OAAS,oBAAAA,EAAkB,iCAAAC,MAAqC,aAEhE,OAEE,uBAAAC,EACA,oBAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,qBAAAC,MACK,oBACP,OAAS,2BAAAC,MAA+B,cACxC,OAAS,wBAAAC,MAA4B,mBACrC,OAAS,oBAAAC,MAAwB,qBAuB1B,MAAMC,CAAqB,CACf,IACA,sBACA,iBACT,2BAAkD,KAE1D,YAAYC,EAAsBC,EAA0B,CAC1D,KAAK,IAAM,CAAE,UAAAD,EAAW,IAAAC,CAAI,EAG5BD,EAAU,YACRV,EACA,KAAK,UAAU,CAAE,OAAQD,EAAiB,aAAc,CAAC,CAC3D,EAGA,KAAK,sBAAwBQ,EAAqBI,EAAKD,CAAS,EAGhE,KAAK,iBAAmB,IAAIF,EAAiBG,EAAKD,CAAS,EAG3D,KAAK,qBAAqB,CAC5B,CAKA,SAAgB,CACd,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,QAAQ,EAE1B,KAAK,6BACP,KAAK,2BAA2B,EAChC,KAAK,2BAA6B,KAEtC,CAKQ,sBAA6B,CACnC,KAAM,CAAE,YAAAE,CAAY,EAAI,KAAK,IAAI,UAAU,iBACzC,MAAOC,EAAMC,IAAY,CACvB,GAAI,CACF,OAAQD,EAAM,CACZ,KAAKP,EAAwB,WAC3B,MAAMJ,EAAiB,KAAK,IAAKY,CAAO,EACxC,MACF,KAAKR,EAAwB,UAC3B,MAAMF,EAAe,KAAK,IAAKU,CAAO,EACtC,MACF,KAAKR,EAAwB,aAC3BH,EAAkB,KAAK,GAAG,EAC1B,MACF,KAAKG,EAAwB,aAC3BD,EAAkB,KAAK,IAAKS,CAAO,EACnC,MACF,KAAKR,EAAwB,wBAC3B,KAAK,iBAAiB,eAAe,EACrC,MACF,KAAKA,EAAwB,uBAC3B,KAAK,iBAAiB,cAAc,EACpC,MACF,KAAKA,EAAwB,kBAC3B,KAAK,iBAAiB,iBAAiB,EACvC,MACF,KAAKA,EAAwB,iBAC3B,KAAK,iBAAiB,gBAAgB,EACtC,MACF,KAAKA,EAAwB,eAC3B,MAAML,EACJ,KAAK,IACLa,EACA,KAAK,iBAAiB,iBACxB,EACA,KACJ,CACF,OAASC,EAAO,CACd,QAAQ,MACN,iDAAiDF,CAAI,GACrDE,CACF,CACF,CACF,CACF,EACA,KAAK,2BAA6BH,CACpC,CACF",
6
+ "names": ["DEVTOOLS_MODULES", "MODULE_CONNECTED_MESSAGE_TYPE", "handleConnectDevice", "handleDisconnect", "handleGetProvider", "handleSendApdu", "handleSetProvider", "INSPECTOR_COMMAND_TYPES", "createDeviceObserver", "DiscoveryHandler", "DevToolsDmkInspector", "connector", "dmk", "unsubscribe", "type", "payload", "error"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{startDiscoveringObserver as t,startListeningObserver as s}from"./discoveryObserver";class r{dmk;connector;stopListeningFn=null;stopDiscoveringFn=null;_discoveredDevices=[];constructor(i,e){this.dmk=i,this.connector=e}get discoveredDevices(){return this._discoveredDevices}get isListening(){return this.stopListeningFn!==null}get isDiscovering(){return this.stopDiscoveringFn!==null}startListening(){this.stopListeningFn||(this.stopListeningFn=s(this.dmk,this.connector,i=>{this._discoveredDevices=i}))}stopListening(){this.stopListeningFn&&(this.stopListeningFn(),this.stopListeningFn=null,this._discoveredDevices=[])}startDiscovering(){this.stopDiscoveringFn||(this.stopDiscoveringFn=t(this.dmk,this.connector,i=>{this._discoveredDevices=i}))}stopDiscovering(){this.stopDiscoveringFn&&(this.stopDiscoveringFn(),this.stopDiscoveringFn=null,this._discoveredDevices=[])}destroy(){this.stopListening(),this.stopDiscovering()}}export{r as DiscoveryHandler};
2
+ //# sourceMappingURL=DiscoveryHandler.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/DiscoveryHandler.ts"],
4
+ "sourcesContent": ["import {\n type DeviceManagementKit,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type Connector } from \"../types\";\nimport {\n startDiscoveringObserver,\n startListeningObserver,\n} from \"./discoveryObserver\";\n\n/**\n * Handles device discovery operations for the devtools inspector.\n * Encapsulates both passive listening and active discovery modes.\n *\n * @example\n * ```ts\n * const handler = new DiscoveryHandler(dmk, connector);\n *\n * // Start passive listening (no user gesture required)\n * handler.startListening();\n *\n * // Or start active discovery (triggers permission prompt in web)\n * handler.startDiscovering();\n *\n * // Get current discovered devices\n * const devices = handler.discoveredDevices;\n *\n * // Clean up\n * handler.destroy();\n * ```\n */\nexport class DiscoveryHandler {\n private readonly dmk: DeviceManagementKit;\n private readonly connector: Connector;\n\n private stopListeningFn: (() => void) | null = null;\n private stopDiscoveringFn: (() => void) | null = null;\n private _discoveredDevices: DiscoveredDevice[] = [];\n\n constructor(dmk: DeviceManagementKit, connector: Connector) {\n this.dmk = dmk;\n this.connector = connector;\n }\n\n /**\n * Get the current list of discovered devices.\n */\n get discoveredDevices(): DiscoveredDevice[] {\n return this._discoveredDevices;\n }\n\n /**\n * Whether passive listening is currently active.\n */\n get isListening(): boolean {\n return this.stopListeningFn !== null;\n }\n\n /**\n * Whether active discovery is currently active.\n */\n get isDiscovering(): boolean {\n return this.stopDiscoveringFn !== null;\n }\n\n /**\n * Start passive listening for available devices.\n * Does NOT trigger permission prompts - works with already-paired devices.\n */\n startListening(): void {\n if (this.stopListeningFn) {\n return; // Already listening\n }\n\n this.stopListeningFn = startListeningObserver(\n this.dmk,\n this.connector,\n (devices) => {\n this._discoveredDevices = devices;\n },\n );\n }\n\n /**\n * Stop passive listening for available devices.\n */\n stopListening(): void {\n if (this.stopListeningFn) {\n this.stopListeningFn();\n this.stopListeningFn = null;\n this._discoveredDevices = [];\n }\n }\n\n /**\n * Start active device discovery.\n * NOTE: In web apps (WebHID/WebBLE), this requires a user gesture in the app context.\n * Calling this from the dashboard will NOT work for web apps.\n */\n startDiscovering(): void {\n if (this.stopDiscoveringFn) {\n return; // Already discovering\n }\n\n this.stopDiscoveringFn = startDiscoveringObserver(\n this.dmk,\n this.connector,\n (devices) => {\n this._discoveredDevices = devices;\n },\n );\n }\n\n /**\n * Stop active device discovery.\n */\n stopDiscovering(): void {\n if (this.stopDiscoveringFn) {\n this.stopDiscoveringFn();\n this.stopDiscoveringFn = null;\n this._discoveredDevices = [];\n }\n }\n\n /**\n * Clean up all discovery operations.\n */\n destroy(): void {\n this.stopListening();\n this.stopDiscovering();\n }\n}\n"],
5
+ "mappings": "AAMA,OACE,4BAAAA,EACA,0BAAAC,MACK,sBAuBA,MAAMC,CAAiB,CACX,IACA,UAET,gBAAuC,KACvC,kBAAyC,KACzC,mBAAyC,CAAC,EAElD,YAAYC,EAA0BC,EAAsB,CAC1D,KAAK,IAAMD,EACX,KAAK,UAAYC,CACnB,CAKA,IAAI,mBAAwC,CAC1C,OAAO,KAAK,kBACd,CAKA,IAAI,aAAuB,CACzB,OAAO,KAAK,kBAAoB,IAClC,CAKA,IAAI,eAAyB,CAC3B,OAAO,KAAK,oBAAsB,IACpC,CAMA,gBAAuB,CACjB,KAAK,kBAIT,KAAK,gBAAkBH,EACrB,KAAK,IACL,KAAK,UACJI,GAAY,CACX,KAAK,mBAAqBA,CAC5B,CACF,EACF,CAKA,eAAsB,CAChB,KAAK,kBACP,KAAK,gBAAgB,EACrB,KAAK,gBAAkB,KACvB,KAAK,mBAAqB,CAAC,EAE/B,CAOA,kBAAyB,CACnB,KAAK,oBAIT,KAAK,kBAAoBL,EACvB,KAAK,IACL,KAAK,UACJK,GAAY,CACX,KAAK,mBAAqBA,CAC5B,CACF,EACF,CAKA,iBAAwB,CAClB,KAAK,oBACP,KAAK,kBAAkB,EACvB,KAAK,kBAAoB,KACzB,KAAK,mBAAqB,CAAC,EAE/B,CAKA,SAAgB,CACd,KAAK,cAAc,EACnB,KAAK,gBAAgB,CACvB,CACF",
6
+ "names": ["startDiscoveringObserver", "startListeningObserver", "DiscoveryHandler", "dmk", "connector", "devices"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{INSPECTOR_MESSAGE_TYPES as d}from"./constants";async function m(e,n){const{sessionId:r}=JSON.parse(n);await e.dmk.disconnect({sessionId:r})}async function p(e,n){const{sessionId:r,apdu:t,requestId:i}=JSON.parse(n);try{const o=new Uint8Array(t),s=await e.dmk.sendApdu({sessionId:r,apdu:o});e.connector.sendMessage(d.APDU_RESPONSE,JSON.stringify({requestId:i,success:!0,statusCode:Array.from(s.statusCode),data:Array.from(s.data)}))}catch(o){e.connector.sendMessage(d.APDU_RESPONSE,JSON.stringify({requestId:i,success:!1,error:o instanceof Error?o.message:String(o)}))}}function c(e){const n=e.dmk.getProvider();e.connector.sendMessage(d.PROVIDER_VALUE,JSON.stringify({provider:n}))}function v(e,n){const{provider:r}=JSON.parse(n);e.dmk.setProvider(r),c(e)}async function u(e,n,r){const{deviceId:t,sessionRefresherOptions:i}=JSON.parse(n),o=r.find(s=>s.id===t);if(!o){console.error(`[DevToolsDmkInspector] Device not found for connect: ${t}`);return}try{await e.dmk.connect({device:o,sessionRefresherOptions:i})}catch(s){console.error(`[DevToolsDmkInspector] Error connecting to device ${t}`,s)}}export{u as handleConnectDevice,m as handleDisconnect,c as handleGetProvider,p as handleSendApdu,v as handleSetProvider};
2
+ //# sourceMappingURL=commandHandlers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/commandHandlers.ts"],
4
+ "sourcesContent": ["import {\n type DeviceId,\n type DeviceManagementKit,\n type DeviceSessionId,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type Connector } from \"../types\";\nimport { INSPECTOR_MESSAGE_TYPES } from \"./constants\";\n\n/**\n * Context passed to command handlers.\n */\nexport type CommandHandlerContext = {\n dmk: DeviceManagementKit;\n connector: Connector;\n};\n\n/**\n * Handle disconnect command - disconnects a device session.\n */\nexport async function handleDisconnect(\n ctx: CommandHandlerContext,\n payload: string,\n): Promise<void> {\n const { sessionId } = JSON.parse(payload) as { sessionId: DeviceSessionId };\n await ctx.dmk.disconnect({ sessionId });\n // Device list update will be sent via the observer\n}\n\n/**\n * Handle sendApdu command - sends a raw APDU to a device.\n */\nexport async function handleSendApdu(\n ctx: CommandHandlerContext,\n payload: string,\n): Promise<void> {\n const { sessionId, apdu, requestId } = JSON.parse(payload) as {\n sessionId: DeviceSessionId;\n apdu: number[];\n requestId: string;\n };\n try {\n // Convert array to Uint8Array for DMK\n const apduBytes = new Uint8Array(apdu);\n const response = await ctx.dmk.sendApdu({ sessionId, apdu: apduBytes });\n ctx.connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.APDU_RESPONSE,\n JSON.stringify({\n requestId,\n success: true,\n statusCode: Array.from(response.statusCode),\n data: Array.from(response.data),\n }),\n );\n } catch (error) {\n ctx.connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.APDU_RESPONSE,\n JSON.stringify({\n requestId,\n success: false,\n error: error instanceof Error ? error.message : String(error),\n }),\n );\n }\n}\n\n/**\n * Handle getProvider command - returns the current provider value.\n */\nexport function handleGetProvider(ctx: CommandHandlerContext): void {\n const provider = ctx.dmk.getProvider();\n ctx.connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.PROVIDER_VALUE,\n JSON.stringify({ provider }),\n );\n}\n\n/**\n * Handle setProvider command - sets the provider value and confirms.\n */\nexport function handleSetProvider(\n ctx: CommandHandlerContext,\n payload: string,\n): void {\n const { provider } = JSON.parse(payload) as { provider: number };\n ctx.dmk.setProvider(provider);\n // Send back the new value to confirm\n handleGetProvider(ctx);\n}\n\n/**\n * Handle connectDevice command - connects to a discovered device.\n *\n * @param ctx - Command handler context\n * @param payload - JSON payload containing deviceId and optional sessionRefresherOptions\n * @param discoveredDevices - Current list of discovered devices to find the device\n */\nexport async function handleConnectDevice(\n ctx: CommandHandlerContext,\n payload: string,\n discoveredDevices: DiscoveredDevice[],\n): Promise<void> {\n const { deviceId, sessionRefresherOptions } = JSON.parse(payload) as {\n deviceId: DeviceId;\n sessionRefresherOptions?: {\n isRefresherDisabled: boolean;\n pollingInterval?: number;\n };\n };\n\n const device = discoveredDevices.find((d) => d.id === deviceId);\n if (!device) {\n console.error(\n `[DevToolsDmkInspector] Device not found for connect: ${deviceId}`,\n );\n return;\n }\n\n try {\n await ctx.dmk.connect({ device, sessionRefresherOptions });\n // The connected device will be picked up by the deviceObserver\n } catch (error) {\n console.error(\n `[DevToolsDmkInspector] Error connecting to device ${deviceId}`,\n error,\n );\n }\n}\n"],
5
+ "mappings": "AAQA,OAAS,2BAAAA,MAA+B,cAaxC,eAAsBC,EACpBC,EACAC,EACe,CACf,KAAM,CAAE,UAAAC,CAAU,EAAI,KAAK,MAAMD,CAAO,EACxC,MAAMD,EAAI,IAAI,WAAW,CAAE,UAAAE,CAAU,CAAC,CAExC,CAKA,eAAsBC,EACpBH,EACAC,EACe,CACf,KAAM,CAAE,UAAAC,EAAW,KAAAE,EAAM,UAAAC,CAAU,EAAI,KAAK,MAAMJ,CAAO,EAKzD,GAAI,CAEF,MAAMK,EAAY,IAAI,WAAWF,CAAI,EAC/BG,EAAW,MAAMP,EAAI,IAAI,SAAS,CAAE,UAAAE,EAAW,KAAMI,CAAU,CAAC,EACtEN,EAAI,UAAU,YACZF,EAAwB,cACxB,KAAK,UAAU,CACb,UAAAO,EACA,QAAS,GACT,WAAY,MAAM,KAAKE,EAAS,UAAU,EAC1C,KAAM,MAAM,KAAKA,EAAS,IAAI,CAChC,CAAC,CACH,CACF,OAASC,EAAO,CACdR,EAAI,UAAU,YACZF,EAAwB,cACxB,KAAK,UAAU,CACb,UAAAO,EACA,QAAS,GACT,MAAOG,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAC9D,CAAC,CACH,CACF,CACF,CAKO,SAASC,EAAkBT,EAAkC,CAClE,MAAMU,EAAWV,EAAI,IAAI,YAAY,EACrCA,EAAI,UAAU,YACZF,EAAwB,eACxB,KAAK,UAAU,CAAE,SAAAY,CAAS,CAAC,CAC7B,CACF,CAKO,SAASC,EACdX,EACAC,EACM,CACN,KAAM,CAAE,SAAAS,CAAS,EAAI,KAAK,MAAMT,CAAO,EACvCD,EAAI,IAAI,YAAYU,CAAQ,EAE5BD,EAAkBT,CAAG,CACvB,CASA,eAAsBY,EACpBZ,EACAC,EACAY,EACe,CACf,KAAM,CAAE,SAAAC,EAAU,wBAAAC,CAAwB,EAAI,KAAK,MAAMd,CAAO,EAQ1De,EAASH,EAAkB,KAAMI,GAAMA,EAAE,KAAOH,CAAQ,EAC9D,GAAI,CAACE,EAAQ,CACX,QAAQ,MACN,wDAAwDF,CAAQ,EAClE,EACA,MACF,CAEA,GAAI,CACF,MAAMd,EAAI,IAAI,QAAQ,CAAE,OAAAgB,EAAQ,wBAAAD,CAAwB,CAAC,CAE3D,OAASP,EAAO,CACd,QAAQ,MACN,qDAAqDM,CAAQ,GAC7DN,CACF,CACF,CACF",
6
+ "names": ["INSPECTOR_MESSAGE_TYPES", "handleDisconnect", "ctx", "payload", "sessionId", "handleSendApdu", "apdu", "requestId", "apduBytes", "response", "error", "handleGetProvider", "provider", "handleSetProvider", "handleConnectDevice", "discoveredDevices", "deviceId", "sessionRefresherOptions", "device", "d"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const E={CONNECTED_DEVICES_UPDATE:"connectedDevicesUpdate",DEVICE_SESSION_STATE_UPDATE:"deviceSessionStateUpdate",PROVIDER_VALUE:"providerValue",APDU_RESPONSE:"apduResponse",DISCOVERED_DEVICES_UPDATE:"discoveredDevicesUpdate"},e={DISCONNECT:"disconnect",SEND_APDU:"sendApdu",GET_PROVIDER:"getProvider",SET_PROVIDER:"setProvider",START_LISTENING_DEVICES:"startListeningDevices",STOP_LISTENING_DEVICES:"stopListeningDevices",START_DISCOVERING:"startDiscovering",STOP_DISCOVERING:"stopDiscovering",CONNECT_DEVICE:"connectDevice"};export{e as INSPECTOR_COMMAND_TYPES,E as INSPECTOR_MESSAGE_TYPES};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/constants.ts"],
4
+ "sourcesContent": ["/**\n * Message types sent from inspector to dashboard\n */\nexport const INSPECTOR_MESSAGE_TYPES = {\n /** List of all connected devices updated */\n CONNECTED_DEVICES_UPDATE: \"connectedDevicesUpdate\",\n /** A device session state updated */\n DEVICE_SESSION_STATE_UPDATE: \"deviceSessionStateUpdate\",\n /** Response to a getProvider request */\n PROVIDER_VALUE: \"providerValue\",\n /** Response to a sendApdu request */\n APDU_RESPONSE: \"apduResponse\",\n /** List of discovered (available) devices updated */\n DISCOVERED_DEVICES_UPDATE: \"discoveredDevicesUpdate\",\n} as const;\n\n/**\n * Message types sent from dashboard to inspector (commands)\n */\nexport const INSPECTOR_COMMAND_TYPES = {\n /** Request to disconnect a session */\n DISCONNECT: \"disconnect\",\n /** Request to send an APDU */\n SEND_APDU: \"sendApdu\",\n /** Request to get current provider */\n GET_PROVIDER: \"getProvider\",\n /** Request to set provider */\n SET_PROVIDER: \"setProvider\",\n /** Request to start listening for available devices (passive, no user gesture required) */\n START_LISTENING_DEVICES: \"startListeningDevices\",\n /** Request to stop listening for available devices */\n STOP_LISTENING_DEVICES: \"stopListeningDevices\",\n /** Request to start discovering devices (triggers permission prompt, requires user gesture in web apps) */\n START_DISCOVERING: \"startDiscovering\",\n /** Request to stop discovering devices */\n STOP_DISCOVERING: \"stopDiscovering\",\n /** Request to connect to a discovered device */\n CONNECT_DEVICE: \"connectDevice\",\n} as const;\n"],
5
+ "mappings": "AAGO,MAAMA,EAA0B,CAErC,yBAA0B,yBAE1B,4BAA6B,2BAE7B,eAAgB,gBAEhB,cAAe,eAEf,0BAA2B,yBAC7B,EAKaC,EAA0B,CAErC,WAAY,aAEZ,UAAW,WAEX,aAAc,cAEd,aAAc,cAEd,wBAAyB,wBAEzB,uBAAwB,uBAExB,kBAAmB,mBAEnB,iBAAkB,kBAElB,eAAgB,eAClB",
6
+ "names": ["INSPECTOR_MESSAGE_TYPES", "INSPECTOR_COMMAND_TYPES"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{INSPECTOR_MESSAGE_TYPES as S}from"./constants";import{serializeConnectedDevice as a,serializeDeviceSessionState as p}from"./serialization";function r(t,s){const i=t.listConnectedDevices();s.sendMessage(S.CONNECTED_DEVICES_UPDATE,JSON.stringify(i.map(a)))}function u(t,s,i){t.sendMessage(S.DEVICE_SESSION_STATE_UPDATE,JSON.stringify({sessionId:s,state:p(i)}))}function l(t,s){const i=[],o=new Map,c=e=>{if(o.has(e))return;const D=t.getDeviceSessionState({sessionId:e}).subscribe({next:n=>{u(s,e,n)},error:n=>{console.error(`[DevToolsDmkInspector] getDeviceSessionState error for ${e}`,n),o.delete(e)},complete:()=>{o.delete(e),r(t,s)}});o.set(e,D)};r(t,s);const v=t.listenToConnectedDevice().subscribe({next:e=>{r(t,s),c(e.sessionId)},error:e=>{console.error("[DevToolsDmkInspector] listenToConnectedDevice error",e)}});return i.push(v),t.listConnectedDevices().forEach(e=>{c(e.sessionId)}),()=>{for(const e of i)e.unsubscribe();for(const e of o.values())e.unsubscribe();o.clear()}}export{l as createDeviceObserver,r as sendConnectedDevicesUpdate,u as sendSessionStateUpdate};
2
+ //# sourceMappingURL=deviceObserver.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/deviceObserver.ts"],
4
+ "sourcesContent": ["import {\n type DeviceManagementKit,\n type DeviceSessionId,\n type DeviceSessionState,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Subscription } from \"rxjs\";\n\nimport { type Connector } from \"../types\";\nimport { INSPECTOR_MESSAGE_TYPES } from \"./constants\";\nimport {\n serializeConnectedDevice,\n serializeDeviceSessionState,\n} from \"./serialization\";\n\n/**\n * Sends the current list of connected devices to the dashboard.\n */\nexport function sendConnectedDevicesUpdate(\n dmk: DeviceManagementKit,\n connector: Connector,\n): void {\n const devices = dmk.listConnectedDevices();\n connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.CONNECTED_DEVICES_UPDATE,\n JSON.stringify(devices.map(serializeConnectedDevice)),\n );\n}\n\n/**\n * Sends a device session state update to the dashboard.\n */\nexport function sendSessionStateUpdate(\n connector: Connector,\n sessionId: DeviceSessionId,\n state: DeviceSessionState,\n): void {\n connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.DEVICE_SESSION_STATE_UPDATE,\n JSON.stringify({\n sessionId,\n state: serializeDeviceSessionState(state),\n }),\n );\n}\n\n/**\n * Creates a device observer that tracks connected devices and their session states.\n * Returns a cleanup function to unsubscribe from all observations.\n */\nexport function createDeviceObserver(\n dmk: DeviceManagementKit,\n connector: Connector,\n): () => void {\n const subscriptions: Subscription[] = [];\n const sessionStateSubscriptions = new Map<DeviceSessionId, Subscription>();\n\n const subscribeToSessionState = (sessionId: DeviceSessionId): void => {\n // Don't double-subscribe\n if (sessionStateSubscriptions.has(sessionId)) {\n return;\n }\n\n const sub = dmk.getDeviceSessionState({ sessionId }).subscribe({\n next: (state: DeviceSessionState) => {\n sendSessionStateUpdate(connector, sessionId, state);\n },\n error: (err) => {\n console.error(\n `[DevToolsDmkInspector] getDeviceSessionState error for ${sessionId}`,\n err,\n );\n sessionStateSubscriptions.delete(sessionId);\n },\n complete: () => {\n // Session ended, clean up and send updated device list\n sessionStateSubscriptions.delete(sessionId);\n sendConnectedDevicesUpdate(dmk, connector);\n },\n });\n\n sessionStateSubscriptions.set(sessionId, sub);\n };\n\n // Send initial list of connected devices\n sendConnectedDevicesUpdate(dmk, connector);\n\n // Subscribe to new device connections\n const deviceSub = dmk.listenToConnectedDevice().subscribe({\n next: (device) => {\n sendConnectedDevicesUpdate(dmk, connector);\n subscribeToSessionState(device.sessionId);\n },\n error: (err) => {\n console.error(\n \"[DevToolsDmkInspector] listenToConnectedDevice error\",\n err,\n );\n },\n });\n subscriptions.push(deviceSub);\n\n // Subscribe to existing devices' session states\n const existingDevices = dmk.listConnectedDevices();\n existingDevices.forEach((device) => {\n subscribeToSessionState(device.sessionId);\n });\n\n // Return cleanup function\n return () => {\n for (const sub of subscriptions) {\n sub.unsubscribe();\n }\n for (const sub of sessionStateSubscriptions.values()) {\n sub.unsubscribe();\n }\n sessionStateSubscriptions.clear();\n };\n}\n"],
5
+ "mappings": "AAQA,OAAS,2BAAAA,MAA+B,cACxC,OACE,4BAAAC,EACA,+BAAAC,MACK,kBAKA,SAASC,EACdC,EACAC,EACM,CACN,MAAMC,EAAUF,EAAI,qBAAqB,EACzCC,EAAU,YACRL,EAAwB,yBACxB,KAAK,UAAUM,EAAQ,IAAIL,CAAwB,CAAC,CACtD,CACF,CAKO,SAASM,EACdF,EACAG,EACAC,EACM,CACNJ,EAAU,YACRL,EAAwB,4BACxB,KAAK,UAAU,CACb,UAAAQ,EACA,MAAON,EAA4BO,CAAK,CAC1C,CAAC,CACH,CACF,CAMO,SAASC,EACdN,EACAC,EACY,CACZ,MAAMM,EAAgC,CAAC,EACjCC,EAA4B,IAAI,IAEhCC,EAA2BL,GAAqC,CAEpE,GAAII,EAA0B,IAAIJ,CAAS,EACzC,OAGF,MAAMM,EAAMV,EAAI,sBAAsB,CAAE,UAAAI,CAAU,CAAC,EAAE,UAAU,CAC7D,KAAOC,GAA8B,CACnCF,EAAuBF,EAAWG,EAAWC,CAAK,CACpD,EACA,MAAQM,GAAQ,CACd,QAAQ,MACN,0DAA0DP,CAAS,GACnEO,CACF,EACAH,EAA0B,OAAOJ,CAAS,CAC5C,EACA,SAAU,IAAM,CAEdI,EAA0B,OAAOJ,CAAS,EAC1CL,EAA2BC,EAAKC,CAAS,CAC3C,CACF,CAAC,EAEDO,EAA0B,IAAIJ,EAAWM,CAAG,CAC9C,EAGAX,EAA2BC,EAAKC,CAAS,EAGzC,MAAMW,EAAYZ,EAAI,wBAAwB,EAAE,UAAU,CACxD,KAAOa,GAAW,CAChBd,EAA2BC,EAAKC,CAAS,EACzCQ,EAAwBI,EAAO,SAAS,CAC1C,EACA,MAAQF,GAAQ,CACd,QAAQ,MACN,uDACAA,CACF,CACF,CACF,CAAC,EACD,OAAAJ,EAAc,KAAKK,CAAS,EAGJZ,EAAI,qBAAqB,EACjC,QAASa,GAAW,CAClCJ,EAAwBI,EAAO,SAAS,CAC1C,CAAC,EAGM,IAAM,CACX,UAAWH,KAAOH,EAChBG,EAAI,YAAY,EAElB,UAAWA,KAAOF,EAA0B,OAAO,EACjDE,EAAI,YAAY,EAElBF,EAA0B,MAAM,CAClC,CACF",
6
+ "names": ["INSPECTOR_MESSAGE_TYPES", "serializeConnectedDevice", "serializeDeviceSessionState", "sendConnectedDevicesUpdate", "dmk", "connector", "devices", "sendSessionStateUpdate", "sessionId", "state", "createDeviceObserver", "subscriptions", "sessionStateSubscriptions", "subscribeToSessionState", "sub", "err", "deviceSub", "device"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{INSPECTOR_MESSAGE_TYPES as D}from"./constants";import{serializeDiscoveredDevice as p}from"./serialization";function c(r,o){o.sendMessage(D.DISCOVERED_DEVICES_UPDATE,JSON.stringify(r.map(p)))}function u(r,o,n){let i=null;return i=r.listenToAvailableDevices({}).subscribe({next:e=>{c(e,o),n?.(e)},error:e=>{console.error("[DevToolsDmkInspector] listenToAvailableDevices error",e)}}),()=>{i&&(i.unsubscribe(),i=null)}}function a(r,o,n){let i=null;const e=[];return i=r.startDiscovering({}).subscribe({next:s=>{const t=e.findIndex(v=>v.id===s.id);t>=0?e[t]=s:e.push(s),c([...e],o),n?.([...e])},error:s=>{console.error("[DevToolsDmkInspector] startDiscovering error",s)},complete:()=>{}}),()=>{i&&(i.unsubscribe(),i=null),r.stopDiscovering()}}export{c as sendDiscoveredDevicesUpdate,a as startDiscoveringObserver,u as startListeningObserver};
2
+ //# sourceMappingURL=discoveryObserver.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/discoveryObserver.ts"],
4
+ "sourcesContent": ["import {\n type DeviceManagementKit,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\nimport { type Subscription } from \"rxjs\";\n\nimport { type Connector } from \"../types\";\nimport { INSPECTOR_MESSAGE_TYPES } from \"./constants\";\nimport { serializeDiscoveredDevice } from \"./serialization\";\n\n/**\n * Callback type for when discovered devices are updated.\n */\nexport type OnDiscoveredDevicesUpdate = (devices: DiscoveredDevice[]) => void;\n\n/**\n * Sends the list of discovered devices to the dashboard.\n */\nexport function sendDiscoveredDevicesUpdate(\n devices: DiscoveredDevice[],\n connector: Connector,\n): void {\n connector.sendMessage(\n INSPECTOR_MESSAGE_TYPES.DISCOVERED_DEVICES_UPDATE,\n JSON.stringify(devices.map(serializeDiscoveredDevice)),\n );\n}\n\n/**\n * Starts listening to available devices (passive discovery).\n * Uses listenToAvailableDevices which returns the current list of known devices.\n * Does NOT trigger permission prompts - works with already-paired devices.\n *\n * @param dmk - The Device Management Kit instance\n * @param connector - The connector to send messages to the dashboard\n * @param onDevicesUpdate - Optional callback when devices are updated (used to track current devices)\n * @returns A cleanup function to stop listening\n */\nexport function startListeningObserver(\n dmk: DeviceManagementKit,\n connector: Connector,\n onDevicesUpdate?: OnDiscoveredDevicesUpdate,\n): () => void {\n let subscription: Subscription | null = null;\n\n subscription = dmk.listenToAvailableDevices({}).subscribe({\n next: (devices: DiscoveredDevice[]) => {\n sendDiscoveredDevicesUpdate(devices, connector);\n onDevicesUpdate?.(devices);\n },\n error: (err) => {\n console.error(\n \"[DevToolsDmkInspector] listenToAvailableDevices error\",\n err,\n );\n },\n });\n\n // Return cleanup function\n return () => {\n if (subscription) {\n subscription.unsubscribe();\n subscription = null;\n }\n };\n}\n\n/**\n * Starts active device discovery.\n * Uses startDiscovering which triggers permission prompts in web apps.\n * NOTE: In web apps (WebHID/WebBLE), this requires a user gesture in the app context.\n * Calling this from the dashboard will NOT work for web apps.\n *\n * @param dmk - The Device Management Kit instance\n * @param connector - The connector to send messages to the dashboard\n * @param onDevicesUpdate - Optional callback when devices are updated (used to track current devices)\n * @returns A cleanup function to stop discovering\n */\nexport function startDiscoveringObserver(\n dmk: DeviceManagementKit,\n connector: Connector,\n onDevicesUpdate?: OnDiscoveredDevicesUpdate,\n): () => void {\n let subscription: Subscription | null = null;\n const discoveredDevices: DiscoveredDevice[] = [];\n\n subscription = dmk.startDiscovering({}).subscribe({\n next: (device: DiscoveredDevice) => {\n // Accumulate devices (avoid duplicates by id)\n const existingIndex = discoveredDevices.findIndex(\n (d) => d.id === device.id,\n );\n if (existingIndex >= 0) {\n discoveredDevices[existingIndex] = device;\n } else {\n discoveredDevices.push(device);\n }\n sendDiscoveredDevicesUpdate([...discoveredDevices], connector);\n onDevicesUpdate?.([...discoveredDevices]);\n },\n error: (err) => {\n console.error(\"[DevToolsDmkInspector] startDiscovering error\", err);\n },\n complete: () => {\n // Discovery completed (user closed picker or similar)\n },\n });\n\n // Return cleanup function\n return () => {\n if (subscription) {\n subscription.unsubscribe();\n subscription = null;\n }\n void dmk.stopDiscovering();\n };\n}\n"],
5
+ "mappings": "AAOA,OAAS,2BAAAA,MAA+B,cACxC,OAAS,6BAAAC,MAAiC,kBAUnC,SAASC,EACdC,EACAC,EACM,CACNA,EAAU,YACRJ,EAAwB,0BACxB,KAAK,UAAUG,EAAQ,IAAIF,CAAyB,CAAC,CACvD,CACF,CAYO,SAASI,EACdC,EACAF,EACAG,EACY,CACZ,IAAIC,EAAoC,KAExC,OAAAA,EAAeF,EAAI,yBAAyB,CAAC,CAAC,EAAE,UAAU,CACxD,KAAOH,GAAgC,CACrCD,EAA4BC,EAASC,CAAS,EAC9CG,IAAkBJ,CAAO,CAC3B,EACA,MAAQM,GAAQ,CACd,QAAQ,MACN,wDACAA,CACF,CACF,CACF,CAAC,EAGM,IAAM,CACPD,IACFA,EAAa,YAAY,EACzBA,EAAe,KAEnB,CACF,CAaO,SAASE,EACdJ,EACAF,EACAG,EACY,CACZ,IAAIC,EAAoC,KACxC,MAAMG,EAAwC,CAAC,EAE/C,OAAAH,EAAeF,EAAI,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAChD,KAAOM,GAA6B,CAElC,MAAMC,EAAgBF,EAAkB,UACrCG,GAAMA,EAAE,KAAOF,EAAO,EACzB,EACIC,GAAiB,EACnBF,EAAkBE,CAAa,EAAID,EAEnCD,EAAkB,KAAKC,CAAM,EAE/BV,EAA4B,CAAC,GAAGS,CAAiB,EAAGP,CAAS,EAC7DG,IAAkB,CAAC,GAAGI,CAAiB,CAAC,CAC1C,EACA,MAAQF,GAAQ,CACd,QAAQ,MAAM,gDAAiDA,CAAG,CACpE,EACA,SAAU,IAAM,CAEhB,CACF,CAAC,EAGM,IAAM,CACPD,IACFA,EAAa,YAAY,EACzBA,EAAe,MAEZF,EAAI,gBAAgB,CAC3B,CACF",
6
+ "names": ["INSPECTOR_MESSAGE_TYPES", "serializeDiscoveredDevice", "sendDiscoveredDevicesUpdate", "devices", "connector", "startListeningObserver", "dmk", "onDevicesUpdate", "subscription", "err", "startDiscoveringObserver", "discoveredDevices", "device", "existingIndex", "d"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{DeviceSessionStateType as s}from"@ledgerhq/device-management-kit";function n(e){return JSON.parse(JSON.stringify(e))}function c(e){const i=JSON.parse(JSON.stringify(e));return i.sessionStateType=s[e.sessionStateType],i}function o(e){return JSON.parse(JSON.stringify(e))}export{n as serializeConnectedDevice,c as serializeDeviceSessionState,o as serializeDiscoveredDevice};
2
+ //# sourceMappingURL=serialization.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/inspector/serialization.ts"],
4
+ "sourcesContent": ["import {\n type ConnectedDevice,\n type DeviceSessionState,\n DeviceSessionStateType,\n type DiscoveredDevice,\n} from \"@ledgerhq/device-management-kit\";\n\n/**\n * Serialize a ConnectedDevice to a plain object for JSON transmission.\n */\nexport function serializeConnectedDevice(\n device: ConnectedDevice,\n): ConnectedDevice {\n return JSON.parse(JSON.stringify(device)) as ConnectedDevice;\n}\n\n/**\n * Serialize a DeviceSessionState to a plain object for JSON transmission.\n * Converts enum values to their string names for readability.\n */\nexport function serializeDeviceSessionState(\n state: DeviceSessionState,\n): DeviceSessionState {\n const serialized = JSON.parse(JSON.stringify(state)) as Record<\n string,\n unknown\n >;\n // Convert enum to string name for readability\n serialized[\"sessionStateType\"] =\n DeviceSessionStateType[state.sessionStateType];\n return serialized as DeviceSessionState;\n}\n\n/**\n * Serialize a DiscoveredDevice to a plain object for JSON transmission.\n */\nexport function serializeDiscoveredDevice(\n device: DiscoveredDevice,\n): DiscoveredDevice {\n return JSON.parse(JSON.stringify(device)) as DiscoveredDevice;\n}\n"],
5
+ "mappings": "AAAA,OAGE,0BAAAA,MAEK,kCAKA,SAASC,EACdC,EACiB,CACjB,OAAO,KAAK,MAAM,KAAK,UAAUA,CAAM,CAAC,CAC1C,CAMO,SAASC,EACdC,EACoB,CACpB,MAAMC,EAAa,KAAK,MAAM,KAAK,UAAUD,CAAK,CAAC,EAKnD,OAAAC,EAAW,iBACTL,EAAuBI,EAAM,gBAAgB,EACxCC,CACT,CAKO,SAASC,EACdJ,EACkB,CAClB,OAAO,KAAK,MAAM,KAAK,UAAUA,CAAM,CAAC,CAC1C",
6
+ "names": ["DeviceSessionStateType", "serializeConnectedDevice", "device", "serializeDeviceSessionState", "state", "serialized", "serializeDiscoveredDevice"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=DevToolsLog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{DEVTOOLS_MODULES as r,MODULE_CONNECTED_MESSAGE_TYPE as e}from"../modules";import{LOGGER_MESSAGE_TYPES as t}from"./constants";import{mapDmkLogToDevToolsLog as s}from"./mapDmkLogToDevToolsLog";class g{constructor(o){this.connector=o;this.connector.sendMessage(e,JSON.stringify({module:r.LOGGER}))}log(...o){this.connector.sendMessage(t.ADD_LOG,JSON.stringify(s(o)))}}export{g as DevToolsLogger};
2
+ //# sourceMappingURL=DevToolsLogger.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/DevToolsLogger.ts"],
4
+ "sourcesContent": ["import {\n type LoggerSubscriberService,\n type LogParams,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { DEVTOOLS_MODULES, MODULE_CONNECTED_MESSAGE_TYPE } from \"../modules\";\nimport { type Connector } from \"../types\";\nimport { LOGGER_MESSAGE_TYPES } from \"./constants\";\nimport { mapDmkLogToDevToolsLog } from \"./mapDmkLogToDevToolsLog\";\n\nexport class DevToolsLogger implements LoggerSubscriberService {\n constructor(private readonly connector: Connector) {\n // Send handshake to identify this module to the dashboard\n this.connector.sendMessage(\n MODULE_CONNECTED_MESSAGE_TYPE,\n JSON.stringify({ module: DEVTOOLS_MODULES.LOGGER }),\n );\n }\n\n log(...logParams: LogParams): void {\n this.connector.sendMessage(\n LOGGER_MESSAGE_TYPES.ADD_LOG,\n JSON.stringify(mapDmkLogToDevToolsLog(logParams)),\n );\n }\n}\n"],
5
+ "mappings": "AAKA,OAAS,oBAAAA,EAAkB,iCAAAC,MAAqC,aAEhE,OAAS,wBAAAC,MAA4B,cACrC,OAAS,0BAAAC,MAA8B,2BAEhC,MAAMC,CAAkD,CAC7D,YAA6BC,EAAsB,CAAtB,eAAAA,EAE3B,KAAK,UAAU,YACbJ,EACA,KAAK,UAAU,CAAE,OAAQD,EAAiB,MAAO,CAAC,CACpD,CACF,CAEA,OAAOM,EAA4B,CACjC,KAAK,UAAU,YACbJ,EAAqB,QACrB,KAAK,UAAUC,EAAuBG,CAAS,CAAC,CAClD,CACF,CACF",
6
+ "names": ["DEVTOOLS_MODULES", "MODULE_CONNECTED_MESSAGE_TYPE", "LOGGER_MESSAGE_TYPES", "mapDmkLogToDevToolsLog", "DevToolsLogger", "connector", "logParams"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const o={ADD_LOG:"addLog"};export{o as LOGGER_MESSAGE_TYPES};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/constants.ts"],
4
+ "sourcesContent": ["/**\n * Message types sent from logger to dashboard\n */\nexport const LOGGER_MESSAGE_TYPES = {\n /** A new log entry */\n ADD_LOG: \"addLog\",\n} as const;\n"],
5
+ "mappings": "AAGO,MAAMA,EAAuB,CAElC,QAAS,QACX",
6
+ "names": ["LOGGER_MESSAGE_TYPES"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{LogLevel as o}from"@ledgerhq/device-management-kit";function l(r){const[a,s,e]=r,g={[o.Debug]:"debug",[o.Info]:"info",[o.Warning]:"warning",[o.Error]:"error",[o.Fatal]:"fatal"};let t="";try{t=JSON.stringify(e.data||{},null)}catch(i){console.error("Failed to stringify log data",i)}return{timestamp:new Date(e.timestamp).toISOString(),tag:e.tag,message:s,verbosity:g[a],payloadJSON:t}}export{l as mapDmkLogToDevToolsLog};
2
+ //# sourceMappingURL=mapDmkLogToDevToolsLog.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/logger/mapDmkLogToDevToolsLog.ts"],
4
+ "sourcesContent": ["import { LogLevel, type LogParams } from \"@ledgerhq/device-management-kit\";\n\nimport { type DevToolsLog } from \"./DevToolsLog\";\n\nexport function mapDmkLogToDevToolsLog(dmkLog: LogParams): DevToolsLog {\n const [level, message, options] = dmkLog;\n\n const verbosities: Record<LogLevel, DevToolsLog[\"verbosity\"]> = {\n [LogLevel.Debug]: \"debug\",\n [LogLevel.Info]: \"info\",\n [LogLevel.Warning]: \"warning\",\n [LogLevel.Error]: \"error\",\n [LogLevel.Fatal]: \"fatal\",\n };\n\n let payloadJSON = \"\";\n try {\n payloadJSON = JSON.stringify(options.data || {}, null);\n } catch (e) {\n console.error(\"Failed to stringify log data\", e);\n }\n\n return {\n timestamp: new Date(options.timestamp).toISOString(),\n tag: options.tag,\n message: message,\n verbosity: verbosities[level],\n payloadJSON,\n };\n}\n"],
5
+ "mappings": "AAAA,OAAS,YAAAA,MAAgC,kCAIlC,SAASC,EAAuBC,EAAgC,CACrE,KAAM,CAACC,EAAOC,EAASC,CAAO,EAAIH,EAE5BI,EAA0D,CAC9D,CAACN,EAAS,KAAK,EAAG,QAClB,CAACA,EAAS,IAAI,EAAG,OACjB,CAACA,EAAS,OAAO,EAAG,UACpB,CAACA,EAAS,KAAK,EAAG,QAClB,CAACA,EAAS,KAAK,EAAG,OACpB,EAEA,IAAIO,EAAc,GAClB,GAAI,CACFA,EAAc,KAAK,UAAUF,EAAQ,MAAQ,CAAC,EAAG,IAAI,CACvD,OAASG,EAAG,CACV,QAAQ,MAAM,+BAAgCA,CAAC,CACjD,CAEA,MAAO,CACL,UAAW,IAAI,KAAKH,EAAQ,SAAS,EAAE,YAAY,EACnD,IAAKA,EAAQ,IACb,QAASD,EACT,UAAWE,EAAYH,CAAK,EAC5B,YAAAI,CACF,CACF",
6
+ "names": ["LogLevel", "mapDmkLogToDevToolsLog", "dmkLog", "level", "message", "options", "verbosities", "payloadJSON", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const o={LOGGER:"logger",DMK_INSPECTOR:"dmk-inspector"},e="moduleConnected";export{o as DEVTOOLS_MODULES,e as MODULE_CONNECTED_MESSAGE_TYPE};
2
+ //# sourceMappingURL=modules.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/modules.ts"],
4
+ "sourcesContent": ["/**\n * Module identifiers for devtools handshake.\n * Used by both client modules and dashboard UI to track which modules are connected.\n */\nexport const DEVTOOLS_MODULES = {\n LOGGER: \"logger\",\n DMK_INSPECTOR: \"dmk-inspector\",\n} as const;\n\nexport type DevToolsModule =\n (typeof DEVTOOLS_MODULES)[keyof typeof DEVTOOLS_MODULES];\n\n/**\n * Message type for module connection handshake.\n */\nexport const MODULE_CONNECTED_MESSAGE_TYPE = \"moduleConnected\";\n"],
5
+ "mappings": "AAIO,MAAMA,EAAmB,CAC9B,OAAQ,SACR,cAAe,eACjB,EAQaC,EAAgC",
6
+ "names": ["DEVTOOLS_MODULES", "MODULE_CONNECTED_MESSAGE_TYPE"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./src";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { type CommandHandlerContext } from "./inspector/commandHandlers";
2
+ export { INSPECTOR_COMMAND_TYPES, INSPECTOR_MESSAGE_TYPES, } from "./inspector/constants";
3
+ export { DevToolsDmkInspector } from "./inspector/DevToolsDmkInspector";
4
+ export { serializeConnectedDevice, serializeDeviceSessionState, serializeDiscoveredDevice, } from "./inspector/serialization";
5
+ export { LOGGER_MESSAGE_TYPES } from "./logger/constants";
6
+ export { type DevToolsLog } from "./logger/DevToolsLog";
7
+ export { DevToolsLogger } from "./logger/DevToolsLogger";
8
+ export { DEVTOOLS_MODULES, type DevToolsModule, MODULE_CONNECTED_MESSAGE_TYPE, } from "./modules";
9
+ export { type Connector } from "./types";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EACL,gBAAgB,EAChB,KAAK,cAAc,EACnB,6BAA6B,GAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type DeviceManagementKit } from "@ledgerhq/device-management-kit";
2
+ import { type Connector } from "../types";
3
+ /**
4
+ * DevToolsDmkInspector enables the devtools dashboard to inspect and interact
5
+ * with the Device Management Kit.
6
+ *
7
+ * Features:
8
+ * - Device sessions: list connected devices, observe session states
9
+ * - Actions: disconnect sessions, send APDUs
10
+ * - Configuration: get/set provider
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const connector = DevToolsWebSocketConnector.getInstance().connect({ url });
15
+ * const dmk = new DeviceManagementKitBuilder().build();
16
+ *
17
+ * // Enable inspector after DMK is built
18
+ * const inspector = new DevToolsDmkInspector(connector, dmk);
19
+ *
20
+ * // Clean up when done
21
+ * inspector.destroy();
22
+ * ```
23
+ */
24
+ export declare class DevToolsDmkInspector {
25
+ private readonly ctx;
26
+ private readonly destroyDeviceObserver;
27
+ private readonly discoveryHandler;
28
+ private commandListenerUnsubscribe;
29
+ constructor(connector: Connector, dmk: DeviceManagementKit);
30
+ /**
31
+ * Clean up subscriptions and listeners.
32
+ */
33
+ destroy(): void;
34
+ /**
35
+ * Listen for commands from the dashboard.
36
+ */
37
+ private setupCommandListener;
38
+ }
39
+ //# sourceMappingURL=DevToolsDmkInspector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevToolsDmkInspector.d.ts","sourceRoot":"","sources":["../../../../src/inspector/DevToolsDmkInspector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAa1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwB;IAC5C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,0BAA0B,CAA6B;gBAEnD,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB;IAmB1D;;OAEG;IACH,OAAO,IAAI,IAAI;IAUf;;OAEG;IACH,OAAO,CAAC,oBAAoB;CA+C7B"}