Skip to main content

Built-in Plugins

Mahresources ships with nine plugins in the plugins/ directory. They are not enabled by default. Enable them from the plugin management page or via the API.

The data-views, meta-editors, and widgets plugins register shortcodes for use in a category's custom template slots (see Custom Templates) and entity descriptions. Full interactive documentation is available on each plugin's documentation page after enabling: shortcode pages render their supplied examples, while documented note-block pages show their defaults, validation schemas, filters, and a safe view-mode preview whenever the block can render without live data.

All nine ship an api_version = 1 manifest, and enabling one is your consent to exactly the capabilities it declares. See Plugin Permissions for what each capability grants.

PluginDeclared capabilitiesNetwork
data-viewsdb:read, inject, rendernone
meta-editorsinject, rendernone
widgetsdb:read, rendernone
example-blocksrendernone
example-pluginhooks, inject, pagesnone
fal-aidb:read, db:write, http, image, actions, jobs, pagesthe fal.run, fal.ai and fal.media host families
project-managementdb:read, db:write, render, pages, api, kv, actions, hooks, schedulenone
ketchupdb:read, pages, inject, actionsnone
location-historydb:read, kv, actions, pages, api, hooksbrowser map tiles from OpenStreetMap

fal-ai is the only one that makes server-side network requests. Location History loads background map tiles from OpenStreetMap in the browser.

data-views​

Data visualization shortcodes for rendering metadata values, charts, and tables. The chart shortcodes render as pure HTML/CSS or SVG with no JavaScript. Two shortcodes are exceptions: qr-code renders client-side via an injected JavaScript encoder, and json-tree uses Alpine.js directives for its collapse/expand behavior.

ShortcodeDescription
badgeColored status badge from a meta field value
formatFormatted value display (currency, percent, date, filesize, number, duration)
stat-cardCard with label, value, and optional icon
meterHorizontal gauge bar with min/max/value
sparklineInline SVG sparkline from an array meta field
tableTable of entities owned by the group, or of an MRQL query result (columns via cols/labels)
listVertical list from an array meta field
count-badgeBadge showing the count of items in an array meta field
embedText content of a resource (by ID or path), base64-decoded into a scrollable code block
imageImage display from a meta field containing a URL or resource ID
barcodeCode 128 barcode SVG from a meta field value
qr-codeQR code SVG from a meta field value or literal string
link-previewCard linking to a URL, showing the URL and its domain from a meta field
json-treeCollapsible JSON tree view of a meta field
bar-chartHorizontal bar chart from an object or array meta field
pie-chartSVG pie chart from an object or array meta field
timeline-chartHorizontal timeline from an array of date-range objects

Usage: [plugin:data-views:badge path="status"]

meta-editors​

Inline editing shortcodes for entity metadata fields. Each shortcode renders an Alpine.js component that saves changes via the editMeta API endpoint. Changes persist immediately without a full page reload.

ShortcodeDescription
sliderRange slider with min/max/step
stepperIncrement/decrement numeric input
star-ratingClickable star rating (1-N)
toggleBoolean on/off switch
multi-selectCheckbox group for selecting multiple values from a list
button-groupSingle-select button row
color-pickerColor input with hex value
tags-inputFree-form tag chips with add/remove
textareaMulti-line text editor
date-pickerDate input
date-rangeStart and end date inputs
status-badgeClickable badge that cycles through defined statuses
progress-inputEditable progress bar (0-100)
key-valueAdd/edit/remove key-value pairs
checklistCheckbox list with add/remove
url-inputURL input with validation and clickable link
markdownMarkdown text editor (monospace textarea, debounced auto-save, no rendered preview)

Usage: [plugin:meta-editors:slider path="rating" min=0 max=10 step=1]

widgets​

Dashboard-style shortcodes for category custom templates. These query owned entities to build summaries, galleries, and hierarchy views.

ShortcodeDescription
summaryEntity count dashboard (owned resources, notes, and sub-groups)
galleryThumbnail grid of owned image resources with lightbox (for a group that owns no images, falls back to its group-related resources)
progressProgress bar driven by a meta field value
activityTimeline of recently updated owned entities
treeGroup hierarchy visualization (ancestors and children)

Usage: [plugin:widgets:summary]

example-blocks​

Demonstrates custom plugin block types for the note block editor via mah.block_type().

Block TypeDescription
counterA click counter block with label editing and +1 increment

Usage: Enable the plugin, then add a "Counter" block in the note block editor.

example-plugin​

Reference implementation demonstrating the plugin API: injections, hooks, pages, menus, settings, and the database/HTTP/KV APIs. Most API calls are commented out to serve as copy-paste examples.

