@mudlet/mudlet-web 0.3.0 → 0.4.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 (111) hide show
  1. package/LICENSE +338 -338
  2. package/README.md +158 -150
  3. package/dist-lib/assets/qt-resources/index.d.ts +16 -0
  4. package/dist-lib/branding.d.ts +1 -1
  5. package/dist-lib/hooks/useMudSession.d.ts +1 -1
  6. package/dist-lib/hooks/useOutput.d.ts +3 -1
  7. package/dist-lib/import/defaultPackages.d.ts +35 -2
  8. package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
  9. package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
  10. package/dist-lib/import/defaults/{run-lua-code.mpackage → mudlet-base-ui/mudlet-base-ui.mpackage} +0 -0
  11. package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -13023
  12. package/dist-lib/import/defaults/run-lua-code/run-lua-code.mpackage +0 -0
  13. package/dist-lib/import/packageExport.d.ts +71 -0
  14. package/dist-lib/import/packageInstaller.d.ts +4 -1
  15. package/dist-lib/index.js +45910 -39931
  16. package/dist-lib/logging/SessionLogger.d.ts +66 -1
  17. package/dist-lib/map/MapStore.d.ts +32 -4
  18. package/dist-lib/map/mapImageExport.d.ts +1 -1
  19. package/dist-lib/map/mapZoom.d.ts +71 -0
  20. package/dist-lib/mud/ItemIdSequence.d.ts +23 -0
  21. package/dist-lib/mud/MudSession.d.ts +113 -11
  22. package/dist-lib/mud/PatternEngine.d.ts +6 -1
  23. package/dist-lib/mud/commandSplit.d.ts +16 -0
  24. package/dist-lib/mud/connection/LineAssembler.d.ts +56 -0
  25. package/dist-lib/mud/connection/MudClient.d.ts +136 -19
  26. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +39 -0
  27. package/dist-lib/mud/connection/telnetByteTags.d.ts +35 -0
  28. package/dist-lib/mud/events.d.ts +86 -4
  29. package/dist-lib/mud/games/bundledGames.d.ts +29 -0
  30. package/dist-lib/mud/games/gameIcons.d.ts +5 -0
  31. package/dist-lib/mud/keybindings/KeyEngine.d.ts +9 -2
  32. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +5 -1
  33. package/dist-lib/mud/keybindings/keyEventTarget.d.ts +17 -0
  34. package/dist-lib/mud/keybindings/qtKeys.d.ts +2 -0
  35. package/dist-lib/mud/protocol/charLoginFlow.d.ts +68 -0
  36. package/dist-lib/mud/protocol/charset.d.ts +27 -5
  37. package/dist-lib/mud/protocol/constants.d.ts +1 -0
  38. package/dist-lib/mud/protocol/gmcp.d.ts +19 -3
  39. package/dist-lib/mud/protocol/index.d.ts +1 -1
  40. package/dist-lib/mud/protocol/msspTls.d.ts +54 -0
  41. package/dist-lib/mud/protocol/mxp.d.ts +28 -5
  42. package/dist-lib/mud/protocol/tlsCodes.d.ts +4 -0
  43. package/dist-lib/mud/replay/ReplayPlayer.d.ts +17 -0
  44. package/dist-lib/mud/text/Console.d.ts +64 -0
  45. package/dist-lib/mud/text/FormatState.d.ts +66 -3
  46. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +35 -0
  47. package/dist-lib/mud/text/osc8Docs.d.ts +23 -0
  48. package/dist-lib/mud/text/serverWrap.d.ts +191 -0
  49. package/dist-lib/mud/timers/TimerEngine.d.ts +43 -12
  50. package/dist-lib/mud/triggers/TriggerEngine.d.ts +112 -3
  51. package/dist-lib/scripting/EngineHost.d.ts +56 -3
  52. package/dist-lib/scripting/IScriptingRuntime.d.ts +22 -0
  53. package/dist-lib/scripting/MxpFrameManager.d.ts +118 -0
  54. package/dist-lib/scripting/ScriptingAPI.d.ts +331 -54
  55. package/dist-lib/scripting/ScriptingEngine.d.ts +181 -24
  56. package/dist-lib/scripting/http/HttpService.d.ts +51 -1
  57. package/dist-lib/scripting/lua/LuaRuntime.d.ts +159 -2
  58. package/dist-lib/scripting/lua/bindings/map.d.ts +0 -12
  59. package/dist-lib/scripting/lua/utf8Patterns.d.ts +59 -0
  60. package/dist-lib/storage/index.d.ts +1 -1
  61. package/dist-lib/storage/persistentStorage.d.ts +10 -0
  62. package/dist-lib/storage/schema.d.ts +166 -4
  63. package/dist-lib/styles.css +1 -1
  64. package/dist-lib/ui/BundledGameGrid.d.ts +21 -0
  65. package/dist-lib/ui/CharLoginModal.d.ts +5 -1
  66. package/dist-lib/ui/CommandBar.d.ts +7 -1
  67. package/dist-lib/ui/ConnectionGrid.d.ts +4 -1
  68. package/dist-lib/ui/FileBrowserModal.d.ts +1 -0
  69. package/dist-lib/ui/FilePickerModal.d.ts +3 -3
  70. package/dist-lib/ui/HelpModal.d.ts +11 -0
  71. package/dist-lib/ui/LogBrowserModal.d.ts +4 -1
  72. package/dist-lib/ui/PlayerMarkerPreview.d.ts +20 -0
  73. package/dist-lib/ui/SettingsModal.d.ts +5 -1
  74. package/dist-lib/ui/TlsAlertBanner.d.ts +18 -0
  75. package/dist-lib/ui/TlsCertificateBox.d.ts +20 -0
  76. package/dist-lib/ui/TlsUpgradeModal.d.ts +16 -0
  77. package/dist-lib/ui/Toolbar.d.ts +2 -1
  78. package/dist-lib/ui/VfsPickerModal.d.ts +26 -0
  79. package/dist-lib/ui/components/FileSourceButton.d.ts +47 -0
  80. package/dist-lib/ui/components/index.d.ts +1 -0
  81. package/dist-lib/ui/components/useModalFocus.d.ts +6 -0
  82. package/dist-lib/ui/helpTopics.d.ts +19 -0
  83. package/dist-lib/ui/labels/LabelManager.d.ts +32 -0
  84. package/dist-lib/ui/labels/labelLinks.d.ts +52 -0
  85. package/dist-lib/ui/layout/ScriptWindow.d.ts +11 -2
  86. package/dist-lib/ui/markdown.d.ts +10 -1
  87. package/dist-lib/ui/output/OutputArea.d.ts +11 -1
  88. package/dist-lib/ui/output/OutputContextMenu.d.ts +3 -1
  89. package/dist-lib/ui/output/OutputRenderer.d.ts +7 -1
  90. package/dist-lib/ui/output/OutputSearchBar.d.ts +25 -0
  91. package/dist-lib/ui/output/StickyOutputPanel.d.ts +5 -1
  92. package/dist-lib/ui/output/linkNavigation.d.ts +22 -0
  93. package/dist-lib/ui/output/outputSearch.d.ts +130 -0
  94. package/dist-lib/ui/search/matcher.d.ts +15 -0
  95. package/dist-lib/ui/search/useDebounced.d.ts +3 -0
  96. package/dist-lib/ui/tts/TtsManager.d.ts +3 -0
  97. package/dist-lib/ui/useCommandHistory.d.ts +4 -2
  98. package/dist-lib/ui/useOpenProfiles.d.ts +26 -0
  99. package/dist-lib/ui/video/VideoManager.d.ts +17 -0
  100. package/dist-lib/ui/windows/WindowManager.d.ts +149 -2
  101. package/dist-lib/ui/windows/panels/MapPanel.d.ts +4 -1
  102. package/dist-lib/ui/windows/panels/PackageExportModal.d.ts +18 -0
  103. package/dist-lib/ui/windows/panels/TextPanel.d.ts +3 -1
  104. package/dist-lib/ui/windows/types.d.ts +35 -0
  105. package/dist-lib/utils/describeThrown.d.ts +22 -0
  106. package/dist-lib/utils/fontLoader.d.ts +5 -0
  107. package/dist-lib/vfs-sw.js +131 -131
  108. package/dist-lib/vite.js +22 -0
  109. package/package.json +97 -93
  110. package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
  111. package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +0 -8
