### LlmSetup.run(api, opts) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ui/js/setup/LlmSetup.md Runs the local-LLM setup pipeline: ensures the runtime, downloads the model, configures defaults, and starts the server. Returns a promise that resolves with the setup result. ```APIDOC ## LlmSetup.run(api, opts) ### Description Runs the local-LLM setup pipeline: ensures the runtime, downloads the model, configures defaults, and starts the server. Returns a promise that resolves with the setup result. ### Method run ### Parameters #### api (object) - Required An object with the following methods: - **getRuntimesView** (function) - Required - Returns the current runtimes view. - **installRuntime** (function) - Required - Installs a runtime. - **downloadModel** (function) - Required - Downloads a model. - **setDefaults** (function) - Required - Sets default configuration. - **startServer** (function) - Required - Starts the server. - **restartServer** (function) - Optional - Restarts the server. - **onRuntimeEvent** (function) - Required - Subscribes to runtime events; returns an unsubscribe function. - **onModelEvent** (function) - Required - Subscribes to model events; returns an unsubscribe function. #### opts (object) - Required Options object with the following properties: - **rec** (object) - Required - Contains the runtime ID (e.g., `rec.runtimeId`). - **override** (object) - Optional - Overrides for the download spec. Can be `{ url, filename }` or `{ mlx, repoId }`. If `override.mlx` is set, the runtime is `mlx-lm` and MLX is never auto-installed (user gets pip guidance). - **advanced** (object) - Optional - Advanced options; if present, the download spec is `{ hf }`. - **isCanceled** (function) - Optional - A function to check if the operation is canceled. - **onPhase** (function) - Optional - Callback for phase changes. - **onBar** (function) - Optional - Callback for progress bar updates. - **onSub** (function) - Optional - Callback for sub-line updates. ### Steps 1. **RuntimeEnsurer** - Ensures the runtime for `rec.runtimeId`, or `mlx-lm` when `override.mlx` is set. 2. **Downloading model…** - Downloads the model using the download spec: `override` (`{ url, filename }` or `{ mlx, repoId }`), else `advanced` (`{ hf }`), else the recommendation. Progress is reported via SetupProgressEvents, with `Resuming…` and `Paused` sub-lines. A paused download returns `{ ok: false, paused: true }` (bytes are kept; rerunning resumes). 3. **Configuring & starting the server…** - Calls `setDefaults({ runtimeId, modelPath, contextSize, kvCacheType, cpuMoe? })` (cpuMoe only when the plan sets it), then starts the server. ### Returns Resolves with an object: - **ok** (boolean) - Indicates success. - **file** (string) - The downloaded file path. - **destPath** (string) - The destination path. - **alreadyPresent** (boolean) - Whether the model was already present. ### Example ```js const result = await LlmSetup.run(api, { rec: { runtimeId: 'mlx-lm' }, override: { url: 'https://example.com/model.gguf', filename: 'model.gguf' }, onPhase: (phase) => console.log(phase), onBar: (progress) => console.log(progress), onSub: (sub) => console.log(sub) }); // result: { ok: true, file, destPath, alreadyPresent } ``` ### Response #### Success Response - **ok** (boolean) - Indicates success. - **file** (string) - The downloaded file path. - **destPath** (string) - The destination path of the downloaded model. - **alreadyPresent** (boolean) - Whether the model was already present. #### Paused Download Response If a download is paused, the method returns `{ ok: false, paused: true }`. The bytes are kept; rerunning resumes. ### Notes - The download spec is determined by `override` if provided, else `advanced` if provided, else the recommendation. - Progress is reported via SetupProgressEvents, with `Resuming…` and `Paused` sub-lines. - `setDefaults` is called with `{ runtimeId, modelPath, contextSize, kvCacheType, cpuMoe? }`; `cpuMoe` is only included when the plan sets it. - After setting defaults, the server is started via ServerStarter. ### Response Resolves with an object: - **ok** (boolean) - Indicates success. - **file** (string) - The downloaded file path. - **destPath** (string) - The destination path. - **alreadyPresent** (boolean) - Whether the model was already present. If a download is paused, the promise resolves with `{ ok: false, paused: true }` (bytes are kept; rerunning resumes). ``` -------------------------------- ### install(id, opts, send) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ipc/LlmRuntimeSetup.md Installs a runtime. Sends 'start' and streams installer events. Drops the cache before 'finalize' and after. On Linux, clears cached diagnostics for Vulkan, SYCL, or ROCm runtimes. Supports pre-release channel. Resolves with the result. ```APIDOC ## install(id, opts, send) ### Description Installs a runtime. Sends 'start' and streams installer events. Drops the cache before 'finalize' and after. On Linux, clears cached diagnostics for Vulkan, SYCL, or ROCm runtimes. Supports pre-release channel. ### Parameters - **id** (string) - Required - The runtime ID. - **opts** (object) - Required - Options object. - **channel** (string) - Optional - If 'prerelease', selects the pre-release build. - **send** (function) - Required - Callback to send events. ### Returns - **{ result }** - An object containing the result. ### Events - Sends `start` event. - Streams installer events. - Sends `finalize` event. - On failure, sends `error { message, code, detail }` and throws with `code` and `detail` (null when absent). ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/shell/RestGateway.md Starts the HTTP server listening on 0.0.0.0:. ```APIDOC ## start() ### Description Starts the HTTP server listening on `0.0.0.0:`. Resolves when listening, rejects on a server error. ### Returns - **Promise** - Resolves when the server is listening, rejects on error. ``` -------------------------------- ### start({ router, upgrade }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/tab-share/TabShareService.md Starts the TabShareService: loads shares and settings, starts the relay if enabled, listens to TabViewManager events, binds already-live tabs, and mounts the /tab web mount. Idempotent. ```APIDOC ## Method: start({ router, upgrade }) ### Description Starts the TabShareService. It loads shares and settings, starts the relay if enabled, listens to TabViewManager events (tabCreated, tabClosed, tabNavigated, tabTitleUpdated), binds already-live tabs, and mounts the /tab web mount using host.registerWebMount. Idempotent. ### Parameters - **router** (object) - Required - Router instance. - **upgrade** (object) - Required - Upgrade instance. ### Returns No return value. ``` -------------------------------- ### SetupMain wiring for page entry (wave 3) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ui/js/setup-ui/SetupMain.md Imports SetupMain and PreflightBanner, constructs SetupMain with the preload API and collaborators, starts it, and starts the PreflightBanner. Call after FoldMemory.install and SegmentedPicker.install. ```javascript import SetupMain from './setup-ui/SetupMain.js'; import PreflightBanner from './setup-ui/preflight/PreflightBanner.js'; const setup = new SetupMain({ api: window.llmDiagAPI, modelList, modelSearch, openers: { image: () => imageSetup.open(), music: () => musicSetup.open() } }); setup.start(); new PreflightBanner({ api: window.llmDiagAPI }).start(); ``` -------------------------------- ### RuntimeInstallModal.open({ name?, assetSupported?, installed?, hardware? }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ui/js/setup/RuntimeInstallModal.md Shows an install or update dialog on the shared modal overlay with options to auto-download a prebuilt binary or locate an existing install. Resolves with 'auto', 'locate', or null on cancel. ```APIDOC ## RuntimeInstallModal.open({ name?, assetSupported?, installed?, hardware? }) ### Description Shows an "Install " (or "Update") dialog on the shared `.luma-modal-overlay` shell with two options: automatically download the official prebuilt binary (disabled, "Unavailable", when no prebuilt exists for the platform) or locate an existing install. Resolves `'auto'`, `'locate'`, or `null` on Cancel, the close button, Escape or a click on the surround. Pure UI: the caller performs the action. The name is escaped. `hardware` is the detector's `{ ready, note }`: when `ready` is false a warning (`[data-rt-hardware-warning]`) above the options quotes the note and says the build will run on the CPU or fail to start until that is fixed; both options stay available. ### Method open ### Parameters #### Object Parameter - **name** (string) - Optional - The name of the runtime to display in the dialog title. - **assetSupported** (boolean) - Optional - Indicates whether a prebuilt binary exists for the platform. If false, the auto-download option is disabled and labeled "Unavailable". - **installed** (boolean) - Optional - Indicates whether the runtime is already installed, which changes the dialog title to "Update". - **hardware** (object) - Optional - The detector's hardware status object with properties `ready` (boolean) and `note` (string). When `ready` is false, a warning is shown above the options. ### Return Value - **Promise** - Resolves to `'auto'` if the user chooses automatic download, `'locate'` if the user chooses to locate an existing install, or `null` if the user cancels (via Cancel button, close button, Escape key, or click on the surround). ### Notes - The dialog is shown on the shared `.luma-modal-overlay` shell. - The name is escaped to prevent XSS. - The module reads `document` and adds/removes its own keydown listener. ``` -------------------------------- ### placement.start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/PlacementApi.md Starts the placement process. ```APIDOC ## placement.start() ### Description Starts the placement process. ### Method invoke ### IPC Channel `core.placement.start` ### Parameters None ### Response Returns the result of the start operation. ``` -------------------------------- ### start(deviceId, getFill) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ui/js/voice/MicProbe.md Starts the preview stream for the given device and drives the level meter using the provided getFill callback. ```APIDOC ## start(deviceId, getFill) ### Description Starts the preview stream for the given device and drives the level meter using the provided getFill callback. ### Method start ### Parameters - **deviceId** (string) - Required - The ID of the microphone device to use. - **getFill** (function) - Required - A callback that returns the fill value for the level meter. ``` -------------------------------- ### startServer() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/LlmServerApi.md Starts the LLM server. ```APIDOC ## startServer() ### Description Starts the LLM server. ### Method invoke ### Endpoint core.llmServer.startServer ### Parameters None ### Response No return value. ``` -------------------------------- ### new RuntimeInstallJob({ id, runtimesRoot, stopEngine, onInstalled, installer? }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/chatterbox-voice/RuntimeInstallJob.md Creates a new RuntimeInstallJob instance. The installer defaults to a new AudioCppRuntimeInstaller. ```APIDOC ## new RuntimeInstallJob({ id, runtimesRoot, stopEngine, onInstalled, installer? }) ### Description Creates a new RuntimeInstallJob instance. The installer defaults to a new AudioCppRuntimeInstaller. ### Constructor Parameters - **id** (string) - Required - Identifier for the job. - **runtimesRoot** (string) - Required - Root directory for runtimes. - **stopEngine** (function) - Required - Function to stop the engine. - **onInstalled** (function) - Required - Callback invoked with the job id after installation completes. - **installer** (AudioCppRuntimeInstaller) - Optional - Installer instance; defaults to a new AudioCppRuntimeInstaller. ### Returns A new RuntimeInstallJob instance. ``` -------------------------------- ### start({ messages, temperature }, send) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ipc/QuickChat.md Starts a quick chat session. Returns success once streaming starts, or throws errors if the server is not ready or the catalog entry is missing. ```APIDOC ## start({ messages, temperature }, send) ### Description Starts a quick chat session. Aborts any previous quick chat, then streams through the runtime's adapter at `http://:` with the supervisor's launch-time `authKey` and the plan's `apiModelName`. Returns `{ success: true }` once streaming starts. ### Parameters - `messages` (array) - Required - The messages to send. - `temperature` (number) - Required - The temperature for the chat. - `send` (function) - Required - Callback to receive streamed events. ### Returns - `{ success: true }` - Indicates streaming started successfully. ### Throws - `Server is , not ready.` - If the server is not ready or has no port. - `Catalog entry for not found.` - If the runtime catalog entry is missing. ### Streamed Events - `delta` - A delta chunk. - `reasoning-delta` - A reasoning delta chunk. - `done` - Summary or `{}`. - `error { message }` - Error event with message. ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/selenium-driver/SeleniumDriverExtension.md Starts the WebDriver server. Returns success with port, host, and prefix, or an error object. Never throws. ```APIDOC ## start() ### Description Starts the WebDriver server. Returns success with port, host, and prefix, or an error object. Never throws. ### Method start ### Returns - **success** (boolean) - Indicates if the operation succeeded. - **port** (number) - The port the server is listening on (when success is true). - **host** (string) - The host the server is bound to (when success is true). - **prefix** (string) - The URL prefix for the WebDriver protocol (when success is true). - **already** (boolean) - True if the server was already running (when success is true and already true). - **error** (string) - Error message when success is false. ### Response Example { "success": true, "port": 9515, "host": "127.0.0.1", "prefix": "/" } ``` -------------------------------- ### start Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/app/BootClock.md The boot epoch timestamp in milliseconds. ```APIDOC ## start ### Description The boot epoch timestamp in milliseconds, recorded at construction time. ### Property `start` ### Type - **number** - The epoch timestamp in milliseconds. ``` -------------------------------- ### image.startServer() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/ImageApi.md Starts the image server. ```APIDOC ## image.startServer() ### Description Starts the image server. ### Method invoke ### Endpoint core.imageServer.startServer ### Parameters None ### Response No specific response documented. ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/shell/McpServer.md Starts the MCP server by using a running app or auto-starting one, then reads JSON-RPC from the input. Rejects if the app is not up within 30 seconds. ```APIDOC ## start() ### Description Starts the MCP server. It uses a running app or auto-starts one (rejects if it is not up in 30 s), then reads JSON-RPC from the input. ### Method start ### Parameters None. ### Returns - **Promise** - Resolves when the server is started and reading input. ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/chatterbox-voice/ModelDownloadJob.md Starts the core ModelDownload.start into `/` and returns the job. The `finished` promise resolves once the download settles and the engine is stopped. ```APIDOC ## start() ### Description Starts the core ModelDownload.start into `/` and returns the job. The `finished` promise resolves once the download settles and the engine is stopped. ### Method `start()` ### Returns - **job** (ModelDownloadJob) - The current job instance. ### Notes - The `finished` promise resolves after the download settles and the engine is stopped. ``` -------------------------------- ### grounding.start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/GroundingApi.md Starts the grounding server. ```APIDOC ## grounding.start() ### Description Starts the grounding server. ### Method invoke ### IPC Channel `core.groundingServer.start` ### Parameters None ### Response Confirmation of server start. ``` -------------------------------- ### Start LumaBrowser with npx Source: https://github.com/amurgola/lumabrowser/blob/main/cli/README.md Launches LumaBrowser. On first run, it downloads the appropriate build for your OS from lumabyte.com, caches it under ~/.lumabrowser/, and starts the browser. Subsequent runs launch from cache without re-downloading. ```bash npx lumabrowser start ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/network-sharing/MdnsBrowser.md Starts one Bonjour browser per pooled instance, then re-queries every 8 seconds or restarts all browsers when the interface set changes. It is a no-op when discovery is unavailable. Returns the instance for chaining. ```APIDOC ## start() ### Description Starts browsing for mDNS services. It starts one Bonjour browser per pooled instance, then every 8 seconds re-queries, or restarts all browsers when the interface set changes. It is a no-op when discovery is unavailable. ### Method start ### Returns `this` (the MdnsBrowser instance) for chaining. ``` -------------------------------- ### POST /api/selenium/start Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/selenium-driver/SeleniumDriverExtension.md Starts the WebDriver server. ```APIDOC ## POST /api/selenium/start ### Description Starts the WebDriver server. ### Method POST ### Endpoint /api/selenium/start ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation succeeded. - **port** (number) - The port the server is listening on. - **host** (string) - The host the server is bound to. - **prefix** (string) - The URL prefix for the WebDriver protocol. - **already** (boolean) - True if the server was already running. #### Error Response (503) - **error** (string) - "selenium-driver not activated" when the extension is not activated. ``` -------------------------------- ### install({ force = false }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/cli/lib/launcher/AppInstaller.md Fetches the manifest, checks for a platform asset, reuses a cached build unless forced, downloads the build into `~/.lumabrowser` with a progress bar, prepares it, and writes the InstallRecord. Resolves the record. ```APIDOC ## Method: install({ force = false }) ### Description Downloads and prepares the LumaBrowser build for the current platform. It fetches the manifest, validates that an asset exists for the platform, reuses a cached build unless `force` is true, otherwise downloads the asset into `~/.lumabrowser` with a progress bar, prepares it, and writes the InstallRecord. Resolves the InstallRecord. ### Parameters - **force** (boolean) - Optional - If true, forces a fresh download even if a cached build exists. Defaults to false. ### Returns - **Promise** - Resolves with the InstallRecord after installation. ### Manifest Format ```json { "version": "string", "assets": { "": { "url": "string", "filename": "string" } } } ``` ### Behavior - Throws an error if the manifest has no asset for the current platform, listing the available platform keys. - Reuses a current cached build unless `force` is true. - Downloads into `~/.lumabrowser` with a progress bar. - Prepares the build (platform-specific). - Writes the InstallRecord. ``` -------------------------------- ### Global install and start LumaBrowser Source: https://github.com/amurgola/lumabrowser/blob/main/cli/README.md Install LumaBrowser globally with npm and start it with the `lumabrowser start` command, avoiding the need to type `npx` each time. ```bash npm install -g lumabrowser lumabrowser start ``` -------------------------------- ### openSetup(opts) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/LlmServerApi.md Opens the setup dialog with the given options. ```APIDOC ## openSetup(opts) ### Description Opens the setup dialog with the given options. ### Method invoke ### Endpoint core.llmServer.openSetup ### Parameters - **opts** (any) - Required - Options for the setup dialog. ### Response No return value. ``` -------------------------------- ### GET /v1/models Source: https://github.com/amurgola/lumabrowser/blob/main/cli/lib/docs/local-api.md Lists the loaded model first, then every installed GGUF. The response carries both OpenAI and Anthropic list fields. ```APIDOC ## GET /v1/models ### Description Lists the loaded model first, then every installed GGUF. The response carries both OpenAI and Anthropic list fields. ### Method GET ### Endpoint /v1/models ### Response #### Success Response (200) - **data** (array) - List of models, loaded model first. - **object** (string) - Type of the response, e.g., "list". #### Response Example { "object": "list", "data": [ { "id": "model-id", "object": "model", "owned_by": "local" } ] } ``` -------------------------------- ### setup.listTabs() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/ChatModesApi.md Lists the extension Setup tabs. Invokes the IPC channel 'core.llmServer.setup.listTabs'. ```APIDOC ## setup.listTabs() ### Description Lists the extension Setup tabs. ### Method invoke ### Endpoint core.llmServer.setup.listTabs ### Parameters None ### Response Returns a list of setup tabs. ``` -------------------------------- ### new ResolutionCacheStore({ store, maxEntries, ttlMs, maxSoftMisses, saveDelayMs, now }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/browser/resolution-cache/ResolutionCacheStore.md Creates a new ResolutionCacheStore instance. Entries load lazily from a snapshot on first use when the store has get and set methods; a load failure warns and starts empty. ```APIDOC ## new ResolutionCacheStore({ store, maxEntries, ttlMs, maxSoftMisses, saveDelayMs, now }) ### Description Creates a new ResolutionCacheStore instance. Entries load lazily from a snapshot on first use when the store has get and set methods; a load failure warns and starts empty. ### Constructor `new ResolutionCacheStore({ store, maxEntries, ttlMs, maxSoftMisses, saveDelayMs, now })` ### Parameters - **store** (object) - Required - The underlying store; must have `get` and `set` methods for lazy loading. - **maxEntries** (number) - Required - Maximum number of entries before eviction. - **ttlMs** (number) - Required - Time-to-live in milliseconds for entries. - **maxSoftMisses** (number) - Required - Maximum consecutive soft misses before an entry is dropped. - **saveDelayMs** (number) - Required - Delay in milliseconds before writing changes; 0 writes immediately. - **now** (function) - Optional - Function returning the current time in milliseconds. ### Public Fields - **store** - The underlying store. - **maxEntries** - Maximum entries. - **ttlMs** - Time-to-live in milliseconds. - **maxSoftMisses** - Maximum soft misses. - **saveDelayMs** - Save delay in milliseconds. - **now** - Current time function. ``` -------------------------------- ### Run development, test, and build commands with npm Source: https://github.com/amurgola/lumabrowser/blob/main/README.md Requires Node 20 and a C++ toolchain, with Visual Studio 2022 Build Tools on Windows for the native SQLite module. Run npm install first, then use npm run dev to start the app, npm test and npm run test:e2e for tests, and npm run build to generate installers for the current platform. ```sh npm install npm run dev # start the app in developer mode npm test # unit tests under Electron npm run test:e2e # end-to-end suites npm run build # installers for the current platform ``` -------------------------------- ### execute(id, { modelsDir, runtimesRoot, detectRuntime, installRuntime, onEvent, isCanceled, handle }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/models/AddonModelSetup.md Executes the full add-on model setup: installs the required runtime if missing, downloads weights, verifies checksum, and writes the sidecar file. Returns the destination path, runtime ID, and sidecar data. ```APIDOC ## execute(id, { modelsDir, runtimesRoot, detectRuntime, installRuntime, onEvent, isCanceled, handle }) ### Description Executes the full add-on model setup: installs the required runtime if missing, downloads weights, verifies checksum, and writes the sidecar file. Returns the destination path, runtime ID, and sidecar data. ### Method `execute(id, options)` ### Parameters - **id** (string) - Required - The identifier of the add-on model entry. - **modelsDir** (string) - Required - The directory where model weights are stored. - **runtimesRoot** (string) - Required - The root directory for runtimes. - **detectRuntime** (function) - Required - A function that detects the runtime for the model. Must resolve a detector row. - **installRuntime** (function) - Required - A function that installs the runtime if missing. Called with `{ runtimesRoot, isCanceled, onEvent }`. - **onEvent** (function) - Required - Event callback for progress and status updates. - **isCanceled** (function) - Required - A function that returns a boolean indicating if the operation has been canceled. - **handle** (object) - Required - An object with a `cancel` property to cancel the download. ### Returns - **Promise<{ destPath, runtimeId, sidecar }>** - Resolves with the destination path, runtime ID, and sidecar data. ### Behavior 1. If `entry.requiresRuntime` is set, `detectRuntime(id)` must resolve a detector row; when the runtime is not installed, `installRuntime(id, { runtimesRoot, isCanceled, onEvent })` runs. 2. Weights download to `destPathFor(entry, modelsDir)`; `handle.cancel` is wired to the live transfer while it runs. 3. When `entry.file.sha256` is set, the file is hashed and compared (case-insensitive); a mismatch deletes the file. 4. The sidecar is written: `{ schema, id, kind, label, requiresRuntime, contextLength, defaultContextSize, bytes, sha256, installedAt, ...entry.sidecar }`. ### Events - `onEvent(type, payload)`: - `start { id }` - `runtime { runtimeId, type, payload }` (nested installer events between `start` and `finalize`) - `model { type, payload }` (nested downloader events) - `verify { read, total }` (at most every 250 ms, plus the final tick) - `sidecar { path }` - `done` A throwing listener never aborts the setup. ### Errors - **ADDON_MODEL_UNKNOWN** - Unknown add-on model. - **RUNTIME_UNAVAILABLE** - No detector row. - **RUNTIME_NOT_INSTALLED** - No `installRuntime`. - **CHECKSUM_MISMATCH** - Checksum mismatch. - **CANCELED** - "Setup canceled.", after the runtime step or when the download was canceled or paused. - A missing `modelsDir` throws. ``` -------------------------------- ### new LlmRuntimeSetup({ llmServerService, installer?, catalog?, pickPath?, platform? }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ipc/LlmRuntimeSetup.md Creates a new LlmRuntimeSetup instance with optional dependencies. Defaults to LlmRuntimeInstaller.shared, LlmRuntimeCatalog.shared, PathPicker.pick, and process.platform. ```APIDOC ## new LlmRuntimeSetup({ llmServerService, installer?, catalog?, pickPath?, platform? }) ### Description Creates a new LlmRuntimeSetup instance. The `llmServerService` is required; other parameters are optional and default to shared instances or platform defaults. ### Parameters - **llmServerService** (object) - Required - The LLM server service. - **installer** (object) - Optional - Defaults to `LlmRuntimeInstaller.shared`. - **catalog** (object) - Optional - Defaults to `LlmRuntimeCatalog.shared`. - **pickPath** (function) - Optional - Defaults to `PathPicker.pick`. - **platform** (string) - Optional - Defaults to `process.platform`. ### Returns - **LlmRuntimeSetup** - A new instance. ``` -------------------------------- ### openSetup(anchor, views, purpose) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/ui/js/voice/VoicePanels.md Opens the setup panel for voice conversation or read aloud, noting the engines run on this computer or on the host. ```APIDOC ## openSetup(anchor, views, purpose) ### Description Opens the setup panel for voice conversation or read aloud, noting the engines run on this computer or on the host. ### Method `openSetup(anchor, views, purpose)` ### Parameters - **anchor** (any) - Required - The anchor element or reference for positioning the panel. - **views** (any) - Required - The views object containing view configurations. - **purpose** (string) - Required - The purpose of the setup, e.g., "Set up voice conversation" or "Set up read aloud". ``` -------------------------------- ### start() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/network-sharing/client/PeerDiscovery.md Starts the discovery process. Idempotent; reads the self id once and starts browsing. ```APIDOC ## start() ### Description Starts the discovery process. Idempotent; reads the self id once and starts browsing. ### Method `start()` ### Parameters None. ### Returns None. ``` -------------------------------- ### start(intervalMs = 15000) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/network-sharing/client/PeerPoller.md Starts the polling loop. It is idempotent, clears persisted backoff, starts an unref'd interval, and polls once immediately. ```APIDOC ## Method: start(intervalMs = 15000) ### Description Starts the polling loop. It is idempotent, clears persisted backoff, starts an unref'd interval, and polls once immediately. ### Parameters #### Parameters - **intervalMs** (number) - Optional - The interval in milliseconds between polls. Defaults to 15000. ### Behavior - Clears persisted backoff. - Starts an unref'd interval. - Polls once immediately. ### Example ```javascript poller.start(15000); ``` ``` -------------------------------- ### run({ resumeFrom }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/shell/ui/wizard/auto/AutoRunner.md Executes the plan through AutoSetup and mirrors the outcome into the guided state. On success, it sets the model file, name, image result, and marks steps as done or resolved. On failure, it captures the error, failed step, and system dependencies. ```APIDOC ## run({ resumeFrom }) ### Description Runs the plan through AutoSetup and mirrors the outcome into the guided state. On success, it sets the model file, name, image result, and marks steps as done or resolved. On failure, it captures the error, failed step, and system dependencies. ### Method run ### Parameters #### Object Parameter - **resumeFrom** (any) - Optional - The point from which to resume the setup. ### Behavior Calls `AutoSetup.run(WizardApis.all(), { plan, resumeFrom, priorFile, ... })`. ### Success Outcome - **model file** - The resulting model file. - **name** - The model name. - **image result** - The image result. - **done** - The LLM step counts as done locally. - **image step** - Resolved (skipped without an image leg). ### Failure Outcome - **error** - Error message. If canceled: "Setup canceled. Your download progress is saved; try again to resume." - **failedStep** - The step that failed. - **sysdeps** - System dependencies. ``` -------------------------------- ### started() Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/network-sharing/host/llm/ResponsesStream.md Emits the 'response.created' and 'response.in_progress' events to signal the start of a response. ```APIDOC ## Method: started() ### Description Emits the 'response.created' and 'response.in_progress' events to signal the start of a response. ### Parameters None. ### Returns No return value. ``` -------------------------------- ### GET /json, GET /json/list Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/cdp-driver/CdpHttpBootstrap.md Returns a list of target descriptors. ```APIDOC ## GET /json, GET /json/list ### Description Returns one descriptor per target, including WebSocket URLs and metadata. ### Method GET ### Endpoint /json or /json/list ### Response #### Success Response (200) - **description** (string) - Target description. - **devtoolsFrontendUrl** (string) - DevTools frontend URL. - **id** (string) - Target ID. - **title** (string) - Target title. - **type** (string) - Target type. - **url** (string) - Target URL. - **webSocketDebuggerUrl** (string) - WebSocket URL for the target. #### Response Example [ { "description": "...", "devtoolsFrontendUrl": "...", "id": "...", "title": "...", "type": "...", "url": "...", "webSocketDebuggerUrl": "ws://..." } ] ``` -------------------------------- ### GET /ai//store Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/index.md Gets the conversation's key-value store. ```APIDOC ## GET /ai//store ### Description Retrieves the entire store for the conversation. ### Method GET ### Endpoint /ai//store ### Parameters #### Path Parameters - **convId** (string) - Required - The conversation identifier for the game. ### Response #### Success Response (200) - The store data. ``` -------------------------------- ### new AutoPlanner().plan(args) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/models/AutoPlanner.md Generates a complete install plan based on hardware detection and user preferences for image and music models. Returns a structured recommendation including model selections, GPU placement, tier, summary, and RAM pin advice. ```APIDOC ## new AutoPlanner().plan(args) ### Description Generates a complete install plan based on hardware detection and user preferences for image and music models. Returns a structured recommendation including model selections, GPU placement, tier, summary, and RAM pin advice. ### Method plan ### Endpoint new AutoPlanner().plan(args) ### Parameters #### Request Body - **hw** (HwBudget) - Required - A HwBudget result. - **devices** (Array) - Optional - CUDA rows `{ index, totalBytes }`; empty on non-CUDA hosts. - **wantImage** (boolean) - Required - Whether image models are desired. - **wantMusic** (boolean) - Optional - Whether music models are desired. - **llmModels** (CuratedModelCatalog.MODELS) - Required - The catalog of LLM models. - **imageModels** (Array) - Optional - The catalog of image models. - **musicModels** (Array) - Optional - The catalog of music models. - **musicEligibility** (Object) - Optional - Contains `wslReady` boolean; `false` only when known missing. - **cpuMoeSupported** (boolean) - Optional - Default `true`; indicates CPU MoE support. ### Response #### Success Response - **llm** (LlmRecommendation) - The chat model recommendation. - **image** (Object|null) - `{ modelId, label, approxTotalBytes, minVramBytes, offload }` or null. - **music** (MusicLegPlanner) - Music model recommendation. - **placement** (Object) - `{ kind: 'none'|'coexist'|'singularity'|'fcfs', card, layout }`; singularity carries a v2 PlacementLayout. - **tier** (HardwareTiers) - The hardware tier row. - **summary** (Array) - Plain-language summary lines. - **ramPin** (RamPinAdvice) - RAM pin advice. #### Response Example { "llm": {}, "image": {}, "music": {}, "placement": { "kind": "none" }, "tier": {}, "summary": ["No model in the catalog fits this machine."], "ramPin": {} } ``` -------------------------------- ### Keyboard input setup and usage Source: https://github.com/amurgola/lumabrowser/blob/main/extensions/game-mode/docs/phaser3-input-and-camera.md Shows how to create cursor keys, add custom keys, and listen for key events. Includes checking key states in update() and using JustDown for edge-triggered actions. ```javascript // In create(): this.cursors = this.input.keyboard.createCursorKeys(); // up/down/left/right/space/shift this.keys = this.input.keyboard.addKeys('W,A,S,D,SPACE,ENTER,ESC'); const jump = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); // In update(): if (this.keys.A.isDown) { ... } // held if (Phaser.Input.Keyboard.JustDown(jump)) { ... } // edge-triggered (fires once per press) // Event style (menus): this.input.keyboard.on('keydown-ENTER', () => this.scene.start('Game')); ``` -------------------------------- ### GET /ai//store/:col Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/index.md Gets a specific collection from the conversation's store. ```APIDOC ## GET /ai//store/:col ### Description Retrieves a collection from the store. ### Method GET ### Endpoint /ai//store/:col ### Parameters #### Path Parameters - **convId** (string) - Required - The conversation identifier. - **col** (string) - Required - The collection name. ### Response #### Success Response (200) - The collection data. ``` -------------------------------- ### onShowSetup(cb) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/llm-server/preload/LlmServerApi.md Subscribes to show setup events. Returns a detach function. ```APIDOC ## onShowSetup(cb) ### Description Subscribes to show setup events. Returns a detach function. ### Method subscribe ### Endpoint core.llmServer.showSetup ### Parameters - **cb** (function) - Required - Callback function for show setup events. ### Response Returns a detach function to unsubscribe. ``` -------------------------------- ### start(port, host = '127.0.0.1') Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/extensions/cdp-driver/CdpServer.md Starts the CDP server on the specified port and host, resolving the bound port. ```APIDOC ## Method: start(port, host = '127.0.0.1') ### Description Starts the CDP server on the given port and host. Resolves the bound port. ### Parameters - **port** (number) - Required - The port to listen on. - **host** (string) - Optional - The host to bind to. Defaults to '127.0.0.1'. ### Returns - **Promise** - Resolves to the bound port. ``` -------------------------------- ### start({ env, initConfig, timeoutMessage }) Source: https://github.com/amurgola/lumabrowser/blob/main/Documentation/core/tts-server/runtimes/SherpaWorkerProcess.md Starts the worker process, sends an init message, and waits for the ready handshake. ```APIDOC ## start({ env, initConfig, timeoutMessage }) ### Description Forks the worker with the given environment, posts an init message, and resolves when the worker sends a ready message. Rejects on init-error, exit, or timeout. ### Method start ### Parameters - **env** (object) - Required - Environment variables for the worker process. - **initConfig** (object) - Required - Configuration object sent in the init message. - **timeoutMessage** (string) - Required - Message to use when the ready timeout occurs. ### Behavior - Forks with `{ serviceName, stdio: 'pipe', env }`. - Posts `{ type: 'init', config }`. - Resolves on `{ type: 'ready', ... }` message. - Rejects on `init-error` (text, else `