FeatureDescription
Page injectionFooter banner controlled by a boolean setting
HooksLogs note and resource creation events
Custom page/plugins/example-plugin/info displays the greeting setting
Menu item"Plugin Info" links to the custom page

fal-ai​

AI-powered image processing using fal.ai. Requires a FAL.AI API key configured in plugin settings. The plugin registers seven resource actions (available from the resource detail view, and some from resource cards in list views) plus a Generate Image page.

Supported input formats: PNG, JPEG, WebP, GIF, TIFF, BMP. SVG inputs are filtered out; Vectorize produces SVG output from a raster source.

Actions​

ActionPlacementDescription
colorizedetail, cardColorize black and white images (DDColor or Topaz Colorize)
adjustdetail, cardCorrect exposure/lighting or white balance (Topaz Adjust)
upscaledetail, cardIncrease resolution -- choose from several upscaling models
restoredetail, cardRestore and enhance old or damaged photos -- several restoration models
edit (AI Edit)detailEdit an image from a text prompt; supports multiple input images
vectorizedetail, cardConvert a raster image to an SVG (always creates a new resource)
polishdetailSharpening finishing pass (post-processing), typically run after a restore

Model options per action​

Several actions expose a model selector that switches the underlying fal.ai endpoint. Each model has its own parameters, which appear only when that model is selected (see Conditional parameters below).

  • colorize models: ddcolor (default, fast photographic colorization) and topaz_colorize (Topaz Labs' current professional colorization pass).
  • adjust models: adjust_v2 (default: exposure and lighting) and white_balance (color-cast correction). Both preserve source resolution.
  • upscale models: clarity (default), crystal, esrgan, creative, seedvr, bria_creative, topaz (Topaz Precision), topaz_generative, topaz_creative, topaz_transparent, drct, aura_sr. The August 2026 Topaz family is split by intent: faithful precision, missing-detail reconstruction, creative Bloom enhancement, or fixed 4x alpha-preserving PNG. drct and aura_sr remain degradation-aware choices for JPEG-compressed sources; seedvr offers a seamless-tiling endpoint for repeating textures.
  • restore models: photo_restoration (default), codeformer, nafnet_denoise, nafnet_deblur, topaz_restore, and topaz_denoise. Topaz Restore offers Recover 3 and Dust-Scratch V2; Topaz Denoise ranges from Normal through generative Denoise Max. The older photo_restoration endpoint is still the combined color/scratch fix, but always reshapes to a fixed 4K aspect-ratio enum. SwinIR (swin2sr) was removed in October 2026 after fal.ai deprecated its endpoint; Topaz Restore covers degraded non-portrait photos.
  • edit (AI Edit) models: flux2 (default), flux2pro, flux2max, flux2flash, flux2flex, flux3, flux3klein, nanobanana2, nanobanana21, nanobananapro, nanobanana_lite, gptimage25_flare, gptimage25_sunburst, gptimage2, qwen3, mai25, mai25pro, ideogram_v4, seedream5lite, seedream5, grok2, muse, fibo15, krea3, and flux1dev. FLUX 3 is Black Forest Labs' newest editor with native 2K/4K output, and FLUX.3 Klein its small, low-cost open-weights sibling; Nano Banana 2.1 improves character consistency over Nano Banana 2; Krea 3 offers a quality (berry) or speed (jam) variant. Meta Muse focuses on precise coherent multi-reference edits; Bria Fibo Edit 1.5 is trained for commercially safe composites; Nano Banana Lite favors low latency. Each model reveals only its own live-schema controls, including seed, thinking, web search, system prompt, background, prompt expansion, and safety switches where supported.
  • polish models: post_processing (default: basic, smart, or CAS sharpening) and topaz_sharpen (blur-specific Topaz presets plus generative Super Focus).

Conditional parameters​

Action parameters use show_when conditions, so the form reveals only the inputs relevant to the current selection. Every fal.ai action parameter carries concise inline help, and every model selector reveals a short strengths/tradeoffs card before its controls. Nested controls are also conditional: for example, Topaz Redefine reveals prompt/creativity/texture fields that other Topaz Generative presets do not use.

How images reach fal.ai​

Each input image is uploaded to fal's CDN first (kept for an hour), and the request names it by URL, which is the way fal recommends passing files. If the upload fails, the image is sent inline as a base64 data URI instead, so a CDN problem slows a run down rather than failing it. While a request runs the plugin checks its status every half second, then every second after 10 seconds and every 2 seconds after a minute.

Output mode​

Every action except vectorize includes a Save Result As toggle:

  • version (default) -- adds the result as a new version of the source resource.
  • clone -- creates a new resource, copying the source's name (with an action suffix), description, owner, metadata, tags, groups, and notes.

vectorize always clones, since its SVG output cannot be a version of a raster source.

Multiple input images​

The edit (AI Edit) action accepts more than one input image through an extra_images entity-reference parameter (a resource picker, up to nine images). It defaults to the triggering resource, and the user can add or remove images. mai25, mai25pro, ideogram_v4 and flux1dev take a single image; every other model consumes the extra images. Per-model ceilings are enforced with explicit errors where fal.ai would truncate or reject opaquely: qwen3 and grok2 accept three; flux2, flux2flash and fibo15 accept four; krea3 accepts eight. flux3, flux3klein, seedream5lite, seedream5 and muse accept ten, nanobanana21 fourteen, and gptimage2 and the GPT Image 2.5 models sixteen (more than the picker allows).

Generate Image page​

The plugin also adds a Generate Image page (/plugins/fal-ai/generate, linked from the plugin menu) for text-to-image generation. It runs as an asynchronous job and supports nanobanana2 (default), nanobanana21, nanobananapro, nanobanana_lite, gptimage25_flare, gptimage25_sunburst, flux3, flux3klein, krea3, qwen3, seedream5lite, mai25, mai25pro, ideogram_v4, recraft_v4_style, recraft_v4_style_pro, krea2_style, gptimage2, seedream5, grok2, muse, and fibo15. The withdrawn Imagen 4 preview endpoints were removed after their live schemas and queue routes began returning 404. Generated images are saved as new resources.

The page renders a documented union of prompt, sizing, format, seed, quality/background, safety, Nano Banana advanced controls, and Bria style preset. Each model receives only the fields its own schema declares:

SettingHow each model receives it
ResolutionSnapped to the nearest native tier. Nano Banana Pro, Nano Banana 2.1 and FLUX 3 have no 0.5K; Grok stops at 2K; Lite, GPT Image 2, Seedream, and Muse auto-size; Fibo maps the union to 1MP or 4MP.
Aspect ratioPassed through where supported. GPT Image 2 and Seedream receive the closest image_size preset instead.
Safety toleranceSent to the Nano Banana family. FLUX 3 receives it one level lower on its integer 0-4 scale (5 and 6 both become 4). Seedream maps levels 1-2 to its boolean checker; models without a tolerance field ignore it.
FormatSent where supported. Seedream maps WebP to JPEG, while Fibo uses its endpoint-native result format.
Advanced controlsSeed, GPT/Grok quality, GPT background, Nano Banana thinking/system prompt/web search (Nano Banana 2.1 cannot turn thinking off, so Off sends minimal), prompt expansion (Qwen, FLUX 3, Klein), and Fibo style preset are each sent only to models that declare them.

project-management​

A project tracker built on the host's own entities: projects are groups in the PM Project category, epics are groups in the PM Epic category owned by their project, and tasks are notes of the PM Task type (status, priority and an order key in the note meta, due/start on the note's native dates). The plugin page serves a kanban board, a filterable backlog, a dashboard and a due-date timeline, all rendered client-side from the ordinary /v1/notes endpoint; every mutation runs through the plugin's own API, which validates statuses and dates and does the ordering inside a transaction. Tasks remain plain notes — searchable, mass-edit-able and group-export-able. The provisioned taxonomies also carry native detail, summary, hover, list and MRQL templates, and PM Task notes gain Acceptance criteria, Status update, Subtasks, Dependencies and Time log blocks. Native pages support task edits and bulk actions; project pages include mini boards whose column counts come from stored rollups once a group has one. Version 1.1.0 requires an administrator to re-enable the plugin for its new grants, then run Set up to upgrade bundled presentation defaults.