@@ -0,0 +1,71 @@
1
+ import { type SerializeInput } from './mudletXmlExport';
2
+ export interface PackageExportMeta {
3
+ /** Package identity — also the XML filename and the install directory name. */
4
+ name: string;
5
+ author?: string;
6
+ title?: string;
7
+ description?: string;
8
+ version?: string;
9
+ helpURL?: string;
10
+ dependencies?: string[];
11
+ /** Icon filename as stored under `.mudlet/Icon/`; empty when there's no icon. */
12
+ icon?: string;
13
+ /** ISO-8601 creation stamp. Passed in rather than read from the clock so the
14
+ * builders stay pure and testable. */
15
+ created: string;
16
+ }
17
+ /** Strip characters that are illegal in zip entry / filesystem names. */
18
+ export declare function sanitizePackageName(raw: string, fallback?: string): string;
19
+ /**
20
+ * Mudlet's `config.lua`: every key is written even when empty, in the order
21
+ * dlgPackageExporter emits them, with `created` as a plain quoted string.
22
+ */
23
+ export declare function buildConfigLua(meta: PackageExportMeta): string;
24
+ interface TreeNode {
25
+ id: string;
26
+ parentId: string | null;
27
+ isGroup: boolean;
28
+ }
29
+ /** Every descendant id of `rootId`, excluding the root itself. */
30
+ export declare function descendantIds<T extends TreeNode>(nodes: T[], rootId: string): string[];
31
+ /**
32
+ * Reduce a category's nodes to the selected ones, re-parenting any node whose
33
+ * parent wasn't selected to the top level.
34
+ *
35
+ * Mudlet drops such a node instead: its exporter walks from the roots and never
36
+ * reaches a selected child under an unselected group, so checking one trigger
37
+ * inside a folder exports nothing. Re-rooting keeps the item and makes the
38
+ * selection mean what it looks like; a fully-checked subtree serializes
39
+ * identically either way.
40
+ */
41
+ export declare function selectExportNodes<T extends TreeNode>(nodes: T[], selected: ReadonlySet<string>): T[];
42
+ /** Ids of every category, as the modal tracks them. */
43
+ export interface PackageSelection {
44
+ scripts: ReadonlySet<string>;
45
+ aliases: ReadonlySet<string>;
46
+ triggers: ReadonlySet<string>;
47
+ timers: ReadonlySet<string>;
48
+ keys: ReadonlySet<string>;
49
+ buttons: ReadonlySet<string>;
50
+ }
51
+ /** Apply a selection across all six categories at once. */
52
+ export declare function selectExportInput(all: SerializeInput, selection: PackageSelection): SerializeInput;
53
+ export declare function countSelected(input: SerializeInput): number;
54
+ export interface PackageExportInput {
55
+ meta: PackageExportMeta;
56
+ /** Already filtered through `selectExportInput`. */
57
+ nodes: SerializeInput;
58
+ /** Extra files to carry, keyed by path relative to the package root. */
59
+ assets?: Record<string, Uint8Array>;
60
+ /** Icon bytes; stored at `.mudlet/Icon/<meta.icon>` when `meta.icon` is set. */
61
+ iconBytes?: Uint8Array;
62
+ }
63
+ /**
64
+ * Build the package's file map. `config.lua` and `<name>.xml` are written last
65
+ * and always win: an asset list harvested from an installed package directory
66
+ * contains the *previous* pair, and letting those through would ship stale
67
+ * metadata alongside the freshly serialized items.
68
+ */
69
+ export declare function buildPackageEntries(input: PackageExportInput): Record<string, Uint8Array>;
70
+ export declare function buildPackageZip(input: PackageExportInput): Uint8Array;
71
+ export {};
@@ -69,4 +69,7 @@ export declare function reloadModuleFromVfs(manifest: PackageManifest, vfs: Prof
69
69
  *
70
70
  * Throws on read/parse failures.
71
71
  */
72
- export declare function installModuleFromVfsPath(absolutePath: string, vfs: ProfileVFS): InstallResult;
72
+ export declare function installModuleFromVfsPath(absolutePath: string, vfs: ProfileVFS,
73
+ /** Consulted first, so a module under the read-only /lua/ namespace installs
74
+ * as readily as one in the profile — see LuaRuntime.readBuiltinBytes. */
75
+ readBuiltin?: (path: string) => Uint8Array | null): InstallResult;