@mudlet/mudlet-web 0.4.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/analytics.d.ts +27 -0
  3. package/dist-lib/assets/fonts/Vera.woff2 +0 -0
  4. package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
  5. package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
  6. package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
  7. package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
  8. package/dist-lib/backupImport-wt8r7JXI.js +233 -0
  9. package/dist-lib/branding.d.ts +111 -13
  10. package/dist-lib/db/sqliteClient.d.ts +195 -7
  11. package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
  12. package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
  13. package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
  14. package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
  15. package/dist-lib/import/applyMudletProfile.d.ts +35 -9
  16. package/dist-lib/import/backupImport.d.ts +118 -0
  17. package/dist-lib/import/collectProfileExport.d.ts +33 -2
  18. package/dist-lib/import/defaultPackages.d.ts +57 -14
  19. package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
  20. package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
  21. package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
  22. package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
  23. package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
  24. package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
  25. package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
  26. package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
  27. package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
  28. package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
  29. package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
  30. package/dist-lib/import/mudletControlChars.d.ts +14 -0
  31. package/dist-lib/import/mudletHost.d.ts +73 -10
  32. package/dist-lib/import/mudletLink.d.ts +53 -2
  33. package/dist-lib/import/mudletProfileExport.d.ts +38 -5
  34. package/dist-lib/import/mudletProfileImport.d.ts +110 -12
  35. package/dist-lib/import/mudletVariables.d.ts +4 -3
  36. package/dist-lib/import/mudletWriteback.d.ts +15 -1
  37. package/dist-lib/import/mudletXmlImport.d.ts +46 -0
  38. package/dist-lib/import/packageFonts.d.ts +33 -0
  39. package/dist-lib/import/packageInstaller.d.ts +111 -7
  40. package/dist-lib/import/qtProfileData.d.ts +10 -0
  41. package/dist-lib/import/remotePackageInstall.d.ts +23 -7
  42. package/dist-lib/import/zipEntries.d.ts +45 -0
  43. package/dist-lib/index.d.ts +7 -3
  44. package/dist-lib/index.js +50660 -29735
  45. package/dist-lib/logging/SessionLogger.d.ts +75 -15
  46. package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
  47. package/dist-lib/map/MapStore.d.ts +432 -59
  48. package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
  49. package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
  50. package/dist-lib/map/areaGraph.d.ts +120 -0
  51. package/dist-lib/map/environmentKit.d.ts +36 -0
  52. package/dist-lib/map/labelPixmap.d.ts +90 -0
  53. package/dist-lib/map/mapImageExport.d.ts +36 -2
  54. package/dist-lib/map/mapStyle.d.ts +11 -0
  55. package/dist-lib/map/mapVersion.d.ts +66 -0
  56. package/dist-lib/map/pathfinding.d.ts +2 -2
  57. package/dist-lib/mud/CharLoginController.d.ts +230 -0
  58. package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
  59. package/dist-lib/mud/MudSession.d.ts +279 -22
  60. package/dist-lib/mud/PatternEngine.d.ts +153 -14
  61. package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
  62. package/dist-lib/mud/autoLogin.d.ts +59 -0
  63. package/dist-lib/mud/commandSplit.d.ts +9 -0
  64. package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
  65. package/dist-lib/mud/connection/MudClient.d.ts +291 -53
  66. package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
  67. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
  68. package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
  69. package/dist-lib/mud/events.d.ts +102 -23
  70. package/dist-lib/mud/games/bundledGames.d.ts +12 -7
  71. package/dist-lib/mud/games/gameLinks.d.ts +40 -0
  72. package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
  73. package/dist-lib/mud/games/icons/3Scapes.png +0 -0
  74. package/dist-lib/mud/games/icons/achaea.png +0 -0
  75. package/dist-lib/mud/games/icons/aetolia.png +0 -0
  76. package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
  77. package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
  78. package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
  79. package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
  80. package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
  81. package/dist-lib/mud/games/icons/blackmud.png +0 -0
  82. package/dist-lib/mud/games/icons/carrionfields.png +0 -0
  83. package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
  84. package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
  85. package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
  86. package/dist-lib/mud/games/icons/imperian.png +0 -0
  87. package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
  88. package/dist-lib/mud/games/icons/lusternia.png +0 -0
  89. package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
  90. package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
  91. package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
  92. package/dist-lib/mud/games/icons/starmourn.png +0 -0
  93. package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
  94. package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
  95. package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
  96. package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
  97. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
  98. package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
  99. package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
  100. package/dist-lib/mud/protocol/atcp.d.ts +19 -0
  101. package/dist-lib/mud/protocol/byteString.d.ts +24 -0
  102. package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
  103. package/dist-lib/mud/protocol/charset.d.ts +111 -46
  104. package/dist-lib/mud/protocol/codePages.d.ts +10 -0
  105. package/dist-lib/mud/protocol/constants.d.ts +17 -10
  106. package/dist-lib/mud/protocol/echo.d.ts +23 -27
  107. package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
  108. package/dist-lib/mud/protocol/index.d.ts +3 -2
  109. package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
  110. package/dist-lib/mud/protocol/mccp.d.ts +83 -1
  111. package/dist-lib/mud/protocol/mnes.d.ts +41 -58
  112. package/dist-lib/mud/protocol/msdp.d.ts +11 -4
  113. package/dist-lib/mud/protocol/msp.d.ts +3 -2
  114. package/dist-lib/mud/protocol/mssp.d.ts +9 -4
  115. package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
  116. package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
  117. package/dist-lib/mud/protocol/mxp.d.ts +193 -14
  118. package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
  119. package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
  120. package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
  121. package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
  122. package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
  123. package/dist-lib/mud/text/Console.d.ts +255 -49
  124. package/dist-lib/mud/text/FormatState.d.ts +137 -14
  125. package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
  126. package/dist-lib/mud/text/colorParsers.d.ts +14 -2
  127. package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
  128. package/dist-lib/mud/text/colors.d.ts +17 -10
  129. package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
  130. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
  131. package/dist-lib/mud/text/lineBreak.d.ts +5 -0
  132. package/dist-lib/mud/text/serverWrap.d.ts +2 -2
  133. package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
  134. package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
  135. package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
  136. package/dist-lib/mud/text/wcwidth.d.ts +27 -22
  137. package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
  138. package/dist-lib/mud/timers/workerClock.d.ts +67 -0
  139. package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
  140. package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
  141. package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
  142. package/dist-lib/oauth-callback.html +94 -0
  143. package/dist-lib/pcre2Wasm.d.ts +54 -0
  144. package/dist-lib/pcre2Wasm.js +241 -0
  145. package/dist-lib/scripting/EngineHost.d.ts +54 -21
  146. package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
  147. package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
  148. package/dist-lib/scripting/ScriptingAPI.d.ts +1039 -213
  149. package/dist-lib/scripting/ScriptingEngine.d.ts +753 -103
  150. package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
  151. package/dist-lib/scripting/http/HttpService.d.ts +9 -1
  152. package/dist-lib/scripting/http/userUrl.d.ts +41 -0
  153. package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
  154. package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
  155. package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
  156. package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
  157. package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
  158. package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
  159. package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
  160. package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
  161. package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
  162. package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
  163. package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
  164. package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
  165. package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
  166. package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
  167. package/dist-lib/scripting/lua/rex.d.ts +4 -2
  168. package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
  169. package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
  170. package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
  171. package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
  172. package/dist-lib/scripting/lua/yajl.d.ts +43 -5
  173. package/dist-lib/scripting/profilesPresence.d.ts +20 -2
  174. package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
  175. package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
  176. package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
  177. package/dist-lib/storage/appStore.d.ts +24 -9
  178. package/dist-lib/storage/hooks.d.ts +5 -1
  179. package/dist-lib/storage/index.d.ts +2 -2
  180. package/dist-lib/storage/mapStorage.d.ts +2 -0
  181. package/dist-lib/storage/persistentStorage.d.ts +3 -1
  182. package/dist-lib/storage/profileStorage.d.ts +15 -0
  183. package/dist-lib/storage/profileVfsData.d.ts +3 -3
  184. package/dist-lib/storage/schema.d.ts +521 -44
  185. package/dist-lib/storage/storageMigration.d.ts +82 -0
  186. package/dist-lib/storage-g5V1b-c1.js +2039 -0
  187. package/dist-lib/styles.css +1 -1
  188. package/dist-lib/ui/AboutModal.d.ts +1 -1
  189. package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
  190. package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
  191. package/dist-lib/ui/CharLoginModal.d.ts +24 -15
  192. package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
  193. package/dist-lib/ui/CommandBar.d.ts +8 -8
  194. package/dist-lib/ui/ConnectionFormModal.d.ts +25 -1
  195. package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
  196. package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
  197. package/dist-lib/ui/HelpModal.d.ts +5 -1
  198. package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
  199. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
  200. package/dist-lib/ui/NotepadModal.d.ts +22 -0
  201. package/dist-lib/ui/ResizableModal.d.ts +16 -1
  202. package/dist-lib/ui/SettingsModal.d.ts +10 -1
  203. package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
  204. package/dist-lib/ui/Toolbar.d.ts +22 -1
  205. package/dist-lib/ui/VaultManageButton.d.ts +20 -0
  206. package/dist-lib/ui/VaultModal.d.ts +5 -0
  207. package/dist-lib/ui/VaultUnlockPrompt.d.ts +15 -0
  208. package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
  209. package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
  210. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
  211. package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
  212. package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
  213. package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
  214. package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
  215. package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
  216. package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
  217. package/dist-lib/ui/codemirror/options.d.ts +33 -0
  218. package/dist-lib/ui/codemirror/theme.d.ts +29 -5
  219. package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
  220. package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
  221. package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
  222. package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
  223. package/dist-lib/ui/commands/keySequence.d.ts +57 -0
  224. package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
  225. package/dist-lib/ui/components/FontPicker.d.ts +5 -1
  226. package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
  227. package/dist-lib/ui/helpTopics.d.ts +15 -0
  228. package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
  229. package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
  230. package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
  231. package/dist-lib/ui/labels/labelModel.d.ts +64 -0
  232. package/dist-lib/ui/labels/qColor.d.ts +13 -0
  233. package/dist-lib/ui/labels/qtCss.d.ts +12 -4
  234. package/dist-lib/ui/landmarks.d.ts +9 -0
  235. package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
  236. package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
  237. package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
  238. package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
  239. package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
  240. package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
  241. package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
  242. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
  243. package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
  244. package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
  245. package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
  246. package/dist-lib/ui/menu/appMenus.d.ts +65 -0
  247. package/dist-lib/ui/menu/menuModel.d.ts +88 -0
  248. package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
  249. package/dist-lib/ui/notepad.d.ts +76 -0
  250. package/dist-lib/ui/openSignInPage.d.ts +14 -0
  251. package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
  252. package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
  253. package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
  254. package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
  255. package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
  256. package/dist-lib/ui/output/caretMode.d.ts +3 -2
  257. package/dist-lib/ui/output/clearSplit.d.ts +11 -0
  258. package/dist-lib/ui/output/outputCopy.d.ts +41 -2
  259. package/dist-lib/ui/output/outputRows.d.ts +43 -0
  260. package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
  261. package/dist-lib/ui/output/wordSelection.d.ts +33 -0
  262. package/dist-lib/ui/search/matcher.d.ts +14 -4
  263. package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
  264. package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
  265. package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
  266. package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
  267. package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
  268. package/dist-lib/ui/tabCompletion.d.ts +53 -0
  269. package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
  270. package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
  271. package/dist-lib/ui/useVaultSaver.d.ts +26 -0
  272. package/dist-lib/ui/video/VideoManager.d.ts +7 -0
  273. package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
  274. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
  275. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
  276. package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
  277. package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
  278. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
  279. package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
  280. package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
  281. package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
  282. package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
  283. package/dist-lib/utils/appShellCache.d.ts +25 -0
  284. package/dist-lib/utils/fontFamilyName.d.ts +13 -0
  285. package/dist-lib/utils/fontLoader.d.ts +31 -0
  286. package/dist-lib/utils/formatBytes.d.ts +4 -0
  287. package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
  288. package/dist-lib/utils/profileLock.d.ts +1 -1
  289. package/dist-lib/utils/storedCredentials.d.ts +31 -0
  290. package/dist-lib/utils/systemTheme.d.ts +24 -0
  291. package/dist-lib/utils/timeZone.d.ts +10 -0
  292. package/dist-lib/vault/CredentialVault.d.ts +197 -0
  293. package/dist-lib/vault/deviceUnlock.d.ts +47 -0
  294. package/dist-lib/vault/passkeyPrf.d.ts +56 -0
  295. package/dist-lib/vault/useVault.d.ts +8 -0
  296. package/dist-lib/vault/vaultAccess.d.ts +80 -0
  297. package/dist-lib/vault/vaultCrypto.d.ts +56 -0
  298. package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
  299. package/dist-lib/vault/vaultRecord.d.ts +92 -0
  300. package/dist-lib/vfs-sw.js +220 -11
  301. package/dist-lib/vite.d.ts +1 -1
  302. package/dist-lib/vite.js +66 -43
  303. package/package.json +22 -14
  304. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
  305. package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
  306. package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
  307. package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
  308. package/dist-lib/ui/bufferWords.d.ts +0 -38
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The client-driven GMCP `Char.Login` v2 OAuth flow, for a browser.
3
+ *
4
+ * Port of Mudlet's `OAuthClientFlow` (development branch). When the game is its
5
+ * own OpenID Provider it advertises a discovery document and a `client_id`; we
6
+ * fetch the document, build the provider's authorization URL with a PKCE (S256)
7
+ * challenge, wait for the provider to redirect back with an authorization code,
8
+ * and hand `{code, code_verifier, redirect_uri, nonce}` to the caller, which
9
+ * sends it to the game as `Char.Login.AuthCode`. The token exchange itself stays
10
+ * on the game server.
11
+ *
12
+ * **The redirect is where a browser has to differ.** Desktop Mudlet listens on
13
+ * `http://127.0.0.1:<random port>/` — an RFC 8252 loopback redirect, which a
14
+ * provider registers once and accepts on any port. A web page cannot listen on a
15
+ * socket, so our redirect is a real page on our own origin,
16
+ * `oauth-callback.html` beside the app (or a branded build's
17
+ * `oauthRedirectUrl`). The game's provider has to have registered that address
18
+ * for its `client_id`, next to Mudlet's loopback one. The page reports the
19
+ * provider's answer over a same-origin `BroadcastChannel`, which works whether
20
+ * the sign-in ran in a popup, a tab or a tab the player opened by hand, and
21
+ * survives a provider that severs `window.opener` with COOP.
22
+ *
23
+ * Opening the authorization URL is the caller's job — a browser only lets a
24
+ * page open one from a user gesture, so it becomes a button — exactly as
25
+ * Mudlet leaves launching the browser to `GMCPAuthenticator`.
26
+ */
27
+ /** One deadline covers the whole flow — discovery, the player's sign-in, the
28
+ * redirect — so an abandoned attempt cannot keep listening for ever. */
29
+ export declare const OAUTH_FLOW_TIMEOUT_MS: number;
30
+ /** The channel `oauth-callback.html` reports on. Keep in step with that page. */
31
+ export declare const OAUTH_CALLBACK_CHANNEL = "mudlet-web-oauth";
32
+ /** What `oauth-callback.html` posts: the redirect's parameters, verbatim. */
33
+ export interface OAuthCallbackMessage {
34
+ type: 'callback';
35
+ state?: string;
36
+ code?: string;
37
+ error?: string;
38
+ }
39
+ /** What the app answers so the page can tell the player how it went. */
40
+ export interface OAuthCallbackAck {
41
+ type: 'ack';
42
+ state: string;
43
+ ok: boolean;
44
+ }
45
+ /** 32 random bytes, base64url without padding: a 43-character verifier, the
46
+ * RFC 7636 minimum, from the required unreserved character set. */
47
+ export declare function generateCodeVerifier(): string;
48
+ /** RFC 7636 S256: base64url(SHA-256(ASCII(verifier))). */
49
+ export declare function codeChallengeS256(codeVerifier: string): Promise<string>;
50
+ /**
51
+ * OAuth endpoints must be https; plain http is permitted solely for loopback
52
+ * hosts, so self-hosted and test setups work without certificates. Mudlet's
53
+ * `acceptableEndpointUrl`.
54
+ */
55
+ export declare function acceptableEndpointUrl(raw: string): boolean;
56
+ export declare function buildAuthorizationUrl(authorizationEndpoint: string, clientId: string, scopes: string[], redirectUri: string, state: string, codeChallenge: string, nonce?: string): string;
57
+ /**
58
+ * The redirect URI this build asks providers to send the player back to: a
59
+ * branded build's `oauthRedirectUrl`, else `oauth-callback.html` beside the
60
+ * app. It must be same-origin with the app — the callback reports over a
61
+ * same-origin `BroadcastChannel` — and is what each game's provider has to
62
+ * register for its `client_id`.
63
+ */
64
+ export declare function defaultOAuthRedirectUri(): string | null;
65
+ /** Whether this page can run the flow at all: WebCrypto (a secure context) for
66
+ * PKCE, and `BroadcastChannel` to hear the callback. */
67
+ export declare function clientOAuthSupported(): boolean;
68
+ /** What a successful flow hands back — exactly the `Char.Login.AuthCode` body,
69
+ * less the common fields. */
70
+ export interface OAuthAuthorization {
71
+ code: string;
72
+ codeVerifier: string;
73
+ redirectUri: string;
74
+ nonce?: string;
75
+ }
76
+ /**
77
+ * Which half failed. `setup` is everything before the player is involved —
78
+ * discovery (commonly a provider that serves its discovery document without
79
+ * CORS headers, which only a browser trips over), a bad endpoint — and the
80
+ * caller can still fall back to the game's own sign-in. `signin` is the player's
81
+ * attempt itself: the provider refused, the state did not match, or it timed
82
+ * out.
83
+ */
84
+ export type OAuthFailureStage = 'setup' | 'signin';
85
+ /** The slice of BroadcastChannel the flow uses; injectable for tests. */
86
+ export interface OAuthChannel {
87
+ onmessage: ((ev: MessageEvent) => void) | null;
88
+ postMessage(message: unknown): void;
89
+ close(): void;
90
+ }
91
+ export interface OAuthClientFlowOptions {
92
+ discoveryUrl: string;
93
+ clientId: string;
94
+ scopes: string[];
95
+ nonceRequired: boolean;
96
+ redirectUri: string;
97
+ onAuthorizationUrl: (url: string) => void;
98
+ onCaptured: (authorization: OAuthAuthorization) => void;
99
+ onFailed: (logDetail: string, stage: OAuthFailureStage) => void;
100
+ fetch?: typeof fetch;
101
+ openChannel?: (name: string) => OAuthChannel;
102
+ timeoutMs?: number;
103
+ }
104
+ /**
105
+ * Single-use: create a fresh flow for each sign-in attempt. Reaches exactly one
106
+ * terminal outcome — captured, failed or aborted — after which every late
107
+ * callback, timer or message is ignored.
108
+ */
109
+ export declare class OAuthClientFlow {
110
+ private readonly opts;
111
+ private started;
112
+ private completed;
113
+ private channel;
114
+ private timer;
115
+ private abortController;
116
+ private codeVerifier;
117
+ private state;
118
+ private nonce;
119
+ constructor(opts: OAuthClientFlowOptions);
120
+ get done(): boolean;
121
+ start(): void;
122
+ abort(): void;
123
+ private discover;
124
+ private handleCallback;
125
+ private ack;
126
+ private fail;
127
+ private cleanup;
128
+ }
@@ -0,0 +1 @@
1
+ export declare const QT_CODE_PAGES: Readonly<Record<string, string>>;
@@ -1,4 +1,41 @@
1
1
  export declare function describeCertCode(code: string): string;