Because it needs two categories and a note type, the plugin provisions them in an explicit Set up step (admin only) rather than in init(). See Project Management for the full story, the settings and the known limits.

ketchup​

Draw new images and edit existing ones in Ketchup, a browser drawing app with brushes, shapes, text, stamps, layers, crop and transforms. The editor runs in your browser on the plugin's edit page (/plugins/ketchup/edit), and saves back to the library as you:

Starting pointWhereSaving
Edit in KetchupSidebar of a PNG, JPEG, WebP or BMP resource, and the card menu on resource listsSave as new version uploads the edit as a new version of the resource. Save as new resource files it as a separate resource, named after the original with "(edited)" and owned by the same group, instead. Tags, notes and other groups are not copied.
New image in this groupSidebar of a groupSave to library creates a resource owned by the group.
New ImagePlugins menuSave to library creates a resource with no owner.

After a new image is first saved, the page switches to editing that resource, so saving again adds a version. Ctrl/Cmd+S saves too.

  • What is saved is the flattened image: every visible layer, at the image's own size. Layers, history and stamps last only for the editing session; closing the page with unsaved changes asks first.
  • Formats stay as they were: a PNG or WebP keeps its transparency, a JPEG is saved as a JPEG (quality 0.92), and a BMP is saved as a PNG because browsers cannot encode BMP. A browser that cannot encode WebP (Safari) saves a WebP edit as PNG. GIFs are not offered, since only their first frame would survive.
  • Duplicates. Creating a resource (Save to library, Save as new resource) from bytes that are already the current file of a resource you can see is refused as a duplicate, with a link to the resource that has them, when you save with no group, or when that resource's owner is your group or it is already linked to your group. Otherwise mahresources links that resource to your group instead, and the editor says so and stays on your drawing rather than switching to that resource. A new resource saved from an unchanged image is the usual way to meet this. New versions are not checked for duplicates.
  • Access. Loading and saving go through the ordinary resource API as the signed-in user, so the plugin needs no write capability and reaches nothing the user could not. A group-limited account can use the editor only once an operator allows it for this plugin on /plugins/manage. An account that can only read (a guest) can open the editor, and is told that it cannot save.

