@mudlet/mudlet-web 0.5.0 → 1.0.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 (301) 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 +50508 -29836
  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 +387 -60
  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 +45 -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 +1030 -213
  149. package/dist-lib/scripting/ScriptingEngine.d.ts +727 -106
  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 +512 -40
  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/CmdLineMenuRegistry.d.ts +14 -5
  192. package/dist-lib/ui/CommandBar.d.ts +8 -8
  193. package/dist-lib/ui/ConnectionFormModal.d.ts +20 -1
  194. package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
  195. package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
  196. package/dist-lib/ui/HelpModal.d.ts +5 -1
  197. package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
  198. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
  199. package/dist-lib/ui/NotepadModal.d.ts +22 -0
  200. package/dist-lib/ui/ResizableModal.d.ts +16 -1
  201. package/dist-lib/ui/SettingsModal.d.ts +10 -1
  202. package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
  203. package/dist-lib/ui/Toolbar.d.ts +22 -1
  204. package/dist-lib/ui/VaultManageButton.d.ts +10 -5
  205. package/dist-lib/ui/VaultModal.d.ts +3 -0
  206. package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
  207. package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
  208. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
  209. package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
  210. package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
  211. package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
  212. package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
  213. package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
  214. package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
  215. package/dist-lib/ui/codemirror/options.d.ts +33 -0
  216. package/dist-lib/ui/codemirror/theme.d.ts +29 -5
  217. package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
  218. package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
  219. package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
  220. package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
  221. package/dist-lib/ui/commands/keySequence.d.ts +57 -0
  222. package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
  223. package/dist-lib/ui/components/FontPicker.d.ts +5 -1
  224. package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
  225. package/dist-lib/ui/helpTopics.d.ts +15 -0
  226. package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
  227. package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
  228. package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
  229. package/dist-lib/ui/labels/labelModel.d.ts +64 -0
  230. package/dist-lib/ui/labels/qColor.d.ts +13 -0
  231. package/dist-lib/ui/labels/qtCss.d.ts +12 -4
  232. package/dist-lib/ui/landmarks.d.ts +9 -0
  233. package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
  234. package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
  235. package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
  236. package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
  237. package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
  238. package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
  239. package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
  240. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
  241. package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
  242. package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
  243. package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
  244. package/dist-lib/ui/menu/appMenus.d.ts +65 -0
  245. package/dist-lib/ui/menu/menuModel.d.ts +88 -0
  246. package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
  247. package/dist-lib/ui/notepad.d.ts +76 -0
  248. package/dist-lib/ui/openSignInPage.d.ts +14 -0
  249. package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
  250. package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
  251. package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
  252. package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
  253. package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
  254. package/dist-lib/ui/output/caretMode.d.ts +3 -2
  255. package/dist-lib/ui/output/clearSplit.d.ts +11 -0
  256. package/dist-lib/ui/output/outputCopy.d.ts +41 -2
  257. package/dist-lib/ui/output/outputRows.d.ts +43 -0
  258. package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
  259. package/dist-lib/ui/output/wordSelection.d.ts +33 -0
  260. package/dist-lib/ui/search/matcher.d.ts +14 -4
  261. package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
  262. package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
  263. package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
  264. package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
  265. package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
  266. package/dist-lib/ui/tabCompletion.d.ts +53 -0
  267. package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
  268. package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
  269. package/dist-lib/ui/video/VideoManager.d.ts +7 -0
  270. package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
  271. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
  272. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
  273. package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
  274. package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
  275. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
  276. package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
  277. package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
  278. package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
  279. package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
  280. package/dist-lib/utils/appShellCache.d.ts +25 -0
  281. package/dist-lib/utils/fontFamilyName.d.ts +13 -0
  282. package/dist-lib/utils/fontLoader.d.ts +31 -0
  283. package/dist-lib/utils/formatBytes.d.ts +4 -0
  284. package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
  285. package/dist-lib/utils/profileLock.d.ts +1 -1
  286. package/dist-lib/utils/systemTheme.d.ts +24 -0
  287. package/dist-lib/utils/timeZone.d.ts +10 -0
  288. package/dist-lib/vault/CredentialVault.d.ts +51 -5
  289. package/dist-lib/vault/deviceUnlock.d.ts +47 -0
  290. package/dist-lib/vault/vaultAccess.d.ts +24 -2
  291. package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
  292. package/dist-lib/vault/vaultRecord.d.ts +33 -1
  293. package/dist-lib/vfs-sw.js +220 -11
  294. package/dist-lib/vite.d.ts +1 -1
  295. package/dist-lib/vite.js +66 -43
  296. package/package.json +23 -15
  297. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
  298. package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
  299. package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
  300. package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
  301. package/dist-lib/ui/bufferWords.d.ts +0 -38
@@ -1,10 +1,20 @@
1
1
  import React from 'react';
2
+ import type { TriggerPatternType } from '../../../storage/schema';
2
3
  import type { MudSession } from '../../../mud/MudSession';
3
4
  import type { ProfileVFS } from '../../../scripting/vfs/ProfileVFS';
4
5
  import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
5
6
  import './ScriptEditorPanel.css';
6
7
  type Category = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons' | 'packages' | 'errors' | 'variables';