2
- /** Which of Mudlet's three tolerance checkboxes would clear a given fault.
3
- * `all` means only "accept all certificate errors" covers it. */
4
- export declare function toleranceForCode(code: string): 'expired' | 'selfSigned' | 'all';
2
+ export declare function isCertificateFault(code: string): boolean;
3
+ /** Which of Mudlet's three tolerance checkboxes would clear a given fault, or
4
+ * null when no checkbox can — the fault is not about a certificate. */
5
+ export declare function toleranceForCode(code: string): 'expired' | 'selfSigned' | 'all' | null;
6
+ /** What the UI needs to know about a failed handshake, in prose. */
7
+ export interface TlsFailureExplanation {
8
+ /** What went wrong, as one sentence. */
9
+ summary: string;
10
+ /** What to do about it, or null when nothing honest can be suggested.
11
+ * Never names a control that isn't rendered. */
12
+ remedy: string | null;
13
+ /** True when the fault is about the peer's certificate at all. */
14
+ certificateFault: boolean;
15
+ }
16
+ /**
17
+ * Turn a `tls.error` into a diagnosis and a remedy that exists.
18
+ *
19
+ * Both used to be composed from the certificate vocabulary regardless of what
20
+ * failed: connecting with TLS to a plaintext port was reported as a certificate
21
+ * refusal and the user was told to tick "Accept all certificate errors" in
22
+ * Settings → Network — a control that is not rendered on the default
23
+ * Cloudflare-Worker proxy (`proxyCanInspectCertificates` is false for it and
24
+ * for every `*.workers.dev` host, so that panel says "Certificate options
25
+ * unavailable" instead), and that would not have helped if it were.
26
+ *
27
+ * Desktop Mudlet reports the underlying socket/SSL error verbatim and only
28
+ * offers the ignore-certificate settings when they apply; its answer to a
29
+ * `QAbstractSocket::SslHandshakeFailedError` is "Secure connections not
30
+ * supported by this game on this port; try turning the option off"
31
+ * (`src/ctelnet.cpp:865`). This is that, phrased for the controls this client
32
+ * actually has.
33
+ */
34
+ export declare function describeTlsFailure(info: {
35
+ code: string;
36
+ message?: string;
37
+ codes?: string[];
38
+ /** False when the proxy runtime cannot inspect certificates at all, and so
39
+ * cannot offer — or render — the tolerance options. */
40
+ certInspection?: boolean;
41
+ }): TlsFailureExplanation;
@@ -9,6 +9,19 @@ export interface ReplayPlayerCallbacks {
9
9
  feed: (data: string) => void;
10
10
  /** Fired once, after the last chunk has been delivered. Not fired on abort. */
11
11
  onDone: () => void;
12
+ /**
13
+ * Reads a chunk again as it comes up, from the file as it is now. Mudlet
14
+ * reads its replay file a chunk at a time while it plays
15
+ * (cTelnet::loadReplayChunk), so the chunks parsed at load time are only
16
+ * what the file held THEN. Returning null says the chunk can no longer be
17
+ * read — a header turned negative or too long — and the replay ends there
18
+ * through {@link onCorrupt}. Left out, the parsed chunks are played as they
19
+ * are (a replay with no file behind it).
20
+ */
21
+ reread?: (chunk: ReplayChunk, index: number) => ReplayChunk | null;
22
+ /** Fired once, instead of onDone, when {@link reread} found a chunk that
23
+ * will not read. Nothing after it is played. */
24
+ onCorrupt?: () => void;
12
25
  }
