@mudlet/mudlet-web 0.3.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.
- package/LICENSE +338 -0
- package/README.md +150 -0
- package/dist-lib/App.d.ts +1 -0
- package/dist-lib/MudletWebApp.d.ts +11 -0
- package/dist-lib/ProfileSession.d.ts +15 -0
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +9 -0
- package/dist-lib/branding.d.ts +213 -0
- package/dist-lib/core/EventBus.d.ts +29 -0
- package/dist-lib/db/sqliteClient.d.ts +25 -0
- package/dist-lib/hooks/useEngines.d.ts +12 -0
- package/dist-lib/hooks/useMudSession.d.ts +10 -0
- package/dist-lib/hooks/useOutput.d.ts +17 -0
- package/dist-lib/hooks/useViewportMode.d.ts +14 -0
- package/dist-lib/import/applyMudletProfile.d.ts +57 -0
- package/dist-lib/import/collectProfileExport.d.ts +16 -0
- package/dist-lib/import/defaultPackages.d.ts +81 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -0
- package/dist-lib/import/defaults/run-lua-code.mpackage +0 -0
- package/dist-lib/import/mudletHost.d.ts +67 -0
- package/dist-lib/import/mudletLink.d.ts +34 -0
- package/dist-lib/import/mudletProfileExport.d.ts +49 -0
- package/dist-lib/import/mudletProfileImport.d.ts +71 -0
- package/dist-lib/import/mudletVariables.d.ts +49 -0
- package/dist-lib/import/mudletWriteback.d.ts +12 -0
- package/dist-lib/import/mudletXmlExport.d.ts +16 -0
- package/dist-lib/import/mudletXmlImport.d.ts +21 -0
- package/dist-lib/import/packageInstaller.d.ts +72 -0
- package/dist-lib/import/packageRepository.d.ts +54 -0
- package/dist-lib/import/remotePackageInstall.d.ts +52 -0
- package/dist-lib/index.d.ts +30 -0
- package/dist-lib/index.js +42307 -0
- package/dist-lib/logging/SessionLogger.d.ts +41 -0
- package/dist-lib/main.d.ts +2 -0
- package/dist-lib/map/MapSelectionOverlay.d.ts +15 -0
- package/dist-lib/map/MapStore.d.ts +1067 -0
- package/dist-lib/map/MudixMapReader.d.ts +90 -0
- package/dist-lib/map/MudletHighlightOverlay.d.ts +18 -0
- package/dist-lib/map/mapImageExport.d.ts +26 -0
- package/dist-lib/map/mapParser.worker.d.ts +1 -0
- package/dist-lib/map/mapParserClient.d.ts +35 -0
- package/dist-lib/map/pathfinding.d.ts +52 -0
- package/dist-lib/map/xmlMapImport.d.ts +28 -0
- package/dist-lib/mud/MudSession.d.ts +236 -0
- package/dist-lib/mud/PatternEngine.d.ts +28 -0
- package/dist-lib/mud/aliases/AliasEngine.d.ts +15 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +84 -0
- package/dist-lib/mud/connection/MudClient.d.ts +268 -0
- package/dist-lib/mud/connection/PingTracker.d.ts +28 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +188 -0
- package/dist-lib/mud/connection/telnetDebug.d.ts +54 -0
- package/dist-lib/mud/events.d.ts +160 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +36 -0
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +45 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +33 -0
- package/dist-lib/mud/protocol/charset.d.ts +105 -0
- package/dist-lib/mud/protocol/constants.d.ts +116 -0
- package/dist-lib/mud/protocol/echo.d.ts +63 -0
- package/dist-lib/mud/protocol/gmcp.d.ts +28 -0
- package/dist-lib/mud/protocol/index.d.ts +11 -0
- package/dist-lib/mud/protocol/mccp.d.ts +18 -0
- package/dist-lib/mud/protocol/mnes.d.ts +83 -0
- package/dist-lib/mud/protocol/msdp.d.ts +19 -0
- package/dist-lib/mud/protocol/msp.d.ts +47 -0
- package/dist-lib/mud/protocol/mssp.d.ts +25 -0
- package/dist-lib/mud/protocol/mxp.d.ts +188 -0
- package/dist-lib/mud/protocol/naws.d.ts +7 -0
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +31 -0
- package/dist-lib/mud/replay/ReplayRecorder.d.ts +18 -0
- package/dist-lib/mud/replay/replayFormat.d.ts +49 -0
- package/dist-lib/mud/text/Console.d.ts +183 -0
- package/dist-lib/mud/text/FormatState.d.ts +256 -0
- package/dist-lib/mud/text/ansiEscapes.d.ts +88 -0
- package/dist-lib/mud/text/cellRender.d.ts +21 -0
- package/dist-lib/mud/text/colorParsers.d.ts +54 -0
- package/dist-lib/mud/text/colors.d.ts +31 -0
- package/dist-lib/mud/text/controlCharacterMode.d.ts +13 -0
- package/dist-lib/mud/text/controlChars.d.ts +31 -0
- package/dist-lib/mud/text/hyperlinkConfig.d.ts +164 -0
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +37 -0
- package/dist-lib/mud/text/oscLinkManager.d.ts +35 -0
- package/dist-lib/mud/text/wcwidth.d.ts +44 -0
- package/dist-lib/mud/text/xterm256.d.ts +2 -0
- package/dist-lib/mud/timers/TimerEngine.d.ts +61 -0
- package/dist-lib/mud/triggers/ChunkProcessor.d.ts +11 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +188 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +26 -0
- package/dist-lib/scripting/EngineHost.d.ts +152 -0
- package/dist-lib/scripting/GlobalEventChannel.d.ts +36 -0
- package/dist-lib/scripting/IScriptingRuntime.d.ts +95 -0
- package/dist-lib/scripting/MapOpenNotifier.d.ts +19 -0
- package/dist-lib/scripting/ScriptingAPI.d.ts +1691 -0
- package/dist-lib/scripting/ScriptingEngine.d.ts +806 -0
- package/dist-lib/scripting/StopwatchManager.d.ts +94 -0
- package/dist-lib/scripting/heldModifiers.d.ts +3 -0
- package/dist-lib/scripting/http/HttpService.d.ts +23 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +190 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/commandLine.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +87 -0
- package/dist-lib/scripting/lua/bindings/cursor.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/map.d.ts +14 -0
- package/dist-lib/scripting/lua/bindings/media.d.ts +24 -0
- package/dist-lib/scripting/lua/bindings/output.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/packages.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/session.d.ts +16 -0
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/window.d.ts +10 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +4 -0
- package/dist-lib/scripting/lua/luaCompletions.d.ts +9 -0
- package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/scripting/lua/rex.d.ts +3 -0
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +1 -0
- package/dist-lib/scripting/lua/yajl.d.ts +11 -0
- package/dist-lib/scripting/profilesPresence.d.ts +50 -0
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +62 -0
- package/dist-lib/scripting/vfs/cssRewrite.d.ts +21 -0
- package/dist-lib/scripting/vfs/folderHandleStore.d.ts +16 -0
- package/dist-lib/scripting/vfs/folderSync.d.ts +59 -0
- package/dist-lib/scripting/vfs/htmlRewrite.d.ts +26 -0
- package/dist-lib/scripting/vfs/vfsBridge.d.ts +16 -0
- package/dist-lib/services/cloudflare.d.ts +54 -0
- package/dist-lib/storage/appStore.d.ts +132 -0
- package/dist-lib/storage/crossTabSync.d.ts +3 -0
- package/dist-lib/storage/debouncedStorage.d.ts +18 -0
- package/dist-lib/storage/hooks.d.ts +17 -0
- package/dist-lib/storage/index.d.ts +4 -0
- package/dist-lib/storage/logExport.d.ts +32 -0
- package/dist-lib/storage/logStorage.d.ts +45 -0
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/profileVfsData.d.ts +47 -0
- package/dist-lib/storage/schema.d.ts +638 -0
- package/dist-lib/styles.css +2 -0
- package/dist-lib/ui/AboutModal.d.ts +8 -0
- package/dist-lib/ui/BrandLoginFields.d.ts +25 -0
- package/dist-lib/ui/BrandLoginScreen.d.ts +11 -0
- package/dist-lib/ui/CharLoginModal.d.ts +32 -0
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +27 -0
- package/dist-lib/ui/CodeEditorPreview.d.ts +19 -0
- package/dist-lib/ui/CommandBar.d.ts +17 -0
- package/dist-lib/ui/ConnectionFormModal.d.ts +13 -0
- package/dist-lib/ui/ConnectionGrid.d.ts +18 -0
- package/dist-lib/ui/ConnectionScreen.d.ts +14 -0
- package/dist-lib/ui/FileBrowserModal.d.ts +20 -0
- package/dist-lib/ui/FilePickerModal.d.ts +21 -0
- package/dist-lib/ui/FolderPermissionScreen.d.ts +16 -0
- package/dist-lib/ui/JsonPreview.d.ts +15 -0
- package/dist-lib/ui/LogBrowserModal.d.ts +7 -0
- package/dist-lib/ui/MapEditorModal.d.ts +9 -0
- package/dist-lib/ui/MarkdownPreview.d.ts +15 -0
- package/dist-lib/ui/MergeConflictModal.d.ts +17 -0
- package/dist-lib/ui/ModuleResolveModal.d.ts +22 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -0
- package/dist-lib/ui/ProfileBusyScreen.d.ts +12 -0
- package/dist-lib/ui/ProfileExportModal.d.ts +7 -0
- package/dist-lib/ui/ProxyInfoModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWhyModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWizardModal.d.ts +6 -0
- package/dist-lib/ui/QuickOpenPalette.d.ts +8 -0
- package/dist-lib/ui/ResizableModal.d.ts +17 -0
- package/dist-lib/ui/ScriptingDocsModal.d.ts +12 -0
- package/dist-lib/ui/SettingsModal.d.ts +9 -0
- package/dist-lib/ui/Toolbar.d.ts +29 -0
- package/dist-lib/ui/bufferWords.d.ts +38 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +21 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +97 -0
- package/dist-lib/ui/cmdline/CommandLineOverlay.d.ts +8 -0
- package/dist-lib/ui/codemirror/theme.d.ts +5 -0
- package/dist-lib/ui/commandHistory.d.ts +31 -0
- package/dist-lib/ui/components/Button.d.ts +9 -0
- package/dist-lib/ui/components/ConfirmDialog.d.ts +29 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +9 -0
- package/dist-lib/ui/components/FontPicker.d.ts +9 -0
- package/dist-lib/ui/components/FormField.d.ts +16 -0
- package/dist-lib/ui/components/HelpTip.d.ts +7 -0
- package/dist-lib/ui/components/Input.d.ts +6 -0
- package/dist-lib/ui/components/Toggle.d.ts +10 -0
- package/dist-lib/ui/components/index.d.ts +9 -0
- package/dist-lib/ui/components/useModalFocus.d.ts +18 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +220 -0
- package/dist-lib/ui/labels/LabelOverlay.d.ts +9 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +10 -0
- package/dist-lib/ui/labels/cursorShapes.d.ts +6 -0
- package/dist-lib/ui/labels/gifMovie.d.ts +100 -0
- package/dist-lib/ui/labels/qtCss.d.ts +57 -0
- package/dist-lib/ui/layout/ContentLayout.d.ts +19 -0
- package/dist-lib/ui/layout/DockArea.d.ts +14 -0
- package/dist-lib/ui/layout/DockedPanel.d.ts +13 -0
- package/dist-lib/ui/layout/FloatingWindowLayer.d.ts +10 -0
- package/dist-lib/ui/layout/MobileLayout.d.ts +22 -0
- package/dist-lib/ui/layout/PopoutWindow.d.ts +35 -0
- package/dist-lib/ui/layout/ScriptWindow.d.ts +29 -0
- package/dist-lib/ui/layout/SplitGroupPanel.d.ts +17 -0
- package/dist-lib/ui/layout/TabGroupPanel.d.ts +12 -0
- package/dist-lib/ui/layout/WindowContextMenu.d.ts +11 -0
- package/dist-lib/ui/layout/dockDetect.d.ts +26 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +71 -0
- package/dist-lib/ui/markdown.d.ts +1 -0
- package/dist-lib/ui/output/CaretReviewPanel.d.ts +22 -0
- package/dist-lib/ui/output/OutputArea.d.ts +9 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +23 -0
- package/dist-lib/ui/output/OutputRenderer.d.ts +64 -0
- package/dist-lib/ui/output/ScreenReaderLog.d.ts +23 -0
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +28 -0
- package/dist-lib/ui/output/backgroundImageStyle.d.ts +17 -0
- package/dist-lib/ui/output/caretMode.d.ts +40 -0
- package/dist-lib/ui/output/linkNavigation.d.ts +29 -0
- package/dist-lib/ui/output/osc8Menu.d.ts +16 -0
- package/dist-lib/ui/output/outputCopy.d.ts +15 -0
- package/dist-lib/ui/preventPinchZoom.d.ts +1 -0
- package/dist-lib/ui/scrollbox/ScrollBoxManager.d.ts +62 -0
- package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +25 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +149 -0
- package/dist-lib/ui/sound/closedCaption.d.ts +37 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +56 -0
- package/dist-lib/ui/tts/TtsManager.d.ts +68 -0
- package/dist-lib/ui/useBrandLogin.d.ts +19 -0
- package/dist-lib/ui/useCommandHistory.d.ts +7 -0
- package/dist-lib/ui/video/VideoManager.d.ts +56 -0
- package/dist-lib/ui/windows/ScriptEditorModal.d.ts +13 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +694 -0
- package/dist-lib/ui/windows/panels/HtmlPanel.d.ts +27 -0
- package/dist-lib/ui/windows/panels/LuaEditor.d.ts +14 -0
- package/dist-lib/ui/windows/panels/MapPanel.d.ts +8 -0
- package/dist-lib/ui/windows/panels/PackageRepositoryModal.d.ts +18 -0
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +24 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +12 -0
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +35 -0
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +21 -0
- package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +8 -0
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +23 -0
- package/dist-lib/ui/windows/types.d.ts +145 -0
- package/dist-lib/utils/documentTitle.d.ts +33 -0
- package/dist-lib/utils/fontLoader.d.ts +52 -0
- package/dist-lib/utils/profileLock.d.ts +26 -0
- package/dist-lib/utils/sessionCredentials.d.ts +16 -0
- package/dist-lib/version.d.ts +39 -0
- package/dist-lib/vfs-sw.js +131 -0
- package/dist-lib/vite.d.ts +2 -0
- package/dist-lib/vite.js +154 -0
- package/package.json +93 -0
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ProfileSettings } from '../storage/schema';
|
|
2
|
+
import { type MudletImportResult } from './mudletXmlImport';
|
|
3
|
+
import { type MudletVariablePackage } from './mudletVariables';
|
|
4
|
+
/**
|
|
5
|
+
* Map a `<Host>` element to a partial ProfileSettings. Only keys actually
|
|
6
|
+
* present in the XML are set, so the result can be merged over existing/default
|
|
7
|
+
* settings without clobbering anything Mudlet didn't specify.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseMudletHost(host: Element): Partial<ProfileSettings>;
|
|
10
|
+
/** The connection identity a Mudlet `<Host>` carries: the profile name and the
|
|
11
|
+
* MUD address (`<url>` host + `<port>`). Used to seed a new mudix connection. */
|
|
12
|
+
export interface MudletProfileIdentity {
|
|
13
|
+
name?: string;
|
|
14
|
+
host?: string;
|
|
15
|
+
port?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Read `<name>`/`<url>`/`<port>` (direct children of `<Host>`). */
|
|
18
|
+
export declare function parseMudletHostIdentity(host: Element): MudletProfileIdentity;
|
|
19
|
+
/**
|
|
20
|
+
* Write the modeled ProfileSettings back onto an existing `<Host>` element,
|
|
21
|
+
* in place — only the fields present in `s` are touched, so unmodeled Host
|
|
22
|
+
* fields (and the whole rest of the profile) are preserved. The inverse of
|
|
23
|
+
* {@link parseMudletHost}. The display-font family is only written for a *system*
|
|
24
|
+
* font (Mudlet can't resolve a url/vfs font name); the size is always synced, and
|
|
25
|
+
* the rest of the QFont spec is preserved.
|
|
26
|
+
*/
|
|
27
|
+
export declare function applyProfileSettingsToHost(host: Element, s: Partial<ProfileSettings>): void;
|
|
28
|
+
/** Names from `<Host><mInstalledPackages>` — the packages Mudlet considers
|
|
29
|
+
* installed for this profile. Mudlet tracks these so package managers (mpkg) and
|
|
30
|
+
* `getPackageInfo`/`getInstalledPackages` work; mudix registers a manifest per
|
|
31
|
+
* entry on import. */
|
|
32
|
+
export declare function parseInstalledPackages(host: Element): string[];
|
|
33
|
+
/** Everything a full Mudlet profile XML carries that mudix can import. */
|
|
34
|
+
export interface MudletProfileImport {
|
|
35
|
+
/** From `<Host>` — the profile name + MUD address for the connection record. */
|
|
36
|
+
connection: MudletProfileIdentity;
|
|
37
|
+
/** From `<HostPackage><Host>` — partial so it merges over defaults. */
|
|
38
|
+
settings: Partial<ProfileSettings>;
|
|
39
|
+
/** From the Trigger/Alias/Script/Timer/Key/Action packages. */
|
|
40
|
+
automation: MudletImportResult;
|
|
41
|
+
/** From `<VariablePackage>` — the saved-variables tree + hidden list. */
|
|
42
|
+
variables: MudletVariablePackage;
|
|
43
|
+
/** Names from `<mInstalledPackages>` — registered as package manifests on import. */
|
|
44
|
+
installedPackages: string[];
|
|
45
|
+
/** From `<mInstalledModules>` — modules reference an XML file at an absolute
|
|
46
|
+
* local path *outside* the profile, which a browser can't read. The import
|
|
47
|
+
* flow surfaces these for the user to upload or drop. */
|
|
48
|
+
modules: MudletModuleRef[];
|
|
49
|
+
}
|
|
50
|
+
/** One `<mInstalledModules>` entry: a module the profile loads from an external
|
|
51
|
+
* XML file on the user's disk. */
|
|
52
|
+
export interface MudletModuleRef {
|
|
53
|
+
key: string;
|
|
54
|
+
filepath: string;
|
|
55
|
+
/** Mudlet `globalSave` flag — sync the module back on save. */
|
|
56
|
+
globalSave: boolean;
|
|
57
|
+
priority: number;
|
|
58
|
+
}
|
|
59
|
+
/** Parse the repeated `<mInstalledModules>` blocks under `<Host>`. */
|
|
60
|
+
export declare function parseInstalledModules(host: Element): MudletModuleRef[];
|
|
61
|
+
/**
|
|
62
|
+
* Parse a complete Mudlet profile XML (a `current/*.xml`) into the things mudix
|
|
63
|
+
* can apply: the connection identity, profile settings, automation trees, and
|
|
64
|
+
* saved variables. `<VariablePackage>` variable names become the seed of the
|
|
65
|
+
* profile's save-list when applied. Throws on malformed XML.
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseMudletProfile(xml: string): MudletProfileImport;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface VfsReader {
|
|
2
|
+
exists(path: string): boolean;
|
|
3
|
+
readdir(path: string): string[];
|
|
4
|
+
stat(path: string): {
|
|
5
|
+
mtime: Date;
|
|
6
|
+
} | null;
|
|
7
|
+
readFile(path: string): string;
|
|
8
|
+
}
|
|
9
|
+
/** current/*.xml paths (relative to the profile root) ordered newest-first.
|
|
10
|
+
* Order is by mtime; when mtimes are unavailable (all zero) autosave.xml comes
|
|
11
|
+
* first, then the latest timestamp filename. Empty when not a Mudlet profile. */
|
|
12
|
+
export declare function listCurrentXmlsByRecency(vfs: VfsReader): string[];
|
|
13
|
+
/** Path of the newest profile save in current/, or null if not a Mudlet profile. */
|
|
14
|
+
export declare function findNewestCurrentXml(vfs: VfsReader): string | null;
|
|
15
|
+
/** Whether a mounted VFS looks like a linked Mudlet profile (has current/*.xml). */
|
|
16
|
+
export declare function isMudletProfileVfs(vfs: VfsReader): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The newest current/*.xml whose content actually parses as a Mudlet profile,
|
|
19
|
+
* with its text. Skips a corrupt newest save (e.g. a truncated/garbage autosave
|
|
20
|
+
* from the write bug) and falls back to older saves — so a linked profile still
|
|
21
|
+
* opens, and write-back can re-heal the bad file from a good base. Null if none
|
|
22
|
+
* parse.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readNewestParseableXml(vfs: VfsReader): {
|
|
25
|
+
path: string;
|
|
26
|
+
xml: string;
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* Hydrate the store for a Mudlet-linked profile from the newest current/*.xml,
|
|
30
|
+
* layering the .mudix sidecar's mudix-only slices on top. Returns false if the
|
|
31
|
+
* VFS isn't a Mudlet profile (caller falls back to the normal profile.json load).
|
|
32
|
+
* `installedAt` stamps the package manifests (pass an ISO timestamp).
|
|
33
|
+
*/
|
|
34
|
+
export declare function loadMudletLinkedProfile(vfs: VfsReader, connectionId: string, installedAt: string): boolean;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { MudConnection } from '../storage/schema';
|
|
2
|
+
import type { PersistedProfileData } from '../storage/profileVfsData';
|
|
3
|
+
/** Mudlet names its saves `YYYY-MM-DD#HH-mm-ss.xml`; the importer sorts by that
|
|
4
|
+
* filename when no mtimes are available, so the stamp has to be sortable. */
|
|
5
|
+
export declare function formatSaveStamp(date: Date): string;
|
|
6
|
+
/** Connection fields Mudlet's `<Host>` can't express (websocket mode, the proxy
|
|
7
|
+
* override, auto-reconnect). Written beside the XML so a mudix→mudix round-trip
|
|
8
|
+
* keeps them; desktop Mudlet ignores the dot-directory entirely. */
|
|
9
|
+
export declare const CONNECTION_SIDECAR_PATH = ".mudix/connection.json";
|
|
10
|
+
export interface ConnectionSidecar {
|
|
11
|
+
mode?: MudConnection['mode'];
|
|
12
|
+
url?: string;
|
|
13
|
+
host?: string;
|
|
14
|
+
port?: number;
|
|
15
|
+
proxyUrl?: string;
|
|
16
|
+
autoReconnect?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function buildConnectionSidecar(c: MudConnection): ConnectionSidecar;
|
|
19
|
+
/** Serialize one profile's automation, variables and settings as Mudlet profile XML. */
|
|
20
|
+
export declare function buildProfileXml(connection: MudConnection, data: PersistedProfileData): string;
|
|
21
|
+
/** One exported session log: `name` becomes the filename under `logs/`. */
|
|
22
|
+
export interface ExportLog {
|
|
23
|
+
name: string;
|
|
24
|
+
html: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ProfileExportSource {
|
|
27
|
+
connection: MudConnection;
|
|
28
|
+
/** Contents of `.mudix/profile.json`. */
|
|
29
|
+
data: PersistedProfileData;
|
|
30
|
+
/** Loose VFS files (packages, fonts, sounds, …), keyed relative to the
|
|
31
|
+
* profile root. `.mudix/` is expected to be filtered out by the collector. */
|
|
32
|
+
files: Record<string, Uint8Array>;
|
|
33
|
+
mapBytes?: Uint8Array;
|
|
34
|
+
logs?: ExportLog[];
|
|
35
|
+
}
|
|
36
|
+
/** Strip characters that are illegal in zip entry / filesystem names, so a
|
|
37
|
+
* profile called `Arkadia: main` can't produce an unextractable archive. */
|
|
38
|
+
export declare function sanitizeFolderName(name: string, fallback: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Build one profile's folder as `{path -> bytes}`, keyed *relative to the
|
|
41
|
+
* profile root* (no folder prefix). Pure — the caller supplies everything.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildProfileFolder(src: ProfileExportSource, stamp: string): Record<string, Uint8Array>;
|
|
44
|
+
/**
|
|
45
|
+
* Build the downloadable archive: one folder per profile, so a single zip can
|
|
46
|
+
* carry every profile a user has. Duplicate profile names are suffixed rather
|
|
47
|
+
* than merged — two folders that collide would silently lose one profile.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildProfilesZip(sources: ProfileExportSource[], now: Date): Uint8Array;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PackageManifest } from '../storage/schema';
|
|
2
|
+
import { type MudletProfileImport, type MudletModuleRef } from './mudletHost';
|
|
3
|
+
export interface MudletProfileBundle {
|
|
4
|
+
/** Profile name — `<Host><name>`, else the profile folder name, else fallback. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** MUD address from `<Host>` (`<url>`/`<port>`), if present. */
|
|
7
|
+
host?: string;
|
|
8
|
+
port?: number;
|
|
9
|
+
/** Parsed settings + automation + variables from the newest current/*.xml. */
|
|
10
|
+
profile: MudletProfileImport;
|
|
11
|
+
/** Manifests for the profile's installed packages (from <mInstalledPackages>,
|
|
12
|
+
* metadata from each package's config.lua). Registered on import so
|
|
13
|
+
* getPackageInfo / package managers see them as installed. */
|
|
14
|
+
packages: PackageManifest[];
|
|
15
|
+
/** Modules the profile loads from external local XML files — unresolvable in a
|
|
16
|
+
* browser; the import UI asks the user to upload or drop each. */
|
|
17
|
+
modules: MudletModuleRef[];
|
|
18
|
+
/** Newest map/* binary, ready for mapStorage. Undefined if the profile has no map. */
|
|
19
|
+
mapBytes?: Uint8Array;
|
|
20
|
+
/** Remaining profile-root files to copy into the new VFS (packages, fonts,
|
|
21
|
+
* sounds, …), keyed relative to the profile root. Excludes current/ and map/. */
|
|
22
|
+
files: Record<string, Uint8Array>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a manifest per installed package, reading metadata from each package's
|
|
26
|
+
* config.lua via `readConfig(name)` (returns the file text or undefined).
|
|
27
|
+
* `installedAt` is left empty for the caller to stamp (keeps this deterministic).
|
|
28
|
+
* Reusable across the file-map import path and the linked-folder (VFS) path.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildPackageManifests(names: string[], readConfig: (name: string) => string | undefined): PackageManifest[];
|
|
31
|
+
/**
|
|
32
|
+
* Every profile root in the tree — the prefix before each `current/` directory.
|
|
33
|
+
*
|
|
34
|
+
* A tree with profiles side by side (mudix's multi-profile export) yields one
|
|
35
|
+
* root each. Nesting is resolved by depth: a root at the top wins over anything
|
|
36
|
+
* inside it, so a single profile that happens to contain another `current/*.xml`
|
|
37
|
+
* deeper down still imports as one profile, matching the old shallowest-wins
|
|
38
|
+
* behavior. Returned sorted, so import order is deterministic.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findProfileRoots(files: Record<string, Uint8Array>): string[];
|
|
41
|
+
export declare function buildMudletProfileBundle(files: Record<string, Uint8Array>, fallbackName?: string, mtimes?: Record<string, number>,
|
|
42
|
+
/** Import this specific root (from {@link findProfileRoots}) instead of the
|
|
43
|
+
* shallowest one — used when one tree holds several profiles. */
|
|
44
|
+
rootOverride?: string): MudletProfileBundle;
|
|
45
|
+
/** Build a profile bundle from a `.zip` of a Mudlet profile directory. (Zip
|
|
46
|
+
* entry mtimes aren't surfaced, so newest-save uses the autosave/timestamp
|
|
47
|
+
* fallback.) */
|
|
48
|
+
export declare function extractMudletProfileZip(bytes: Uint8Array, fallbackName?: string): MudletProfileBundle;
|
|
49
|
+
/** One bundle per profile in the tree — a mudix multi-profile export, or a
|
|
50
|
+
* single Mudlet profile (in which case this is a one-element list). */
|
|
51
|
+
export declare function buildAllMudletProfileBundles(files: Record<string, Uint8Array>, fallbackName?: string, mtimes?: Record<string, number>): MudletProfileBundle[];
|
|
52
|
+
/** Every profile in a `.zip`, in folder order. */
|
|
53
|
+
export declare function extractMudletProfileZipAll(bytes: Uint8Array, fallbackName?: string): MudletProfileBundle[];
|
|
54
|
+
export interface ResolvedModule {
|
|
55
|
+
ref: MudletModuleRef;
|
|
56
|
+
xmlBytes: Uint8Array;
|
|
57
|
+
}
|
|
58
|
+
/** Split a bundle's modules into those whose XML was found in the imported tree
|
|
59
|
+
* (by filename) and those still missing. */
|
|
60
|
+
export declare function resolveModulesFromTree(bundle: MudletProfileBundle): {
|
|
61
|
+
resolved: ResolvedModule[];
|
|
62
|
+
unresolved: MudletModuleRef[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Fold a resolved/uploaded module's XML into the bundle: its triggers/aliases/…
|
|
66
|
+
* are parsed (grouped + tagged under the module key, so it's a removable unit)
|
|
67
|
+
* and appended to the automation, and a manifest is registered. Mutates and
|
|
68
|
+
* returns the bundle. Treated as a package — the live-sync-to-disk behaviour
|
|
69
|
+
* doesn't apply in a browser.
|
|
70
|
+
*/
|
|
71
|
+
export declare function addModuleToBundle(bundle: MudletProfileBundle, key: string, xmlBytes: Uint8Array): MudletProfileBundle;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const LUA_TBOOLEAN = 1;
|
|
2
|
+
export declare const LUA_TNUMBER = 3;
|
|
3
|
+
export declare const LUA_TSTRING = 4;
|
|
4
|
+
export declare const LUA_TTABLE = 5;
|
|
5
|
+
/** How a variable's key is typed in its parent table. Lua only distinguishes
|
|
6
|
+
* string vs number keys here (Mudlet never saves other key types). */
|
|
7
|
+
export type VarKeyKind = 'string' | 'number';
|
|
8
|
+
/** Scalar value types we round-trip. Tables are represented by `children`. */
|
|
9
|
+
export type VarValueType = 'boolean' | 'number' | 'string' | 'table';
|
|
10
|
+
/**
|
|
11
|
+
* One saved variable (or table entry). `name` is the key as written in <name>
|
|
12
|
+
* — for a numeric key it's the number stringified ("7"). `value` is Mudlet's
|
|
13
|
+
* string form of the scalar ("true"/"42"/"3.5"/raw string); it is '' and unused
|
|
14
|
+
* for tables, whose entries live in `children`.
|
|
15
|
+
*/
|
|
16
|
+
export interface MudletVariable {
|
|
17
|
+
name: string;
|
|
18
|
+
keyKind: VarKeyKind;
|
|
19
|
+
valueType: VarValueType;
|
|
20
|
+
value: string;
|
|
21
|
+
children?: MudletVariable[];
|
|
22
|
+
}
|
|
23
|
+
export interface MudletVariablePackage {
|
|
24
|
+
/** <HiddenVariables> names. Round-tripped verbatim; the populated inner
|
|
25
|
+
* format is unverified (only ever observed empty) so we preserve whatever
|
|
26
|
+
* <name> entries are present without interpreting them. */
|
|
27
|
+
hidden: string[];
|
|
28
|
+
variables: MudletVariable[];
|
|
29
|
+
}
|
|
30
|
+
/** Parse a `<VariablePackage>` element. */
|
|
31
|
+
export declare function parseVariablePackage(pkg: Element): MudletVariablePackage;
|
|
32
|
+
/** Parse the first `<VariablePackage>` out of a full Mudlet profile XML string.
|
|
33
|
+
* Returns an empty package when there is none. */
|
|
34
|
+
export declare function parseVariablePackageXml(xml: string): MudletVariablePackage;
|
|
35
|
+
/**
|
|
36
|
+
* Coerce a loosely-typed variable tree (e.g. the result of `JSON.parse` on a
|
|
37
|
+
* `yajl.to_string` capture from the Lua side) into well-formed `MudletVariable`s.
|
|
38
|
+
* Notably, yajl can't tell an empty Lua table from an empty array, so an empty
|
|
39
|
+
* `children`/root arrives as `{}` rather than `[]`; this normalises those back to
|
|
40
|
+
* arrays and drops anything that isn't a recognisable node.
|
|
41
|
+
*/
|
|
42
|
+
export declare function normalizeVariableTree(raw: unknown): MudletVariable[];
|
|
43
|
+
/**
|
|
44
|
+
* Serialize a `<VariablePackage>` to Mudlet's exact textual format (tab indent).
|
|
45
|
+
* `indent` is the leading indent of the `<VariablePackage>` line itself (one tab
|
|
46
|
+
* inside `<MudletPackage>` in a real profile). Top-level variables and table
|
|
47
|
+
* children are emitted name-sorted to match Mudlet and keep output stable.
|
|
48
|
+
*/
|
|
49
|
+
export declare function serializeVariablePackage(pkg: MudletVariablePackage, indent?: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProfileSettings } from '../storage/schema';
|
|
2
|
+
import { type SerializeInput } from './mudletXmlExport';
|
|
3
|
+
import { type MudletVariablePackage } from './mudletVariables';
|
|
4
|
+
/**
|
|
5
|
+
* Produce the updated profile XML: the base save with its automation + variable
|
|
6
|
+
* packages replaced by `trees` / `variables`, the modeled `<Host>` settings
|
|
7
|
+
* updated in place from `settings`, and HostPackage's unmodeled fields (plus any
|
|
8
|
+
* unknown element) carried over verbatim. Throws if the base XML is malformed.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildLinkedWriteback(baseXml: string, trees: SerializeInput, variables: MudletVariablePackage, settings?: Partial<ProfileSettings>): string;
|
|
11
|
+
/** Mudlet's profile-save filename stamp for `date`: `YYYY-MM-DD#HH-mm-ss`. */
|
|
12
|
+
export declare function mudletTimestamp(date: Date): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AliasNode, ButtonNode, KeyNode, ScriptNode, TimerNode, TriggerNode } from '../storage/schema';
|
|
2
|
+
export interface SerializeInput {
|
|
3
|
+
scripts: ScriptNode[];
|
|
4
|
+
aliases: AliasNode[];
|
|
5
|
+
triggers: TriggerNode[];
|
|
6
|
+
timers: TimerNode[];
|
|
7
|
+
keys: KeyNode[];
|
|
8
|
+
buttons: ButtonNode[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Serialize a Mudlet-package node set back to XML. When `packageName` is supplied,
|
|
12
|
+
* a top-level wrapper group of that name (the one that `applyPackageTagging`
|
|
13
|
+
* inserts on import) is unwrapped — its children become package-level roots —
|
|
14
|
+
* so the document round-trips back to the same structure on re-import.
|
|
15
|
+
*/
|
|
16
|
+
export declare function serializeMudletXml(input: SerializeInput, packageName?: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AliasNode, ButtonNode, KeyNode, ScriptNode, TimerNode, TriggerNode } from '../storage/schema';
|
|
2
|
+
export interface MudletImportResult {
|
|
3
|
+
scripts: ScriptNode[];
|
|
4
|
+
aliases: AliasNode[];
|
|
5
|
+
triggers: TriggerNode[];
|
|
6
|
+
timers: TimerNode[];
|
|
7
|
+
keys: KeyNode[];
|
|
8
|
+
buttons: ButtonNode[];
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ParseOptions {
|
|
12
|
+
/**
|
|
13
|
+
* When set, every parsed node is tagged with this packageName, and a
|
|
14
|
+
* top-level group of the same name is prepended to each non-empty
|
|
15
|
+
* category as a parent for the imported tree. This mirrors Mudlet's
|
|
16
|
+
* .mpackage import behaviour: items are organisationally grouped and
|
|
17
|
+
* cleanly removable by tag.
|
|
18
|
+
*/
|
|
19
|
+
packageName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function parseMudletXml(xml: string, opts?: ParseOptions): MudletImportResult;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ProfileVFS } from '../scripting/vfs/ProfileVFS';
|
|
2
|
+
import type { PackageKind, PackageManifest } from '../storage/schema';
|
|
3
|
+
import { type MudletImportResult } from './mudletXmlImport';
|
|
4
|
+
export interface InstallResult {
|
|
5
|
+
manifest: PackageManifest;
|
|
6
|
+
data: MudletImportResult;
|
|
7
|
+
}
|
|
8
|
+
export interface InstallOptions {
|
|
9
|
+
/**
|
|
10
|
+
* 'package' (default) — plain XML imports skip VFS storage; only zips are kept on disk.
|
|
11
|
+
* 'module' — XML on disk is the source of truth: even plain XML is written to the
|
|
12
|
+
* VFS so it can be re-parsed on the next profile open and synced to.
|
|
13
|
+
*/
|
|
14
|
+
kind?: PackageKind;
|
|
15
|
+
/**
|
|
16
|
+
* Absolute VFS path the bytes were read from, when known. If it lives inside the
|
|
17
|
+
* derived pkgDir, the install skips the pkgDir wipe — otherwise an installer-style
|
|
18
|
+
* "unzip into <pkgDir>/ then installPackage(<pkgDir>/foo.xml)" pattern would delete
|
|
19
|
+
* the resources the script just staged.
|
|
20
|
+
*/
|
|
21
|
+
sourcePath?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Install a Mudlet package from in-memory bytes. Synchronous — the caller is
|
|
25
|
+
* expected to flush the VFS afterwards (or let the next idle flush handle it).
|
|
26
|
+
*
|
|
27
|
+
* Behaviour by kind:
|
|
28
|
+
* - .mpackage / .zip : always unzipped into <profilePath>/<packageName>/. The full payload
|
|
29
|
+
* is preserved so resources (images, sounds, lua modules) remain
|
|
30
|
+
* available to scripts via the VFS, regardless of `kind`.
|
|
31
|
+
* - .xml as 'package': parse only — no files written. Nodes live in the app store.
|
|
32
|
+
* - .xml as 'module' : the XML is also written to <profilePath>/<packageName>/<filename>;
|
|
33
|
+
* the on-disk file is treated as the source of truth, so it must exist
|
|
34
|
+
* to be re-parsed on profile open.
|
|
35
|
+
*
|
|
36
|
+
* The XML is parsed in package-mode, which wraps each category in a top-level
|
|
37
|
+
* group and tags every node with the package name, making uninstall a tag-based cascade.
|
|
38
|
+
*/
|
|
39
|
+
export declare function installPackageFromBytes(filename: string, buf: Uint8Array, vfs: ProfileVFS, opts?: InstallOptions): InstallResult;
|
|
40
|
+
/** Async wrapper that reads from a File and flushes the VFS to disk on success. */
|
|
41
|
+
export declare function installPackageFromFile(file: File, vfs: ProfileVFS, opts?: InstallOptions): Promise<InstallResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Remove a package's on-disk files. The store handles tag-based node removal
|
|
44
|
+
* separately. Modules are exempt: they unlink only — the underlying XML (and any
|
|
45
|
+
* unzipped resources) survive uninstall so the user's source files aren't
|
|
46
|
+
* silently destroyed when they remove the module from the app.
|
|
47
|
+
*/
|
|
48
|
+
export declare function uninstallPackageFiles(manifest: PackageManifest, vfs: ProfileVFS): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the absolute VFS path of a module's XML file. Honors `xmlVfsPath` (in-place
|
|
51
|
+
* modules) first, then falls back to the managed `<profilePath>/<name>/<xmlPath>` layout.
|
|
52
|
+
* Returns null if neither is set.
|
|
53
|
+
*/
|
|
54
|
+
export declare function moduleXmlAbsolutePath(manifest: PackageManifest, vfs: ProfileVFS): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Re-read a module's XML from the VFS and return the parsed result.
|
|
57
|
+
* Throws if the on-disk file is missing — modules require their XML to be present.
|
|
58
|
+
*/
|
|
59
|
+
export declare function reloadModuleFromVfs(manifest: PackageManifest, vfs: ProfileVFS): MudletImportResult;
|
|
60
|
+
/**
|
|
61
|
+
* Install a module from a path that already lives inside the profile's VFS.
|
|
62
|
+
*
|
|
63
|
+
* - Plain XML : referenced in place. The manifest stores `xmlVfsPath` and no pkgDir is
|
|
64
|
+
* created. Reload and sync read/write the user-chosen path verbatim, so
|
|
65
|
+
* external tools (a synced folder, an editor) can keep editing it.
|
|
66
|
+
* - .mpackage / .zip : same flow as a normal module install — extracted into a fresh
|
|
67
|
+
* pkgDir so resources are accessible. The original archive on disk is
|
|
68
|
+
* left untouched but is no longer referenced by the module.
|
|
69
|
+
*
|
|
70
|
+
* Throws on read/parse failures.
|
|
71
|
+
*/
|
|
72
|
+
export declare function installModuleFromVfsPath(absolutePath: string, vfs: ProfileVFS): InstallResult;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browse and install packages from Mudlet's official package repository.
|
|
3
|
+
*
|
|
4
|
+
* The repository is published as a static site backed by the
|
|
5
|
+
* github.com/Mudlet/mudlet-package-repository git repo. A reindex script
|
|
6
|
+
* regenerates `packages/mpkg.packages.json` after every commit, so the JSON
|
|
7
|
+
* catalog is authoritative — we don't try to scrape the all-packages.html page.
|
|
8
|
+
*
|
|
9
|
+
* Catalog shape (top-level object):
|
|
10
|
+
* { name, updated, packages: PackageRepoEntry[] }
|
|
11
|
+
*
|
|
12
|
+
* URLs are constructed from the repo's GitHub Pages base. Icon paths inside
|
|
13
|
+
* each entry are already relative to the repo root (e.g. "packages/icons/Foo.png"),
|
|
14
|
+
* so they're joined to REPO_BASE_URL verbatim.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Public-facing repository site (used for "view in browser" links).
|
|
18
|
+
* NOT used for fetching the catalog — the GitHub Pages mirror lags weeks behind
|
|
19
|
+
* the main branch. Mudlet's own package manager dialog hits raw.githubusercontent.com
|
|
20
|
+
* for the same reason; we mirror that choice.
|
|
21
|
+
*/
|
|
22
|
+
export declare const REPO_SITE_URL = "https://mudlet.github.io/mudlet-package-repository";
|
|
23
|
+
/** Base for fetching individual .mpackage files and icons (always-current `main` branch). */
|
|
24
|
+
export declare const REPO_RAW_BASE = "https://raw.githubusercontent.com/Mudlet/mudlet-package-repository/refs/heads/main";
|
|
25
|
+
export declare const CATALOG_URL = "https://raw.githubusercontent.com/Mudlet/mudlet-package-repository/refs/heads/main/packages/mpkg.packages.json";
|
|
26
|
+
export interface PackageRepoEntry {
|
|
27
|
+
/** Internal identifier (matches manifest.name produced by installPackageFromBytes). */
|
|
28
|
+
mpackage: string;
|
|
29
|
+
/** Filename inside the repo's packages/ directory, e.g. "Foo.mpackage". */
|
|
30
|
+
filename: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
author?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
/** ISO-8601 author-declared creation date. */
|
|
36
|
+
created?: string;
|
|
37
|
+
/** Unix timestamp the package was last uploaded to the repo. */
|
|
38
|
+
uploaded?: number;
|
|
39
|
+
/** Repo-relative icon path, e.g. "packages/icons/Foo.png". Optional. */
|
|
40
|
+
icon?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PackageRepoCatalog {
|
|
43
|
+
name: string;
|
|
44
|
+
updated: string;
|
|
45
|
+
packages: PackageRepoEntry[];
|
|
46
|
+
}
|
|
47
|
+
/** Absolute URL of the .mpackage zip for `entry`. */
|
|
48
|
+
export declare function packageDownloadUrl(entry: PackageRepoEntry): string;
|
|
49
|
+
/** Absolute URL of the icon image for `entry`, or null when none. */
|
|
50
|
+
export declare function packageIconUrl(entry: PackageRepoEntry): string | null;
|
|
51
|
+
/** Fetch and parse the package catalog. Throws on network or JSON errors. */
|
|
52
|
+
export declare function fetchPackageCatalog(proxyUrl?: string): Promise<PackageRepoCatalog>;
|
|
53
|
+
/** Download a single package's bytes. The caller is expected to pass it to installPackageFromBytes. */
|
|
54
|
+
export declare function downloadPackageBytes(entry: PackageRepoEntry, proxyUrl?: string): Promise<Uint8Array>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch a package file from a remote URL, falling back through the configured
|
|
3
|
+
* proxy on CORS / network failures. Mirrors the proxy logic in HttpService and
|
|
4
|
+
* packageRepository — duplicated rather than imported to keep this module
|
|
5
|
+
* focused on the small concern of "download bytes for a package install".
|
|
6
|
+
*/
|
|
7
|
+
import type { PackageManifest } from '../storage/schema';
|
|
8
|
+
export declare function downloadFromUrl(url: string, proxyUrlRaw?: string): Promise<Uint8Array>;
|
|
9
|
+
/** Pull the trailing path segment out of a URL, falling back when the URL is malformed. */
|
|
10
|
+
export declare function filenameFromUrl(url: string): string;
|
|
11
|
+
export interface ClientGuiPayload {
|
|
12
|
+
url: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Decide whether a `Client.GUI` request is a re-delivery of a package already
|
|
17
|
+
* installed from the same URL — i.e. whether the install can be skipped.
|
|
18
|
+
*
|
|
19
|
+
* The comparison is against `sourceVersion` (the server's own delivery
|
|
20
|
+
* revision, see PackageManifest.sourceVersion), never against the package's
|
|
21
|
+
* own `version`: those are the two fields that must stay apart.
|
|
22
|
+
*
|
|
23
|
+
* When the server declares no version — either the message carries none, or it
|
|
24
|
+
* carries a non-string one that `parseClientGuiPayload` drops — nothing
|
|
25
|
+
* signals that anything changed, so a URL match alone is the whole answer.
|
|
26
|
+
* Falling back to the package's own `version` here would re-conflate the two
|
|
27
|
+
* fields, and would still reinstall on every connect for a package whose
|
|
28
|
+
* author shipped no version at all.
|
|
29
|
+
*
|
|
30
|
+
* A manifest from before `sourceVersion` existed has none recorded, so a
|
|
31
|
+
* versioned request reinstalls it once — that pass is what replaces the
|
|
32
|
+
* server's value in `version` with the author's.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isClientGuiRedelivery(existing: PackageManifest | undefined, version: string | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Decode a `Client.Map` GMCP payload (the MMP map-location announcement).
|
|
37
|
+
* Mudlet (Host::setMmpMapLocation) only accepts a JSON object with a valid
|
|
38
|
+
* `url`; anything else is silently ignored. Returns null on that same basis.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseClientMapPayload(value: unknown): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Decode a `Client.GUI` GMCP payload. Mudlet supports two shapes
|
|
43
|
+
* (cTelnet::setGMCPVariables):
|
|
44
|
+
* - a `{ url, version }` JSON object (current MMP-style format)
|
|
45
|
+
* - a string `"<version>\n<url>"` (legacy raw telnet) — version first, which
|
|
46
|
+
* is the opposite of what this parser assumed before
|
|
47
|
+
* Returns null when neither shape applies or the URL is empty. Mudlet also
|
|
48
|
+
* requires both fields in the legacy shape and drops the message otherwise, so
|
|
49
|
+
* a lone line is only accepted as a bare URL from the JSON-ish path, never as a
|
|
50
|
+
* half-decoded legacy pair.
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseClientGuiPayload(value: unknown): ClientGuiPayload | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import './styles.css';
|
|
2
|
+
export { MudletWebApp } from "./MudletWebApp";
|
|
3
|
+
export { getBrand, isBrandedMode, isPackageRemovable, getThemeChoices, isLightTheme, DEFAULT_BRAND, STOCK_THEMES, type BrandConfig, type BrandMudTarget, type BrandPackage, type BrandTheme, type BrandToolbarButton, type BrandToolbarConfig, type BrandToolbarContext, type StockToolbarButton, type LandingProps, } from "./branding";
|
|
4
|
+
export { BrandLoginScreen } from "./ui/BrandLoginScreen";
|
|
5
|
+
export { useBrandLogin, type UseBrandLoginResult } from "./ui/useBrandLogin";
|
|
6
|
+
export { BrandLoginFields, type BrandLoginFieldsProps } from "./ui/BrandLoginFields";
|
|
7
|
+
export { setSessionCredentials, getSessionCredentials, getLastSessionCredentials, type SessionCredentials } from "./utils/sessionCredentials";
|
|
8
|
+
export type { MudConnection, ConnectionMode } from "./storage/schema";
|
|
9
|
+
export { EventBus } from "./core/EventBus";
|
|
10
|
+
export { ScriptingAPI } from "./scripting/ScriptingAPI";
|
|
11
|
+
export { MudSession } from "./mud/MudSession";
|
|
12
|
+
export type { MudSessionOptions } from "./mud/MudSession";
|
|
13
|
+
export type { SessionStatus, MudClientEvents, MudEvents } from "./mud/events";
|
|
14
|
+
export { TELNET_OPTION_REGEX, GMCP_COMMAND_CODE, GMCP_WILL, GMCP_DO, ECHO_WILL, ECHO_WONT, ECHO_DO, ECHO_DONT, MCCP2_OPTION, } from "./mud/protocol/constants";
|
|
15
|
+
export { MccpHandler } from "./mud/protocol/mccp";
|
|
16
|
+
export { EchoHandler } from "./mud/protocol/echo";
|
|
17
|
+
export { createTelnetOptionParser, stripTelnetSequences, createGmcpStream, encodeGmcp, encodeGmcpRaw, } from "./mud/protocol/gmcp";
|
|
18
|
+
export type { GmcpEnvelope, TelnetOptionHandler, GmcpStreamOptions } from "./mud/protocol/gmcp";
|
|
19
|
+
export { AnsiAwareBuffer, cloneFormatState, formatStatesEqual, } from "./mud/text/FormatState";
|
|
20
|
+
export type { FormatStateSnapshot, FormatColor, IndexedColor, RgbColor, HexColor, FormatHyperlink, DimEffect, DimEasing, BufferSegment, TextRange, } from "./mud/text/FormatState";
|
|
21
|
+
export { colorCodes } from "./mud/text/colors";
|
|
22
|
+
export { setupOutputRenderer } from "./ui/output/OutputRenderer";
|
|
23
|
+
export type { OutputRendererControls } from "./ui/output/OutputRenderer";
|
|
24
|
+
export { MudClient } from "./mud/connection/MudClient";
|
|
25
|
+
export type { MudClientOptions } from "./mud/connection/MudClient";
|
|
26
|
+
export { PingTracker } from "./mud/connection/PingTracker";
|
|
27
|
+
export { createPassthroughProcessor } from "./mud/triggers/ChunkProcessor";
|
|
28
|
+
export type { ChunkProcessor } from "./mud/triggers/ChunkProcessor";
|
|
29
|
+
export { TriggerEngine } from "./mud/triggers/TriggerEngine";
|
|
30
|
+
export type { TriggerNode } from "./mud/triggers/TriggerEngine";
|