7
8
  type EditCategory = Exclude<Category, 'errors' | 'packages' | 'variables'>;
9
+ /** The `text` a pattern row should carry after its type changes.
10
+ *
11
+ * `colorTrigger` stores `"fg,bg"` and `lineSpacer` stores a line count, so
12
+ * neither can inherit a regex left over from the previous type — and a regex
13
+ * must not inherit `"-1,-1"` or `"2"` either. Mudlet gets this for free by
14
+ * giving each type its own widget (`dlgTriggerEditor.cpp:7196-7239`); here one
15
+ * `text` field is shared, so it is reset explicitly whenever the type crosses
16
+ * into or out of one of the two structured kinds. */
17
+ export declare function retypePatternText(text: string, from: TriggerPatternType, to: TriggerPatternType): string;
8
18
  interface ScriptEditorPanelProps {
9
19
  connectionId: string;
10
20
  session: MudSession;
@@ -19,6 +29,10 @@ export interface ScriptEditorPanelHandle {
19
29
  /** Switch to the item's category, expand its ancestors, select it, and —
20
30
  * when a line is given — move the editor cursor there. */
21
31
  navigateToItem: (category: EditCategory, id: string, line?: number) => void;
32
+ /** Show the Variables tab with its filter set to the named top-level global.
33
+ * Desktop selects the row in its variables tree; filtering is the same job
34
+ * in a view that has no persistent selection. */
35
+ navigateToVariable: (name: string) => void;
22
36
  }
23
37
  export declare const ScriptEditorPanel: React.ForwardRefExoticComponent<ScriptEditorPanelProps & React.RefAttributes<ScriptEditorPanelHandle>>;
24
38
  export {};
@@ -1,12 +1,17 @@
1
+ import React from 'react';
2
+ import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
1
3
  import './ScriptSearch.css';
2
4
  export type EditCategory = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons';
3
5
  interface ScriptSearchProps {
4
6
  connectionId: string;
7
+ scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
5
8
  /** Navigate the editor to a matched item (and optionally a code line). */
6
9
  onNavigate: (category: EditCategory, id: string, line?: number) => void;
10
+ /** Show the Variables tab filtered to the named top-level global. */
11
+ onNavigateVariable?: (name: string) => void;
7
12
  }
8
13
  /** Global search for the Scripts editor — lives in the modal title bar and
9
14
  * drops a VS Code-style results overlay (rendered through a portal so it
10
15
  * escapes the modal's `overflow: hidden`). */
11
- export declare function ScriptSearch({ connectionId, onNavigate }: ScriptSearchProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ScriptSearch({ connectionId, scriptingEngineRef, onNavigate, onNavigateVariable }: ScriptSearchProps): import("react/jsx-runtime").JSX.Element;
12
17
  export {};
@@ -2,6 +2,7 @@ import type { WindowManager } from '../WindowManager';
2
2
  import type { LabelManager } from '../../labels/LabelManager';
3
3
  import type { CommandLineManager } from '../../cmdline/CommandLineManager';
4
4
  import type { ScrollBoxManager } from '../../scrollbox/ScrollBoxManager';
5
+ import { type MouseEventRegistry } from '../../MouseEventRegistry';
5
6
  interface TextPanelProps {
6
7
  id: string;
7
8
  /** Human-readable window title (defaults to the id), used as the accessible
@@ -11,6 +12,8 @@ interface TextPanelProps {
11
12
  labels?: LabelManager;
12
13
  cmdLines?: CommandLineManager;
13
14
  scrollBoxes?: ScrollBoxManager;
15
+ /** addMouseEvent entries, which desktop puts in every console's menu. */
16
+ mouseEvents?: MouseEventRegistry;
14
17
  fontSize?: number;
15
18
  fontFamily?: string;
16
19
  /** Rendered row height in px (MXP frames). See WindowManager.setLineHeight. */
@@ -33,5 +36,5 @@ interface TextPanelProps {
33
36
  cmdLineValue?: string;
34
37
  cmdLineValueSeq?: number;
35
38
  }
36
- export declare function TextPanel({ id, title, manager, labels, cmdLines, scrollBoxes, fontSize, fontFamily, lineHeight, wrapAt, wrapIndent, wrapHangingIndent, backgroundColor, backgroundImage, cmdLineEnabled, cmdLineStyleSheet, cmdLineValue, cmdLineValueSeq }: TextPanelProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function TextPanel({ id, title, manager, labels, cmdLines, scrollBoxes, mouseEvents, fontSize, fontFamily, lineHeight, wrapAt, wrapIndent, wrapHangingIndent, backgroundColor, backgroundImage, cmdLineEnabled, cmdLineStyleSheet, cmdLineValue, cmdLineValueSeq }: TextPanelProps): import("react/jsx-runtime").JSX.Element;
37
40
  export {};
@@ -2,20 +2,50 @@ import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
2
2
  interface VariablesViewProps {
3
3
  connectionId: string;
4
4
  scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
5
+ /** A search result asking for this top-level global to be brought into view.
6
+ * `revision` makes a repeat jump to the same name re-apply the filter. */
7
+ focus?: {
8
+ name: string;
9
+ revision: number;
10
+ } | null;
11
+ /** Called once `focus` has been applied. The request lives in the parent,
12
+ * which outlives this view — without clearing it, leaving the tab and
13
+ * coming back would silently re-type the old name into the filter. */
14
+ onFocusConsumed?: () => void;
5
15
  }
16
+ /**
17
+ * Re-point every hidden path that lived at `from` (or underneath it) at `to`,
18
+ * for a rename. Returns null when nothing referred to the old path, so the
19
+ * caller can skip a no-op store write.
20
+ *
21
+ * A descendant is spelled `from` followed by `.` or `[`, which are the only two
22
+ * separators {@link pathKey} emits — so `myTable` never captures `myTableTwo`.
23
+ */
24
+ export declare function renameHiddenPaths(hidden: readonly string[], from: string, to: string): string[] | null;
25
+ /** Drop every hidden path at `at` or underneath it, for a delete. Returns null
26
+ * when none matched, so the caller can skip a no-op store write. */
27
+ export declare function dropHiddenPaths(hidden: readonly string[], at: string): string[] | null;
6
28
  /**
7
29
  * Mudlet's Variables view: the live `_G` tree with a checkbox per top-level
8
30
  * entry that toggles whether it persists across sessions (the profile's
9
- * save-list / Mudlet `<VariablePackage>`). Built-in globals — the default Lua +
10
- * Mudlet API namespace present at runtime boot — are hidden by default (toggle
11
- * to show), so only your own variables appear. Tables expand to browse their
12
- * contents (fetched eagerly, so expansion is instant). Functions/userdata are
13
- * shown but not flaggable. Save flagging is top-level granularity (checking a
14
- * table persists all of it); per-key flagging is a follow-up.
31
+ * save-list / Mudlet `<VariablePackage>`), and the create/rename/retype/edit/
32
+ * hide/delete controls desktop puts in `vars_main_area.ui` — name
33
+ * (`lineEdit_var_name:73`), key type (`comboBox_variable_key_type:105`), hidden
34
+ * (`checkBox_variable_hidden:142`), value type
35
+ * (`comboBox_variable_value_type:165`), plus `dlgTriggerEditor::addVar`
36
+ * (:5211). Edits go straight into the running `_G`, so a script sees them
37
+ * immediately.
38
+ *
39
+ * Built-in globals — the default Lua + Mudlet API namespace present at runtime
40
+ * boot — are hidden by default (toggle to show), so only your own variables
41
+ * appear. Tables expand to browse their contents (fetched eagerly, so expansion
42
+ * is instant). Functions/userdata are shown but neither flaggable nor editable.
43
+ * Save flagging is top-level granularity (checking a table persists all of it);
44
+ * per-key flagging is a follow-up.
15
45
  *
16
46
  * Enumerating `_G` runs synchronously on the Lua/main thread, so we defer it a
17
47
  * tick behind a loader: the spinner paints first, then the walk runs, keeping
18
48
  * opening the tab responsive even for a large namespace.
19
49
  */
20
- export declare function VariablesView({ connectionId, scriptingEngineRef }: VariablesViewProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function VariablesView({ connectionId, scriptingEngineRef, focus, onFocusConsumed }: VariablesViewProps): import("react/jsx-runtime").JSX.Element;
21
51
  export {};
@@ -16,8 +16,10 @@ interface WindowCmdLineProps {
16
16
  * with WindowManager so getCmdLine([name]) can read the live text.
17
17
  *
18
18
  * Enter dispatches to the bound Lua callback (setCmdLineAction). When no
19
- * callback is bound, Enter is a no-op — userwindow command lines don't
20
- * automatically send to the MUD the way the main command bar does.
19
+ * callback is bound, the text is sent to the game as typed input, the way
20
+ * Mudlet's TCommandLine::enterCommand falls back to Host::send. History, Tab
21
+ * completion, Shift+Enter, Escape and what Enter leaves behind follow desktop's
22
+ * TCommandLine (see useSubCommandLineKeys).
21
23
  */
22
24
  export declare function WindowCmdLine({ id, manager, styleSheet, seedValue, seedSeq }: WindowCmdLineProps): import("react/jsx-runtime").JSX.Element;
23
25
  export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Edit-time detection of the alias that feeds itself: a pattern that matches
3
+ * its own substitution, so sending the command re-triggers the alias.
4
+ *
5
+ * Desktop refuses the save outright — `if (aliasSubstitutionLoops(regex,
6
+ * substitution)) { showAliasLoopWarning(...); return; }`
7
+ * (dlgTriggerEditor.cpp:6174-6178, :15054, :15090), implemented at :6269 as an
8
+ * unanchored match of the pattern against the substitution.
9
+ *
10
+ * Here it only warns. Mudlet Web already stops the damage at runtime — send()
11
+ * refuses past `MAX_SEND_DEPTH` with a message naming the alias — and that
12
+ * guard catches indirect loops (A → B → A) this one cannot see. Refusing the
13
+ * save on top of it would block the direct case while still letting the
14
+ * indirect one through, so the warning is what the runtime guard is missing:
15
+ * feedback before the 25 junk lines rather than after them.
16
+ *
17
+ * The match runs through JS `RegExp`, not PCRE — near enough for a warning, and
18
+ * a pattern that does not compile here produces none, mirroring desktop's
19
+ * `if (!rx.isValid()) return false`.
20
+ */
21
+ export declare function aliasSubstitutionLoops(pattern: string, substitution: string): boolean;
22
+ /** The warning shown beside a looping alias, worded as desktop words it
23
+ * (`showAliasLoopWarning`, dlgTriggerEditor.cpp:6364-6369) minus the refusal. */
24
+ export declare function aliasLoopWarning(name: string): string;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copy / paste / duplicate for editor items.
3
+ *
4
+ * Mudlet round-trips the item and its subtree through XML — `slot_copyXml`
5
+ * (dlgTriggerEditor.cpp:11777) exports it to `mpHost->mpEditorDialog`'s
6
+ * clipboard buffer and `slot_pasteXml` (:11913) imports it back, which is why
7
+ * the paste mints fresh ids there too. Mudlet Web's nodes are plain objects, so the
8
+ * same job is a structured clone with remapped ids; the clipboard is an
9
+ * in-memory snapshot rather than XML text, which keeps it exact (no lossy
10
+ * element set) at the cost of not surviving a page reload — Mudlet's doesn't
11
+ * outlive its editor either.
12
+ */
13
+ import type { EditorItemCategory, EditorItemNode } from './editorUndo';
14
+ export interface EditorClipboard {
15
+ category: EditorItemCategory;
16
+ /** The copied item followed by its descendants, in tree order. */
17
+ nodes: EditorItemNode[];
18
+ /** What the context menu says it will paste, e.g. `trigger "qa-sub"`. */
19
+ label: string;
20
+ }
21
+ /**
22
+ * The item plus every descendant, root first and the rest in `items` order.
23
+ *
24
+ * Root-first matters because {@link cloneSubtree} and the paste placement both
25
+ * treat the first element as the item the user picked. Every producer happens
26
+ * to keep parents ahead of children today, but the walk below explicitly does
27
+ * not rely on that — so neither does this.
28
+ */
29
+ export declare function collectSubtree<T extends {
30
+ id: string;
31
+ parentId: string | null;
32
+ }>(items: readonly T[], rootId: string): T[];
33
+ /**
34
+ * Copy `nodes` (a subtree, root first) under `newParentId` with fresh ids.
35
+ *
36
+ * `packageName` is dropped: uninstalling a package removes every item carrying
37
+ * its name, so a copy that kept the tag would be deleted along with the
38
+ * original the next time that package went away — and the package's own
39
+ * manifest never listed the copy in the first place.
40
+ *
41
+ * `existingNames` are the names already in use among the new siblings; a
42
+ * collision gets a " (copy)" suffix so the paste is visible in the tree rather
43
+ * than looking like nothing happened.
44
+ */
45
+ export declare function cloneSubtree<T extends EditorItemNode>(nodes: readonly T[], newParentId: string | null, existingNames: ReadonlySet<string>, newId?: () => string): T[];
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The script editor's item-level undo stack.
3
+ *
4
+ * Mudlet's editor deletes immediately and never asks; what makes that safe is
5
+ * that every delete path builds an `EditorDeleteItemCommand` and pushes it onto
6
+ * the editor's own `EditorUndoStack` (dlgTriggerEditor.cpp:3714 for triggers,
7
+ * and the same at :3089 aliases, :3237 buttons, :3441 scripts, :3575 keys,
8
+ * :3848 timers), reachable from Ctrl+Z. This is that stack, minus the parts
9
+ * Mudlet only needs because of how it stores items:
10
+ *
11
+ * * Mudlet snapshots each deleted item to XML and re-imports it on undo, which
12
+ * mints fresh ids — hence the id remapping, the `remapItemID` plumbing and
13
+ * the child-id fix-up loops all over `EditorDeleteItemCommand::undo()`.
14
+ * Mudlet Web's nodes are plain objects with stable string ids, so the very same
15
+ * objects go back and none of that is needed.
16
+ * * Mudlet restores parents before children (a topological sort) because a
17
+ * child needs a live parent pointer. Here the tree is a flat array plus
18
+ * `parentId`, so restoring the whole subtree at its recorded indices
19
+ * reproduces it in one step, in any order.
20
+ */
21
+ import type { AliasNode, ButtonNode, KeyNode, ScriptNode, TimerNode, TriggerNode } from '../../../storage/schema';
22
+ import type { RestoredNode } from '../../../storage/appStore';
23
+ /** The six editor views that hold deletable items. Mirrors Mudlet's
24
+ * EditorViewType minus the varUnit view, which has no delete command. */
25
+ export type EditorItemCategory = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons';
26
+ export type EditorItemNode = ScriptNode | AliasNode | TriggerNode | TimerNode | KeyNode | ButtonNode;
27
+ /** Mudlet caps the editor stack at 50 commands (`setUndoLimit(50)`,
28
+ * dlgTriggerEditor.cpp:457). */
29
+ export declare const EDITOR_UNDO_LIMIT = 50;
30
+ /**
31
+ * One reversible edit to the item tree.
32
+ *
33
+ * `delete` and `insert` are the same record read in opposite directions: both
34
+ * hold every node involved plus the index it occupied, so undoing one is
35
+ * redoing the other. Mudlet only ever pushes deletions here, but a paste that
36
+ * cannot be undone makes Ctrl+Z do something unrelated to what the user just
37
+ * did — so pastes and duplicates go on the same stack.
38
+ */
39
+ export interface EditorItemCommand {
40
+ kind: 'delete' | 'insert';
41
+ category: EditorItemCategory;
42
+ /** Every node the command covers — the item and its whole subtree — each
43
+ * with the index it occupied in the category's flat list. */
44
+ entries: ReadonlyArray<RestoredNode<EditorItemNode>>;
45
+ /** Undo-menu wording, e.g. `delete trigger "qa-sub"`. Mirrors
46
+ * `EditorDeleteItemCommand::generateText`. */
47
+ label: string;
48
+ }
49
+ /**
50
+ * The item plus every descendant, paired with the index each occupies in
51
+ * `items` — exactly the set the store's `removeX` actions drop (they take the
52
+ * same `id` + `getDescendantIds` closure), so the capture and the removal can
53
+ * never disagree.
54
+ *
55
+ * Mudlet's `captureTriggerAndChildren` lambda (dlgTriggerEditor.cpp:3616) does
56
+ * the same walk, recording `positionInParent` because its tree is real
57
+ * parent/child widgets. Here sibling order lives in the flat array, so the flat
58
+ * index is the position worth keeping.
59
+ */
60
+ export declare function captureDeletion<T extends {
61
+ id: string;
62
+ parentId: string | null;
63
+ }>(items: readonly T[], id: string): RestoredNode<T>[];
64
+ /** `delete trigger "qa-sub"` / `delete 4 triggers`, following
65
+ * `EditorDeleteItemCommand::generateText` — including its choice to count the
66
+ * captured descendants, not just the item the user picked. */
67
+ export declare function describeDeletion(category: EditorItemCategory, entries: ReadonlyArray<{
68
+ node: {
69
+ name: string;
70
+ };
71
+ }>): string;
72
+ /** The same wording for the other direction — `paste trigger "qa-sub"`. */
73
+ export declare function describeInsertion(category: EditorItemCategory, entries: ReadonlyArray<{
74
+ node: {
75
+ name: string;
76
+ };
77
+ }>): string;
78
+ /** Push onto a stack held at Mudlet's 50-command limit, dropping the oldest. */
79
+ export declare function pushBounded<T>(stack: readonly T[], command: T): T[];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The `sysMapAreaChanged(newAreaID, prevAreaID)` a centerview raises, or null
3
+ * when it raises none.
4
+ *
5
+ * Moving into another area raises it, as does the first centerview since the
6
+ * map widget opened (or its map was replaced) even when the room lies in the
7
+ * area already on show: that area is only the view restored from last time,
8
+ * and desktop reports the first centerview with -2 as the previous area.
9
+ */
10
+ export declare function centerviewAreaChange(first: boolean, prevArea: number | null, areaId: number): [number, number] | null;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Whether this build wants its shell cached at all.
3
+ *
4
+ * Only a built app does. A dev server has no content-hashed assets to cache
5
+ * anyway, and the caching it *could* do — the icons, the manifest, the WASM the
6
+ * plugin serves at the root — is pure cost there: a second copy written on every
7
+ * boot, and a hot-reload hazard for the one file that isn't content-addressed.
8
+ * It is measurable cost, too. The busted corpus boots the whole app 41 times in
9
+ * parallel contexts, and on a four-core CI runner the extra work per boot was
10
+ * enough to push readiness past its 90s timeout.
11
+ *
12
+ * Read at the two edges rather than inside the functions below, so the worker's
13
+ * registration URL and the page's decision to speak to it can't disagree.
14
+ */
15
+ export declare const appShellCacheEnabled: boolean;
16
+ /**
17
+ * Hand the active worker this build's resource list, once the page has settled.
18
+ * Safe to call when there is no worker, no support, or nothing loaded — it is a
19
+ * best-effort optimisation of a cache the worker also fills on its own.
20
+ */
21
+ export declare function primeAppShellCache(): Promise<void>;
22
+ /** How long after load to let stragglers arrive before taking the snapshot.
23
+ * A flat wait rather than an idle callback: the browser counts as idle while a
24
+ * WASM download is still in flight, which is exactly the case this is for. */
25
+ export declare const SETTLE_MS = 5000;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The family name a font file declares, or null when the bytes are not a font
3
+ * this can read.
4
+ *
5
+ * Null is a normal answer, not an error: a package may ship a font in a format
6
+ * with no sfnt wrapper, and the caller's job is then to say so rather than to
7
+ * register the file under a name nothing would ask for.
8
+ */
9
+ export declare function fontFamilyName(bytes: Uint8Array): string | null;
10
+ /** File extensions desktop's `Host::installPackageFonts` picks up
11
+ * (Host.cpp:3513). */
12
+ export declare const FONT_EXTENSIONS: readonly [".otf", ".ttf", ".ttc", ".otc"];
13
+ export declare function isFontPath(path: string): boolean;
@@ -1,5 +1,9 @@
1
1
  import type { ProfileVFS } from '../scripting/vfs/ProfileVFS';
2
2
  import type { OutputFontSource } from '../storage';
3
+ /** Cache-key component for anything that memoises a font measurement. */
4
+ export declare function getFontGeneration(): number;
5
+ /** Note that a family became usable — see `getFontGeneration`. */
6
+ export declare function bumpFontGeneration(): void;
3
7
  /** Synchronous detection. May false-negative on a system font whose face the
4
8
  * browser hasn't materialized yet — use {@link ensureFontAvailable} when an
5
9
  * await is acceptable. */
@@ -53,5 +57,32 @@ export declare function primeLocalFontsCache(): Promise<void>;
53
57
  * forms ("Family Name") are unwrapped to plain names. */
54
58
  export declare function getRegisteredFontFamilies(): string[];
55
59
  export declare function loadFontFromUrl(family: string, url: string): Promise<void>;
60
+ /**
61
+ * Register a font file from the profile VFS under `family`.
62
+ *
63
+ * The face goes into `document.fonts` before this returns — synchronously —
64
+ * and the returned promise settles once the browser has parsed it. That order
65
+ * is what lets a package use its own font in the events its install raises
66
+ * straight after (#438): `getAvailableFonts()` reads `document.fonts`, and
67
+ * desktop's font database has the family the moment `loadFont` returns, so a
68
+ * `setFont` in sysInstallPackage or sysLoadEvent must find it. Text already
69
+ * asking for the family re-renders in it once the face has loaded, as with any
70
+ * web font. A file that will not load is taken out again and the promise
71
+ * rejects.
72
+ */
56
73
  export declare function loadFontFromVfs(family: string, path: string, vfs: ProfileVFS): Promise<void>;
74
+ /**
75
+ * Make a font source drawable, without saying where it is to be drawn.
76
+ *
77
+ * A `system` source is whatever the machine already has, so there is nothing to
78
+ * do; the other two have to be fetched or read out of the profile before the
79
+ * family name means anything. Both underlying loaders are idempotent, so calling
80
+ * this again for a font already registered costs nothing — which is what lets it
81
+ * sit in an effect keyed on the setting.
82
+ *
83
+ * Separate from {@link applyOutputFont} because the map's room-symbol font needs
84
+ * the registration half and not the CSS-variable half: it is handed to a canvas
85
+ * by the renderer, not inherited through the document.
86
+ */
87
+ export declare function registerFontSource(font: OutputFontSource | undefined, vfs: ProfileVFS | null): Promise<void>;
57
88
  export declare function applyOutputFont(font: OutputFontSource | undefined, vfs: ProfileVFS | null): Promise<void>;
@@ -0,0 +1,4 @@
1
+ /** Byte count for a person: "912 B", "48 KB", "3.4 MB". Rounded hard on
2
+ * purpose — these appear next to a control, where the order of magnitude is
3
+ * the whole message and a second decimal place is noise. */
4
+ export declare function formatBytes(n: number): string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The refusal Mudlet gives a value outside a fixed set of words, in the one
3
+ * wording its API settled on: `<what> must be "a", "b" or "c", got "x"` — no
4
+ * function-name prefix, double quotes, no comma before the "or".
5
+ *
6
+ * The Lua twin is `__mudlet_must_be_one_of` in `src/scripting/lua/Bridge.lua`;
7
+ * keep the two in step.
8
+ */
9
+ export declare function mustBeOneOf(what: string, values: readonly string[], got: unknown): string;
@@ -1,5 +1,5 @@
1
1
  /** Shared prefix for every per-profile Web Lock name. */
2
- export declare const PROFILE_LOCK_PREFIX = "mudix:profile:";
2
+ export declare const PROFILE_LOCK_PREFIX = "mudlet:profile:";
3
3
  /** Web Lock name for a profile. */
4
4
  export declare const profileLockName: (connectionId: string) => string;
5
5
  /** Inverse of {@link profileLockName}: the connectionId encoded in a lock name,
@@ -0,0 +1,24 @@
1
+ import type { Theme } from '../storage/schema';
2
+ /** The stored value meaning "whatever the OS is set to". Never reaches
3
+ * `data-theme`; {@link resolveTheme} turns it into a real palette first. */
4
+ export declare const SYSTEM_THEME = "system";
5
+ /** Whether the OS is asking for a dark UI right now. Defaults to dark when
6
+ * nothing can be asked, which is this app's own default. */
7
+ export declare function prefersDark(): boolean;
8
+ /**
9
+ * The concrete palette to render: `theme` itself, unless it is the system
10
+ * sentinel. Safe to call with any stored value, including one from a brand.
11
+ */
12
+ export declare function resolveTheme(theme: Theme | undefined): Theme;
13
+ /** `isLightTheme` through {@link resolveTheme}, for callers holding a stored
14
+ * value rather than a resolved one (the editor's syntax palette). */
15
+ export declare function isLightResolvedTheme(theme: Theme | undefined): boolean;
16
+ /**
17
+ * Call `onChange` whenever the OS preference flips, so a theme left on "System
18
+ * setting" repaints without a reload. Returns an unsubscribe.
19
+ *
20
+ * Subscribed unconditionally rather than only while `system` is selected: the
21
+ * listener is one boolean check, and gating it on the current value would mean
22
+ * re-subscribing every time the theme changes for no saving worth having.
23
+ */
24
+ export declare function onSystemThemeChange(onChange: () => void): () => void;
@@ -0,0 +1,10 @@
1
+ /** Short zone name in effect at `date` ("UTC", "EST", "CET") — what glibc's
2
+ * `%Z` and Qt's `t` format token print. A zone tzdata gives no letters gets
3
+ * its numeric abbreviation ("+03", "+0545"); a time before the zone adopted
4
+ * standard time is its local mean time, "LMT". `timeZone` is an IANA id; the
5
+ * local zone when omitted. */
6
+ export declare function timeZoneAbbreviation(date: Date, timeZone?: string): string;
7
+ export declare function timeZoneLongName(date: Date): string;
8
+ /** The local zone's offset from UTC at `date` as "+hhmm", or "+hh:mm" with
9
+ * `colon` — Qt's `tt` and `ttt`. */
10
+ export declare function timeZoneOffset(date: Date, colon?: boolean): string;
@@ -21,12 +21,15 @@
21
21
  * sync, another user on the machine, an extension trawling localStorage. It does
22
22
  * not defend against script running in the page *while the vault is unlocked* —
23
23
  * no in-page vault can, and neither can a password manager with an open vault.
24
- * The unlocked state is per page load and lives only in memory.
24
+ * The unlocked state is per page load and lives only in memory — unless the
25
+ * player opts into keeping it unlocked on this device (see `deviceUnlock`).
25
26
  *
26
27
  * State changes notify `subscribe` listeners so React can render off
27
28
  * `getSnapshot` through `useSyncExternalStore`.
28
29
  */
29
- import { type VaultRecord, type VaultUnlocker } from './vaultRecord';
30
+ import { type DeviceUnlockStore } from './deviceUnlock';
31
+ import { type VaultRecord, type VaultSignIn, type VaultUnlocker } from './vaultRecord';
32
+ export type { VaultSignIn } from './vaultRecord';
30
33
  /** What a listener needs to render. Immutable; identity changes on every
31
34
  * mutation so `useSyncExternalStore` re-renders exactly when something did. */
32
35
  export interface VaultSnapshot {
@@ -36,6 +39,8 @@ export interface VaultSnapshot {
36
39
  locked: boolean;
37
40
  /** Profiles with a stored password — readable while locked. */
38
41
  entryIds: readonly string[];
42
+ /** Profiles with a saved GMCP sign-in token — readable while locked. */
43
+ signInIds: readonly string[];
39
44
  /** Unlock methods, without their key material. */
40
45
  unlockers: readonly {
41
46
  id: string;
@@ -43,6 +48,9 @@ export interface VaultSnapshot {
43
48
  label: string;
44
49
  createdAt: string;
45
50
  }[];
51
+ /** Epoch ms until which this device opens the vault by itself, when the
52
+ * player chose that. Known only once the vault is open. */
53
+ rememberedUntil: number | null;
46
54
  }
47
55
  /** Failure modes worth telling apart in the UI. */
48
56
  export type VaultErrorCode = 'unavailable' | 'no-vault' | 'locked' | 'no-prf' | 'no-passkey' | 'last-unlocker';
@@ -56,14 +64,19 @@ interface VaultIO {
56
64
  }
57
65
  export declare class CredentialVault {
58
66
  private io;
67
+ private device;
59
68
  private record;
60
69
  /** Recovered at unlock, dropped at lock. Never persisted. */
61
70
  private masterKey;
62
71
  /** Decrypted secrets while unlocked, keyed by connection id. */
63
72
  private secrets;
73
+ /** Decrypted GMCP sign-ins while unlocked, keyed by connection id. */
74
+ private signIns;
64
75
  private listeners;
65
76
  private snapshot;
66
- constructor(io?: VaultIO);
77
+ /** See {@link VaultSnapshot.rememberedUntil}. */
78
+ private rememberedUntil;
79
+ constructor(io?: VaultIO, device?: DeviceUnlockStore | null);
67
80
  subscribe: (listener: () => void) => (() => void);
68
81
  getSnapshot: () => VaultSnapshot;
69
82
  /** Whether this browser can do vault crypto at all (secure context). */
@@ -78,6 +91,18 @@ export declare class CredentialVault {
78
91
  /** The stored password, or `undefined` when there is none *or* the vault is
79
92
  * locked. Callers treat both the same way: fall back to asking the user. */
80
93
  getPassword(connectionId: string): string | undefined;
94
+ /** True when this profile has a saved sign-in *token* — answerable while
95
+ * locked. A token-less resume hint does not count: it is not worth asking
96
+ * the player to unlock for. */
97
+ hasSignIn(connectionId: string): boolean;
98
+ /** The saved GMCP sign-in (a copy), or `undefined` when there is none or
99
+ * the vault is locked. */
100
+ getSignIn(connectionId: string): VaultSignIn | undefined;
101
+ /** Whether this browser can keep the vault unlocked between visits. */
102
+ get canRemember(): boolean;
103
+ /** Whether a secret written now would actually be kept: a vault exists and
104
+ * is open. What the GMCP `token_storage` field reports. */
105
+ get canStore(): boolean;
81
106
  /**
82
107
  * Create a vault whose first unlocker is a passphrase.
83
108
  *
@@ -101,8 +126,23 @@ export declare class CredentialVault {
101
126
  /** Open the vault with a registered passkey. Throws on cancel (WebAuthn's
102
127
  * own error) or when no passkey unlocker exists. */
103
128
  unlockWithPasskey(): Promise<boolean>;
104
- /** Drop the master key and every decrypted secret. The record stays. */
129
+ /** Drop the master key and every decrypted secret. The record stays. A
130
+ * vault kept unlocked on this device stops being so: "Lock" means locked
131
+ * on the next visit too. */
105
132
  lock(): void;
133
+ /**
134
+ * Open the vault from a remembered unlock, if this device has one for it.
135
+ * Called once at startup, before anything reads a password. A stale entry —
136
+ * expired, for a vault since replaced, or one that will not decrypt — is
137
+ * dropped. Never throws: the worst case is the usual unlock prompt.
138
+ */
139
+ restoreOnThisDevice(): Promise<boolean>;
140
+ /** Keep the open vault unlocked on this device until the expiry. Asking
141
+ * again renews it. Requires unlocked. */
142
+ rememberOnThisDevice(): Promise<void>;
143
+ /** Stop keeping the vault unlocked on this device. It stays open for the
144
+ * rest of this visit. */
145
+ forgetOnThisDevice(): Promise<void>;
106
146
  /** Remove the vault and everything in it, irreversibly. */
107
147
  deleteVault(): void;
108
148
  /** Store (or, with `null`, forget) one profile's password. Requires unlocked. */
@@ -116,6 +156,13 @@ export declare class CredentialVault {
116
156
  * password is unreachable.
117
157
  */
118
158
  forgetConnection(connectionId: string): Promise<boolean>;
159
+ /**
160
+ * Store (or, with `null`, forget) one profile's GMCP sign-in. Requires
161
+ * unlocked: whether a token can be kept at all is decided from
162
+ * {@link canStore} *before* the game is told (`token_storage`), so a locked
163
+ * vault here is a race for the caller to report, not a silent drop.
164
+ */
165
+ setSignIn(connectionId: string, entry: VaultSignIn | null): Promise<void>;
119
166
  /** Drop stored passwords for profiles that no longer exist. No-op while
120
167
  * locked; the caller runs it right after an unlock. */
121
168
  pruneMissing(existingConnectionIds: Iterable<string>): Promise<void>;
@@ -148,4 +195,3 @@ export declare class CredentialVault {
148
195
  * across profiles, so opening a second game after unlocking the first asks for
149
196
  * nothing. */
150
197
  export declare const credentialVault: CredentialVault;
151
- export {};
@@ -0,0 +1,47 @@
1
+ /**
2
+ * "Keep unlocked on this device": the vault opens by itself on later visits.
3
+ *
4
+ * The master key is wrapped under a *device key* — an AES-GCM key created with
5
+ * `extractable: false` and kept in IndexedDB, which stores a `CryptoKey` by
6
+ * structured clone. Script on this origin can ask the browser to use it but can
7
+ * never read its bytes, so the wrapped copy is useless anywhere but this
8
+ * browser profile: not in a backup, not on another machine, not to an extension
9
+ * that copies localStorage (where the vault record lives).
10
+ *
11
+ * What it gives up, and what the player is told: anyone who can use this
12
+ * browser profile can open the vault, as with the browser's own saved
13
+ * passwords. Script in the page could already use an unlocked vault, so that
14
+ * exposure is unchanged. Someone copying the profile directory off the disk may
15
+ * recover the key, since browsers do not all encrypt IndexedDB at rest. Hence
16
+ * opt-in, and an expiry ({@link REMEMBER_UNLOCK_DAYS}) that re-asking renews.
17
+ *
18
+ * Kept in its own database so dropping it never touches anything else, and so
19
+ * no backup or storage sweep that names the app's other databases picks it up.
20
+ */
21
+ import { type Ciphertext } from './vaultCrypto';
22
+ /** How long a remembered unlock lasts before the vault asks again. */
23
+ export declare const REMEMBER_UNLOCK_DAYS = 30;
24
+ /** One remembered unlock — at most one per browser profile, like the vault. */
25
+ export interface RememberedUnlock {
26
+ /** Non-extractable; never leaves IndexedDB as bytes. */
27
+ deviceKey: CryptoKey;
28
+ /** The vault master key, encrypted under `deviceKey`. */
29
+ wrapped: Ciphertext;
30
+ /** Which vault this opens — its `prfSalt`, random per vault. A vault
31
+ * deleted and set up again must not be "opened" by a stale entry. */
32
+ vaultTag: string;
33
+ /** Epoch ms after which it is discarded unused. */
34
+ expiresAt: number;
35
+ }
36
+ export interface DeviceUnlockStore {
37
+ load(): Promise<RememberedUnlock | null>;
38
+ save(entry: RememberedUnlock): Promise<void>;
39
+ clear(): Promise<void>;
40
+ }
41
+ /** Wrap `master` under a fresh device key. */
42
+ export declare function rememberMasterKey(master: CryptoKey, vaultTag: string, now?: number): Promise<RememberedUnlock>;
43
+ /** The master key back, or `null` when the entry is for another vault, has
44
+ * expired, or will not decrypt. */
45
+ export declare function recallMasterKey(entry: RememberedUnlock, vaultTag: string, now?: number): Promise<CryptoKey | null>;
46
+ /** The IndexedDB-backed store, or `null` where there is no IndexedDB. */
47
+ export declare function idbDeviceUnlockStore(): DeviceUnlockStore | null;