13
26
  /**
14
27
  * Plays parsed replay chunks back on their recorded timeline: each chunk is
@@ -17,11 +30,13 @@ export interface ReplayPlayerCallbacks {
17
30
  * they did live.
18
31
  */
19
32
  export declare class ReplayPlayer {
20
- private readonly chunks;
21
33
  private readonly callbacks;
22
34
  private timer;
23
35
  private index;
24
36
  private finished;
37
+ /** Our own copy: {@link ReplayPlayerCallbacks.reread} replaces entries as
38
+ * they come up, and the caller's array is not ours to write. */
39
+ private readonly chunks;
25
40
  constructor(chunks: ReplayChunk[], callbacks: ReplayPlayerCallbacks);
26
41
  start(): void;
27
42
  /** Stop playback and drop any pending chunk. Idempotent; onDone is not
@@ -5,7 +5,7 @@
5
5
  * The on-disk layout is a bare sequence of chunk records with no header:
6
6
  *
7
7
  * int32 BE offsetMs milliseconds elapsed since the previous chunk
8
- * int32 BE length payload byte count (1..REPLAY_MAX_CHUNK)
8
+ * int32 BE length payload byte count (0..REPLAY_MAX_CHUNK)
9
9
  * bytes payload the network data verbatim — post-MCCP-decompression,
10
10
  * pre-telnet-parsing, IAC sequences and all
11
11
  *
@@ -21,7 +21,14 @@ export interface ReplayChunk {
21
21
  offsetMs: number;
22
22
  /** Raw telnet bytes as received post-MCCP. */
23
23
  data: Uint8Array;
24
+ /** Byte offset of this chunk's header in the file it was parsed from. Set
25
+ * by {@link parseReplayLayout}, so playback can read the chunk again from
26
+ * disk when it comes due — see readReplayChunkAt. */
27
+ position?: number;
24
28
  }