Settings: New image width and New image height (default 1200 × 800 pixels) size a new drawing.

The editor itself is Ketchup's embeddable build, committed as plugins/ketchup/public/ketchup.js so the plugin needs no internet access. Its first line names the Ketchup commit it was built from. To update it, run ./scripts/update-ketchup.sh <ref> with a Ketchup branch, tag or commit: it builds that ref from a clean clone and writes the stamped result to the plugin and to its copy in e2e/test-plugins/ketchup.

location-history​

Import a Google location export and ask it where you were. Upload the JSON file and run Import location history on it (resource sidebar or card menu). Then open Location History from the Plugins menu (/plugins/location-history/query).

FileWhere it comes from
Timeline Edits.jsonGoogle Takeout, Takeout/Timeline/. Since Google moved Timeline onto the phone, this is what Takeout exports: raw position fixes plus the visits and trips the phone inferred or you edited.
Timeline.jsonExported from Timeline's settings on the phone. Both the Android object and the iOS array layouts are read.
Records.jsonOlder Takeout Location History exports.
YYYY_MONTH.jsonOlder Takeout "Semantic Location History" month files.

Upload the JSON file itself; the plugin cannot read inside a .zip. The file is read one entry at a time (see mah.db.each_resource_json), so its size is not limited by memory, but an import must finish within the 5-minute limit on background plugin work: a 254 MB phone export of 2.6 million positions took about 100 seconds on a development machine, which puts the practical limit at a few hundred megabytes. A larger import fails with a timeout. That file's earlier import, if it had one, is lost with it, and the part already written is cleaned up as described under Storage. Importing a file again replaces its earlier import.

The page opens with an interactive map of the latest recorded day. Pick another day, use Previous day / Next day, or choose an import to explore. Blue dots are recorded fixes, green dots are visits, and amber dots are trip endpoints; the map does not draw an inferred route between them. Fit day brings the day's locations into view. A day shows at most 2,000 fixes and 500 located visits and trips across the selected imports, with a notice when the display is incomplete; the counts describe the whole day. Auto uses the latest selected import's usual UTC offset, or UTC when none was recorded.

Click the map or a visit below it to fill the nearby search's coordinates, then set a radius; its circle updates as you type. Keyboard users can focus the map, pan with arrow keys, zoom with +/−, and choose Use map center. The visit list also offers keyboard-accessible place buttons, including separate start and destination buttons for trips.

How often was I near…? also has its own map picker beside the coordinate and radius fields. Click that map to choose a place, or enter coordinates directly; both maps show the same selection and search circle. The picker centers on your selection as you type. Keyboard users can pan/zoom it and press Use picker center. Choosing a place fills the coordinates; press Count to run the search.

The Recorded fix selector exposes each displayed fix's time, coordinates and reported accuracy. Choose a fix and press Use recorded fix to center the map and fill the nearby search's coordinates using the keyboard.

Time-query results also expose their plotted positions under Query locations. Those buttons select the estimate, surrounding fixes, or trip endpoints even when they are outside the displayed day.

