{
  "format": "odb-inspection/1",
  "executed": false,
  "source": {
    "path": "components/examples/number-display/1.0.0/display.js",
    "sha256": "df9575a3932a2f8fd966b8cf8724b63db60584b40aa9ce2bd2acaf21bad8a62c",
    "build": "No build step; artifact and source are the same JavaScript file.",
    "text": "// SPDX-License-Identifier: AGPL-3.0-or-later\n// Runs in an opaque-origin sandbox, receiving only validated scalar messages.\nclass OdbScalarDisplay extends HTMLElement {\n  connectedCallback() {\n    this.innerHTML = '<style>:host{display:block;font:16px system-ui;color:#eee;padding:20px}output{display:block;font-size:40px;margin:8px 0}small{color:#b8b8ce}</style><strong></strong><output aria-live=\"polite\">Ready</output><small>Waiting for a session</small>';\n  }\n  update(sample) {\n    this.querySelector('strong').textContent = sample.label || 'Measurement';\n    this.querySelector('output').textContent = sample.value === null ? 'Stopped' : `${Number(sample.value).toLocaleString(undefined, {maximumFractionDigits: 6})} ${sample.unit}`;\n    this.querySelector('small').textContent = sample.value === null ? 'No current measurement' : `${sample.source} · ${new Date(sample.timestamp).toLocaleTimeString()}`;\n  }\n}\ncustomElements.define('odb-scalar-display', OdbScalarDisplay);\nconst display = document.createElement('odb-scalar-display');\ndocument.body.append(display);\naddEventListener('message', event => {\n  if (event.source !== parent || event.data !== 'odb-ui-connect/1' || event.ports.length !== 1) return;\n  const port = event.ports[0];\n  port.onmessage = ({ data }) => {\n    if (data?.format !== 'odb.scalar/1' || !(data.value === null || Number.isFinite(data.value)) || typeof data.unit !== 'string' || typeof data.timestamp !== 'number' || typeof data.source !== 'string') return;\n    display.update(data);\n  };\n  port.start();\n}, { once: true });\n"
  },
  "behavior": "Displays only validated scalar data received over its private MessageChannel. The host creates an opaque-origin iframe with network access blocked by CSP. Stop removes the frame and releases the channel. No browser permissions, filesystem or parent DOM are exposed.",
  "ports": {
    "samples": {
      "direction": "in",
      "kind": "stream",
      "contract": "odb.scalar/1"
    }
  },
  "parameters": {},
  "fixtures": [],
  "evidence": []
}