29
+ /** The width of the delay field: 4 in the original layout, 8 in the PR #4400
30
+ * "modified format". */
31
+ export type ReplayOffsetSize = 4 | 8;
25
32
  /** Mudlet's replay read buffer size (cTelnet BUFFER_SIZE). A record whose
26
33
  * length field exceeds this is treated as corrupt by Mudlet's loader, so the
27
34
  * encoder splits bigger payloads into continuation records (offset 0). */
@@ -35,13 +42,33 @@ export declare function replayBytesToLatin1(bytes: Uint8Array): string;
35
42
  /** Serialize chunks to the original (current-Mudlet) replay format. Payloads
36
43
  * larger than {@link REPLAY_MAX_CHUNK} are split into continuation records
37
44
  * with a 0ms offset so Mudlet itself can read the file back. Empty payloads
38
- * are dropped — Mudlet's loader treats a 0-length record as corruption. */
45
+ * are dropped — there is nothing in them to play. */
39
46
  export declare function encodeReplay(chunks: ReplayChunk[]): Uint8Array;
40
47
  /** Parse a replay file, auto-detecting the original (4-byte offset) vs the
41
48
  * modified (8-byte offset, PR #4400 era) layout the way Mudlet's
42
49
  * testReadReplayFile does: trial-parse original first, fall back to modified.
43
50
  * Returns null when the data is readable as neither — "seems to be corrupt". */