The page answers two questions, updating the answer and map without a reload:

  • Where was I? Give a date and time. The answer is the visit or trip covering it (one you edited wins over the one Google inferred), plus the last fix before and the first fix after. Your position is the visit's place, or else interpolated between fixes no more than two hours either side. The time is read in the zone your timeline recorded around then ("Auto"), or in the zone you pick; a time typed with its own offset (2026-04-27T10:30:00+02:00, API only) is taken as given.
  • How often was I near…? Give a place as latitude, longitude, a radius in metres, and optionally a date range. Visits whose place is inside the radius, and runs of fixes inside it, count as one time there each; overlapping ones merge. A run ends when a fix lands outside the radius (counting its accuracy, so a vague fix does not end it) or after an hour with no fix. The summary gives the number of times, distinct days, total time, and first and last; the times are listed newest first, up to 500.

Positions link to OpenStreetMap, and the estimated position and every visit link to a "How often was I here?" query.

The map code (Leaflet 1.9.4) ships with the plugin, so no external script service is required. Background tiles require internet access: OpenStreetMap receives your IP address, the app's origin and the map area you view. Tile requests set an origin-only referrer policy to identify the application as required by OpenStreetMap; the page path and location query parameters are not sent in that header. Recorded data comes from your server; if tiles fail to load, locations and search controls still work. Text queries and their ordinary GET forms also work without JavaScript.

The same queries are JSON endpoints, for scripts:

curl "http://localhost:8181/v1/plugins/location-history/imports"
curl "http://localhost:8181/v1/plugins/location-history/day?date=2026-04-27&offset=120"
curl "http://localhost:8181/v1/plugins/location-history/at?time=2026-04-27T10:30&offset=auto"
curl "http://localhost:8181/v1/plugins/location-history/near?point=50.5818,8.6725&radius=150&from=2026-04-01&to=2026-04-30"

offset is auto or whole minutes east of UTC (120 for UTC+02:00); resource limits a query to one import.

The day endpoint requires a valid date between 1990 and 2099. Its points array contains [epoch_seconds, latitude, longitude, accuracy_metres, resource_id] tuples. segments contains located visit/trip objects in the same shape as an at answer's segment, plus resource_id. point_count and segment_count count the day's located records, while truncated indicates the display caps were exceeded. Day boundaries use the returned offset_minutes; overnight visits are included even when they started in an earlier month.

  • Storage. The parsed data lives in the plugin's key-value store, bucketed by month, not in notes. Forget on the page, deleting the resource, or purging the plugin's data removes it. Deleting the resource removes it straight away unless the plugin is busy (an import running), in which case the import notices the delete when it finishes and keeps nothing. With more than one server process, an import or forget of a file waits for one already writing that file in another process: the import fails with a "try again" message and Forget asks you to try again. Then, and for what an interrupted import left behind, a cleanup removes it the next time an administrator with no group scope opens the page or calls an endpoint (at most every ten minutes). Only such an administrator can tell a deleted resource from one outside their scope.
  • Limits. One import may hold at most 4,000,000 positions and 400,000 visits and trips (ten years of a dense phone history is under three million and a hundred thousand), and one "How often" question may count at most 1,000,000 separate visits and stays; past a limit the import fails before writing anything, so an earlier import of the same file stays as it was, and the question asks you to narrow it. All three are plugin settings. Place names, place IDs and types are kept to 200 bytes each, and a UTC offset outside −12:00 to +14:00 is ignored.
  • Access. Every query first reads the resource the import came from as you, so an account sees only imports of resources it can read. Guests cannot forget an import.
  • Size. An import holds every position in memory, compactly, until it has sorted and stored them: a 254 MB export raised the server's memory by about 300 MB while it ran. While an import runs, the plugin's page and endpoints wait for it. A "How often" question over a whole decade of dense history reads every month near the place and can take 10–20 seconds.

Enabling a Plugin​

Via the UI:

  1. Navigate to the plugin management page
  2. Click Enable on the plugin

Via the API:

curl -X POST http://localhost:8181/v1/plugin/enable -d "name=data-views"

Via the CLI:

mr plugin enable data-views

Plugin Documentation Pages​

After enabling a plugin, its documentation page shows registered shortcodes with descriptions, parameters, and live previews using example data. It also shows every documented custom note block with its full type, default content and state, JSON Schema validation rules, availability filters, and a read-only view preview when the default renderer does not need live data. Preview renders receive no viewer identity, request data, or plugin settings, and cannot call host data, network, KV, media, download, job, or sleep APIs; a preview is omitted if the renderer attempts any of them. Access it from the plugin management page by clicking the View documentation link shown under the plugin (present only when the plugin ships docs).