Advanced

URL Config Sharing

Load complete model configurations from a single URL

This guide covers URL config sharing, which encodes a complete model in a link. Opening the link restores the structure, optics, Sweep, and Optimizer configuration for quick reproduction and remote collaboration.

The link has the following form:

https://tmm.dreapex.com/#config=<base64url>

When to Use

ScenarioRecommended
Drop a one-click reproduction link in chatURL sharing
Cross-machine migration of a complete model + compute preferencesPrefer .tmm.json file
AI agent in a remote browser hands a result back to the userURL sharing (link generated by the agent)
Long-term archival.tmm.json file

URL sharing is a one-shot, short-term reproduction tool: payloads have a size cap, URLs grow with model complexity, and they get truncated when forwarded through chat tools. For long-term storage, prefer .tmm.json files.

URL Payload Shape

The encoded object equals the localStorage autosave snapshot plus an optional settings:

{
  version: 1,
  savedAt: string,
  data: {
    structure:    StructureElement[],
    optics:       Optics,
    surroundings: Surroundings,
    sweepList:    SweepItem[],
    optimizer: {
      objectives:        OptimizationObjective[],
      variables:         OptimizationVariable[],
      algorithmSettings: GridOptimizationSettings
    }
  },
  // Only present in URL sharing; not in localStorage snapshots
  settings?: SettingsState
}

Pipeline: JSON → DEFLATE → base64url → URL hash. No backend call at any step.

Import Rules

Data categoryImport behavior
Model data (data)Applied directly with per-module Zod validation; failed modules fall back to defaults
Performance settingsA confirmation dialog appears only if at least one shared value is greater than the current value; remaining fields are silently skipped
Theme, language, other preferencesNot imported (treated as local user preferences)
Computed resultsNot included (large and recomputable)

Only four performance fields are eligible for import: maxConcurrentRequests, maxSweepCombinations, maxCalculationDataPoints, maxSingleRequestDataPoints. The pattern lets the sender raise the user's safety thresholds enough to fully run the shared model — without quietly lowering settings the user has already configured.

Priority vs. Local Autosave

If the URL hash contains #config= at startup:

  1. URL config import runs first.
  2. Even if it fails, and even if the hash is immediately cleared, the localStorage autosave restore is skipped for this session.
  3. Subsequent edits resume the normal autosave flow.

This respects the user's explicit intent to load a shared link, preventing old autosave data from silently overwriting the freshly imported model.

Size Safety

If the encoded base64url string exceeds 50,000 bytes, link generation is rejected. Typical configurations compress to 0.4–4 KB, well below the cap; the limit usually only matters when very deep stacks, large sweep combinations, and a large incident-spectrum file all stack up.

Agent / Remote Browser Side

With the debug bridge enabled (?simulation_debug=1 in the URL), the browser console exposes:

const url = window.__SIMULATION_DEBUG__.getShareableUrl()

This returns the full shareable link for the current model, so a remote AI agent can hand it back to the user. Production pages do not expose this interface by default.

Failure Toasts

ToastMeaningWhat to check
Loaded configuration from shared linkAll modules imported successfullyNothing
Shared link partially importedSome modules had invalid shape and fell back to defaultsInspect the module list in the toast
Shared link import failedPayload corrupted or undecodableURL was likely truncated in transit; ask sender to resend the full URL

When to Pick .tmm.json vs URL

Dimension.tmm.json fileURL sharing
Practical size limitEffectively none50,000 bytes after base64
Truncation riskNoneHigh in chat / email previews
CoverageModel snapshot onlyModel snapshot + selected performance settings
Archival-friendlyYesNo
One-click reproductionNo (recipient must download)Yes (open link, done)

A common combination: send the link for fast reproduction, and archive the matching .tmm.json file in the project directory.

Copyright © 2026 Dreapex