44
51
  export declare function parseReplay(bytes: Uint8Array): ReplayChunk[] | null;
52
+ /** {@link parseReplay}, also saying which layout the file turned out to be in,
53
+ * which is what reading a chunk back from disk at play time needs to know. */
54
+ export declare function parseReplayLayout(bytes: Uint8Array): {
55
+ chunks: ReplayChunk[];
56
+ offsetSize: ReplayOffsetSize;
57
+ } | null;
58
+ /**
59
+ * The chunk whose header starts at `position`, read again from the file as it
60
+ * is NOW — or null when that header has stopped being a usable one.
61
+ *
62
+ * Mudlet vets a replay file once, when it is loaded, and then reads it a chunk
63
+ * at a time as it plays (cTelnet::loadReplayChunk), so a file that changes
64
+ * underneath a running replay is played as it has become — and a chunk header
65
+ * that went bad since is where the replay ends ("seems to be corrupt"), rather
66
+ * than a negative delay arming a timer that never fires and leaves the replay
67
+ * stuck as running. `readAt` reads up to `length` bytes from `position`; a
68
+ * payload cut short by the end of the file is played as far as it goes, as
69
+ * QDataStream::readRawData returns what it got.
70
+ */
71
+ export declare function readReplayChunkAt(readAt: (position: number, length: number) => Uint8Array, position: number, offsetSize: ReplayOffsetSize): ReplayChunk | null;
45
72
  /** Total recorded duration in milliseconds (sum of chunk offsets). */
46
73
  export declare function replayDurationMs(chunks: ReplayChunk[]): number;
47
74
  /** Mudlet-style replay file name for a recording finished at `date`: