Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Ship twelve creative and engineering harnesses with verified previews (#118)

Dee89bfc11bc22f
diff --git a/store/agents/data-studio/.gitignore b/store/agents/data-studio/.gitignore
new file mode 100644
index 000000000..b0ab68025
--- /dev/null
+++ b/store/agents/data-studio/.gitignore
@@ -0,0 +1,3 @@
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/data-studio/AGENTS.md b/store/agents/data-studio/AGENTS.md
new file mode 100644
index 000000000..6377174f1
--- /dev/null
+++ b/store/agents/data-studio/AGENTS.md
@@ -0,0 +1,13 @@
+# Data Studio
+
+Read the `data` skill. Build an exploratory dashboard around the user's actual data and question.
+The starter uses `index.html`, `dashboard.mjs` and `data.mjs`, with `data.csv` as its source.
+The shared viewer serves local modules and data; no CDN, build step or separate server is needed.
+
+Preserve the meaning of the data: units, missing values, time order and filtering rules must be
+explicit. A load or parsing error is an error, never a reason to silently substitute sample data.
+Derive axes, labels, groups and totals from the source rather than hardcoding the starter's values.
+
+Provide useful filters, exact-value inspection, a clear empty state and a downloadable selection.
+Keep `proof.json` current. `update-verdict.sh` now runs a real browser proof, not a file-existence
+check. Inspect the screenshot and exercise changed datasets before reporting completion.
diff --git a/store/agents/data-studio/LICENSE b/store/agents/data-studio/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/data-studio/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/data-studio/PROVENANCE.md b/store/agents/data-studio/PROVENANCE.md
new file mode 100644
index 000000000..99dcadec8
--- /dev/null
+++ b/store/agents/data-studio/PROVENANCE.md
@@ -0,0 +1,5 @@
+# Data Studio provenance
+
+The dashboard, CSV parser, aggregation, starter data, instructions and tests are original
+OpenHarness work, licensed MIT. The starter does not include D3, Plotly or any chart-library CDN.
+`data.csv` is synthetic demonstration data, not a report of real business results.
diff --git a/store/agents/data-studio/README.md b/store/agents/data-studio/README.md
new file mode 100644
index 000000000..a821b54af
--- /dev/null
+++ b/store/agents/data-studio/README.md
@@ -0,0 +1,28 @@
+# Data Studio
+
+Drop a CSV into a working analytical dashboard. Change measures, compare groups, narrow the period,
+switch between trends and bars, inspect exact values and export the filtered rows. Charts and
+summaries derive from your data. Errors and empty selections stay visible.
+
+The starter runs entirely locally with no chart-library CDN. It includes a quoted-field CSV parser,
+safe imports and keyboard-accessible point inspection. Browser imports are temporary until exported.
+The default view expects two text dimensions plus a numeric measure; the agent can adapt that schema.
+
+Try: “Compare regional revenue across quarters, show what changed, and let me explore the raw rows.”
+
+Choose **Data Studio** in the Harness Store, then New Harness and an empty folder. Local development:
+
+```sh
+harness dsh install "$PWD/store/agents/data-studio" --link
+harness dsh doctor autonomous/data-studio
+```
+
+Requires Node 20+ and the shared Web Viewer. Browser proofs are optional development tooling, but
+the readiness helper requires a successful real-browser check; file existence is not proof.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/data-studio/harness.json b/store/agents/data-studio/harness.json
new file mode 100644
index 000000000..535a46d99
--- /dev/null
+++ b/store/agents/data-studio/harness.json
@@ -0,0 +1,35 @@
+{
+ "spec": 1,
+ "id": "autonomous/data-studio",
+ "name": "Data Studio",
+ "category": "Data",
+ "author": "OpenHarness contributors",
+ "description": "Turn CSV into a local interactive dashboard with dynamic metrics, filtering, exact-value inspection, safe imports and selection export.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "index.html",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "DATA_TOOLCHAIN": "${dsh}/toolchain",
+ "DATA_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [
+ ".html"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/data-studio/package.json b/store/agents/data-studio/package.json
new file mode 100644
index 000000000..dd9647a1e
--- /dev/null
+++ b/store/agents/data-studio/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@autonomous/data-studio-harness",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test test/*.test.mjs",
+ "perf": "node skills/data/scripts/perf.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+}
diff --git a/store/agents/data-studio/skills/data/SKILL.md b/store/agents/data-studio/skills/data/SKILL.md
new file mode 100644
index 000000000..03ad0e811
--- /dev/null
+++ b/store/agents/data-studio/skills/data/SKILL.md
@@ -0,0 +1,38 @@
+---
+name: data
+description: Build and verify interactive CSV dashboards in Data Studio, with truthful metrics, filtering, inspection and export.
+---
+
+# Data Studio
+
+Read the source before choosing a chart. `data.mjs` contains the tested CSV parser and aggregation;
+`dashboard.mjs` binds it to the interface. The default parser supports quoted fields, embedded
+newlines, escaped quotes, BOM and CRLF, and rejects duplicate headers or ragged records.
+
+The starter needs two text dimensions (period and group) and at least one fully numeric column.
+Uploads are limited to 5 MB. Numeric-looking year columns will be inferred as measures: adapt the
+mapping when the user's schema differs. Periods use natural string order; parse dates explicitly
+for formats that do not sort chronologically. Missing period/group combinations aggregate to zero.
+Blank numeric values are not silently imputed. Do not assume revenue means USD; currency suffixes
+such as `_usd` are explicit units.
+
+Use the source data for every metric, tooltip and exported row. Labels and uploaded text go through
+`textContent`. The browser's imported data is temporary; export it to persist a selection. Exported
+CSV preserves source values, including formula-looking text; treat it as untrusted in spreadsheet apps.
+
+## Verification
+
+```sh
+sh "$DATA_SKILLS/data/scripts/update-verdict.sh"
+node "$DATA_SKILLS/data/scripts/perf.mjs" "$HARNESS_WORKSPACE/index.html"
+```
+
+The first command runs the shared browser proof and writes the verdict, screenshot and
+`.harness/browser-proof.json` with hashes of loaded local files. It requires Playwright + Chromium
+in the shared isolated-web-viewer package, or `PLAYWRIGHT_MODULE` pointing to `playwright/index.mjs`.
+Keep `proof.json` as real control actions and exact text/attribute assertions. Update it when the
+dashboard changes. A failed or unavailable browser check must not become `ready: true`.
+
+Inspect desktop and narrow layouts. Test another dataset, no matching rows, negative/zero values,
+malformed CSV, changed column names, keyboard point inspection and export. The performance helper
+exercises controls while measuring frame delays/long tasks; do not claim an unmeasured frame rate.
diff --git a/store/agents/data-studio/skills/data/scripts/perf.mjs b/store/agents/data-studio/skills/data/scripts/perf.mjs
new file mode 100644
index 000000000..3b885bd05
--- /dev/null
+++ b/store/agents/data-studio/skills/data/scripts/perf.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'perf' });
+}
diff --git a/store/agents/data-studio/skills/data/scripts/screenshot.mjs b/store/agents/data-studio/skills/data/scripts/screenshot.mjs
new file mode 100644
index 000000000..4419012c3
--- /dev/null
+++ b/store/agents/data-studio/skills/data/scripts/screenshot.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'proof' });
+}
diff --git a/store/agents/data-studio/skills/data/scripts/update-verdict.sh b/store/agents/data-studio/skills/data/scripts/update-verdict.sh
new file mode 100755
index 000000000..b96ab9178
--- /dev/null
+++ b/store/agents/data-studio/skills/data/scripts/update-verdict.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -eu
+exec node "$(dirname "$0")/screenshot.mjs" "${HARNESS_WORKSPACE:-$PWD}/index.html"
diff --git a/store/agents/data-studio/store.json b/store/agents/data-studio/store.json
new file mode 100644
index 000000000..d9090e3f5
--- /dev/null
+++ b/store/agents/data-studio/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/data-studio",
+ "upstream": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/data-studio",
+ "license": "MIT",
+ "tagline": "Explore CSV data with live charts, filters and exact values",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/data-studio/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Explore the included sample data, filter a region, compare metrics, and export the selected rows.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/data-studio/starter.jpg",
+ "caption": "Synthetic data · working filters, charts and CSV export"
+ }
+ ]
+}
diff --git a/store/agents/data-studio/template/.gitignore b/store/agents/data-studio/template/.gitignore
new file mode 100644
index 000000000..709c17c79
--- /dev/null
+++ b/store/agents/data-studio/template/.gitignore
@@ -0,0 +1,4 @@
+# Rendering-by-hand never shipped to source.
+# (The dashboard is static self-contained HTML; no generated build output.)
+.harness/
+.harness-initialized
diff --git a/store/agents/data-studio/template/dashboard.mjs b/store/agents/data-studio/template/dashboard.mjs
new file mode 100644
index 000000000..9c1e15a16
--- /dev/null
+++ b/store/agents/data-studio/template/dashboard.mjs
@@ -0,0 +1,204 @@
+import { parseCSV, numericColumns, inferFields, summarize, exportCSV } from './data.mjs';
+
+const $ = id => document.getElementById(id);
+const colors = ['#2b6451', '#88a965', '#c29a5c', '#829ea9', '#b57c75', '#817da3', '#4a8e89', '#9a8255'];
+const NS = 'http://www.w3.org/2000/svg';
+let table, fields, enabled, groups, periods, snapshot, mode = 'trend', selected = null;
+const title = value => value.replaceAll('_', ' ').replace(/^\w/, c => c.toUpperCase());
+// Units belong to the data, never guessed from a word such as "revenue".
+const currency = () => fields.metric.match(/_(usd|eur|gbp|jpy|vnd)$/i)?.[1].toUpperCase();
+const format = (value, compact = false) => new Intl.NumberFormat('en-US', {
+ ...(currency() ? { style: 'currency', currency: currency() } : {}),
+ maximumFractionDigits: compact ? 1 : 2, ...(compact ? { notation: 'compact' } : {})
+}).format(value);
+const color = group => colors[groups.indexOf(group) % colors.length];
+function element(tag, attributes = {}, text, svg = false) {
+ const node = svg ? document.createElementNS(NS, tag) : document.createElement(tag);
+ for (const [key, value] of Object.entries(attributes)) node.setAttribute(key, value);
+ if (text !== undefined) node.textContent = text;
+ return node;
+}
+function options(id, values, chosen) {
+ $(id).replaceChildren(...values.map(value => element('option', { value }, value)));
+ $(id).value = chosen;
+}
+function configure() {
+ groups = [...new Set(table.rows.map(row => row[fields.group]))].sort((a,b) => a.localeCompare(b));
+ periods = [...new Set(table.rows.map(row => row[fields.period]))].sort((a,b) => a.localeCompare(b, undefined, { numeric: true }));
+ enabled = new Set(groups); selected = null;
+ options('start', periods, periods[0]); options('end', periods, periods.at(-1));
+ options('period-field', table.headers, fields.period); options('group-field', table.headers, fields.group);
+ options('metric-field', numericColumns(table), fields.metric);
+ $('group-label').textContent = title(fields.group);
+ $('regions').replaceChildren(...groups.map(group => {
+ const button = element('button', { class: 'region', 'aria-pressed': 'true', 'aria-label': group });
+ const dot = element('i', { class: 'dot', 'aria-hidden': 'true' }); dot.style.background = color(group);
+ button.append(dot, element('span', {}, group), element('span', { class: 'count' }, table.rows.filter(row => row[fields.group] === group).length), element('span', { class: 'check', 'aria-hidden': 'true' }, '✓'));
+ button.onclick = () => {
+ enabled.has(group) ? enabled.delete(group) : enabled.add(group);
+ button.setAttribute('aria-pressed', String(enabled.has(group)));
+ button.querySelector('.check').textContent = enabled.has(group) ? '✓' : '';
+ selected = null; render();
+ };
+ return button;
+ }));
+ render();
+}
+function render() {
+ snapshot = summarize(table, fields, enabled, { start: $('start').value, end: $('end').value });
+ const { total, rows, ranked, growth } = snapshot;
+ const metric = title(fields.metric);
+ $('headline').textContent = metric + ', in perspective.';
+ $('takeaway').textContent = rows.length && ranked.length
+ ? ranked[0].name + ' leads your selection with ' + format(ranked[0].value) + '. Explore what changes across ' + snapshot.periods.length + ' periods.'
+ : 'Choose a group to start exploring.';
+ $('total-label').textContent = 'Total ' + fields.metric.replaceAll('_',' ');
+ $('total').textContent = rows.length ? format(total) : '—';
+ $('row-count').textContent = rows.length + ' of ' + table.rows.length + ' rows selected';
+ $('growth').textContent = growth === null || !rows.length ? '—' : (growth > 0 ? '+' : '') + (growth * 100).toFixed(1) + '%';
+ $('growth-detail').textContent = snapshot.periods.length < 2 ? 'Choose more than one period' : snapshot.periods[0] + ' → ' + snapshot.periods.at(-1);
+ $('leader').textContent = rows.length ? ranked[0]?.name || '—' : '—';
+ $('leader-detail').textContent = rows.length ? format(ranked[0]?.value || 0) + ' in this selection' : 'No groups selected';
+ $('chart-title').textContent = metric + ' over time';
+ $('chart-subtitle').textContent = (currency() ? currency() + ' · ' : '') + title(fields.period) + ' / ' + title(fields.group);
+ $('export').disabled = !rows.length;
+ $('tooltip').hidden = true;
+ drawChart(); drawRanking(); drawTable();
+ $('legend').replaceChildren(...snapshot.series.map(series => {
+ const item = element('span'), dot = element('i', { class: 'dot', 'aria-hidden': 'true' });
+ dot.style.background = color(series.name); item.append(dot, document.createTextNode(series.name)); return item;
+ }));
+}
+function drawChart() {
+ const plot = $('plot'); plot.replaceChildren();
+ if (!snapshot.rows.length) {
+ const empty = element('div', { class: 'empty' });
+ empty.append(element('strong', {}, 'A fresh perspective starts with a selection.'), document.createTextNode('Choose a group, or reset your filters.'));
+ plot.append(empty); return;
+ }
+ const W = 900, H = 310, L = 70, R = 30, T = 30, B = 42, pw = W - L - R, ph = H - T - B;
+ const values = snapshot.series.flatMap(series => series.values.map(point => point.value));
+ let min = Math.min(0, ...values), max = Math.max(0, ...values);
+ if (min === max) max = min + 1;
+ const extent = max - min; if (min < 0) min -= extent * .08; if (max > 0) max += extent * .12;
+ const y = value => T + ph * (max - value) / (max - min);
+ const step = pw / Math.max(1, snapshot.periods.length);
+ const x = index => L + step * (index + .5);
+ const svg = element('svg', { viewBox: '0 0 '+W+' '+H, role: 'img', 'aria-label': fields.metric + ' by ' + fields.period + ' and ' + fields.group }, undefined, true);
+ for (let i = 0; i <= 4; i++) {
+ const value = min + (max - min) * i / 4, yy = y(value);
+ svg.append(element('line', { x1: L, x2: W-R, y1: yy, y2: yy, stroke: '#e8ede5', 'stroke-dasharray': '3 5' }, undefined, true));
+ svg.append(element('text', { x: L-12, y: yy+4, 'text-anchor': 'end' }, format(value,true), true));
+ }
+ svg.append(element('line', { x1:L, x2:W-R, y1:y(0), y2:y(0), stroke:'#dce4d8' }, undefined, true));
+ const stride = Math.max(1, Math.ceil(snapshot.periods.length / 8));
+ snapshot.periods.forEach((period,i) => {
+ if (i % stride === 0 || i === snapshot.periods.length-1) svg.append(element('text', {x:x(i), y:H-14, 'text-anchor':'middle'}, period.length > 14 ? period.slice(0,12)+'…' : period, true));
+ });
+ snapshot.series.forEach((series, si) => {
+ if (mode === 'trend') {
+ const points = series.values.map((point,i) => x(i)+','+y(point.value)).join(' ');
+ svg.append(element('polyline', { points, fill:'none', stroke:color(series.name), 'stroke-width':2.5, 'stroke-linejoin':'round', 'stroke-linecap':'round' }, undefined, true));
+ }
+ series.values.forEach((point, i) => {
+ const label = series.name+' · '+point.period+' · '+format(point.value);
+ let mark;
+ if (mode === 'trend') mark = element('circle', {cx:x(i), cy:y(point.value), r:4, fill:'white', stroke:color(series.name), 'stroke-width':2}, undefined, true);
+ else {
+ const barWidth = Math.max(1, step * .64 / snapshot.series.length);
+ mark = element('rect', {x:x(i)-step*.32+si*barWidth, y:Math.min(y(0),y(point.value)), width:Math.max(.5,barWidth-2), height:Math.max(1,Math.abs(y(point.value)-y(0))), rx:2, fill:color(series.name)}, undefined, true);
+ }
+ mark.setAttribute('class','point'); mark.setAttribute('tabindex','0'); mark.setAttribute('role','button'); mark.setAttribute('aria-label',label);
+ const show = event => {
+ const tip = $('tooltip'); tip.replaceChildren(element('span',{},series.name+' · '+point.period),element('strong',{},format(point.value)));
+ tip.hidden = false;
+ const rect = mark.getBoundingClientRect();
+ const px = Number.isFinite(event.clientX) ? event.clientX : rect.x + rect.width/2;
+ const py = Number.isFinite(event.clientY) ? event.clientY : rect.y;
+ tip.style.left = Math.max(8,Math.min(innerWidth-tip.offsetWidth-8, px+14))+'px';
+ tip.style.top = Math.max(8,Math.min(innerHeight-tip.offsetHeight-8,py-55))+'px';
+ };
+ mark.onpointerenter = show; mark.onfocus = show;
+ mark.onpointerleave = () => $('tooltip').hidden = true;
+ mark.onblur = () => $('tooltip').hidden = true;
+ mark.onclick = event => { selected = { group: series.name, period: point.period }; drawTable(); show(event); };
+ mark.onkeydown = event => { if (event.key==='Enter' || event.key===' ') { event.preventDefault(); mark.onclick(event); } if(event.key==='Escape') $('tooltip').hidden=true; };
+ svg.append(mark);
+ });
+ });
+ plot.append(svg);
+}
+function drawRanking() {
+ const maximum = Math.max(1,...snapshot.ranked.map(row=>Math.abs(row.value)));
+ $('ranking').replaceChildren(...snapshot.ranked.map(row => {
+ const container = element('div',{class:'ranking-row'}), label = element('div',{class:'ranking-label'}), track=element('div',{class:'track'}), bar=element('i');
+ label.append(element('span',{},row.name),element('span',{},format(row.value)));
+ bar.style.width=(Math.abs(row.value)/maximum*100)+'%'; bar.style.background=color(row.name); track.append(bar); container.append(label,track); return container;
+ }));
+ if (!snapshot.rows.length) $('ranking').textContent='No groups selected.';
+}
+function drawTable() {
+ const columns = [...new Set([fields.period,fields.group,fields.metric])];
+ const head = element('tr'); head.append(...columns.map(key=>element('th',{scope:'col'},title(key))));
+ $('table').querySelector('thead').replaceChildren(head);
+ const rows = selected ? snapshot.rows.filter(row=>row[fields.group]===selected.group && row[fields.period]===selected.period) : snapshot.rows;
+ $('table').querySelector('tbody').replaceChildren(...rows.slice(0,100).map(row=>{
+ const tr = element('tr',selected?{class:'selected'}:{});
+ tr.append(...columns.map(key=>element('td',{},key===fields.metric?format(Number(row[key])):row[key]))); return tr;
+ }));
+ $('table-note').textContent = selected ? 'Inspecting '+selected.group+' · '+selected.period+' — change a filter to clear' : (rows.length>100?'First 100 of '+rows.length+' rows · export for all rows':rows.length+' source rows · values are aggregated in the chart');
+}
+function failure(error) {
+ $('error-message').textContent=error.message;
+ $('error').hidden=false; $('dashboard').hidden=true; $('loading').hidden=true; $('export').disabled=true;
+}
+function accept(text,name) {
+ try {
+ if(text.length>5*1024*1024) throw new Error('Choose a CSV smaller than 5 MB for this interactive view.');
+ const parsed = parseCSV(text);
+ if(!parsed.rows.length) throw new Error('The header is present, but there are no data rows yet.');
+ const inferred = inferFields(parsed);
+ table=parsed; fields=inferred;
+ $('source').textContent=name; $('error').hidden=true; $('loading').hidden=true; $('dashboard').hidden=false;
+ configure();
+ } catch(error) { failure(error); }
+}
+async function load() {
+ $('loading').hidden=false; $('dashboard').hidden=true; $('error').hidden=true;
+ try {
+ const response=await fetch('data.csv');
+ if(!response.ok) throw new Error('data.csv returned HTTP '+response.status+'. Add it to this workspace or open a CSV.');
+ accept(await response.text(),'data.csv');
+ } catch(error) { failure(error); }
+}
+$('open').onclick=()=>$('upload').click();
+$('upload').onchange=async event=>{
+ const file=event.target.files[0]; if(!file)return;
+ if(file.size>5*1024*1024) failure(new Error('Choose a CSV smaller than 5 MB.'));
+ else accept(await file.text(),file.name);
+ event.target.value='';
+};
+$('retry').onclick=load;
+$('reset').onclick=()=>configure();
+for(const id of ['start','end']) $(id).onchange=()=>{
+ if(periods.indexOf($('start').value)>periods.indexOf($('end').value)) $(id==='start'?'end':'start').value=$(id).value;
+ selected=null; render();
+};
+for(const [id,key] of [['period-field','period'],['group-field','group'],['metric-field','metric']]) $(id).onchange=()=>{
+ const value=$(id).value;
+ if((key==='period' && value===fields.group)||(key==='group' && value===fields.period)) {
+ const other=key==='period'?'group':'period'; fields[other]=fields[key];
+ }
+ fields[key]=value; configure();
+};
+for(const kind of ['trend','bars']) $(kind).onclick=()=>{
+ mode=kind;
+ for(const id of ['trend','bars']) $(id).setAttribute('aria-pressed',String(id===mode));
+ drawChart();
+};
+$('export').onclick=()=>{
+ const blob=new Blob([exportCSV(table.headers,snapshot.rows)],{type:'text/csv;charset=utf-8'});
+ const url=URL.createObjectURL(blob), link=document.createElement('a');
+ link.href=url; link.download='data-studio-selection.csv'; link.click(); setTimeout(()=>URL.revokeObjectURL(url),30000);
+};
+await load();
diff --git a/store/agents/data-studio/template/data.csv b/store/agents/data-studio/template/data.csv
new file mode 100644
index 000000000..fa43fb79c
--- /dev/null
+++ b/store/agents/data-studio/template/data.csv
@@ -0,0 +1,17 @@
+quarter,region,revenue,units
+2025-Q1,North,12400,310
+2025-Q1,South,8100,202
+2025-Q1,East,15200,380
+2025-Q1,West,9800,245
+2025-Q2,North,13200,330
+2025-Q2,South,9400,235
+2025-Q2,East,16100,402
+2025-Q2,West,10500,262
+2025-Q3,North,14100,352
+2025-Q3,South,9800,245
+2025-Q3,East,17300,432
+2025-Q3,West,11200,280
+2025-Q4,North,14900,372
+2025-Q4,South,10300,257
+2025-Q4,East,18600,465
+2025-Q4,West,12100,302
diff --git a/store/agents/data-studio/template/data.mjs b/store/agents/data-studio/template/data.mjs
new file mode 100644
index 000000000..15ed32cc6
--- /dev/null
+++ b/store/agents/data-studio/template/data.mjs
@@ -0,0 +1,79 @@
+// Shared by the dashboard and Node tests. No external runtime or chart library.
+export function parseCSV(input) {
+ const text = String(input).replace(/^\uFEFF/, '');
+ const records = []; let record = [], field = '', quoted = false, closed = false;
+ const finishField = () => { record.push(field); field = ''; closed = false; };
+ const finishRecord = () => {
+ finishField();
+ if (record.some(value => value.trim() !== '')) records.push(record);
+ record = [];
+ };
+ for (let i = 0; i < text.length; i++) {
+ const char = text[i];
+ if (quoted) {
+ if (char === '"' && text[i + 1] === '"') { field += '"'; i++; }
+ else if (char === '"') { quoted = false; closed = true; }
+ else field += char;
+ } else if (char === '"' && field === '' && !closed) quoted = true;
+ else if (char === ',') finishField();
+ else if (char === '\n' || char === '\r') { if (char === '\r' && text[i + 1] === '\n') i++; finishRecord(); }
+ else if (closed || char === '"') throw new Error('Unexpected character after a CSV quote.');
+ else field += char;
+ }
+ if (quoted) throw new Error('An opening CSV quote has no closing quote.');
+ if (field !== '' || record.length || closed) finishRecord();
+ if (!records.length) throw new Error('The CSV is empty. Add a header row and your data.');
+ const headers = records.shift().map(value => value.trim());
+ if (headers.some(value => !value) || new Set(headers).size !== headers.length) throw new Error('Column names must be nonempty and unique.');
+ const rows = records.map((record, index) => {
+ if (record.length !== headers.length) throw new Error(`Record ${index + 2} has ${record.length} fields; expected ${headers.length}.`);
+ return Object.fromEntries(headers.map((header, i) => [header, record[i]]));
+ });
+ return { headers, rows };
+}
+
+export function numericColumns({ headers, rows }) {
+ return headers.filter(key => rows.length && rows.every(row => row[key].trim() !== '' && Number.isFinite(Number(row[key]))));
+}
+
+export function inferFields(table) {
+ const numeric = numericColumns(table);
+ if (!numeric.length) throw new Error('Choose data with at least one numeric column (no blank values).');
+ const dimensions = table.headers.filter(key => !numeric.includes(key));
+ if (dimensions.length < 2) throw new Error('This view needs two text columns (period and group) plus a numeric value.');
+ const period = dimensions.find(key => /^(quarter|month|date|period|year)$/i.test(key)) || dimensions[0];
+ const group = dimensions.find(key => /^(region|category|group|product|team)$/i.test(key) && key !== period) || dimensions.find(key => key !== period);
+ const metric = numeric.find(key => /^(revenue|sales|value|amount)$/i.test(key)) || numeric[0];
+ return { period, group, metric };
+}
+
+export function summarize(table, fields, enabled, range = {}) {
+ const { period, group, metric } = fields;
+ const periods = [...new Set(table.rows.map(row => row[period]))].sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
+ const groups = [...new Set(table.rows.map(row => row[group]))].sort((a, b) => a.localeCompare(b));
+ const start = Math.max(0, periods.indexOf(range.start)), end = range.end ? periods.indexOf(range.end) : periods.length - 1;
+ const window = periods.slice(start, end + 1);
+ const included = new Set(window), sums = new Map(), periodSums = new Map();
+ const rows = table.rows.filter(row => enabled.has(row[group]) && included.has(row[period]));
+ for (const row of rows) {
+ const name = row[group], label = row[period], value = Number(row[metric]);
+ if (!sums.has(name)) sums.set(name, new Map());
+ const bucket = sums.get(name);
+ bucket.set(label, (bucket.get(label) || 0) + value);
+ periodSums.set(label, (periodSums.get(label) || 0) + value);
+ }
+ const series = groups.filter(name => enabled.has(name)).map(name => ({ name, values: window.map(label => ({
+ period: label,
+ value: sums.get(name)?.get(label) || 0
+ })) }));
+ const totals = window.map(label => periodSums.get(label) || 0);
+ const total = totals.reduce((sum, value) => sum + value, 0);
+ const growth = totals.length > 1 && totals[0] !== 0 ? (totals.at(-1) - totals[0]) / Math.abs(totals[0]) : null;
+ const ranked = series.map(series => ({ name: series.name, value: series.values.reduce((sum, point) => sum + point.value, 0) })).sort((a, b) => b.value - a.value);
+ return { periods: window, groups, rows, series, totals, total, growth, ranked };
+}
+
+export function exportCSV(headers, rows) {
+ const escape = value => '"' + String(value ?? '').replaceAll('"', '""') + '"';
+ return [headers, ...rows.map(row => headers.map(key => row[key]))].map(row => row.map(escape).join(',')).join('\r\n') + '\r\n';
+}
diff --git a/store/agents/data-studio/template/index.html b/store/agents/data-studio/template/index.html
new file mode 100644
index 000000000..259bf7344
--- /dev/null
+++ b/store/agents/data-studio/template/index.html
@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<title>Data Studio — a clearer picture</title>
+<style>
+:root{color-scheme:light;--bg:#f4f5ef;--white:#fff;--ink:#263d34;--muted:#7b877e;--line:#e2e7df;--green:#275c49;--lime:#ddebaf;--mono:11px/1.5 ui-monospace,SFMono-Regular,monospace}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:13px/1.5 system-ui,-apple-system,sans-serif}button,select,input{font:inherit}button,select{cursor:pointer;color:inherit}button{touch-action:manipulation}:focus-visible{outline:2px solid #578d65;outline-offset:3px}button{border:1px solid var(--line);background:white;border-radius:7px;padding:8px 12px}button:hover{border-color:#96af9b}.eyebrow{font:var(--mono);letter-spacing:1.4px;text-transform:uppercase;color:var(--muted)}
+header{height:72px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 34px;background:#fafbf7}.brand{font-size:17px;font-weight:650;letter-spacing:-.5px;display:flex;gap:10px;align-items:center}.brand-icon{width:24px;height:24px;display:flex;gap:3px;align-items:end}.brand-icon i{background:var(--green);width:5px;border-radius:2px}.brand-icon i:nth-child(1){height:10px}.brand-icon i:nth-child(2){height:22px}.brand-icon i:nth-child(3){height:16px}.header-tools{display:flex;gap:9px;align-items:center}.source{font:var(--mono);color:var(--muted);margin-right:7px;max-width:180px;overflow:hidden;text-overflow:ellipsis}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#194632}
+main{padding:32px 34px;max-width:1520px;margin:auto}.intro{display:flex;justify-content:space-between;gap:20px;align-items:end;margin-bottom:26px}h1{font-size:clamp(28px,3.1vw,43px);letter-spacing:-1.8px;font-weight:500;line-height:1.12;margin:9px 0 11px}.intro p{color:var(--muted);margin:0;font-size:13px}.stamp{font:var(--mono);color:var(--muted);white-space:nowrap;padding-bottom:4px}.stamp i{display:inline-block;width:5px;height:5px;background:#6a8a52;border-radius:50%;margin-right:6px}
+.metrics{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:14px;margin-bottom:22px}.metric{background:white;border:1px solid var(--line);border-radius:10px;padding:19px 22px;position:relative;min-height:116px}.metric:first-child{background:var(--green);color:white;border-color:var(--green)}.metric .label{font-size:11px;color:var(--muted)}.metric:first-child .label,.metric:first-child small{color:#d4e6d9}.metric strong{display:block;font-size:31px;font-weight:500;letter-spacing:-1px;margin:5px 0}.metric small{font:var(--mono);color:var(--muted)}.metric .marker{position:absolute;right:22px;top:24px;font-size:20px;color:#97b99b}
+.workspace{display:grid;grid-template-columns:218px minmax(0,1fr);gap:22px}.filters{padding:6px 4px 0 0}.filter-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}.filter-title h2{font-size:13px;margin:0;font-weight:600}.filter-title button{border:0;background:transparent;font-size:11px;padding:0;color:var(--muted)}.regions{display:grid;gap:6px}.region{display:flex;align-items:center;gap:8px;padding:9px 11px;background:transparent;border-color:transparent;text-align:left}.region:hover{background:#e9eee3}.region[aria-pressed=true]{background:#e8eedf;border-color:#d8e2ce}.dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.region .count{margin-left:auto;font:var(--mono);color:var(--muted)}.region .check{width:12px;color:var(--green)}.range{border-top:1px solid var(--line);margin-top:22px;padding-top:19px;display:grid;gap:11px}.field{display:grid;gap:5px}.field label{font-size:10px;color:var(--muted)}select{width:100%;background:#fafbf7;border:1px solid #dce2d7;border-radius:6px;padding:8px 7px;font-size:11px}.mapping{margin-top:22px;padding-top:18px;border-top:1px solid var(--line);font-size:11px}.mapping summary{cursor:pointer;color:var(--muted);margin-bottom:12px}.mapping .field{margin:10px 0}.side-note{margin-top:28px;font-size:11px;color:var(--muted);line-height:1.7}
+.content{min-width:0}.chart-card{background:white;border:1px solid var(--line);border-radius:10px;overflow:hidden}.chart-head{display:flex;justify-content:space-between;gap:12px;padding:22px 23px 9px;align-items:center}h2{font-size:14px;font-weight:600;margin:0}.chart-head p{font:var(--mono);color:var(--muted);margin:3px 0 0}.view-switch{display:flex;gap:3px;background:var(--bg);border-radius:6px;padding:3px}.view-switch button{border:0;background:transparent;padding:5px 9px;font-size:11px}.view-switch button[aria-pressed=true]{background:white;box-shadow:0 1px 3px #0001}.plot{position:relative;padding:3px 17px 4px;min-height:274px}.plot svg{width:100%;display:block;overflow:visible}.plot svg text{font-family:ui-monospace,monospace;fill:#88938c;font-size:10px}.plot .point{cursor:pointer;outline:none}.plot .point:focus{stroke:#172b21;stroke-width:3}.chart-foot{display:flex;justify-content:space-between;align-items:center;padding:13px 23px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);gap:12px}.legend{display:flex;gap:15px;flex-wrap:wrap}.legend span{display:flex;gap:5px;align-items:center}.empty{padding:75px 20px;text-align:center;color:var(--muted)}.empty strong{display:block;color:var(--ink);font-size:16px;font-weight:500;margin-bottom:6px}.bottom{display:grid;grid-template-columns:.85fr 1.15fr;gap:18px;margin-top:19px}.panel{background:white;border:1px solid var(--line);border-radius:10px;padding:20px 22px;min-width:0}.panel h2{margin-bottom:18px}.ranking-row{margin:16px 0}.ranking-label{display:flex;justify-content:space-between;font-size:11px;margin-bottom:6px;gap:10px}.track{height:6px;background:#f1f3ec;border-radius:3px;overflow:hidden}.track i{display:block;height:100%;border-radius:3px}.table-wrap{max-height:216px;overflow:auto}table{width:100%;border-collapse:collapse;font-size:11px;text-align:left;font-variant-numeric:tabular-nums}th{color:var(--muted);font-size:10px;font-weight:400;background:white;position:sticky;top:0}td,th{padding:8px 6px;border-bottom:1px solid #eef1ea;white-space:nowrap}td:last-child,th:last-child{text-align:right}tr.selected td{background:#edf3da}.table-note{font:var(--mono);font-size:10px;color:var(--muted);margin-top:12px}
+.error{padding:22px;border:1px solid #d5a48d;border-radius:10px;background:#fff7ef;margin-bottom:20px;color:#7e3c28}.error strong{display:block;font-size:15px;margin-bottom:4px}[hidden]{display:none!important}.tip{position:fixed;pointer-events:none;padding:10px 13px;background:#243c31;color:white;border-radius:7px;box-shadow:0 6px 20px #172d2425;font-size:11px;z-index:9;max-width:240px}.tip strong{display:block;font-size:15px;margin-top:3px}.loading{padding:60px;text-align:center;color:var(--muted)}
+@media(max-width:950px){main{padding:25px 23px}.workspace{grid-template-columns:175px minmax(0,1fr);gap:18px}.bottom{grid-template-columns:1fr}.metric{padding:17px}.metric strong{font-size:27px}.stamp{display:none}header{padding:0 23px}}
+@media(max-width:650px){header{height:64px;padding:0 18px}.header-tools{gap:6px}.source{display:none}.header-tools button{font-size:10px;padding:7px 9px}.brand{font-size:15px}main{padding:24px 18px}.intro{margin-bottom:19px}h1{font-size:32px}.metrics{grid-template-columns:1fr 1fr;gap:9px}.metric:first-child{grid-column:1/-1;min-height:100px}.metric{min-height:108px;padding:15px}.metric strong{font-size:26px}.metric .marker{display:none}.workspace{display:block}.filters{margin-bottom:20px}.regions{display:flex;flex-wrap:wrap;gap:3px}.region{padding:7px 9px;font-size:11px}.region .count{display:none}.range{display:grid;grid-template-columns:1fr 1fr;margin-top:15px;padding-top:14px}.mapping{margin-top:14px;padding-top:12px}.side-note{display:none}.chart-head{padding:18px 15px 6px;align-items:start}.chart-head h2{font-size:12px}.chart-head p{font-size:9px}.view-switch button{padding:4px 7px}.plot{padding:4px 7px;min-height:0}.chart-foot{padding:12px 15px;display:block}.legend{gap:10px;margin-bottom:8px}.bottom{gap:14px}.panel{padding:18px 15px}}
+</style>
+</head>
+<body>
+<header><div class="brand"><span class="brand-icon" aria-hidden="true"><i></i><i></i><i></i></span>Data Studio</div><div class="header-tools"><span class="source" id="source">data.csv</span><button id="open">Open CSV ↗</button><button class="primary" id="export" disabled>Export selection ↓</button><input id="upload" type="file" accept=".csv,text/csv" hidden aria-label="Choose a CSV file"></div></header>
+<main>
+ <div class="intro"><div><span class="eyebrow">From data to discovery</span><h1 id="headline">A clearer picture.</h1><p id="takeaway">Your numbers have a story. Find it here.</p></div><span class="stamp" id="stamp"><i></i>Local data · private by design</span></div>
+ <div class="error" id="error" role="alert" hidden><strong>We couldn’t read this dataset.</strong><span id="error-message"></span> <button id="retry">Reload data.csv</button></div>
+ <div class="loading" id="loading" role="status">Reading data.csv…</div>
+ <div id="dashboard" hidden>
+ <section class="metrics" aria-label="Selection summary">
+ <div class="metric"><span class="label" id="total-label">Total revenue</span><strong id="total">—</strong><small id="row-count"></small><span class="marker" aria-hidden="true">↗</span></div>
+ <div class="metric"><span class="label">First → last period</span><strong id="growth">—</strong><small id="growth-detail"></small></div>
+ <div class="metric"><span class="label">Leading group</span><strong id="leader">—</strong><small id="leader-detail"></small></div>
+ </section>
+ <div class="workspace">
+ <aside class="filters" aria-label="Data filters">
+ <div class="filter-title"><h2 id="group-label">Regions</h2><button id="reset">Reset filters</button></div>
+ <div class="regions" id="regions" role="group" aria-label="Groups"></div>
+ <div class="range"><div class="field"><label for="start">From period</label><select id="start"></select></div><div class="field"><label for="end">To period</label><select id="end"></select></div></div>
+ <details class="mapping"><summary>Map your columns</summary><div class="field"><label for="period-field">Period column</label><select id="period-field"></select></div><div class="field"><label for="group-field">Group column</label><select id="group-field"></select></div><div class="field"><label for="metric-field">Value column</label><select id="metric-field"></select></div></details>
+ <p class="side-note">Every chart and number follows your selection.<br><br>Your CSV stays on this device. Nothing is uploaded.</p>
+ </aside>
+ <div class="content">
+ <section class="chart-card">
+ <div class="chart-head"><div><h2 id="chart-title">Revenue over time</h2><p id="chart-subtitle"></p></div><div class="view-switch" role="group" aria-label="Chart type"><button id="trend" aria-pressed="true">Trend</button><button id="bars" aria-pressed="false">Bars</button></div></div>
+ <div class="plot" id="plot"></div>
+ <div class="chart-foot"><div class="legend" id="legend"></div><span>Tap a point to inspect</span></div>
+ </section>
+ <div class="bottom">
+ <section class="panel"><h2>Where it comes from</h2><div id="ranking"></div></section>
+ <section class="panel"><h2>The numbers behind the picture</h2><div class="table-wrap"><table id="table"><thead></thead><tbody></tbody></table></div><div class="table-note" id="table-note"></div></section>
+ </div>
+ </div>
+ </div>
+ </div>
+</main>
+<div id="tooltip" class="tip" role="status" hidden></div>
+<script type="module" src="dashboard.mjs"></script>
+</body>
+</html>
diff --git a/store/agents/data-studio/template/proof.json b/store/agents/data-studio/template/proof.json
new file mode 100644
index 000000000..995d49ea3
--- /dev/null
+++ b/store/agents/data-studio/template/proof.json
@@ -0,0 +1,8 @@
+{
+ "actions": [
+ { "selector": "#bars", "click": true },
+ { "selector": "#bars", "attribute": { "name": "aria-pressed", "value": "true" } },
+ { "selector": "#trend", "click": true },
+ { "selector": "#trend", "attribute": { "name": "aria-pressed", "value": "true" } }
+ ]
+}
diff --git a/store/agents/data-studio/test/data.test.mjs b/store/agents/data-studio/test/data.test.mjs
new file mode 100644
index 000000000..e3c74347c
--- /dev/null
+++ b/store/agents/data-studio/test/data.test.mjs
@@ -0,0 +1,42 @@
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { test } from 'node:test';
+import { parseCSV, inferFields, summarize, exportCSV } from '../template/data.mjs';
+
+test('CSV supports BOM, CRLF, quoted commas, doubled quotes, multiline fields and negative/decimal numbers', () => {
+ const table = parseCSV('\uFEFFperiod,group,value\r\nQ1,"North, coast",-2.5\r\nQ2,"A ""quoted""\nteam",4.75\r\n');
+ assert.equal(table.rows[0].group, 'North, coast');
+ assert.equal(table.rows[1].group, 'A "quoted"\nteam');
+ assert.deepEqual(parseCSV(exportCSV(table.headers, table.rows)), table);
+ const fields = inferFields(table);
+ assert.equal(summarize(table, fields, new Set(table.rows.map(row => row.group))).total, 2.25);
+});
+
+test('malformed CSV is rejected rather than charted as plausible numbers', () => {
+ for (const csv of ['', 'x,x\na,b', 'x,\na,b', 'x,y\na,b,c', 'x,y\n"unfinished,b', 'x,y\n"a"oops,b']) {
+ assert.throws(() => parseCSV(csv), undefined, csv);
+ }
+ assert.throws(() => inferFields(parseCSV('period,group,value\nQ1,A,NaN')));
+ assert.throws(() => inferFields(parseCSV('period,group,value\nQ1,A,')));
+});
+
+test('new groups/periods, repeated observations, zeros and negative values determine the view', () => {
+ const table = parseCSV('period,group,value\nQ1,New group,0\nQ2,New group,20\nQ2,New group,5\nQ2,Other,-8');
+ const fields = inferFields(table);
+ const all = summarize(table, fields, new Set(['New group', 'Other']));
+ assert.equal(all.total, 17);
+ assert.equal(all.growth, null, 'a zero baseline has no finite percentage growth');
+ assert.equal(all.ranked[0].value, 25);
+ assert.equal(summarize(table, fields, new Set()).rows.length, 0);
+ assert.equal(summarize(table, fields, new Set(['Other']), { start: 'Q2', end: 'Q2' }).total, -8);
+});
+
+test('the actual starter totals and filters agree with the underlying rows', () => {
+ const table = parseCSV(readFileSync(new URL('../template/data.csv', import.meta.url), 'utf8'));
+ const fields = inferFields(table);
+ const result = summarize(table, fields, new Set(['North', 'East', 'South', 'West']));
+ assert.equal(result.total, 203000);
+ assert.equal(result.ranked[0].name, 'East');
+ assert.equal(result.ranked[0].value, 67200);
+ assert.equal(summarize(table, fields, new Set(['North'])).total, 54600);
+});
diff --git a/store/agents/data-studio/test/toolchain.test.mjs b/store/agents/data-studio/test/toolchain.test.mjs
new file mode 100644
index 000000000..9f1fd60c6
--- /dev/null
+++ b/store/agents/data-studio/test/toolchain.test.mjs
@@ -0,0 +1,106 @@
+// The Data Studio harness's scripts, run the way Harness runs them: by path, in the directory
+// Harness gives them, with the environment Harness sets.
+//
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync, chmodSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const dir of scratch) rmSync(dir, { recursive: true, force: true }) })
+
+function tempDir() {
+ const dir = mkdtempSync(join(tmpdir(), 'data-studio-'))
+ scratch.push(dir)
+ return dir
+}
+
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [key, value] of Object.entries(env)) if (value === null) delete merged[key]; else merged[key] = value
+ const result = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: result.status, stdout: result.stdout, stderr: result.stderr }
+}
+
+/** A fake `node` (this harness's only local runtime gate) that reports a version. */
+function fakeNode() {
+ const dir = tempDir()
+ const bin = join(dir, 'node')
+ writeFileSync(bin, '#!/bin/sh\nfor a in "$@"; do [ "$a" = "--version" ] && echo "v20.19.0"; done; exit 0\n')
+ chmodSync(bin, 0o755)
+ return dir
+}
+
+test('every script the manifest names is in the folder and executable', () => {
+ for (const script of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/data/scripts/update-verdict.sh']) {
+ assert.doesNotThrow(() => accessSync(join(here, script), constants.X_OK), script)
+ }
+})
+
+test('setup finds node on PATH and says ok', () => {
+ const dir = fakeNode()
+ const { code, stdout } = run(manifest.toolchain.setup, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok node/)
+})
+
+test('doctor says ok when node is on PATH', () => {
+ const dir = fakeNode()
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok node/)
+})
+
+test('doctor says miss and fails when node is absent', () => {
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: tempDir() } })
+ assert.equal(code, 1)
+ assert.match(stdout, /miss node/)
+})
+
+test('init seeds the first verdict and the initialized marker', () => {
+ const workspace = tempDir()
+ const { code } = run(manifest.workspace.init, { cwd: workspace, env: { HARNESS_DSH: manifest.id } })
+ assert.equal(code, 0)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, false)
+ assert.match(readFileSync(join(workspace, '.harness-initialized'), 'utf8'), new RegExp(manifest.id.replace('/', '/')))
+})
+
+test('file existence cannot turn an unavailable browser proof into a ready verdict', () => {
+ const skill = readFileSync(join(here, 'skills/data/SKILL.md'), 'utf8')
+ const command = 'sh "$DATA_SKILLS/data/scripts/update-verdict.sh"'
+ assert.ok(skill.includes(command), 'SKILL.md should document the one-stop update command')
+ assert.equal(manifest.agent.env.DATA_SKILLS, '${dsh}/skills')
+
+ const workspace = tempDir()
+ writeFileSync(join(workspace, 'index.html'), '<!doctype html><h1>dash</h1>\n')
+ writeFileSync(join(workspace, 'data.csv'), 'quarter,region,revenue\n2025-Q1,North,12\n')
+ const result = spawnSync('/bin/sh', ['-c', command], {
+ cwd: workspace,
+ env: { ...process.env, DATA_SKILLS: join(here, 'skills'), HARNESS_WORKSPACE: workspace, PLAYWRIGHT_MODULE: join(workspace, 'missing-playwright.mjs') },
+ encoding: 'utf8',
+ })
+ assert.equal(result.status, 1, result.stderr)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, false)
+ assert.match(verdict.findings[0].message, /Playwright is missing/)
+ assert.equal(verdict.artifact, 'index.html')
+})
+
+test('update-verdict.sh reports missing index.html and fails', () => {
+ const workspace = tempDir()
+ writeFileSync(join(workspace, 'data.csv'), 'q,r,v\n1,2,3\n')
+ const result = spawnSync('/bin/sh', ['-c', 'sh "$DATA_SKILLS/data/scripts/update-verdict.sh"'], {
+ cwd: workspace,
+ env: { ...process.env, DATA_SKILLS: join(here, 'skills'), HARNESS_WORKSPACE: workspace },
+ encoding: 'utf8',
+ })
+ assert.equal(result.status, 1)
+ assert.match(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'), /index\.html missing/)
+})
diff --git a/store/agents/data-studio/toolchain/doctor.sh b/store/agents/data-studio/toolchain/doctor.sh
new file mode 100755
index 000000000..2b8161f7d
--- /dev/null
+++ b/store/agents/data-studio/toolchain/doctor.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Exit 0 when this machine can run the Data Studio harness. Print one line per check.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+fail=0
+if command -v node >/dev/null 2>&1; then
+ echo "ok node $(node --version 2>/dev/null) at $(command -v node)"
+else
+ echo "miss node — run toolchain/setup.sh or install Node.js 20+ from https://nodejs.org"
+ fail=1
+fi
+[ -d "$dsh/skills/data" ] && echo "ok data skill" || { echo "warn data skill missing"; fail=1; }
+exit $fail
diff --git a/store/agents/data-studio/toolchain/init-workspace.sh b/store/agents/data-studio/toolchain/init-workspace.sh
new file mode 100755
index 000000000..6903fb46a
--- /dev/null
+++ b/store/agents/data-studio/toolchain/init-workspace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Data Studio workspace ready — open data.csv and tell me the view you want",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Data Studio workspace initialized by %s\n' "${HARNESS_DSH:-data-studio}" > .harness-initialized
diff --git a/store/agents/data-studio/toolchain/setup.sh b/store/agents/data-studio/toolchain/setup.sh
new file mode 100755
index 000000000..0024cf785
--- /dev/null
+++ b/store/agents/data-studio/toolchain/setup.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Install/verify the runtime for this harness. cwd = the package install dir.
+# Data Studio is web-native: the shared isolated-web-viewer renders index.html in the pane. The only
+# local runtime the harness needs is Node (it drives the data helpers and the test suite).
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+if command -v node >/dev/null 2>&1; then
+ echo "ok node $(node --version 2>/dev/null) at $(command -v node)"
+ exit 0
+fi
+echo "miss node — install Node.js 20+ from https://nodejs.org (or via nvm/brew) and re-run setup."
+exit 1
diff --git a/store/agents/firmware-studio/.gitignore b/store/agents/firmware-studio/.gitignore
new file mode 100644
index 000000000..627512470
--- /dev/null
+++ b/store/agents/firmware-studio/.gitignore
@@ -0,0 +1,11 @@
+# Build output — never source.
+build/
+*.bin
+*.hex
+*.elf
+# Harness bookkeeping.
+.harness/
+.harness-initialized
+.pio/
+.venv/
+out/
diff --git a/store/agents/firmware-studio/AGENTS.md b/store/agents/firmware-studio/AGENTS.md
new file mode 100644
index 000000000..991f0bc6e
--- /dev/null
+++ b/store/agents/firmware-studio/AGENTS.md
@@ -0,0 +1,16 @@
+# Firmware Studio
+
+Read the `firmware` skill. This is a PlatformIO workspace: `platformio.ini` selects the target,
+`src/` holds firmware, and the live `build-status.html` pane shows the latest build.
+
+Use the one-stop helper after meaningful changes. It compiles one selected environment once,
+captures the compiler output, records reported memory usage, publishes downloadable binaries and
+refreshes the dashboard and verdict. Failure produces a fresh failure page; an old successful
+page must not remain the current result.
+
+Keep `pins.json` aligned with the source as a project pin plan, not a verified board pinout.
+The ESP32 starter uses Arduino C++, so its entry point is `src/main.cpp`, not `main.c`.
+
+Compilation proves neither runtime behavior nor electrical safety. Upload, erase, debugging and
+serial/device access require explicit user authorization for that device. The build helper does
+none of those operations. Don't add upload targets or device side effects to its compile step.
diff --git a/store/agents/firmware-studio/LICENSE b/store/agents/firmware-studio/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/firmware-studio/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/firmware-studio/PROVENANCE.md b/store/agents/firmware-studio/PROVENANCE.md
new file mode 100644
index 000000000..ff85ddb1d
--- /dev/null
+++ b/store/agents/firmware-studio/PROVENANCE.md
@@ -0,0 +1,9 @@
+# Provenance
+
+The Signal dashboard, ESP32 demonstration source, build helpers and instructions
+are original MIT-licensed OpenHarness work. [PlatformIO Core](https://platformio.org)
+is separately installed, Apache-2.0 software. Setup pins Core 6.1.18 and the starter
+pins the espressif32 platform at 6.10.0. Those tools download their own board SDKs
+under their respective licenses; none are vendored in this package. The board
+illustration is conceptual, not a manufacturer's pinout or a verified circuit.
+No hardware was connected or flashed during native QA.
diff --git a/store/agents/firmware-studio/README.md b/store/agents/firmware-studio/README.md
new file mode 100644
index 000000000..5e611709d
--- /dev/null
+++ b/store/agents/firmware-studio/README.md
@@ -0,0 +1,29 @@
+# Firmware Studio
+
+From source to a firmware binary, with a useful build report beside you. **Signal** shows the real
+compiler log, static RAM and flash usage, configuration, a project pin plan and downloadable build
+artifacts. Search the log, inspect the target and see failures clearly.
+
+Try: “Build a nonblocking ESP32 status light and show me its memory footprint.”
+
+The Arduino starter is pinned to Espressif's PlatformIO platform 6.10.0. The helper builds one
+environment once and never flashes hardware. Upload, erase, debugging and serial access are
+separate, explicitly approved steps. “Compiled” does not mean “tested on the device.”
+
+Requires PlatformIO, Node 20+ (or Harness's managed Node) and the shared Web Viewer. `PIO_BIN`
+supports custom installs. The first compile downloads the selected platform's SDK and toolchain.
+
+```sh
+harness dsh install "$PWD/store/agents/firmware-studio" --link
+harness dsh doctor autonomous/firmware-studio
+```
+
+Memory figures come from the compiler; the board illustration and pin plan are not live telemetry
+or a verified wiring diagram. Upstream: [PlatformIO](https://platformio.org).
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/firmware-studio/harness.json b/store/agents/firmware-studio/harness.json
new file mode 100644
index 000000000..b52f2446a
--- /dev/null
+++ b/store/agents/firmware-studio/harness.json
@@ -0,0 +1,35 @@
+{
+ "spec": 1,
+ "id": "autonomous/firmware-studio",
+ "name": "Firmware Studio",
+ "category": "Embedded",
+ "author": "OpenHarness contributors",
+ "description": "Build PlatformIO firmware and inspect real compiler results, memory usage, downloadable artifacts and a project pin plan. Hardware deployment is a separate approved step.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "platformio.ini",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "FIRMWARE_TOOLCHAIN": "${dsh}/toolchain",
+ "FIRMWARE_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [
+ ".html"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/firmware-studio/package.json b/store/agents/firmware-studio/package.json
new file mode 100644
index 000000000..eefef2e54
--- /dev/null
+++ b/store/agents/firmware-studio/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/firmware-studio-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/firmware-studio/skills/firmware/SKILL.md b/store/agents/firmware-studio/skills/firmware/SKILL.md
new file mode 100644
index 000000000..6fbe9c7ea
--- /dev/null
+++ b/store/agents/firmware-studio/skills/firmware/SKILL.md
@@ -0,0 +1,40 @@
+---
+name: firmware
+description: Build PlatformIO firmware and inspect real compilation, memory, artifacts and pin plans without implicitly accessing hardware.
+---
+
+# Firmware Studio
+
+`platformio.ini` selects environments, platform, board and framework. Pin platform and library
+versions for reproducibility; the starter uses `[email protected]` with Arduino. Arduino code is C++:
+use `src/main.cpp`. Document a board's exact variant before choosing pins or peripherals.
+
+```sh
+sh "$FIRMWARE_SKILLS/firmware/scripts/build-firmware.sh"
+sh "$FIRMWARE_SKILLS/firmware/scripts/build-firmware.sh" esp32dev
+```
+
+The helper selects the requested environment, first `default_envs` entry, or first `[env:name]`.
+It runs `pio run --project-dir ... -e ...` exactly once, not a second compile to read sizes.
+`PIO_BIN` can select an explicit binary; otherwise PATH or the package's PlatformIO venv is used.
+Node 20+ can come from the machine or Harness's managed runtime.
+
+Outputs: `build-status.html`, `.harness/build.json`, `.harness/build.log` and copied artifacts under
+`out/`. Missing memory lines display as unavailable, not fabricated zeroes. RAM is the compiler's
+static allocation, not a runtime peak. Flash is the selected build partition budget, not necessarily
+the chip's total flash capacity. Advanced inherited INI values remain source text in the dashboard;
+the compiler log is authoritative about the resolved target.
+
+`pins.json` contains `{"pins":[{"pin":"GPIO 2","role":"LED","direction":"Output","note":"..."}]}`
+and an optional top-level note. It documents intent only. The pictured board is conceptual.
+Review the exact board documentation for input-only pins, boot straps, voltage and current limits.
+
+A failed command, missing binary or invalid pin plan clears readiness and publishes a failure page.
+Read the actual log and fix the cause, then rebuild. Inspect dashboard tabs, log filtering and
+artifact downloads in the shared Web Viewer. `proof.json` includes a default tab-interaction recipe.
+
+## Device boundary
+
+Compile first. `pio run -t upload`, `-t erase`, debugger connections and serial access are separate
+real-device steps requiring the user's explicit authorization. A requested build does not authorize
+any of them. Do not claim the firmware works on hardware until an actual approved test establishes it.
diff --git a/store/agents/firmware-studio/skills/firmware/scripts/build-firmware.sh b/store/agents/firmware-studio/skills/firmware/scripts/build-firmware.sh
new file mode 100755
index 000000000..9a9c80032
--- /dev/null
+++ b/store/agents/firmware-studio/skills/firmware/scripts/build-firmware.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd "$(dirname "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs" "$@"
diff --git a/store/agents/firmware-studio/skills/firmware/scripts/build.mjs b/store/agents/firmware-studio/skills/firmware/scripts/build.mjs
new file mode 100644
index 000000000..c6be0dc71
--- /dev/null
+++ b/store/agents/firmware-studio/skills/firmware/scripts/build.mjs
@@ -0,0 +1,62 @@
+import { access, readFile, writeFile, mkdir, readdir, rename } from 'node:fs/promises';
+import { constants } from 'node:fs';
+import { spawnSync } from 'node:child_process';
+import { delimiter, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+export function parseMemory(log){
+ const read=label=>{const match=log.match(new RegExp(label+':[^\\n]*?used\\s+(\\d+)\\s+bytes\\s+from\\s+(\\d+)\\s+bytes','i'));return match&&Number(match[2])>0?{used:Number(match[1]),total:Number(match[2])}:null;};
+ return {ram:read('RAM'),flash:read('Flash')};
+}
+export function projectConfig(source,requested){
+ const sections=new Map();let section='';
+ for(const raw of source.split(/\r?\n/)){const line=raw.trim();if(!line||/^[#;]/.test(line))continue;const heading=line.match(/^\[([^\]]+)\]$/);if(heading){section=heading[1];sections.set(section,{});continue;}const pair=line.match(/^([^=]+)=(.*)$/);if(pair&&sections.has(section))sections.get(section)[pair[1].trim()]=pair[2].trim();}
+ const environment=requested||sections.get('platformio')?.default_envs?.split(/[\s,]+/)[0]||[...sections.keys()].find(name=>name.startsWith('env:'))?.slice(4);
+ if(!environment||!/^[a-zA-Z0-9_.-]{1,80}$/.test(environment)||!sections.has('env:'+environment))throw new Error('Choose an existing [env:name] from platformio.ini.');
+ return {...sections.get('env'),...sections.get('env:'+environment),environment};
+}
+async function executable(){
+ const candidates=[process.env.PIO_BIN,'pio',process.env.FIRMWARE_TOOLCHAIN&&resolve(process.env.FIRMWARE_TOOLCHAIN,'../.venv/bin/pio')];
+ for(const candidate of candidates.filter(Boolean))for(const file of candidate.includes('/')?[candidate]:(process.env.PATH||'').split(delimiter).map(dir=>join(dir,candidate))){try{await access(file,constants.X_OK);return file;}catch{}}
+ throw new Error('PlatformIO not found. Set PIO_BIN or run harness dsh doctor autonomous/firmware-studio.');
+}
+export async function build(workspace,{bin,environment}={}){
+ const state=join(workspace,'.harness');await mkdir(state,{recursive:true});
+ const atomic=async(path,bytes)=>{const temporary=path+'.'+process.pid+'.tmp';await writeFile(temporary,bytes);await rename(temporary,path);};
+ const shell=await readFile(new URL('dashboard.html',import.meta.url),'utf8');
+ const report={state:'building',summary:'Building the selected environment. No device access.',at:new Date().toISOString(),log:'',artifacts:[],pins:null};
+ const publish=async()=>{
+ const payload=JSON.stringify(report).replaceAll('<','\\u003c').replaceAll('\u2028','\\u2028').replaceAll('\u2029','\\u2029');
+ await atomic(join(workspace,'build-status.html'),shell.replace('<!--DATA-->',()=>payload));
+ await atomic(join(state,'build.json'),JSON.stringify(report,null,2)+'\n');
+ await atomic(join(state,'verdict.json'),JSON.stringify({spec:1,ready:report.state==='ok',summary:report.summary,findings:report.state==='failed'?[{severity:'error',kind:'compile',message:report.summary}]:[],artifact:'build-status.html',updatedAt:new Date().toISOString()},null,2)+'\n');
+ };
+ try{
+ await publish();
+ report.config=await readFile(join(workspace,'platformio.ini'),'utf8');
+ const config=projectConfig(report.config,environment);for(const key of ['environment','board','platform','framework'])report[key]=config[key];
+ try{
+ const plan=JSON.parse(await readFile(join(workspace,'pins.json'),'utf8'));
+ if(!plan||!Array.isArray(plan.pins)||plan.pins.length>100)throw new Error('pins.json needs a pins array (at most 100).');
+ if(plan.note!==undefined&&typeof plan.note!=='string')throw new Error('The pin-plan note must be text.');
+ for(const pin of plan.pins)if(!pin||typeof pin.pin!=='string'||typeof pin.role!=='string'||['direction','note'].some(key=>pin[key]!==undefined&&typeof pin[key]!=='string'))throw new Error('Each pin needs text pin/role fields and optional text direction/note fields.');
+ report.pins=plan;
+ }catch(error){if(error.code!=='ENOENT')throw error;}
+ await publish();
+ const started=performance.now();
+ const result=spawnSync(bin||await executable(),['run','--project-dir',workspace,'-e',config.environment],{cwd:workspace,encoding:'utf8',timeout:600000,maxBuffer:20*1024*1024});
+ report.duration=(performance.now()-started)/1000;report.log=(result.stdout||'')+(result.stderr||'');
+ await atomic(join(state,'build.log'),report.log);Object.assign(report,parseMemory(report.log));
+ if(result.error||result.status!==0)throw new Error('PlatformIO build failed: '+(result.error?.message||'exit '+result.status)+'.');
+ const output=join(workspace,'.pio/build',config.environment);
+ const names=(await readdir(output)).filter(name=>/^firmware\.(bin|hex|elf)$/.test(name));
+ if(!names.length)throw new Error('PlatformIO exited successfully but produced no firmware binary.');
+ await mkdir(join(workspace,'out'),{recursive:true});
+ for(const name of names){const bytes=await readFile(join(output,name));if(!bytes.length)throw new Error(name+' is empty.');const path='out/'+config.environment+'-'+name;await atomic(join(workspace,path),bytes);report.artifacts.push({name:config.environment+'-'+name,path,bytes:bytes.length});}
+ report.state='ok';report.summary=config.environment+' compiled and linked · not flashed';
+ await publish();return report;
+ }catch(error){report.state='failed';report.summary=error.message;report.artifacts=[];await publish();throw error;}
+}
+if(process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url)){
+ try{console.log((await build(resolve(process.env.HARNESS_WORKSPACE||process.cwd()),{environment:process.argv[2]})).summary);}
+ catch(error){console.error(error.message);process.exitCode=1;}
+}
diff --git a/store/agents/firmware-studio/skills/firmware/scripts/dashboard.html b/store/agents/firmware-studio/skills/firmware/scripts/dashboard.html
new file mode 100644
index 000000000..581a1a4dc
--- /dev/null
+++ b/store/agents/firmware-studio/skills/firmware/scripts/dashboard.html
@@ -0,0 +1,22 @@
+<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Signal / Firmware Studio</title><link rel="icon" href="data:,"><style>
+:root{color-scheme:dark;font:14px/1.55 system-ui,sans-serif;--bg:#10191d;--card:#19252b;--line:#314047;--muted:#8fa6ac;--ink:#e6efea;--accent:#b8e574}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}header,main,footer{max-width:1240px;margin:auto;padding:25px 38px}header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.brand{font-size:23px;font-weight:700;letter-spacing:-1px}.brand span{font:10px ui-monospace,monospace;color:var(--muted);letter-spacing:2px;margin-left:16px}.badge{border:1px solid #486243;color:var(--accent);padding:6px 11px;border-radius:20px;font:10px ui-monospace,monospace}.eyebrow{color:var(--muted);font:10px ui-monospace,monospace;letter-spacing:2px}.hero{display:grid;grid-template-columns:1.3fr 1fr;gap:50px;align-items:center;margin:30px 0}h1{font-size:clamp(38px,5vw,66px);font-weight:550;line-height:1.05;letter-spacing:-2.5px;margin:20px 0}h1 em{font-family:Georgia,serif;font-weight:400;color:var(--accent)}p{color:var(--muted);max-width:520px}.board{position:relative;border:1px solid #486358;border-radius:17px;padding:27px 30px;background:radial-gradient(ellipse at 20% 20%,#2d4436,#20312d 60%,#182823);box-shadow:0 25px 70px #0003}.board:before,.board:after{content:'';position:absolute;top:28px;bottom:28px;width:10px;background:repeating-linear-gradient(to bottom,#b5a16b 0,#b5a16b 7px,transparent 7px,transparent 20px)}.board:before{left:-7px}.board:after{right:-7px}.chip{margin:18px auto 23px;width:116px;height:92px;background:#182427;border:1px solid #638375;box-shadow:0 0 0 8px #314b3f;display:grid;place-content:center;text-align:center;color:#cad7c7;font:11px ui-monospace,monospace}.chip strong{font-size:19px;color:#eff5df}.board dl{margin:0;display:grid;grid-template-columns:1fr 1fr;font-size:11px;gap:10px}.board dt{color:#aac4ae}.board dd{text-align:right;margin:0;overflow-wrap:anywhere}.led{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px #b8e57480;margin-right:7px}.board-note{text-align:center;font:9px ui-monospace,monospace;color:#88a797;margin-top:17px}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:34px 0 26px}.metric{border:1px solid var(--line);background:var(--card);padding:22px;border-radius:10px}.metric strong{display:block;font:32px/1.2 ui-monospace,monospace;letter-spacing:-1px;margin:13px 0}.metric small{color:var(--muted);font:10px ui-monospace,monospace}.bar{height:5px;background:#2b3e41;border-radius:4px;margin:15px 0 12px;overflow:hidden}.bar span{display:block;height:100%;width:0;background:var(--accent)}.tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-top:28px}button{font:inherit;color:var(--muted);border:0;background:transparent;cursor:pointer;padding:10px 0;border-bottom:2px solid transparent}button[aria-selected=true]{border-color:var(--accent);color:var(--ink)}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.panel{border:1px solid var(--line);border-top:0;border-radius:0 0 9px 9px;background:#131f24;padding:24px;min-height:210px}.panel pre{font:11px/1.7 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;margin:14px 0 0;max-height:310px;overflow:auto;color:#b4c8c6}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:20px}.panel-head input{font:11px system-ui;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px 10px;max-width:180px}#pins{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.pin{border:1px solid var(--line);border-radius:8px;padding:15px}.pin strong{color:var(--accent)}.pin p{font-size:11px}.artifacts{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}.artifacts a{display:block;padding:9px 13px;border:1px solid #486243;background:#21332a;border-radius:7px;color:var(--accent);font-size:12px;text-decoration:none}.notice{font-size:11px;padding:15px 18px;border-left:2px solid #57754c;background:#17251e;margin-top:23px;color:#b8c9b6}.failed{--accent:#ffad82}.failed .notice{border-color:#ffad82;background:#32251f}.failed .led{background:#ffad82}footer{display:flex;justify-content:space-between;gap:20px;font:10px ui-monospace,monospace;color:var(--muted);border-top:1px solid var(--line);margin-top:26px}[hidden]{display:none!important}@media(max-width:700px){header,main,footer{padding:19px}.brand span{display:none}.hero{grid-template-columns:1fr;gap:22px;margin-top:17px}h1{font-size:48px}.board{max-width:390px;width:100%;margin:auto}.metrics{grid-template-columns:1fr;gap:9px}.metric{padding:17px}.metric strong{font-size:28px}.panel{padding:16px}.tabs{gap:22px}.panel-head{align-items:flex-start}.panel-head input{max-width:140px}footer{font-size:9px}}
+</style></head><body><header><div class="brand">⌁ Signal <span>/ FIRMWARE STUDIO</span></div><span class="badge" id="status">BUILD REPORT</span></header><main><section class="hero"><div><div class="eyebrow">FROM SOURCE TO SILICON</div><h1 id="headline">Make a little<br><em>hardware happen.</em></h1><p id="summary"></p><div class="artifacts" id="artifacts"></div></div><div class="board" aria-label="Conceptual board summary, not a pinout"><div class="eyebrow"><span class="led"></span>PROJECT / <span id="environment"></span></div><div class="chip"><strong id="chip">MCU</strong><span>BUILD TARGET</span></div><dl><dt>Board</dt><dd id="board">—</dd><dt>Framework</dt><dd id="framework">—</dd><dt>Platform</dt><dd id="platform">—</dd><dt>Device connection</dt><dd>Not requested</dd></dl><div class="board-note">CONCEPTUAL VIEW · NO HARDWARE CONNECTED</div></div></section><section class="metrics" aria-label="Build metrics"><div class="metric"><span class="eyebrow">FLASH</span><strong id="flash-value">—</strong><div class="bar"><span id="flash-bar"></span></div><small id="flash-detail">Not reported</small></div><div class="metric"><span class="eyebrow">STATIC RAM</span><strong id="ram-value">—</strong><div class="bar"><span id="ram-bar"></span></div><small id="ram-detail">Not reported</small></div><div class="metric"><span class="eyebrow">BUILD TIME</span><strong id="duration">—</strong><div class="bar"><span style="width:100%"></span></div><small id="built-at"></small></div></section><div class="tabs" role="tablist" aria-label="Build details"><button id="tab-log" role="tab" aria-selected="true" aria-controls="panel-log">Build log</button><button id="tab-config" role="tab" aria-selected="false" aria-controls="panel-config">Configuration</button><button id="tab-pins" role="tab" aria-selected="false" aria-controls="panel-pins">Pin plan</button></div><section id="panel-log" class="panel" role="tabpanel" aria-labelledby="tab-log"><div class="panel-head"><span class="eyebrow" id="command"></span><input id="filter" type="search" aria-label="Filter build log" placeholder="Filter the log…"></div><pre id="log"></pre></section><section id="panel-config" class="panel" role="tabpanel" aria-labelledby="tab-config" hidden><span class="eyebrow">PLATFORMIO.INI · SAVED INPUT</span><pre id="config"></pre></section><section id="panel-pins" class="panel" role="tabpanel" aria-labelledby="tab-pins" hidden><div id="pins"></div><p id="pin-note"></p></section><div class="notice" id="notice"></div></main><footer><span>Built locally. Made for the real world.</span><span>Compilation ≠ hardware verification</span></footer><script id="build-data" type="application/json"><!--DATA--></script><script>
+const data=JSON.parse(document.getElementById('build-data').textContent),$=id=>document.getElementById(id);
+const human=bytes=>bytes>=1048576?(bytes/1048576).toFixed(2)+' MiB':(bytes/1024).toFixed(1)+' KiB';
+$('status').textContent=data.state==='ok'?'COMPILED · NOT FLASHED':data.state==='building'?'COMPILING':'BUILD FAILED';
+document.body.classList.toggle('failed',data.state==='failed');
+if(data.state==='failed')$('headline').textContent='A useful failure. A clear next step.';
+$('summary').textContent=data.summary;$('environment').textContent=data.environment||'—';
+for(const key of ['board','framework','platform'])$(key).textContent=data[key]||'—';
+$('chip').textContent=(data.board||'MCU').toUpperCase();$('config').textContent=data.config||'';
+for(const key of ['ram','flash']){const value=data[key];if(value){$(key+'-value').textContent=human(value.used);$(key+'-detail').textContent=value.used.toLocaleString()+' / '+value.total.toLocaleString()+' bytes · '+(value.used/value.total*100).toFixed(1)+'%';$(key+'-bar').style.width=Math.min(100,value.used/value.total*100)+'%';}}
+$('duration').textContent=Number.isFinite(data.duration)?data.duration.toFixed(1)+' s':'—';$('built-at').textContent=new Date(data.at).toLocaleString();
+$('command').textContent='PIO RUN -E '+(data.environment||'—');
+const filter=()=>{const query=$('filter').value.toLowerCase();$('log').textContent=(data.log||'Waiting for the compiler…').split('\n').filter(line=>line.toLowerCase().includes(query)).join('\n')||'No log lines match.';};$('filter').oninput=filter;filter();
+const tabs=['log','config','pins'];function show(name){for(const tab of tabs){$('tab-'+tab).setAttribute('aria-selected',String(tab===name));$('tab-'+tab).tabIndex=tab===name?0:-1;$('panel-'+tab).hidden=tab!==name;}}
+for(const name of tabs){$('tab-'+name).onclick=()=>show(name);$('tab-'+name).onkeydown=event=>{if(!['ArrowLeft','ArrowRight','Home','End'].includes(event.key))return;event.preventDefault();const index=tabs.indexOf(name),next=event.key==='Home'?0:event.key==='End'?2:(index+(event.key==='ArrowRight'?1:2))%3;show(tabs[next]);$('tab-'+tabs[next]).focus();};}show('log');
+for(const pin of data.pins?.pins||[]){const card=document.createElement('div');card.className='pin';const title=document.createElement('strong');title.textContent=pin.pin+' / '+pin.role;const note=document.createElement('p');note.textContent=[pin.direction,pin.note].filter(Boolean).join(' · ');card.append(title,note);$('pins').append(card);}
+$('pin-note').textContent=data.pins?.note||'No pin plan supplied. Add pins.json to document project assignments.';
+for(const file of data.artifacts||[]){const link=document.createElement('a');link.href=file.path.split('/').map(encodeURIComponent).join('/');link.download=file.name;link.textContent='↧ '+file.name+' · '+human(file.bytes);$('artifacts').append(link);}
+$('notice').textContent=data.state==='ok'?'The selected environment compiled and linked. This does not test electrical connections, runtime behavior or physical safety. Upload, erase and serial access are separate, explicitly approved actions.':data.state==='building'?'Compiling only. No device will be flashed or contacted.':data.summary+' Older outputs are not presented as a successful new build. See the log and rebuild.';
+</script></body></html>
diff --git a/store/agents/firmware-studio/store.json b/store/agents/firmware-studio/store.json
new file mode 100644
index 000000000..73e6f510b
--- /dev/null
+++ b/store/agents/firmware-studio/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://platformio.org",
+ "upstream": "https://github.com/platformio/platformio-core",
+ "license": "MIT",
+ "tagline": "Compile firmware and inspect memory, artifacts and build logs",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/firmware-studio/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Compile the ESP32 starter and show memory use, pin intent and build logs. Do not flash hardware.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/firmware-studio/starter.jpg",
+ "caption": "Signal · actual ESP32 compile, not hardware-tested"
+ }
+ ]
+}
diff --git a/store/agents/firmware-studio/template/.gitignore b/store/agents/firmware-studio/template/.gitignore
new file mode 100644
index 000000000..befe657d9
--- /dev/null
+++ b/store/agents/firmware-studio/template/.gitignore
@@ -0,0 +1,4 @@
+.pio/
+build/
+*.elf
+*.bin
diff --git a/store/agents/firmware-studio/template/pins.json b/store/agents/firmware-studio/template/pins.json
new file mode 100644
index 000000000..6086fe7b7
--- /dev/null
+++ b/store/agents/firmware-studio/template/pins.json
@@ -0,0 +1 @@
+{"pins":[{"pin":"GPIO 2","role":"Status LED","direction":"Output","note":"Example assignment. Confirm the LED and boot-strapping requirements on your exact ESP32 board."}],"note":"This is a project pin plan, not a hardware connection or a verified board pinout."}
diff --git a/store/agents/firmware-studio/template/platformio.ini b/store/agents/firmware-studio/template/platformio.ini
new file mode 100644
index 000000000..f4d844955
--- /dev/null
+++ b/store/agents/firmware-studio/template/platformio.ini
@@ -0,0 +1,5 @@
+[env:esp32dev]
+platform = [email protected]
+board = esp32dev
+framework = arduino
+monitor_speed = 115200
diff --git a/store/agents/firmware-studio/template/proof.json b/store/agents/firmware-studio/template/proof.json
new file mode 100644
index 000000000..fdc1ff18c
--- /dev/null
+++ b/store/agents/firmware-studio/template/proof.json
@@ -0,0 +1 @@
+{"actions":[{"selector":"#tab-config","click":true},{"selector":"#tab-config","attribute":{"name":"aria-selected","value":"true"}},{"selector":"#tab-pins","click":true},{"selector":"#tab-pins","attribute":{"name":"aria-selected","value":"true"}},{"selector":"#tab-log","click":true},{"selector":"#tab-log","attribute":{"name":"aria-selected","value":"true"}}]}
diff --git a/store/agents/firmware-studio/template/src/main.cpp b/store/agents/firmware-studio/template/src/main.cpp
new file mode 100644
index 000000000..eac7aa1f4
--- /dev/null
+++ b/store/agents/firmware-studio/template/src/main.cpp
@@ -0,0 +1,18 @@
+#include <Arduino.h>
+
+// Example LED assignment, not a verified board pinout. Confirm GPIO 2 on your board.
+const int kLed = 2;
+
+void setup() {
+ pinMode(kLed, OUTPUT);
+ Serial.begin(115200);
+ delay(200);
+ Serial.println("firmware alive");
+}
+
+void loop() {
+ digitalWrite(kLed, HIGH);
+ delay(500);
+ digitalWrite(kLed, LOW);
+ delay(500);
+}
diff --git a/store/agents/firmware-studio/test/build.test.mjs b/store/agents/firmware-studio/test/build.test.mjs
new file mode 100644
index 000000000..afcdcfc6d
--- /dev/null
+++ b/store/agents/firmware-studio/test/build.test.mjs
@@ -0,0 +1,31 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';
+import { join } from 'node:path';
+import { tmpdir } from 'node:os';
+import { build, parseMemory, projectConfig } from '../skills/firmware/scripts/build.mjs';
+test('compiler memory reports remain numeric and missing information is not invented',()=>{
+ assert.deepEqual(parseMemory('RAM: [= ] 6.6% (used 21464 bytes from 327680 bytes)\nFlash: [== ] 20.5% (used 269197 bytes from 1310720 bytes)'),{ram:{used:21464,total:327680},flash:{used:269197,total:1310720}});
+ assert.deepEqual(parseMemory('Build succeeded'),{ram:null,flash:null});
+ assert.equal(projectConfig('[platformio]\ndefault_envs=b\n[env]\nframework=arduino\n[env:a]\nboard=a\n[env:b]\nboard=b').environment,'b');
+ assert.throws(()=>projectConfig('[env:a]\n','unknown'));
+});
+test('the build invokes PlatformIO once, publishes real artifact bytes, and replaces a stale success on failure',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'firmware-build-test-'));
+ try{
+ await writeFile(join(workspace,'platformio.ini'),'[env:test]\nboard=example\nframework=arduino\n');
+ await writeFile(join(workspace,'pins.json'),JSON.stringify({pins:[{pin:'GPIO 2',role:'</script><script>window.injected=1</script>'}]}));
+ const bin=join(workspace,'fake-pio');
+ await writeFile(bin,'#!/bin/sh\necho call >> calls\nmkdir -p .pio/build/test\nprintf "real artifact fixture" > .pio/build/test/firmware.bin\necho "RAM: [= ] 10% (used 10 bytes from 100 bytes)"\n',{mode:0o755});
+ const report=await build(workspace,{bin});assert.equal(report.state,'ok');assert.equal(report.ram.used,10);
+ assert.equal((await readFile(join(workspace,'calls'),'utf8')).trim(),'call');
+ assert.equal(await readFile(join(workspace,'out/test-firmware.bin'),'utf8'),'real artifact fixture');
+ const html=await readFile(join(workspace,'build-status.html'),'utf8');assert.ok(!html.includes('</script><script>window.injected'));
+ await writeFile(bin,'#!/bin/sh\necho "compile error" >&2\nexit 1\n',{mode:0o755});
+ await assert.rejects(()=>build(workspace,{bin}),/failed/);
+ assert.equal(JSON.parse(await readFile(join(workspace,'.harness/verdict.json'))).ready,false);
+ const failed=JSON.parse(await readFile(join(workspace,'.harness/build.json')));assert.equal(failed.state,'failed');assert.deepEqual(failed.artifacts,[]);assert.match(failed.log,/compile error/);
+ await writeFile(join(workspace,'pins.json'),'{"pins":[null]}');await assert.rejects(()=>build(workspace,{bin}),/Each pin/);
+ assert.equal(JSON.parse(await readFile(join(workspace,'.harness/build.json'))).pins,null);
+ }finally{await rm(workspace,{recursive:true,force:true});}
+});
diff --git a/store/agents/firmware-studio/test/toolchain.test.mjs b/store/agents/firmware-studio/test/toolchain.test.mjs
new file mode 100644
index 000000000..44f60aa1e
--- /dev/null
+++ b/store/agents/firmware-studio/test/toolchain.test.mjs
@@ -0,0 +1,72 @@
+// Firmware Studio's scripts, run the way Harness runs them.
+//
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync, chmodSync, mkdirSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join, dirname } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const dir of scratch) rmSync(dir, { recursive: true, force: true }) })
+function tempDir() { const d = mkdtempSync(join(tmpdir(), 'firmware-')); scratch.push(d); return d }
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [k, v] of Object.entries(env)) if (v === null) delete merged[k]; else merged[k] = v
+ const r = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: r.status, stdout: r.stdout, stderr: r.stderr }
+}
+function fakePio() {
+ const dir = tempDir(); const bin = join(dir, 'pio')
+ writeFileSync(bin, '#!/bin/sh\nmkdir -p .pio/build/esp32dev\nprintf "fixture" > .pio/build/esp32dev/firmware.bin\necho "RAM: [= ] 10% (used 10 bytes from 100 bytes)"\nexit 0\n'); chmodSync(bin, 0o755)
+ return { dir, bin }
+}
+
+test('every script the manifest names is executable', () => {
+ for (const s of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/firmware/scripts/build-firmware.sh'])
+ assert.doesNotThrow(() => accessSync(join(here, s), constants.X_OK), s)
+})
+
+test('setup finds pio on PATH and says ok', () => {
+ const { dir } = fakePio()
+ const { code, stdout } = run(manifest.toolchain.setup, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0); assert.match(stdout, /ok pio/)
+})
+
+test('doctor ok when pio on PATH', () => {
+ const { dir } = fakePio()
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0); assert.match(stdout, /ok pio/)
+})
+
+test('doctor miss and fails when pio is absent', () => {
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: tempDir() } })
+ assert.equal(code, 1); assert.match(stdout, /miss pio/)
+})
+
+test('init seeds the first verdict and a placeholder build-status pane', () => {
+ const ws = tempDir()
+ assert.equal(run(manifest.workspace.init, { cwd: ws, env: { HARNESS_DSH: manifest.id } }).code, 0)
+ assert.equal(JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8')).ready, false)
+ assert.ok(existsSync(join(ws, 'build-status.html')))
+})
+
+test('build-firmware.sh builds, writes the pane, and flips the verdict, as SKILL.md documents', () => {
+ const skill = readFileSync(join(here, 'skills/firmware/SKILL.md'), 'utf8')
+ const command = 'sh "$FIRMWARE_SKILLS/firmware/scripts/build-firmware.sh"'
+ assert.ok(skill.includes(command))
+ assert.equal(manifest.agent.env.FIRMWARE_SKILLS, '${dsh}/skills')
+ const { dir } = fakePio()
+ const ws = tempDir()
+ mkdirSync(join(ws, 'src'), { recursive: true })
+ writeFileSync(join(ws, 'platformio.ini'), '[env:esp32dev]\n')
+ writeFileSync(join(ws, 'src/main.cpp'), 'void setup(){}\nvoid loop(){}\n')
+ const r = spawnSync('/bin/sh', ['-c', command], { cwd: ws, env: { ...process.env, FIRMWARE_SKILLS: join(here, 'skills'), FIRMWARE_TOOLCHAIN: join(here, 'toolchain'), PATH: `${dir}:${dirname(process.execPath)}:/usr/bin:/bin`, HARNESS_WORKSPACE: ws }, encoding: 'utf8' })
+ assert.equal(r.status, 0, `${r.stderr || ''} ${r.stdout || ''}`)
+ assert.equal(existsSync(join(ws, 'build-status.html')), true)
+ assert.equal(JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8')).ready, true)
+})
diff --git a/store/agents/firmware-studio/toolchain/doctor.sh b/store/agents/firmware-studio/toolchain/doctor.sh
new file mode 100755
index 000000000..633477053
--- /dev/null
+++ b/store/agents/firmware-studio/toolchain/doctor.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Exit 0 when this machine can run the harness.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+fail=0
+if [ -n "${PIO_BIN:-}" ] && [ -x "$PIO_BIN" ]; then
+ echo "ok pio at $PIO_BIN"
+elif command -v pio >/dev/null 2>&1; then
+ echo "ok pio on PATH ($(command -v pio))"
+elif [ -x "$dsh/.venv/bin/pio" ]; then
+ echo "ok pio vendored at $dsh/.venv/bin/pio"
+else
+ echo "miss pio — run toolchain/setup.sh (vendors PlatformIO)"
+ fail=1
+fi
+[ -d "$dsh/skills/firmware" ] && echo "ok firmware skill" || echo "warn firmware skill missing"
+exit $fail
diff --git a/store/agents/firmware-studio/toolchain/init-workspace.sh b/store/agents/firmware-studio/toolchain/init-workspace.sh
new file mode 100755
index 000000000..f83c9a386
--- /dev/null
+++ b/store/agents/firmware-studio/toolchain/init-workspace.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Firmware workspace ready — describe a device to build",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+cat > build-status.html <<'HTML'
+<!doctype html><meta charset="utf-8"><title>Firmware build</title>
+<h1>Firmware Studio</h1><p>No build yet. Describe a device to get compiled, flashable firmware.</p>
+HTML
+printf 'Firmware workspace initialized by %s\n' "${HARNESS_DSH:-firmware-studio}" > .harness-initialized
diff --git a/store/agents/firmware-studio/toolchain/node.sh b/store/agents/firmware-studio/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/firmware-studio/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/firmware-studio/toolchain/runtimes.sh b/store/agents/firmware-studio/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/firmware-studio/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/firmware-studio/toolchain/setup.sh b/store/agents/firmware-studio/toolchain/setup.sh
new file mode 100755
index 000000000..3bf7a4130
--- /dev/null
+++ b/store/agents/firmware-studio/toolchain/setup.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Install/verify PlatformIO for this harness. cwd = the package install dir.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+if [ -n "${PIO_BIN:-}" ]; then
+ [ -x "$PIO_BIN" ] || { echo "miss PIO_BIN is not executable"; exit 1; }
+ echo "ok pio at $PIO_BIN"; exit 0
+fi
+if command -v pio >/dev/null 2>&1; then
+ echo "ok pio on PATH ($(command -v pio))"; exit 0
+fi
+if [ -x "$dsh/.venv/bin/pio" ]; then
+ echo "ok pio vendored at $dsh/.venv/bin/pio"; exit 0
+fi
+echo "miss pio — vendoring PlatformIO into .venv (first run downloads it)..."
+bash -c '. "$1"; harness_venv "$2" 3.12 3.10 || exit 1; "$2/bin/python" -m pip install "platformio==6.1.18"' _ "$dsh/toolchain/runtimes.sh" "$dsh/.venv" || { echo "miss managed PlatformIO setup failed — check network"; exit 1; }
+[ -x "$dsh/.venv/bin/pio" ] || { echo "miss pio still missing after install"; exit 1; }
+echo "ok pio vendored at $dsh/.venv/bin/pio"
diff --git a/store/agents/freecad/.gitignore b/store/agents/freecad/.gitignore
new file mode 100644
index 000000000..530967c5c
--- /dev/null
+++ b/store/agents/freecad/.gitignore
@@ -0,0 +1,13 @@
+# Exported geometry — never source.
+part.step
+part.stl
+*.step
+*.stp
+*.stl
+*.brep
+# Harness bookkeeping.
+.harness/
+.harness-initialized
+toolchain/freecad-cli
+*.FCStd
+*.FCStd1
diff --git a/store/agents/freecad/AGENTS.md b/store/agents/freecad/AGENTS.md
new file mode 100644
index 000000000..89bc14391
--- /dev/null
+++ b/store/agents/freecad/AGENTS.md
@@ -0,0 +1,15 @@
+# FreeCAD
+
+Read the `freecad` skill. The saved design is `part.FCMacro`, a Python macro executed by FreeCADCmd.
+Keep design inputs at the top and rebuild after changes. The shared CAD Viewer follows `part.step`.
+
+The Pocket starter exports a two-piece electronics enclosure, a vented lid, an STL mesh and a
+FreeCAD document. Geometry is generated by the macro; the exported parameter object records inputs,
+not a fully constrained Sketcher feature history.
+
+Use the one-stop build. The macro must export into `HARNESS_BUILD_DIR` (falling back to the current
+directory only for manual use). The build reimports and checks the newly written STEP in FreeCAD.
+An old export is never proof of a successful new build.
+
+State manufacturing assumptions and inspect the real assembly. Closed, valid solids do not prove
+wall thickness, strength, fit or suitability for a particular machine.
diff --git a/store/agents/freecad/LICENSE b/store/agents/freecad/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/freecad/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/freecad/PROVENANCE.md b/store/agents/freecad/PROVENANCE.md
new file mode 100644
index 000000000..441be6692
--- /dev/null
+++ b/store/agents/freecad/PROVENANCE.md
@@ -0,0 +1,7 @@
+# Provenance
+
+The Pocket enclosure macro, native validation/export runner and instructions are
+original MIT-licensed OpenHarness work. [FreeCAD](https://freecad.org) is a
+separately installed LGPL-2.1-or-later CAD application; no FreeCAD binary or source
+is redistributed. Native QA used FreeCAD 1.1.3. The CAD pane is the separate
+autonomous/cad-viewer package, which carries its own upstream notices.
diff --git a/store/agents/freecad/README.md b/store/agents/freecad/README.md
new file mode 100644
index 000000000..05c418b45
--- /dev/null
+++ b/store/agents/freecad/README.md
@@ -0,0 +1,29 @@
+# FreeCAD
+
+Turn a design brief into real CAD geometry and a STEP assembly. The **Pocket** starter includes
+a rounded electronics enclosure, screw bosses, a cable opening and a vented locating lid.
+Change named dimensions in the macro, rebuild, then inspect and measure the parts in the CAD Viewer.
+
+Try: “Resize the enclosure for my board, keep 3 mm clearance, and move the cable opening.”
+
+The build produces STEP, STL and a native FreeCAD document. It reimports the fresh STEP and verifies
+closed, valid, positive-volume solids; a failed build cannot reuse an old export as success.
+The macro is the parametric source. The native file records the generated shapes and design inputs,
+not a complete Sketcher constraint history. Manufacturing fit and strength still need review.
+
+Requires FreeCADCmd, Node 20+ and the shared CAD Viewer. Use `FREECAD_BIN` for a custom binary.
+
+```sh
+harness dsh install "$PWD/store/agents/freecad" --link
+harness dsh doctor autonomous/freecad
+```
+
+Upstream: [FreeCAD](https://freecad.org). This package adds the workspace, skill, example design and
+fresh-export verification.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/freecad/harness.json b/store/agents/freecad/harness.json
new file mode 100644
index 000000000..a95841bc9
--- /dev/null
+++ b/store/agents/freecad/harness.json
@@ -0,0 +1,37 @@
+{
+ "spec": 1,
+ "id": "autonomous/freecad",
+ "name": "FreeCAD",
+ "category": "CAD",
+ "author": "OpenHarness contributors",
+ "description": "Build parametric FreeCAD macros, inspect real STEP assemblies, and verify freshly reimported solids. Includes an editable enclosure and vented lid.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "part.FCMacro",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "FREECAD_TOOLCHAIN": "${dsh}/toolchain",
+ "FREECAD_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/cad-viewer",
+ "artifactExtensions": [
+ ".step",
+ ".stp",
+ ".stl"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/freecad/package.json b/store/agents/freecad/package.json
new file mode 100644
index 000000000..7c3c6d659
--- /dev/null
+++ b/store/agents/freecad/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/freecad-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/freecad/skills/freecad/SKILL.md b/store/agents/freecad/skills/freecad/SKILL.md
new file mode 100644
index 000000000..7cdbdf488
--- /dev/null
+++ b/store/agents/freecad/skills/freecad/SKILL.md
@@ -0,0 +1,36 @@
+---
+name: freecad
+description: Build parametric FreeCAD macros, export STEP assemblies and verify fresh geometry in the shared CAD Viewer.
+---
+
+# FreeCAD
+
+`part.FCMacro` is Python executed by FreeCADCmd, not system Python. Import `FreeCAD as App` and
+`Part`; use named dimensions and reusable construction functions. The Pocket starter produces
+a base and vented lid laid out side by side, with screw bosses, clearance and a cable opening.
+
+```sh
+sh "$FREECAD_SKILLS/freecad/scripts/build-part.sh"
+```
+
+Requires Node 20+ and the headless FreeCAD binary. Resolve `FREECAD_BIN`, the toolchain link,
+`freecadcmd`/`FreeCADCmd` or the installed macOS app. Recent macOS packages put the CLI at
+`FreeCAD.app/Contents/Resources/bin/freecadcmd`, not necessarily `Contents/MacOS/FreeCADCmd`.
+
+## Export contract
+
+The build runs `runner.py` in FreeCAD with `HARNESS_WORKSPACE` and a unique `HARNESS_BUILD_DIR`.
+Your macro reads its source inputs from the workspace and writes `part.step` to that build directory.
+Optional `part.stl` and `part.FCStd` exports are copied alongside it only after verification.
+Use `MeshPart.meshFromShape` for controlled mesh tessellation, and `doc.saveAs` for the native file.
+
+The runner reimports the new STEP, calls `shape.check(True)`, and requires positive-volume,
+closed, valid solids. `shape.check` does not return a success boolean; exceptions indicate errors.
+It writes a fresh geometry receipt. The Node wrapper rejects missing output or receipt even if
+FreeCAD reports exit zero after a Python exception. See `.harness/build.log` and `geometry.json`.
+
+Do not equate STEP validity with printability or machining suitability. Review wall thickness,
+clearance, supports, tool access, strength and intended materials separately. Parametric macro
+inputs are not a promise of a fully constrained Sketcher history in the exported document.
+
+Inspect both parts in the actual viewer; verify dimensions or section cuts relevant to the request.
diff --git a/store/agents/freecad/skills/freecad/scripts/build-part.sh b/store/agents/freecad/skills/freecad/scripts/build-part.sh
new file mode 100755
index 000000000..87483c590
--- /dev/null
+++ b/store/agents/freecad/skills/freecad/scripts/build-part.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd "$(dirname "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs"
diff --git a/store/agents/freecad/skills/freecad/scripts/build.mjs b/store/agents/freecad/skills/freecad/scripts/build.mjs
new file mode 100644
index 000000000..2f7fa7bd0
--- /dev/null
+++ b/store/agents/freecad/skills/freecad/scripts/build.mjs
@@ -0,0 +1,45 @@
+import { access, readFile, writeFile, mkdir, mkdtemp, rename, rm } from 'node:fs/promises';
+import { constants } from 'node:fs';
+import { spawnSync } from 'node:child_process';
+import { delimiter, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+export async function findExecutable(){
+ const candidates=[process.env.FREECAD_BIN,process.env.FREECAD_TOOLCHAIN&&join(process.env.FREECAD_TOOLCHAIN,'freecad-cli'),'freecadcmd','FreeCADCmd','/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd','/Applications/FreeCAD.app/Contents/MacOS/FreeCADCmd'];
+ for(const candidate of candidates.filter(Boolean))for(const file of candidate.includes('/')?[candidate]:(process.env.PATH||'').split(delimiter).map(dir=>join(dir,candidate))){
+ try{await access(file,constants.X_OK);return file;}catch{}
+ }
+ throw new Error('FreeCADCmd not found. Set FREECAD_BIN or run harness dsh doctor autonomous/freecad.');
+}
+export async function build(workspace,{bin}={}){
+ const state=join(workspace,'.harness');await mkdir(state,{recursive:true});
+ const atomic=async(path,value)=>{const temporary=path+'.'+process.pid+'.tmp';await writeFile(temporary,value);await rename(temporary,path);};
+ const verdict=value=>atomic(join(state,'verdict.json'),JSON.stringify({spec:1,...value,updatedAt:new Date().toISOString()},null,2)+'\n');
+ let temporary;
+ try{
+ await verdict({ready:false,summary:'Building and reimporting the STEP assembly',findings:[],artifact:null});
+ const executable=bin||await findExecutable();
+ await access(join(workspace,'part.FCMacro'));
+ temporary=await mkdtemp(join(state,'freecad-'));
+ const runner=fileURLToPath(new URL('runner.py',import.meta.url));
+ const result=spawnSync(executable,[runner],{cwd:workspace,env:{...process.env,HARNESS_WORKSPACE:workspace,HARNESS_BUILD_DIR:temporary},encoding:'utf8',timeout:180000,maxBuffer:10*1024*1024});
+ await atomic(join(state,'build.log'),(result.stdout||'')+(result.stderr||''));
+ if(result.error||result.status!==0)throw new Error('FreeCAD failed: '+(result.error?.message||'exit '+result.status)+'. See .harness/build.log.');
+ const report=JSON.parse(await readFile(join(temporary,'geometry.json'),'utf8'));
+ const step=await readFile(join(temporary,'part.step'));
+ if(!report.valid||!report.closed||report.solids<1||report.volumeMM3<=0||!step.toString('utf8').startsWith('ISO-10303-21;'))throw new Error('Fresh STEP verification failed.');
+ const files=new Map([['part.step',step]]);
+ for(const name of ['part.stl','part.FCStd']){
+ try{const bytes=await readFile(join(temporary,name));if(!bytes.length)throw new Error(name+' is empty');files.set(name,bytes);}
+ catch(error){if(error.code!=='ENOENT')throw error;}
+ }
+ for(const[name,bytes]of files)await atomic(join(workspace,name),bytes);
+ await atomic(join(state,'geometry.json'),JSON.stringify(report,null,2)+'\n');
+ await verdict({ready:true,summary:report.solids+' closed solids · STEP reimport verified',findings:[{severity:'info',kind:'manufacturing',message:'Geometry checks do not certify wall thickness, tolerances or strength. Review the design for its intended manufacturing process.'}],artifact:'part.step'});
+ return report;
+ }catch(error){await verdict({ready:false,summary:'FreeCAD build failed',findings:[{severity:'error',kind:'build',message:error.message}],artifact:null});throw error;}
+ finally{if(temporary)await rm(temporary,{recursive:true,force:true});}
+}
+if(process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url)){
+ try{console.log(await build(resolve(process.env.HARNESS_WORKSPACE||process.cwd())));}
+ catch(error){console.error(error.message);process.exitCode=1;}
+}
diff --git a/store/agents/freecad/skills/freecad/scripts/runner.py b/store/agents/freecad/skills/freecad/scripts/runner.py
new file mode 100644
index 000000000..cb1cc6595
--- /dev/null
+++ b/store/agents/freecad/skills/freecad/scripts/runner.py
@@ -0,0 +1,23 @@
+# Executed by FreeCADCmd, not system Python. Always verify the freshly exported STEP.
+import os
+import json
+import runpy
+import FreeCAD as App
+import Part
+
+workspace = os.environ["HARNESS_WORKSPACE"]
+output = os.environ["HARNESS_BUILD_DIR"]
+runpy.run_path(os.path.join(workspace, "part.FCMacro"), run_name="__main__")
+shape = Part.Shape()
+shape.read(os.path.join(output, "part.step"))
+shape.check(True)
+if not shape.isValid() or not shape.isClosed() or not shape.Solids or shape.Volume <= 0:
+ raise RuntimeError("Reimported STEP does not contain closed, valid solids")
+bounds = shape.BoundBox
+report = {"valid": True, "closed": True, "solids": len(shape.Solids),
+ "volumeMM3": shape.Volume, "areaMM2": shape.Area,
+ "boundsMM": [bounds.XLength, bounds.YLength, bounds.ZLength],
+ "freecadVersion": ".".join(App.Version()[:3])}
+with open(os.path.join(output, "geometry.json"), "w", encoding="utf8") as handle:
+ json.dump(report, handle, indent=2)
+print("HARNESS_GEOMETRY_VERIFIED")
diff --git a/store/agents/freecad/store.json b/store/agents/freecad/store.json
new file mode 100644
index 000000000..cbdb3050b
--- /dev/null
+++ b/store/agents/freecad/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://freecad.org",
+ "upstream": "https://github.com/FreeCAD/FreeCAD",
+ "license": "MIT",
+ "tagline": "Parametric 3D modeling with verified STEP exports",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/freecad/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Build the Pocket enclosure with its vented lid and export validated STEP solids.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/freecad/starter.jpg",
+ "caption": "Pocket · editable enclosure and two closed STEP solids"
+ }
+ ]
+}
diff --git a/store/agents/freecad/template/part.FCMacro b/store/agents/freecad/template/part.FCMacro
new file mode 100644
index 000000000..6c0f9c299
--- /dev/null
+++ b/store/agents/freecad/template/part.FCMacro
@@ -0,0 +1,80 @@
+# Pocket / a parametric two-piece electronics enclosure, millimetres.
+# Build with build-part.sh; exports a real STEP assembly, mesh and FreeCAD document.
+# Edit dimensions here, then rebuild. Clearances are design inputs, not certified fit.
+import os
+import FreeCAD as App
+import Part
+import MeshPart
+
+length, width, height = 92.0, 60.0, 26.0
+wall, floor, corner_radius = 2.4, 2.8, 6.0
+lid_thickness, lip_height, clearance = 2.4, 2.0, 0.3
+screw_diameter, boss_radius, boss_inset = 3.4, 4.4, 9.0
+vent_count, vent_width, vent_length = 7, 2.2, 22.0
+
+assert min(length, width) > 2 * (boss_inset + boss_radius)
+assert height > floor + 6 and 1.2 <= wall < corner_radius < min(length, width) / 2
+assert min(floor, lid_thickness) >= 1.2 and 0 < clearance < wall
+assert screw_diameter / 2 < boss_radius and vent_count >= 1
+outdir = os.environ.get("HARNESS_BUILD_DIR", os.getcwd())
+doc = App.newDocument("Pocket")
+
+def rounded_box(l, w, h, radius):
+ shape = Part.makeBox(l, w, h, App.Vector(-l/2, -w/2, 0))
+ vertical = [edge for edge in shape.Edges if edge.BoundBox.ZLength > h - 1e-7
+ and edge.BoundBox.XLength < 1e-7 and edge.BoundBox.YLength < 1e-7]
+ return shape.makeFillet(radius, vertical)
+
+shell = rounded_box(length, width, height, corner_radius)
+cavity = rounded_box(length-2*wall, width-2*wall, height, corner_radius-wall)
+cavity.translate(App.Vector(0, 0, floor))
+shell = shell.cut(cavity)
+positions = [(x, y) for x in [-length/2+boss_inset, length/2-boss_inset]
+ for y in [-width/2+boss_inset, width/2-boss_inset]]
+for x, y in positions:
+ boss = Part.makeCylinder(boss_radius, height-floor-3, App.Vector(x, y, floor-0.01))
+ hole = Part.makeCylinder(screw_diameter/2, height, App.Vector(x, y, floor))
+ shell = shell.fuse(boss).cut(hole)
+# A cable opening in the near wall, intentionally open to the cavity.
+shell = shell.cut(Part.makeBox(12, wall+0.2, 7, App.Vector(-6, -width/2-0.1, floor+3)))
+shell = shell.removeSplitter()
+
+lid = rounded_box(length, width, lid_thickness, corner_radius)
+lip_outer = rounded_box(length-2*(wall+clearance), width-2*(wall+clearance), lip_height,
+ corner_radius-wall-clearance)
+lip_inner = rounded_box(length-2*(2*wall+clearance), width-2*(2*wall+clearance), lip_height+0.2,
+ max(0.5, corner_radius-2*wall-clearance))
+lip_inner.translate(App.Vector(0, 0, -0.1))
+lip = lip_outer.cut(lip_inner)
+lip.translate(App.Vector(0, 0, lid_thickness-0.01))
+lid = lid.fuse(lip)
+for x, y in positions:
+ lid = lid.cut(Part.makeCylinder(screw_diameter/2, lid_thickness+lip_height+2, App.Vector(x, y, -1)))
+for i in range(int(vent_count)):
+ x = (i-(vent_count-1)/2)*5.5
+ lid = lid.cut(Part.makeBox(vent_width, vent_length, lid_thickness+2,
+ App.Vector(x-vent_width/2, -vent_length/2, -1)))
+lid = lid.removeSplitter()
+lid.translate(App.Vector(length+14, 0, 0)) # laid out beside the base for inspection
+
+features = []
+for name, shape in [("Base", shell), ("Lid", lid)]:
+ if not shape.isValid() or not shape.isClosed() or len(shape.Solids) != 1:
+ raise RuntimeError(name + " is not one closed, valid solid")
+ shape.check(True) # raises on BRep errors; it does not return a boolean
+ feature = doc.addObject("Part::Feature", name)
+ feature.Label = name
+ feature.Shape = shape
+ features.append(feature)
+parameters = doc.addObject("App::FeaturePython", "DesignInputs")
+for name, value in [("Length",length),("Width",width),("Height",height),("Wall",wall),("Clearance",clearance)]:
+ parameters.addProperty("App::PropertyLength", name, "Dimensions", "Source parameter; edit the macro and rebuild")
+ setattr(parameters, name, value)
+doc.recompute()
+doc.saveAs(os.path.join(outdir, "part.FCStd"))
+Part.export(features, os.path.join(outdir, "part.step"))
+mesh = MeshPart.meshFromShape(Shape=Part.makeCompound([shell,lid]),
+ LinearDeflection=0.1, AngularDeflection=0.15, Relative=False)
+mesh.write(os.path.join(outdir, "part.stl"))
+App.closeDocument(doc.Name)
+print("Exported Pocket: base + vented lid")
diff --git a/store/agents/freecad/test/build.test.mjs b/store/agents/freecad/test/build.test.mjs
new file mode 100644
index 000000000..342abb326
--- /dev/null
+++ b/store/agents/freecad/test/build.test.mjs
@@ -0,0 +1,23 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { build } from '../skills/freecad/scripts/build.mjs';
+test('a successful CLI exit with no fresh STEP receipt cannot reuse an old artifact',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'freecad-build-test-'));
+ try{
+ await writeFile(join(workspace,'part.FCMacro'),'# macro');
+ const bin=join(workspace,'fake-freecad');
+ await writeFile(bin,'#!/bin/sh\nprintf \'ISO-10303-21;\\nEND-ISO-10303-21;\\n\' > "$HARNESS_BUILD_DIR/part.step"\nprintf \'{"valid":true,"closed":true,"solids":1,"volumeMM3":1}\' > "$HARNESS_BUILD_DIR/geometry.json"\n',{mode:0o755});
+ const report=await build(workspace,{bin});assert.equal(report.solids,1);
+ const saved=await readFile(join(workspace,'part.step'),'utf8');
+ for(const command of ['exit 1','exit 0']){
+ await writeFile(bin,'#!/bin/sh\n'+command+'\n',{mode:0o755});
+ await assert.rejects(()=>build(workspace,{bin}));
+ const verdict=JSON.parse(await readFile(join(workspace,'.harness/verdict.json')));
+ assert.equal(verdict.ready,false);assert.equal(verdict.artifact,null);
+ assert.equal(await readFile(join(workspace,'part.step'),'utf8'),saved);
+ }
+ }finally{await rm(workspace,{recursive:true,force:true});}
+});
diff --git a/store/agents/freecad/test/toolchain.test.mjs b/store/agents/freecad/test/toolchain.test.mjs
new file mode 100644
index 000000000..a717934af
--- /dev/null
+++ b/store/agents/freecad/test/toolchain.test.mjs
@@ -0,0 +1,97 @@
+// The FreeCAD harness's scripts, run the way Harness runs them: by path, in the directory Harness
+// gives them, with the environment Harness sets. Uses a FAKE freecadcmd so no real app is needed.
+//
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync, chmodSync, mkdirSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join, dirname } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const dir of scratch) rmSync(dir, { recursive: true, force: true }) })
+
+function tempDir() {
+ const dir = mkdtempSync(join(tmpdir(), 'freecad-'))
+ scratch.push(dir)
+ return dir
+}
+
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [key, value] of Object.entries(env)) if (value === null) delete merged[key]; else merged[key] = value
+ const result = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: result.status, stdout: result.stdout, stderr: result.stderr }
+}
+
+/** A fake `freecadcmd`: writes `part.step` into the output-dir argument (last arg), as the real
+ * FreeCADCmd writes the file named by the plan's Part.export. */
+function fakeFreecadCmd() {
+ const dir = tempDir()
+ const bin = join(dir, 'freecadcmd')
+ writeFileSync(bin, '#!/bin/sh\n[ -n "$HARNESS_BUILD_DIR" ] || exit 0\nprintf \'ISO-10303-21;\\nEND-ISO-10303-21;\\n\' > "$HARNESS_BUILD_DIR/part.step"\nprintf \'{"valid":true,"closed":true,"solids":1,"volumeMM3":1}\' > "$HARNESS_BUILD_DIR/geometry.json"\n')
+ chmodSync(bin, 0o755)
+ return { dir, bin }
+}
+
+test('every script the manifest names is in the folder and executable', () => {
+ for (const script of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/freecad/scripts/build-part.sh']) {
+ assert.doesNotThrow(() => accessSync(join(here, script), constants.X_OK), script)
+ }
+})
+
+test('setup finds a freecadcmd CLI on PATH and says ok', () => {
+ const { dir, bin } = fakeFreecadCmd()
+ const { code, stdout } = run(manifest.toolchain.setup, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok freecad/)
+})
+
+test('doctor says ok when freecadcmd is on PATH', () => {
+ const { dir } = fakeFreecadCmd()
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok freecadcmd/)
+})
+
+test('doctor says miss and fails when freecad is not present', () => {
+ if (existsSync('/Applications/FreeCAD.app')) return // can't force this case on a machine with the cask installed
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: tempDir() } })
+ assert.equal(code, 1)
+ assert.match(stdout, /miss freecadcmd/)
+})
+
+test('init seeds the first verdict and the initialized marker', () => {
+ const workspace = tempDir()
+ const { code } = run(manifest.workspace.init, { cwd: workspace, env: { HARNESS_DSH: manifest.id } })
+ assert.equal(code, 0)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, false)
+ assert.match(readFileSync(join(workspace, '.harness-initialized'), 'utf8'), new RegExp(manifest.id.replace('/', '/')))
+})
+
+test('build-part.sh exports an artifact and flips the verdict, exactly as SKILL.md writes it', () => {
+ const skill = readFileSync(join(here, 'skills/freecad/SKILL.md'), 'utf8')
+ const command = 'sh "$FREECAD_SKILLS/freecad/scripts/build-part.sh"'
+ assert.ok(skill.includes(command), 'SKILL.md should document the one-stop build command')
+ assert.equal(manifest.agent.env.FREECAD_SKILLS, '${dsh}/skills')
+
+ const { dir, bin } = fakeFreecadCmd()
+ const workspace = tempDir()
+ mkdirSync(join(workspace, 'parts'), { recursive: true })
+ writeFileSync(join(workspace, 'part.FCMacro'), 'import FreeCAD as App\nimport Part\n')
+ const result = spawnSync('/bin/sh', ['-c', command], {
+ cwd: workspace,
+ env: { ...process.env, FREECAD_SKILLS: join(here, 'skills'), PATH: `${dir}:${dirname(process.execPath)}:/usr/bin:/bin`, HARNESS_WORKSPACE: workspace },
+ encoding: 'utf8',
+ })
+ assert.equal(result.status, 0, result.stderr)
+ assert.equal(existsSync(join(workspace, 'part.step')), true)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, true)
+ assert.equal(verdict.artifact, 'part.step')
+})
diff --git a/store/agents/freecad/toolchain/doctor.sh b/store/agents/freecad/toolchain/doctor.sh
new file mode 100755
index 000000000..9fa7f41f8
--- /dev/null
+++ b/store/agents/freecad/toolchain/doctor.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Exit 0 when this machine can run the harness. Print one line per check; Harness shows them.
+set -u
+fail=0
+if [ -n "${FREECAD_BIN:-}" ] && [ -x "$FREECAD_BIN" ]; then
+ echo "ok freecadcmd at $FREECAD_BIN"
+elif command -v freecadcmd >/dev/null 2>&1; then
+ echo "ok freecadcmd on PATH ($(command -v freecadcmd))"
+elif command -v FreeCADCmd >/dev/null 2>&1; then
+ echo "ok freecadcmd on PATH ($(command -v FreeCADCmd))"
+elif [ -x "/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd" ]; then
+ echo "ok freecadcmd at /Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd"
+elif [ -x "/Applications/FreeCAD.app/Contents/MacOS/FreeCADCmd" ]; then
+ echo "ok FreeCADCmd at /Applications/FreeCAD.app/Contents/MacOS/FreeCADCmd"
+else
+ echo "miss freecadcmd — run toolchain/setup.sh or install from https://freecad.org"
+ fail=1
+fi
+[ -d "$(dirname "$0")/../skills/freecad" ] && echo "ok freecad skill" || echo "warn freecad skill missing"
+exit $fail
diff --git a/store/agents/freecad/toolchain/init-workspace.sh b/store/agents/freecad/toolchain/init-workspace.sh
new file mode 100755
index 000000000..3badf775e
--- /dev/null
+++ b/store/agents/freecad/toolchain/init-workspace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "FreeCAD workspace ready — describe a part to model",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'FreeCAD workspace initialized by %s\n' "${HARNESS_DSH:-freecad}" > .harness-initialized
diff --git a/store/agents/freecad/toolchain/node.sh b/store/agents/freecad/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/freecad/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/freecad/toolchain/runtimes.sh b/store/agents/freecad/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/freecad/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/freecad/toolchain/setup.sh b/store/agents/freecad/toolchain/setup.sh
new file mode 100755
index 000000000..9685a61ce
--- /dev/null
+++ b/store/agents/freecad/toolchain/setup.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Install/verify FreeCAD for this harness. cwd = the package install dir.
+# FreeCAD is a desktop app with a headless CLI (FreeCADCmd); detect an existing
+# install, otherwise provide an explicit installation instruction.
+set -u
+
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+
+find_freecad() {
+ [ -z "${FREECAD_BIN:-}" ] || { [ -x "$FREECAD_BIN" ] && { echo "$FREECAD_BIN"; return 0; }; }
+ command -v freecadcmd 2>/dev/null && return 0
+ command -v FreeCADCmd 2>/dev/null && return 0
+ [ -x "/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd" ] && { echo "/Applications/FreeCAD.app/Contents/Resources/bin/freecadcmd"; return 0; }
+ [ -x "/Applications/FreeCAD.app/Contents/MacOS/FreeCADCmd" ] && { echo "/Applications/FreeCAD.app/Contents/MacOS/FreeCADCmd"; return 0; }
+ return 1
+}
+
+if bin=$(find_freecad); then
+ echo "ok freecad at $bin"
+ ln -sf "$bin" "$dsh/toolchain/freecad-cli" 2>/dev/null || true
+ exit 0
+fi
+
+echo "miss freecadcmd — install FreeCAD from https://freecad.org or set FREECAD_BIN, then re-run setup."
+exit 1
diff --git a/store/agents/gis/.gitattributes b/store/agents/gis/.gitattributes
new file mode 100644
index 000000000..b8bb5ea65
--- /dev/null
+++ b/store/agents/gis/.gitattributes
@@ -0,0 +1,2 @@
+# Preserve the upstream distribution's CRLF bytes and treat CR as a line ending.
+template/vendor/* -text whitespace=cr-at-eol
diff --git a/store/agents/gis/.gitignore b/store/agents/gis/.gitignore
new file mode 100644
index 000000000..504800545
--- /dev/null
+++ b/store/agents/gis/.gitignore
@@ -0,0 +1,7 @@
+# Generated map data — never source.
+out/
+*.geojson
+!template/*.geojson
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/gis/AGENTS.md b/store/agents/gis/AGENTS.md
new file mode 100644
index 000000000..c8b9d3334
--- /dev/null
+++ b/store/agents/gis/AGENTS.md
@@ -0,0 +1,13 @@
+# GIS / Atlas
+
+Read the `gis` skill. The starter is a completely local map explorer: `index.html`, `atlas.mjs`,
+`geo.mjs`, `atlas.css`, `cities.geojson`, and vendored map assets. The shared viewer serves them.
+Preserve the user's geographic question and data rather than forcing it into the city example.
+
+Support useful exploration: search/filter, feature properties, pan/zoom, distance measurement and
+export. Treat imported properties as text, validate geometry, and make load errors visible.
+Do not silently replace failed data with the sample layer or add third-party requests without need.
+
+Maintain `proof.json`, run the browser proof, inspect desktop/mobile screenshots, and exercise
+a real map interaction before marking the result ready. Distinguish approximate great-circle
+distances and coarse boundaries from road routes, cadastral data or survey-grade measurements.
diff --git a/store/agents/gis/LICENSE b/store/agents/gis/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/gis/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/gis/PROVENANCE.md b/store/agents/gis/PROVENANCE.md
new file mode 100644
index 000000000..6cc3f664f
--- /dev/null
+++ b/store/agents/gis/PROVENANCE.md
@@ -0,0 +1,18 @@
+# GIS provenance
+
+Atlas's explorer, validator, tests and package glue are original OpenHarness work (MIT).
+
+- `template/vendor/leaflet.js` and `leaflet.css`: Leaflet 1.9.4, BSD-2-Clause. Upstream
+ [Leaflet/Leaflet](https://github.com/Leaflet/Leaflet/tree/v1.9.4). Unmodified distribution files;
+ license included as `vendor/LICENSE`. npm tarball SHA-512:
+ `nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==`.
+- `template/countries.geojson`: Natural Earth v5.1.2, `ne_110m_admin_0_countries.geojson` at commit
+ `f1890d9f152c896d250a77557a5751a93d494776` from
+ [natural-earth-vector](https://github.com/nvkelso/natural-earth-vector/tree/f1890d9f152c896d250a77557a5751a93d494776).
+ Geometry is unchanged; unused attributes were removed, retaining the English name.
+ [Natural Earth terms](https://www.naturalearthdata.com/about/terms-of-use/): public domain.
+ Boundaries follow that dataset's conventions and are not a statement about disputed sovereignty.
+- `cities.geojson`: original illustrative starter. Coordinates identify cities; population numbers
+ are demonstration values and must not be treated as demographic evidence.
+
+No network service is contacted by the default map.
diff --git a/store/agents/gis/README.md b/store/agents/gis/README.md
new file mode 100644
index 000000000..a2014ebff
--- /dev/null
+++ b/store/agents/gis/README.md
@@ -0,0 +1,29 @@
+# GIS / Atlas
+
+Bring a dataset into a map you can explore. **Atlas** includes an offline world outline, a searchable
+feature list, geometry filters, property inspection, keyboard selection, pan/zoom, two-point
+distance measurement and GeoJSON export. Imported data stays local.
+
+Try: “Map these locations, help me compare them, and export just the places I select.”
+
+Choose **GIS** in the Harness Store, then select an empty folder in New Harness. Requires the
+shared Web Viewer (Node 20+); no GIS server, map account or CDN. Local development:
+
+```sh
+harness dsh install "$PWD/store/agents/gis" --link
+harness dsh doctor autonomous/gis
+```
+
+The starter supports GeoJSON points, lines, polygons and their Multi variants (WGS 84), with
+2,000-feature/100,000-vertex/5 MB limits. The agent can adapt the map for larger or different data.
+Browser imports persist only when exported.
+
+Natural Earth outlines are coarse and public-domain; distances are spherical estimates, not travel
+routes or survey measurements. The city starter's population values are illustrative.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/gis/harness.json b/store/agents/gis/harness.json
new file mode 100644
index 000000000..e8395c12b
--- /dev/null
+++ b/store/agents/gis/harness.json
@@ -0,0 +1,34 @@
+{
+ "spec": 1,
+ "id": "autonomous/gis",
+ "name": "GIS",
+ "category": "GIS",
+ "author": "OpenHarness contributors",
+ "description": "Explore GeoJSON in an offline-capable map with search, geometry filters, safe feature inspection, distance measurement and export.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "index.html",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "GIS_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [
+ ".html"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/gis/package.json b/store/agents/gis/package.json
new file mode 100644
index 000000000..b6f1133b8
--- /dev/null
+++ b/store/agents/gis/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@autonomous/gis-harness",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test test/*.test.mjs",
+ "perf": "node skills/gis/scripts/perf.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+}
diff --git a/store/agents/gis/skills/gis/SKILL.md b/store/agents/gis/skills/gis/SKILL.md
new file mode 100644
index 000000000..0ad94d82c
--- /dev/null
+++ b/store/agents/gis/skills/gis/SKILL.md
@@ -0,0 +1,40 @@
+---
+name: gis
+description: Build and verify interactive GeoJSON maps in Atlas, with local exploration, safe imports, feature inspection and export.
+---
+
+# Atlas
+
+The starter uses locally vendored Leaflet 1.9.4 and Natural Earth 1:110m country outlines.
+No internet or tile account is required. Keep attribution and `vendor/LICENSE` when reusing them.
+Use relative URLs in the shared sandboxed viewer. For detailed streets or large datasets, choose
+appropriate licensed tiles/data explicitly; do not present the coarse offline layer as detailed mapping.
+
+`cities.geojson` seeds real locations with illustrative population values, not official estimates.
+Imported GeoJSON must be a WGS 84 FeatureCollection, coordinates `[longitude, latitude]`.
+The local validator handles Point, LineString, Polygon and Multi variants, up to 2,000 features,
+100,000 vertices and a 5 MB upload. Closed rings are checked; polygon topology/self-intersections
+are not. Simplify large data or use a more suitable renderer instead of freezing the UI.
+
+The feature list shows at most 100 names while the map renders all filtered features.
+Search, geometry filtering, selection and export use the same source records. Use `textContent`
+for properties and tooltips; never interpolate uploaded strings as HTML.
+
+The distance tool measures a mean-radius spherical great-circle distance between two points;
+its straight map segment is only a visual connector. It is not a road route or survey result.
+Antimeridian data may need split geometries for intuitive display in Web Mercator.
+Imports are temporary browser state; export to persist.
+
+## Prove and inspect
+
+```sh
+node "$GIS_SKILLS/gis/scripts/proof.mjs" "$HARNESS_WORKSPACE/index.html"
+node "$GIS_SKILLS/gis/scripts/perf.mjs" "$HARNESS_WORKSPACE/index.html"
+```
+
+Helpers use the real shared HTTP viewer, current `proof.json` interaction assertions and Playwright
+with Chromium. Install Playwright in the shared viewer or set `PLAYWRIGHT_MODULE` to its `index.mjs`.
+Proof captures `.harness/last.png`, errors and dependency hashes and updates the verdict.
+Inspect pan/zoom, search, selection, two-point measurement, import/export and a narrow viewport.
+Test an empty selection, malformed GeoJSON and untrusted property text. Never call a map verified
+because a Leaflet container merely exists.
diff --git a/store/agents/gis/skills/gis/scripts/perf.mjs b/store/agents/gis/skills/gis/scripts/perf.mjs
new file mode 100644
index 000000000..3b885bd05
--- /dev/null
+++ b/store/agents/gis/skills/gis/scripts/perf.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'perf' });
+}
diff --git a/store/agents/gis/skills/gis/scripts/proof.mjs b/store/agents/gis/skills/gis/scripts/proof.mjs
new file mode 100755
index 000000000..4419012c3
--- /dev/null
+++ b/store/agents/gis/skills/gis/scripts/proof.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'proof' });
+}
diff --git a/store/agents/gis/store.json b/store/agents/gis/store.json
new file mode 100644
index 000000000..8e02ad1e3
--- /dev/null
+++ b/store/agents/gis/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://leafletjs.com",
+ "upstream": "https://github.com/Leaflet/Leaflet",
+ "license": "MIT",
+ "tagline": "An open-source JavaScript library for interactive maps",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/gis/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Open the offline atlas, inspect the sample cities, and measure a great-circle distance.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/gis/starter.jpg",
+ "caption": "Atlas · offline map, GeoJSON inspection and measurement"
+ }
+ ]
+}
diff --git a/store/agents/gis/template/atlas.css b/store/agents/gis/template/atlas.css
new file mode 100644
index 000000000..66a6f7fe2
--- /dev/null
+++ b/store/agents/gis/template/atlas.css
@@ -0,0 +1 @@
+:root{color-scheme:light;--ink:#223a35;--muted:#737f76;--paper:#f6f6ee;--line:#dce1d5;--accent:#da582d;font:14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink)}button,input,select,.button{font:inherit;color:inherit}button,.button{cursor:pointer;border:1px solid #c6d0c0;border-radius:7px;padding:9px 13px;background:transparent;text-decoration:none;white-space:nowrap}button:hover,.button:hover{background:#e6ebdd}:focus-visible{outline:3px solid #db6b3a;outline-offset:3px}.top{height:76px;padding:0 28px;display:flex;gap:12px;align-items:center;border-bottom:1px solid var(--line)}.brand{font-size:25px;font-weight:700;letter-spacing:-1px;color:inherit;text-decoration:none;display:flex;align-items:center;gap:9px}.mark{font-size:32px;color:#52784b}.edition,.eyebrow{font:10px/1.6 ui-monospace,monospace;letter-spacing:1.6px}.edition{margin:3px 0 0 14px;color:#637561;letter-spacing:1.3px}.local{margin-left:auto;margin-right:12px;color:#52704f;font-size:11px}#export{background:var(--ink);color:white;border-color:var(--ink)}#error{padding:14px 28px;color:#8b351d;background:#ffe8d8;border-bottom:1px solid #dfac93}.workspace{display:grid;grid-template-columns:336px minmax(0,1fr);min-height:760px;height:calc(100dvh - 154px)}.sidebar{padding:30px 25px 20px;overflow:auto;border-right:1px solid var(--line)}h1{font:48px/.99 Georgia,'Times New Roman',serif;letter-spacing:-1.7px;margin:20px 0}h1 em{color:#618253;font-weight:normal}.intro{font-size:13px;line-height:1.65;color:#657266;margin:18px 0 25px}.metrics{display:grid;grid-template-columns:1fr 1fr;padding:19px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:25px}.metrics strong{display:block;font:33px/1.1 Georgia,serif}.metrics span{display:block;font-size:11px;color:var(--muted);margin-top:5px}h2{font-size:13px;font-weight:650;margin:0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-head span{max-width:128px;font:10px ui-monospace,monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.search{margin:14px 0 10px;display:flex;gap:8px;align-items:center;padding:8px 11px;background:#fff;border:1px solid var(--line);border-radius:7px;font-size:20px}.search input{width:100%;min-width:0;font-size:12px;border:0;outline-offset:8px;background:transparent}.select-row{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}select{border:1px solid var(--line);background:#fff;padding:6px 8px;border-radius:5px;max-width:150px}.list-head{display:flex;justify-content:space-between;margin-top:19px;padding-bottom:5px;color:var(--muted);font:9px ui-monospace,monospace;letter-spacing:1.1px}.features{max-height:236px;overflow:auto;margin-bottom:14px}.feature{display:flex;width:100%;justify-content:space-between;gap:12px;align-items:center;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:11px 2px;font-size:12px;white-space:normal}.feature span:first-child{overflow-wrap:anywhere}.feature span:last-child{font:9px ui-monospace,monospace;color:var(--muted)}.feature[aria-pressed=true]{color:var(--accent);font-weight:700}.wide{width:100%;font-size:12px}.details{border-top:1px solid var(--line);margin-top:22px;padding-top:17px;font-size:12px}.details h2{overflow-wrap:anywhere}.details p{color:var(--muted)}.details dl{margin:12px 0;display:grid;grid-template-columns:minmax(65px,1fr) minmax(0,1.6fr);gap:7px 12px;font-size:11px}.details dt{color:var(--muted);overflow-wrap:anywhere}.details dd{margin:0;overflow-wrap:anywhere}.source-note{font-size:10px;color:var(--muted);margin-top:25px}.map-panel{position:relative;min-width:0;overflow:hidden;background:#c9dcde}#map{position:absolute;inset:0;background:#cedee0;outline-offset:-4px}.map-title{position:absolute;z-index:500;top:28px;left:30px;pointer-events:none;display:flex;flex-direction:column;gap:6px;max-width:70%;text-shadow:0 1px #dfebea}.map-title strong{font:26px Georgia,serif;overflow-wrap:anywhere}.map-title span:last-child{font:10px ui-monospace,monospace;color:#486367}.map-tools{position:absolute;z-index:500;left:30px;bottom:83px;display:flex;gap:8px}.map-tools button{background:#f9fbf4ee;box-shadow:0 2px 12px #28423412;font-size:12px}.map-tools button[aria-pressed=true]{color:#fff;background:#c04d29;border-color:#c04d29}.map-bottom{position:absolute;z-index:500;bottom:29px;left:30px;right:30px;background:#f8faf1f0;border:1px solid #f8fbef;box-shadow:0 6px 32px #1f394320;border-radius:9px;padding:15px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;pointer-events:none}.map-legend{display:flex;gap:20px;font-size:11px}.map-legend i{display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#3f7361}.map-legend .selected{background:var(--accent)}.offline{font:9px ui-monospace,monospace;letter-spacing:1px;color:#6d7e72}.coordinates{position:absolute;right:15px;top:13px;z-index:500;font:9px ui-monospace,monospace;color:#577372;pointer-events:none}.measurement{position:absolute;left:30px;bottom:136px;z-index:500;max-width:calc(100% - 60px);padding:12px 18px;border-radius:7px;background:#223a35;color:#f1f6e8;font-size:13px;box-shadow:0 4px 18px #172c3929}.leaflet-control-zoom{border:1px solid #bccdbe!important;box-shadow:0 2px 12px #28423412!important;margin:72px 24px 0 0!important}.leaflet-control-zoom a{background:#f7f9f0!important;color:var(--ink)!important;font:18px/30px system-ui!important}.leaflet-control-attribution{font-size:8px!important;background:#eaf2eccc!important;color:#61746b!important}.leaflet-control-attribution a{color:#45634d!important}.leaflet-tooltip{border:1px solid #e7ecdc;box-shadow:0 3px 18px #183d3520;background:#f9fbee;color:#2e4539;font:11px/1.5 system-ui;border-radius:5px;padding:5px 9px}.city-label{border:none;box-shadow:none;background:transparent;font-size:11px;font-weight:600;letter-spacing:.1px;pointer-events:none;text-shadow:0 1px #e7ede5,1px 0 #e7ede5,-1px 0 #e7ede5,0 -1px #e7ede5}.city-label:before{display:none}.leaflet-interactive:focus{outline:none;filter:drop-shadow(0 0 4px #e18737)}footer{height:34px;display:flex;justify-content:space-between;align-items:center;padding:0 28px;color:#7c8879;font-size:10px}#empty{color:var(--muted);font-size:12px;padding:15px 0}[hidden]{display:none!important}@media(max-width:850px){.workspace{grid-template-columns:282px minmax(0,1fr)}.sidebar{padding:25px 19px}.edition,.local{display:none}.top{padding:0 18px;gap:8px}.brand{margin-right:auto}.map-title{left:20px}.offline{display:none}}@media(max-width:600px){.top{height:64px;padding:0 12px;gap:6px}.brand{font-size:23px}.mark{font-size:26px}.top button,.top .button{font-size:10px;padding:8px}.workspace{height:auto;min-height:0;display:flex;flex-direction:column}.map-panel{height:560px;order:0}.sidebar{order:1;padding:28px 22px;border-right:0}.sidebar h1{font-size:42px}.map-title{left:18px;top:27px;max-width:75%}.map-title strong{font-size:23px}.map-tools{left:18px}.map-bottom{left:18px;right:18px;padding:13px}.measurement{left:18px;max-width:calc(100% - 36px)}.coordinates{font-size:8px;top:8px}.features{max-height:260px}footer{height:auto;gap:12px;padding:15px 20px;align-items:flex-start}footer span:last-child{text-align:right;max-width:50%}}
diff --git a/store/agents/gis/template/atlas.mjs b/store/agents/gis/template/atlas.mjs
new file mode 100644
index 000000000..b8f89ad99
--- /dev/null
+++ b/store/agents/gis/template/atlas.mjs
@@ -0,0 +1,82 @@
+import { validateGeoJSON, filterFeatures, featureName, distanceKm } from './geo.mjs';
+const $ = id => document.getElementById(id), L = window.L;
+const map = L.map('map', { zoomControl:false, minZoom:2, maxZoom:14, zoomAnimation:!matchMedia('(prefers-reduced-motion: reduce)').matches, worldCopyJump:false }).setView([16,106],5);
+L.control.zoom({position:'topright'}).addTo(map);
+L.control.scale({imperial:false,position:'bottomleft'}).addTo(map);
+map.attributionControl.setPrefix('<a href="https://leafletjs.com" target="_blank" rel="noreferrer">Leaflet</a>');
+map.attributionControl.addAttribution('Natural Earth · public domain');
+let data={type:'FeatureCollection',features:[]}, selected=null, layers=new Map(), rows=[], measuring=false, measurePoints=[];
+const featureLayer=L.featureGroup().addTo(map), measureLayer=L.featureGroup().addTo(map);
+const status = (message='') => { $('error').textContent=message; $('error').hidden=!message; };
+const text = (tag,content,className) => { const el=document.createElement(tag);el.textContent=String(content);if(className)el.className=className;return el; };
+const color = index => index===selected?'#da582d':'#427560';
+function select(index,fly=false) {
+ selected=index;
+ for(const [key,layer] of layers)layer.setStyle?.({color:color(key),fillColor:color(key),weight:key===selected?3:2,fillOpacity:key===selected?.9:.72});
+ document.querySelectorAll('.feature').forEach(button=>button.setAttribute('aria-pressed',String(Number(button.dataset.index)===index)));
+ const feature=data.features[index];if(!feature)return;
+ const detail=$('details');detail.replaceChildren(text('h2',featureName(feature,index)));
+ const dl=document.createElement('dl');
+ for(const [key,value] of Object.entries(feature.properties||{}).slice(0,40)){dl.append(text('dt',key),text('dd',typeof value==='object'?JSON.stringify(value):value));}
+ dl.append(text('dt','geometry'),text('dd',feature.geometry.type));
+ if(feature.geometry.type==='Point')dl.append(text('dt','lon / lat'),text('dd',feature.geometry.coordinates.slice(0,2).map(n=>n.toFixed(5)).join(' / ')));
+ detail.append(dl);
+ const layer=layers.get(index);
+ if(fly&&layer){const bounds=layer.getBounds?.();if(bounds?.isValid())map.fitBounds(bounds,{padding:[75,110],maxZoom:7,animate:false});else if(layer.getLatLng)map.panTo(layer.getLatLng(),{animate:false});}
+}
+function fit(){if(featureLayer.getLayers().length)map.fitBounds(featureLayer.getBounds(),{padding:[85,135],maxZoom:7,animate:false});}
+function render(){
+ featureLayer.clearLayers();layers.clear();
+ rows=filterFeatures(data.features,$('search').value,$('type').value);
+ $('count').textContent=rows.length.toLocaleString();$('geometry-count').textContent=new Set(rows.map(row=>row.feature.geometry.type)).size;
+ $('empty').hidden=rows.length>0;$('export').disabled=!rows.length;$('fit').disabled=!rows.length;
+ if(!rows.some(row=>row.index===selected)){selected=null;$('details').replaceChildren(text('h2','Select a feature'),text('p','Choose a name or a shape on the map to inspect its properties.'));}
+ const list=$('features');list.replaceChildren();
+ rows.forEach(({feature,index,name})=>{
+ const layer=L.geoJSON(feature,{
+ style:()=>({color:color(index),fillColor:color(index),weight:2,fillOpacity:.35}),
+ pointToLayer:(_f,latlng)=>L.circleMarker(latlng,{radius:feature.properties?.type==='hub'?8:6,color:color(index),fillColor:color(index),weight:2,fillOpacity:.8}),
+ onEachFeature:(_f,shape)=>{
+ shape.bindTooltip(text('span',name),{permanent:feature.geometry.type==='Point'&&rows.length<=25,direction:'right',offset:[12,0],className:feature.geometry.type==='Point'&&rows.length<=25?'city-label':''});
+ shape.on('click',event=>{if(event.originalEvent)L.DomEvent.stopPropagation(event.originalEvent);if(measuring)addMeasure(event.latlng);else select(index);});
+ shape.on('add',()=>{const path=shape.getElement?.();if(path){path.setAttribute('tabindex','0');path.setAttribute('role','button');path.setAttribute('aria-label',name);path.addEventListener('keydown',event=>{if(event.key==='Enter'||event.key===' '){event.preventDefault();select(index);}});}});
+ }
+ }).addTo(featureLayer);
+ layers.set(index,layer);
+ if(list.children.length<100){const button=text('button','', 'feature');button.dataset.index=index;button.setAttribute('aria-pressed',String(selected===index));button.append(text('span',name),text('span',feature.geometry.type));button.onclick=()=>select(index,true);list.append(button);}
+ });
+ if(rows.length>100)list.append(text('p','Showing the first 100 names. All '+rows.length+' features are on the map.'));
+ if(selected!==null)select(selected);
+}
+function load(value,name){
+ validateGeoJSON(value);data=value;selected=null;
+ $('source').textContent=name;$('source').title=name;$('map-name').textContent=name==='cities.geojson'?'Vietnam / City atlas':name.replace(/\.(geo)?json$/i,'');
+ $('search').value='';$('type').replaceChildren(new Option('All types','all'));
+ [...new Set(data.features.map(feature=>feature.geometry.type))].sort().forEach(type=>$('type').add(new Option(type,type)));
+ status();resetMeasurement();render();fit();
+}
+function resetMeasurement(){measurePoints=[];measureLayer.clearLayers();$('measurement').hidden=!measuring;$('measurement').textContent='Tap two locations to measure a great-circle distance.';$('clear-measure').hidden=!measuring;}
+function addMeasure(point){
+ if(measurePoints.length===2)resetMeasurement();
+ measurePoints.push(point);L.circleMarker(point,{radius:5,color:'#9b3e20',fillColor:'#fff4dd',fillOpacity:1,weight:2,interactive:false}).addTo(measureLayer);
+ if(measurePoints.length===1){$('measurement').textContent='Now choose the second location.';return;}
+ L.polyline(measurePoints,{color:'#c3542b',weight:2,dashArray:'6 6',interactive:false}).addTo(measureLayer);
+ const km=distanceKm([measurePoints[0].lng,measurePoints[0].lat],[measurePoints[1].lng,measurePoints[1].lat]);
+ $('measurement').textContent=km.toLocaleString(undefined,{maximumFractionDigits:1})+' km · great-circle estimate, not a travel route';
+}
+$('measure').onclick=()=>{measuring=!measuring;$('measure').setAttribute('aria-pressed',String(measuring));$('map').style.cursor=measuring?'crosshair':'';resetMeasurement();};
+$('clear-measure').onclick=resetMeasurement;
+map.on('click',event=>{if(measuring)addMeasure(event.latlng);});
+map.on('mousemove',event=>$('coordinates').textContent=event.latlng.lng.toFixed(4)+'° / '+event.latlng.lat.toFixed(4)+'° · WGS 84');
+map.on('moveend',()=>{const c=map.getCenter();$('bounds-label').textContent=c.lat.toFixed(2)+'° latitude / '+c.lng.toFixed(2)+'° longitude · zoom '+map.getZoom();});
+$('search').oninput=render;$('type').onchange=render;$('fit').onclick=fit;
+$('upload').onchange=async event=>{const file=event.target.files[0];if(!file)return;try{if(file.size>5*1024*1024)throw new Error('Choose a GeoJSON file smaller than 5 MB.');load(JSON.parse(await file.text()),file.name);}catch(error){status('Import failed: '+error.message+' The previous layer is unchanged.');}event.target.value='';};
+$('export').onclick=()=>{const value={type:'FeatureCollection',features:rows.map(row=>row.feature)};const url=URL.createObjectURL(new Blob([JSON.stringify(value,null,2)+'\n'],{type:'application/geo+json'}));const link=document.createElement('a');link.href=url;link.download='atlas-selection.geojson';link.click();setTimeout(()=>URL.revokeObjectURL(url),30000);};
+new ResizeObserver(()=>map.invalidateSize({pan:false})).observe($('map'));
+async function fetchJSON(path){const response=await fetch(path);if(!response.ok)throw new Error(path+' returned HTTP '+response.status);return response.json();}
+const results=await Promise.allSettled([
+ fetchJSON('countries.geojson').then(geo=>L.geoJSON(geo,{interactive:false,style:{color:'#a4b9aa',weight:.7,fillColor:'#e5ead8',fillOpacity:1}}).addTo(map).bringToBack()),
+ fetchJSON('cities.geojson').then(geo=>load(geo,'cities.geojson'))
+]);
+const failures=results.flatMap((result,index)=>result.status==='rejected'?[(index?'Could not load cities.geojson: ':'Offline outlines unavailable: ')+result.reason.message]:[]);
+if(failures.length){status(failures.join(' · '));render();}
diff --git a/store/agents/gis/template/cities.geojson b/store/agents/gis/template/cities.geojson
new file mode 100644
index 000000000..8d006c1c3
--- /dev/null
+++ b/store/agents/gis/template/cities.geojson
@@ -0,0 +1,9 @@
+{
+ "type": "FeatureCollection",
+ "features": [
+ { "type": "Feature", "properties": { "name": "Ho Chi Minh City", "pop": 9.3, "type": "hub" }, "geometry": { "type": "Point", "coordinates": [106.6297, 10.8231] } },
+ { "type": "Feature", "properties": { "name": "Hanoi", "pop": 8.4, "type": "hub" }, "geometry": { "type": "Point", "coordinates": [105.8342, 21.0278] } },
+ { "type": "Feature", "properties": { "name": "Da Nang", "pop": 1.2, "type": "site" }, "geometry": { "type": "Point", "coordinates": [108.2022, 16.0544] } },
+ { "type": "Feature", "properties": { "name": "Nha Trang", "pop": 0.4, "type": "site" }, "geometry": { "type": "Point", "coordinates": [109.1967, 12.2388] } }
+ ]
+}
diff --git a/store/agents/gis/template/countries.geojson b/store/agents/gis/template/countries.geojson
new file mode 100644
index 000000000..54f81b9b0
--- /dev/null
+++ b/store/agents/gis/template/countries.geojson
@@ -0,0 +1 @@
+{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"Fiji"},"geometry":{"type":"MultiPolygon","coordinates":[[[[180,-16.067133],[180,-16.555217],[179.364143,-16.801354],[178.725059,-17.012042],[178.596839,-16.63915],[179.096609,-16.433984],[179.413509,-16.379054],[180,-16.067133]]],[[[178.12557,-17.50481],[178.3736,-17.33992],[178.71806,-17.62846],[178.55271,-18.15059],[177.93266,-18.28799],[177.38146,-18.16432],[177.28504,-17.72465],[177.67087,-17.38114],[178.12557,-17.50481]]],[[[-179.79332,-16.020882],[-179.917369,-16.501783],[-180,-16.555217],[-180,-16.067133],[-179.79332,-16.020882]]]]}},{"type":"Feature","properties":{"name":"Tanzania"},"geometry":{"type":"Polygon","coordinates":[[[33.903711,-0.95],[34.07262,-1.05982],[37.69869,-3.09699],[37.7669,-3.67712],[39.20222,-4.67677],[38.74054,-5.90895],[38.79977,-6.47566],[39.44,-6.84],[39.47,-7.1],[39.19469,-7.7039],[39.25203,-8.00781],[39.18652,-8.48551],[39.53574,-9.11237],[39.9496,-10.0984],[40.316586,-10.317098],[40.31659,-10.3171],[39.521,-10.89688],[38.427557,-11.285202],[37.82764,-11.26879],[37.47129,-11.56876],[36.775151,-11.594537],[36.514082,-11.720938],[35.312398,-11.439146],[34.559989,-11.52002],[34.28,-10.16],[33.940838,-9.693674],[33.73972,-9.41715],[32.759375,-9.230599],[32.191865,-8.930359],[31.556348,-8.762049],[31.157751,-8.594579],[30.74001,-8.340006],[30.740015,-8.340007],[30.199997,-7.079981],[29.620032,-6.520015],[29.419993,-5.939999],[29.519987,-5.419979],[29.339998,-4.499983],[29.753512,-4.452389],[30.11632,-4.09012],[30.50554,-3.56858],[30.75224,-3.35931],[30.74301,-3.03431],[30.52766,-2.80762],[30.469674,-2.413855],[30.46967,-2.41383],[30.758309,-2.28725],[30.816135,-1.698914],[30.419105,-1.134659],[30.76986,-1.01455],[31.86617,-1.02736],[33.903711,-0.95]]]}},{"type":"Feature","properties":{"name":"Western Sahara"},"geometry":{"type":"Polygon","coordinates":[[[-8.66559,27.656426],[-8.665124,27.589479],[-8.6844,27.395744],[-8.687294,25.881056],[-11.969419,25.933353],[-11.937224,23.374594],[-12.874222,23.284832],[-13.118754,22.77122],[-12.929102,21.327071],[-16.845194,21.333323],[-17.063423,20.999752],[-17.020428,21.42231],[-17.002962,21.420734],[-14.750955,21.5006],[-14.630833,21.86094],[-14.221168,22.310163],[-13.89111,23.691009],[-12.500963,24.770116],[-12.030759,26.030866],[-11.71822,26.104092],[-11.392555,26.883424],[-10.551263,26.990808],[-10.189424,26.860945],[-9.735343,26.860945],[-9.413037,27.088476],[-8.794884,27.120696],[-8.817828,27.656426],[-8.66559,27.656426]]]}},{"type":"Feature","properties":{"name":"Canada"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-122.84,49],[-122.97421,49.002538],[-124.91024,49.98456],[-125.62461,50.41656],[-127.43561,50.83061],[-127.99276,51.71583],[-127.85032,52.32961],[-129.12979,52.75538],[-129.30523,53.56159],[-130.51497,54.28757],[-130.536109,54.802754],[-130.53611,54.80278],[-129.98,55.285],[-130.00778,55.91583],[-131.70781,56.55212],[-132.73042,57.69289],[-133.35556,58.41028],[-134.27111,58.86111],[-134.945,59.27056],[-135.47583,59.78778],[-136.47972,59.46389],[-137.4525,58.905],[-138.34089,59.56211],[-139.039,60],[-140.013,60.27682],[-140.99778,60.30639],[-140.9925,66.00003],[-140.986,69.712],[-140.985988,69.711998],[-139.12052,69.47102],[-137.54636,68.99002],[-136.50358,68.89804],[-135.62576,69.31512],[-134.41464,69.62743],[-132.92925,69.50534],[-131.43136,69.94451],[-129.79471,70.19369],[-129.10773,69.77927],[-128.36156,70.01286],[-128.13817,70.48384],[-127.44712,70.37721],[-125.75632,69.48058],[-124.42483,70.1584],[-124.28968,69.39969],[-123.06108,69.56372],[-122.6835,69.85553],[-121.47226,69.79778],[-119.94288,69.37786],[-117.60268,69.01128],[-116.22643,68.84151],[-115.2469,68.90591],[-113.89794,68.3989],[-115.30489,67.90261],[-113.49727,67.68815],[-110.798,67.80612],[-109.94619,67.98104],[-108.8802,67.38144],[-107.79239,67.88736],[-108.81299,68.31164],[-108.16721,68.65392],[-106.95,68.7],[-106.15,68.8],[-105.34282,68.56122],[-104.33791,68.018],[-103.22115,68.09775],[-101.45433,67.64689],[-99.90195,67.80566],[-98.4432,67.78165],[-98.5586,68.40394],[-97.66948,68.57864],[-96.11991,68.23939],[-96.12588,67.29338],[-95.48943,68.0907],[-94.685,68.06383],[-94.23282,69.06903],[-95.30408,69.68571],[-96.47131,70.08976],[-96.39115,71.19482],[-95.2088,71.92053],[-93.88997,71.76015],[-92.87818,71.31869],[-91.51964,70.19129],[-92.40692,69.69997],[-90.5471,69.49766],[-90.55151,68.47499],[-89.21515,69.25873],[-88.01966,68.61508],[-88.31749,67.87338],[-87.35017,67.19872],[-86.30607,67.92146],[-85.57664,68.78456],[-85.52197,69.88211],[-84.10081,69.80539],[-82.62258,69.65826],[-81.28043,69.16202],[-81.2202,68.66567],[-81.96436,68.13253],[-81.25928,67.59716],[-81.38653,67.11078],[-83.34456,66.41154],[-84.73542,66.2573],[-85.76943,66.55833],[-86.0676,66.05625],[-87.03143,65.21297],[-87.32324,64.77563],[-88.48296,64.09897],[-89.91444,64.03273],[-90.70398,63.61017],[-90.77004,62.96021],[-91.93342,62.83508],[-93.15698,62.02469],[-94.24153,60.89865],[-94.62931,60.11021],[-94.6846,58.94882],[-93.21502,58.78212],[-92.76462,57.84571],[-92.29703,57.08709],[-90.89769,57.28468],[-89.03953,56.85172],[-88.03978,56.47162],[-87.32421,55.99914],[-86.07121,55.72383],[-85.01181,55.3026],[-83.36055,55.24489],[-82.27285,55.14832],[-82.4362,54.28227],[-82.12502,53.27703],[-81.40075,52.15788],[-79.91289,51.20842],[-79.14301,51.53393],[-78.60191,52.56208],[-79.12421,54.14145],[-79.82958,54.66772],[-78.22874,55.13645],[-77.0956,55.83741],[-76.54137,56.53423],[-76.62319,57.20263],[-77.30226,58.05209],[-78.51688,58.80458],[-77.33676,59.85261],[-77.77272,60.75788],[-78.10687,62.31964],[-77.41067,62.55053],[-75.69621,62.2784],[-74.6682,62.18111],[-73.83988,62.4438],[-72.90853,62.10507],[-71.67708,61.52535],[-71.37369,61.13717],[-69.59042,61.06141],[-69.62033,60.22125],[-69.2879,58.95736],[-68.37455,58.80106],[-67.64976,58.21206],[-66.20178,58.76731],[-65.24517,59.87071],[-64.58352,60.33558],[-63.80475,59.4426],[-62.50236,58.16708],[-61.39655,56.96745],[-61.79866,56.33945],[-60.46853,55.77548],[-59.56962,55.20407],[-57.97508,54.94549],[-57.3332,54.6265],[-56.93689,53.78032],[-56.15811,53.64749],[-55.75632,53.27036],[-55.68338,52.14664],[-56.40916,51.7707],[-57.12691,51.41972],[-58.77482,51.0643],[-60.03309,50.24277],[-61.72366,50.08046],[-63.86251,50.29099],[-65.36331,50.2982],[-66.39905,50.22897],[-67.23631,49.51156],[-68.51114,49.06836],[-69.95362,47.74488],[-71.10458,46.82171],[-70.25522,46.98606],[-68.65,48.3],[-66.55243,49.1331],[-65.05626,49.23278],[-64.17099,48.74248],[-65.11545,48.07085],[-64.79854,46.99297],[-64.47219,46.23849],[-63.17329,45.73902],[-61.52072,45.88377],[-60.51815,47.00793],[-60.4486,46.28264],[-59.80287,45.9204],[-61.03988,45.26525],[-63.25471,44.67014],[-64.24656,44.26553],[-65.36406,43.54523],[-66.1234,43.61867],[-66.16173,44.46512],[-64.42549,45.29204],[-66.02605,45.25931],[-67.13741,45.13753],[-67.79134,45.70281],[-67.79046,47.06636],[-68.23444,47.35486],[-68.905,47.185],[-69.237216,47.447781],[-69.99997,46.69307],[-70.305,45.915],[-70.66,45.46],[-71.08482,45.30524],[-71.405,45.255],[-71.50506,45.0082],[-73.34783,45.00738],[-74.867,45.00048],[-75.31821,44.81645],[-76.375,44.09631],[-76.5,44.018459],[-76.820034,43.628784],[-77.737885,43.629056],[-78.72028,43.625089],[-79.171674,43.466339],[-79.01,43.27],[-78.92,42.965],[-78.939362,42.863611],[-80.247448,42.3662],[-81.277747,42.209026],[-82.439278,41.675105],[-82.690089,41.675105],[-83.02981,41.832796],[-83.142,41.975681],[-83.12,42.08],[-82.9,42.43],[-82.43,42.98],[-82.137642,43.571088],[-82.337763,44.44],[-82.550925,45.347517],[-83.592851,45.816894],[-83.469551,45.994686],[-83.616131,46.116927],[-83.890765,46.116927],[-84.091851,46.275419],[-84.14212,46.512226],[-84.3367,46.40877],[-84.6049,46.4396],[-84.543749,46.538684],[-84.779238,46.637102],[-84.87608,46.900083],[-85.652363,47.220219],[-86.461991,47.553338],[-87.439793,47.94],[-88.378114,48.302918],[-89.272917,48.019808],[-89.6,48.01],[-90.83,48.27],[-91.64,48.14],[-92.61,48.45],[-93.63087,48.60926],[-94.32914,48.67074],[-94.64,48.84],[-94.81758,49.38905],[-95.15609,49.38425],[-95.15907,49],[-97.22872,49.0007],[-100.65,49],[-104.04826,48.99986],[-107.05,49],[-110.05,49],[-113,49],[-116.04818,49],[-117.03121,49],[-120,49],[-122.84,49]]],[[[-83.99367,62.4528],[-83.25048,62.91409],[-81.87699,62.90458],[-81.89825,62.7108],[-83.06857,62.15922],[-83.77462,62.18231],[-83.99367,62.4528]]],[[[-79.775833,72.802902],[-80.876099,73.333183],[-80.833885,73.693184],[-80.353058,73.75972],[-78.064438,73.651932],[-76.34,73.102685],[-76.251404,72.826385],[-77.314438,72.855545],[-78.39167,72.876656],[-79.486252,72.742203],[-79.775833,72.802902]]],[[[-80.315395,62.085565],[-79.92939,62.3856],[-79.52002,62.36371],[-79.26582,62.158675],[-79.65752,61.63308],[-80.09956,61.7181],[-80.36215,62.01649],[-80.315395,62.085565]]],[[[-93.612756,74.979997],[-94.156909,74.592347],[-95.608681,74.666864],[-96.820932,74.927623],[-96.288587,75.377828],[-94.85082,75.647218],[-93.977747,75.29649],[-93.612756,74.979997]]],[[[-93.840003,77.519997],[-94.295608,77.491343],[-96.169654,77.555111],[-96.436304,77.834629],[-94.422577,77.820005],[-93.720656,77.634331],[-93.840003,77.519997]]],[[[-96.754399,78.765813],[-95.559278,78.418315],[-95.830295,78.056941],[-97.309843,77.850597],[-98.124289,78.082857],[-98.552868,78.458105],[-98.631984,78.87193],[-97.337231,78.831984],[-96.754399,78.765813]]],[[[-88.15035,74.392307],[-89.764722,74.515555],[-92.422441,74.837758],[-92.768285,75.38682],[-92.889906,75.882655],[-93.893824,76.319244],[-95.962457,76.441381],[-97.121379,76.751078],[-96.745123,77.161389],[-94.684086,77.097878],[-93.573921,76.776296],[-91.605023,76.778518],[-90.741846,76.449597],[-90.969661,76.074013],[-89.822238,75.847774],[-89.187083,75.610166],[-87.838276,75.566189],[-86.379192,75.482421],[-84.789625,75.699204],[-82.753445,75.784315],[-81.128531,75.713983],[-80.057511,75.336849],[-79.833933,74.923127],[-80.457771,74.657304],[-81.948843,74.442459],[-83.228894,74.564028],[-86.097452,74.410032],[-88.15035,74.392307]]],[[[-111.264443,78.152956],[-109.854452,77.996325],[-110.186938,77.697015],[-112.051191,77.409229],[-113.534279,77.732207],[-112.724587,78.05105],[-111.264443,78.152956]]],[[[-110.963661,78.804441],[-109.663146,78.601973],[-110.881314,78.40692],[-112.542091,78.407902],[-112.525891,78.550555],[-111.50001,78.849994],[-110.963661,78.804441]]],[[[-55.600218,51.317075],[-56.134036,50.68701],[-56.795882,49.812309],[-56.143105,50.150117],[-55.471492,49.935815],[-55.822401,49.587129],[-54.935143,49.313011],[-54.473775,49.556691],[-53.476549,49.249139],[-53.786014,48.516781],[-53.086134,48.687804],[-52.958648,48.157164],[-52.648099,47.535548],[-53.069158,46.655499],[-53.521456,46.618292],[-54.178936,46.807066],[-53.961869,47.625207],[-54.240482,47.752279],[-55.400773,46.884994],[-55.997481,46.91972],[-55.291219,47.389562],[-56.250799,47.632545],[-57.325229,47.572807],[-59.266015,47.603348],[-59.419494,47.899454],[-58.796586,48.251525],[-59.231625,48.523188],[-58.391805,49.125581],[-57.35869,50.718274],[-56.73865,51.287438],[-55.870977,51.632094],[-55.406974,51.588273],[-55.600218,51.317075]]],[[[-83.882626,65.109618],[-82.787577,64.766693],[-81.642014,64.455136],[-81.55344,63.979609],[-80.817361,64.057486],[-80.103451,63.725981],[-80.99102,63.411246],[-82.547178,63.651722],[-83.108798,64.101876],[-84.100417,63.569712],[-85.523405,63.052379],[-85.866769,63.637253],[-87.221983,63.541238],[-86.35276,64.035833],[-86.224886,64.822917],[-85.883848,65.738778],[-85.161308,65.657285],[-84.975764,65.217518],[-84.464012,65.371772],[-83.882626,65.109618]]],[[[-78.770639,72.352173],[-77.824624,72.749617],[-75.605845,72.243678],[-74.228616,71.767144],[-74.099141,71.33084],[-72.242226,71.556925],[-71.200015,70.920013],[-68.786054,70.525024],[-67.91497,70.121948],[-66.969033,69.186087],[-68.805123,68.720198],[-66.449866,68.067163],[-64.862314,67.847539],[-63.424934,66.928473],[-61.851981,66.862121],[-62.163177,66.160251],[-63.918444,64.998669],[-65.14886,65.426033],[-66.721219,66.388041],[-68.015016,66.262726],[-68.141287,65.689789],[-67.089646,65.108455],[-65.73208,64.648406],[-65.320168,64.382737],[-64.669406,63.392927],[-65.013804,62.674185],[-66.275045,62.945099],[-68.783186,63.74567],[-67.369681,62.883966],[-66.328297,62.280075],[-66.165568,61.930897],[-68.877367,62.330149],[-71.023437,62.910708],[-72.235379,63.397836],[-71.886278,63.679989],[-73.378306,64.193963],[-74.834419,64.679076],[-74.818503,64.389093],[-77.70998,64.229542],[-78.555949,64.572906],[-77.897281,65.309192],[-76.018274,65.326969],[-73.959795,65.454765],[-74.293883,65.811771],[-73.944912,66.310578],[-72.651167,67.284576],[-72.92606,67.726926],[-73.311618,68.069437],[-74.843307,68.554627],[-76.869101,68.894736],[-76.228649,69.147769],[-77.28737,69.76954],[-78.168634,69.826488],[-78.957242,70.16688],[-79.492455,69.871808],[-81.305471,69.743185],[-84.944706,69.966634],[-87.060003,70.260001],[-88.681713,70.410741],[-89.51342,70.762038],[-88.467721,71.218186],[-89.888151,71.222552],[-90.20516,72.235074],[-89.436577,73.129464],[-88.408242,73.537889],[-85.826151,73.803816],[-86.562179,73.157447],[-85.774371,72.534126],[-84.850112,73.340278],[-82.31559,73.750951],[-80.600088,72.716544],[-80.748942,72.061907],[-78.770639,72.352173]]],[[[-94.503658,74.134907],[-92.420012,74.100025],[-90.509793,73.856732],[-92.003965,72.966244],[-93.196296,72.771992],[-94.269047,72.024596],[-95.409856,72.061881],[-96.033745,72.940277],[-96.018268,73.43743],[-95.495793,73.862417],[-94.503658,74.134907]]],[[[-122.854924,76.116543],[-122.854925,76.116543],[-121.157535,76.864508],[-119.103939,77.51222],[-117.570131,77.498319],[-116.198587,77.645287],[-116.335813,76.876962],[-117.106051,76.530032],[-118.040412,76.481172],[-119.899318,76.053213],[-121.499995,75.900019],[-122.854924,76.116543]]],[[[-132.710008,54.040009],[-131.74999,54.120004],[-132.04948,52.984621],[-131.179043,52.180433],[-131.57783,52.182371],[-132.180428,52.639707],[-132.549992,53.100015],[-133.054611,53.411469],[-133.239664,53.85108],[-133.180004,54.169975],[-132.710008,54.040009]]],[[[-105.492289,79.301594],[-103.529282,79.165349],[-100.825158,78.800462],[-100.060192,78.324754],[-99.670939,77.907545],[-101.30394,78.018985],[-102.949809,78.343229],[-105.176133,78.380332],[-104.210429,78.67742],[-105.41958,78.918336],[-105.492289,79.301594]]],[[[-123.510002,48.510011],[-124.012891,48.370846],[-125.655013,48.825005],[-125.954994,49.179996],[-126.850004,49.53],[-127.029993,49.814996],[-128.059336,49.994959],[-128.444584,50.539138],[-128.358414,50.770648],[-127.308581,50.552574],[-126.695001,50.400903],[-125.755007,50.295018],[-125.415002,49.950001],[-124.920768,49.475275],[-123.922509,49.062484],[-123.510002,48.510011]]],[[[-121.53788,74.44893],[-120.10978,74.24135],[-117.55564,74.18577],[-116.58442,73.89607],[-115.51081,73.47519],[-116.76794,73.22292],[-119.22,72.52],[-120.46,71.82],[-120.46,71.383602],[-123.09219,70.90164],[-123.62,71.34],[-125.928949,71.868688],[-125.5,72.292261],[-124.80729,73.02256],[-123.94,73.68],[-124.91775,74.29275],[-121.53788,74.44893]]],[[[-107.81943,75.84552],[-106.92893,76.01282],[-105.881,75.9694],[-105.70498,75.47951],[-106.31347,75.00527],[-109.7,74.85],[-112.22307,74.41696],[-113.74381,74.39427],[-113.87135,74.72029],[-111.79421,75.1625],[-116.31221,75.04343],[-117.7104,75.2222],[-116.34602,76.19903],[-115.40487,76.47887],[-112.59056,76.14134],[-110.81422,75.54919],[-109.0671,75.47321],[-110.49726,76.42982],[-109.5811,76.79417],[-108.54859,76.67832],[-108.21141,76.20168],[-107.81943,75.84552]]],[[[-106.52259,73.07601],[-105.40246,72.67259],[-104.77484,71.6984],[-104.46476,70.99297],[-102.78537,70.49776],[-100.98078,70.02432],[-101.08929,69.58447],[-102.73116,69.50402],[-102.09329,69.11962],[-102.43024,68.75282],[-104.24,68.91],[-105.96,69.18],[-107.12254,69.11922],[-109,68.78],[-111.534149,68.630059],[-113.3132,68.53554],[-113.85496,69.00744],[-115.22,69.28],[-116.10794,69.16821],[-117.34,69.96],[-116.67473,70.06655],[-115.13112,70.2373],[-113.72141,70.19237],[-112.4161,70.36638],[-114.35,70.6],[-116.48684,70.52045],[-117.9048,70.54056],[-118.43238,70.9092],[-116.11311,71.30918],[-117.65568,71.2952],[-119.40199,71.55859],[-118.56267,72.30785],[-117.86642,72.70594],[-115.18909,73.31459],[-114.16717,73.12145],[-114.66634,72.65277],[-112.44102,72.9554],[-111.05039,72.4504],[-109.92035,72.96113],[-109.00654,72.63335],[-108.18835,71.65089],[-107.68599,72.06548],[-108.39639,73.08953],[-107.51645,73.23598],[-106.52259,73.07601]]],[[[-100.43836,72.70588],[-101.54,73.36],[-100.35642,73.84389],[-99.16387,73.63339],[-97.38,73.76],[-97.12,73.47],[-98.05359,72.99052],[-96.54,72.56],[-96.72,71.66],[-98.35966,71.27285],[-99.32286,71.35639],[-100.01482,71.73827],[-102.5,72.51],[-102.48,72.83],[-100.43836,72.70588]]],[[[-106.6,73.6],[-105.26,73.64],[-104.5,73.42],[-105.38,72.76],[-106.94,73.46],[-106.6,73.6]]],[[[-98.5,76.72],[-97.735585,76.25656],[-97.704415,75.74344],[-98.16,75],[-99.80874,74.89744],[-100.88366,75.05736],[-100.86292,75.64075],[-102.50209,75.5638],[-102.56552,76.3366],[-101.48973,76.30537],[-99.98349,76.64634],[-98.57699,76.58859],[-98.5,76.72]]],[[[-96.01644,80.60233],[-95.32345,80.90729],[-94.29843,80.97727],[-94.73542,81.20646],[-92.40984,81.25739],[-91.13289,80.72345],[-89.45,80.509322],[-87.81,80.32],[-87.02,79.66],[-85.81435,79.3369],[-87.18756,79.0393],[-89.03535,78.28723],[-90.80436,78.21533],[-92.87669,78.34333],[-93.95116,78.75099],[-93.93574,79.11373],[-93.14524,79.3801],[-94.974,79.37248],[-96.07614,79.70502],[-96.70972,80.15777],[-96.01644,80.60233]]],[[[-91.58702,81.89429],[-90.1,82.085],[-88.93227,82.11751],[-86.97024,82.27961],[-85.5,82.652273],[-84.260005,82.6],[-83.18,82.32],[-82.42,82.86],[-81.1,83.02],[-79.30664,83.13056],[-76.25,83.172059],[-75.71878,83.06404],[-72.83153,83.23324],[-70.665765,83.169781],[-68.5,83.106322],[-65.82735,83.02801],[-63.68,82.9],[-61.85,82.6286],[-61.89388,82.36165],[-64.334,81.92775],[-66.75342,81.72527],[-67.65755,81.50141],[-65.48031,81.50657],[-67.84,80.9],[-69.4697,80.61683],[-71.18,79.8],[-73.2428,79.63415],[-73.88,79.430162],[-76.90773,79.32309],[-75.52924,79.19766],[-76.22046,79.01907],[-75.39345,78.52581],[-76.34354,78.18296],[-77.88851,77.89991],[-78.36269,77.50859],[-79.75951,77.20968],[-79.61965,76.98336],[-77.91089,77.022045],[-77.88911,76.777955],[-80.56125,76.17812],[-83.17439,76.45403],[-86.11184,76.29901],[-87.6,76.42],[-89.49068,76.47239],[-89.6161,76.95213],[-87.76739,77.17833],[-88.26,77.9],[-87.65,77.970222],[-84.97634,77.53873],[-86.34,78.18],[-87.96192,78.37181],[-87.15198,78.75867],[-85.37868,78.9969],[-85.09495,79.34543],[-86.50734,79.73624],[-86.93179,80.25145],[-84.19844,80.20836],[-83.408696,80.1],[-81.84823,80.46442],[-84.1,80.58],[-87.59895,80.51627],[-89.36663,80.85569],[-90.2,81.26],[-91.36786,81.5531],[-91.58702,81.89429]]],[[[-75.21597,67.44425],[-75.86588,67.14886],[-76.98687,67.09873],[-77.2364,67.58809],[-76.81166,68.14856],[-75.89521,68.28721],[-75.1145,68.01036],[-75.10333,67.58202],[-75.21597,67.44425]]],[[[-96.257401,69.49003],[-95.647681,69.10769],[-96.269521,68.75704],[-97.617401,69.06003],[-98.431801,68.9507],[-99.797401,69.40003],[-98.917401,69.71003],[-98.218261,70.14354],[-97.157401,69.86003],[-96.557401,69.68003],[-96.257401,69.49003]]],[[[-64.51912,49.87304],[-64.17322,49.95718],[-62.85829,49.70641],[-61.835585,49.28855],[-61.806305,49.10506],[-62.29318,49.08717],[-63.58926,49.40069],[-64.51912,49.87304]]],[[[-64.01486,47.03601],[-63.6645,46.55001],[-62.9393,46.41587],[-62.01208,46.44314],[-62.50391,46.03339],[-62.87433,45.96818],[-64.1428,46.39265],[-64.39261,46.72747],[-64.01486,47.03601]]]]}},{"type":"Feature","properties":{"name":"United States of America"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-122.84,49],[-120,49],[-117.03121,49],[-116.04818,49],[-113,49],[-110.05,49],[-107.05,49],[-104.04826,48.99986],[-100.65,49],[-97.22872,49.0007],[-95.15907,49],[-95.15609,49.38425],[-94.81758,49.38905],[-94.64,48.84],[-94.32914,48.67074],[-93.63087,48.60926],[-92.61,48.45],[-91.64,48.14],[-90.83,48.27],[-89.6,48.01],[-89.272917,48.019808],[-88.378114,48.302918],[-87.439793,47.94],[-86.461991,47.553338],[-85.652363,47.220219],[-84.87608,46.900083],[-84.779238,46.637102],[-84.543749,46.538684],[-84.6049,46.4396],[-84.3367,46.40877],[-84.14212,46.512226],[-84.091851,46.275419],[-83.890765,46.116927],[-83.616131,46.116927],[-83.469551,45.994686],[-83.592851,45.816894],[-82.550925,45.347517],[-82.337763,44.44],[-82.137642,43.571088],[-82.43,42.98],[-82.9,42.43],[-83.12,42.08],[-83.142,41.975681],[-83.02981,41.832796],[-82.690089,41.675105],[-82.439278,41.675105],[-81.277747,42.209026],[-80.247448,42.3662],[-78.939362,42.863611],[-78.92,42.965],[-79.01,43.27],[-79.171674,43.466339],[-78.72028,43.625089],[-77.737885,43.629056],[-76.820034,43.628784],[-76.5,44.018459],[-76.375,44.09631],[-75.31821,44.81645],[-74.867,45.00048],[-73.34783,45.00738],[-71.50506,45.0082],[-71.405,45.255],[-71.08482,45.30524],[-70.66,45.46],[-70.305,45.915],[-69.99997,46.69307],[-69.237216,47.447781],[-68.905,47.185],[-68.23444,47.35486],[-67.79046,47.06636],[-67.79134,45.70281],[-67.13741,45.13753],[-66.96466,44.8097],[-68.03252,44.3252],[-69.06,43.98],[-70.11617,43.68405],[-70.645476,43.090238],[-70.81489,42.8653],[-70.825,42.335],[-70.495,41.805],[-70.08,41.78],[-70.185,42.145],[-69.88497,41.92283],[-69.96503,41.63717],[-70.64,41.475],[-71.12039,41.49445],[-71.86,41.32],[-72.295,41.27],[-72.87643,41.22065],[-73.71,40.931102],[-72.24126,41.11948],[-71.945,40.93],[-73.345,40.63],[-73.982,40.628],[-73.952325,40.75075],[-74.25671,40.47351],[-73.96244,40.42763],[-74.17838,39.70926],[-74.90604,38.93954],[-74.98041,39.1964],[-75.20002,39.24845],[-75.52805,39.4985],[-75.32,38.96],[-75.071835,38.782032],[-75.05673,38.40412],[-75.37747,38.01551],[-75.94023,37.21689],[-76.03127,37.2566],[-75.72205,37.93705],[-76.23287,38.319215],[-76.35,39.15],[-76.542725,38.717615],[-76.32933,38.08326],[-76.989998,38.239992],[-76.30162,37.917945],[-76.25874,36.9664],[-75.9718,36.89726],[-75.86804,36.55125],[-75.72749,35.55074],[-76.36318,34.80854],[-77.397635,34.51201],[-78.05496,33.92547],[-78.55435,33.86133],[-79.06067,33.49395],[-79.20357,33.15839],[-80.301325,32.509355],[-80.86498,32.0333],[-81.33629,31.44049],[-81.49042,30.72999],[-81.31371,30.03552],[-80.98,29.18],[-80.535585,28.47213],[-80.53,28.04],[-80.056539,26.88],[-80.088015,26.205765],[-80.13156,25.816775],[-80.38103,25.20616],[-80.68,25.08],[-81.17213,25.20126],[-81.33,25.64],[-81.71,25.87],[-82.24,26.73],[-82.70515,27.49504],[-82.85526,27.88624],[-82.65,28.55],[-82.93,29.1],[-83.70959,29.93656],[-84.1,30.09],[-85.10882,29.63615],[-85.28784,29.68612],[-85.7731,30.15261],[-86.4,30.4],[-87.53036,30.27433],[-88.41782,30.3849],[-89.18049,30.31598],[-89.593831,30.159994],[-89.413735,29.89419],[-89.43,29.48864],[-89.21767,29.29108],[-89.40823,29.15961],[-89.77928,29.30714],[-90.15463,29.11743],[-90.880225,29.148535],[-91.626785,29.677],[-92.49906,29.5523],[-93.22637,29.78375],[-93.84842,29.71363],[-94.69,29.48],[-95.60026,28.73863],[-96.59404,28.30748],[-97.14,27.83],[-97.37,27.38],[-97.38,26.69],[-97.33,26.21],[-97.14,25.87],[-97.53,25.84],[-98.24,26.06],[-99.02,26.37],[-99.3,26.84],[-99.52,27.54],[-100.11,28.11],[-100.45584,28.69612],[-100.9576,29.38071],[-101.6624,29.7793],[-102.48,29.76],[-103.11,28.97],[-103.94,29.27],[-104.45697,29.57196],[-104.70575,30.12173],[-105.03737,30.64402],[-105.63159,31.08383],[-106.1429,31.39995],[-106.50759,31.75452],[-108.24,31.754854],[-108.24194,31.34222],[-109.035,31.34194],[-111.02361,31.33472],[-113.30498,32.03914],[-114.815,32.52528],[-114.72139,32.72083],[-115.99135,32.61239],[-117.12776,32.53534],[-117.295938,33.046225],[-117.944,33.621236],[-118.410602,33.740909],[-118.519895,34.027782],[-119.081,34.078],[-119.438841,34.348477],[-120.36778,34.44711],[-120.62286,34.60855],[-120.74433,35.15686],[-121.71457,36.16153],[-122.54747,37.55176],[-122.51201,37.78339],[-122.95319,38.11371],[-123.7272,38.95166],[-123.86517,39.76699],[-124.39807,40.3132],[-124.17886,41.14202],[-124.2137,41.99964],[-124.53284,42.76599],[-124.14214,43.70838],[-124.020535,44.615895],[-123.89893,45.52341],[-124.079635,46.86475],[-124.39567,47.72017],[-124.68721,48.184433],[-124.566101,48.379715],[-123.12,48.04],[-122.58736,47.096],[-122.34,47.36],[-122.5,48.18],[-122.84,49]]],[[[-155.40214,20.07975],[-155.22452,19.99302],[-155.06226,19.8591],[-154.80741,19.50871],[-154.83147,19.45328],[-155.22217,19.23972],[-155.54211,19.08348],[-155.68817,18.91619],[-155.93665,19.05939],[-155.90806,19.33888],[-156.07347,19.70294],[-156.02368,19.81422],[-155.85008,19.97729],[-155.91907,20.17395],[-155.86108,20.26721],[-155.78505,20.2487],[-155.40214,20.07975]]],[[[-155.99566,20.76404],[-156.07926,20.64397],[-156.41445,20.57241],[-156.58673,20.783],[-156.70167,20.8643],[-156.71055,20.92676],[-156.61258,21.01249],[-156.25711,20.91745],[-155.99566,20.76404]]],[[[-156.75824,21.17684],[-156.78933,21.06873],[-157.32521,21.09777],[-157.25027,21.21958],[-156.75824,21.17684]]],[[[-158.0252,21.71696],[-157.94161,21.65272],[-157.65283,21.32217],[-157.70703,21.26442],[-157.7786,21.27729],[-158.12667,21.31244],[-158.2538,21.53919],[-158.29265,21.57912],[-158.0252,21.71696]]],[[[-159.36569,22.21494],[-159.34512,21.982],[-159.46372,21.88299],[-159.80051,22.06533],[-159.74877,22.1382],[-159.5962,22.23618],[-159.36569,22.21494]]],[[[-166.467792,60.38417],[-165.67443,60.293607],[-165.579164,59.909987],[-166.19277,59.754441],[-166.848337,59.941406],[-167.455277,60.213069],[-166.467792,60.38417]]],[[[-153.228729,57.968968],[-152.564791,57.901427],[-152.141147,57.591059],[-153.006314,57.115842],[-154.00509,56.734677],[-154.516403,56.992749],[-154.670993,57.461196],[-153.76278,57.816575],[-153.228729,57.968968]]],[[[-140.985988,69.711998],[-140.986,69.712],[-140.9925,66.00003],[-140.99778,60.30639],[-140.013,60.27682],[-139.039,60],[-138.34089,59.56211],[-137.4525,58.905],[-136.47972,59.46389],[-135.47583,59.78778],[-134.945,59.27056],[-134.27111,58.86111],[-133.35556,58.41028],[-132.73042,57.69289],[-131.70781,56.55212],[-130.00778,55.91583],[-129.98,55.285],[-130.53611,54.80278],[-130.536109,54.802754],[-130.53611,54.802753],[-131.085818,55.178906],[-131.967211,55.497776],[-132.250011,56.369996],[-133.539181,57.178887],[-134.078063,58.123068],[-135.038211,58.187715],[-136.628062,58.212209],[-137.800006,58.499995],[-139.867787,59.537762],[-140.825274,59.727517],[-142.574444,60.084447],[-143.958881,59.99918],[-145.925557,60.45861],[-147.114374,60.884656],[-148.224306,60.672989],[-148.018066,59.978329],[-148.570823,59.914173],[-149.727858,59.705658],[-150.608243,59.368211],[-151.716393,59.155821],[-151.859433,59.744984],[-151.409719,60.725803],[-150.346941,61.033588],[-150.621111,61.284425],[-151.895839,60.727198],[-152.57833,60.061657],[-154.019172,59.350279],[-153.287511,58.864728],[-154.232492,58.146374],[-155.307491,57.727795],[-156.308335,57.422774],[-156.556097,56.979985],[-158.117217,56.463608],[-158.433321,55.994154],[-159.603327,55.566686],[-160.28972,55.643581],[-161.223048,55.364735],[-162.237766,55.024187],[-163.069447,54.689737],[-164.785569,54.404173],[-164.942226,54.572225],[-163.84834,55.039431],[-162.870001,55.348043],[-161.804175,55.894986],[-160.563605,56.008055],[-160.07056,56.418055],[-158.684443,57.016675],[-158.461097,57.216921],[-157.72277,57.570001],[-157.550274,58.328326],[-157.041675,58.918885],[-158.194731,58.615802],[-158.517218,58.787781],[-159.058606,58.424186],[-159.711667,58.93139],[-159.981289,58.572549],[-160.355271,59.071123],[-161.355003,58.670838],[-161.968894,58.671665],[-162.054987,59.266925],[-161.874171,59.633621],[-162.518059,59.989724],[-163.818341,59.798056],[-164.662218,60.267484],[-165.346388,60.507496],[-165.350832,61.073895],[-166.121379,61.500019],[-165.734452,62.074997],[-164.919179,62.633076],[-164.562508,63.146378],[-163.753332,63.219449],[-163.067224,63.059459],[-162.260555,63.541936],[-161.53445,63.455817],[-160.772507,63.766108],[-160.958335,64.222799],[-161.518068,64.402788],[-160.777778,64.788604],[-161.391926,64.777235],[-162.45305,64.559445],[-162.757786,64.338605],[-163.546394,64.55916],[-164.96083,64.446945],[-166.425288,64.686672],[-166.845004,65.088896],[-168.11056,65.669997],[-166.705271,66.088318],[-164.47471,66.57666],[-163.652512,66.57666],[-163.788602,66.077207],[-161.677774,66.11612],[-162.489715,66.735565],[-163.719717,67.116395],[-164.430991,67.616338],[-165.390287,68.042772],[-166.764441,68.358877],[-166.204707,68.883031],[-164.430811,68.915535],[-163.168614,69.371115],[-162.930566,69.858062],[-161.908897,70.33333],[-160.934797,70.44769],[-159.039176,70.891642],[-158.119723,70.824721],[-156.580825,71.357764],[-155.06779,71.147776],[-154.344165,70.696409],[-153.900006,70.889989],[-152.210006,70.829992],[-152.270002,70.600006],[-150.739992,70.430017],[-149.720003,70.53001],[-147.613362,70.214035],[-145.68999,70.12001],[-144.920011,69.989992],[-143.589446,70.152514],[-142.07251,69.851938],[-140.985988,69.711998],[-140.985988,69.711998]]],[[[-171.731657,63.782515],[-171.114434,63.592191],[-170.491112,63.694975],[-169.682505,63.431116],[-168.689439,63.297506],[-168.771941,63.188598],[-169.52944,62.976931],[-170.290556,63.194438],[-170.671386,63.375822],[-171.553063,63.317789],[-171.791111,63.405846],[-171.731657,63.782515]]]]}},{"type":"Feature","properties":{"name":"Kazakhstan"},"geometry":{"type":"Polygon","coordinates":[[[87.35997,49.214981],[86.598776,48.549182],[85.768233,48.455751],[85.720484,47.452969],[85.16429,47.000956],[83.180484,47.330031],[82.458926,45.53965],[81.947071,45.317027],[79.966106,44.917517],[80.866206,43.180362],[80.18015,42.920068],[80.25999,42.349999],[79.643645,42.496683],[79.142177,42.856092],[77.658392,42.960686],[76.000354,42.988022],[75.636965,42.8779],[74.212866,43.298339],[73.645304,43.091272],[73.489758,42.500894],[71.844638,42.845395],[71.186281,42.704293],[70.962315,42.266154],[70.388965,42.081308],[69.070027,41.384244],[68.632483,40.668681],[68.259896,40.662325],[67.985856,41.135991],[66.714047,41.168444],[66.510649,41.987644],[66.023392,41.994646],[66.098012,42.99766],[64.900824,43.728081],[63.185787,43.650075],[62.0133,43.504477],[61.05832,44.405817],[60.239972,44.784037],[58.689989,45.500014],[58.503127,45.586804],[55.928917,44.995858],[55.968191,41.308642],[55.455251,41.259859],[54.755345,42.043971],[54.079418,42.324109],[52.944293,42.116034],[52.50246,41.783316],[52.446339,42.027151],[52.692112,42.443895],[52.501426,42.792298],[51.342427,43.132975],[50.891292,44.031034],[50.339129,44.284016],[50.305643,44.609836],[51.278503,44.514854],[51.316899,45.245998],[52.16739,45.408391],[53.040876,45.259047],[53.220866,46.234646],[53.042737,46.853006],[52.042023,46.804637],[51.191945,47.048705],[50.034083,46.60899],[49.10116,46.39933],[48.59325,46.56104],[48.694734,47.075628],[48.05725,47.74377],[47.31524,47.71585],[46.466446,48.394152],[47.043672,49.152039],[46.751596,49.356006],[47.54948,50.454698],[48.577841,49.87476],[48.702382,50.605128],[50.766648,51.692762],[52.328724,51.718652],[54.532878,51.02624],[55.71694,50.62171],[56.77798,51.04355],[58.36332,51.06364],[59.642282,50.545442],[59.932807,50.842194],[61.337424,50.79907],[61.588003,51.272659],[59.967534,51.96042],[60.927269,52.447548],[60.739993,52.719986],[61.699986,52.979996],[60.978066,53.664993],[61.4366,54.00625],[65.178534,54.354228],[65.66687,54.60125],[68.1691,54.970392],[69.068167,55.38525],[70.865267,55.169734],[71.180131,54.133285],[72.22415,54.376655],[73.508516,54.035617],[73.425679,53.48981],[74.38482,53.54685],[76.8911,54.490524],[76.525179,54.177003],[77.800916,53.404415],[80.03556,50.864751],[80.568447,51.388336],[81.945986,50.812196],[83.383004,51.069183],[83.935115,50.889246],[84.416377,50.3114],[85.11556,50.117303],[85.54127,49.692859],[86.829357,49.826675],[87.35997,49.214981]]]}},{"type":"Feature","properties":{"name":"Uzbekistan"},"geometry":{"type":"Polygon","coordinates":[[[55.968191,41.308642],[55.928917,44.995858],[58.503127,45.586804],[58.689989,45.500014],[60.239972,44.784037],[61.05832,44.405817],[62.0133,43.504477],[63.185787,43.650075],[64.900824,43.728081],[66.098012,42.99766],[66.023392,41.994646],[66.510649,41.987644],[66.714047,41.168444],[67.985856,41.135991],[68.259896,40.662325],[68.632483,40.668681],[69.070027,41.384244],[70.388965,42.081308],[70.962315,42.266154],[71.259248,42.167711],[70.420022,41.519998],[71.157859,41.143587],[71.870115,41.3929],[73.055417,40.866033],[71.774875,40.145844],[71.014198,40.244366],[70.601407,40.218527],[70.45816,40.496495],[70.666622,40.960213],[69.329495,40.727824],[69.011633,40.086158],[68.536416,39.533453],[67.701429,39.580478],[67.44222,39.140144],[68.176025,38.901553],[68.392033,38.157025],[67.83,37.144994],[67.075782,37.356144],[66.518607,37.362784],[66.54615,37.974685],[65.215999,38.402695],[64.170223,38.892407],[63.518015,39.363257],[62.37426,40.053886],[61.882714,41.084857],[61.547179,41.26637],[60.465953,41.220327],[60.083341,41.425146],[59.976422,42.223082],[58.629011,42.751551],[57.78653,42.170553],[56.932215,41.826026],[57.096391,41.32231],[55.968191,41.308642]]]}},{"type":"Feature","properties":{"name":"Papua New Guinea"},"geometry":{"type":"MultiPolygon","coordinates":[[[[141.00021,-2.600151],[142.735247,-3.289153],[144.583971,-3.861418],[145.27318,-4.373738],[145.829786,-4.876498],[145.981922,-5.465609],[147.648073,-6.083659],[147.891108,-6.614015],[146.970905,-6.721657],[147.191874,-7.388024],[148.084636,-8.044108],[148.734105,-9.104664],[149.306835,-9.071436],[149.266631,-9.514406],[150.038728,-9.684318],[149.738798,-9.872937],[150.801628,-10.293687],[150.690575,-10.582713],[150.028393,-10.652476],[149.78231,-10.393267],[148.923138,-10.280923],[147.913018,-10.130441],[147.135443,-9.492444],[146.567881,-8.942555],[146.048481,-8.067414],[144.744168,-7.630128],[143.897088,-7.91533],[143.286376,-8.245491],[143.413913,-8.983069],[142.628431,-9.326821],[142.068259,-9.159596],[141.033852,-9.117893],[141.017057,-5.859022],[141.00021,-2.600151]]],[[[152.640017,-3.659983],[153.019994,-3.980015],[153.140038,-4.499983],[152.827292,-4.766427],[152.638673,-4.176127],[152.406026,-3.789743],[151.953237,-3.462062],[151.384279,-3.035422],[150.66205,-2.741486],[150.939965,-2.500002],[151.479984,-2.779985],[151.820015,-2.999972],[152.239989,-3.240009],[152.640017,-3.659983]]],[[[151.30139,-5.840728],[150.754447,-6.083763],[150.241197,-6.317754],[149.709963,-6.316513],[148.890065,-6.02604],[148.318937,-5.747142],[148.401826,-5.437756],[149.298412,-5.583742],[149.845562,-5.505503],[149.99625,-5.026101],[150.139756,-5.001348],[150.236908,-5.53222],[150.807467,-5.455842],[151.089672,-5.113693],[151.647881,-4.757074],[151.537862,-4.167807],[152.136792,-4.14879],[152.338743,-4.312966],[152.318693,-4.867661],[151.982796,-5.478063],[151.459107,-5.56028],[151.30139,-5.840728]]],[[[154.759991,-5.339984],[155.062918,-5.566792],[155.547746,-6.200655],[156.019965,-6.540014],[155.880026,-6.819997],[155.599991,-6.919991],[155.166994,-6.535931],[154.729192,-5.900828],[154.514114,-5.139118],[154.652504,-5.042431],[154.759991,-5.339984]]]]}},{"type":"Feature","properties":{"name":"Indonesia"},"geometry":{"type":"MultiPolygon","coordinates":[[[[141.00021,-2.600151],[141.017057,-5.859022],[141.033852,-9.117893],[140.143415,-8.297168],[139.127767,-8.096043],[138.881477,-8.380935],[137.614474,-8.411683],[138.039099,-7.597882],[138.668621,-7.320225],[138.407914,-6.232849],[137.92784,-5.393366],[135.98925,-4.546544],[135.164598,-4.462931],[133.66288,-3.538853],[133.367705,-4.024819],[132.983956,-4.112979],[132.756941,-3.746283],[132.753789,-3.311787],[131.989804,-2.820551],[133.066845,-2.460418],[133.780031,-2.479848],[133.696212,-2.214542],[132.232373,-2.212526],[131.836222,-1.617162],[130.94284,-1.432522],[130.519558,-0.93772],[131.867538,-0.695461],[132.380116,-0.369538],[133.985548,-0.78021],[134.143368,-1.151867],[134.422627,-2.769185],[135.457603,-3.367753],[136.293314,-2.307042],[137.440738,-1.703513],[138.329727,-1.702686],[139.184921,-2.051296],[139.926684,-2.409052],[141.00021,-2.600151]]],[[[124.968682,-8.89279],[125.07002,-9.089987],[125.08852,-9.393173],[124.43595,-10.140001],[123.579982,-10.359987],[123.459989,-10.239995],[123.550009,-9.900016],[123.980009,-9.290027],[124.968682,-8.89279]]],[[[134.210134,-6.895238],[134.112776,-6.142467],[134.290336,-5.783058],[134.499625,-5.445042],[134.727002,-5.737582],[134.724624,-6.214401],[134.210134,-6.895238]]],[[[117.882035,4.137551],[117.313232,3.234428],[118.04833,2.28769],[117.875627,1.827641],[118.996747,0.902219],[117.811858,0.784242],[117.478339,0.102475],[117.521644,-0.803723],[116.560048,-1.487661],[116.533797,-2.483517],[116.148084,-4.012726],[116.000858,-3.657037],[114.864803,-4.106984],[114.468652,-3.495704],[113.755672,-3.43917],[113.256994,-3.118776],[112.068126,-3.478392],[111.703291,-2.994442],[111.04824,-3.049426],[110.223846,-2.934032],[110.070936,-1.592874],[109.571948,-1.314907],[109.091874,-0.459507],[108.952658,0.415375],[109.069136,1.341934],[109.66326,2.006467],[109.830227,1.338136],[110.514061,0.773131],[111.159138,0.976478],[111.797548,0.904441],[112.380252,1.410121],[112.859809,1.49779],[113.80585,1.217549],[114.621355,1.430688],[115.134037,2.821482],[115.519078,3.169238],[115.865517,4.306559],[117.015214,4.306094],[117.882035,4.137551]]],[[[129.370998,-2.802154],[130.471344,-3.093764],[130.834836,-3.858472],[129.990547,-3.446301],[129.155249,-3.362637],[128.590684,-3.428679],[127.898891,-3.393436],[128.135879,-2.84365],[129.370998,-2.802154]]],[[[126.874923,-3.790983],[126.183802,-3.607376],[125.989034,-3.177273],[127.000651,-3.129318],[127.249215,-3.459065],[126.874923,-3.790983]]],[[[127.932378,2.174596],[128.004156,1.628531],[128.594559,1.540811],[128.688249,1.132386],[128.635952,0.258486],[128.12017,0.356413],[127.968034,-0.252077],[128.379999,-0.780004],[128.100016,-0.899996],[127.696475,-0.266598],[127.39949,1.011722],[127.600512,1.810691],[127.932378,2.174596]]],[[[122.927567,0.875192],[124.077522,0.917102],[125.065989,1.643259],[125.240501,1.419836],[124.437035,0.427881],[123.685505,0.235593],[122.723083,0.431137],[121.056725,0.381217],[120.183083,0.237247],[120.04087,-0.519658],[120.935905,-1.408906],[121.475821,-0.955962],[123.340565,-0.615673],[123.258399,-1.076213],[122.822715,-0.930951],[122.38853,-1.516858],[121.508274,-1.904483],[122.454572,-3.186058],[122.271896,-3.5295],[123.170963,-4.683693],[123.162333,-5.340604],[122.628515,-5.634591],[122.236394,-5.282933],[122.719569,-4.464172],[121.738234,-4.851331],[121.489463,-4.574553],[121.619171,-4.188478],[120.898182,-3.602105],[120.972389,-2.627643],[120.305453,-2.931604],[120.390047,-4.097579],[120.430717,-5.528241],[119.796543,-5.6734],[119.366906,-5.379878],[119.653606,-4.459417],[119.498835,-3.494412],[119.078344,-3.487022],[118.767769,-2.801999],[119.180974,-2.147104],[119.323394,-1.353147],[119.825999,0.154254],[120.035702,0.566477],[120.885779,1.309223],[121.666817,1.013944],[122.927567,0.875192]]],[[[120.295014,-10.25865],[118.967808,-9.557969],[119.90031,-9.36134],[120.425756,-9.665921],[120.775502,-9.969675],[120.715609,-10.239581],[120.295014,-10.25865]]],[[[121.341669,-8.53674],[122.007365,-8.46062],[122.903537,-8.094234],[122.756983,-8.649808],[121.254491,-8.933666],[119.924391,-8.810418],[119.920929,-8.444859],[120.715092,-8.236965],[121.341669,-8.53674]]],[[[118.260616,-8.362383],[118.87846,-8.280683],[119.126507,-8.705825],[117.970402,-8.906639],[117.277731,-9.040895],[116.740141,-9.032937],[117.083737,-8.457158],[117.632024,-8.449303],[117.900018,-8.095681],[118.260616,-8.362383]]],[[[108.486846,-6.421985],[108.623479,-6.777674],[110.539227,-6.877358],[110.759576,-6.465186],[112.614811,-6.946036],[112.978768,-7.594213],[114.478935,-7.776528],[115.705527,-8.370807],[114.564511,-8.751817],[113.464734,-8.348947],[112.559672,-8.376181],[111.522061,-8.302129],[110.58615,-8.122605],[109.427667,-7.740664],[108.693655,-7.6416],[108.277763,-7.766657],[106.454102,-7.3549],[106.280624,-6.9249],[105.365486,-6.851416],[106.051646,-5.895919],[107.265009,-5.954985],[108.072091,-6.345762],[108.486846,-6.421985]]],[[[104.369991,-1.084843],[104.53949,-1.782372],[104.887893,-2.340425],[105.622111,-2.428844],[106.108593,-3.061777],[105.857446,-4.305525],[105.817655,-5.852356],[104.710384,-5.873285],[103.868213,-5.037315],[102.584261,-4.220259],[102.156173,-3.614146],[101.399113,-2.799777],[100.902503,-2.050262],[100.141981,-0.650348],[99.26374,0.183142],[98.970011,1.042882],[98.601351,1.823507],[97.699598,2.453184],[97.176942,3.308791],[96.424017,3.86886],[95.380876,4.970782],[95.293026,5.479821],[95.936863,5.439513],[97.484882,5.246321],[98.369169,4.26837],[99.142559,3.59035],[99.693998,3.174329],[100.641434,2.099381],[101.658012,2.083697],[102.498271,1.3987],[103.07684,0.561361],[103.838396,0.104542],[103.437645,-0.711946],[104.010789,-1.059212],[104.369991,-1.084843]]]]}},{"type":"Feature","properties":{"name":"Argentina"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-68.63401,-52.63637],[-68.25,-53.1],[-67.75,-53.85],[-66.45,-54.45],[-65.05,-54.7],[-65.5,-55.2],[-66.45,-55.25],[-66.95992,-54.89681],[-67.56244,-54.87001],[-68.63335,-54.8695],[-68.63401,-52.63637]]],[[[-57.625133,-30.216295],[-57.874937,-31.016556],[-58.14244,-32.044504],[-58.132648,-33.040567],[-58.349611,-33.263189],[-58.427074,-33.909454],[-58.495442,-34.43149],[-57.22583,-35.288027],[-57.362359,-35.97739],[-56.737487,-36.413126],[-56.788285,-36.901572],[-57.749157,-38.183871],[-59.231857,-38.72022],[-61.237445,-38.928425],[-62.335957,-38.827707],[-62.125763,-39.424105],[-62.330531,-40.172586],[-62.145994,-40.676897],[-62.745803,-41.028761],[-63.770495,-41.166789],[-64.73209,-40.802677],[-65.118035,-41.064315],[-64.978561,-42.058001],[-64.303408,-42.359016],[-63.755948,-42.043687],[-63.458059,-42.563138],[-64.378804,-42.873558],[-65.181804,-43.495381],[-65.328823,-44.501366],[-65.565269,-45.036786],[-66.509966,-45.039628],[-67.293794,-45.551896],[-67.580546,-46.301773],[-66.597066,-47.033925],[-65.641027,-47.236135],[-65.985088,-48.133289],[-67.166179,-48.697337],[-67.816088,-49.869669],[-68.728745,-50.264218],[-69.138539,-50.73251],[-68.815561,-51.771104],[-68.149995,-52.349983],[-68.571545,-52.299444],[-69.498362,-52.142761],[-71.914804,-52.009022],[-72.329404,-51.425956],[-72.309974,-50.67701],[-72.975747,-50.74145],[-73.328051,-50.378785],[-73.415436,-49.318436],[-72.648247,-48.878618],[-72.331161,-48.244238],[-72.447355,-47.738533],[-71.917258,-46.884838],[-71.552009,-45.560733],[-71.659316,-44.973689],[-71.222779,-44.784243],[-71.329801,-44.407522],[-71.793623,-44.207172],[-71.464056,-43.787611],[-71.915424,-43.408565],[-72.148898,-42.254888],[-71.746804,-42.051386],[-71.915734,-40.832339],[-71.680761,-39.808164],[-71.413517,-38.916022],[-70.814664,-38.552995],[-71.118625,-37.576827],[-71.121881,-36.658124],[-70.364769,-36.005089],[-70.388049,-35.169688],[-69.817309,-34.193571],[-69.814777,-33.273886],[-70.074399,-33.09121],[-70.535069,-31.36501],[-69.919008,-30.336339],[-70.01355,-29.367923],[-69.65613,-28.459141],[-69.001235,-27.521214],[-68.295542,-26.89934],[-68.5948,-26.506909],[-68.386001,-26.185016],[-68.417653,-24.518555],[-67.328443,-24.025303],[-66.985234,-22.986349],[-67.106674,-22.735925],[-66.273339,-21.83231],[-64.964892,-22.075862],[-64.377021,-22.798091],[-63.986838,-21.993644],[-62.846468,-22.034985],[-62.685057,-22.249029],[-60.846565,-23.880713],[-60.028966,-24.032796],[-58.807128,-24.771459],[-57.777217,-25.16234],[-57.63366,-25.603657],[-58.618174,-27.123719],[-57.60976,-27.395899],[-56.486702,-27.548499],[-55.695846,-27.387837],[-54.788795,-26.621786],[-54.625291,-25.739255],[-54.13005,-25.547639],[-53.628349,-26.124865],[-53.648735,-26.923473],[-54.490725,-27.474757],[-55.162286,-27.881915],[-56.2909,-28.852761],[-57.625133,-30.216295]]]]}},{"type":"Feature","properties":{"name":"Chile"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-68.63401,-52.63637],[-68.63335,-54.8695],[-67.56244,-54.87001],[-66.95992,-54.89681],[-67.29103,-55.30124],[-68.14863,-55.61183],[-68.639991,-55.580018],[-69.2321,-55.49906],[-69.95809,-55.19843],[-71.00568,-55.05383],[-72.2639,-54.49514],[-73.2852,-53.95752],[-74.66253,-52.83749],[-73.8381,-53.04743],[-72.43418,-53.7154],[-71.10773,-54.07433],[-70.59178,-53.61583],[-70.26748,-52.93123],[-69.34565,-52.5183],[-68.63401,-52.63637]]],[[[-69.590424,-17.580012],[-69.100247,-18.260125],[-68.966818,-18.981683],[-68.442225,-19.405068],[-68.757167,-20.372658],[-68.219913,-21.494347],[-67.82818,-22.872919],[-67.106674,-22.735925],[-66.985234,-22.986349],[-67.328443,-24.025303],[-68.417653,-24.518555],[-68.386001,-26.185016],[-68.5948,-26.506909],[-68.295542,-26.89934],[-69.001235,-27.521214],[-69.65613,-28.459141],[-70.01355,-29.367923],[-69.919008,-30.336339],[-70.535069,-31.36501],[-70.074399,-33.09121],[-69.814777,-33.273886],[-69.817309,-34.193571],[-70.388049,-35.169688],[-70.364769,-36.005089],[-71.121881,-36.658124],[-71.118625,-37.576827],[-70.814664,-38.552995],[-71.413517,-38.916022],[-71.680761,-39.808164],[-71.915734,-40.832339],[-71.746804,-42.051386],[-72.148898,-42.254888],[-71.915424,-43.408565],[-71.464056,-43.787611],[-71.793623,-44.207172],[-71.329801,-44.407522],[-71.222779,-44.784243],[-71.659316,-44.973689],[-71.552009,-45.560733],[-71.917258,-46.884838],[-72.447355,-47.738533],[-72.331161,-48.244238],[-72.648247,-48.878618],[-73.415436,-49.318436],[-73.328051,-50.378785],[-72.975747,-50.74145],[-72.309974,-50.67701],[-72.329404,-51.425956],[-71.914804,-52.009022],[-69.498362,-52.142761],[-68.571545,-52.299444],[-69.461284,-52.291951],[-69.94278,-52.537931],[-70.845102,-52.899201],[-71.006332,-53.833252],[-71.429795,-53.856455],[-72.557943,-53.53141],[-73.702757,-52.835069],[-73.702757,-52.83507],[-74.946763,-52.262754],[-75.260026,-51.629355],[-74.976632,-51.043396],[-75.479754,-50.378372],[-75.608015,-48.673773],[-75.18277,-47.711919],[-74.126581,-46.939253],[-75.644395,-46.647643],[-74.692154,-45.763976],[-74.351709,-44.103044],[-73.240356,-44.454961],[-72.717804,-42.383356],[-73.3889,-42.117532],[-73.701336,-43.365776],[-74.331943,-43.224958],[-74.017957,-41.794813],[-73.677099,-39.942213],[-73.217593,-39.258689],[-73.505559,-38.282883],[-73.588061,-37.156285],[-73.166717,-37.12378],[-72.553137,-35.50884],[-71.861732,-33.909093],[-71.43845,-32.418899],[-71.668721,-30.920645],[-71.370083,-30.095682],[-71.489894,-28.861442],[-70.905124,-27.64038],[-70.724954,-25.705924],[-70.403966,-23.628997],[-70.091246,-21.393319],[-70.16442,-19.756468],[-70.372572,-18.347975],[-69.858444,-18.092694],[-69.590424,-17.580012]]]]}},{"type":"Feature","properties":{"name":"Democratic Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":[[[29.339998,-4.499983],[29.519987,-5.419979],[29.419993,-5.939999],[29.620032,-6.520015],[30.199997,-7.079981],[30.740015,-8.340007],[30.74001,-8.340006],[30.346086,-8.238257],[29.002912,-8.407032],[28.734867,-8.526559],[28.449871,-9.164918],[28.673682,-9.605925],[28.49607,-10.789884],[28.372253,-11.793647],[28.642417,-11.971569],[29.341548,-12.360744],[29.616001,-12.178895],[29.699614,-13.257227],[28.934286,-13.248958],[28.523562,-12.698604],[28.155109,-12.272481],[27.388799,-12.132747],[27.16442,-11.608748],[26.553088,-11.92444],[25.75231,-11.784965],[25.418118,-11.330936],[24.78317,-11.238694],[24.314516,-11.262826],[24.257155,-10.951993],[23.912215,-10.926826],[23.456791,-10.867863],[22.837345,-11.017622],[22.402798,-10.993075],[22.155268,-11.084801],[22.208753,-9.894796],[21.875182,-9.523708],[21.801801,-8.908707],[21.949131,-8.305901],[21.746456,-7.920085],[21.728111,-7.290872],[20.514748,-7.299606],[20.601823,-6.939318],[20.091622,-6.94309],[20.037723,-7.116361],[19.417502,-7.155429],[19.166613,-7.738184],[19.016752,-7.988246],[18.464176,-7.847014],[18.134222,-7.987678],[17.47297,-8.068551],[17.089996,-7.545689],[16.860191,-7.222298],[16.57318,-6.622645],[16.326528,-5.87747],[13.375597,-5.864241],[13.024869,-5.984389],[12.735171,-5.965682],[12.322432,-6.100092],[12.182337,-5.789931],[12.436688,-5.684304],[12.468004,-5.248362],[12.631612,-4.991271],[12.995517,-4.781103],[13.25824,-4.882957],[13.600235,-4.500138],[14.144956,-4.510009],[14.209035,-4.793092],[14.582604,-4.970239],[15.170992,-4.343507],[15.75354,-3.855165],[16.00629,-3.535133],[15.972803,-2.712392],[16.407092,-1.740927],[16.865307,-1.225816],[17.523716,-0.74383],[17.638645,-0.424832],[17.663553,-0.058084],[17.82654,0.288923],[17.774192,0.855659],[17.898835,1.741832],[18.094276,2.365722],[18.393792,2.900443],[18.453065,3.504386],[18.542982,4.201785],[18.932312,4.709506],[19.467784,5.031528],[20.290679,4.691678],[20.927591,4.322786],[21.659123,4.224342],[22.405124,4.02916],[22.704124,4.633051],[22.84148,4.710126],[23.297214,4.609693],[24.410531,5.108784],[24.805029,4.897247],[25.128833,4.927245],[25.278798,5.170408],[25.650455,5.256088],[26.402761,5.150875],[27.044065,5.127853],[27.374226,5.233944],[27.979977,4.408413],[28.428994,4.287155],[28.696678,4.455077],[29.159078,4.389267],[29.715995,4.600805],[29.9535,4.173699],[30.833852,3.509172],[30.83386,3.509166],[30.773347,2.339883],[31.174149,2.204465],[30.85267,1.849396],[30.468508,1.583805],[30.086154,1.062313],[29.875779,0.59738],[29.819503,-0.20531],[29.587838,-0.587406],[29.579466,-1.341313],[29.291887,-1.620056],[29.254835,-2.21511],[29.117479,-2.292211],[29.024926,-2.839258],[29.276384,-3.293907],[29.339998,-4.499983]]]}},{"type":"Feature","properties":{"name":"Somalia"},"geometry":{"type":"Polygon","coordinates":[[[41.58513,-1.68325],[40.993,-0.85829],[40.98105,2.78452],[41.855083,3.918912],[42.12861,4.23413],[42.76967,4.25259],[43.66087,4.95755],[44.9636,5.00162],[47.78942,8.003],[48.486736,8.837626],[48.93813,9.451749],[48.938233,9.9735],[48.938491,10.982327],[48.942005,11.394266],[48.948205,11.410617],[48.948205,11.410617],[49.26776,11.43033],[49.72862,11.5789],[50.25878,11.67957],[50.73202,12.0219],[51.1112,12.02464],[51.13387,11.74815],[51.04153,11.16651],[51.04531,10.6409],[50.83418,10.27972],[50.55239,9.19874],[50.07092,8.08173],[49.4527,6.80466],[48.59455,5.33911],[47.74079,4.2194],[46.56476,2.85529],[45.56399,2.04576],[44.06815,1.05283],[43.13597,0.2922],[42.04157,-0.91916],[41.81095,-1.44647],[41.58513,-1.68325]]]}},{"type":"Feature","properties":{"name":"Kenya"},"geometry":{"type":"Polygon","coordinates":[[[39.20222,-4.67677],[37.7669,-3.67712],[37.69869,-3.09699],[34.07262,-1.05982],[33.903711,-0.95],[33.893569,0.109814],[34.18,0.515],[34.6721,1.17694],[35.03599,1.90584],[34.59607,3.05374],[34.47913,3.5556],[34.005,4.249885],[34.620196,4.847123],[35.298007,5.506],[35.817448,5.338232],[35.817448,4.776966],[36.159079,4.447864],[36.855093,4.447864],[38.120915,3.598605],[38.43697,3.58851],[38.67114,3.61607],[38.89251,3.50074],[39.559384,3.42206],[39.85494,3.83879],[40.76848,4.25702],[41.1718,3.91909],[41.855083,3.918912],[40.98105,2.78452],[40.993,-0.85829],[41.58513,-1.68325],[40.88477,-2.08255],[40.63785,-2.49979],[40.26304,-2.57309],[40.12119,-3.27768],[39.80006,-3.68116],[39.60489,-4.34653],[39.20222,-4.67677]]]}},{"type":"Feature","properties":{"name":"Sudan"},"geometry":{"type":"Polygon","coordinates":[[[24.567369,8.229188],[23.805813,8.666319],[23.459013,8.954286],[23.394779,9.265068],[23.55725,9.681218],[23.554304,10.089255],[22.977544,10.714463],[22.864165,11.142395],[22.87622,11.38461],[22.50869,11.67936],[22.49762,12.26024],[22.28801,12.64605],[21.93681,12.58818],[22.03759,12.95546],[22.29658,13.37232],[22.18329,13.78648],[22.51202,14.09318],[22.30351,14.32682],[22.56795,14.94429],[23.02459,15.68072],[23.88689,15.61084],[23.83766,19.58047],[23.85,20],[25,20.00304],[25,22],[29.02,22],[32.9,22],[36.86623,22],[37.18872,21.01885],[36.96941,20.83744],[37.1147,19.80796],[37.48179,18.61409],[37.86276,18.36786],[38.41009,17.998307],[37.904,17.42754],[37.16747,17.26314],[36.85253,16.95655],[36.75389,16.29186],[36.32322,14.82249],[36.42951,14.42211],[36.27022,13.56333],[35.86363,12.57828],[35.26049,12.08286],[34.83163,11.31896],[34.73115,10.91017],[34.25745,10.63009],[33.96162,9.58358],[33.97498,8.68456],[33.963393,9.464285],[33.824963,9.484061],[33.842131,9.981915],[33.721959,10.325262],[33.206938,10.720112],[33.086766,11.441141],[33.206938,12.179338],[32.743419,12.248008],[32.67475,12.024832],[32.073892,11.97333],[32.314235,11.681484],[32.400072,11.080626],[31.850716,10.531271],[31.352862,9.810241],[30.837841,9.707237],[29.996639,10.290927],[29.618957,10.084919],[29.515953,9.793074],[29.000932,9.604232],[28.966597,9.398224],[27.97089,9.398224],[27.833551,9.604232],[27.112521,9.638567],[26.752006,9.466893],[26.477328,9.55273],[25.962307,10.136421],[25.790633,10.411099],[25.069604,10.27376],[24.794926,9.810241],[24.537415,8.917538],[24.194068,8.728696],[23.88698,8.61973],[24.567369,8.229188]]]}},{"type":"Feature","properties":{"name":"Chad"},"geometry":{"type":"Polygon","coordinates":[[[23.83766,19.58047],[23.88689,15.61084],[23.02459,15.68072],[22.56795,14.94429],[22.30351,14.32682],[22.51202,14.09318],[22.18329,13.78648],[22.29658,13.37232],[22.03759,12.95546],[21.93681,12.58818],[22.28801,12.64605],[22.49762,12.26024],[22.50869,11.67936],[22.87622,11.38461],[22.864165,11.142395],[22.231129,10.971889],[21.723822,10.567056],[21.000868,9.475985],[20.059685,9.012706],[19.094008,9.074847],[18.81201,8.982915],[18.911022,8.630895],[18.389555,8.281304],[17.96493,7.890914],[16.705988,7.508328],[16.456185,7.734774],[16.290562,7.754307],[16.106232,7.497088],[15.27946,7.421925],[15.436092,7.692812],[15.120866,8.38215],[14.979996,8.796104],[14.544467,8.965861],[13.954218,9.549495],[14.171466,10.021378],[14.627201,9.920919],[14.909354,9.992129],[15.467873,9.982337],[14.923565,10.891325],[14.960152,11.555574],[14.89336,12.21905],[14.495787,12.859396],[14.595781,13.330427],[13.954477,13.353449],[13.956699,13.996691],[13.540394,14.367134],[13.97217,15.68437],[15.247731,16.627306],[15.300441,17.92795],[15.685741,19.95718],[15.903247,20.387619],[15.487148,20.730415],[15.47106,21.04845],[15.096888,21.308519],[14.8513,22.86295],[15.86085,23.40972],[19.84926,21.49509],[23.83766,19.58047]]]}},{"type":"Feature","properties":{"name":"Haiti"},"geometry":{"type":"Polygon","coordinates":[[[-71.712361,19.714456],[-71.624873,19.169838],[-71.701303,18.785417],[-71.945112,18.6169],[-71.687738,18.31666],[-71.708305,18.044997],[-72.372476,18.214961],[-72.844411,18.145611],[-73.454555,18.217906],[-73.922433,18.030993],[-74.458034,18.34255],[-74.369925,18.664908],[-73.449542,18.526053],[-72.694937,18.445799],[-72.334882,18.668422],[-72.79165,19.101625],[-72.784105,19.483591],[-73.415022,19.639551],[-73.189791,19.915684],[-72.579673,19.871501],[-71.712361,19.714456]]]}},{"type":"Feature","properties":{"name":"Dominican Republic"},"geometry":{"type":"Polygon","coordinates":[[[-71.708305,18.044997],[-71.687738,18.31666],[-71.945112,18.6169],[-71.701303,18.785417],[-71.624873,19.169838],[-71.712361,19.714456],[-71.587304,19.884911],[-70.806706,19.880286],[-70.214365,19.622885],[-69.950815,19.648],[-69.76925,19.293267],[-69.222126,19.313214],[-69.254346,19.015196],[-68.809412,18.979074],[-68.317943,18.612198],[-68.689316,18.205142],[-69.164946,18.422648],[-69.623988,18.380713],[-69.952934,18.428307],[-70.133233,18.245915],[-70.517137,18.184291],[-70.669298,18.426886],[-70.99995,18.283329],[-71.40021,17.598564],[-71.657662,17.757573],[-71.708305,18.044997]]]}},{"type":"Feature","properties":{"name":"Russia"},"geometry":{"type":"MultiPolygon","coordinates":[[[[178.7253,71.0988],[180,71.515714],[180,70.832199],[178.903425,70.78114],[178.7253,71.0988]]],[[[49.10116,46.39933],[48.64541,45.80629],[47.67591,45.64149],[46.68201,44.6092],[47.59094,43.66016],[47.49252,42.98658],[48.58437,41.80888],[48.584353,41.808869],[47.987283,41.405819],[47.815666,41.151416],[47.373315,41.219732],[46.686071,41.827137],[46.404951,41.860675],[45.7764,42.09244],[45.470279,42.502781],[44.537623,42.711993],[43.93121,42.55496],[43.75599,42.74083],[42.3944,43.2203],[40.92219,43.38215],[40.076965,43.553104],[39.955009,43.434998],[38.68,44.28],[37.53912,44.65721],[36.67546,45.24469],[37.40317,45.40451],[38.23295,46.24087],[37.67372,46.63657],[39.14767,47.04475],[39.1212,47.26336],[38.223538,47.10219],[38.255112,47.5464],[38.77057,47.82562],[39.738278,47.898937],[39.89562,48.23241],[39.67465,48.78382],[40.080789,49.30743],[40.06904,49.60105],[38.594988,49.926462],[38.010631,49.915662],[37.39346,50.383953],[36.626168,50.225591],[35.356116,50.577197],[35.37791,50.77394],[35.022183,51.207572],[34.224816,51.255993],[34.141978,51.566413],[34.391731,51.768882],[33.7527,52.335075],[32.715761,52.238465],[32.412058,52.288695],[32.15944,52.06125],[31.785992,52.101678],[31.78597,52.10168],[31.540018,52.742052],[31.305201,53.073996],[31.49764,53.16743],[32.304519,53.132726],[32.693643,53.351421],[32.405599,53.618045],[31.731273,53.794029],[31.791424,53.974639],[31.384472,54.157056],[30.757534,54.811771],[30.971836,55.081548],[30.873909,55.550976],[29.896294,55.789463],[29.371572,55.670091],[29.229513,55.918344],[28.176709,56.16913],[27.855282,56.759326],[27.770016,57.244258],[27.288185,57.474528],[27.716686,57.791899],[27.42015,58.72457],[28.131699,59.300825],[27.98112,59.47537],[27.981127,59.475373],[29.1177,60.02805],[28.070002,60.503519],[28.07,60.50352],[30.211107,61.780028],[31.139991,62.357693],[31.516092,62.867687],[30.035872,63.552814],[30.444685,64.204453],[29.54443,64.948672],[30.21765,65.80598],[29.054589,66.944286],[29.977426,67.698297],[28.445944,68.364613],[28.59193,69.064777],[29.39955,69.15692],[31.101042,69.558101],[31.10108,69.55811],[32.13272,69.90595],[33.77547,69.30142],[36.51396,69.06342],[40.29234,67.9324],[41.05987,67.45713],[41.12595,66.79158],[40.01583,66.26618],[38.38295,65.99953],[33.91871,66.75961],[33.18444,66.63253],[34.81477,65.90015],[34.878574,65.436213],[34.94391,64.41437],[36.23129,64.10945],[37.01273,63.84983],[37.14197,64.33471],[36.539579,64.76446],[37.17604,65.14322],[39.59345,64.52079],[40.4356,64.76446],[39.7626,65.49682],[42.09309,66.47623],[43.01604,66.41858],[43.94975,66.06908],[44.53226,66.75634],[43.69839,67.35245],[44.18795,67.95051],[43.45282,68.57079],[46.25,68.25],[46.82134,67.68997],[45.55517,67.56652],[45.56202,67.01005],[46.34915,66.66767],[47.89416,66.88455],[48.13876,67.52238],[50.22766,67.99867],[53.71743,68.85738],[54.47171,68.80815],[53.48582,68.20131],[54.72628,68.09702],[55.44268,68.43866],[57.31702,68.46628],[58.802,68.88082],[59.94142,68.27844],[61.07784,68.94069],[60.03,69.52],[60.55,69.85],[63.504,69.54739],[64.888115,69.234835],[68.51216,68.09233],[69.18068,68.61563],[68.16444,69.14436],[68.13522,69.35649],[66.93008,69.45461],[67.25976,69.92873],[66.72492,70.70889],[66.69466,71.02897],[68.54006,71.9345],[69.19636,72.84336],[69.94,73.04],[72.58754,72.77629],[72.79603,72.22006],[71.84811,71.40898],[72.47011,71.09019],[72.79188,70.39114],[72.5647,69.02085],[73.66787,68.4079],[73.2387,67.7404],[71.28,66.32],[72.42301,66.17267],[72.82077,66.53267],[73.92099,66.78946],[74.18651,67.28429],[75.052,67.76047],[74.46926,68.32899],[74.93584,68.98918],[73.84236,69.07146],[73.60187,69.62763],[74.3998,70.63175],[73.1011,71.44717],[74.89082,72.12119],[74.65926,72.83227],[75.15801,72.85497],[75.68351,72.30056],[75.28898,71.33556],[76.35911,71.15287],[75.90313,71.87401],[77.57665,72.26717],[79.65202,72.32011],[81.5,71.75],[80.61071,72.58285],[80.51109,73.6482],[82.25,73.85],[84.65526,73.80591],[86.8223,73.93688],[86.00956,74.45967],[87.16682,75.11643],[88.31571,75.14393],[90.26,75.64],[92.90058,75.77333],[93.23421,76.0472],[95.86,76.14],[96.67821,75.91548],[98.92254,76.44689],[100.75967,76.43028],[101.03532,76.86189],[101.99084,77.28754],[104.3516,77.69792],[106.06664,77.37389],[104.705,77.1274],[106.97013,76.97419],[107.24,76.48],[108.1538,76.72335],[111.07726,76.71],[113.33151,76.22224],[114.13417,75.84764],[113.88539,75.32779],[112.77918,75.03186],[110.15125,74.47673],[109.4,74.18],[110.64,74.04],[112.11919,73.78774],[113.01954,73.97693],[113.52958,73.33505],[113.96881,73.59488],[115.56782,73.75285],[118.77633,73.58772],[119.02,73.12],[123.20066,72.97122],[123.25777,73.73503],[125.38,73.56],[126.97644,73.56549],[128.59126,73.03871],[129.05157,72.39872],[128.46,71.98],[129.71599,71.19304],[131.28858,70.78699],[132.2535,71.8363],[133.85766,71.38642],[135.56193,71.65525],[137.49755,71.34763],[138.23409,71.62803],[139.86983,71.48783],[139.14791,72.41619],[140.46817,72.84941],[149.5,72.2],[150.35118,71.60643],[152.9689,70.84222],[157.00688,71.03141],[158.99779,70.86672],[159.83031,70.45324],[159.70866,69.72198],[160.94053,69.43728],[162.27907,69.64204],[164.05248,69.66823],[165.94037,69.47199],[167.83567,69.58269],[169.57763,68.6938],[170.81688,69.01363],[170.0082,69.65276],[170.45345,70.09703],[173.64391,69.81743],[175.72403,69.87725],[178.6,69.4],[180,68.963636],[180,64.979709],[179.99281,64.97433],[178.7072,64.53493],[177.41128,64.60821],[178.313,64.07593],[178.90825,63.25197],[179.37034,62.98262],[179.48636,62.56894],[179.22825,62.3041],[177.3643,62.5219],[174.56929,61.76915],[173.68013,61.65261],[172.15,60.95],[170.6985,60.33618],[170.33085,59.88177],[168.90046,60.57355],[166.29498,59.78855],[165.84,60.16],[164.87674,59.7316],[163.53929,59.86871],[163.21711,59.21101],[162.01733,58.24328],[162.05297,57.83912],[163.19191,57.61503],[163.05794,56.15924],[162.12958,56.12219],[161.70146,55.28568],[162.11749,54.85514],[160.36877,54.34433],[160.02173,53.20257],[158.53094,52.95868],[158.23118,51.94269],[156.78979,51.01105],[156.42,51.7],[155.99182,53.15895],[155.43366,55.38103],[155.91442,56.76792],[156.75815,57.3647],[156.81035,57.83204],[158.36433,58.05575],[160.15064,59.31477],[161.87204,60.343],[163.66969,61.1409],[164.47355,62.55061],[163.25842,62.46627],[162.65791,61.6425],[160.12148,60.54423],[159.30232,61.77396],[156.72068,61.43442],[154.21806,59.75818],[155.04375,59.14495],[152.81185,58.88385],[151.26573,58.78089],[151.33815,59.50396],[149.78371,59.65573],[148.54481,59.16448],[145.48722,59.33637],[142.19782,59.03998],[138.95848,57.08805],[135.12619,54.72959],[136.70171,54.60355],[137.19342,53.97732],[138.1647,53.75501],[138.80463,54.25455],[139.90151,54.18968],[141.34531,53.08957],[141.37923,52.23877],[140.59742,51.23967],[140.51308,50.04553],[140.06193,48.44671],[138.55472,46.99965],[138.21971,46.30795],[136.86232,45.1435],[135.51535,43.989],[134.86939,43.39821],[133.53687,42.81147],[132.90627,42.79849],[132.27807,43.28456],[130.93587,42.55274],[130.780005,42.22001],[130.780004,42.220008],[130.78,42.22],[130.779992,42.22001],[130.64,42.395],[130.64,42.395024],[130.633866,42.903015],[131.144688,42.92999],[131.288555,44.11152],[131.02519,44.96796],[131.883454,45.321162],[133.09712,45.14409],[133.769644,46.116927],[134.11235,47.21248],[134.50081,47.57845],[135.026311,48.47823],[133.373596,48.183442],[132.50669,47.78896],[130.98726,47.79013],[130.582293,48.729687],[129.397818,49.4406],[127.6574,49.76027],[127.287456,50.739797],[126.939157,51.353894],[126.564399,51.784255],[125.946349,52.792799],[125.068211,53.161045],[123.57147,53.4588],[122.245748,53.431726],[121.003085,53.251401],[120.177089,52.753886],[120.725789,52.516226],[120.7382,51.96411],[120.18208,51.64355],[119.27939,50.58292],[119.288461,50.142883],[117.879244,49.510983],[116.678801,49.888531],[115.485695,49.805177],[114.96211,50.140247],[114.362456,50.248303],[112.89774,49.543565],[111.581231,49.377968],[110.662011,49.130128],[109.402449,49.292961],[108.475167,49.282548],[107.868176,49.793705],[106.888804,50.274296],[105.886591,50.406019],[104.62158,50.27532],[103.676545,50.089966],[102.25589,50.51056],[102.06521,51.25991],[100.88948,51.516856],[99.981732,51.634006],[98.861491,52.047366],[97.82574,51.010995],[98.231762,50.422401],[97.25976,49.72605],[95.81402,49.97746],[94.815949,50.013433],[94.147566,50.480537],[93.10421,50.49529],[92.234712,50.802171],[90.713667,50.331812],[88.805567,49.470521],[87.751264,49.297198],[87.35997,49.214981],[86.829357,49.826675],[85.54127,49.692859],[85.11556,50.117303],[84.416377,50.3114],[83.935115,50.889246],[83.383004,51.069183],[81.945986,50.812196],[80.568447,51.388336],[80.03556,50.864751],[77.800916,53.404415],[76.525179,54.177003],[76.8911,54.490524],[74.38482,53.54685],[73.425679,53.48981],[73.508516,54.035617],[72.22415,54.376655],[71.180131,54.133285],[70.865267,55.169734],[69.068167,55.38525],[68.1691,54.970392],[65.66687,54.60125],[65.178534,54.354228],[61.4366,54.00625],[60.978066,53.664993],[61.699986,52.979996],[60.739993,52.719986],[60.927269,52.447548],[59.967534,51.96042],[61.588003,51.272659],[61.337424,50.79907],[59.932807,50.842194],[59.642282,50.545442],[58.36332,51.06364],[56.77798,51.04355],[55.71694,50.62171],[54.532878,51.02624],[52.328724,51.718652],[50.766648,51.692762],[48.702382,50.605128],[48.577841,49.87476],[47.54948,50.454698],[46.751596,49.356006],[47.043672,49.152039],[46.466446,48.394152],[47.31524,47.71585],[48.05725,47.74377],[48.694734,47.075628],[48.59325,46.56104],[49.10116,46.39933]]],[[[93.77766,81.0246],[95.940895,81.2504],[97.88385,80.746975],[100.186655,79.780135],[99.93976,78.88094],[97.75794,78.7562],[94.97259,79.044745],[93.31288,79.4265],[92.5454,80.14379],[91.18107,80.34146],[93.77766,81.0246]]],[[[102.837815,79.28129],[105.37243,78.71334],[105.07547,78.30689],[99.43814,77.921],[101.2649,79.23399],[102.08635,79.34641],[102.837815,79.28129]]],[[[138.831075,76.13676],[141.471615,76.09289],[145.086285,75.562625],[144.3,74.82],[140.61381,74.84768],[138.95544,74.61148],[136.97439,75.26167],[137.51176,75.94917],[138.831075,76.13676]]],[[[148.22223,75.345845],[150.73167,75.08406],[149.575925,74.68892],[147.977465,74.778355],[146.11919,75.17298],[146.358485,75.49682],[148.22223,75.345845]]],[[[139.86312,73.36983],[140.81171,73.76506],[142.06207,73.85758],[143.48283,73.47525],[143.60385,73.21244],[142.08763,73.20544],[140.038155,73.31692],[139.86312,73.36983]]],[[[44.846958,80.58981],[46.799139,80.771918],[48.318477,80.78401],[48.522806,80.514569],[49.09719,80.753986],[50.039768,80.918885],[51.522933,80.699726],[51.136187,80.54728],[49.793685,80.415428],[48.894411,80.339567],[48.754937,80.175468],[47.586119,80.010181],[46.502826,80.247247],[47.072455,80.559424],[44.846958,80.58981]]],[[[22.731099,54.327537],[20.892245,54.312525],[19.66064,54.426084],[19.888481,54.86616],[21.268449,55.190482],[22.315724,55.015299],[22.757764,54.856574],[22.651052,54.582741],[22.731099,54.327537]]],[[[53.50829,73.749814],[55.902459,74.627486],[55.631933,75.081412],[57.868644,75.60939],[61.170044,76.251883],[64.498368,76.439055],[66.210977,76.809782],[68.15706,76.939697],[68.852211,76.544811],[68.180573,76.233642],[64.637326,75.737755],[61.583508,75.260885],[58.477082,74.309056],[56.986786,73.333044],[55.419336,72.371268],[55.622838,71.540595],[57.535693,70.720464],[56.944979,70.632743],[53.677375,70.762658],[53.412017,71.206662],[51.601895,71.474759],[51.455754,72.014881],[52.478275,72.229442],[52.444169,72.774731],[54.427614,73.627548],[53.50829,73.749814]]],[[[142.914616,53.704578],[143.260848,52.74076],[143.235268,51.75666],[143.648007,50.7476],[144.654148,48.976391],[143.173928,49.306551],[142.558668,47.861575],[143.533492,46.836728],[143.505277,46.137908],[142.747701,46.740765],[142.09203,45.966755],[141.906925,46.805929],[142.018443,47.780133],[141.904445,48.859189],[142.1358,49.615163],[142.179983,50.952342],[141.594076,51.935435],[141.682546,53.301966],[142.606934,53.762145],[142.209749,54.225476],[142.654786,54.365881],[142.914616,53.704578]]],[[[-174.92825,67.20589],[-175.01425,66.58435],[-174.33983,66.33556],[-174.57182,67.06219],[-171.85731,66.91308],[-169.89958,65.97724],[-170.89107,65.54139],[-172.53025,65.43791],[-172.555,64.46079],[-172.95533,64.25269],[-173.89184,64.2826],[-174.65392,64.63125],[-175.98353,64.92288],[-176.20716,65.35667],[-177.22266,65.52024],[-178.35993,65.39052],[-178.90332,65.74044],[-178.68611,66.11211],[-179.88377,65.87456],[-179.43268,65.40411],[-180,64.979709],[-180,68.963636],[-177.55,68.2],[-174.92825,67.20589]]],[[[-178.69378,70.89302],[-180,70.832199],[-180,71.515714],[-179.871875,71.55762],[-179.02433,71.55553],[-177.577945,71.26948],[-177.663575,71.13277],[-178.69378,70.89302]]],[[[33.435988,45.971917],[33.699462,46.219573],[34.410402,46.005162],[34.732017,45.965666],[34.861792,45.768182],[35.012659,45.737725],[35.020788,45.651219],[35.510009,45.409993],[36.529998,45.46999],[36.334713,45.113216],[35.239999,44.939996],[33.882511,44.361479],[33.326421,44.564877],[33.546924,45.034771],[32.454174,45.327466],[32.630804,45.519186],[33.588162,45.851569],[33.435988,45.971917]]]]}},{"type":"Feature","properties":{"name":"The Bahamas"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-78.98,26.79],[-78.51,26.87],[-77.85,26.84],[-77.82,26.58],[-78.91,26.42],[-78.98,26.79]]],[[[-77.79,27.04],[-77,26.59],[-77.17255,25.87918],[-77.35641,26.00735],[-77.34,26.53],[-77.78802,26.92516],[-77.79,27.04]]],[[[-78.19087,25.2103],[-77.89,25.17],[-77.54,24.34],[-77.53466,23.75975],[-77.78,23.71],[-78.03405,24.28615],[-78.40848,24.57564],[-78.19087,25.2103]]]]}},{"type":"Feature","properties":{"name":"Falkland Islands"},"geometry":{"type":"Polygon","coordinates":[[[-61.2,-51.85],[-60,-51.25],[-59.15,-51.5],[-58.55,-51.1],[-57.75,-51.55],[-58.05,-51.9],[-59.4,-52.2],[-59.85,-51.85],[-60.7,-52.3],[-61.2,-51.85]]]}},{"type":"Feature","properties":{"name":"Norway"},"geometry":{"type":"MultiPolygon","coordinates":[[[[15.14282,79.67431],[15.52255,80.01608],[16.99085,80.05086],[18.25183,79.70175],[21.54383,78.95611],[19.02737,78.5626],[18.47172,77.82669],[17.59441,77.63796],[17.1182,76.80941],[15.91315,76.77045],[13.76259,77.38035],[14.66956,77.73565],[13.1706,78.02493],[11.22231,78.8693],[10.44453,79.65239],[13.17077,80.01046],[13.71852,79.66039],[15.14282,79.67431]]],[[[31.101042,69.558101],[29.39955,69.15692],[28.59193,69.064777],[29.015573,69.766491],[27.732292,70.164193],[26.179622,69.825299],[25.689213,69.092114],[24.735679,68.649557],[23.66205,68.891247],[22.356238,68.841741],[21.244936,69.370443],[20.645593,69.106247],[20.025269,69.065139],[19.87856,68.407194],[17.993868,68.567391],[17.729182,68.010552],[16.768879,68.013937],[16.108712,67.302456],[15.108411,66.193867],[13.55569,64.787028],[13.919905,64.445421],[13.571916,64.049114],[12.579935,64.066219],[11.930569,63.128318],[11.992064,61.800362],[12.631147,61.293572],[12.300366,60.117933],[11.468272,59.432393],[11.027369,58.856149],[10.356557,59.469807],[8.382,58.313288],[7.048748,58.078884],[5.665835,58.588155],[5.308234,59.663232],[4.992078,61.970998],[5.9129,62.614473],[8.553411,63.454008],[10.527709,64.486038],[12.358347,65.879726],[14.761146,67.810642],[16.435927,68.563205],[19.184028,69.817444],[21.378416,70.255169],[23.023742,70.202072],[24.546543,71.030497],[26.37005,70.986262],[28.165547,71.185474],[31.293418,70.453788],[30.005435,70.186259],[31.101042,69.558101]]],[[[27.407506,80.056406],[25.924651,79.517834],[23.024466,79.400012],[20.075188,79.566823],[19.897266,79.842362],[18.462264,79.85988],[17.368015,80.318896],[20.455992,80.598156],[21.907945,80.357679],[22.919253,80.657144],[25.447625,80.40734],[27.407506,80.056406]]],[[[24.72412,77.85385],[22.49032,77.44493],[20.72601,77.67704],[21.41611,77.93504],[20.8119,78.25463],[22.88426,78.45494],[23.28134,78.07954],[24.72412,77.85385]]]]}},{"type":"Feature","properties":{"name":"Greenland"},"geometry":{"type":"Polygon","coordinates":[[[-46.76379,82.62796],[-43.40644,83.22516],[-39.89753,83.18018],[-38.62214,83.54905],[-35.08787,83.64513],[-27.10046,83.51966],[-20.84539,82.72669],[-22.69182,82.34165],[-26.51753,82.29765],[-31.9,82.2],[-31.39646,82.02154],[-27.85666,82.13178],[-24.84448,81.78697],[-22.90328,82.09317],[-22.07175,81.73449],[-23.16961,81.15271],[-20.62363,81.52462],[-15.76818,81.91245],[-12.77018,81.71885],[-12.20855,81.29154],[-16.28533,80.58004],[-16.85,80.35],[-20.04624,80.17708],[-17.73035,80.12912],[-18.9,79.4],[-19.70499,78.75128],[-19.67353,77.63859],[-18.47285,76.98565],[-20.03503,76.94434],[-21.67944,76.62795],[-19.83407,76.09808],[-19.59896,75.24838],[-20.66818,75.15585],[-19.37281,74.29561],[-21.59422,74.22382],[-20.43454,73.81713],[-20.76234,73.46436],[-22.17221,73.30955],[-23.56593,73.30663],[-22.31311,72.62928],[-22.29954,72.18409],[-24.27834,72.59788],[-24.79296,72.3302],[-23.44296,72.08016],[-22.13281,71.46898],[-21.75356,70.66369],[-23.53603,70.471],[-24.30702,70.85649],[-25.54341,71.43094],[-25.20135,70.75226],[-26.36276,70.22646],[-23.72742,70.18401],[-22.34902,70.12946],[-25.02927,69.2588],[-27.74737,68.47046],[-30.67371,68.12503],[-31.77665,68.12078],[-32.81105,67.73547],[-34.20196,66.67974],[-36.35284,65.9789],[-37.04378,65.93768],[-38.37505,65.69213],[-39.81222,65.45848],[-40.66899,64.83997],[-40.68281,64.13902],[-41.1887,63.48246],[-42.81938,62.68233],[-42.41666,61.90093],[-42.86619,61.07404],[-43.3784,60.09772],[-44.7875,60.03676],[-46.26364,60.85328],[-48.26294,60.85843],[-49.23308,61.40681],[-49.90039,62.38336],[-51.63325,63.62691],[-52.14014,64.27842],[-52.27659,65.1767],[-53.66166,66.09957],[-53.30161,66.8365],[-53.96911,67.18899],[-52.9804,68.35759],[-51.47536,68.72958],[-51.08041,69.14781],[-50.87122,69.9291],[-52.013585,69.574925],[-52.55792,69.42616],[-53.45629,69.283625],[-54.68336,69.61003],[-54.75001,70.28932],[-54.35884,70.821315],[-53.431315,70.835755],[-51.39014,70.56978],[-53.10937,71.20485],[-54.00422,71.54719],[-55,71.406537],[-55.83468,71.65444],[-54.71819,72.58625],[-55.32634,72.95861],[-56.12003,73.64977],[-57.32363,74.71026],[-58.59679,75.09861],[-58.58516,75.51727],[-61.26861,76.10238],[-63.39165,76.1752],[-66.06427,76.13486],[-68.50438,76.06141],[-69.66485,76.37975],[-71.40257,77.00857],[-68.77671,77.32312],[-66.76397,77.37595],[-71.04293,77.63595],[-73.297,78.04419],[-73.15938,78.43271],[-69.37345,78.91388],[-65.7107,79.39436],[-65.3239,79.75814],[-68.02298,80.11721],[-67.15129,80.51582],[-63.68925,81.21396],[-62.23444,81.3211],[-62.65116,81.77042],[-60.28249,82.03363],[-57.20744,82.19074],[-54.13442,82.19962],[-53.04328,81.88833],[-50.39061,82.43883],[-48.00386,82.06481],[-46.59984,81.985945],[-44.523,81.6607],[-46.9007,82.19979],[-46.76379,82.62796]]]}},{"type":"Feature","properties":{"name":"French Southern and Antarctic Lands"},"geometry":{"type":"Polygon","coordinates":[[[68.935,-48.625],[69.58,-48.94],[70.525,-49.065],[70.56,-49.255],[70.28,-49.71],[68.745,-49.775],[68.72,-49.2425],[68.8675,-48.83],[68.935,-48.625]]]}},{"type":"Feature","properties":{"name":"East Timor"},"geometry":{"type":"Polygon","coordinates":[[[124.968682,-8.89279],[125.086246,-8.656887],[125.947072,-8.432095],[126.644704,-8.398247],[126.957243,-8.273345],[127.335928,-8.397317],[126.967992,-8.668256],[125.925885,-9.106007],[125.08852,-9.393173],[125.07002,-9.089987],[124.968682,-8.89279]]]}},{"type":"Feature","properties":{"name":"South Africa"},"geometry":{"type":"Polygon","coordinates":[[[16.344977,-28.576705],[16.824017,-28.082162],[17.218929,-28.355943],[17.387497,-28.783514],[17.836152,-28.856378],[18.464899,-29.045462],[19.002127,-28.972443],[19.894734,-28.461105],[19.895768,-24.76779],[20.165726,-24.917962],[20.758609,-25.868136],[20.66647,-26.477453],[20.889609,-26.828543],[21.605896,-26.726534],[22.105969,-26.280256],[22.579532,-25.979448],[22.824271,-25.500459],[23.312097,-25.26869],[23.73357,-25.390129],[24.211267,-25.670216],[25.025171,-25.71967],[25.664666,-25.486816],[25.765849,-25.174845],[25.941652,-24.696373],[26.485753,-24.616327],[26.786407,-24.240691],[27.11941,-23.574323],[28.017236,-22.827754],[29.432188,-22.091313],[29.839037,-22.102216],[30.322883,-22.271612],[30.659865,-22.151567],[31.191409,-22.25151],[31.670398,-23.658969],[31.930589,-24.369417],[31.752408,-25.484284],[31.837778,-25.843332],[31.333158,-25.660191],[31.04408,-25.731452],[30.949667,-26.022649],[30.676609,-26.398078],[30.685962,-26.743845],[31.282773,-27.285879],[31.86806,-27.177927],[32.071665,-26.73382],[32.83012,-26.742192],[32.580265,-27.470158],[32.462133,-28.301011],[32.203389,-28.752405],[31.521001,-29.257387],[31.325561,-29.401978],[30.901763,-29.909957],[30.622813,-30.423776],[30.055716,-31.140269],[28.925553,-32.172041],[28.219756,-32.771953],[27.464608,-33.226964],[26.419452,-33.61495],[25.909664,-33.66704],[25.780628,-33.944646],[25.172862,-33.796851],[24.677853,-33.987176],[23.594043,-33.794474],[22.988189,-33.916431],[22.574157,-33.864083],[21.542799,-34.258839],[20.689053,-34.417175],[20.071261,-34.795137],[19.616405,-34.819166],[19.193278,-34.462599],[18.855315,-34.444306],[18.424643,-33.997873],[18.377411,-34.136521],[18.244499,-33.867752],[18.25008,-33.281431],[17.92519,-32.611291],[18.24791,-32.429131],[18.221762,-31.661633],[17.566918,-30.725721],[17.064416,-29.878641],[17.062918,-29.875954],[16.344977,-28.576705]],[[28.978263,-28.955597],[28.5417,-28.647502],[28.074338,-28.851469],[27.532511,-29.242711],[26.999262,-29.875954],[27.749397,-30.645106],[28.107205,-30.545732],[28.291069,-30.226217],[28.8484,-30.070051],[29.018415,-29.743766],[29.325166,-29.257387],[28.978263,-28.955597]]]}},{"type":"Feature","properties":{"name":"Lesotho"},"geometry":{"type":"Polygon","coordinates":[[[28.978263,-28.955597],[29.325166,-29.257387],[29.018415,-29.743766],[28.8484,-30.070051],[28.291069,-30.226217],[28.107205,-30.545732],[27.749397,-30.645106],[26.999262,-29.875954],[27.532511,-29.242711],[28.074338,-28.851469],[28.5417,-28.647502],[28.978263,-28.955597]]]}},{"type":"Feature","properties":{"name":"Mexico"},"geometry":{"type":"Polygon","coordinates":[[[-117.12776,32.53534],[-115.99135,32.61239],[-114.72139,32.72083],[-114.815,32.52528],[-113.30498,32.03914],[-111.02361,31.33472],[-109.035,31.34194],[-108.24194,31.34222],[-108.24,31.754854],[-106.50759,31.75452],[-106.1429,31.39995],[-105.63159,31.08383],[-105.03737,30.64402],[-104.70575,30.12173],[-104.45697,29.57196],[-103.94,29.27],[-103.11,28.97],[-102.48,29.76],[-101.6624,29.7793],[-100.9576,29.38071],[-100.45584,28.69612],[-100.11,28.11],[-99.52,27.54],[-99.3,26.84],[-99.02,26.37],[-98.24,26.06],[-97.53,25.84],[-97.140008,25.869997],[-97.528072,24.992144],[-97.702946,24.272343],[-97.776042,22.93258],[-97.872367,22.444212],[-97.699044,21.898689],[-97.38896,21.411019],[-97.189333,20.635433],[-96.525576,19.890931],[-96.292127,19.320371],[-95.900885,18.828024],[-94.839063,18.562717],[-94.42573,18.144371],[-93.548651,18.423837],[-92.786114,18.524839],[-92.037348,18.704569],[-91.407903,18.876083],[-90.77187,19.28412],[-90.53359,19.867418],[-90.451476,20.707522],[-90.278618,20.999855],[-89.601321,21.261726],[-88.543866,21.493675],[-87.658417,21.458846],[-87.05189,21.543543],[-86.811982,21.331515],[-86.845908,20.849865],[-87.383291,20.255405],[-87.621054,19.646553],[-87.43675,19.472403],[-87.58656,19.04013],[-87.837191,18.259816],[-88.090664,18.516648],[-88.300031,18.499982],[-88.490123,18.486831],[-88.848344,17.883198],[-89.029857,18.001511],[-89.150909,17.955468],[-89.14308,17.808319],[-90.067934,17.819326],[-91.00152,17.817595],[-91.002269,17.254658],[-91.453921,17.252177],[-91.08167,16.918477],[-90.711822,16.687483],[-90.600847,16.470778],[-90.438867,16.41011],[-90.464473,16.069562],[-91.74796,16.066565],[-92.229249,15.251447],[-92.087216,15.064585],[-92.20323,14.830103],[-92.22775,14.538829],[-93.359464,15.61543],[-93.875169,15.940164],[-94.691656,16.200975],[-95.250227,16.128318],[-96.053382,15.752088],[-96.557434,15.653515],[-97.263592,15.917065],[-98.01303,16.107312],[-98.947676,16.566043],[-99.697397,16.706164],[-100.829499,17.171071],[-101.666089,17.649026],[-101.918528,17.91609],[-102.478132,17.975751],[-103.50099,18.292295],[-103.917527,18.748572],[-104.99201,19.316134],[-105.493038,19.946767],[-105.731396,20.434102],[-105.397773,20.531719],[-105.500661,20.816895],[-105.270752,21.076285],[-105.265817,21.422104],[-105.603161,21.871146],[-105.693414,22.26908],[-106.028716,22.773752],[-106.90998,23.767774],[-107.915449,24.548915],[-108.401905,25.172314],[-109.260199,25.580609],[-109.444089,25.824884],[-109.291644,26.442934],[-109.801458,26.676176],[-110.391732,27.162115],[-110.641019,27.859876],[-111.178919,27.941241],[-111.759607,28.467953],[-112.228235,28.954409],[-112.271824,29.266844],[-112.809594,30.021114],[-113.163811,30.786881],[-113.148669,31.170966],[-113.871881,31.567608],[-114.205737,31.524045],[-114.776451,31.799532],[-114.9367,31.393485],[-114.771232,30.913617],[-114.673899,30.162681],[-114.330974,29.750432],[-113.588875,29.061611],[-113.424053,28.826174],[-113.271969,28.754783],[-113.140039,28.411289],[-112.962298,28.42519],[-112.761587,27.780217],[-112.457911,27.525814],[-112.244952,27.171727],[-111.616489,26.662817],[-111.284675,25.73259],[-110.987819,25.294606],[-110.710007,24.826004],[-110.655049,24.298595],[-110.172856,24.265548],[-109.771847,23.811183],[-109.409104,23.364672],[-109.433392,23.185588],[-109.854219,22.818272],[-110.031392,22.823078],[-110.295071,23.430973],[-110.949501,24.000964],[-111.670568,24.484423],[-112.182036,24.738413],[-112.148989,25.470125],[-112.300711,26.012004],[-112.777297,26.32196],[-113.464671,26.768186],[-113.59673,26.63946],[-113.848937,26.900064],[-114.465747,27.14209],[-115.055142,27.722727],[-114.982253,27.7982],[-114.570366,27.741485],[-114.199329,28.115003],[-114.162018,28.566112],[-114.931842,29.279479],[-115.518654,29.556362],[-115.887365,30.180794],[-116.25835,30.836464],[-116.721526,31.635744],[-117.12776,32.53534]]]}},{"type":"Feature","properties":{"name":"Uruguay"},"geometry":{"type":"Polygon","coordinates":[[[-57.625133,-30.216295],[-56.976026,-30.109686],[-55.973245,-30.883076],[-55.60151,-30.853879],[-54.572452,-31.494511],[-53.787952,-32.047243],[-53.209589,-32.727666],[-53.650544,-33.202004],[-53.373662,-33.768378],[-53.806426,-34.396815],[-54.935866,-34.952647],[-55.67409,-34.752659],[-56.215297,-34.859836],[-57.139685,-34.430456],[-57.817861,-34.462547],[-58.427074,-33.909454],[-58.349611,-33.263189],[-58.132648,-33.040567],[-58.14244,-32.044504],[-57.874937,-31.016556],[-57.625133,-30.216295]]]}},{"type":"Feature","properties":{"name":"Brazil"},"geometry":{"type":"Polygon","coordinates":[[[-53.373662,-33.768378],[-53.650544,-33.202004],[-53.209589,-32.727666],[-53.787952,-32.047243],[-54.572452,-31.494511],[-55.60151,-30.853879],[-55.973245,-30.883076],[-56.976026,-30.109686],[-57.625133,-30.216295],[-56.2909,-28.852761],[-55.162286,-27.881915],[-54.490725,-27.474757],[-53.648735,-26.923473],[-53.628349,-26.124865],[-54.13005,-25.547639],[-54.625291,-25.739255],[-54.428946,-25.162185],[-54.293476,-24.5708],[-54.29296,-24.021014],[-54.652834,-23.839578],[-55.027902,-24.001274],[-55.400747,-23.956935],[-55.517639,-23.571998],[-55.610683,-22.655619],[-55.797958,-22.35693],[-56.473317,-22.0863],[-56.88151,-22.282154],[-57.937156,-22.090176],[-57.870674,-20.732688],[-58.166392,-20.176701],[-57.853802,-19.969995],[-57.949997,-19.400004],[-57.676009,-18.96184],[-57.498371,-18.174188],[-57.734558,-17.552468],[-58.280804,-17.27171],[-58.388058,-16.877109],[-58.24122,-16.299573],[-60.15839,-16.258284],[-60.542966,-15.09391],[-60.251149,-15.077219],[-60.264326,-14.645979],[-60.459198,-14.354007],[-60.503304,-13.775955],[-61.084121,-13.479384],[-61.713204,-13.489202],[-62.127081,-13.198781],[-62.80306,-13.000653],[-63.196499,-12.627033],[-64.316353,-12.461978],[-65.402281,-11.56627],[-65.321899,-10.895872],[-65.444837,-10.511451],[-65.338435,-9.761988],[-66.646908,-9.931331],[-67.173801,-10.306812],[-68.048192,-10.712059],[-68.271254,-11.014521],[-68.786158,-11.03638],[-69.529678,-10.951734],[-70.093752,-11.123972],[-70.548686,-11.009147],[-70.481894,-9.490118],[-71.302412,-10.079436],[-72.184891,-10.053598],[-72.563033,-9.520194],[-73.226713,-9.462213],[-73.015383,-9.032833],[-73.571059,-8.424447],[-73.987235,-7.52383],[-73.723401,-7.340999],[-73.724487,-6.918595],[-73.120027,-6.629931],[-73.219711,-6.089189],[-72.964507,-5.741251],[-72.891928,-5.274561],[-71.748406,-4.593983],[-70.928843,-4.401591],[-70.794769,-4.251265],[-69.893635,-4.298187],[-69.444102,-1.556287],[-69.420486,-1.122619],[-69.577065,-0.549992],[-70.020656,-0.185156],[-70.015566,0.541414],[-69.452396,0.706159],[-69.252434,0.602651],[-69.218638,0.985677],[-69.804597,1.089081],[-69.816973,1.714805],[-67.868565,1.692455],[-67.53781,2.037163],[-67.259998,1.719999],[-67.065048,1.130112],[-66.876326,1.253361],[-66.325765,0.724452],[-65.548267,0.789254],[-65.354713,1.095282],[-64.611012,1.328731],[-64.199306,1.492855],[-64.083085,1.916369],[-63.368788,2.2009],[-63.422867,2.411068],[-64.269999,2.497006],[-64.408828,3.126786],[-64.368494,3.79721],[-64.816064,4.056445],[-64.628659,4.148481],[-63.888343,4.02053],[-63.093198,3.770571],[-62.804533,4.006965],[-62.08543,4.162124],[-60.966893,4.536468],[-60.601179,4.918098],[-60.733574,5.200277],[-60.213683,5.244486],[-59.980959,5.014061],[-60.111002,4.574967],[-59.767406,4.423503],[-59.53804,3.958803],[-59.815413,3.606499],[-59.974525,2.755233],[-59.718546,2.24963],[-59.646044,1.786894],[-59.030862,1.317698],[-58.540013,1.268088],[-58.429477,1.463942],[-58.11345,1.507195],[-57.660971,1.682585],[-57.335823,1.948538],[-56.782704,1.863711],[-56.539386,1.899523],[-55.995698,1.817667],[-55.9056,2.021996],[-56.073342,2.220795],[-55.973322,2.510364],[-55.569755,2.421506],[-55.097587,2.523748],[-54.524754,2.311849],[-54.088063,2.105557],[-53.778521,2.376703],[-53.554839,2.334897],[-53.418465,2.053389],[-52.939657,2.124858],[-52.556425,2.504705],[-52.249338,3.241094],[-51.657797,4.156232],[-51.317146,4.203491],[-51.069771,3.650398],[-50.508875,1.901564],[-49.974076,1.736483],[-49.947101,1.04619],[-50.699251,0.222984],[-50.388211,-0.078445],[-48.620567,-0.235489],[-48.584497,-1.237805],[-47.824956,-0.581618],[-46.566584,-0.941028],[-44.905703,-1.55174],[-44.417619,-2.13775],[-44.581589,-2.691308],[-43.418791,-2.38311],[-41.472657,-2.912018],[-39.978665,-2.873054],[-38.500383,-3.700652],[-37.223252,-4.820946],[-36.452937,-5.109404],[-35.597796,-5.149504],[-35.235389,-5.464937],[-34.89603,-6.738193],[-34.729993,-7.343221],[-35.128212,-8.996401],[-35.636967,-9.649282],[-37.046519,-11.040721],[-37.683612,-12.171195],[-38.423877,-13.038119],[-38.673887,-13.057652],[-38.953276,-13.79337],[-38.882298,-15.667054],[-39.161092,-17.208407],[-39.267339,-17.867746],[-39.583521,-18.262296],[-39.760823,-19.599113],[-40.774741,-20.904512],[-40.944756,-21.937317],[-41.754164,-22.370676],[-41.988284,-22.97007],[-43.074704,-22.967693],[-44.647812,-23.351959],[-45.352136,-23.796842],[-46.472093,-24.088969],[-47.648972,-24.885199],[-48.495458,-25.877025],[-48.641005,-26.623698],[-48.474736,-27.175912],[-48.66152,-28.186135],[-48.888457,-28.674115],[-49.587329,-29.224469],[-50.696874,-30.984465],[-51.576226,-31.777698],[-52.256081,-32.24537],[-52.7121,-33.196578],[-53.373662,-33.768378]]]}},{"type":"Feature","properties":{"name":"Bolivia"},"geometry":{"type":"Polygon","coordinates":[[[-69.529678,-10.951734],[-68.786158,-11.03638],[-68.271254,-11.014521],[-68.048192,-10.712059],[-67.173801,-10.306812],[-66.646908,-9.931331],[-65.338435,-9.761988],[-65.444837,-10.511451],[-65.321899,-10.895872],[-65.402281,-11.56627],[-64.316353,-12.461978],[-63.196499,-12.627033],[-62.80306,-13.000653],[-62.127081,-13.198781],[-61.713204,-13.489202],[-61.084121,-13.479384],[-60.503304,-13.775955],[-60.459198,-14.354007],[-60.264326,-14.645979],[-60.251149,-15.077219],[-60.542966,-15.09391],[-60.15839,-16.258284],[-58.24122,-16.299573],[-58.388058,-16.877109],[-58.280804,-17.27171],[-57.734558,-17.552468],[-57.498371,-18.174188],[-57.676009,-18.96184],[-57.949997,-19.400004],[-57.853802,-19.969995],[-58.166392,-20.176701],[-58.183471,-19.868399],[-59.115042,-19.356906],[-60.043565,-19.342747],[-61.786326,-19.633737],[-62.265961,-20.513735],[-62.291179,-21.051635],[-62.685057,-22.249029],[-62.846468,-22.034985],[-63.986838,-21.993644],[-64.377021,-22.798091],[-64.964892,-22.075862],[-66.273339,-21.83231],[-67.106674,-22.735925],[-67.82818,-22.872919],[-68.219913,-21.494347],[-68.757167,-20.372658],[-68.442225,-19.405068],[-68.966818,-18.981683],[-69.100247,-18.260125],[-69.590424,-17.580012],[-68.959635,-16.500698],[-69.389764,-15.660129],[-69.160347,-15.323974],[-69.339535,-14.953195],[-68.948887,-14.453639],[-68.929224,-13.602684],[-68.88008,-12.899729],[-68.66508,-12.5613],[-69.529678,-10.951734]]]}},{"type":"Feature","properties":{"name":"Peru"},"geometry":{"type":"Polygon","coordinates":[[[-69.893635,-4.298187],[-70.794769,-4.251265],[-70.928843,-4.401591],[-71.748406,-4.593983],[-72.891928,-5.274561],[-72.964507,-5.741251],[-73.219711,-6.089189],[-73.120027,-6.629931],[-73.724487,-6.918595],[-73.723401,-7.340999],[-73.987235,-7.52383],[-73.571059,-8.424447],[-73.015383,-9.032833],[-73.226713,-9.462213],[-72.563033,-9.520194],[-72.184891,-10.053598],[-71.302412,-10.079436],[-70.481894,-9.490118],[-70.548686,-11.009147],[-70.093752,-11.123972],[-69.529678,-10.951734],[-68.66508,-12.5613],[-68.88008,-12.899729],[-68.929224,-13.602684],[-68.948887,-14.453639],[-69.339535,-14.953195],[-69.160347,-15.323974],[-69.389764,-15.660129],[-68.959635,-16.500698],[-69.590424,-17.580012],[-69.858444,-18.092694],[-70.372572,-18.347975],[-71.37525,-17.773799],[-71.462041,-17.363488],[-73.44453,-16.359363],[-75.237883,-15.265683],[-76.009205,-14.649286],[-76.423469,-13.823187],[-76.259242,-13.535039],[-77.106192,-12.222716],[-78.092153,-10.377712],[-79.036953,-8.386568],[-79.44592,-7.930833],[-79.760578,-7.194341],[-80.537482,-6.541668],[-81.249996,-6.136834],[-80.926347,-5.690557],[-81.410943,-4.736765],[-81.09967,-4.036394],[-80.302561,-3.404856],[-80.184015,-3.821162],[-80.469295,-4.059287],[-80.442242,-4.425724],[-80.028908,-4.346091],[-79.624979,-4.454198],[-79.205289,-4.959129],[-78.639897,-4.547784],[-78.450684,-3.873097],[-77.837905,-3.003021],[-76.635394,-2.608678],[-75.544996,-1.56161],[-75.233723,-0.911417],[-75.373223,-0.152032],[-75.106625,-0.057205],[-74.441601,-0.53082],[-74.122395,-1.002833],[-73.659504,-1.260491],[-73.070392,-2.308954],[-72.325787,-2.434218],[-71.774761,-2.16979],[-71.413646,-2.342802],[-70.813476,-2.256865],[-70.047709,-2.725156],[-70.692682,-3.742872],[-70.394044,-3.766591],[-69.893635,-4.298187]]]}},{"type":"Feature","properties":{"name":"Colombia"},"geometry":{"type":"Polygon","coordinates":[[[-66.876326,1.253361],[-67.065048,1.130112],[-67.259998,1.719999],[-67.53781,2.037163],[-67.868565,1.692455],[-69.816973,1.714805],[-69.804597,1.089081],[-69.218638,0.985677],[-69.252434,0.602651],[-69.452396,0.706159],[-70.015566,0.541414],[-70.020656,-0.185156],[-69.577065,-0.549992],[-69.420486,-1.122619],[-69.444102,-1.556287],[-69.893635,-4.298187],[-70.394044,-3.766591],[-70.692682,-3.742872],[-70.047709,-2.725156],[-70.813476,-2.256865],[-71.413646,-2.342802],[-71.774761,-2.16979],[-72.325787,-2.434218],[-73.070392,-2.308954],[-73.659504,-1.260491],[-74.122395,-1.002833],[-74.441601,-0.53082],[-75.106625,-0.057205],[-75.373223,-0.152032],[-75.801466,0.084801],[-76.292314,0.416047],[-76.57638,0.256936],[-77.424984,0.395687],[-77.668613,0.825893],[-77.855061,0.809925],[-78.855259,1.380924],[-78.990935,1.69137],[-78.617831,1.766404],[-78.662118,2.267355],[-78.42761,2.629556],[-77.931543,2.696606],[-77.510431,3.325017],[-77.12769,3.849636],[-77.496272,4.087606],[-77.307601,4.667984],[-77.533221,5.582812],[-77.318815,5.845354],[-77.476661,6.691116],[-77.881571,7.223771],[-77.753414,7.70984],[-77.431108,7.638061],[-77.242566,7.935278],[-77.474723,8.524286],[-77.353361,8.670505],[-76.836674,8.638749],[-76.086384,9.336821],[-75.6746,9.443248],[-75.664704,9.774003],[-75.480426,10.61899],[-74.906895,11.083045],[-74.276753,11.102036],[-74.197223,11.310473],[-73.414764,11.227015],[-72.627835,11.731972],[-72.238195,11.95555],[-71.75409,12.437303],[-71.399822,12.376041],[-71.137461,12.112982],[-71.331584,11.776284],[-71.973922,11.608672],[-72.227575,11.108702],[-72.614658,10.821975],[-72.905286,10.450344],[-73.027604,9.73677],[-73.304952,9.152],[-72.78873,9.085027],[-72.660495,8.625288],[-72.439862,8.405275],[-72.360901,8.002638],[-72.479679,7.632506],[-72.444487,7.423785],[-72.198352,7.340431],[-71.960176,6.991615],[-70.674234,7.087785],[-70.093313,6.960376],[-69.38948,6.099861],[-68.985319,6.206805],[-68.265052,6.153268],[-67.695087,6.267318],[-67.34144,6.095468],[-67.521532,5.55687],[-67.744697,5.221129],[-67.823012,4.503937],[-67.621836,3.839482],[-67.337564,3.542342],[-67.303173,3.318454],[-67.809938,2.820655],[-67.447092,2.600281],[-67.181294,2.250638],[-66.876326,1.253361]]]}},{"type":"Feature","properties":{"name":"Panama"},"geometry":{"type":"Polygon","coordinates":[[[-77.353361,8.670505],[-77.474723,8.524286],[-77.242566,7.935278],[-77.431108,7.638061],[-77.753414,7.70984],[-77.881571,7.223771],[-78.214936,7.512255],[-78.429161,8.052041],[-78.182096,8.319182],[-78.435465,8.387705],[-78.622121,8.718124],[-79.120307,8.996092],[-79.557877,8.932375],[-79.760578,8.584515],[-80.164481,8.333316],[-80.382659,8.298409],[-80.480689,8.090308],[-80.00369,7.547524],[-80.276671,7.419754],[-80.421158,7.271572],[-80.886401,7.220541],[-81.059543,7.817921],[-81.189716,7.647906],[-81.519515,7.70661],[-81.721311,8.108963],[-82.131441,8.175393],[-82.390934,8.292362],[-82.820081,8.290864],[-82.850958,8.073823],[-82.965783,8.225028],[-82.913176,8.423517],[-82.829771,8.626295],[-82.868657,8.807266],[-82.719183,8.925709],[-82.927155,9.07433],[-82.932891,9.476812],[-82.546196,9.566135],[-82.187123,9.207449],[-82.207586,8.995575],[-81.808567,8.950617],[-81.714154,9.031955],[-81.439287,8.786234],[-80.947302,8.858504],[-80.521901,9.111072],[-79.9146,9.312765],[-79.573303,9.61161],[-79.021192,9.552931],[-79.05845,9.454565],[-78.500888,9.420459],[-78.055928,9.24773],[-77.729514,8.946844],[-77.353361,8.670505]]]}},{"type":"Feature","properties":{"name":"Costa Rica"},"geometry":{"type":"Polygon","coordinates":[[[-82.546196,9.566135],[-82.932891,9.476812],[-82.927155,9.07433],[-82.719183,8.925709],[-82.868657,8.807266],[-82.829771,8.626295],[-82.913176,8.423517],[-82.965783,8.225028],[-83.508437,8.446927],[-83.711474,8.656836],[-83.596313,8.830443],[-83.632642,9.051386],[-83.909886,9.290803],[-84.303402,9.487354],[-84.647644,9.615537],[-84.713351,9.908052],[-84.97566,10.086723],[-84.911375,9.795992],[-85.110923,9.55704],[-85.339488,9.834542],[-85.660787,9.933347],[-85.797445,10.134886],[-85.791709,10.439337],[-85.659314,10.754331],[-85.941725,10.895278],[-85.71254,11.088445],[-85.561852,11.217119],[-84.903003,10.952303],[-84.673069,11.082657],[-84.355931,10.999226],[-84.190179,10.79345],[-83.895054,10.726839],[-83.655612,10.938764],[-83.40232,10.395438],[-83.015677,9.992982],[-82.546196,9.566135]]]}},{"type":"Feature","properties":{"name":"Nicaragua"},"geometry":{"type":"Polygon","coordinates":[[[-83.655612,10.938764],[-83.895054,10.726839],[-84.190179,10.79345],[-84.355931,10.999226],[-84.673069,11.082657],[-84.903003,10.952303],[-85.561852,11.217119],[-85.71254,11.088445],[-86.058488,11.403439],[-86.52585,11.806877],[-86.745992,12.143962],[-87.167516,12.458258],[-87.668493,12.90991],[-87.557467,13.064552],[-87.392386,12.914018],[-87.316654,12.984686],[-87.005769,13.025794],[-86.880557,13.254204],[-86.733822,13.263093],[-86.755087,13.754845],[-86.520708,13.778487],[-86.312142,13.771356],[-86.096264,14.038187],[-85.801295,13.836055],[-85.698665,13.960078],[-85.514413,14.079012],[-85.165365,14.35437],[-85.148751,14.560197],[-85.052787,14.551541],[-84.924501,14.790493],[-84.820037,14.819587],[-84.649582,14.666805],[-84.449336,14.621614],[-84.228342,14.748764],[-83.975721,14.749436],[-83.628585,14.880074],[-83.489989,15.016267],[-83.147219,14.995829],[-83.233234,14.899866],[-83.284162,14.676624],[-83.182126,14.310703],[-83.4125,13.970078],[-83.519832,13.567699],[-83.552207,13.127054],[-83.498515,12.869292],[-83.473323,12.419087],[-83.626104,12.32085],[-83.719613,11.893124],[-83.650858,11.629032],[-83.85547,11.373311],[-83.808936,11.103044],[-83.655612,10.938764]]]}},{"type":"Feature","properties":{"name":"Honduras"},"geometry":{"type":"Polygon","coordinates":[[[-83.147219,14.995829],[-83.489989,15.016267],[-83.628585,14.880074],[-83.975721,14.749436],[-84.228342,14.748764],[-84.449336,14.621614],[-84.649582,14.666805],[-84.820037,14.819587],[-84.924501,14.790493],[-85.052787,14.551541],[-85.148751,14.560197],[-85.165365,14.35437],[-85.514413,14.079012],[-85.698665,13.960078],[-85.801295,13.836055],[-86.096264,14.038187],[-86.312142,13.771356],[-86.520708,13.778487],[-86.755087,13.754845],[-86.733822,13.263093],[-86.880557,13.254204],[-87.005769,13.025794],[-87.316654,12.984686],[-87.489409,13.297535],[-87.793111,13.38448],[-87.723503,13.78505],[-87.859515,13.893312],[-88.065343,13.964626],[-88.503998,13.845486],[-88.541231,13.980155],[-88.843073,14.140507],[-89.058512,14.340029],[-89.353326,14.424133],[-89.145535,14.678019],[-89.22522,14.874286],[-89.154811,15.066419],[-88.68068,15.346247],[-88.225023,15.727722],[-88.121153,15.688655],[-87.901813,15.864458],[-87.61568,15.878799],[-87.522921,15.797279],[-87.367762,15.84694],[-86.903191,15.756713],[-86.440946,15.782835],[-86.119234,15.893449],[-86.001954,16.005406],[-85.683317,15.953652],[-85.444004,15.885749],[-85.182444,15.909158],[-84.983722,15.995923],[-84.52698,15.857224],[-84.368256,15.835158],[-84.063055,15.648244],[-83.773977,15.424072],[-83.410381,15.270903],[-83.147219,14.995829]]]}},{"type":"Feature","properties":{"name":"El Salvador"},"geometry":{"type":"Polygon","coordinates":[[[-89.353326,14.424133],[-89.058512,14.340029],[-88.843073,14.140507],[-88.541231,13.980155],[-88.503998,13.845486],[-88.065343,13.964626],[-87.859515,13.893312],[-87.723503,13.78505],[-87.793111,13.38448],[-87.904112,13.149017],[-88.483302,13.163951],[-88.843228,13.259734],[-89.256743,13.458533],[-89.812394,13.520622],[-90.095555,13.735338],[-90.064678,13.88197],[-89.721934,14.134228],[-89.534219,14.244816],[-89.587343,14.362586],[-89.353326,14.424133]]]}},{"type":"Feature","properties":{"name":"Guatemala"},"geometry":{"type":"Polygon","coordinates":[[[-92.22775,14.538829],[-92.20323,14.830103],[-92.087216,15.064585],[-92.229249,15.251447],[-91.74796,16.066565],[-90.464473,16.069562],[-90.438867,16.41011],[-90.600847,16.470778],[-90.711822,16.687483],[-91.08167,16.918477],[-91.453921,17.252177],[-91.002269,17.254658],[-91.00152,17.817595],[-90.067934,17.819326],[-89.14308,17.808319],[-89.150806,17.015577],[-89.229122,15.886938],[-88.930613,15.887273],[-88.604586,15.70638],[-88.518364,15.855389],[-88.225023,15.727722],[-88.68068,15.346247],[-89.154811,15.066419],[-89.22522,14.874286],[-89.145535,14.678019],[-89.353326,14.424133],[-89.587343,14.362586],[-89.534219,14.244816],[-89.721934,14.134228],[-90.064678,13.88197],[-90.095555,13.735338],[-90.608624,13.909771],[-91.23241,13.927832],[-91.689747,14.126218],[-92.22775,14.538829]]]}},{"type":"Feature","properties":{"name":"Belize"},"geometry":{"type":"Polygon","coordinates":[[[-89.14308,17.808319],[-89.150909,17.955468],[-89.029857,18.001511],[-88.848344,17.883198],[-88.490123,18.486831],[-88.300031,18.499982],[-88.296336,18.353273],[-88.106813,18.348674],[-88.123479,18.076675],[-88.285355,17.644143],[-88.197867,17.489475],[-88.302641,17.131694],[-88.239518,17.036066],[-88.355428,16.530774],[-88.551825,16.265467],[-88.732434,16.233635],[-88.930613,15.887273],[-89.229122,15.886938],[-89.150806,17.015577],[-89.14308,17.808319]]]}},{"type":"Feature","properties":{"name":"Venezuela"},"geometry":{"type":"Polygon","coordinates":[[[-60.733574,5.200277],[-60.601179,4.918098],[-60.966893,4.536468],[-62.08543,4.162124],[-62.804533,4.006965],[-63.093198,3.770571],[-63.888343,4.02053],[-64.628659,4.148481],[-64.816064,4.056445],[-64.368494,3.79721],[-64.408828,3.126786],[-64.269999,2.497006],[-63.422867,2.411068],[-63.368788,2.2009],[-64.083085,1.916369],[-64.199306,1.492855],[-64.611012,1.328731],[-65.354713,1.095282],[-65.548267,0.789254],[-66.325765,0.724452],[-66.876326,1.253361],[-67.181294,2.250638],[-67.447092,2.600281],[-67.809938,2.820655],[-67.303173,3.318454],[-67.337564,3.542342],[-67.621836,3.839482],[-67.823012,4.503937],[-67.744697,5.221129],[-67.521532,5.55687],[-67.34144,6.095468],[-67.695087,6.267318],[-68.265052,6.153268],[-68.985319,6.206805],[-69.38948,6.099861],[-70.093313,6.960376],[-70.674234,7.087785],[-71.960176,6.991615],[-72.198352,7.340431],[-72.444487,7.423785],[-72.479679,7.632506],[-72.360901,8.002638],[-72.439862,8.405275],[-72.660495,8.625288],[-72.78873,9.085027],[-73.304952,9.152],[-73.027604,9.73677],[-72.905286,10.450344],[-72.614658,10.821975],[-72.227575,11.108702],[-71.973922,11.608672],[-71.331584,11.776284],[-71.360006,11.539994],[-71.94705,11.423282],[-71.620868,10.96946],[-71.633064,10.446494],[-72.074174,9.865651],[-71.695644,9.072263],[-71.264559,9.137195],[-71.039999,9.859993],[-71.350084,10.211935],[-71.400623,10.968969],[-70.155299,11.375482],[-70.293843,11.846822],[-69.943245,12.162307],[-69.5843,11.459611],[-68.882999,11.443385],[-68.233271,10.885744],[-68.194127,10.554653],[-67.296249,10.545868],[-66.227864,10.648627],[-65.655238,10.200799],[-64.890452,10.077215],[-64.329479,10.389599],[-64.318007,10.641418],[-63.079322,10.701724],[-61.880946,10.715625],[-62.730119,10.420269],[-62.388512,9.948204],[-61.588767,9.873067],[-60.830597,9.38134],[-60.671252,8.580174],[-60.150096,8.602757],[-59.758285,8.367035],[-60.550588,7.779603],[-60.637973,7.415],[-60.295668,7.043911],[-60.543999,6.856584],[-61.159336,6.696077],[-61.139415,6.234297],[-61.410303,5.959068],[-60.733574,5.200277]]]}},{"type":"Feature","properties":{"name":"Guyana"},"geometry":{"type":"Polygon","coordinates":[[[-56.539386,1.899523],[-56.782704,1.863711],[-57.335823,1.948538],[-57.660971,1.682585],[-58.11345,1.507195],[-58.429477,1.463942],[-58.540013,1.268088],[-59.030862,1.317698],[-59.646044,1.786894],[-59.718546,2.24963],[-59.974525,2.755233],[-59.815413,3.606499],[-59.53804,3.958803],[-59.767406,4.423503],[-60.111002,4.574967],[-59.980959,5.014061],[-60.213683,5.244486],[-60.733574,5.200277],[-61.410303,5.959068],[-61.139415,6.234297],[-61.159336,6.696077],[-60.543999,6.856584],[-60.295668,7.043911],[-60.637973,7.415],[-60.550588,7.779603],[-59.758285,8.367035],[-59.101684,7.999202],[-58.482962,7.347691],[-58.454876,6.832787],[-58.078103,6.809094],[-57.542219,6.321268],[-57.147436,5.97315],[-57.307246,5.073567],[-57.914289,4.812626],[-57.86021,4.576801],[-58.044694,4.060864],[-57.601569,3.334655],[-57.281433,3.333492],[-57.150098,2.768927],[-56.539386,1.899523]]]}},{"type":"Feature","properties":{"name":"Suriname"},"geometry":{"type":"Polygon","coordinates":[[[-54.524754,2.311849],[-55.097587,2.523748],[-55.569755,2.421506],[-55.973322,2.510364],[-56.073342,2.220795],[-55.9056,2.021996],[-55.995698,1.817667],[-56.539386,1.899523],[-57.150098,2.768927],[-57.281433,3.333492],[-57.601569,3.334655],[-58.044694,4.060864],[-57.86021,4.576801],[-57.914289,4.812626],[-57.307246,5.073567],[-57.147436,5.97315],[-55.949318,5.772878],[-55.84178,5.953125],[-55.03325,6.025291],[-53.958045,5.756548],[-54.478633,4.896756],[-54.399542,4.212611],[-54.006931,3.620038],[-54.181726,3.18978],[-54.269705,2.732392],[-54.524754,2.311849]]]}},{"type":"Feature","properties":{"name":"France"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-51.657797,4.156232],[-52.249338,3.241094],[-52.556425,2.504705],[-52.939657,2.124858],[-53.418465,2.053389],[-53.554839,2.334897],[-53.778521,2.376703],[-54.088063,2.105557],[-54.524754,2.311849],[-54.269705,2.732392],[-54.181726,3.18978],[-54.006931,3.620038],[-54.399542,4.212611],[-54.478633,4.896756],[-53.958045,5.756548],[-53.618453,5.646529],[-52.882141,5.409851],[-51.823343,4.565768],[-51.657797,4.156232]]],[[[6.18632,49.463803],[6.65823,49.201958],[8.099279,49.017784],[7.593676,48.333019],[7.466759,47.620582],[7.192202,47.449766],[6.736571,47.541801],[6.768714,47.287708],[6.037389,46.725779],[6.022609,46.27299],[6.5001,46.429673],[6.843593,45.991147],[6.802355,45.70858],[7.096652,45.333099],[6.749955,45.028518],[7.007562,44.254767],[7.549596,44.127901],[7.435185,43.693845],[6.529245,43.128892],[4.556963,43.399651],[3.100411,43.075201],[2.985999,42.473015],[1.826793,42.343385],[0.701591,42.795734],[0.338047,42.579546],[-1.502771,43.034014],[-1.901351,43.422802],[-1.384225,44.02261],[-1.193798,46.014918],[-2.225724,47.064363],[-2.963276,47.570327],[-4.491555,47.954954],[-4.59235,48.68416],[-3.295814,48.901692],[-1.616511,48.644421],[-1.933494,49.776342],[-0.989469,49.347376],[1.338761,50.127173],[1.639001,50.946606],[2.513573,51.148506],[2.658422,50.796848],[3.123252,50.780363],[3.588184,50.378992],[4.286023,49.907497],[4.799222,49.985373],[5.674052,49.529484],[5.897759,49.442667],[6.18632,49.463803]]],[[[8.746009,42.628122],[9.390001,43.009985],[9.560016,42.152492],[9.229752,41.380007],[8.775723,41.583612],[8.544213,42.256517],[8.746009,42.628122]]]]}},{"type":"Feature","properties":{"name":"Ecuador"},"geometry":{"type":"Polygon","coordinates":[[[-75.373223,-0.152032],[-75.233723,-0.911417],[-75.544996,-1.56161],[-76.635394,-2.608678],[-77.837905,-3.003021],[-78.450684,-3.873097],[-78.639897,-4.547784],[-79.205289,-4.959129],[-79.624979,-4.454198],[-80.028908,-4.346091],[-80.442242,-4.425724],[-80.469295,-4.059287],[-80.184015,-3.821162],[-80.302561,-3.404856],[-79.770293,-2.657512],[-79.986559,-2.220794],[-80.368784,-2.685159],[-80.967765,-2.246943],[-80.764806,-1.965048],[-80.933659,-1.057455],[-80.58337,-0.906663],[-80.399325,-0.283703],[-80.020898,0.36034],[-80.09061,0.768429],[-79.542762,0.982938],[-78.855259,1.380924],[-77.855061,0.809925],[-77.668613,0.825893],[-77.424984,0.395687],[-76.57638,0.256936],[-76.292314,0.416047],[-75.801466,0.084801],[-75.373223,-0.152032]]]}},{"type":"Feature","properties":{"name":"Puerto Rico"},"geometry":{"type":"Polygon","coordinates":[[[-66.282434,18.514762],[-65.771303,18.426679],[-65.591004,18.228035],[-65.847164,17.975906],[-66.599934,17.981823],[-67.184162,17.946553],[-67.242428,18.37446],[-67.100679,18.520601],[-66.282434,18.514762]]]}},{"type":"Feature","properties":{"name":"Jamaica"},"geometry":{"type":"Polygon","coordinates":[[[-77.569601,18.490525],[-76.896619,18.400867],[-76.365359,18.160701],[-76.199659,17.886867],[-76.902561,17.868238],[-77.206341,17.701116],[-77.766023,17.861597],[-78.337719,18.225968],[-78.217727,18.454533],[-77.797365,18.524218],[-77.569601,18.490525]]]}},{"type":"Feature","properties":{"name":"Cuba"},"geometry":{"type":"Polygon","coordinates":[[[-82.268151,23.188611],[-81.404457,23.117271],[-80.618769,23.10598],[-79.679524,22.765303],[-79.281486,22.399202],[-78.347434,22.512166],[-77.993296,22.277194],[-77.146422,21.657851],[-76.523825,21.20682],[-76.19462,21.220565],[-75.598222,21.016624],[-75.67106,20.735091],[-74.933896,20.693905],[-74.178025,20.284628],[-74.296648,20.050379],[-74.961595,19.923435],[-75.63468,19.873774],[-76.323656,19.952891],[-77.755481,19.855481],[-77.085108,20.413354],[-77.492655,20.673105],[-78.137292,20.739949],[-78.482827,21.028613],[-78.719867,21.598114],[-79.285,21.559175],[-80.217475,21.827324],[-80.517535,22.037079],[-81.820943,22.192057],[-82.169992,22.387109],[-81.795002,22.636965],[-82.775898,22.68815],[-83.494459,22.168518],[-83.9088,22.154565],[-84.052151,21.910575],[-84.54703,21.801228],[-84.974911,21.896028],[-84.447062,22.20495],[-84.230357,22.565755],[-83.77824,22.788118],[-83.267548,22.983042],[-82.510436,23.078747],[-82.268151,23.188611]]]}},{"type":"Feature","properties":{"name":"Zimbabwe"},"geometry":{"type":"Polygon","coordinates":[[[31.191409,-22.25151],[30.659865,-22.151567],[30.322883,-22.271612],[29.839037,-22.102216],[29.432188,-22.091313],[28.794656,-21.639454],[28.02137,-21.485975],[27.727228,-20.851802],[27.724747,-20.499059],[27.296505,-20.39152],[26.164791,-19.293086],[25.850391,-18.714413],[25.649163,-18.536026],[25.264226,-17.73654],[26.381935,-17.846042],[26.706773,-17.961229],[27.044427,-17.938026],[27.598243,-17.290831],[28.467906,-16.4684],[28.825869,-16.389749],[28.947463,-16.043051],[29.516834,-15.644678],[30.274256,-15.507787],[30.338955,-15.880839],[31.173064,-15.860944],[31.636498,-16.07199],[31.852041,-16.319417],[32.328239,-16.392074],[32.847639,-16.713398],[32.849861,-17.979057],[32.654886,-18.67209],[32.611994,-19.419383],[32.772708,-19.715592],[32.659743,-20.30429],[32.508693,-20.395292],[32.244988,-21.116489],[31.191409,-22.25151]]]}},{"type":"Feature","properties":{"name":"Botswana"},"geometry":{"type":"Polygon","coordinates":[[[29.432188,-22.091313],[28.017236,-22.827754],[27.11941,-23.574323],[26.786407,-24.240691],[26.485753,-24.616327],[25.941652,-24.696373],[25.765849,-25.174845],[25.664666,-25.486816],[25.025171,-25.71967],[24.211267,-25.670216],[23.73357,-25.390129],[23.312097,-25.26869],[22.824271,-25.500459],[22.579532,-25.979448],[22.105969,-26.280256],[21.605896,-26.726534],[20.889609,-26.828543],[20.66647,-26.477453],[20.758609,-25.868136],[20.165726,-24.917962],[19.895768,-24.76779],[19.895458,-21.849157],[20.881134,-21.814327],[20.910641,-18.252219],[21.65504,-18.219146],[23.196858,-17.869038],[23.579006,-18.281261],[24.217365,-17.889347],[24.520705,-17.887125],[25.084443,-17.661816],[25.264226,-17.73654],[25.649163,-18.536026],[25.850391,-18.714413],[26.164791,-19.293086],[27.296505,-20.39152],[27.724747,-20.499059],[27.727228,-20.851802],[28.02137,-21.485975],[28.794656,-21.639454],[29.432188,-22.091313]]]}},{"type":"Feature","properties":{"name":"Namibia"},"geometry":{"type":"Polygon","coordinates":[[[19.895768,-24.76779],[19.894734,-28.461105],[19.002127,-28.972443],[18.464899,-29.045462],[17.836152,-28.856378],[17.387497,-28.783514],[17.218929,-28.355943],[16.824017,-28.082162],[16.344977,-28.576705],[15.601818,-27.821247],[15.210472,-27.090956],[14.989711,-26.117372],[14.743214,-25.39292],[14.408144,-23.853014],[14.385717,-22.656653],[14.257714,-22.111208],[13.868642,-21.699037],[13.352498,-20.872834],[12.826845,-19.673166],[12.608564,-19.045349],[11.794919,-18.069129],[11.734199,-17.301889],[12.215461,-17.111668],[12.814081,-16.941343],[13.462362,-16.971212],[14.058501,-17.423381],[14.209707,-17.353101],[18.263309,-17.309951],[18.956187,-17.789095],[21.377176,-17.930636],[23.215048,-17.523116],[24.033862,-17.295843],[24.682349,-17.353411],[25.07695,-17.578823],[25.084443,-17.661816],[24.520705,-17.887125],[24.217365,-17.889347],[23.579006,-18.281261],[23.196858,-17.869038],[21.65504,-18.219146],[20.910641,-18.252219],[20.881134,-21.814327],[19.895458,-21.849157],[19.895768,-24.76779]]]}},{"type":"Feature","properties":{"name":"Senegal"},"geometry":{"type":"Polygon","coordinates":[[[-16.713729,13.594959],[-17.126107,14.373516],[-17.625043,14.729541],[-17.185173,14.919477],[-16.700706,15.621527],[-16.463098,16.135036],[-16.12069,16.455663],[-15.623666,16.369337],[-15.135737,16.587282],[-14.577348,16.598264],[-14.099521,16.304302],[-13.435738,16.039383],[-12.830658,15.303692],[-12.17075,14.616834],[-12.124887,13.994727],[-11.927716,13.422075],[-11.553398,13.141214],[-11.467899,12.754519],[-11.513943,12.442988],[-11.658301,12.386583],[-12.203565,12.465648],[-12.278599,12.35444],[-12.499051,12.33209],[-13.217818,12.575874],[-13.700476,12.586183],[-15.548477,12.62817],[-15.816574,12.515567],[-16.147717,12.547762],[-16.677452,12.384852],[-16.841525,13.151394],[-15.931296,13.130284],[-15.691001,13.270353],[-15.511813,13.27857],[-15.141163,13.509512],[-14.712197,13.298207],[-14.277702,13.280585],[-13.844963,13.505042],[-14.046992,13.794068],[-14.376714,13.62568],[-14.687031,13.630357],[-15.081735,13.876492],[-15.39877,13.860369],[-15.624596,13.623587],[-16.713729,13.594959]]]}},{"type":"Feature","properties":{"name":"Mali"},"geometry":{"type":"Polygon","coordinates":[[[-11.513943,12.442988],[-11.467899,12.754519],[-11.553398,13.141214],[-11.927716,13.422075],[-12.124887,13.994727],[-12.17075,14.616834],[-11.834208,14.799097],[-11.666078,15.388208],[-11.349095,15.411256],[-10.650791,15.132746],[-10.086846,15.330486],[-9.700255,15.264107],[-9.550238,15.486497],[-5.537744,15.50169],[-5.315277,16.201854],[-5.488523,16.325102],[-5.971129,20.640833],[-6.453787,24.956591],[-4.923337,24.974574],[-1.550055,22.792666],[1.823228,20.610809],[2.060991,20.142233],[2.683588,19.85623],[3.146661,19.693579],[3.158133,19.057364],[4.267419,19.155265],[4.27021,16.852227],[3.723422,16.184284],[3.638259,15.56812],[2.749993,15.409525],[1.385528,15.323561],[1.015783,14.968182],[0.374892,14.928908],[-0.266257,14.924309],[-0.515854,15.116158],[-1.066363,14.973815],[-2.001035,14.559008],[-2.191825,14.246418],[-2.967694,13.79815],[-3.103707,13.541267],[-3.522803,13.337662],[-4.006391,13.472485],[-4.280405,13.228444],[-4.427166,12.542646],[-5.220942,11.713859],[-5.197843,11.375146],[-5.470565,10.95127],[-5.404342,10.370737],[-5.816926,10.222555],[-6.050452,10.096361],[-6.205223,10.524061],[-6.493965,10.411303],[-6.666461,10.430811],[-6.850507,10.138994],[-7.622759,10.147236],[-7.89959,10.297382],[-8.029944,10.206535],[-8.335377,10.494812],[-8.282357,10.792597],[-8.407311,10.909257],[-8.620321,10.810891],[-8.581305,11.136246],[-8.376305,11.393646],[-8.786099,11.812561],[-8.905265,12.088358],[-9.127474,12.30806],[-9.327616,12.334286],[-9.567912,12.194243],[-9.890993,12.060479],[-10.165214,11.844084],[-10.593224,11.923975],[-10.87083,12.177887],[-11.036556,12.211245],[-11.297574,12.077971],[-11.456169,12.076834],[-11.513943,12.442988]]]}},{"type":"Feature","properties":{"name":"Mauritania"},"geometry":{"type":"Polygon","coordinates":[[[-17.063423,20.999752],[-16.845194,21.333323],[-12.929102,21.327071],[-13.118754,22.77122],[-12.874222,23.284832],[-11.937224,23.374594],[-11.969419,25.933353],[-8.687294,25.881056],[-8.6844,27.395744],[-4.923337,24.974574],[-6.453787,24.956591],[-5.971129,20.640833],[-5.488523,16.325102],[-5.315277,16.201854],[-5.537744,15.50169],[-9.550238,15.486497],[-9.700255,15.264107],[-10.086846,15.330486],[-10.650791,15.132746],[-11.349095,15.411256],[-11.666078,15.388208],[-11.834208,14.799097],[-12.17075,14.616834],[-12.830658,15.303692],[-13.435738,16.039383],[-14.099521,16.304302],[-14.577348,16.598264],[-15.135737,16.587282],[-15.623666,16.369337],[-16.12069,16.455663],[-16.463098,16.135036],[-16.549708,16.673892],[-16.270552,17.166963],[-16.146347,18.108482],[-16.256883,19.096716],[-16.377651,19.593817],[-16.277838,20.092521],[-16.536324,20.567866],[-17.063423,20.999752]]]}},{"type":"Feature","properties":{"name":"Benin"},"geometry":{"type":"Polygon","coordinates":[[[2.691702,6.258817],[1.865241,6.142158],[1.618951,6.832038],[1.664478,9.12859],[1.463043,9.334624],[1.425061,9.825395],[1.077795,10.175607],[0.772336,10.470808],[0.899563,10.997339],[1.24347,11.110511],[1.447178,11.547719],[1.935986,11.64115],[2.154474,11.94015],[2.490164,12.233052],[2.848643,12.235636],[3.61118,11.660167],[3.572216,11.327939],[3.797112,10.734746],[3.60007,10.332186],[3.705438,10.06321],[3.220352,9.444153],[2.912308,9.137608],[2.723793,8.506845],[2.749063,7.870734],[2.691702,6.258817]]]}},{"type":"Feature","properties":{"name":"Niger"},"geometry":{"type":"Polygon","coordinates":[[[14.8513,22.86295],[15.096888,21.308519],[15.47106,21.04845],[15.487148,20.730415],[15.903247,20.387619],[15.685741,19.95718],[15.300441,17.92795],[15.247731,16.627306],[13.97217,15.68437],[13.540394,14.367134],[13.956699,13.996691],[13.954477,13.353449],[14.595781,13.330427],[14.495787,12.859396],[14.213531,12.802035],[14.181336,12.483657],[13.995353,12.461565],[13.318702,13.556356],[13.083987,13.596147],[12.302071,13.037189],[11.527803,13.32898],[10.989593,13.387323],[10.701032,13.246918],[10.114814,13.277252],[9.524928,12.851102],[9.014933,12.826659],[7.804671,13.343527],[7.330747,13.098038],[6.820442,13.115091],[6.445426,13.492768],[5.443058,13.865924],[4.368344,13.747482],[4.107946,13.531216],[3.967283,12.956109],[3.680634,12.552903],[3.61118,11.660167],[2.848643,12.235636],[2.490164,12.233052],[2.154474,11.94015],[2.177108,12.625018],[1.024103,12.851826],[0.993046,13.33575],[0.429928,13.988733],[0.295646,14.444235],[0.374892,14.928908],[1.015783,14.968182],[1.385528,15.323561],[2.749993,15.409525],[3.638259,15.56812],[3.723422,16.184284],[4.27021,16.852227],[4.267419,19.155265],[5.677566,19.601207],[8.572893,21.565661],[11.999506,23.471668],[13.581425,23.040506],[14.143871,22.491289],[14.8513,22.86295]]]}},{"type":"Feature","properties":{"name":"Nigeria"},"geometry":{"type":"Polygon","coordinates":[[[2.691702,6.258817],[2.749063,7.870734],[2.723793,8.506845],[2.912308,9.137608],[3.220352,9.444153],[3.705438,10.06321],[3.60007,10.332186],[3.797112,10.734746],[3.572216,11.327939],[3.61118,11.660167],[3.680634,12.552903],[3.967283,12.956109],[4.107946,13.531216],[4.368344,13.747482],[5.443058,13.865924],[6.445426,13.492768],[6.820442,13.115091],[7.330747,13.098038],[7.804671,13.343527],[9.014933,12.826659],[9.524928,12.851102],[10.114814,13.277252],[10.701032,13.246918],[10.989593,13.387323],[11.527803,13.32898],[12.302071,13.037189],[13.083987,13.596147],[13.318702,13.556356],[13.995353,12.461565],[14.181336,12.483657],[14.577178,12.085361],[14.468192,11.904752],[14.415379,11.572369],[13.57295,10.798566],[13.308676,10.160362],[13.1676,9.640626],[12.955468,9.417772],[12.753672,8.717763],[12.218872,8.305824],[12.063946,7.799808],[11.839309,7.397042],[11.745774,6.981383],[11.058788,6.644427],[10.497375,7.055358],[10.118277,7.03877],[9.522706,6.453482],[9.233163,6.444491],[8.757533,5.479666],[8.500288,4.771983],[7.462108,4.412108],[7.082596,4.464689],[6.698072,4.240594],[5.898173,4.262453],[5.362805,4.887971],[5.033574,5.611802],[4.325607,6.270651],[3.57418,6.2583],[2.691702,6.258817]]]}},{"type":"Feature","properties":{"name":"Cameroon"},"geometry":{"type":"Polygon","coordinates":[[[14.495787,12.859396],[14.89336,12.21905],[14.960152,11.555574],[14.923565,10.891325],[15.467873,9.982337],[14.909354,9.992129],[14.627201,9.920919],[14.171466,10.021378],[13.954218,9.549495],[14.544467,8.965861],[14.979996,8.796104],[15.120866,8.38215],[15.436092,7.692812],[15.27946,7.421925],[14.776545,6.408498],[14.53656,6.226959],[14.459407,5.451761],[14.558936,5.030598],[14.478372,4.732605],[14.950953,4.210389],[15.03622,3.851367],[15.405396,3.335301],[15.862732,3.013537],[15.907381,2.557389],[16.012852,2.26764],[15.940919,1.727673],[15.146342,1.964015],[14.337813,2.227875],[13.075822,2.267097],[12.951334,2.321616],[12.35938,2.192812],[11.751665,2.326758],[11.276449,2.261051],[9.649158,2.283866],[9.795196,3.073404],[9.404367,3.734527],[8.948116,3.904129],[8.744924,4.352215],[8.488816,4.495617],[8.500288,4.771983],[8.757533,5.479666],[9.233163,6.444491],[9.522706,6.453482],[10.118277,7.03877],[10.497375,7.055358],[11.058788,6.644427],[11.745774,6.981383],[11.839309,7.397042],[12.063946,7.799808],[12.218872,8.305824],[12.753672,8.717763],[12.955468,9.417772],[13.1676,9.640626],[13.308676,10.160362],[13.57295,10.798566],[14.415379,11.572369],[14.468192,11.904752],[14.577178,12.085361],[14.181336,12.483657],[14.213531,12.802035],[14.495787,12.859396]]]}},{"type":"Feature","properties":{"name":"Togo"},"geometry":{"type":"Polygon","coordinates":[[[0.899563,10.997339],[0.772336,10.470808],[1.077795,10.175607],[1.425061,9.825395],[1.463043,9.334624],[1.664478,9.12859],[1.618951,6.832038],[1.865241,6.142158],[1.060122,5.928837],[0.836931,6.279979],[0.570384,6.914359],[0.490957,7.411744],[0.712029,8.312465],[0.461192,8.677223],[0.365901,9.465004],[0.36758,10.191213],[-0.049785,10.706918],[0.023803,11.018682],[0.899563,10.997339]]]}},{"type":"Feature","properties":{"name":"Ghana"},"geometry":{"type":"Polygon","coordinates":[[[0.023803,11.018682],[-0.049785,10.706918],[0.36758,10.191213],[0.365901,9.465004],[0.461192,8.677223],[0.712029,8.312465],[0.490957,7.411744],[0.570384,6.914359],[0.836931,6.279979],[1.060122,5.928837],[-0.507638,5.343473],[-1.063625,5.000548],[-1.964707,4.710462],[-2.856125,4.994476],[-2.810701,5.389051],[-3.24437,6.250472],[-2.983585,7.379705],[-2.56219,8.219628],[-2.827496,9.642461],[-2.963896,10.395335],[-2.940409,10.96269],[-1.203358,11.009819],[-0.761576,10.93693],[-0.438702,11.098341],[0.023803,11.018682]]]}},{"type":"Feature","properties":{"name":"Ivory Coast"},"geometry":{"type":"Polygon","coordinates":[[[-8.029944,10.206535],[-7.89959,10.297382],[-7.622759,10.147236],[-6.850507,10.138994],[-6.666461,10.430811],[-6.493965,10.411303],[-6.205223,10.524061],[-6.050452,10.096361],[-5.816926,10.222555],[-5.404342,10.370737],[-4.954653,10.152714],[-4.779884,9.821985],[-4.330247,9.610835],[-3.980449,9.862344],[-3.511899,9.900326],[-2.827496,9.642461],[-2.56219,8.219628],[-2.983585,7.379705],[-3.24437,6.250472],[-2.810701,5.389051],[-2.856125,4.994476],[-3.311084,4.984296],[-4.00882,5.179813],[-4.649917,5.168264],[-5.834496,4.993701],[-6.528769,4.705088],[-7.518941,4.338288],[-7.712159,4.364566],[-7.635368,5.188159],[-7.539715,5.313345],[-7.570153,5.707352],[-7.993693,6.12619],[-8.311348,6.193033],[-8.60288,6.467564],[-8.385452,6.911801],[-8.485446,7.395208],[-8.439298,7.686043],[-8.280703,7.68718],[-8.221792,8.123329],[-8.299049,8.316444],[-8.203499,8.455453],[-7.8321,8.575704],[-8.079114,9.376224],[-8.309616,9.789532],[-8.229337,10.12902],[-8.029944,10.206535]]]}},{"type":"Feature","properties":{"name":"Guinea"},"geometry":{"type":"Polygon","coordinates":[[[-13.700476,12.586183],[-13.217818,12.575874],[-12.499051,12.33209],[-12.278599,12.35444],[-12.203565,12.465648],[-11.658301,12.386583],[-11.513943,12.442988],[-11.456169,12.076834],[-11.297574,12.077971],[-11.036556,12.211245],[-10.87083,12.177887],[-10.593224,11.923975],[-10.165214,11.844084],[-9.890993,12.060479],[-9.567912,12.194243],[-9.327616,12.334286],[-9.127474,12.30806],[-8.905265,12.088358],[-8.786099,11.812561],[-8.376305,11.393646],[-8.581305,11.136246],[-8.620321,10.810891],[-8.407311,10.909257],[-8.282357,10.792597],[-8.335377,10.494812],[-8.029944,10.206535],[-8.229337,10.12902],[-8.309616,9.789532],[-8.079114,9.376224],[-7.8321,8.575704],[-8.203499,8.455453],[-8.299049,8.316444],[-8.221792,8.123329],[-8.280703,7.68718],[-8.439298,7.686043],[-8.722124,7.711674],[-8.926065,7.309037],[-9.208786,7.313921],[-9.403348,7.526905],[-9.33728,7.928534],[-9.755342,8.541055],[-10.016567,8.428504],[-10.230094,8.406206],[-10.505477,8.348896],[-10.494315,8.715541],[-10.65477,8.977178],[-10.622395,9.26791],[-10.839152,9.688246],[-11.117481,10.045873],[-11.917277,10.046984],[-12.150338,9.858572],[-12.425929,9.835834],[-12.596719,9.620188],[-12.711958,9.342712],[-13.24655,8.903049],[-13.685154,9.494744],[-14.074045,9.886167],[-14.330076,10.01572],[-14.579699,10.214467],[-14.693232,10.656301],[-14.839554,10.876572],[-15.130311,11.040412],[-14.685687,11.527824],[-14.382192,11.509272],[-14.121406,11.677117],[-13.9008,11.678719],[-13.743161,11.811269],[-13.828272,12.142644],[-13.718744,12.247186],[-13.700476,12.586183]]]}},{"type":"Feature","properties":{"name":"Guinea-Bissau"},"geometry":{"type":"Polygon","coordinates":[[[-16.677452,12.384852],[-16.147717,12.547762],[-15.816574,12.515567],[-15.548477,12.62817],[-13.700476,12.586183],[-13.718744,12.247186],[-13.828272,12.142644],[-13.743161,11.811269],[-13.9008,11.678719],[-14.121406,11.677117],[-14.382192,11.509272],[-14.685687,11.527824],[-15.130311,11.040412],[-15.66418,11.458474],[-16.085214,11.524594],[-16.314787,11.806515],[-16.308947,11.958702],[-16.613838,12.170911],[-16.677452,12.384852]]]}},{"type":"Feature","properties":{"name":"Liberia"},"geometry":{"type":"Polygon","coordinates":[[[-8.439298,7.686043],[-8.485446,7.395208],[-8.385452,6.911801],[-8.60288,6.467564],[-8.311348,6.193033],[-7.993693,6.12619],[-7.570153,5.707352],[-7.539715,5.313345],[-7.635368,5.188159],[-7.712159,4.364566],[-7.974107,4.355755],[-9.004794,4.832419],[-9.91342,5.593561],[-10.765384,6.140711],[-11.438779,6.785917],[-11.199802,7.105846],[-11.146704,7.396706],[-10.695595,7.939464],[-10.230094,8.406206],[-10.016567,8.428504],[-9.755342,8.541055],[-9.33728,7.928534],[-9.403348,7.526905],[-9.208786,7.313921],[-8.926065,7.309037],[-8.722124,7.711674],[-8.439298,7.686043]]]}},{"type":"Feature","properties":{"name":"Sierra Leone"},"geometry":{"type":"Polygon","coordinates":[[[-13.24655,8.903049],[-12.711958,9.342712],[-12.596719,9.620188],[-12.425929,9.835834],[-12.150338,9.858572],[-11.917277,10.046984],[-11.117481,10.045873],[-10.839152,9.688246],[-10.622395,9.26791],[-10.65477,8.977178],[-10.494315,8.715541],[-10.505477,8.348896],[-10.230094,8.406206],[-10.695595,7.939464],[-11.146704,7.396706],[-11.199802,7.105846],[-11.438779,6.785917],[-11.708195,6.860098],[-12.428099,7.262942],[-12.949049,7.798646],[-13.124025,8.163946],[-13.24655,8.903049]]]}},{"type":"Feature","properties":{"name":"Burkina Faso"},"geometry":{"type":"Polygon","coordinates":[[[-5.404342,10.370737],[-5.470565,10.95127],[-5.197843,11.375146],[-5.220942,11.713859],[-4.427166,12.542646],[-4.280405,13.228444],[-4.006391,13.472485],[-3.522803,13.337662],[-3.103707,13.541267],[-2.967694,13.79815],[-2.191825,14.246418],[-2.001035,14.559008],[-1.066363,14.973815],[-0.515854,15.116158],[-0.266257,14.924309],[0.374892,14.928908],[0.295646,14.444235],[0.429928,13.988733],[0.993046,13.33575],[1.024103,12.851826],[2.177108,12.625018],[2.154474,11.94015],[1.935986,11.64115],[1.447178,11.547719],[1.24347,11.110511],[0.899563,10.997339],[0.023803,11.018682],[-0.438702,11.098341],[-0.761576,10.93693],[-1.203358,11.009819],[-2.940409,10.96269],[-2.963896,10.395335],[-2.827496,9.642461],[-3.511899,9.900326],[-3.980449,9.862344],[-4.330247,9.610835],[-4.779884,9.821985],[-4.954653,10.152714],[-5.404342,10.370737]]]}},{"type":"Feature","properties":{"name":"Central African Republic"},"geometry":{"type":"Polygon","coordinates":[[[27.374226,5.233944],[27.044065,5.127853],[26.402761,5.150875],[25.650455,5.256088],[25.278798,5.170408],[25.128833,4.927245],[24.805029,4.897247],[24.410531,5.108784],[23.297214,4.609693],[22.84148,4.710126],[22.704124,4.633051],[22.405124,4.02916],[21.659123,4.224342],[20.927591,4.322786],[20.290679,4.691678],[19.467784,5.031528],[18.932312,4.709506],[18.542982,4.201785],[18.453065,3.504386],[17.8099,3.560196],[17.133042,3.728197],[16.537058,3.198255],[16.012852,2.26764],[15.907381,2.557389],[15.862732,3.013537],[15.405396,3.335301],[15.03622,3.851367],[14.950953,4.210389],[14.478372,4.732605],[14.558936,5.030598],[14.459407,5.451761],[14.53656,6.226959],[14.776545,6.408498],[15.27946,7.421925],[16.106232,7.497088],[16.290562,7.754307],[16.456185,7.734774],[16.705988,7.508328],[17.96493,7.890914],[18.389555,8.281304],[18.911022,8.630895],[18.81201,8.982915],[19.094008,9.074847],[20.059685,9.012706],[21.000868,9.475985],[21.723822,10.567056],[22.231129,10.971889],[22.864165,11.142395],[22.977544,10.714463],[23.554304,10.089255],[23.55725,9.681218],[23.394779,9.265068],[23.459013,8.954286],[23.805813,8.666319],[24.567369,8.229188],[25.114932,7.825104],[25.124131,7.500085],[25.796648,6.979316],[26.213418,6.546603],[26.465909,5.946717],[27.213409,5.550953],[27.374226,5.233944]]]}},{"type":"Feature","properties":{"name":"Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":[[[18.453065,3.504386],[18.393792,2.900443],[18.094276,2.365722],[17.898835,1.741832],[17.774192,0.855659],[17.82654,0.288923],[17.663553,-0.058084],[17.638645,-0.424832],[17.523716,-0.74383],[16.865307,-1.225816],[16.407092,-1.740927],[15.972803,-2.712392],[16.00629,-3.535133],[15.75354,-3.855165],[15.170992,-4.343507],[14.582604,-4.970239],[14.209035,-4.793092],[14.144956,-4.510009],[13.600235,-4.500138],[13.25824,-4.882957],[12.995517,-4.781103],[12.62076,-4.438023],[12.318608,-4.60623],[11.914963,-5.037987],[11.093773,-3.978827],[11.855122,-3.426871],[11.478039,-2.765619],[11.820964,-2.514161],[12.495703,-2.391688],[12.575284,-1.948511],[13.109619,-2.42874],[13.992407,-2.470805],[14.29921,-1.998276],[14.425456,-1.333407],[14.316418,-0.552627],[13.843321,0.038758],[14.276266,1.19693],[14.026669,1.395677],[13.282631,1.314184],[13.003114,1.830896],[13.075822,2.267097],[14.337813,2.227875],[15.146342,1.964015],[15.940919,1.727673],[16.012852,2.26764],[16.537058,3.198255],[17.133042,3.728197],[17.8099,3.560196],[18.453065,3.504386]]]}},{"type":"Feature","properties":{"name":"Gabon"},"geometry":{"type":"Polygon","coordinates":[[[11.276449,2.261051],[11.751665,2.326758],[12.35938,2.192812],[12.951334,2.321616],[13.075822,2.267097],[13.003114,1.830896],[13.282631,1.314184],[14.026669,1.395677],[14.276266,1.19693],[13.843321,0.038758],[14.316418,-0.552627],[14.425456,-1.333407],[14.29921,-1.998276],[13.992407,-2.470805],[13.109619,-2.42874],[12.575284,-1.948511],[12.495703,-2.391688],[11.820964,-2.514161],[11.478039,-2.765619],[11.855122,-3.426871],[11.093773,-3.978827],[10.066135,-2.969483],[9.405245,-2.144313],[8.797996,-1.111301],[8.830087,-0.779074],[9.04842,-0.459351],[9.291351,0.268666],[9.492889,1.01012],[9.830284,1.067894],[11.285079,1.057662],[11.276449,2.261051]]]}},{"type":"Feature","properties":{"name":"Equatorial Guinea"},"geometry":{"type":"Polygon","coordinates":[[[9.649158,2.283866],[11.276449,2.261051],[11.285079,1.057662],[9.830284,1.067894],[9.492889,1.01012],[9.305613,1.160911],[9.649158,2.283866]]]}},{"type":"Feature","properties":{"name":"Zambia"},"geometry":{"type":"Polygon","coordinates":[[[30.74001,-8.340006],[31.157751,-8.594579],[31.556348,-8.762049],[32.191865,-8.930359],[32.759375,-9.230599],[33.231388,-9.676722],[33.485688,-10.525559],[33.31531,-10.79655],[33.114289,-11.607198],[33.306422,-12.435778],[32.991764,-12.783871],[32.688165,-13.712858],[33.214025,-13.97186],[30.179481,-14.796099],[30.274256,-15.507787],[29.516834,-15.644678],[28.947463,-16.043051],[28.825869,-16.389749],[28.467906,-16.4684],[27.598243,-17.290831],[27.044427,-17.938026],[26.706773,-17.961229],[26.381935,-17.846042],[25.264226,-17.73654],[25.084443,-17.661816],[25.07695,-17.578823],[24.682349,-17.353411],[24.033862,-17.295843],[23.215048,-17.523116],[22.562478,-16.898451],[21.887843,-16.08031],[21.933886,-12.898437],[24.016137,-12.911046],[23.930922,-12.565848],[24.079905,-12.191297],[23.904154,-11.722282],[24.017894,-11.237298],[23.912215,-10.926826],[24.257155,-10.951993],[24.314516,-11.262826],[24.78317,-11.238694],[25.418118,-11.330936],[25.75231,-11.784965],[26.553088,-11.92444],[27.16442,-11.608748],[27.388799,-12.132747],[28.155109,-12.272481],[28.523562,-12.698604],[28.934286,-13.248958],[29.699614,-13.257227],[29.616001,-12.178895],[29.341548,-12.360744],[28.642417,-11.971569],[28.372253,-11.793647],[28.49607,-10.789884],[28.673682,-9.605925],[28.449871,-9.164918],[28.734867,-8.526559],[29.002912,-8.407032],[30.346086,-8.238257],[30.74001,-8.340006]]]}},{"type":"Feature","properties":{"name":"Malawi"},"geometry":{"type":"Polygon","coordinates":[[[32.759375,-9.230599],[33.73972,-9.41715],[33.940838,-9.693674],[34.28,-10.16],[34.559989,-11.52002],[34.280006,-12.280025],[34.559989,-13.579998],[34.907151,-13.565425],[35.267956,-13.887834],[35.686845,-14.611046],[35.771905,-15.896859],[35.339063,-16.10744],[35.03381,-16.8013],[34.381292,-16.18356],[34.307291,-15.478641],[34.517666,-15.013709],[34.459633,-14.61301],[34.064825,-14.35995],[33.7897,-14.451831],[33.214025,-13.97186],[32.688165,-13.712858],[32.991764,-12.783871],[33.306422,-12.435778],[33.114289,-11.607198],[33.31531,-10.79655],[33.485688,-10.525559],[33.231388,-9.676722],[32.759375,-9.230599]]]}},{"type":"Feature","properties":{"name":"Mozambique"},"geometry":{"type":"Polygon","coordinates":[[[34.559989,-11.52002],[35.312398,-11.439146],[36.514082,-11.720938],[36.775151,-11.594537],[37.47129,-11.56876],[37.82764,-11.26879],[38.427557,-11.285202],[39.521,-10.89688],[40.31659,-10.3171],[40.316586,-10.317098],[40.316589,-10.317096],[40.478387,-10.765441],[40.437253,-11.761711],[40.560811,-12.639177],[40.59962,-14.201975],[40.775475,-14.691764],[40.477251,-15.406294],[40.089264,-16.100774],[39.452559,-16.720891],[38.538351,-17.101023],[37.411133,-17.586368],[36.281279,-18.659688],[35.896497,-18.84226],[35.1984,-19.552811],[34.786383,-19.784012],[34.701893,-20.497043],[35.176127,-21.254361],[35.373428,-21.840837],[35.385848,-22.14],[35.562546,-22.09],[35.533935,-23.070788],[35.371774,-23.535359],[35.60747,-23.706563],[35.458746,-24.12261],[35.040735,-24.478351],[34.215824,-24.816314],[33.01321,-25.357573],[32.574632,-25.727318],[32.660363,-26.148584],[32.915955,-26.215867],[32.83012,-26.742192],[32.071665,-26.73382],[31.985779,-26.29178],[31.837778,-25.843332],[31.752408,-25.484284],[31.930589,-24.369417],[31.670398,-23.658969],[31.191409,-22.25151],[32.244988,-21.116489],[32.508693,-20.395292],[32.659743,-20.30429],[32.772708,-19.715592],[32.611994,-19.419383],[32.654886,-18.67209],[32.849861,-17.979057],[32.847639,-16.713398],[32.328239,-16.392074],[31.852041,-16.319417],[31.636498,-16.07199],[31.173064,-15.860944],[30.338955,-15.880839],[30.274256,-15.507787],[30.179481,-14.796099],[33.214025,-13.97186],[33.7897,-14.451831],[34.064825,-14.35995],[34.459633,-14.61301],[34.517666,-15.013709],[34.307291,-15.478641],[34.381292,-16.18356],[35.03381,-16.8013],[35.339063,-16.10744],[35.771905,-15.896859],[35.686845,-14.611046],[35.267956,-13.887834],[34.907151,-13.565425],[34.559989,-13.579998],[34.280006,-12.280025],[34.559989,-11.52002]]]}},{"type":"Feature","properties":{"name":"Eswatini"},"geometry":{"type":"Polygon","coordinates":[[[32.071665,-26.73382],[31.86806,-27.177927],[31.282773,-27.285879],[30.685962,-26.743845],[30.676609,-26.398078],[30.949667,-26.022649],[31.04408,-25.731452],[31.333158,-25.660191],[31.837778,-25.843332],[31.985779,-26.29178],[32.071665,-26.73382]]]}},{"type":"Feature","properties":{"name":"Angola"},"geometry":{"type":"MultiPolygon","coordinates":[[[[12.995517,-4.781103],[12.631612,-4.991271],[12.468004,-5.248362],[12.436688,-5.684304],[12.182337,-5.789931],[11.914963,-5.037987],[12.318608,-4.60623],[12.62076,-4.438023],[12.995517,-4.781103]]],[[[12.322432,-6.100092],[12.735171,-5.965682],[13.024869,-5.984389],[13.375597,-5.864241],[16.326528,-5.87747],[16.57318,-6.622645],[16.860191,-7.222298],[17.089996,-7.545689],[17.47297,-8.068551],[18.134222,-7.987678],[18.464176,-7.847014],[19.016752,-7.988246],[19.166613,-7.738184],[19.417502,-7.155429],[20.037723,-7.116361],[20.091622,-6.94309],[20.601823,-6.939318],[20.514748,-7.299606],[21.728111,-7.290872],[21.746456,-7.920085],[21.949131,-8.305901],[21.801801,-8.908707],[21.875182,-9.523708],[22.208753,-9.894796],[22.155268,-11.084801],[22.402798,-10.993075],[22.837345,-11.017622],[23.456791,-10.867863],[23.912215,-10.926826],[24.017894,-11.237298],[23.904154,-11.722282],[24.079905,-12.191297],[23.930922,-12.565848],[24.016137,-12.911046],[21.933886,-12.898437],[21.887843,-16.08031],[22.562478,-16.898451],[23.215048,-17.523116],[21.377176,-17.930636],[18.956187,-17.789095],[18.263309,-17.309951],[14.209707,-17.353101],[14.058501,-17.423381],[13.462362,-16.971212],[12.814081,-16.941343],[12.215461,-17.111668],[11.734199,-17.301889],[11.640096,-16.673142],[11.778537,-15.793816],[12.123581,-14.878316],[12.175619,-14.449144],[12.500095,-13.5477],[12.738479,-13.137906],[13.312914,-12.48363],[13.633721,-12.038645],[13.738728,-11.297863],[13.686379,-10.731076],[13.387328,-10.373578],[13.120988,-9.766897],[12.87537,-9.166934],[12.929061,-8.959091],[13.236433,-8.562629],[12.93304,-7.596539],[12.728298,-6.927122],[12.227347,-6.294448],[12.322432,-6.100092]]]]}},{"type":"Feature","properties":{"name":"Burundi"},"geometry":{"type":"Polygon","coordinates":[[[30.469674,-2.413855],[30.52766,-2.80762],[30.74301,-3.03431],[30.75224,-3.35931],[30.50554,-3.56858],[30.11632,-4.09012],[29.753512,-4.452389],[29.339998,-4.499983],[29.276384,-3.293907],[29.024926,-2.839258],[29.632176,-2.917858],[29.938359,-2.348487],[30.469674,-2.413855]]]}},{"type":"Feature","properties":{"name":"Israel"},"geometry":{"type":"Polygon","coordinates":[[[35.719918,32.709192],[35.545665,32.393992],[35.18393,32.532511],[34.974641,31.866582],[35.225892,31.754341],[34.970507,31.616778],[34.927408,31.353435],[35.397561,31.489086],[35.420918,31.100066],[34.922603,29.501326],[34.823243,29.761081],[34.26544,31.21936],[34.265435,31.219357],[34.265433,31.219361],[34.556372,31.548824],[34.488107,31.605539],[34.752587,32.072926],[34.955417,32.827376],[35.098457,33.080539],[35.126053,33.0909],[35.460709,33.08904],[35.552797,33.264275],[35.821101,33.277426],[35.836397,32.868123],[35.700798,32.716014],[35.719918,32.709192]]]}},{"type":"Feature","properties":{"name":"Lebanon"},"geometry":{"type":"Polygon","coordinates":[[[35.821101,33.277426],[35.552797,33.264275],[35.460709,33.08904],[35.126053,33.0909],[35.482207,33.90545],[35.979592,34.610058],[35.998403,34.644914],[36.448194,34.593935],[36.61175,34.201789],[36.06646,33.824912],[35.821101,33.277426]]]}},{"type":"Feature","properties":{"name":"Madagascar"},"geometry":{"type":"Polygon","coordinates":[[[49.543519,-12.469833],[49.808981,-12.895285],[50.056511,-13.555761],[50.217431,-14.758789],[50.476537,-15.226512],[50.377111,-15.706069],[50.200275,-16.000263],[49.860606,-15.414253],[49.672607,-15.710204],[49.863344,-16.451037],[49.774564,-16.875042],[49.498612,-17.106036],[49.435619,-17.953064],[49.041792,-19.118781],[48.548541,-20.496888],[47.930749,-22.391501],[47.547723,-23.781959],[47.095761,-24.94163],[46.282478,-25.178463],[45.409508,-25.601434],[44.833574,-25.346101],[44.03972,-24.988345],[43.763768,-24.460677],[43.697778,-23.574116],[43.345654,-22.776904],[43.254187,-22.057413],[43.433298,-21.336475],[43.893683,-21.163307],[43.89637,-20.830459],[44.374325,-20.072366],[44.464397,-19.435454],[44.232422,-18.961995],[44.042976,-18.331387],[43.963084,-17.409945],[44.312469,-16.850496],[44.446517,-16.216219],[44.944937,-16.179374],[45.502732,-15.974373],[45.872994,-15.793454],[46.312243,-15.780018],[46.882183,-15.210182],[47.70513,-14.594303],[48.005215,-14.091233],[47.869047,-13.663869],[48.293828,-13.784068],[48.84506,-13.089175],[48.863509,-12.487868],[49.194651,-12.040557],[49.543519,-12.469833]]]}},{"type":"Feature","properties":{"name":"Palestine"},"geometry":{"type":"Polygon","coordinates":[[[35.397561,31.489086],[34.927408,31.353435],[34.970507,31.616778],[35.225892,31.754341],[34.974641,31.866582],[35.18393,32.532511],[35.545665,32.393992],[35.545252,31.782505],[35.397561,31.489086]]]}},{"type":"Feature","properties":{"name":"The Gambia"},"geometry":{"type":"Polygon","coordinates":[[[-16.713729,13.594959],[-15.624596,13.623587],[-15.39877,13.860369],[-15.081735,13.876492],[-14.687031,13.630357],[-14.376714,13.62568],[-14.046992,13.794068],[-13.844963,13.505042],[-14.277702,13.280585],[-14.712197,13.298207],[-15.141163,13.509512],[-15.511813,13.27857],[-15.691001,13.270353],[-15.931296,13.130284],[-16.841525,13.151394],[-16.713729,13.594959]]]}},{"type":"Feature","properties":{"name":"Tunisia"},"geometry":{"type":"Polygon","coordinates":[[[9.48214,30.307556],[9.055603,32.102692],[8.439103,32.506285],[8.430473,32.748337],[7.612642,33.344115],[7.524482,34.097376],[8.140981,34.655146],[8.376368,35.479876],[8.217824,36.433177],[8.420964,36.946427],[9.509994,37.349994],[10.210002,37.230002],[10.18065,36.724038],[11.028867,37.092103],[11.100026,36.899996],[10.600005,36.41],[10.593287,35.947444],[10.939519,35.698984],[10.807847,34.833507],[10.149593,34.330773],[10.339659,33.785742],[10.856836,33.76874],[11.108501,33.293343],[11.488787,33.136996],[11.432253,32.368903],[10.94479,32.081815],[10.636901,31.761421],[9.950225,31.37607],[10.056575,30.961831],[9.970017,30.539325],[9.48214,30.307556]]]}},{"type":"Feature","properties":{"name":"Algeria"},"geometry":{"type":"Polygon","coordinates":[[[-8.6844,27.395744],[-8.665124,27.589479],[-8.66559,27.656426],[-8.674116,28.841289],[-7.059228,29.579228],[-6.060632,29.7317],[-5.242129,30.000443],[-4.859646,30.501188],[-3.690441,30.896952],[-3.647498,31.637294],[-3.06898,31.724498],[-2.616605,32.094346],[-1.307899,32.262889],[-1.124551,32.651522],[-1.388049,32.864015],[-1.733455,33.919713],[-1.792986,34.527919],[-2.169914,35.168396],[-1.208603,35.714849],[-0.127454,35.888662],[0.503877,36.301273],[1.466919,36.605647],[3.161699,36.783905],[4.815758,36.865037],[5.32012,36.716519],[6.26182,37.110655],[7.330385,37.118381],[7.737078,36.885708],[8.420964,36.946427],[8.217824,36.433177],[8.376368,35.479876],[8.140981,34.655146],[7.524482,34.097376],[7.612642,33.344115],[8.430473,32.748337],[8.439103,32.506285],[9.055603,32.102692],[9.48214,30.307556],[9.805634,29.424638],[9.859998,28.95999],[9.683885,28.144174],[9.756128,27.688259],[9.629056,27.140953],[9.716286,26.512206],[9.319411,26.094325],[9.910693,25.365455],[9.948261,24.936954],[10.303847,24.379313],[10.771364,24.562532],[11.560669,24.097909],[11.999506,23.471668],[8.572893,21.565661],[5.677566,19.601207],[4.267419,19.155265],[3.158133,19.057364],[3.146661,19.693579],[2.683588,19.85623],[2.060991,20.142233],[1.823228,20.610809],[-1.550055,22.792666],[-4.923337,24.974574],[-8.6844,27.395744]]]}},{"type":"Feature","properties":{"name":"Jordan"},"geometry":{"type":"Polygon","coordinates":[[[35.545665,32.393992],[35.719918,32.709192],[36.834062,32.312938],[38.792341,33.378686],[39.195468,32.161009],[39.004886,32.010217],[37.002166,31.508413],[37.998849,30.5085],[37.66812,30.338665],[37.503582,30.003776],[36.740528,29.865283],[36.501214,29.505254],[36.068941,29.197495],[34.956037,29.356555],[34.922603,29.501326],[35.420918,31.100066],[35.397561,31.489086],[35.545252,31.782505],[35.545665,32.393992]]]}},{"type":"Feature","properties":{"name":"United Arab Emirates"},"geometry":{"type":"Polygon","coordinates":[[[51.579519,24.245497],[51.757441,24.294073],[51.794389,24.019826],[52.577081,24.177439],[53.404007,24.151317],[54.008001,24.121758],[54.693024,24.797892],[55.439025,25.439145],[56.070821,26.055464],[56.261042,25.714606],[56.396847,24.924732],[55.886233,24.920831],[55.804119,24.269604],[55.981214,24.130543],[55.528632,23.933604],[55.525841,23.524869],[55.234489,23.110993],[55.208341,22.70833],[55.006803,22.496948],[52.000733,23.001154],[51.617708,24.014219],[51.579519,24.245497]]]}},{"type":"Feature","properties":{"name":"Qatar"},"geometry":{"type":"Polygon","coordinates":[[[50.810108,24.754743],[50.743911,25.482424],[51.013352,26.006992],[51.286462,26.114582],[51.589079,25.801113],[51.6067,25.21567],[51.389608,24.627386],[51.112415,24.556331],[50.810108,24.754743]]]}},{"type":"Feature","properties":{"name":"Kuwait"},"geometry":{"type":"Polygon","coordinates":[[[47.974519,29.975819],[48.183189,29.534477],[48.093943,29.306299],[48.416094,28.552004],[47.708851,28.526063],[47.459822,29.002519],[46.568713,29.099025],[47.302622,30.05907],[47.974519,29.975819]]]}},{"type":"Feature","properties":{"name":"Iraq"},"geometry":{"type":"Polygon","coordinates":[[[39.195468,32.161009],[38.792341,33.378686],[41.006159,34.419372],[41.383965,35.628317],[41.289707,36.358815],[41.837064,36.605854],[42.349591,37.229873],[42.779126,37.385264],[43.942259,37.256228],[44.293452,37.001514],[44.772677,37.170437],[45.420618,35.977546],[46.07634,35.677383],[46.151788,35.093259],[45.64846,34.748138],[45.416691,33.967798],[46.109362,33.017287],[47.334661,32.469155],[47.849204,31.709176],[47.685286,30.984853],[48.004698,30.985137],[48.014568,30.452457],[48.567971,29.926778],[47.974519,29.975819],[47.302622,30.05907],[46.568713,29.099025],[44.709499,29.178891],[41.889981,31.190009],[40.399994,31.889992],[39.195468,32.161009]]]}},{"type":"Feature","properties":{"name":"Oman"},"geometry":{"type":"MultiPolygon","coordinates":[[[[55.208341,22.70833],[55.234489,23.110993],[55.525841,23.524869],[55.528632,23.933604],[55.981214,24.130543],[55.804119,24.269604],[55.886233,24.920831],[56.396847,24.924732],[56.84514,24.241673],[57.403453,23.878594],[58.136948,23.747931],[58.729211,23.565668],[59.180502,22.992395],[59.450098,22.660271],[59.80806,22.533612],[59.806148,22.310525],[59.442191,21.714541],[59.282408,21.433886],[58.861141,21.114035],[58.487986,20.428986],[58.034318,20.481437],[57.826373,20.243002],[57.665762,19.736005],[57.7887,19.06757],[57.694391,18.94471],[57.234264,18.947991],[56.609651,18.574267],[56.512189,18.087113],[56.283521,17.876067],[55.661492,17.884128],[55.269939,17.632309],[55.2749,17.228354],[54.791002,16.950697],[54.239253,17.044981],[53.570508,16.707663],[53.108573,16.651051],[52.782184,17.349742],[52.00001,19.000003],[54.999982,19.999994],[55.666659,22.000001],[55.208341,22.70833]]],[[[56.261042,25.714606],[56.070821,26.055464],[56.362017,26.395934],[56.485679,26.309118],[56.391421,25.895991],[56.261042,25.714606]]]]}},{"type":"Feature","properties":{"name":"Vanuatu"},"geometry":{"type":"MultiPolygon","coordinates":[[[[167.216801,-15.891846],[167.844877,-16.466333],[167.515181,-16.59785],[167.180008,-16.159995],[167.216801,-15.891846]]],[[[166.793158,-15.668811],[166.649859,-15.392704],[166.629137,-14.626497],[167.107712,-14.93392],[167.270028,-15.740021],[167.001207,-15.614602],[166.793158,-15.668811]]]]}},{"type":"Feature","properties":{"name":"Cambodia"},"geometry":{"type":"Polygon","coordinates":[[[102.584932,12.186595],[102.348099,13.394247],[102.988422,14.225721],[104.281418,14.416743],[105.218777,14.273212],[106.043946,13.881091],[106.496373,14.570584],[107.382727,14.202441],[107.614548,13.535531],[107.491403,12.337206],[105.810524,11.567615],[106.24967,10.961812],[105.199915,10.88931],[104.334335,10.486544],[103.49728,10.632555],[103.09069,11.153661],[102.584932,12.186595]]]}},{"type":"Feature","properties":{"name":"Thailand"},"geometry":{"type":"Polygon","coordinates":[[[105.218777,14.273212],[104.281418,14.416743],[102.988422,14.225721],[102.348099,13.394247],[102.584932,12.186595],[101.687158,12.64574],[100.83181,12.627085],[100.978467,13.412722],[100.097797,13.406856],[100.018733,12.307001],[99.478921,10.846367],[99.153772,9.963061],[99.222399,9.239255],[99.873832,9.207862],[100.279647,8.295153],[100.459274,7.429573],[101.017328,6.856869],[101.623079,6.740622],[102.141187,6.221636],[101.814282,5.810808],[101.154219,5.691384],[101.075516,6.204867],[100.259596,6.642825],[100.085757,6.464489],[99.690691,6.848213],[99.519642,7.343454],[98.988253,7.907993],[98.503786,8.382305],[98.339662,7.794512],[98.150009,8.350007],[98.25915,8.973923],[98.553551,9.93296],[99.038121,10.960546],[99.587286,11.892763],[99.196354,12.804748],[99.212012,13.269294],[99.097755,13.827503],[98.430819,14.622028],[98.192074,15.123703],[98.537376,15.308497],[98.903348,16.177824],[98.493761,16.837836],[97.859123,17.567946],[97.375896,18.445438],[97.797783,18.62708],[98.253724,19.708203],[98.959676,19.752981],[99.543309,20.186598],[100.115988,20.41785],[100.548881,20.109238],[100.606294,19.508344],[101.282015,19.462585],[101.035931,18.408928],[101.059548,17.512497],[102.113592,18.109102],[102.413005,17.932782],[102.998706,17.961695],[103.200192,18.309632],[103.956477,18.240954],[104.716947,17.428859],[104.779321,16.441865],[105.589039,15.570316],[105.544338,14.723934],[105.218777,14.273212]]]}},{"type":"Feature","properties":{"name":"Laos"},"geometry":{"type":"Polygon","coordinates":[[[107.382727,14.202441],[106.496373,14.570584],[106.043946,13.881091],[105.218777,14.273212],[105.544338,14.723934],[105.589039,15.570316],[104.779321,16.441865],[104.716947,17.428859],[103.956477,18.240954],[103.200192,18.309632],[102.998706,17.961695],[102.413005,17.932782],[102.113592,18.109102],[101.059548,17.512497],[101.035931,18.408928],[101.282015,19.462585],[100.606294,19.508344],[100.548881,20.109238],[100.115988,20.41785],[100.329101,20.786122],[101.180005,21.436573],[101.270026,21.201652],[101.80312,21.174367],[101.652018,22.318199],[102.170436,22.464753],[102.754896,21.675137],[103.203861,20.766562],[104.435,20.758733],[104.822574,19.886642],[104.183388,19.624668],[103.896532,19.265181],[105.094598,18.666975],[105.925762,17.485315],[106.556008,16.604284],[107.312706,15.908538],[107.564525,15.202173],[107.382727,14.202441]]]}},{"type":"Feature","properties":{"name":"Myanmar"},"geometry":{"type":"Polygon","coordinates":[[[100.115988,20.41785],[99.543309,20.186598],[98.959676,19.752981],[98.253724,19.708203],[97.797783,18.62708],[97.375896,18.445438],[97.859123,17.567946],[98.493761,16.837836],[98.903348,16.177824],[98.537376,15.308497],[98.192074,15.123703],[98.430819,14.622028],[99.097755,13.827503],[99.212012,13.269294],[99.196354,12.804748],[99.587286,11.892763],[99.038121,10.960546],[98.553551,9.93296],[98.457174,10.675266],[98.764546,11.441292],[98.428339,12.032987],[98.509574,13.122378],[98.103604,13.64046],[97.777732,14.837286],[97.597072,16.100568],[97.16454,16.928734],[96.505769,16.427241],[95.369352,15.71439],[94.808405,15.803454],[94.188804,16.037936],[94.533486,17.27724],[94.324817,18.213514],[93.540988,19.366493],[93.663255,19.726962],[93.078278,19.855145],[92.368554,20.670883],[92.303234,21.475485],[92.652257,21.324048],[92.672721,22.041239],[93.166128,22.27846],[93.060294,22.703111],[93.286327,23.043658],[93.325188,24.078556],[94.106742,23.850741],[94.552658,24.675238],[94.603249,25.162495],[95.155153,26.001307],[95.124768,26.573572],[96.419366,27.264589],[97.133999,27.083774],[97.051989,27.699059],[97.402561,27.882536],[97.327114,28.261583],[97.911988,28.335945],[98.246231,27.747221],[98.68269,27.508812],[98.712094,26.743536],[98.671838,25.918703],[97.724609,25.083637],[97.60472,23.897405],[98.660262,24.063286],[98.898749,23.142722],[99.531992,22.949039],[99.240899,22.118314],[99.983489,21.742937],[100.416538,21.558839],[101.150033,21.849984],[101.180005,21.436573],[100.329101,20.786122],[100.115988,20.41785]]]}},{"type":"Feature","properties":{"name":"Vietnam"},"geometry":{"type":"Polygon","coordinates":[[[104.334335,10.486544],[105.199915,10.88931],[106.24967,10.961812],[105.810524,11.567615],[107.491403,12.337206],[107.614548,13.535531],[107.382727,14.202441],[107.564525,15.202173],[107.312706,15.908538],[106.556008,16.604284],[105.925762,17.485315],[105.094598,18.666975],[103.896532,19.265181],[104.183388,19.624668],[104.822574,19.886642],[104.435,20.758733],[103.203861,20.766562],[102.754896,21.675137],[102.170436,22.464753],[102.706992,22.708795],[103.504515,22.703757],[104.476858,22.81915],[105.329209,23.352063],[105.811247,22.976892],[106.725403,22.794268],[106.567273,22.218205],[107.04342,21.811899],[108.05018,21.55238],[106.715068,20.696851],[105.881682,19.75205],[105.662006,19.058165],[106.426817,18.004121],[107.361954,16.697457],[108.269495,16.079742],[108.877107,15.276691],[109.33527,13.426028],[109.200136,11.666859],[108.36613,11.008321],[107.220929,10.364484],[106.405113,9.53084],[105.158264,8.59976],[104.795185,9.241038],[105.076202,9.918491],[104.334335,10.486544]]]}},{"type":"Feature","properties":{"name":"North Korea"},"geometry":{"type":"MultiPolygon","coordinates":[[[[130.780004,42.220008],[130.780005,42.22001],[130.780007,42.220007],[130.780004,42.220008]]],[[[130.64,42.395024],[130.64,42.395],[130.779992,42.22001],[130.400031,42.280004],[129.965949,41.941368],[129.667362,41.601104],[129.705189,40.882828],[129.188115,40.661808],[129.0104,40.485436],[128.633368,40.189847],[127.967414,40.025413],[127.533436,39.75685],[127.50212,39.323931],[127.385434,39.213472],[127.783343,39.050898],[128.349716,38.612243],[128.205746,38.370397],[127.780035,38.304536],[127.073309,38.256115],[126.68372,37.804773],[126.237339,37.840378],[126.174759,37.749686],[125.689104,37.94001],[125.568439,37.752089],[125.27533,37.669071],[125.240087,37.857224],[124.981033,37.948821],[124.712161,38.108346],[124.985994,38.548474],[125.221949,38.665857],[125.132859,38.848559],[125.38659,39.387958],[125.321116,39.551385],[124.737482,39.660344],[124.265625,39.928493],[125.079942,40.569824],[126.182045,41.107336],[126.869083,41.816569],[127.343783,41.503152],[128.208433,41.466772],[128.052215,41.994285],[129.596669,42.424982],[129.994267,42.985387],[130.64,42.395024]]]]}},{"type":"Feature","properties":{"name":"South Korea"},"geometry":{"type":"Polygon","coordinates":[[[126.174759,37.749686],[126.237339,37.840378],[126.68372,37.804773],[127.073309,38.256115],[127.780035,38.304536],[128.205746,38.370397],[128.349716,38.612243],[129.21292,37.432392],[129.46045,36.784189],[129.468304,35.632141],[129.091377,35.082484],[128.18585,34.890377],[127.386519,34.475674],[126.485748,34.390046],[126.37392,34.93456],[126.559231,35.684541],[126.117398,36.725485],[126.860143,36.893924],[126.174759,37.749686]]]}},{"type":"Feature","properties":{"name":"Mongolia"},"geometry":{"type":"Polygon","coordinates":[[[87.751264,49.297198],[88.805567,49.470521],[90.713667,50.331812],[92.234712,50.802171],[93.10421,50.49529],[94.147566,50.480537],[94.815949,50.013433],[95.81402,49.97746],[97.25976,49.72605],[98.231762,50.422401],[97.82574,51.010995],[98.861491,52.047366],[99.981732,51.634006],[100.88948,51.516856],[102.06521,51.25991],[102.25589,50.51056],[103.676545,50.089966],[104.62158,50.27532],[105.886591,50.406019],[106.888804,50.274296],[107.868176,49.793705],[108.475167,49.282548],[109.402449,49.292961],[110.662011,49.130128],[111.581231,49.377968],[112.89774,49.543565],[114.362456,50.248303],[114.96211,50.140247],[115.485695,49.805177],[116.678801,49.888531],[116.191802,49.134598],[115.485282,48.135383],[115.742837,47.726545],[116.308953,47.85341],[117.295507,47.697709],[118.064143,48.06673],[118.866574,47.74706],[119.772824,47.048059],[119.66327,46.69268],[118.874326,46.805412],[117.421701,46.672733],[116.717868,46.388202],[115.985096,45.727235],[114.460332,45.339817],[113.463907,44.808893],[112.436062,45.011646],[111.873306,45.102079],[111.348377,44.457442],[111.667737,44.073176],[111.829588,43.743118],[111.129682,43.406834],[110.412103,42.871234],[109.243596,42.519446],[107.744773,42.481516],[106.129316,42.134328],[104.964994,41.59741],[104.522282,41.908347],[103.312278,41.907468],[101.83304,42.514873],[100.845866,42.663804],[99.515817,42.524691],[97.451757,42.74889],[96.349396,42.725635],[95.762455,43.319449],[95.306875,44.241331],[94.688929,44.352332],[93.480734,44.975472],[92.133891,45.115076],[90.94554,45.286073],[90.585768,45.719716],[90.970809,46.888146],[90.280826,47.693549],[88.854298,48.069082],[88.013832,48.599463],[87.751264,49.297198]]]}},{"type":"Feature","properties":{"name":"India"},"geometry":{"type":"Polygon","coordinates":[[[97.327114,28.261583],[97.402561,27.882536],[97.051989,27.699059],[97.133999,27.083774],[96.419366,27.264589],[95.124768,26.573572],[95.155153,26.001307],[94.603249,25.162495],[94.552658,24.675238],[94.106742,23.850741],[93.325188,24.078556],[93.286327,23.043658],[93.060294,22.703111],[93.166128,22.27846],[92.672721,22.041239],[92.146035,23.627499],[91.869928,23.624346],[91.706475,22.985264],[91.158963,23.503527],[91.46773,24.072639],[91.915093,24.130414],[92.376202,24.976693],[91.799596,25.147432],[90.872211,25.132601],[89.920693,25.26975],[89.832481,25.965082],[89.355094,26.014407],[88.563049,26.446526],[88.209789,25.768066],[88.931554,25.238692],[88.306373,24.866079],[88.084422,24.501657],[88.69994,24.233715],[88.52977,23.631142],[88.876312,22.879146],[89.031961,22.055708],[88.888766,21.690588],[88.208497,21.703172],[86.975704,21.495562],[87.033169,20.743308],[86.499351,20.151638],[85.060266,19.478579],[83.941006,18.30201],[83.189217,17.671221],[82.192792,17.016636],[82.191242,16.556664],[81.692719,16.310219],[80.791999,15.951972],[80.324896,15.899185],[80.025069,15.136415],[80.233274,13.835771],[80.286294,13.006261],[79.862547,12.056215],[79.857999,10.357275],[79.340512,10.308854],[78.885345,9.546136],[79.18972,9.216544],[78.277941,8.933047],[77.941165,8.252959],[77.539898,7.965535],[76.592979,8.899276],[76.130061,10.29963],[75.746467,11.308251],[75.396101,11.781245],[74.864816,12.741936],[74.616717,13.992583],[74.443859,14.617222],[73.534199,15.990652],[73.119909,17.92857],[72.820909,19.208234],[72.824475,20.419503],[72.630533,21.356009],[71.175273,20.757441],[70.470459,20.877331],[69.16413,22.089298],[69.644928,22.450775],[69.349597,22.84318],[68.176645,23.691965],[68.842599,24.359134],[71.04324,24.356524],[70.844699,25.215102],[70.282873,25.722229],[70.168927,26.491872],[69.514393,26.940966],[70.616496,27.989196],[71.777666,27.91318],[72.823752,28.961592],[73.450638,29.976413],[74.42138,30.979815],[74.405929,31.692639],[75.258642,32.271105],[74.451559,32.7649],[74.104294,33.441473],[73.749948,34.317699],[74.240203,34.748887],[75.757061,34.504923],[76.871722,34.653544],[77.837451,35.49401],[78.912269,34.321936],[78.811086,33.506198],[79.208892,32.994395],[79.176129,32.48378],[78.458446,32.618164],[78.738894,31.515906],[79.721367,30.882715],[81.111256,30.183481],[80.476721,29.729865],[80.088425,28.79447],[81.057203,28.416095],[81.999987,27.925479],[83.304249,27.364506],[84.675018,27.234901],[85.251779,26.726198],[86.024393,26.630985],[87.227472,26.397898],[88.060238,26.414615],[88.174804,26.810405],[88.043133,27.445819],[88.120441,27.876542],[88.730326,28.086865],[88.814248,27.299316],[88.835643,27.098966],[89.744528,26.719403],[90.373275,26.875724],[91.217513,26.808648],[92.033484,26.83831],[92.103712,27.452614],[91.696657,27.771742],[92.503119,27.896876],[93.413348,28.640629],[94.56599,29.277438],[95.404802,29.031717],[96.117679,29.452802],[96.586591,28.83098],[96.248833,28.411031],[97.327114,28.261583]]]}},{"type":"Feature","properties":{"name":"Bangladesh"},"geometry":{"type":"Polygon","coordinates":[[[92.672721,22.041239],[92.652257,21.324048],[92.303234,21.475485],[92.368554,20.670883],[92.082886,21.192195],[92.025215,21.70157],[91.834891,22.182936],[91.417087,22.765019],[90.496006,22.805017],[90.586957,22.392794],[90.272971,21.836368],[89.847467,22.039146],[89.70205,21.857116],[89.418863,21.966179],[89.031961,22.055708],[88.876312,22.879146],[88.52977,23.631142],[88.69994,24.233715],[88.084422,24.501657],[88.306373,24.866079],[88.931554,25.238692],[88.209789,25.768066],[88.563049,26.446526],[89.355094,26.014407],[89.832481,25.965082],[89.920693,25.26975],[90.872211,25.132601],[91.799596,25.147432],[92.376202,24.976693],[91.915093,24.130414],[91.46773,24.072639],[91.158963,23.503527],[91.706475,22.985264],[91.869928,23.624346],[92.146035,23.627499],[92.672721,22.041239]]]}},{"type":"Feature","properties":{"name":"Bhutan"},"geometry":{"type":"Polygon","coordinates":[[[91.696657,27.771742],[92.103712,27.452614],[92.033484,26.83831],[91.217513,26.808648],[90.373275,26.875724],[89.744528,26.719403],[88.835643,27.098966],[88.814248,27.299316],[89.47581,28.042759],[90.015829,28.296439],[90.730514,28.064954],[91.258854,28.040614],[91.696657,27.771742]]]}},{"type":"Feature","properties":{"name":"Nepal"},"geometry":{"type":"Polygon","coordinates":[[[88.120441,27.876542],[88.043133,27.445819],[88.174804,26.810405],[88.060238,26.414615],[87.227472,26.397898],[86.024393,26.630985],[85.251779,26.726198],[84.675018,27.234901],[83.304249,27.364506],[81.999987,27.925479],[81.057203,28.416095],[80.088425,28.79447],[80.476721,29.729865],[81.111256,30.183481],[81.525804,30.422717],[82.327513,30.115268],[83.337115,29.463732],[83.898993,29.320226],[84.23458,28.839894],[85.011638,28.642774],[85.82332,28.203576],[86.954517,27.974262],[88.120441,27.876542]]]}},{"type":"Feature","properties":{"name":"Pakistan"},"geometry":{"type":"Polygon","coordinates":[[[77.837451,35.49401],[76.871722,34.653544],[75.757061,34.504923],[74.240203,34.748887],[73.749948,34.317699],[74.104294,33.441473],[74.451559,32.7649],[75.258642,32.271105],[74.405929,31.692639],[74.42138,30.979815],[73.450638,29.976413],[72.823752,28.961592],[71.777666,27.91318],[70.616496,27.989196],[69.514393,26.940966],[70.168927,26.491872],[70.282873,25.722229],[70.844699,25.215102],[71.04324,24.356524],[68.842599,24.359134],[68.176645,23.691965],[67.443667,23.944844],[67.145442,24.663611],[66.372828,25.425141],[64.530408,25.237039],[62.905701,25.218409],[61.497363,25.078237],[61.874187,26.239975],[63.316632,26.756532],[63.233898,27.217047],[62.755426,27.378923],[62.72783,28.259645],[61.771868,28.699334],[61.369309,29.303276],[60.874248,29.829239],[62.549857,29.318572],[63.550261,29.468331],[64.148002,29.340819],[64.350419,29.560031],[65.046862,29.472181],[66.346473,29.887943],[66.381458,30.738899],[66.938891,31.304911],[67.683394,31.303154],[67.792689,31.58293],[68.556932,31.71331],[68.926677,31.620189],[69.317764,31.901412],[69.262522,32.501944],[69.687147,33.105499],[70.323594,33.358533],[69.930543,34.02012],[70.881803,33.988856],[71.156773,34.348911],[71.115019,34.733126],[71.613076,35.153203],[71.498768,35.650563],[71.262348,36.074388],[71.846292,36.509942],[72.920025,36.720007],[74.067552,36.836176],[74.575893,37.020841],[75.158028,37.133031],[75.896897,36.666806],[76.192848,35.898403],[77.837451,35.49401]]]}},{"type":"Feature","properties":{"name":"Afghanistan"},"geometry":{"type":"Polygon","coordinates":[[[66.518607,37.362784],[67.075782,37.356144],[67.83,37.144994],[68.135562,37.023115],[68.859446,37.344336],[69.196273,37.151144],[69.518785,37.608997],[70.116578,37.588223],[70.270574,37.735165],[70.376304,38.138396],[70.806821,38.486282],[71.348131,38.258905],[71.239404,37.953265],[71.541918,37.905774],[71.448693,37.065645],[71.844638,36.738171],[72.193041,36.948288],[72.63689,37.047558],[73.260056,37.495257],[73.948696,37.421566],[74.980002,37.41999],[75.158028,37.133031],[74.575893,37.020841],[74.067552,36.836176],[72.920025,36.720007],[71.846292,36.509942],[71.262348,36.074388],[71.498768,35.650563],[71.613076,35.153203],[71.115019,34.733126],[71.156773,34.348911],[70.881803,33.988856],[69.930543,34.02012],[70.323594,33.358533],[69.687147,33.105499],[69.262522,32.501944],[69.317764,31.901412],[68.926677,31.620189],[68.556932,31.71331],[67.792689,31.58293],[67.683394,31.303154],[66.938891,31.304911],[66.381458,30.738899],[66.346473,29.887943],[65.046862,29.472181],[64.350419,29.560031],[64.148002,29.340819],[63.550261,29.468331],[62.549857,29.318572],[60.874248,29.829239],[61.781222,30.73585],[61.699314,31.379506],[60.941945,31.548075],[60.863655,32.18292],[60.536078,32.981269],[60.9637,33.528832],[60.52843,33.676446],[60.803193,34.404102],[61.210817,35.650072],[62.230651,35.270664],[62.984662,35.404041],[63.193538,35.857166],[63.982896,36.007957],[64.546479,36.312073],[64.746105,37.111818],[65.588948,37.305217],[65.745631,37.661164],[66.217385,37.39379],[66.518607,37.362784]]]}},{"type":"Feature","properties":{"name":"Tajikistan"},"geometry":{"type":"Polygon","coordinates":[[[67.83,37.144994],[68.392033,38.157025],[68.176025,38.901553],[67.44222,39.140144],[67.701429,39.580478],[68.536416,39.533453],[69.011633,40.086158],[69.329495,40.727824],[70.666622,40.960213],[70.45816,40.496495],[70.601407,40.218527],[71.014198,40.244366],[70.648019,39.935754],[69.55961,40.103211],[69.464887,39.526683],[70.549162,39.604198],[71.784694,39.279463],[73.675379,39.431237],[73.928852,38.505815],[74.257514,38.606507],[74.864816,38.378846],[74.829986,37.990007],[74.980002,37.41999],[73.948696,37.421566],[73.260056,37.495257],[72.63689,37.047558],[72.193041,36.948288],[71.844638,36.738171],[71.448693,37.065645],[71.541918,37.905774],[71.239404,37.953265],[71.348131,38.258905],[70.806821,38.486282],[70.376304,38.138396],[70.270574,37.735165],[70.116578,37.588223],[69.518785,37.608997],[69.196273,37.151144],[68.859446,37.344336],[68.135562,37.023115],[67.83,37.144994]]]}},{"type":"Feature","properties":{"name":"Kyrgyzstan"},"geometry":{"type":"Polygon","coordinates":[[[70.962315,42.266154],[71.186281,42.704293],[71.844638,42.845395],[73.489758,42.500894],[73.645304,43.091272],[74.212866,43.298339],[75.636965,42.8779],[76.000354,42.988022],[77.658392,42.960686],[79.142177,42.856092],[79.643645,42.496683],[80.25999,42.349999],[80.11943,42.123941],[78.543661,41.582243],[78.187197,41.185316],[76.904484,41.066486],[76.526368,40.427946],[75.467828,40.562072],[74.776862,40.366425],[73.822244,39.893973],[73.960013,39.660008],[73.675379,39.431237],[71.784694,39.279463],[70.549162,39.604198],[69.464887,39.526683],[69.55961,40.103211],[70.648019,39.935754],[71.014198,40.244366],[71.774875,40.145844],[73.055417,40.866033],[71.870115,41.3929],[71.157859,41.143587],[70.420022,41.519998],[71.259248,42.167711],[70.962315,42.266154]]]}},{"type":"Feature","properties":{"name":"Turkmenistan"},"geometry":{"type":"Polygon","coordinates":[[[52.50246,41.783316],[52.944293,42.116034],[54.079418,42.324109],[54.755345,42.043971],[55.455251,41.259859],[55.968191,41.308642],[57.096391,41.32231],[56.932215,41.826026],[57.78653,42.170553],[58.629011,42.751551],[59.976422,42.223082],[60.083341,41.425146],[60.465953,41.220327],[61.547179,41.26637],[61.882714,41.084857],[62.37426,40.053886],[63.518015,39.363257],[64.170223,38.892407],[65.215999,38.402695],[66.54615,37.974685],[66.518607,37.362784],[66.217385,37.39379],[65.745631,37.661164],[65.588948,37.305217],[64.746105,37.111818],[64.546479,36.312073],[63.982896,36.007957],[63.193538,35.857166],[62.984662,35.404041],[62.230651,35.270664],[61.210817,35.650072],[61.123071,36.491597],[60.377638,36.527383],[59.234762,37.412988],[58.436154,37.522309],[57.330434,38.029229],[56.619366,38.121394],[56.180375,37.935127],[55.511578,37.964117],[54.800304,37.392421],[53.921598,37.198918],[53.735511,37.906136],[53.880929,38.952093],[53.101028,39.290574],[53.357808,39.975286],[52.693973,40.033629],[52.915251,40.876523],[53.858139,40.631034],[54.736845,40.951015],[54.008311,41.551211],[53.721713,42.123191],[52.91675,41.868117],[52.814689,41.135371],[52.50246,41.783316]]]}},{"type":"Feature","properties":{"name":"Iran"},"geometry":{"type":"Polygon","coordinates":[[[48.567971,29.926778],[48.014568,30.452457],[48.004698,30.985137],[47.685286,30.984853],[47.849204,31.709176],[47.334661,32.469155],[46.109362,33.017287],[45.416691,33.967798],[45.64846,34.748138],[46.151788,35.093259],[46.07634,35.677383],[45.420618,35.977546],[44.772677,37.170437],[44.77267,37.17045],[44.225756,37.971584],[44.421403,38.281281],[44.109225,39.428136],[44.79399,39.713003],[44.952688,39.335765],[45.457722,38.874139],[46.143623,38.741201],[46.50572,38.770605],[47.685079,39.508364],[48.060095,39.582235],[48.355529,39.288765],[48.010744,38.794015],[48.634375,38.270378],[48.883249,38.320245],[49.199612,37.582874],[50.147771,37.374567],[50.842354,36.872814],[52.264025,36.700422],[53.82579,36.965031],[53.921598,37.198918],[54.800304,37.392421],[55.511578,37.964117],[56.180375,37.935127],[56.619366,38.121394],[57.330434,38.029229],[58.436154,37.522309],[59.234762,37.412988],[60.377638,36.527383],[61.123071,36.491597],[61.210817,35.650072],[60.803193,34.404102],[60.52843,33.676446],[60.9637,33.528832],[60.536078,32.981269],[60.863655,32.18292],[60.941945,31.548075],[61.699314,31.379506],[61.781222,30.73585],[60.874248,29.829239],[61.369309,29.303276],[61.771868,28.699334],[62.72783,28.259645],[62.755426,27.378923],[63.233898,27.217047],[63.316632,26.756532],[61.874187,26.239975],[61.497363,25.078237],[59.616134,25.380157],[58.525761,25.609962],[57.397251,25.739902],[56.970766,26.966106],[56.492139,27.143305],[55.72371,26.964633],[54.71509,26.480658],[53.493097,26.812369],[52.483598,27.580849],[51.520763,27.86569],[50.852948,28.814521],[50.115009,30.147773],[49.57685,29.985715],[48.941333,30.31709],[48.567971,29.926778]]]}},{"type":"Feature","properties":{"name":"Syria"},"geometry":{"type":"Polygon","coordinates":[[[35.719918,32.709192],[35.700798,32.716014],[35.836397,32.868123],[35.821101,33.277426],[36.06646,33.824912],[36.61175,34.201789],[36.448194,34.593935],[35.998403,34.644914],[35.905023,35.410009],[36.149763,35.821535],[36.41755,36.040617],[36.685389,36.259699],[36.739494,36.81752],[37.066761,36.623036],[38.167727,36.90121],[38.699891,36.712927],[39.52258,36.716054],[40.673259,37.091276],[41.212089,37.074352],[42.349591,37.229873],[41.837064,36.605854],[41.289707,36.358815],[41.383965,35.628317],[41.006159,34.419372],[38.792341,33.378686],[36.834062,32.312938],[35.719918,32.709192]]]}},{"type":"Feature","properties":{"name":"Armenia"},"geometry":{"type":"Polygon","coordinates":[[[46.50572,38.770605],[46.143623,38.741201],[45.735379,39.319719],[45.739978,39.473999],[45.298145,39.471751],[45.001987,39.740004],[44.79399,39.713003],[44.400009,40.005],[43.656436,40.253564],[43.752658,40.740201],[43.582746,41.092143],[44.97248,41.248129],[45.179496,40.985354],[45.560351,40.81229],[45.359175,40.561504],[45.891907,40.218476],[45.610012,39.899994],[46.034534,39.628021],[46.483499,39.464155],[46.50572,38.770605]]]}},{"type":"Feature","properties":{"name":"Sweden"},"geometry":{"type":"Polygon","coordinates":[[[11.027369,58.856149],[11.468272,59.432393],[12.300366,60.117933],[12.631147,61.293572],[11.992064,61.800362],[11.930569,63.128318],[12.579935,64.066219],[13.571916,64.049114],[13.919905,64.445421],[13.55569,64.787028],[15.108411,66.193867],[16.108712,67.302456],[16.768879,68.013937],[17.729182,68.010552],[17.993868,68.567391],[19.87856,68.407194],[20.025269,69.065139],[20.645593,69.106247],[21.978535,68.616846],[23.539473,67.936009],[23.56588,66.396051],[23.903379,66.006927],[22.183173,65.723741],[21.213517,65.026005],[21.369631,64.413588],[19.778876,63.609554],[17.847779,62.7494],[17.119555,61.341166],[17.831346,60.636583],[18.787722,60.081914],[17.869225,58.953766],[16.829185,58.719827],[16.44771,57.041118],[15.879786,56.104302],[14.666681,56.200885],[14.100721,55.407781],[12.942911,55.361737],[12.625101,56.30708],[11.787942,57.441817],[11.027369,58.856149]]]}},{"type":"Feature","properties":{"name":"Belarus"},"geometry":{"type":"Polygon","coordinates":[[[28.176709,56.16913],[29.229513,55.918344],[29.371572,55.670091],[29.896294,55.789463],[30.873909,55.550976],[30.971836,55.081548],[30.757534,54.811771],[31.384472,54.157056],[31.791424,53.974639],[31.731273,53.794029],[32.405599,53.618045],[32.693643,53.351421],[32.304519,53.132726],[31.49764,53.16743],[31.305201,53.073996],[31.540018,52.742052],[31.78597,52.10168],[31.785992,52.101678],[30.927549,52.042353],[30.619454,51.822806],[30.555117,51.319503],[30.157364,51.416138],[29.254938,51.368234],[28.992835,51.602044],[28.617613,51.427714],[28.241615,51.572227],[27.454066,51.592303],[26.337959,51.832289],[25.327788,51.910656],[24.553106,51.888461],[24.005078,51.617444],[23.527071,51.578454],[23.508002,52.023647],[23.199494,52.486977],[23.799199,52.691099],[23.804935,53.089731],[23.527536,53.470122],[23.484128,53.912498],[24.450684,53.905702],[25.536354,54.282423],[25.768433,54.846963],[26.588279,55.167176],[26.494331,55.615107],[27.10246,55.783314],[28.176709,56.16913]]]}},{"type":"Feature","properties":{"name":"Ukraine"},"geometry":{"type":"Polygon","coordinates":[[[31.785992,52.101678],[32.15944,52.06125],[32.412058,52.288695],[32.715761,52.238465],[33.7527,52.335075],[34.391731,51.768882],[34.141978,51.566413],[34.224816,51.255993],[35.022183,51.207572],[35.37791,50.77394],[35.356116,50.577197],[36.626168,50.225591],[37.39346,50.383953],[38.010631,49.915662],[38.594988,49.926462],[40.06904,49.60105],[40.080789,49.30743],[39.67465,48.78382],[39.89562,48.23241],[39.738278,47.898937],[38.77057,47.82562],[38.255112,47.5464],[38.223538,47.10219],[37.425137,47.022221],[36.759855,46.6987],[35.823685,46.645964],[34.962342,46.273197],[35.012659,45.737725],[34.861792,45.768182],[34.732017,45.965666],[34.410402,46.005162],[33.699462,46.219573],[33.435988,45.971917],[33.298567,46.080598],[31.74414,46.333348],[31.675307,46.706245],[30.748749,46.5831],[30.377609,46.03241],[29.603289,45.293308],[29.149725,45.464925],[28.679779,45.304031],[28.233554,45.488283],[28.485269,45.596907],[28.659987,45.939987],[28.933717,46.25883],[28.862972,46.437889],[29.072107,46.517678],[29.170654,46.379262],[29.759972,46.349988],[30.024659,46.423937],[29.83821,46.525326],[29.908852,46.674361],[29.559674,46.928583],[29.415135,47.346645],[29.050868,47.510227],[29.122698,47.849095],[28.670891,48.118149],[28.259547,48.155562],[27.522537,48.467119],[26.857824,48.368211],[26.619337,48.220726],[26.19745,48.220881],[25.945941,47.987149],[25.207743,47.891056],[24.866317,47.737526],[24.402056,47.981878],[23.760958,47.985598],[23.142236,48.096341],[22.710531,47.882194],[22.64082,48.15024],[22.085608,48.422264],[22.280842,48.825392],[22.558138,49.085738],[22.776419,49.027395],[22.51845,49.476774],[23.426508,50.308506],[23.922757,50.424881],[24.029986,50.705407],[23.527071,51.578454],[24.005078,51.617444],[24.553106,51.888461],[25.327788,51.910656],[26.337959,51.832289],[27.454066,51.592303],[28.241615,51.572227],[28.617613,51.427714],[28.992835,51.602044],[29.254938,51.368234],[30.157364,51.416138],[30.555117,51.319503],[30.619454,51.822806],[30.927549,52.042353],[31.785992,52.101678]]]}},{"type":"Feature","properties":{"name":"Poland"},"geometry":{"type":"Polygon","coordinates":[[[23.484128,53.912498],[23.527536,53.470122],[23.804935,53.089731],[23.799199,52.691099],[23.199494,52.486977],[23.508002,52.023647],[23.527071,51.578454],[24.029986,50.705407],[23.922757,50.424881],[23.426508,50.308506],[22.51845,49.476774],[22.776419,49.027395],[22.558138,49.085738],[21.607808,49.470107],[20.887955,49.328772],[20.415839,49.431453],[19.825023,49.217125],[19.320713,49.571574],[18.909575,49.435846],[18.853144,49.49623],[18.392914,49.988629],[17.649445,50.049038],[17.554567,50.362146],[16.868769,50.473974],[16.719476,50.215747],[16.176253,50.422607],[16.238627,50.697733],[15.490972,50.78473],[15.016996,51.106674],[14.607098,51.745188],[14.685026,52.089947],[14.4376,52.62485],[14.074521,52.981263],[14.353315,53.248171],[14.119686,53.757029],[14.8029,54.050706],[16.363477,54.513159],[17.622832,54.851536],[18.620859,54.682606],[18.696255,54.438719],[19.66064,54.426084],[20.892245,54.312525],[22.731099,54.327537],[23.243987,54.220567],[23.484128,53.912498]]]}},{"type":"Feature","properties":{"name":"Austria"},"geometry":{"type":"Polygon","coordinates":[[[16.979667,48.123497],[16.903754,47.714866],[16.340584,47.712902],[16.534268,47.496171],[16.202298,46.852386],[16.011664,46.683611],[15.137092,46.658703],[14.632472,46.431817],[13.806475,46.509306],[12.376485,46.767559],[12.153088,47.115393],[11.164828,46.941579],[11.048556,46.751359],[10.442701,46.893546],[9.932448,46.920728],[9.47997,47.10281],[9.632932,47.347601],[9.594226,47.525058],[9.896068,47.580197],[10.402084,47.302488],[10.544504,47.566399],[11.426414,47.523766],[12.141357,47.703083],[12.62076,47.672388],[12.932627,47.467646],[13.025851,47.637584],[12.884103,48.289146],[13.243357,48.416115],[13.595946,48.877172],[14.338898,48.555305],[14.901447,48.964402],[15.253416,49.039074],[16.029647,48.733899],[16.499283,48.785808],[16.960288,48.596982],[16.879983,48.470013],[16.979667,48.123497]]]}},{"type":"Feature","properties":{"name":"Hungary"},"geometry":{"type":"Polygon","coordinates":[[[22.085608,48.422264],[22.64082,48.15024],[22.710531,47.882194],[22.099768,47.672439],[21.626515,46.994238],[21.021952,46.316088],[20.220192,46.127469],[19.596045,46.17173],[18.829838,45.908878],[18.829825,45.908872],[18.456062,45.759481],[17.630066,45.951769],[16.882515,46.380632],[16.564808,46.503751],[16.370505,46.841327],[16.202298,46.852386],[16.534268,47.496171],[16.340584,47.712902],[16.903754,47.714866],[16.979667,48.123497],[17.488473,47.867466],[17.857133,47.758429],[18.696513,47.880954],[18.777025,48.081768],[19.174365,48.111379],[19.661364,48.266615],[19.769471,48.202691],[20.239054,48.327567],[20.473562,48.56285],[20.801294,48.623854],[21.872236,48.319971],[22.085608,48.422264]]]}},{"type":"Feature","properties":{"name":"Moldova"},"geometry":{"type":"Polygon","coordinates":[[[26.619337,48.220726],[26.857824,48.368211],[27.522537,48.467119],[28.259547,48.155562],[28.670891,48.118149],[29.122698,47.849095],[29.050868,47.510227],[29.415135,47.346645],[29.559674,46.928583],[29.908852,46.674361],[29.83821,46.525326],[30.024659,46.423937],[29.759972,46.349988],[29.170654,46.379262],[29.072107,46.517678],[28.862972,46.437889],[28.933717,46.25883],[28.659987,45.939987],[28.485269,45.596907],[28.233554,45.488283],[28.054443,45.944586],[28.160018,46.371563],[28.12803,46.810476],[27.551166,47.405117],[27.233873,47.826771],[26.924176,48.123264],[26.619337,48.220726]]]}},{"type":"Feature","properties":{"name":"Romania"},"geometry":{"type":"Polygon","coordinates":[[[28.233554,45.488283],[28.679779,45.304031],[29.149725,45.464925],[29.603289,45.293308],[29.626543,45.035391],[29.141612,44.82021],[28.837858,44.913874],[28.558081,43.707462],[27.970107,43.812468],[27.2424,44.175986],[26.065159,43.943494],[25.569272,43.688445],[24.100679,43.741051],[23.332302,43.897011],[22.944832,43.823785],[22.65715,44.234923],[22.474008,44.409228],[22.705726,44.578003],[22.459022,44.702517],[22.145088,44.478422],[21.562023,44.768947],[21.483526,45.18117],[20.874313,45.416375],[20.762175,45.734573],[20.220192,46.127469],[21.021952,46.316088],[21.626515,46.994238],[22.099768,47.672439],[22.710531,47.882194],[23.142236,48.096341],[23.760958,47.985598],[24.402056,47.981878],[24.866317,47.737526],[25.207743,47.891056],[25.945941,47.987149],[26.19745,48.220881],[26.619337,48.220726],[26.924176,48.123264],[27.233873,47.826771],[27.551166,47.405117],[28.12803,46.810476],[28.160018,46.371563],[28.054443,45.944586],[28.233554,45.488283]]]}},{"type":"Feature","properties":{"name":"Lithuania"},"geometry":{"type":"Polygon","coordinates":[[[26.494331,55.615107],[26.588279,55.167176],[25.768433,54.846963],[25.536354,54.282423],[24.450684,53.905702],[23.484128,53.912498],[23.243987,54.220567],[22.731099,54.327537],[22.651052,54.582741],[22.757764,54.856574],[22.315724,55.015299],[21.268449,55.190482],[21.0558,56.031076],[22.201157,56.337802],[23.878264,56.273671],[24.860684,56.372528],[25.000934,56.164531],[25.533047,56.100297],[26.494331,55.615107]]]}},{"type":"Feature","properties":{"name":"Latvia"},"geometry":{"type":"Polygon","coordinates":[[[27.288185,57.474528],[27.770016,57.244258],[27.855282,56.759326],[28.176709,56.16913],[27.10246,55.783314],[26.494331,55.615107],[25.533047,56.100297],[25.000934,56.164531],[24.860684,56.372528],[23.878264,56.273671],[22.201157,56.337802],[21.0558,56.031076],[21.090424,56.783873],[21.581866,57.411871],[22.524341,57.753374],[23.318453,57.006236],[24.12073,57.025693],[24.312863,57.793424],[25.164594,57.970157],[25.60281,57.847529],[26.463532,57.476389],[27.288185,57.474528]]]}},{"type":"Feature","properties":{"name":"Estonia"},"geometry":{"type":"Polygon","coordinates":[[[27.981127,59.475373],[27.98112,59.47537],[28.131699,59.300825],[27.42015,58.72457],[27.716686,57.791899],[27.288185,57.474528],[26.463532,57.476389],[25.60281,57.847529],[25.164594,57.970157],[24.312863,57.793424],[24.428928,58.383413],[24.061198,58.257375],[23.42656,58.612753],[23.339795,59.18724],[24.604214,59.465854],[25.864189,59.61109],[26.949136,59.445803],[27.981114,59.475388],[27.981127,59.475373]]]}},{"type":"Feature","properties":{"name":"Germany"},"geometry":{"type":"Polygon","coordinates":[[[14.119686,53.757029],[14.353315,53.248171],[14.074521,52.981263],[14.4376,52.62485],[14.685026,52.089947],[14.607098,51.745188],[15.016996,51.106674],[14.570718,51.002339],[14.307013,51.117268],[14.056228,50.926918],[13.338132,50.733234],[12.966837,50.484076],[12.240111,50.266338],[12.415191,49.969121],[12.521024,49.547415],[13.031329,49.307068],[13.595946,48.877172],[13.243357,48.416115],[12.884103,48.289146],[13.025851,47.637584],[12.932627,47.467646],[12.62076,47.672388],[12.141357,47.703083],[11.426414,47.523766],[10.544504,47.566399],[10.402084,47.302488],[9.896068,47.580197],[9.594226,47.525058],[8.522612,47.830828],[8.317301,47.61358],[7.466759,47.620582],[7.593676,48.333019],[8.099279,49.017784],[6.65823,49.201958],[6.18632,49.463803],[6.242751,49.902226],[6.043073,50.128052],[6.156658,50.803721],[5.988658,51.851616],[6.589397,51.852029],[6.84287,52.22844],[7.092053,53.144043],[6.90514,53.482162],[7.100425,53.693932],[7.936239,53.748296],[8.121706,53.527792],[8.800734,54.020786],[8.572118,54.395646],[8.526229,54.962744],[9.282049,54.830865],[9.921906,54.983104],[9.93958,54.596642],[10.950112,54.363607],[10.939467,54.008693],[11.956252,54.196486],[12.51844,54.470371],[13.647467,54.075511],[14.119686,53.757029]]]}},{"type":"Feature","properties":{"name":"Bulgaria"},"geometry":{"type":"Polygon","coordinates":[[[22.65715,44.234923],[22.944832,43.823785],[23.332302,43.897011],[24.100679,43.741051],[25.569272,43.688445],[26.065159,43.943494],[27.2424,44.175986],[27.970107,43.812468],[28.558081,43.707462],[28.039095,43.293172],[27.673898,42.577892],[27.99672,42.007359],[27.135739,42.141485],[26.117042,41.826905],[26.106138,41.328899],[25.197201,41.234486],[24.492645,41.583896],[23.692074,41.309081],[22.952377,41.337994],[22.881374,41.999297],[22.380526,42.32026],[22.545012,42.461362],[22.436595,42.580321],[22.604801,42.898519],[22.986019,43.211161],[22.500157,43.642814],[22.410446,44.008063],[22.65715,44.234923]]]}},{"type":"Feature","properties":{"name":"Greece"},"geometry":{"type":"MultiPolygon","coordinates":[[[[26.290003,35.29999],[26.164998,35.004995],[24.724982,34.919988],[24.735007,35.084991],[23.514978,35.279992],[23.69998,35.705004],[24.246665,35.368022],[25.025015,35.424996],[25.769208,35.354018],[25.745023,35.179998],[26.290003,35.29999]]],[[[22.952377,41.337994],[23.692074,41.309081],[24.492645,41.583896],[25.197201,41.234486],[26.106138,41.328899],[26.117042,41.826905],[26.604196,41.562115],[26.294602,40.936261],[26.056942,40.824123],[25.447677,40.852545],[24.925848,40.947062],[23.714811,40.687129],[24.407999,40.124993],[23.899968,39.962006],[23.342999,39.960998],[22.813988,40.476005],[22.626299,40.256561],[22.849748,39.659311],[23.350027,39.190011],[22.973099,38.970903],[23.530016,38.510001],[24.025025,38.219993],[24.040011,37.655015],[23.115003,37.920011],[23.409972,37.409991],[22.774972,37.30501],[23.154225,36.422506],[22.490028,36.41],[21.670026,36.844986],[21.295011,37.644989],[21.120034,38.310323],[20.730032,38.769985],[20.217712,39.340235],[20.150016,39.624998],[20.615,40.110007],[20.674997,40.435],[20.99999,40.580004],[21.02004,40.842727],[21.674161,40.931275],[22.055378,41.149866],[22.597308,41.130487],[22.76177,41.3048],[22.952377,41.337994]]]]}},{"type":"Feature","properties":{"name":"Turkey"},"geometry":{"type":"MultiPolygon","coordinates":[[[[44.772677,37.170437],[44.293452,37.001514],[43.942259,37.256228],[42.779126,37.385264],[42.349591,37.229873],[41.212089,37.074352],[40.673259,37.091276],[39.52258,36.716054],[38.699891,36.712927],[38.167727,36.90121],[37.066761,36.623036],[36.739494,36.81752],[36.685389,36.259699],[36.41755,36.040617],[36.149763,35.821535],[35.782085,36.274995],[36.160822,36.650606],[35.550936,36.565443],[34.714553,36.795532],[34.026895,36.21996],[32.509158,36.107564],[31.699595,36.644275],[30.621625,36.677865],[30.391096,36.262981],[29.699976,36.144357],[28.732903,36.676831],[27.641187,36.658822],[27.048768,37.653361],[26.318218,38.208133],[26.8047,38.98576],[26.170785,39.463612],[27.28002,40.420014],[28.819978,40.460011],[29.240004,41.219991],[31.145934,41.087622],[32.347979,41.736264],[33.513283,42.01896],[35.167704,42.040225],[36.913127,41.335358],[38.347665,40.948586],[39.512607,41.102763],[40.373433,41.013673],[41.554084,41.535656],[42.619549,41.583173],[43.582746,41.092143],[43.752658,40.740201],[43.656436,40.253564],[44.400009,40.005],[44.79399,39.713003],[44.109225,39.428136],[44.421403,38.281281],[44.225756,37.971584],[44.77267,37.17045],[44.772677,37.170437]]],[[[26.117042,41.826905],[27.135739,42.141485],[27.99672,42.007359],[28.115525,41.622886],[28.988443,41.299934],[28.806438,41.054962],[27.619017,40.999823],[27.192377,40.690566],[26.358009,40.151994],[26.043351,40.617754],[26.056942,40.824123],[26.294602,40.936261],[26.604196,41.562115],[26.117042,41.826905]]]]}},{"type":"Feature","properties":{"name":"Albania"},"geometry":{"type":"Polygon","coordinates":[[[21.02004,40.842727],[20.99999,40.580004],[20.674997,40.435],[20.615,40.110007],[20.150016,39.624998],[19.98,39.694993],[19.960002,39.915006],[19.406082,40.250773],[19.319059,40.72723],[19.40355,41.409566],[19.540027,41.719986],[19.371769,41.877548],[19.371768,41.877551],[19.304486,42.195745],[19.738051,42.688247],[19.801613,42.500093],[20.0707,42.58863],[20.283755,42.32026],[20.52295,42.21787],[20.590247,41.855409],[20.590247,41.855404],[20.463175,41.515089],[20.605182,41.086226],[21.02004,40.842727]]]}},{"type":"Feature","properties":{"name":"Croatia"},"geometry":{"type":"Polygon","coordinates":[[[16.564808,46.503751],[16.882515,46.380632],[17.630066,45.951769],[18.456062,45.759481],[18.829825,45.908872],[19.072769,45.521511],[19.390476,45.236516],[19.005485,44.860234],[18.553214,45.08159],[17.861783,45.06774],[17.002146,45.233777],[16.534939,45.211608],[16.318157,45.004127],[15.959367,45.233777],[15.750026,44.818712],[16.23966,44.351143],[16.456443,44.04124],[16.916156,43.667722],[17.297373,43.446341],[17.674922,43.028563],[18.56,42.65],[18.450017,42.479992],[18.450016,42.479991],[17.50997,42.849995],[16.930006,43.209998],[16.015385,43.507215],[15.174454,44.243191],[15.37625,44.317915],[14.920309,44.738484],[14.901602,45.07606],[14.258748,45.233777],[13.952255,44.802124],[13.656976,45.136935],[13.679403,45.484149],[13.71506,45.500324],[14.411968,45.466166],[14.595109,45.634941],[14.935244,45.471695],[15.327675,45.452316],[15.323954,45.731783],[15.67153,45.834154],[15.768733,46.238108],[16.564808,46.503751]]]}},{"type":"Feature","properties":{"name":"Switzerland"},"geometry":{"type":"Polygon","coordinates":[[[9.594226,47.525058],[9.632932,47.347601],[9.47997,47.10281],[9.932448,46.920728],[10.442701,46.893546],[10.363378,46.483571],[9.922837,46.314899],[9.182882,46.440215],[8.966306,46.036932],[8.489952,46.005151],[8.31663,46.163642],[7.755992,45.82449],[7.273851,45.776948],[6.843593,45.991147],[6.5001,46.429673],[6.022609,46.27299],[6.037389,46.725779],[6.768714,47.287708],[6.736571,47.541801],[7.192202,47.449766],[7.466759,47.620582],[8.317301,47.61358],[8.522612,47.830828],[9.594226,47.525058]]]}},{"type":"Feature","properties":{"name":"Luxembourg"},"geometry":{"type":"Polygon","coordinates":[[[6.043073,50.128052],[6.242751,49.902226],[6.18632,49.463803],[5.897759,49.442667],[5.674052,49.529484],[5.782417,50.090328],[6.043073,50.128052]]]}},{"type":"Feature","properties":{"name":"Belgium"},"geometry":{"type":"Polygon","coordinates":[[[6.156658,50.803721],[6.043073,50.128052],[5.782417,50.090328],[5.674052,49.529484],[4.799222,49.985373],[4.286023,49.907497],[3.588184,50.378992],[3.123252,50.780363],[2.658422,50.796848],[2.513573,51.148506],[3.314971,51.345781],[3.315011,51.345777],[3.314971,51.345755],[4.047071,51.267259],[4.973991,51.475024],[5.606976,51.037298],[6.156658,50.803721]]]}},{"type":"Feature","properties":{"name":"Netherlands"},"geometry":{"type":"Polygon","coordinates":[[[6.90514,53.482162],[7.092053,53.144043],[6.84287,52.22844],[6.589397,51.852029],[5.988658,51.851616],[6.156658,50.803721],[5.606976,51.037298],[4.973991,51.475024],[4.047071,51.267259],[3.314971,51.345755],[3.315011,51.345777],[3.830289,51.620545],[4.705997,53.091798],[6.074183,53.510403],[6.90514,53.482162]]]}},{"type":"Feature","properties":{"name":"Portugal"},"geometry":{"type":"Polygon","coordinates":[[[-9.034818,41.880571],[-8.671946,42.134689],[-8.263857,42.280469],[-8.013175,41.790886],[-7.422513,41.792075],[-7.251309,41.918346],[-6.668606,41.883387],[-6.389088,41.381815],[-6.851127,41.111083],[-6.86402,40.330872],[-7.026413,40.184524],[-7.066592,39.711892],[-7.498632,39.629571],[-7.098037,39.030073],[-7.374092,38.373059],[-7.029281,38.075764],[-7.166508,37.803894],[-7.537105,37.428904],[-7.453726,37.097788],[-7.855613,36.838269],[-8.382816,36.97888],[-8.898857,36.868809],[-8.746101,37.651346],[-8.839998,38.266243],[-9.287464,38.358486],[-9.526571,38.737429],[-9.446989,39.392066],[-9.048305,39.755093],[-8.977353,40.159306],[-8.768684,40.760639],[-8.790853,41.184334],[-8.990789,41.543459],[-9.034818,41.880571]]]}},{"type":"Feature","properties":{"name":"Spain"},"geometry":{"type":"Polygon","coordinates":[[[-7.453726,37.097788],[-7.537105,37.428904],[-7.166508,37.803894],[-7.029281,38.075764],[-7.374092,38.373059],[-7.098037,39.030073],[-7.498632,39.629571],[-7.066592,39.711892],[-7.026413,40.184524],[-6.86402,40.330872],[-6.851127,41.111083],[-6.389088,41.381815],[-6.668606,41.883387],[-7.251309,41.918346],[-7.422513,41.792075],[-8.013175,41.790886],[-8.263857,42.280469],[-8.671946,42.134689],[-9.034818,41.880571],[-8.984433,42.592775],[-9.392884,43.026625],[-7.97819,43.748338],[-6.754492,43.567909],[-5.411886,43.57424],[-4.347843,43.403449],[-3.517532,43.455901],[-1.901351,43.422802],[-1.502771,43.034014],[0.338047,42.579546],[0.701591,42.795734],[1.826793,42.343385],[2.985999,42.473015],[3.039484,41.89212],[2.091842,41.226089],[0.810525,41.014732],[0.721331,40.678318],[0.106692,40.123934],[-0.278711,39.309978],[0.111291,38.738514],[-0.467124,38.292366],[-0.683389,37.642354],[-1.438382,37.443064],[-2.146453,36.674144],[-3.415781,36.6589],[-4.368901,36.677839],[-4.995219,36.324708],[-5.37716,35.94685],[-5.866432,36.029817],[-6.236694,36.367677],[-6.520191,36.942913],[-7.453726,37.097788]]]}},{"type":"Feature","properties":{"name":"Ireland"},"geometry":{"type":"Polygon","coordinates":[[[-6.197885,53.867565],[-6.032985,53.153164],[-6.788857,52.260118],[-8.561617,51.669301],[-9.977086,51.820455],[-9.166283,52.864629],[-9.688525,53.881363],[-8.327987,54.664519],[-7.572168,55.131622],[-7.366031,54.595841],[-7.572168,54.059956],[-6.95373,54.073702],[-6.197885,53.867565]]]}},{"type":"Feature","properties":{"name":"New Caledonia"},"geometry":{"type":"Polygon","coordinates":[[[165.77999,-21.080005],[166.599991,-21.700019],[167.120011,-22.159991],[166.740035,-22.399976],[166.189732,-22.129708],[165.474375,-21.679607],[164.829815,-21.14982],[164.167995,-20.444747],[164.029606,-20.105646],[164.459967,-20.120012],[165.020036,-20.459991],[165.460009,-20.800022],[165.77999,-21.080005]]]}},{"type":"Feature","properties":{"name":"Solomon Islands"},"geometry":{"type":"MultiPolygon","coordinates":[[[[162.119025,-10.482719],[162.398646,-10.826367],[161.700032,-10.820011],[161.319797,-10.204751],[161.917383,-10.446701],[162.119025,-10.482719]]],[[[161.679982,-9.599982],[161.529397,-9.784312],[160.788253,-8.917543],[160.579997,-8.320009],[160.920028,-8.320009],[161.280006,-9.120011],[161.679982,-9.599982]]],[[[160.852229,-9.872937],[160.462588,-9.89521],[159.849447,-9.794027],[159.640003,-9.63998],[159.702945,-9.24295],[160.362956,-9.400304],[160.688518,-9.610162],[160.852229,-9.872937]]],[[[159.640003,-8.020027],[159.875027,-8.33732],[159.917402,-8.53829],[159.133677,-8.114181],[158.586114,-7.754824],[158.21115,-7.421872],[158.359978,-7.320018],[158.820001,-7.560003],[159.640003,-8.020027]]],[[[157.14,-7.021638],[157.538426,-7.34782],[157.33942,-7.404767],[156.90203,-7.176874],[156.491358,-6.765943],[156.542828,-6.599338],[157.14,-7.021638]]]]}},{"type":"Feature","properties":{"name":"New Zealand"},"geometry":{"type":"MultiPolygon","coordinates":[[[[176.885824,-40.065978],[176.508017,-40.604808],[176.01244,-41.289624],[175.239567,-41.688308],[175.067898,-41.425895],[174.650973,-41.281821],[175.22763,-40.459236],[174.900157,-39.908933],[173.824047,-39.508854],[173.852262,-39.146602],[174.574802,-38.797683],[174.743474,-38.027808],[174.697017,-37.381129],[174.292028,-36.711092],[174.319004,-36.534824],[173.840997,-36.121981],[173.054171,-35.237125],[172.636005,-34.529107],[173.007042,-34.450662],[173.551298,-35.006183],[174.32939,-35.265496],[174.612009,-36.156397],[175.336616,-37.209098],[175.357596,-36.526194],[175.808887,-36.798942],[175.95849,-37.555382],[176.763195,-37.881253],[177.438813,-37.961248],[178.010354,-37.579825],[178.517094,-37.695373],[178.274731,-38.582813],[177.97046,-39.166343],[177.206993,-39.145776],[176.939981,-39.449736],[177.032946,-39.879943],[176.885824,-40.065978]]],[[[169.667815,-43.555326],[170.52492,-43.031688],[171.12509,-42.512754],[171.569714,-41.767424],[171.948709,-41.514417],[172.097227,-40.956104],[172.79858,-40.493962],[173.020375,-40.919052],[173.247234,-41.331999],[173.958405,-40.926701],[174.247587,-41.349155],[174.248517,-41.770008],[173.876447,-42.233184],[173.22274,-42.970038],[172.711246,-43.372288],[173.080113,-43.853344],[172.308584,-43.865694],[171.452925,-44.242519],[171.185138,-44.897104],[170.616697,-45.908929],[169.831422,-46.355775],[169.332331,-46.641235],[168.411354,-46.619945],[167.763745,-46.290197],[166.676886,-46.219917],[166.509144,-45.852705],[167.046424,-45.110941],[168.303763,-44.123973],[168.949409,-43.935819],[169.667815,-43.555326]]]]}},{"type":"Feature","properties":{"name":"Australia"},"geometry":{"type":"MultiPolygon","coordinates":[[[[147.689259,-40.808258],[148.289068,-40.875438],[148.359865,-42.062445],[148.017301,-42.407024],[147.914052,-43.211522],[147.564564,-42.937689],[146.870343,-43.634597],[146.663327,-43.580854],[146.048378,-43.549745],[145.43193,-42.693776],[145.29509,-42.03361],[144.718071,-41.162552],[144.743755,-40.703975],[145.397978,-40.792549],[146.364121,-41.137695],[146.908584,-41.000546],[147.689259,-40.808258]]],[[[126.148714,-32.215966],[125.088623,-32.728751],[124.221648,-32.959487],[124.028947,-33.483847],[123.659667,-33.890179],[122.811036,-33.914467],[122.183064,-34.003402],[121.299191,-33.821036],[120.580268,-33.930177],[119.893695,-33.976065],[119.298899,-34.509366],[119.007341,-34.464149],[118.505718,-34.746819],[118.024972,-35.064733],[117.295507,-35.025459],[116.625109,-35.025097],[115.564347,-34.386428],[115.026809,-34.196517],[115.048616,-33.623425],[115.545123,-33.487258],[115.714674,-33.259572],[115.679379,-32.900369],[115.801645,-32.205062],[115.689611,-31.612437],[115.160909,-30.601594],[114.997043,-30.030725],[115.040038,-29.461095],[114.641974,-28.810231],[114.616498,-28.516399],[114.173579,-28.118077],[114.048884,-27.334765],[113.477498,-26.543134],[113.338953,-26.116545],[113.778358,-26.549025],[113.440962,-25.621278],[113.936901,-25.911235],[114.232852,-26.298446],[114.216161,-25.786281],[113.721255,-24.998939],[113.625344,-24.683971],[113.393523,-24.384764],[113.502044,-23.80635],[113.706993,-23.560215],[113.843418,-23.059987],[113.736552,-22.475475],[114.149756,-21.755881],[114.225307,-22.517488],[114.647762,-21.82952],[115.460167,-21.495173],[115.947373,-21.068688],[116.711615,-20.701682],[117.166316,-20.623599],[117.441545,-20.746899],[118.229559,-20.374208],[118.836085,-20.263311],[118.987807,-20.044203],[119.252494,-19.952942],[119.805225,-19.976506],[120.85622,-19.683708],[121.399856,-19.239756],[121.655138,-18.705318],[122.241665,-18.197649],[122.286624,-17.798603],[122.312772,-17.254967],[123.012574,-16.4052],[123.433789,-17.268558],[123.859345,-17.069035],[123.503242,-16.596506],[123.817073,-16.111316],[124.258287,-16.327944],[124.379726,-15.56706],[124.926153,-15.0751],[125.167275,-14.680396],[125.670087,-14.51007],[125.685796,-14.230656],[126.125149,-14.347341],[126.142823,-14.095987],[126.582589,-13.952791],[127.065867,-13.817968],[127.804633,-14.276906],[128.35969,-14.86917],[128.985543,-14.875991],[129.621473,-14.969784],[129.4096,-14.42067],[129.888641,-13.618703],[130.339466,-13.357376],[130.183506,-13.10752],[130.617795,-12.536392],[131.223495,-12.183649],[131.735091,-12.302453],[132.575298,-12.114041],[132.557212,-11.603012],[131.824698,-11.273782],[132.357224,-11.128519],[133.019561,-11.376411],[133.550846,-11.786515],[134.393068,-12.042365],[134.678632,-11.941183],[135.298491,-12.248606],[135.882693,-11.962267],[136.258381,-12.049342],[136.492475,-11.857209],[136.95162,-12.351959],[136.685125,-12.887223],[136.305407,-13.29123],[135.961758,-13.324509],[136.077617,-13.724278],[135.783836,-14.223989],[135.428664,-14.715432],[135.500184,-14.997741],[136.295175,-15.550265],[137.06536,-15.870762],[137.580471,-16.215082],[138.303217,-16.807604],[138.585164,-16.806622],[139.108543,-17.062679],[139.260575,-17.371601],[140.215245,-17.710805],[140.875463,-17.369069],[141.07111,-16.832047],[141.274095,-16.38887],[141.398222,-15.840532],[141.702183,-15.044921],[141.56338,-14.561333],[141.63552,-14.270395],[141.519869,-13.698078],[141.65092,-12.944688],[141.842691,-12.741548],[141.68699,-12.407614],[141.928629,-11.877466],[142.118488,-11.328042],[142.143706,-11.042737],[142.51526,-10.668186],[142.79731,-11.157355],[142.866763,-11.784707],[143.115947,-11.90563],[143.158632,-12.325656],[143.522124,-12.834358],[143.597158,-13.400422],[143.561811,-13.763656],[143.922099,-14.548311],[144.563714,-14.171176],[144.894908,-14.594458],[145.374724,-14.984976],[145.271991,-15.428205],[145.48526,-16.285672],[145.637033,-16.784918],[145.888904,-16.906926],[146.160309,-17.761655],[146.063674,-18.280073],[146.387478,-18.958274],[147.471082,-19.480723],[148.177602,-19.955939],[148.848414,-20.39121],[148.717465,-20.633469],[149.28942,-21.260511],[149.678337,-22.342512],[150.077382,-22.122784],[150.482939,-22.556142],[150.727265,-22.402405],[150.899554,-23.462237],[151.609175,-24.076256],[152.07354,-24.457887],[152.855197,-25.267501],[153.136162,-26.071173],[153.161949,-26.641319],[153.092909,-27.2603],[153.569469,-28.110067],[153.512108,-28.995077],[153.339095,-29.458202],[153.069241,-30.35024],[153.089602,-30.923642],[152.891578,-31.640446],[152.450002,-32.550003],[151.709117,-33.041342],[151.343972,-33.816023],[151.010555,-34.31036],[150.714139,-35.17346],[150.32822,-35.671879],[150.075212,-36.420206],[149.946124,-37.109052],[149.997284,-37.425261],[149.423882,-37.772681],[148.304622,-37.809061],[147.381733,-38.219217],[146.922123,-38.606532],[146.317922,-39.035757],[145.489652,-38.593768],[144.876976,-38.417448],[145.032212,-37.896188],[144.485682,-38.085324],[143.609974,-38.809465],[142.745427,-38.538268],[142.17833,-38.380034],[141.606582,-38.308514],[140.638579,-38.019333],[139.992158,-37.402936],[139.806588,-36.643603],[139.574148,-36.138362],[139.082808,-35.732754],[138.120748,-35.612296],[138.449462,-35.127261],[138.207564,-34.384723],[137.71917,-35.076825],[136.829406,-35.260535],[137.352371,-34.707339],[137.503886,-34.130268],[137.890116,-33.640479],[137.810328,-32.900007],[136.996837,-33.752771],[136.372069,-34.094766],[135.989043,-34.890118],[135.208213,-34.47867],[135.239218,-33.947953],[134.613417,-33.222778],[134.085904,-32.848072],[134.273903,-32.617234],[132.990777,-32.011224],[132.288081,-31.982647],[131.326331,-31.495803],[129.535794,-31.590423],[128.240938,-31.948489],[127.102867,-32.282267],[126.148714,-32.215966]]]]}},{"type":"Feature","properties":{"name":"Sri Lanka"},"geometry":{"type":"Polygon","coordinates":[[[81.787959,7.523055],[81.637322,6.481775],[81.21802,6.197141],[80.348357,5.96837],[79.872469,6.763463],[79.695167,8.200843],[80.147801,9.824078],[80.838818,9.268427],[81.304319,8.564206],[81.787959,7.523055]]]}},{"type":"Feature","properties":{"name":"People's Republic of China"},"geometry":{"type":"MultiPolygon","coordinates":[[[[109.47521,18.197701],[108.655208,18.507682],[108.626217,19.367888],[109.119056,19.821039],[110.211599,20.101254],[110.786551,20.077534],[111.010051,19.69593],[110.570647,19.255879],[110.339188,18.678395],[109.47521,18.197701]]],[[[80.25999,42.349999],[80.18015,42.920068],[80.866206,43.180362],[79.966106,44.917517],[81.947071,45.317027],[82.458926,45.53965],[83.180484,47.330031],[85.16429,47.000956],[85.720484,47.452969],[85.768233,48.455751],[86.598776,48.549182],[87.35997,49.214981],[87.751264,49.297198],[88.013832,48.599463],[88.854298,48.069082],[90.280826,47.693549],[90.970809,46.888146],[90.585768,45.719716],[90.94554,45.286073],[92.133891,45.115076],[93.480734,44.975472],[94.688929,44.352332],[95.306875,44.241331],[95.762455,43.319449],[96.349396,42.725635],[97.451757,42.74889],[99.515817,42.524691],[100.845866,42.663804],[101.83304,42.514873],[103.312278,41.907468],[104.522282,41.908347],[104.964994,41.59741],[106.129316,42.134328],[107.744773,42.481516],[109.243596,42.519446],[110.412103,42.871234],[111.129682,43.406834],[111.829588,43.743118],[111.667737,44.073176],[111.348377,44.457442],[111.873306,45.102079],[112.436062,45.011646],[113.463907,44.808893],[114.460332,45.339817],[115.985096,45.727235],[116.717868,46.388202],[117.421701,46.672733],[118.874326,46.805412],[119.66327,46.69268],[119.772824,47.048059],[118.866574,47.74706],[118.064143,48.06673],[117.295507,47.697709],[116.308953,47.85341],[115.742837,47.726545],[115.485282,48.135383],[116.191802,49.134598],[116.678801,49.888531],[117.879244,49.510983],[119.288461,50.142883],[119.27939,50.58292],[120.18208,51.64355],[120.7382,51.96411],[120.725789,52.516226],[120.177089,52.753886],[121.003085,53.251401],[122.245748,53.431726],[123.57147,53.4588],[125.068211,53.161045],[125.946349,52.792799],[126.564399,51.784255],[126.939157,51.353894],[127.287456,50.739797],[127.6574,49.76027],[129.397818,49.4406],[130.582293,48.729687],[130.98726,47.79013],[132.50669,47.78896],[133.373596,48.183442],[135.026311,48.47823],[134.50081,47.57845],[134.11235,47.21248],[133.769644,46.116927],[133.09712,45.14409],[131.883454,45.321162],[131.02519,44.96796],[131.288555,44.11152],[131.144688,42.92999],[130.633866,42.903015],[130.64,42.395024],[129.994267,42.985387],[129.596669,42.424982],[128.052215,41.994285],[128.208433,41.466772],[127.343783,41.503152],[126.869083,41.816569],[126.182045,41.107336],[125.079942,40.569824],[124.265625,39.928493],[122.86757,39.637788],[122.131388,39.170452],[121.054554,38.897471],[121.585995,39.360854],[121.376757,39.750261],[122.168595,40.422443],[121.640359,40.94639],[120.768629,40.593388],[119.639602,39.898056],[119.023464,39.252333],[118.042749,39.204274],[117.532702,38.737636],[118.059699,38.061476],[118.87815,37.897325],[118.911636,37.448464],[119.702802,37.156389],[120.823457,37.870428],[121.711259,37.481123],[122.357937,37.454484],[122.519995,36.930614],[121.104164,36.651329],[120.637009,36.11144],[119.664562,35.609791],[119.151208,34.909859],[120.227525,34.360332],[120.620369,33.376723],[121.229014,32.460319],[121.908146,31.692174],[121.891919,30.949352],[121.264257,30.676267],[121.503519,30.142915],[122.092114,29.83252],[121.938428,29.018022],[121.684439,28.225513],[121.125661,28.135673],[120.395473,27.053207],[119.585497,25.740781],[118.656871,24.547391],[117.281606,23.624501],[115.890735,22.782873],[114.763827,22.668074],[114.152547,22.22376],[113.80678,22.54834],[113.241078,22.051367],[111.843592,21.550494],[110.785466,21.397144],[110.444039,20.341033],[109.889861,20.282457],[109.627655,21.008227],[109.864488,21.395051],[108.522813,21.715212],[108.05018,21.55238],[107.04342,21.811899],[106.567273,22.218205],[106.725403,22.794268],[105.811247,22.976892],[105.329209,23.352063],[104.476858,22.81915],[103.504515,22.703757],[102.706992,22.708795],[102.170436,22.464753],[101.652018,22.318199],[101.80312,21.174367],[101.270026,21.201652],[101.180005,21.436573],[101.150033,21.849984],[100.416538,21.558839],[99.983489,21.742937],[99.240899,22.118314],[99.531992,22.949039],[98.898749,23.142722],[98.660262,24.063286],[97.60472,23.897405],[97.724609,25.083637],[98.671838,25.918703],[98.712094,26.743536],[98.68269,27.508812],[98.246231,27.747221],[97.911988,28.335945],[97.327114,28.261583],[96.248833,28.411031],[96.586591,28.83098],[96.117679,29.452802],[95.404802,29.031717],[94.56599,29.277438],[93.413348,28.640629],[92.503119,27.896876],[91.696657,27.771742],[91.258854,28.040614],[90.730514,28.064954],[90.015829,28.296439],[89.47581,28.042759],[88.814248,27.299316],[88.730326,28.086865],[88.120441,27.876542],[86.954517,27.974262],[85.82332,28.203576],[85.011638,28.642774],[84.23458,28.839894],[83.898993,29.320226],[83.337115,29.463732],[82.327513,30.115268],[81.525804,30.422717],[81.111256,30.183481],[79.721367,30.882715],[78.738894,31.515906],[78.458446,32.618164],[79.176129,32.48378],[79.208892,32.994395],[78.811086,33.506198],[78.912269,34.321936],[77.837451,35.49401],[76.192848,35.898403],[75.896897,36.666806],[75.158028,37.133031],[74.980002,37.41999],[74.829986,37.990007],[74.864816,38.378846],[74.257514,38.606507],[73.928852,38.505815],[73.675379,39.431237],[73.960013,39.660008],[73.822244,39.893973],[74.776862,40.366425],[75.467828,40.562072],[76.526368,40.427946],[76.904484,41.066486],[78.187197,41.185316],[78.543661,41.582243],[80.11943,42.123941],[80.25999,42.349999]]]]}},{"type":"Feature","properties":{"name":"Taiwan"},"geometry":{"type":"Polygon","coordinates":[[[121.777818,24.394274],[121.175632,22.790857],[120.74708,21.970571],[120.220083,22.814861],[120.106189,23.556263],[120.69468,24.538451],[121.495044,25.295459],[121.951244,24.997596],[121.777818,24.394274]]]}},{"type":"Feature","properties":{"name":"Italy"},"geometry":{"type":"MultiPolygon","coordinates":[[[[10.442701,46.893546],[11.048556,46.751359],[11.164828,46.941579],[12.153088,47.115393],[12.376485,46.767559],[13.806475,46.509306],[13.69811,46.016778],[13.93763,45.591016],[13.141606,45.736692],[12.328581,45.381778],[12.383875,44.885374],[12.261453,44.600482],[12.589237,44.091366],[13.526906,43.587727],[14.029821,42.761008],[15.14257,41.95514],[15.926191,41.961315],[16.169897,41.740295],[15.889346,41.541082],[16.785002,41.179606],[17.519169,40.877143],[18.376687,40.355625],[18.480247,40.168866],[18.293385,39.810774],[17.73838,40.277671],[16.869596,40.442235],[16.448743,39.795401],[17.17149,39.4247],[17.052841,38.902871],[16.635088,38.843572],[16.100961,37.985899],[15.684087,37.908849],[15.687963,38.214593],[15.891981,38.750942],[16.109332,38.964547],[15.718814,39.544072],[15.413613,40.048357],[14.998496,40.172949],[14.703268,40.60455],[14.060672,40.786348],[13.627985,41.188287],[12.888082,41.25309],[12.106683,41.704535],[11.191906,42.355425],[10.511948,42.931463],[10.200029,43.920007],[9.702488,44.036279],[8.888946,44.366336],[8.428561,44.231228],[7.850767,43.767148],[7.435185,43.693845],[7.549596,44.127901],[7.007562,44.254767],[6.749955,45.028518],[7.096652,45.333099],[6.802355,45.70858],[6.843593,45.991147],[7.273851,45.776948],[7.755992,45.82449],[8.31663,46.163642],[8.489952,46.005151],[8.966306,46.036932],[9.182882,46.440215],[9.922837,46.314899],[10.363378,46.483571],[10.442701,46.893546]]],[[[14.761249,38.143874],[15.520376,38.231155],[15.160243,37.444046],[15.309898,37.134219],[15.099988,36.619987],[14.335229,36.996631],[13.826733,37.104531],[12.431004,37.61295],[12.570944,38.126381],[13.741156,38.034966],[14.761249,38.143874]]],[[[8.709991,40.899984],[9.210012,41.209991],[9.809975,40.500009],[9.669519,39.177376],[9.214818,39.240473],[8.806936,38.906618],[8.428302,39.171847],[8.388253,40.378311],[8.159998,40.950007],[8.709991,40.899984]]]]}},{"type":"Feature","properties":{"name":"Denmark"},"geometry":{"type":"MultiPolygon","coordinates":[[[[9.921906,54.983104],[9.282049,54.830865],[8.526229,54.962744],[8.120311,55.517723],[8.089977,56.540012],[8.256582,56.809969],[8.543438,57.110003],[9.424469,57.172066],[9.775559,57.447941],[10.580006,57.730017],[10.546106,57.215733],[10.25,56.890016],[10.369993,56.609982],[10.912182,56.458621],[10.667804,56.081383],[10.369993,56.190007],[9.649985,55.469999],[9.921906,54.983104]]],[[[12.370904,56.111407],[12.690006,55.609991],[12.089991,54.800015],[11.043543,55.364864],[10.903914,55.779955],[12.370904,56.111407]]]]}},{"type":"Feature","properties":{"name":"United Kingdom"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-6.197885,53.867565],[-6.95373,54.073702],[-7.572168,54.059956],[-7.366031,54.595841],[-7.572168,55.131622],[-6.733847,55.17286],[-5.661949,54.554603],[-6.197885,53.867565]]],[[[-3.093831,53.404547],[-3.09208,53.404441],[-2.945009,53.985],[-3.614701,54.600937],[-3.630005,54.615013],[-4.844169,54.790971],[-5.082527,55.061601],[-4.719112,55.508473],[-5.047981,55.783986],[-5.586398,55.311146],[-5.644999,56.275015],[-6.149981,56.78501],[-5.786825,57.818848],[-5.009999,58.630013],[-4.211495,58.550845],[-3.005005,58.635],[-4.073828,57.553025],[-3.055002,57.690019],[-1.959281,57.6848],[-2.219988,56.870017],[-3.119003,55.973793],[-2.085009,55.909998],[-2.005676,55.804903],[-1.114991,54.624986],[-0.430485,54.464376],[0.184981,53.325014],[0.469977,52.929999],[1.681531,52.73952],[1.559988,52.099998],[1.050562,51.806761],[1.449865,51.289428],[0.550334,50.765739],[-0.787517,50.774989],[-2.489998,50.500019],[-2.956274,50.69688],[-3.617448,50.228356],[-4.542508,50.341837],[-5.245023,49.96],[-5.776567,50.159678],[-4.30999,51.210001],[-3.414851,51.426009],[-3.422719,51.426848],[-4.984367,51.593466],[-5.267296,51.9914],[-4.222347,52.301356],[-4.770013,52.840005],[-4.579999,53.495004],[-3.093831,53.404547]]]]}},{"type":"Feature","properties":{"name":"Iceland"},"geometry":{"type":"Polygon","coordinates":[[[-14.508695,66.455892],[-14.739637,65.808748],[-13.609732,65.126671],[-14.909834,64.364082],[-17.794438,63.678749],[-18.656246,63.496383],[-19.972755,63.643635],[-22.762972,63.960179],[-21.778484,64.402116],[-23.955044,64.89113],[-22.184403,65.084968],[-22.227423,65.378594],[-24.326184,65.611189],[-23.650515,66.262519],[-22.134922,66.410469],[-20.576284,65.732112],[-19.056842,66.276601],[-17.798624,65.993853],[-16.167819,66.526792],[-14.508695,66.455892]]]}},{"type":"Feature","properties":{"name":"Azerbaijan"},"geometry":{"type":"MultiPolygon","coordinates":[[[[46.404951,41.860675],[46.686071,41.827137],[47.373315,41.219732],[47.815666,41.151416],[47.987283,41.405819],[48.584353,41.808869],[49.110264,41.282287],[49.618915,40.572924],[50.08483,40.526157],[50.392821,40.256561],[49.569202,40.176101],[49.395259,39.399482],[49.223228,39.049219],[48.856532,38.815486],[48.883249,38.320245],[48.634375,38.270378],[48.010744,38.794015],[48.355529,39.288765],[48.060095,39.582235],[47.685079,39.508364],[46.50572,38.770605],[46.483499,39.464155],[46.034534,39.628021],[45.610012,39.899994],[45.891907,40.218476],[45.359175,40.561504],[45.560351,40.81229],[45.179496,40.985354],[44.97248,41.248129],[45.217426,41.411452],[45.962601,41.123873],[46.501637,41.064445],[46.637908,41.181673],[46.145432,41.722802],[46.404951,41.860675]]],[[[46.143623,38.741201],[45.457722,38.874139],[44.952688,39.335765],[44.79399,39.713003],[45.001987,39.740004],[45.298145,39.471751],[45.739978,39.473999],[45.735379,39.319719],[46.143623,38.741201]]]]}},{"type":"Feature","properties":{"name":"Georgia"},"geometry":{"type":"Polygon","coordinates":[[[39.955009,43.434998],[40.076965,43.553104],[40.92219,43.38215],[42.3944,43.2203],[43.75599,42.74083],[43.93121,42.55496],[44.537623,42.711993],[45.470279,42.502781],[45.7764,42.09244],[46.404951,41.860675],[46.145432,41.722802],[46.637908,41.181673],[46.501637,41.064445],[45.962601,41.123873],[45.217426,41.411452],[44.97248,41.248129],[43.582746,41.092143],[42.619549,41.583173],[41.554084,41.535656],[41.703171,41.962943],[41.45347,42.645123],[40.875469,43.013628],[40.321394,43.128634],[39.955009,43.434998]]]}},{"type":"Feature","properties":{"name":"Philippines"},"geometry":{"type":"MultiPolygon","coordinates":[[[[120.833896,12.704496],[120.323436,13.466413],[121.180128,13.429697],[121.527394,13.06959],[121.26219,12.20556],[120.833896,12.704496]]],[[[122.586089,9.981045],[122.837081,10.261157],[122.947411,10.881868],[123.49885,10.940624],[123.337774,10.267384],[124.077936,11.232726],[123.982438,10.278779],[123.623183,9.950091],[123.309921,9.318269],[122.995883,9.022189],[122.380055,9.713361],[122.586089,9.981045]]],[[[126.376814,8.414706],[126.478513,7.750354],[126.537424,7.189381],[126.196773,6.274294],[125.831421,7.293715],[125.363852,6.786485],[125.683161,6.049657],[125.396512,5.581003],[124.219788,6.161355],[123.93872,6.885136],[124.243662,7.36061],[123.610212,7.833527],[123.296071,7.418876],[122.825506,7.457375],[122.085499,6.899424],[121.919928,7.192119],[122.312359,8.034962],[122.942398,8.316237],[123.487688,8.69301],[123.841154,8.240324],[124.60147,8.514158],[124.764612,8.960409],[125.471391,8.986997],[125.412118,9.760335],[126.222714,9.286074],[126.306637,8.782487],[126.376814,8.414706]]],[[[118.504581,9.316383],[117.174275,8.3675],[117.664477,9.066889],[118.386914,9.6845],[118.987342,10.376292],[119.511496,11.369668],[119.689677,10.554291],[119.029458,10.003653],[118.504581,9.316383]]],[[[122.336957,18.224883],[122.174279,17.810283],[122.515654,17.093505],[122.252311,16.262444],[121.662786,15.931018],[121.50507,15.124814],[121.728829,14.328376],[122.258925,14.218202],[122.701276,14.336541],[123.950295,13.782131],[123.855107,13.237771],[124.181289,12.997527],[124.077419,12.536677],[123.298035,13.027526],[122.928652,13.55292],[122.671355,13.185836],[122.03465,13.784482],[121.126385,13.636687],[120.628637,13.857656],[120.679384,14.271016],[120.991819,14.525393],[120.693336,14.756671],[120.564145,14.396279],[120.070429,14.970869],[119.920929,15.406347],[119.883773,16.363704],[120.286488,16.034629],[120.390047,17.599081],[120.715867,18.505227],[121.321308,18.504065],[121.937601,18.218552],[122.246006,18.47895],[122.336957,18.224883]]],[[[122.03837,11.415841],[121.883548,11.891755],[122.483821,11.582187],[123.120217,11.58366],[123.100838,11.165934],[122.637714,10.741308],[122.00261,10.441017],[121.967367,10.905691],[122.03837,11.415841]]],[[[125.502552,12.162695],[125.783465,11.046122],[125.011884,11.311455],[125.032761,10.975816],[125.277449,10.358722],[124.801819,10.134679],[124.760168,10.837995],[124.459101,10.88993],[124.302522,11.495371],[124.891013,11.415583],[124.87799,11.79419],[124.266762,12.557761],[125.227116,12.535721],[125.502552,12.162695]]]]}},{"type":"Feature","properties":{"name":"Malaysia"},"geometry":{"type":"MultiPolygon","coordinates":[[[[100.085757,6.464489],[100.259596,6.642825],[101.075516,6.204867],[101.154219,5.691384],[101.814282,5.810808],[102.141187,6.221636],[102.371147,6.128205],[102.961705,5.524495],[103.381215,4.855001],[103.438575,4.181606],[103.332122,3.726698],[103.429429,3.382869],[103.502448,2.791019],[103.854674,2.515454],[104.247932,1.631141],[104.228811,1.293048],[103.519707,1.226334],[102.573615,1.967115],[101.390638,2.760814],[101.27354,3.270292],[100.695435,3.93914],[100.557408,4.76728],[100.196706,5.312493],[100.30626,6.040562],[100.085757,6.464489]]],[[[117.882035,4.137551],[117.015214,4.306094],[115.865517,4.306559],[115.519078,3.169238],[115.134037,2.821482],[114.621355,1.430688],[113.80585,1.217549],[112.859809,1.49779],[112.380252,1.410121],[111.797548,0.904441],[111.159138,0.976478],[110.514061,0.773131],[109.830227,1.338136],[109.66326,2.006467],[110.396135,1.663775],[111.168853,1.850637],[111.370081,2.697303],[111.796928,2.885897],[112.995615,3.102395],[113.712935,3.893509],[114.204017,4.525874],[114.659596,4.007637],[114.869557,4.348314],[115.347461,4.316636],[115.4057,4.955228],[115.45071,5.44773],[116.220741,6.143191],[116.725103,6.924771],[117.129626,6.928053],[117.643393,6.422166],[117.689075,5.98749],[118.347691,5.708696],[119.181904,5.407836],[119.110694,5.016128],[118.439727,4.966519],[118.618321,4.478202],[117.882035,4.137551]]]]}},{"type":"Feature","properties":{"name":"Brunei"},"geometry":{"type":"Polygon","coordinates":[[[115.45071,5.44773],[115.4057,4.955228],[115.347461,4.316636],[114.869557,4.348314],[114.659596,4.007637],[114.204017,4.525874],[114.599961,4.900011],[115.45071,5.44773]]]}},{"type":"Feature","properties":{"name":"Slovenia"},"geometry":{"type":"Polygon","coordinates":[[[13.806475,46.509306],[14.632472,46.431817],[15.137092,46.658703],[16.011664,46.683611],[16.202298,46.852386],[16.370505,46.841327],[16.564808,46.503751],[15.768733,46.238108],[15.67153,45.834154],[15.323954,45.731783],[15.327675,45.452316],[14.935244,45.471695],[14.595109,45.634941],[14.411968,45.466166],[13.71506,45.500324],[13.93763,45.591016],[13.69811,46.016778],[13.806475,46.509306]]]}},{"type":"Feature","properties":{"name":"Finland"},"geometry":{"type":"Polygon","coordinates":[[[28.59193,69.064777],[28.445944,68.364613],[29.977426,67.698297],[29.054589,66.944286],[30.21765,65.80598],[29.54443,64.948672],[30.444685,64.204453],[30.035872,63.552814],[31.516092,62.867687],[31.139991,62.357693],[30.211107,61.780028],[28.07,60.50352],[28.070002,60.503519],[28.069998,60.503517],[26.255173,60.423961],[24.496624,60.057316],[22.869695,59.846373],[22.290764,60.391921],[21.322244,60.72017],[21.544866,61.705329],[21.059211,62.607393],[21.536029,63.189735],[22.442744,63.81781],[24.730512,64.902344],[25.398068,65.111427],[25.294043,65.534346],[23.903379,66.006927],[23.56588,66.396051],[23.539473,67.936009],[21.978535,68.616846],[20.645593,69.106247],[21.244936,69.370443],[22.356238,68.841741],[23.66205,68.891247],[24.735679,68.649557],[25.689213,69.092114],[26.179622,69.825299],[27.732292,70.164193],[29.015573,69.766491],[28.59193,69.064777]]]}},{"type":"Feature","properties":{"name":"Slovakia"},"geometry":{"type":"Polygon","coordinates":[[[22.558138,49.085738],[22.280842,48.825392],[22.085608,48.422264],[21.872236,48.319971],[20.801294,48.623854],[20.473562,48.56285],[20.239054,48.327567],[19.769471,48.202691],[19.661364,48.266615],[19.174365,48.111379],[18.777025,48.081768],[18.696513,47.880954],[17.857133,47.758429],[17.488473,47.867466],[16.979667,48.123497],[16.879983,48.470013],[16.960288,48.596982],[17.101985,48.816969],[17.545007,48.800019],[17.886485,48.903475],[17.913512,48.996493],[18.104973,49.043983],[18.170498,49.271515],[18.399994,49.315001],[18.554971,49.495015],[18.853144,49.49623],[18.909575,49.435846],[19.320713,49.571574],[19.825023,49.217125],[20.415839,49.431453],[20.887955,49.328772],[21.607808,49.470107],[22.558138,49.085738]]]}},{"type":"Feature","properties":{"name":"Czech Republic"},"geometry":{"type":"Polygon","coordinates":[[[15.016996,51.106674],[15.490972,50.78473],[16.238627,50.697733],[16.176253,50.422607],[16.719476,50.215747],[16.868769,50.473974],[17.554567,50.362146],[17.649445,50.049038],[18.392914,49.988629],[18.853144,49.49623],[18.554971,49.495015],[18.399994,49.315001],[18.170498,49.271515],[18.104973,49.043983],[17.913512,48.996493],[17.886485,48.903475],[17.545007,48.800019],[17.101985,48.816969],[16.960288,48.596982],[16.499283,48.785808],[16.029647,48.733899],[15.253416,49.039074],[14.901447,48.964402],[14.338898,48.555305],[13.595946,48.877172],[13.031329,49.307068],[12.521024,49.547415],[12.415191,49.969121],[12.240111,50.266338],[12.966837,50.484076],[13.338132,50.733234],[14.056228,50.926918],[14.307013,51.117268],[14.570718,51.002339],[15.016996,51.106674]]]}},{"type":"Feature","properties":{"name":"Eritrea"},"geometry":{"type":"Polygon","coordinates":[[[36.42951,14.42211],[36.32322,14.82249],[36.75389,16.29186],[36.85253,16.95655],[37.16747,17.26314],[37.904,17.42754],[38.41009,17.998307],[38.990623,16.840626],[39.26611,15.922723],[39.814294,15.435647],[41.179275,14.49108],[41.734952,13.921037],[42.276831,13.343992],[42.589576,13.000421],[43.081226,12.699639],[42.779642,12.455416],[42.35156,12.54223],[42.00975,12.86582],[41.59856,13.45209],[41.1552,13.77333],[40.8966,14.11864],[40.02625,14.51959],[39.34061,14.53155],[39.0994,14.74064],[38.51295,14.50547],[37.90607,14.95943],[37.59377,14.2131],[36.42951,14.42211]]]}},{"type":"Feature","properties":{"name":"Japan"},"geometry":{"type":"MultiPolygon","coordinates":[[[[141.884601,39.180865],[140.959489,38.174001],[140.976388,37.142074],[140.59977,36.343983],[140.774074,35.842877],[140.253279,35.138114],[138.975528,34.6676],[137.217599,34.606286],[135.792983,33.464805],[135.120983,33.849071],[135.079435,34.596545],[133.340316,34.375938],[132.156771,33.904933],[130.986145,33.885761],[132.000036,33.149992],[131.33279,31.450355],[130.686318,31.029579],[130.20242,31.418238],[130.447676,32.319475],[129.814692,32.61031],[129.408463,33.296056],[130.353935,33.604151],[130.878451,34.232743],[131.884229,34.749714],[132.617673,35.433393],[134.608301,35.731618],[135.677538,35.527134],[136.723831,37.304984],[137.390612,36.827391],[138.857602,37.827485],[139.426405,38.215962],[140.05479,39.438807],[139.883379,40.563312],[140.305783,41.195005],[141.368973,41.37856],[141.914263,39.991616],[141.884601,39.180865]]],[[[144.613427,43.960883],[145.320825,44.384733],[145.543137,43.262088],[144.059662,42.988358],[143.18385,41.995215],[141.611491,42.678791],[141.067286,41.584594],[139.955106,41.569556],[139.817544,42.563759],[140.312087,43.333273],[141.380549,43.388825],[141.671952,44.772125],[141.967645,45.551483],[143.14287,44.510358],[143.910162,44.1741],[144.613427,43.960883]]],[[[132.371176,33.463642],[132.924373,34.060299],[133.492968,33.944621],[133.904106,34.364931],[134.638428,34.149234],[134.766379,33.806335],[134.203416,33.201178],[133.79295,33.521985],[133.280268,33.28957],[133.014858,32.704567],[132.363115,32.989382],[132.371176,33.463642]]]]}},{"type":"Feature","properties":{"name":"Paraguay"},"geometry":{"type":"Polygon","coordinates":[[[-58.166392,-20.176701],[-57.870674,-20.732688],[-57.937156,-22.090176],[-56.88151,-22.282154],[-56.473317,-22.0863],[-55.797958,-22.35693],[-55.610683,-22.655619],[-55.517639,-23.571998],[-55.400747,-23.956935],[-55.027902,-24.001274],[-54.652834,-23.839578],[-54.29296,-24.021014],[-54.293476,-24.5708],[-54.428946,-25.162185],[-54.625291,-25.739255],[-54.788795,-26.621786],[-55.695846,-27.387837],[-56.486702,-27.548499],[-57.60976,-27.395899],[-58.618174,-27.123719],[-57.63366,-25.603657],[-57.777217,-25.16234],[-58.807128,-24.771459],[-60.028966,-24.032796],[-60.846565,-23.880713],[-62.685057,-22.249029],[-62.291179,-21.051635],[-62.265961,-20.513735],[-61.786326,-19.633737],[-60.043565,-19.342747],[-59.115042,-19.356906],[-58.183471,-19.868399],[-58.166392,-20.176701]]]}},{"type":"Feature","properties":{"name":"Yemen"},"geometry":{"type":"Polygon","coordinates":[[[52.00001,19.000003],[52.782184,17.349742],[53.108573,16.651051],[52.385206,16.382411],[52.191729,15.938433],[52.168165,15.59742],[51.172515,15.17525],[49.574576,14.708767],[48.679231,14.003202],[48.238947,13.94809],[47.938914,14.007233],[47.354454,13.59222],[46.717076,13.399699],[45.877593,13.347764],[45.62505,13.290946],[45.406459,13.026905],[45.144356,12.953938],[44.989533,12.699587],[44.494576,12.721653],[44.175113,12.58595],[43.482959,12.6368],[43.222871,13.22095],[43.251448,13.767584],[43.087944,14.06263],[42.892245,14.802249],[42.604873,15.213335],[42.805015,15.261963],[42.702438,15.718886],[42.823671,15.911742],[42.779332,16.347891],[43.218375,16.66689],[43.115798,17.08844],[43.380794,17.579987],[43.791519,17.319977],[44.062613,17.410359],[45.216651,17.433329],[45.399999,17.333335],[46.366659,17.233315],[46.749994,17.283338],[47.000005,16.949999],[47.466695,17.116682],[48.183344,18.166669],[49.116672,18.616668],[52.00001,19.000003]]]}},{"type":"Feature","properties":{"name":"Saudi Arabia"},"geometry":{"type":"Polygon","coordinates":[[[34.956037,29.356555],[36.068941,29.197495],[36.501214,29.505254],[36.740528,29.865283],[37.503582,30.003776],[37.66812,30.338665],[37.998849,30.5085],[37.002166,31.508413],[39.004886,32.010217],[39.195468,32.161009],[40.399994,31.889992],[41.889981,31.190009],[44.709499,29.178891],[46.568713,29.099025],[47.459822,29.002519],[47.708851,28.526063],[48.416094,28.552004],[48.807595,27.689628],[49.299554,27.461218],[49.470914,27.109999],[50.152422,26.689663],[50.212935,26.277027],[50.113303,25.943972],[50.239859,25.60805],[50.527387,25.327808],[50.660557,24.999896],[50.810108,24.754743],[51.112415,24.556331],[51.389608,24.627386],[51.579519,24.245497],[51.617708,24.014219],[52.000733,23.001154],[55.006803,22.496948],[55.208341,22.70833],[55.666659,22.000001],[54.999982,19.999994],[52.00001,19.000003],[49.116672,18.616668],[48.183344,18.166669],[47.466695,17.116682],[47.000005,16.949999],[46.749994,17.283338],[46.366659,17.233315],[45.399999,17.333335],[45.216651,17.433329],[44.062613,17.410359],[43.791519,17.319977],[43.380794,17.579987],[43.115798,17.08844],[43.218375,16.66689],[42.779332,16.347891],[42.649573,16.774635],[42.347989,17.075806],[42.270888,17.474722],[41.754382,17.833046],[41.221391,18.6716],[40.939341,19.486485],[40.247652,20.174635],[39.801685,20.338862],[39.139399,21.291905],[39.023696,21.986875],[39.066329,22.579656],[38.492772,23.688451],[38.02386,24.078686],[37.483635,24.285495],[37.154818,24.858483],[37.209491,25.084542],[36.931627,25.602959],[36.639604,25.826228],[36.249137,26.570136],[35.640182,27.37652],[35.130187,28.063352],[34.632336,28.058546],[34.787779,28.607427],[34.83222,28.957483],[34.956037,29.356555]]]}},{"type":"Feature","properties":{"name":"Antarctica"},"geometry":{"type":"MultiPolygon","coordinates":[[[[-48.660616,-78.047019],[-48.151396,-78.04707],[-46.662857,-77.831476],[-45.154758,-78.04707],[-43.920828,-78.478103],[-43.48995,-79.08556],[-43.372438,-79.516645],[-43.333267,-80.026123],[-44.880537,-80.339644],[-46.506174,-80.594357],[-48.386421,-80.829485],[-50.482107,-81.025442],[-52.851988,-80.966685],[-54.164259,-80.633528],[-53.987991,-80.222028],[-51.853134,-79.94773],[-50.991326,-79.614623],[-50.364595,-79.183487],[-49.914131,-78.811209],[-49.306959,-78.458569],[-48.660616,-78.047018],[-48.660616,-78.047019]]],[[[-66.290031,-80.255773],[-64.037688,-80.294944],[-61.883246,-80.39287],[-61.138976,-79.981371],[-60.610119,-79.628679],[-59.572095,-80.040179],[-59.865849,-80.549657],[-60.159656,-81.000327],[-62.255393,-80.863178],[-64.488125,-80.921934],[-65.741666,-80.588827],[-65.741666,-80.549657],[-66.290031,-80.255773]]],[[[-73.915819,-71.269345],[-73.915819,-71.269344],[-73.230331,-71.15178],[-72.074717,-71.190951],[-71.780962,-70.681473],[-71.72218,-70.309196],[-71.741791,-69.505782],[-71.173815,-69.035475],[-70.253252,-68.87874],[-69.724447,-69.251017],[-69.489422,-69.623346],[-69.058518,-70.074016],[-68.725541,-70.505153],[-68.451346,-70.955823],[-68.333834,-71.406493],[-68.510128,-71.798407],[-68.784297,-72.170736],[-69.959471,-72.307885],[-71.075889,-72.503842],[-72.388134,-72.484257],[-71.8985,-72.092343],[-73.073622,-72.229492],[-74.19004,-72.366693],[-74.953895,-72.072757],[-75.012625,-71.661258],[-73.915819,-71.269345]]],[[[-102.330725,-71.894164],[-102.330725,-71.894164],[-101.703967,-71.717792],[-100.430919,-71.854993],[-98.98155,-71.933334],[-97.884743,-72.070535],[-96.787937,-71.952971],[-96.20035,-72.521205],[-96.983765,-72.442864],[-98.198083,-72.482035],[-99.432013,-72.442864],[-100.783455,-72.50162],[-101.801868,-72.305663],[-102.330725,-71.894164]]],[[[-122.621735,-73.657778],[-122.621735,-73.657777],[-122.406245,-73.324619],[-121.211511,-73.50099],[-119.918851,-73.657725],[-118.724143,-73.481353],[-119.292119,-73.834097],[-120.232217,-74.08881],[-121.62283,-74.010468],[-122.621735,-73.657778]]],[[[-127.28313,-73.461769],[-127.28313,-73.461768],[-126.558472,-73.246226],[-125.559566,-73.481353],[-124.031882,-73.873268],[-124.619469,-73.834097],[-125.912181,-73.736118],[-127.28313,-73.461769]]],[[[-163.712896,-78.595667],[-163.712896,-78.595667],[-163.105801,-78.223338],[-161.245113,-78.380176],[-160.246208,-78.693645],[-159.482405,-79.046338],[-159.208184,-79.497059],[-161.127601,-79.634209],[-162.439847,-79.281465],[-163.027408,-78.928774],[-163.066604,-78.869966],[-163.712896,-78.595667]]],[[[180,-84.71338],[180,-90],[-180,-90],[-180,-84.71338],[-179.942499,-84.721443],[-179.058677,-84.139412],[-177.256772,-84.452933],[-177.140807,-84.417941],[-176.084673,-84.099259],[-175.947235,-84.110449],[-175.829882,-84.117914],[-174.382503,-84.534323],[-173.116559,-84.117914],[-172.889106,-84.061019],[-169.951223,-83.884647],[-168.999989,-84.117914],[-168.530199,-84.23739],[-167.022099,-84.570497],[-164.182144,-84.82521],[-161.929775,-85.138731],[-158.07138,-85.37391],[-155.192253,-85.09956],[-150.942099,-85.295517],[-148.533073,-85.609038],[-145.888918,-85.315102],[-143.107718,-85.040752],[-142.892279,-84.570497],[-146.829068,-84.531274],[-150.060732,-84.296146],[-150.902928,-83.904232],[-153.586201,-83.68869],[-153.409907,-83.23802],[-153.037759,-82.82652],[-152.665637,-82.454192],[-152.861517,-82.042692],[-154.526299,-81.768394],[-155.29018,-81.41565],[-156.83745,-81.102129],[-154.408787,-81.160937],[-152.097662,-81.004151],[-150.648293,-81.337309],[-148.865998,-81.043373],[-147.22075,-80.671045],[-146.417749,-80.337938],[-146.770286,-79.926439],[-148.062947,-79.652089],[-149.531901,-79.358205],[-151.588416,-79.299397],[-153.390322,-79.162248],[-155.329376,-79.064269],[-155.975668,-78.69194],[-157.268302,-78.378419],[-158.051768,-78.025676],[-158.365134,-76.889207],[-157.875474,-76.987238],[-156.974573,-77.300759],[-155.329376,-77.202728],[-153.742832,-77.065579],[-152.920247,-77.496664],[-151.33378,-77.398737],[-150.00195,-77.183143],[-148.748486,-76.908845],[-147.612483,-76.575738],[-146.104409,-76.47776],[-146.143528,-76.105431],[-146.496091,-75.733154],[-146.20231,-75.380411],[-144.909624,-75.204039],[-144.322037,-75.537197],[-142.794353,-75.34124],[-141.638764,-75.086475],[-140.209007,-75.06689],[-138.85759,-74.968911],[-137.5062,-74.733783],[-136.428901,-74.518241],[-135.214583,-74.302699],[-134.431194,-74.361455],[-133.745654,-74.439848],[-132.257168,-74.302699],[-130.925311,-74.479019],[-129.554284,-74.459433],[-128.242038,-74.322284],[-126.890622,-74.420263],[-125.402082,-74.518241],[-124.011496,-74.479019],[-122.562152,-74.498604],[-121.073613,-74.518241],[-119.70256,-74.479019],[-118.684145,-74.185083],[-117.469801,-74.028348],[-116.216312,-74.243891],[-115.021552,-74.067519],[-113.944331,-73.714828],[-113.297988,-74.028348],[-112.945452,-74.38104],[-112.299083,-74.714198],[-111.261059,-74.420263],[-110.066325,-74.79254],[-108.714909,-74.910103],[-107.559346,-75.184454],[-106.149148,-75.125698],[-104.876074,-74.949326],[-103.367949,-74.988497],[-102.016507,-75.125698],[-100.645531,-75.302018],[-100.1167,-74.870933],[-100.763043,-74.537826],[-101.252703,-74.185083],[-102.545337,-74.106742],[-103.113313,-73.734413],[-103.328752,-73.362084],[-103.681289,-72.61753],[-102.917485,-72.754679],[-101.60524,-72.813436],[-100.312528,-72.754679],[-99.13738,-72.911414],[-98.118889,-73.20535],[-97.688037,-73.558041],[-96.336595,-73.616849],[-95.043961,-73.4797],[-93.672907,-73.283743],[-92.439003,-73.166179],[-91.420564,-73.401307],[-90.088733,-73.322914],[-89.226951,-72.558722],[-88.423951,-73.009393],[-87.268337,-73.185764],[-86.014822,-73.087786],[-85.192236,-73.4797],[-83.879991,-73.518871],[-82.665646,-73.636434],[-81.470913,-73.851977],[-80.687447,-73.4797],[-80.295791,-73.126956],[-79.296886,-73.518871],[-77.925858,-73.420892],[-76.907367,-73.636434],[-76.221879,-73.969541],[-74.890049,-73.871614],[-73.852024,-73.65602],[-72.833533,-73.401307],[-71.619215,-73.264157],[-70.209042,-73.146542],[-68.935916,-73.009393],[-67.956622,-72.79385],[-67.369061,-72.480329],[-67.134036,-72.049244],[-67.251548,-71.637745],[-67.56494,-71.245831],[-67.917477,-70.853917],[-68.230843,-70.462055],[-68.485452,-70.109311],[-68.544209,-69.717397],[-68.446282,-69.325535],[-67.976233,-68.953206],[-67.5845,-68.541707],[-67.427843,-68.149844],[-67.62367,-67.718759],[-67.741183,-67.326845],[-67.251548,-66.876175],[-66.703184,-66.58224],[-66.056815,-66.209963],[-65.371327,-65.89639],[-64.568276,-65.602506],[-64.176542,-65.171423],[-63.628152,-64.897073],[-63.001394,-64.642308],[-62.041686,-64.583552],[-61.414928,-64.270031],[-60.709855,-64.074074],[-59.887269,-63.95651],[-59.162585,-63.701745],[-58.594557,-63.388224],[-57.811143,-63.27066],[-57.223582,-63.525425],[-57.59573,-63.858532],[-58.614143,-64.152467],[-59.045073,-64.36801],[-59.789342,-64.211223],[-60.611928,-64.309202],[-61.297416,-64.54433],[-62.0221,-64.799094],[-62.51176,-65.09303],[-62.648858,-65.484942],[-62.590128,-65.857219],[-62.120079,-66.190326],[-62.805567,-66.425505],[-63.74569,-66.503847],[-64.294106,-66.837004],[-64.881693,-67.150474],[-65.508425,-67.58161],[-65.665082,-67.953887],[-65.312545,-68.365335],[-64.783715,-68.678908],[-63.961103,-68.913984],[-63.1973,-69.227556],[-62.785955,-69.619419],[-62.570516,-69.991747],[-62.276736,-70.383661],[-61.806661,-70.716768],[-61.512906,-71.089045],[-61.375809,-72.010074],[-61.081977,-72.382351],[-61.003661,-72.774265],[-60.690269,-73.166179],[-60.827367,-73.695242],[-61.375809,-74.106742],[-61.96337,-74.439848],[-63.295201,-74.576997],[-63.74569,-74.92974],[-64.352836,-75.262847],[-65.860987,-75.635124],[-67.192818,-75.79191],[-68.446282,-76.007452],[-69.797724,-76.222995],[-70.600724,-76.634494],[-72.206776,-76.673665],[-73.969536,-76.634494],[-75.555977,-76.712887],[-77.24037,-76.712887],[-76.926979,-77.104802],[-75.399294,-77.28107],[-74.282876,-77.55542],[-73.656119,-77.908112],[-74.772536,-78.221633],[-76.4961,-78.123654],[-77.925858,-78.378419],[-77.984666,-78.789918],[-78.023785,-79.181833],[-76.848637,-79.514939],[-76.633224,-79.887216],[-75.360097,-80.259545],[-73.244852,-80.416331],[-71.442946,-80.69063],[-70.013163,-81.004151],[-68.191646,-81.317672],[-65.704279,-81.474458],[-63.25603,-81.748757],[-61.552026,-82.042692],[-59.691416,-82.37585],[-58.712121,-82.846106],[-58.222487,-83.218434],[-57.008117,-82.865691],[-55.362894,-82.571755],[-53.619771,-82.258235],[-51.543644,-82.003521],[-49.76135,-81.729171],[-47.273931,-81.709586],[-44.825708,-81.846735],[-42.808363,-82.081915],[-42.16202,-81.65083],[-40.771433,-81.356894],[-38.244818,-81.337309],[-36.26667,-81.121715],[-34.386397,-80.906172],[-32.310296,-80.769023],[-30.097098,-80.592651],[-28.549802,-80.337938],[-29.254901,-79.985195],[-29.685805,-79.632503],[-29.685805,-79.260226],[-31.624808,-79.299397],[-33.681324,-79.456132],[-35.639912,-79.456132],[-35.914107,-79.083855],[-35.77701,-78.339248],[-35.326546,-78.123654],[-33.896763,-77.888526],[-32.212369,-77.65345],[-30.998051,-77.359515],[-29.783732,-77.065579],[-28.882779,-76.673665],[-27.511752,-76.497345],[-26.160336,-76.360144],[-25.474822,-76.281803],[-23.927552,-76.24258],[-22.458598,-76.105431],[-21.224694,-75.909474],[-20.010375,-75.674346],[-18.913543,-75.439218],[-17.522982,-75.125698],[-16.641589,-74.79254],[-15.701491,-74.498604],[-15.40771,-74.106742],[-16.46532,-73.871614],[-16.112784,-73.460114],[-15.446855,-73.146542],[-14.408805,-72.950585],[-13.311973,-72.715457],[-12.293508,-72.401936],[-11.510067,-72.010074],[-11.020433,-71.539767],[-10.295774,-71.265416],[-9.101015,-71.324224],[-8.611381,-71.65733],[-7.416622,-71.696501],[-7.377451,-71.324224],[-6.868232,-70.93231],[-5.790985,-71.030289],[-5.536375,-71.402617],[-4.341667,-71.461373],[-3.048981,-71.285053],[-1.795492,-71.167438],[-0.659489,-71.226246],[-0.228637,-71.637745],[0.868195,-71.304639],[1.886686,-71.128267],[3.022638,-70.991118],[4.139055,-70.853917],[5.157546,-70.618789],[6.273912,-70.462055],[7.13572,-70.246512],[7.742866,-69.893769],[8.48711,-70.148534],[9.525135,-70.011333],[10.249845,-70.48164],[10.817821,-70.834332],[11.953824,-70.638375],[12.404287,-70.246512],[13.422778,-69.972162],[14.734998,-70.030918],[15.126757,-70.403247],[15.949342,-70.030918],[17.026589,-69.913354],[18.201711,-69.874183],[19.259373,-69.893769],[20.375739,-70.011333],[21.452985,-70.07014],[21.923034,-70.403247],[22.569403,-70.697182],[23.666184,-70.520811],[24.841357,-70.48164],[25.977309,-70.48164],[27.093726,-70.462055],[28.09258,-70.324854],[29.150242,-70.20729],[30.031583,-69.93294],[30.971733,-69.75662],[31.990172,-69.658641],[32.754053,-69.384291],[33.302443,-68.835642],[33.870419,-68.502588],[34.908495,-68.659271],[35.300202,-69.012014],[36.16201,-69.247142],[37.200035,-69.168748],[37.905108,-69.52144],[38.649404,-69.776205],[39.667894,-69.541077],[40.020431,-69.109941],[40.921358,-68.933621],[41.959434,-68.600514],[42.938702,-68.463313],[44.113876,-68.267408],[44.897291,-68.051866],[45.719928,-67.816738],[46.503343,-67.601196],[47.44344,-67.718759],[48.344419,-67.366068],[48.990736,-67.091718],[49.930885,-67.111303],[50.753471,-66.876175],[50.949325,-66.523484],[51.791547,-66.249133],[52.614133,-66.053176],[53.613038,-65.89639],[54.53355,-65.818049],[55.414943,-65.876805],[56.355041,-65.974783],[57.158093,-66.249133],[57.255968,-66.680218],[58.137361,-67.013324],[58.744508,-67.287675],[59.939318,-67.405239],[60.605221,-67.679589],[61.427806,-67.953887],[62.387489,-68.012695],[63.19049,-67.816738],[64.052349,-67.405239],[64.992447,-67.620729],[65.971715,-67.738345],[66.911864,-67.855909],[67.891133,-67.934302],[68.890038,-67.934302],[69.712624,-68.972791],[69.673453,-69.227556],[69.555941,-69.678226],[68.596258,-69.93294],[67.81274,-70.305268],[67.949889,-70.697182],[69.066307,-70.677545],[68.929157,-71.069459],[68.419989,-71.441788],[67.949889,-71.853287],[68.71377,-72.166808],[69.869307,-72.264787],[71.024895,-72.088415],[71.573285,-71.696501],[71.906288,-71.324224],[72.454627,-71.010703],[73.08141,-70.716768],[73.33602,-70.364024],[73.864877,-69.874183],[74.491557,-69.776205],[75.62756,-69.737034],[76.626465,-69.619419],[77.644904,-69.462684],[78.134539,-69.07077],[78.428371,-68.698441],[79.113859,-68.326216],[80.093127,-68.071503],[80.93535,-67.875546],[81.483792,-67.542388],[82.051767,-67.366068],[82.776426,-67.209282],[83.775331,-67.30726],[84.676206,-67.209282],[85.655527,-67.091718],[86.752359,-67.150474],[87.477017,-66.876175],[87.986289,-66.209911],[88.358411,-66.484261],[88.828408,-66.954568],[89.67063,-67.150474],[90.630365,-67.228867],[91.5901,-67.111303],[92.608539,-67.189696],[93.548637,-67.209282],[94.17542,-67.111303],[95.017591,-67.170111],[95.781472,-67.385653],[96.682399,-67.248504],[97.759646,-67.248504],[98.68021,-67.111303],[99.718182,-67.248504],[100.384188,-66.915346],[100.893356,-66.58224],[101.578896,-66.30789],[102.832411,-65.563284],[103.478676,-65.700485],[104.242557,-65.974783],[104.90846,-66.327527],[106.181561,-66.934931],[107.160881,-66.954568],[108.081393,-66.954568],[109.15864,-66.837004],[110.235835,-66.699804],[111.058472,-66.425505],[111.74396,-66.13157],[112.860378,-66.092347],[113.604673,-65.876805],[114.388088,-66.072762],[114.897308,-66.386283],[115.602381,-66.699804],[116.699161,-66.660633],[117.384701,-66.915346],[118.57946,-67.170111],[119.832924,-67.268089],[120.871,-67.189696],[121.654415,-66.876175],[122.320369,-66.562654],[123.221296,-66.484261],[124.122274,-66.621462],[125.160247,-66.719389],[126.100396,-66.562654],[127.001427,-66.562654],[127.882768,-66.660633],[128.80328,-66.758611],[129.704259,-66.58224],[130.781454,-66.425505],[131.799945,-66.386283],[132.935896,-66.386283],[133.85646,-66.288304],[134.757387,-66.209963],[135.031582,-65.72007],[135.070753,-65.308571],[135.697485,-65.582869],[135.873805,-66.033591],[136.206705,-66.44509],[136.618049,-66.778197],[137.460271,-66.954568],[138.596223,-66.895761],[139.908442,-66.876175],[140.809421,-66.817367],[142.121692,-66.817367],[143.061842,-66.797782],[144.374061,-66.837004],[145.490427,-66.915346],[146.195552,-67.228867],[145.999699,-67.601196],[146.646067,-67.895131],[147.723263,-68.130259],[148.839629,-68.385024],[150.132314,-68.561292],[151.483705,-68.71813],[152.502247,-68.874813],[153.638199,-68.894502],[154.284567,-68.561292],[155.165857,-68.835642],[155.92979,-69.149215],[156.811132,-69.384291],[158.025528,-69.482269],[159.181013,-69.599833],[159.670699,-69.991747],[160.80665,-70.226875],[161.570479,-70.579618],[162.686897,-70.736353],[163.842434,-70.716768],[164.919681,-70.775524],[166.11444,-70.755938],[167.309095,-70.834332],[168.425616,-70.971481],[169.463589,-71.20666],[170.501665,-71.402617],[171.20679,-71.696501],[171.089227,-72.088415],[170.560422,-72.441159],[170.109958,-72.891829],[169.75737,-73.24452],[169.287321,-73.65602],[167.975101,-73.812806],[167.387489,-74.165498],[166.094803,-74.38104],[165.644391,-74.772954],[164.958851,-75.145283],[164.234193,-75.458804],[163.822797,-75.870303],[163.568239,-76.24258],[163.47026,-76.693302],[163.489897,-77.065579],[164.057873,-77.457442],[164.273363,-77.82977],[164.743464,-78.182514],[166.604126,-78.319611],[166.995781,-78.750748],[165.193876,-78.907483],[163.666217,-79.123025],[161.766385,-79.162248],[160.924162,-79.730482],[160.747894,-80.200737],[160.316964,-80.573066],[159.788211,-80.945395],[161.120016,-81.278501],[161.629287,-81.690001],[162.490992,-82.062278],[163.705336,-82.395435],[165.095949,-82.708956],[166.604126,-83.022477],[168.895665,-83.335998],[169.404782,-83.825891],[172.283934,-84.041433],[172.477049,-84.117914],[173.224083,-84.41371],[175.985672,-84.158997],[178.277212,-84.472518],[180,-84.71338]]]]}},{"type":"Feature","properties":{"name":"Turkish Republic of Northern Cyprus"},"geometry":{"type":"Polygon","coordinates":[[[32.73178,35.140026],[32.802474,35.145504],[32.946961,35.386703],[33.667227,35.373216],[34.576474,35.671596],[33.900804,35.245756],[33.973617,35.058506],[33.86644,35.093595],[33.675392,35.017863],[33.525685,35.038688],[33.475817,35.000345],[33.455922,35.101424],[33.383833,35.162712],[33.190977,35.173125],[32.919572,35.087833],[32.73178,35.140026]]]}},{"type":"Feature","properties":{"name":"Cyprus"},"geometry":{"type":"Polygon","coordinates":[[[32.73178,35.140026],[32.919572,35.087833],[33.190977,35.173125],[33.383833,35.162712],[33.455922,35.101424],[33.475817,35.000345],[33.525685,35.038688],[33.675392,35.017863],[33.86644,35.093595],[33.973617,35.058506],[34.004881,34.978098],[32.979827,34.571869],[32.490296,34.701655],[32.256667,35.103232],[32.73178,35.140026]]]}},{"type":"Feature","properties":{"name":"Morocco"},"geometry":{"type":"Polygon","coordinates":[[[-2.169914,35.168396],[-1.792986,34.527919],[-1.733455,33.919713],[-1.388049,32.864015],[-1.124551,32.651522],[-1.307899,32.262889],[-2.616605,32.094346],[-3.06898,31.724498],[-3.647498,31.637294],[-3.690441,30.896952],[-4.859646,30.501188],[-5.242129,30.000443],[-6.060632,29.7317],[-7.059228,29.579228],[-8.674116,28.841289],[-8.66559,27.656426],[-8.817828,27.656426],[-8.794884,27.120696],[-9.413037,27.088476],[-9.735343,26.860945],[-10.189424,26.860945],[-10.551263,26.990808],[-11.392555,26.883424],[-11.71822,26.104092],[-12.030759,26.030866],[-12.500963,24.770116],[-13.89111,23.691009],[-14.221168,22.310163],[-14.630833,21.86094],[-14.750955,21.5006],[-17.002962,21.420734],[-17.020428,21.42231],[-16.973248,21.885745],[-16.589137,22.158234],[-16.261922,22.67934],[-16.326414,23.017768],[-15.982611,23.723358],[-15.426004,24.359134],[-15.089332,24.520261],[-14.824645,25.103533],[-14.800926,25.636265],[-14.43994,26.254418],[-13.773805,26.618892],[-13.139942,27.640148],[-13.121613,27.654148],[-12.618837,28.038186],[-11.688919,28.148644],[-10.900957,28.832142],[-10.399592,29.098586],[-9.564811,29.933574],[-9.814718,31.177736],[-9.434793,32.038096],[-9.300693,32.564679],[-8.657476,33.240245],[-7.654178,33.697065],[-6.912544,34.110476],[-6.244342,35.145865],[-5.929994,35.759988],[-5.193863,35.755182],[-4.591006,35.330712],[-3.640057,35.399855],[-2.604306,35.179093],[-2.169914,35.168396]]]}},{"type":"Feature","properties":{"name":"Egypt"},"geometry":{"type":"Polygon","coordinates":[[[36.86623,22],[32.9,22],[29.02,22],[25,22],[25,25.6825],[25,29.238655],[24.70007,30.04419],[24.95762,30.6616],[24.80287,31.08929],[25.16482,31.56915],[26.49533,31.58568],[27.45762,31.32126],[28.45048,31.02577],[28.91353,30.87005],[29.68342,31.18686],[30.09503,31.4734],[30.97693,31.55586],[31.68796,31.4296],[31.96041,30.9336],[32.19247,31.26034],[32.99392,31.02407],[33.7734,30.96746],[34.265435,31.219357],[34.26544,31.21936],[34.823243,29.761081],[34.9226,29.50133],[34.64174,29.09942],[34.42655,28.34399],[34.15451,27.8233],[33.92136,27.6487],[33.58811,27.97136],[33.13676,28.41765],[32.42323,29.85108],[32.32046,29.76043],[32.73482,28.70523],[33.34876,27.69989],[34.10455,26.14227],[34.47387,25.59856],[34.79507,25.03375],[35.69241,23.92671],[35.49372,23.75237],[35.52598,23.10244],[36.69069,22.20485],[36.86623,22]]]}},{"type":"Feature","properties":{"name":"Libya"},"geometry":{"type":"Polygon","coordinates":[[[25,22],[25,20.00304],[23.85,20],[23.83766,19.58047],[19.84926,21.49509],[15.86085,23.40972],[14.8513,22.86295],[14.143871,22.491289],[13.581425,23.040506],[11.999506,23.471668],[11.560669,24.097909],[10.771364,24.562532],[10.303847,24.379313],[9.948261,24.936954],[9.910693,25.365455],[9.319411,26.094325],[9.716286,26.512206],[9.629056,27.140953],[9.756128,27.688259],[9.683885,28.144174],[9.859998,28.95999],[9.805634,29.424638],[9.48214,30.307556],[9.970017,30.539325],[10.056575,30.961831],[9.950225,31.37607],[10.636901,31.761421],[10.94479,32.081815],[11.432253,32.368903],[11.488787,33.136996],[12.66331,32.79278],[13.08326,32.87882],[13.91868,32.71196],[15.24563,32.26508],[15.71394,31.37626],[16.61162,31.18218],[18.02109,30.76357],[19.08641,30.26639],[19.57404,30.52582],[20.05335,30.98576],[19.82033,31.75179],[20.13397,32.2382],[20.85452,32.7068],[21.54298,32.8432],[22.89576,32.63858],[23.2368,32.19149],[23.60913,32.18726],[23.9275,32.01667],[24.92114,31.89936],[25.16482,31.56915],[24.80287,31.08929],[24.95762,30.6616],[24.70007,30.04419],[25,29.238655],[25,25.6825],[25,22]]]}},{"type":"Feature","properties":{"name":"Ethiopia"},"geometry":{"type":"Polygon","coordinates":[[[47.78942,8.003],[44.9636,5.00162],[43.66087,4.95755],[42.76967,4.25259],[42.12861,4.23413],[41.855083,3.918912],[41.1718,3.91909],[40.76848,4.25702],[39.85494,3.83879],[39.559384,3.42206],[38.89251,3.50074],[38.67114,3.61607],[38.43697,3.58851],[38.120915,3.598605],[36.855093,4.447864],[36.159079,4.447864],[35.817448,4.776966],[35.817448,5.338232],[35.298007,5.506],[34.70702,6.59422],[34.25032,6.82607],[34.0751,7.22595],[33.56829,7.71334],[32.95418,7.78497],[33.2948,8.35458],[33.8255,8.37916],[33.97498,8.68456],[33.96162,9.58358],[34.25745,10.63009],[34.73115,10.91017],[34.83163,11.31896],[35.26049,12.08286],[35.86363,12.57828],[36.27022,13.56333],[36.42951,14.42211],[37.59377,14.2131],[37.90607,14.95943],[38.51295,14.50547],[39.0994,14.74064],[39.34061,14.53155],[40.02625,14.51959],[40.8966,14.11864],[41.1552,13.77333],[41.59856,13.45209],[42.00975,12.86582],[42.35156,12.54223],[42,12.1],[41.66176,11.6312],[41.73959,11.35511],[41.75557,11.05091],[42.31414,11.0342],[42.55493,11.10511],[42.776852,10.926879],[42.55876,10.57258],[42.92812,10.02194],[43.29699,9.54048],[43.67875,9.18358],[46.94834,7.99688],[47.78942,8.003]]]}},{"type":"Feature","properties":{"name":"Djibouti"},"geometry":{"type":"Polygon","coordinates":[[[42.35156,12.54223],[42.779642,12.455416],[43.081226,12.699639],[43.317852,12.390148],[43.286381,11.974928],[42.715874,11.735641],[43.145305,11.46204],[42.776852,10.926879],[42.55493,11.10511],[42.31414,11.0342],[41.75557,11.05091],[41.73959,11.35511],[41.66176,11.6312],[42,12.1],[42.35156,12.54223]]]}},{"type":"Feature","properties":{"name":"Somaliland"},"geometry":{"type":"Polygon","coordinates":[[[48.948205,11.410617],[48.948205,11.410617],[48.942005,11.394266],[48.938491,10.982327],[48.938233,9.9735],[48.93813,9.451749],[48.486736,8.837626],[47.78942,8.003],[46.94834,7.99688],[43.67875,9.18358],[43.29699,9.54048],[42.92812,10.02194],[42.55876,10.57258],[42.776852,10.926879],[43.145305,11.46204],[43.47066,11.27771],[43.666668,10.864169],[44.117804,10.445538],[44.614259,10.442205],[45.556941,10.698029],[46.645401,10.816549],[47.525658,11.127228],[48.021596,11.193064],[48.378784,11.375482],[48.948206,11.410622],[48.948205,11.410617]]]}},{"type":"Feature","properties":{"name":"Uganda"},"geometry":{"type":"Polygon","coordinates":[[[33.903711,-0.95],[31.86617,-1.02736],[30.76986,-1.01455],[30.419105,-1.134659],[29.821519,-1.443322],[29.579466,-1.341313],[29.587838,-0.587406],[29.819503,-0.20531],[29.875779,0.59738],[30.086154,1.062313],[30.468508,1.583805],[30.85267,1.849396],[31.174149,2.204465],[30.773347,2.339883],[30.83386,3.509166],[30.833852,3.509172],[31.24556,3.7819],[31.88145,3.55827],[32.68642,3.79232],[33.39,3.79],[34.005,4.249885],[34.47913,3.5556],[34.59607,3.05374],[35.03599,1.90584],[34.6721,1.17694],[34.18,0.515],[33.893569,0.109814],[33.903711,-0.95]]]}},{"type":"Feature","properties":{"name":"Rwanda"},"geometry":{"type":"Polygon","coordinates":[[[30.419105,-1.134659],[30.816135,-1.698914],[30.758309,-2.28725],[30.46967,-2.41383],[30.469674,-2.413855],[29.938359,-2.348487],[29.632176,-2.917858],[29.024926,-2.839258],[29.117479,-2.292211],[29.254835,-2.21511],[29.291887,-1.620056],[29.579466,-1.341313],[29.821519,-1.443322],[30.419105,-1.134659]]]}},{"type":"Feature","properties":{"name":"Bosnia and Herzegovina"},"geometry":{"type":"Polygon","coordinates":[[[18.56,42.65],[17.674922,43.028563],[17.297373,43.446341],[16.916156,43.667722],[16.456443,44.04124],[16.23966,44.351143],[15.750026,44.818712],[15.959367,45.233777],[16.318157,45.004127],[16.534939,45.211608],[17.002146,45.233777],[17.861783,45.06774],[18.553214,45.08159],[19.005485,44.860234],[19.00548,44.86023],[19.36803,44.863],[19.11761,44.42307],[19.59976,44.03847],[19.454,43.5681],[19.21852,43.52384],[19.03165,43.43253],[18.70648,43.20011],[18.56,42.65]]]}},{"type":"Feature","properties":{"name":"North Macedonia"},"geometry":{"type":"Polygon","coordinates":[[[22.380526,42.32026],[22.881374,41.999297],[22.952377,41.337994],[22.76177,41.3048],[22.597308,41.130487],[22.055378,41.149866],[21.674161,40.931275],[21.02004,40.842727],[20.605182,41.086226],[20.463175,41.515089],[20.590247,41.855404],[20.590247,41.855409],[20.71731,41.84711],[20.76216,42.05186],[21.3527,42.2068],[21.576636,42.245224],[21.91708,42.30364],[22.380526,42.32026]]]}},{"type":"Feature","properties":{"name":"Serbia"},"geometry":{"type":"Polygon","coordinates":[[[18.829825,45.908872],[18.829838,45.908878],[19.596045,46.17173],[20.220192,46.127469],[20.762175,45.734573],[20.874313,45.416375],[21.483526,45.18117],[21.562023,44.768947],[22.145088,44.478422],[22.459022,44.702517],[22.705726,44.578003],[22.474008,44.409228],[22.65715,44.234923],[22.410446,44.008063],[22.500157,43.642814],[22.986019,43.211161],[22.604801,42.898519],[22.436595,42.580321],[22.545012,42.461362],[22.380526,42.32026],[21.91708,42.30364],[21.576636,42.245224],[21.54332,42.32025],[21.66292,42.43922],[21.77505,42.6827],[21.63302,42.67717],[21.43866,42.86255],[21.27421,42.90959],[21.143395,43.068685],[20.95651,43.13094],[20.81448,43.27205],[20.63508,43.21671],[20.49679,42.88469],[20.25758,42.81275],[20.3398,42.89852],[19.95857,43.10604],[19.63,43.21378],[19.48389,43.35229],[19.21852,43.52384],[19.454,43.5681],[19.59976,44.03847],[19.11761,44.42307],[19.36803,44.863],[19.00548,44.86023],[19.005485,44.860234],[19.390476,45.236516],[19.072769,45.521511],[18.829825,45.908872]]]}},{"type":"Feature","properties":{"name":"Montenegro"},"geometry":{"type":"Polygon","coordinates":[[[20.0707,42.58863],[19.801613,42.500093],[19.738051,42.688247],[19.304486,42.195745],[19.371768,41.877551],[19.16246,41.95502],[18.88214,42.28151],[18.450017,42.479992],[18.56,42.65],[18.70648,43.20011],[19.03165,43.43253],[19.21852,43.52384],[19.48389,43.35229],[19.63,43.21378],[19.95857,43.10604],[20.3398,42.89852],[20.25758,42.81275],[20.0707,42.58863]]]}},{"type":"Feature","properties":{"name":"Kosovo"},"geometry":{"type":"Polygon","coordinates":[[[20.590247,41.855409],[20.52295,42.21787],[20.283755,42.32026],[20.0707,42.58863],[20.25758,42.81275],[20.49679,42.88469],[20.63508,43.21671],[20.81448,43.27205],[20.95651,43.13094],[21.143395,43.068685],[21.27421,42.90959],[21.43866,42.86255],[21.63302,42.67717],[21.77505,42.6827],[21.66292,42.43922],[21.54332,42.32025],[21.576636,42.245224],[21.3527,42.2068],[20.76216,42.05186],[20.71731,41.84711],[20.590247,41.855409]]]}},{"type":"Feature","properties":{"name":"Trinidad and Tobago"},"geometry":{"type":"Polygon","coordinates":[[[-61.68,10.76],[-61.105,10.89],[-60.895,10.855],[-60.935,10.11],[-61.77,10],[-61.95,10.09],[-61.66,10.365],[-61.68,10.76]]]}},{"type":"Feature","properties":{"name":"South Sudan"},"geometry":{"type":"Polygon","coordinates":[[[30.833852,3.509172],[29.9535,4.173699],[29.715995,4.600805],[29.159078,4.389267],[28.696678,4.455077],[28.428994,4.287155],[27.979977,4.408413],[27.374226,5.233944],[27.213409,5.550953],[26.465909,5.946717],[26.213418,6.546603],[25.796648,6.979316],[25.124131,7.500085],[25.114932,7.825104],[24.567369,8.229188],[23.88698,8.61973],[24.194068,8.728696],[24.537415,8.917538],[24.794926,9.810241],[25.069604,10.27376],[25.790633,10.411099],[25.962307,10.136421],[26.477328,9.55273],[26.752006,9.466893],[27.112521,9.638567],[27.833551,9.604232],[27.97089,9.398224],[28.966597,9.398224],[29.000932,9.604232],[29.515953,9.793074],[29.618957,10.084919],[29.996639,10.290927],[30.837841,9.707237],[31.352862,9.810241],[31.850716,10.531271],[32.400072,11.080626],[32.314235,11.681484],[32.073892,11.97333],[32.67475,12.024832],[32.743419,12.248008],[33.206938,12.179338],[33.086766,11.441141],[33.206938,10.720112],[33.721959,10.325262],[33.842131,9.981915],[33.824963,9.484061],[33.963393,9.464285],[33.97498,8.68456],[33.8255,8.37916],[33.2948,8.35458],[32.95418,7.78497],[33.56829,7.71334],[34.0751,7.22595],[34.25032,6.82607],[34.70702,6.59422],[35.298007,5.506],[34.620196,4.847123],[34.005,4.249885],[33.39,3.79],[32.68642,3.79232],[31.88145,3.55827],[31.24556,3.7819],[30.833852,3.509172]]]}}]}
diff --git a/store/agents/gis/template/geo.mjs b/store/agents/gis/template/geo.mjs
new file mode 100644
index 000000000..19535145c
--- /dev/null
+++ b/store/agents/gis/template/geo.mjs
@@ -0,0 +1,49 @@
+const supported = new Set(['Point','MultiPoint','LineString','MultiLineString','Polygon','MultiPolygon']);
+
+export function validateGeoJSON(value) {
+ if (!value || value.type !== 'FeatureCollection' || !Array.isArray(value.features)) throw new Error('Open a GeoJSON FeatureCollection.');
+ if (value.features.length > 2000) throw new Error('This local explorer supports up to 2,000 features. Simplify or split this dataset.');
+ let vertices = 0;
+ const coordinate = point => {
+ if (!Array.isArray(point) || point.length < 2 || point.length > 3 || !point.every(Number.isFinite) || Math.abs(point[0]) > 180 || Math.abs(point[1]) > 90) throw new Error('Coordinates must be WGS 84 [longitude, latitude] in degrees.');
+ if (++vertices > 100000) throw new Error('Simplify to at most 100,000 vertices for interactive exploration.');
+ };
+ const array = (points, min, visit) => {
+ if (!Array.isArray(points) || points.length < min) throw new Error('A geometry has too few coordinates.');
+ points.forEach(visit);
+ };
+ const line = points => array(points, 2, coordinate);
+ const ring = points => {
+ array(points, 4, coordinate);
+ if (points[0][0] !== points.at(-1)[0] || points[0][1] !== points.at(-1)[1]) throw new Error('Polygon rings must close on their starting coordinate.');
+ };
+ for (const [index, feature] of value.features.entries()) {
+ if (!feature || feature.type !== 'Feature' || !supported.has(feature.geometry?.type)) throw new Error('Feature ' + (index+1) + ': use Point, LineString, Polygon or their Multi variants.');
+ if (feature.properties !== null && (typeof feature.properties !== 'object' || Array.isArray(feature.properties))) throw new Error('Feature properties must be an object or null.');
+ const { type, coordinates } = feature.geometry;
+ if (type === 'Point') coordinate(coordinates);
+ if (type === 'MultiPoint') array(coordinates, 1, coordinate);
+ if (type === 'LineString') line(coordinates);
+ if (type === 'MultiLineString') array(coordinates, 1, line);
+ if (type === 'Polygon') array(coordinates, 1, ring);
+ if (type === 'MultiPolygon') array(coordinates, 1, polygon => array(polygon, 1, ring));
+ }
+ return value;
+}
+
+export function featureName(feature, index) {
+ return String(feature.properties?.name ?? feature.properties?.title ?? feature.id ?? 'Feature ' + (index+1));
+}
+
+// Great-circle distance on a mean-radius sphere, not a road or survey distance.
+export function distanceKm(a, b) {
+ const rad = Math.PI / 180, dlat = (b[1]-a[1])*rad, dlon = (b[0]-a[0])*rad;
+ const h = Math.sin(dlat/2)**2 + Math.cos(a[1]*rad)*Math.cos(b[1]*rad)*Math.sin(dlon/2)**2;
+ return 6371.0088 * 2 * Math.asin(Math.sqrt(Math.max(0,Math.min(1,h))));
+}
+
+export function filterFeatures(features, query='', type='all') {
+ const term = query.trim().toLocaleLowerCase();
+ return features.map((feature,index)=>({ feature,index,name:featureName(feature,index) }))
+ .filter(row => (type==='all'||row.feature.geometry.type===type) && row.name.toLocaleLowerCase().includes(term));
+}
diff --git a/store/agents/gis/template/index.html b/store/agents/gis/template/index.html
new file mode 100644
index 000000000..f1a17dcab
--- /dev/null
+++ b/store/agents/gis/template/index.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
+<title>Atlas — a place for discovery</title><link rel="icon" href="data:,">
+<link rel="stylesheet" href="vendor/leaflet.css"><link rel="stylesheet" href="atlas.css">
+</head>
+<body>
+<header class="top"><a class="brand" href="index.html"><span class="mark">◈</span> Atlas <span class="edition">/ GIS STUDIO</span></a><span class="local">● Local by design</span><label class="button" for="upload">↥ Open GeoJSON</label><input id="upload" type="file" accept=".geojson,.json,application/geo+json" hidden><button id="export">↗ Export selection</button></header>
+<div id="error" role="alert" hidden></div>
+<main class="workspace">
+<aside class="sidebar">
+ <div class="eyebrow">FIELD NOTES &nbsp; / &nbsp; 001</div>
+ <h1>A place for<br><em>discovery.</em></h1>
+ <p class="intro">See the places. Find the patterns.<br>Bring your own corner of the world.</p>
+ <div class="metrics"><div><strong id="count">—</strong><span>visible features</span></div><div><strong id="geometry-count">—</strong><span>geometry types</span></div></div>
+ <div class="section-head"><h2>Explore your layer</h2><span id="source">cities.geojson</span></div>
+ <label class="search">⌕ <input id="search" type="search" placeholder="Find a place…" aria-label="Search features"></label>
+ <label class="select-row" for="type">Geometry <select id="type"><option value="all">All types</option></select></label>
+ <div class="list-head"><span>FEATURE</span><span>GEOMETRY</span></div>
+ <div id="features" class="features" aria-label="Features"></div>
+ <p id="empty" hidden>No features match. Try another search or geometry.</p>
+ <button id="fit" class="wide">⌖ Fit visible features</button>
+ <section id="details" class="details"><h2>Select a feature</h2><p>Choose a name or a shape on the map to inspect its properties.</p></section>
+ <p class="source-note">Starter coordinates identify real cities. Population values are illustrative, not demographic estimates. Offline outlines: Natural Earth 1:110m; not for navigation or surveying.</p>
+</aside>
+<section class="map-panel" aria-label="Map exploration">
+ <div id="map" role="region" aria-label="Interactive map; use arrow keys to pan and plus or minus to zoom"></div>
+ <div class="map-title"><span class="eyebrow">YOUR DATA, ON THE MAP</span><strong id="map-name">Vietnam / City atlas</strong><span id="bounds-label">Drag to explore · scroll to zoom</span></div>
+ <div class="map-tools"><button id="measure" aria-pressed="false">↔ Measure distance</button><button id="clear-measure" hidden>Clear</button></div>
+ <div class="measurement" id="measurement" role="status" hidden></div>
+ <div class="map-bottom"><div class="map-legend"><span><i></i> Your features</span><span><i class="selected"></i> Selected</span></div><span class="offline">OFFLINE VECTOR MAP</span></div>
+ <div class="coordinates" id="coordinates">WGS 84 · longitude / latitude</div>
+</section>
+</main>
+<footer><span>Every point is a starting point.</span><span>Data stays in this browser. Export to keep your selection.</span></footer>
+<script src="vendor/leaflet.js"></script><script type="module" src="atlas.mjs"></script>
+</body></html>
diff --git a/store/agents/gis/template/proof.json b/store/agents/gis/template/proof.json
new file mode 100644
index 000000000..8c2f36958
--- /dev/null
+++ b/store/agents/gis/template/proof.json
@@ -0,0 +1 @@
+{"actions":[{"selector":"#search","fill":"Hanoi"},{"selector":"#count","text":"1"},{"selector":".feature","click":true},{"selector":"#details h2","text":"Hanoi"},{"selector":"#search","fill":""},{"selector":"#count","text":"4"}]}
diff --git a/store/agents/gis/template/vendor/LICENSE b/store/agents/gis/template/vendor/LICENSE
new file mode 100644
index 000000000..bcb3ba1ac
--- /dev/null
+++ b/store/agents/gis/template/vendor/LICENSE
@@ -0,0 +1,26 @@
+BSD 2-Clause License
+
+Copyright (c) 2010-2023, Volodymyr Agafonkin
+Copyright (c) 2010-2011, CloudMade
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/store/agents/gis/template/vendor/leaflet.css b/store/agents/gis/template/vendor/leaflet.css
new file mode 100644
index 000000000..2961b7618
--- /dev/null
+++ b/store/agents/gis/template/vendor/leaflet.css
@@ -0,0 +1,661 @@
+/* required styles */
+
+.leaflet-pane,
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-tile-container,
+.leaflet-pane > svg,
+.leaflet-pane > canvas,
+.leaflet-zoom-box,
+.leaflet-image-layer,
+.leaflet-layer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ }
+.leaflet-container {
+ overflow: hidden;
+ }
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+ -webkit-user-drag: none;
+ }
+/* Prevents IE11 from highlighting tiles in blue */
+.leaflet-tile::selection {
+ background: transparent;
+}
+/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
+.leaflet-safari .leaflet-tile {
+ image-rendering: -webkit-optimize-contrast;
+ }
+/* hack that prevents hw layers "stretching" when loading new tiles */
+.leaflet-safari .leaflet-tile-container {
+ width: 1600px;
+ height: 1600px;
+ -webkit-transform-origin: 0 0;
+ }
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+ display: block;
+ }
+/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
+/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
+.leaflet-container .leaflet-overlay-pane svg {
+ max-width: none !important;
+ max-height: none !important;
+ }
+.leaflet-container .leaflet-marker-pane img,
+.leaflet-container .leaflet-shadow-pane img,
+.leaflet-container .leaflet-tile-pane img,
+.leaflet-container img.leaflet-image-layer,
+.leaflet-container .leaflet-tile {
+ max-width: none !important;
+ max-height: none !important;
+ width: auto;
+ padding: 0;
+ }
+
+.leaflet-container img.leaflet-tile {
+ /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
+ mix-blend-mode: plus-lighter;
+}
+
+.leaflet-container.leaflet-touch-zoom {
+ -ms-touch-action: pan-x pan-y;
+ touch-action: pan-x pan-y;
+ }
+.leaflet-container.leaflet-touch-drag {
+ -ms-touch-action: pinch-zoom;
+ /* Fallback for FF which doesn't support pinch-zoom */
+ touch-action: none;
+ touch-action: pinch-zoom;
+}
+.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.leaflet-container {
+ -webkit-tap-highlight-color: transparent;
+}
+.leaflet-container a {
+ -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
+}
+.leaflet-tile {
+ filter: inherit;
+ visibility: hidden;
+ }
+.leaflet-tile-loaded {
+ visibility: inherit;
+ }
+.leaflet-zoom-box {
+ width: 0;
+ height: 0;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ z-index: 800;
+ }
+/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
+.leaflet-overlay-pane svg {
+ -moz-user-select: none;
+ }
+
+.leaflet-pane { z-index: 400; }
+
+.leaflet-tile-pane { z-index: 200; }
+.leaflet-overlay-pane { z-index: 400; }
+.leaflet-shadow-pane { z-index: 500; }
+.leaflet-marker-pane { z-index: 600; }
+.leaflet-tooltip-pane { z-index: 650; }
+.leaflet-popup-pane { z-index: 700; }
+
+.leaflet-map-pane canvas { z-index: 100; }
+.leaflet-map-pane svg { z-index: 200; }
+
+.leaflet-vml-shape {
+ width: 1px;
+ height: 1px;
+ }
+.lvml {
+ behavior: url(#default#VML);
+ display: inline-block;
+ position: absolute;
+ }
+
+
+/* control positioning */
+
+.leaflet-control {
+ position: relative;
+ z-index: 800;
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+ pointer-events: auto;
+ }
+.leaflet-top,
+.leaflet-bottom {
+ position: absolute;
+ z-index: 1000;
+ pointer-events: none;
+ }
+.leaflet-top {
+ top: 0;
+ }
+.leaflet-right {
+ right: 0;
+ }
+.leaflet-bottom {
+ bottom: 0;
+ }
+.leaflet-left {
+ left: 0;
+ }
+.leaflet-control {
+ float: left;
+ clear: both;
+ }
+.leaflet-right .leaflet-control {
+ float: right;
+ }
+.leaflet-top .leaflet-control {
+ margin-top: 10px;
+ }
+.leaflet-bottom .leaflet-control {
+ margin-bottom: 10px;
+ }
+.leaflet-left .leaflet-control {
+ margin-left: 10px;
+ }
+.leaflet-right .leaflet-control {
+ margin-right: 10px;
+ }
+
+
+/* zoom and fade animations */
+
+.leaflet-fade-anim .leaflet-popup {
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+ -moz-transition: opacity 0.2s linear;
+ transition: opacity 0.2s linear;
+ }
+.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
+ opacity: 1;
+ }
+.leaflet-zoom-animated {
+ -webkit-transform-origin: 0 0;
+ -ms-transform-origin: 0 0;
+ transform-origin: 0 0;
+ }
+svg.leaflet-zoom-animated {
+ will-change: transform;
+}
+
+.leaflet-zoom-anim .leaflet-zoom-animated {
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
+ transition: transform 0.25s cubic-bezier(0,0,0.25,1);
+ }
+.leaflet-zoom-anim .leaflet-tile,
+.leaflet-pan-anim .leaflet-tile {
+ -webkit-transition: none;
+ -moz-transition: none;
+ transition: none;
+ }
+
+.leaflet-zoom-anim .leaflet-zoom-hide {
+ visibility: hidden;
+ }
+
+
+/* cursors */
+
+.leaflet-interactive {
+ cursor: pointer;
+ }
+.leaflet-grab {
+ cursor: -webkit-grab;
+ cursor: -moz-grab;
+ cursor: grab;
+ }
+.leaflet-crosshair,
+.leaflet-crosshair .leaflet-interactive {
+ cursor: crosshair;
+ }
+.leaflet-popup-pane,
+.leaflet-control {
+ cursor: auto;
+ }
+.leaflet-dragging .leaflet-grab,
+.leaflet-dragging .leaflet-grab .leaflet-interactive,
+.leaflet-dragging .leaflet-marker-draggable {
+ cursor: move;
+ cursor: -webkit-grabbing;
+ cursor: -moz-grabbing;
+ cursor: grabbing;
+ }
+
+/* marker & overlays interactivity */
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-image-layer,
+.leaflet-pane > svg path,
+.leaflet-tile-container {
+ pointer-events: none;
+ }
+
+.leaflet-marker-icon.leaflet-interactive,
+.leaflet-image-layer.leaflet-interactive,
+.leaflet-pane > svg path.leaflet-interactive,
+svg.leaflet-image-layer.leaflet-interactive path {
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+ pointer-events: auto;
+ }
+
+/* visual tweaks */
+
+.leaflet-container {
+ background: #ddd;
+ outline-offset: 1px;
+ }
+.leaflet-container a {
+ color: #0078A8;
+ }
+.leaflet-zoom-box {
+ border: 2px dotted #38f;
+ background: rgba(255,255,255,0.5);
+ }
+
+
+/* general typography */
+.leaflet-container {
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-size: 0.75rem;
+ line-height: 1.5;
+ }
+
+
+/* general toolbar styles */
+
+.leaflet-bar {
+ box-shadow: 0 1px 5px rgba(0,0,0,0.65);
+ border-radius: 4px;
+ }
+.leaflet-bar a {
+ background-color: #fff;
+ border-bottom: 1px solid #ccc;
+ width: 26px;
+ height: 26px;
+ line-height: 26px;
+ display: block;
+ text-align: center;
+ text-decoration: none;
+ color: black;
+ }
+.leaflet-bar a,
+.leaflet-control-layers-toggle {
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ display: block;
+ }
+.leaflet-bar a:hover,
+.leaflet-bar a:focus {
+ background-color: #f4f4f4;
+ }
+.leaflet-bar a:first-child {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ }
+.leaflet-bar a:last-child {
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-bottom: none;
+ }
+.leaflet-bar a.leaflet-disabled {
+ cursor: default;
+ background-color: #f4f4f4;
+ color: #bbb;
+ }
+
+.leaflet-touch .leaflet-bar a {
+ width: 30px;
+ height: 30px;
+ line-height: 30px;
+ }
+.leaflet-touch .leaflet-bar a:first-child {
+ border-top-left-radius: 2px;
+ border-top-right-radius: 2px;
+ }
+.leaflet-touch .leaflet-bar a:last-child {
+ border-bottom-left-radius: 2px;
+ border-bottom-right-radius: 2px;
+ }
+
+/* zoom control */
+
+.leaflet-control-zoom-in,
+.leaflet-control-zoom-out {
+ font: bold 18px 'Lucida Console', Monaco, monospace;
+ text-indent: 1px;
+ }
+
+.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
+ font-size: 22px;
+ }
+
+
+/* layers control */
+
+.leaflet-control-layers {
+ box-shadow: 0 1px 5px rgba(0,0,0,0.4);
+ background: #fff;
+ border-radius: 5px;
+ }
+.leaflet-control-layers-toggle {
+ background-image: url(images/layers.png);
+ width: 36px;
+ height: 36px;
+ }
+.leaflet-retina .leaflet-control-layers-toggle {
+ background-image: url(images/layers-2x.png);
+ background-size: 26px 26px;
+ }
+.leaflet-touch .leaflet-control-layers-toggle {
+ width: 44px;
+ height: 44px;
+ }
+.leaflet-control-layers .leaflet-control-layers-list,
+.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
+ display: none;
+ }
+.leaflet-control-layers-expanded .leaflet-control-layers-list {
+ display: block;
+ position: relative;
+ }
+.leaflet-control-layers-expanded {
+ padding: 6px 10px 6px 6px;
+ color: #333;
+ background: #fff;
+ }
+.leaflet-control-layers-scrollbar {
+ overflow-y: scroll;
+ overflow-x: hidden;
+ padding-right: 5px;
+ }
+.leaflet-control-layers-selector {
+ margin-top: 2px;
+ position: relative;
+ top: 1px;
+ }
+.leaflet-control-layers label {
+ display: block;
+ font-size: 13px;
+ font-size: 1.08333em;
+ }
+.leaflet-control-layers-separator {
+ height: 0;
+ border-top: 1px solid #ddd;
+ margin: 5px -10px 5px -6px;
+ }
+
+/* Default icon URLs */
+.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
+ background-image: url(images/marker-icon.png);
+ }
+
+
+/* attribution and scale controls */
+
+.leaflet-container .leaflet-control-attribution {
+ background: #fff;
+ background: rgba(255, 255, 255, 0.8);
+ margin: 0;
+ }
+.leaflet-control-attribution,
+.leaflet-control-scale-line {
+ padding: 0 5px;
+ color: #333;
+ line-height: 1.4;
+ }
+.leaflet-control-attribution a {
+ text-decoration: none;
+ }
+.leaflet-control-attribution a:hover,
+.leaflet-control-attribution a:focus {
+ text-decoration: underline;
+ }
+.leaflet-attribution-flag {
+ display: inline !important;
+ vertical-align: baseline !important;
+ width: 1em;
+ height: 0.6669em;
+ }
+.leaflet-left .leaflet-control-scale {
+ margin-left: 5px;
+ }
+.leaflet-bottom .leaflet-control-scale {
+ margin-bottom: 5px;
+ }
+.leaflet-control-scale-line {
+ border: 2px solid #777;
+ border-top: none;
+ line-height: 1.1;
+ padding: 2px 5px 1px;
+ white-space: nowrap;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background: rgba(255, 255, 255, 0.8);
+ text-shadow: 1px 1px #fff;
+ }
+.leaflet-control-scale-line:not(:first-child) {
+ border-top: 2px solid #777;
+ border-bottom: none;
+ margin-top: -2px;
+ }
+.leaflet-control-scale-line:not(:first-child):not(:last-child) {
+ border-bottom: 2px solid #777;
+ }
+
+.leaflet-touch .leaflet-control-attribution,
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+ box-shadow: none;
+ }
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+ border: 2px solid rgba(0,0,0,0.2);
+ background-clip: padding-box;
+ }
+
+
+/* popup */
+
+.leaflet-popup {
+ position: absolute;
+ text-align: center;
+ margin-bottom: 20px;
+ }
+.leaflet-popup-content-wrapper {
+ padding: 1px;
+ text-align: left;
+ border-radius: 12px;
+ }
+.leaflet-popup-content {
+ margin: 13px 24px 13px 20px;
+ line-height: 1.3;
+ font-size: 13px;
+ font-size: 1.08333em;
+ min-height: 1px;
+ }
+.leaflet-popup-content p {
+ margin: 17px 0;
+ margin: 1.3em 0;
+ }
+.leaflet-popup-tip-container {
+ width: 40px;
+ height: 20px;
+ position: absolute;
+ left: 50%;
+ margin-top: -1px;
+ margin-left: -20px;
+ overflow: hidden;
+ pointer-events: none;
+ }
+.leaflet-popup-tip {
+ width: 17px;
+ height: 17px;
+ padding: 1px;
+
+ margin: -10px auto 0;
+ pointer-events: auto;
+
+ -webkit-transform: rotate(45deg);
+ -moz-transform: rotate(45deg);
+ -ms-transform: rotate(45deg);
+ transform: rotate(45deg);
+ }
+.leaflet-popup-content-wrapper,
+.leaflet-popup-tip {
+ background: white;
+ color: #333;
+ box-shadow: 0 3px 14px rgba(0,0,0,0.4);
+ }
+.leaflet-container a.leaflet-popup-close-button {
+ position: absolute;
+ top: 0;
+ right: 0;
+ border: none;
+ text-align: center;
+ width: 24px;
+ height: 24px;
+ font: 16px/24px Tahoma, Verdana, sans-serif;
+ color: #757575;
+ text-decoration: none;
+ background: transparent;
+ }
+.leaflet-container a.leaflet-popup-close-button:hover,
+.leaflet-container a.leaflet-popup-close-button:focus {
+ color: #585858;
+ }
+.leaflet-popup-scrolled {
+ overflow: auto;
+ }
+
+.leaflet-oldie .leaflet-popup-content-wrapper {
+ -ms-zoom: 1;
+ }
+.leaflet-oldie .leaflet-popup-tip {
+ width: 24px;
+ margin: 0 auto;
+
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
+ filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
+ }
+
+.leaflet-oldie .leaflet-control-zoom,
+.leaflet-oldie .leaflet-control-layers,
+.leaflet-oldie .leaflet-popup-content-wrapper,
+.leaflet-oldie .leaflet-popup-tip {
+ border: 1px solid #999;
+ }
+
+
+/* div icon */
+
+.leaflet-div-icon {
+ background: #fff;
+ border: 1px solid #666;
+ }
+
+
+/* Tooltip */
+/* Base styles for the element that has a tooltip */
+.leaflet-tooltip {
+ position: absolute;
+ padding: 6px;
+ background-color: #fff;
+ border: 1px solid #fff;
+ border-radius: 3px;
+ color: #222;
+ white-space: nowrap;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ pointer-events: none;
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4);
+ }
+.leaflet-tooltip.leaflet-interactive {
+ cursor: pointer;
+ pointer-events: auto;
+ }
+.leaflet-tooltip-top:before,
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+ position: absolute;
+ pointer-events: none;
+ border: 6px solid transparent;
+ background: transparent;
+ content: "";
+ }
+
+/* Directions */
+
+.leaflet-tooltip-bottom {
+ margin-top: 6px;
+}
+.leaflet-tooltip-top {
+ margin-top: -6px;
+}
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-top:before {
+ left: 50%;
+ margin-left: -6px;
+ }
+.leaflet-tooltip-top:before {
+ bottom: 0;
+ margin-bottom: -12px;
+ border-top-color: #fff;
+ }
+.leaflet-tooltip-bottom:before {
+ top: 0;
+ margin-top: -12px;
+ margin-left: -6px;
+ border-bottom-color: #fff;
+ }
+.leaflet-tooltip-left {
+ margin-left: -6px;
+}
+.leaflet-tooltip-right {
+ margin-left: 6px;
+}
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+ top: 50%;
+ margin-top: -6px;
+ }
+.leaflet-tooltip-left:before {
+ right: 0;
+ margin-right: -12px;
+ border-left-color: #fff;
+ }
+.leaflet-tooltip-right:before {
+ left: 0;
+ margin-left: -12px;
+ border-right-color: #fff;
+ }
+
+/* Printing */
+
+@media print {
+ /* Prevent printers from removing background-images of controls. */
+ .leaflet-control {
+ -webkit-print-color-adjust: exact;
+ print-color-adjust: exact;
+ }
+ }
diff --git a/store/agents/gis/template/vendor/leaflet.js b/store/agents/gis/template/vendor/leaflet.js
new file mode 100644
index 000000000..a3bf693d0
--- /dev/null
+++ b/store/agents/gis/template/vendor/leaflet.js
@@ -0,0 +1,6 @@
+/* @preserve
+ * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
+ * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
+ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,e){var i,n=Array.prototype.slice;return t.bind?t.bind.apply(t,n.call(arguments,1)):(i=n.call(arguments,2),function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)})}var D=0;function h(t){return"_leaflet_id"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,e,i){var n,o,s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return r}function H(t,e,i){var n=e[1],e=e[0],o=n-e;return t===n&&i?t:((t-e)%o+o)%o+e}function u(){return!1}function i(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return W(t).split(/\s+/)}function c(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?R(t.options):{}),e)t.options[i]=e[i];return t.options}function U(t,e,i){var n,o=[];for(n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var V=/\{ *([\w_ -]+) *\}/g;function q(t,i){return t.replace(V,function(t,e){e=i[e];if(void 0===e)throw new Error("No value provided for variable "+t);return e="function"==typeof e?e(i):e})}var d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function G(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var K="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function J(t){var e=+new Date,i=Math.max(0,16-(e-X));return X=e+i,window.setTimeout(t,i)}var $=window.requestAnimationFrame||Y("RequestAnimationFrame")||J,Q=window.cancelAnimationFrame||Y("CancelAnimationFrame")||Y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function x(t,e,i){if(!i||$!==J)return $.call(window,a(t,e));t.call(e)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:i,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function et(){}et.extend=function(t){function e(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i,n=e.__super__=this.prototype,o=R(n);for(i in(o.constructor=e).prototype=o,this)Object.prototype.hasOwnProperty.call(this,i)&&"prototype"!==i&&"__super__"!==i&&(e[i]=this[i]);if(t.statics&&l(e,t.statics),t.includes){var s=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;r++)s[r]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},et.include=function(t){var e=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},et.mergeOptions=function(t){return l(this.prototype.options,t),this},et.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var e={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}else delete this._events;return this},_on:function(t,e,i,n){"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1===this._listens(t,e,i)&&(e={fn:e,ctx:i=i===this?void 0:i},n&&(e.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e))},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1!==(e=this._listens(t,e,i))&&(i=n[e],this._firingCount&&(i.fn=u,this._events[t]=n=n.slice()),n.splice(e,1))},fire:function(t,e,i){if(this.listens(t,i)){var n=l({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}i&&this._propagateEvent(n)}return this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e,s=("function"!=typeof e&&(n=!!e,i=o=void 0),this._events&&this._events[t]);if(s&&s.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(this._events){var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o}return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},it=(e.addEventListener=e.on,e.removeEventListener=e.clearAllEventListeners=e.off,e.addOneTimeEventListener=e.once,e.fireEvent=e.fire,e.hasEventListeners=e.listens,et.extend(e));function p(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function m(t,e,i){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new p(t.x,t.y):new p(t,e,i)}function f(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function _(t,e){return!t||t instanceof f?t:new f(t,e)}function s(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function g(t,e){return t instanceof s?t:new s(t,e)}function v(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function w(t,e,i){return t instanceof v?t:d(t)&&"object"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new v(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new v(t,e,i)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(m(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(m(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var e=(t=m(t)).x-this.x,t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=m(t)).x===this.x&&t.y===this.y},contains:function(t){return t=m(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+i(this.x)+", "+i(this.y)+")"}},f.prototype={extend:function(t){var e,i;if(t){if(t instanceof p||"number"==typeof t[0]||"x"in t)e=i=m(t);else if(e=(t=_(t)).min,i=t.max,!e||!i)return this;this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone())}return this},getCenter:function(t){return m((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return m(this.min.x,this.max.y)},getTopRight:function(){return m(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t=("number"==typeof t[0]||t instanceof p?m:_)(t))instanceof f?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.x<i.x,t=t.y>e.y&&n.y<i.y;return o&&t},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,t=Math.abs(e.y-i.y)*t;return _(m(e.x-n,e.y-t),m(i.x+n,i.y+t))},equals:function(t){return!!t&&(t=_(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},s.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof v)i=e=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new v(e.lat,e.lng),this._northEast=new v(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,t=Math.abs(e.lng-i.lng)*t;return new s(new v(e.lat-n,e.lng-t),new v(i.lat+n,i.lng+t))},getCenter:function(){return new v((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=("number"==typeof t[0]||t instanceof v||"lat"in t?w:g)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof s?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.lat<i.lat,t=t.lng>e.lng&&n.lng<i.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,e){t=this.projection.project(t),e=this.scale(e);return this.transformation._transform(t,e)},pointToLatLng:function(t,e){e=this.scale(e),t=this.transformation.untransform(t,e);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){var e;return this.infinite?null:(e=this.projection.bounds,t=this.scale(t),new f(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t)))},infinite:!(v.prototype={equals:function(t,e){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+i(this.lat,t)+", "+i(this.lng,t)+")"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,e=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new s(new v(i.lat-n,i.lng-e),new v(t.lat-n,t.lng-e)))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),e=Math.sin((e.lng-t.lng)*i/2),t=s*s+Math.cos(n)*Math.cos(o)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new p(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new f([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,e,i,n){d(t)?(this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3]):(this._a=t,this._b=e,this._c=i,this._d=n)}function ht(t,e,i,n){return new at(t,e,i,n)}at.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new p((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var lt=l({},st,{code:"EPSG:3857",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:"EPSG:900913"});function ct(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,e){for(var i,n,o,s,r="",a=0,h=t.length;a<h;a++){for(i=0,n=(o=t[a]).length;i<n;i++)r+=(i?"L":"M")+(s=o[i]).x+" "+s.y;r+=e?b.svg?"z":"x":""}return r||"M0 0"}var _t=document.documentElement.style,pt="ActiveXObject"in window,mt=pt&&!document.addEventListener,n="msLaunchUri"in navigator&&!("documentMode"in document),ft=y("webkit"),gt=y("android"),vt=y("android 2")||y("android 3"),yt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y("Google")&&yt<537&&!("AudioNode"in window),xt=!!window.opera,wt=!n&&y("chrome"),bt=y("gecko")&&!ft&&!xt&&!pt,Pt=!wt&&y("safari"),Lt=y("phantom"),o="OTransition"in _t,Tt=0===navigator.platform.indexOf("Win"),Mt=pt&&"transition"in _t,zt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vt,_t="MozPerspective"in _t,Ct=!window.L_DISABLE_3D&&(Mt||zt||_t)&&!o&&!Lt,Zt="undefined"!=typeof orientation||y("mobile"),St=Zt&&ft,Et=Zt&&zt,kt=!window.PointerEvent&&window.MSPointerEvent,Ot=!(!window.PointerEvent&&!kt),At="ontouchstart"in window||!!window.TouchEvent,Bt=!window.L_NO_TOUCH&&(At||Ot),It=Zt&&xt,Rt=Zt&&bt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(t){}return t}(),jt=!!document.createElement("canvas").getContext,Ht=!(!document.createElementNS||!ct("svg").createSVGRect),Wt=!!Ht&&((Wt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ve(t,e)||ye(t,((i=xe(t))?i+" ":"")+e)}function z(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,W((" "+xe(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}}function we(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function be(t,e,i){e=e||new p(0,0);t.style[ue]=(b.ie3d?"translate("+e.x+"px,"+e.y+"px)":"translate3d("+e.x+"px,"+e.y+"px,0)")+(i?" scale("+i+")":"")}function Z(t,e){t._leaflet_pos=e,b.any3d?be(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Pe(t){return t._leaflet_pos||new p(0,0)}function Le(){S(window,"dragstart",O)}function Te(){k(window,"dragstart",O)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),le=(he=t).style.outlineStyle,t.style.outlineStyle="none",S(window,"keydown",ze))}function ze(){he&&(he.style.outlineStyle=le,le=he=void 0,k(window,"keydown",ze))}function Ce(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}ae="onselectstart"in document?(re=function(){S(window,"selectstart",O)},function(){k(window,"selectstart",O)}):(se=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),re=function(){var t;se&&(t=document.documentElement.style,oe=t[se],t[se]="none")},function(){se&&(document.documentElement.style[se]=oe,oe=void 0)});pt={__proto__:null,TRANSFORM:ue,TRANSITION:ce,TRANSITION_END:de,get:_e,getStyle:pe,create:P,remove:T,empty:me,toFront:fe,toBack:ge,hasClass:ve,addClass:M,removeClass:z,setClass:ye,getClass:xe,setOpacity:C,testProp:we,setTransform:be,setPosition:Z,getPosition:Pe,get disableTextSelection(){return re},get enableTextSelection(){return ae},disableImageDrag:Le,enableImageDrag:Te,preventOutline:Me,restoreOutline:ze,getSizedParentNode:Ce,getScale:Ze};function S(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)ke(t,o,e[o],i);else for(var s=0,r=(e=F(e)).length;s<r;s++)ke(t,e[s],i,n);return this}var E="_leaflet_events";function k(t,e,i,n){if(1===arguments.length)Se(t),delete t[E];else if(e&&"object"==typeof e)for(var o in e)Oe(t,o,e[o],i);else if(e=F(e),2===arguments.length)Se(t,function(t){return-1!==G(e,t)});else for(var s=0,r=e.length;s<r;s++)Oe(t,e[s],i,n);return this}function Se(t,e){for(var i in t[E]){var n=i.split(/\d/)[0];e&&!e(n)||Oe(t,n,null,null,i)}}var Ee={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function ke(e,t,i,n){var o,s,r=t+h(i)+(n?"_"+h(n):"");e[E]&&e[E][r]||(s=o=function(t){return i.call(n||e,t||window.event)},!b.touchNative&&b.pointer&&0===t.indexOf("touch")?o=Jt(e,t,o):b.touch&&"dblclick"===t?o=ne(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ee[t]||t,o,!!b.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?e.addEventListener(Ee[t],o=function(t){t=t||window.event,We(e,t)&&s(t)},!1):e.addEventListener(t,s,!1):e.attachEvent("on"+t,o),e[E]=e[E]||{},e[E][r]=o)}function Oe(t,e,i,n,o){o=o||e+h(i)+(n?"_"+h(n):"");var s,r,i=t[E]&&t[E][o];i&&(!b.touchNative&&b.pointer&&0===e.indexOf("touch")?(n=t,r=i,Gt[s=e]?n.removeEventListener(Gt[s],r,!1):console.warn("wrong event specified:",s)):b.touch&&"dblclick"===e?(n=i,(r=t).removeEventListener("dblclick",n.dblclick),r.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(Ee[e]||e,i,!1):t.detachEvent("on"+e,i),t[E][o]=null)}function Ae(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Be(t){return ke(t,"wheel",Ae),this}function Ie(t){return S(t,"mousedown touchstart dblclick contextmenu",Ae),t._leaflet_disable_click=!0,this}function O(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return O(t),Ae(t),this}function Ne(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function De(t,e){var i,n;return e?(n=(i=Ze(e)).boundingClientRect,new p((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)):new p(t.clientX,t.clientY)}var je=b.linux&&b.chrome?window.devicePixelRatio:b.mac?3*window.devicePixelRatio:0<window.devicePixelRatio?2*window.devicePixelRatio:1;function He(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function We(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var mt={__proto__:null,on:S,off:k,stopPropagation:Ae,disableScrollPropagation:Be,disableClickPropagation:Ie,preventDefault:O,stop:Re,getPropagationPath:Ne,getMousePosition:De,getWheelDelta:He,isExternalTarget:We,addListener:S,removeListener:k},Fe=it.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t));e&&t._round(),Z(this._el,t),this.fire("step")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=it.extend({options:{crs:lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=c(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(w(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ce&&b.any3d&&!b.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(w(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():g(t);var i=m(e.paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));return(o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0?{center:t.getCenter(),zoom:o}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),o),i=this.project(t.getNorthEast(),o),{center:this.unproject(n.add(i).divideBy(2).add(e),o),zoom:o})},fitBounds:function(t,e){if((t=g(t)).isValid())return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e);throw new Error("Bounds are not valid.")},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){var i;return e=e||{},(t=m(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(M(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend")},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!b.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),e=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(e.x,e.y)),i=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(i*i-h*h+(t?-1:1)*c*c*l*l)/(2*(t?i:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var e=(Date.now()-g)/y,i=(1-Math.pow(1-e,1.5))*v;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(i)/l)),a),this.getScaleZoom(h/(e=i,h*(p(m)/p(m+u*e))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){t=this._getBoundsCenterZoom(t,e);return this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return t=g(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&o.push(i[s]);n=o.concat(n)}if(n.length){"contextmenu"===e&&O(t);var r,a=n[0],h={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(e,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Pe(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){i=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){i=this._getNewPixelOrigin(i,e);return _([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){var n,o;return!i||(n=this.project(t,e),o=this.getSize().divideBy(2),o=new f(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,i,e),Math.abs(o.x)<=1&&Math.abs(o.y)<=1)?t:this.unproject(n.add(o),e)},_limitOffset:function(t,e){var i;return e?(i=new f((i=this.getPixelBounds()).min.add(t),i.max.add(t)),t.add(this._getBoundsOffset(i,e))):t},_getBoundsOffset:function(t,e,i){e=_(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),i=e.min.subtract(t.min),e=e.max.subtract(t.max);return new p(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){z(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){t=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(t))&&(this.panBy(t,e),!0)},_createAnimProxy:function(){var t=this._proxy=P("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ue,i=this._proxy.style[e];be(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();be(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(!this._animatingZoom){if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Ve=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var i=this._controlCorners={},n="leaflet-",o=this._controlContainer=P("div",n+"control-container",this._container);function t(t,e){i[t+e]=P("div",n+t+" "+n+e,o)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),B.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in c(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return B.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){M(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(M(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):z(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=P("div",t),i=this.options.collapsed,n=(e.setAttribute("aria-haspopup",!0),Ie(e),Be(e),this._section=P("section",t+"-list")),o=(i&&(this._map.on("click",this.collapse,this),S(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this)),this._layersLink=P("a",t+"-toggle",e));o.href="#",o.title="Layers",o.setAttribute("role","button"),S(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){O(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=P("div",t+"-base",n),this._separator=P("div",t+"-separator",n),this._overlaysList=P("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&h(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(a(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(this._container){me(this._baseLayersList),me(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=e&&t?"":"none"}return this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(h(t.target)),t=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;t&&this._map.fire(t,e)},_createRadioElement:function(t,e){t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280<t?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+" mi",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+" ft",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),t=t/e;return e*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ke=B.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(b.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new p((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,O(t),this._moved||(this.fire("dragstart"),this._moved=!0,M(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),M(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Z(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){z(document.body,"leaflet-dragging"),this._lastTarget&&(z(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),k(document,"mousemove touchmove",this._onMove,this),k(document,"mouseup touchend touchcancel",this._onUp,this),Te(),ae();var e=this._moved&&this._moving;this._moving=!1,Xe._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Je(t,e,i){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=si(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)):(a._code&h&&((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)),n.push(r));t=n}return t}function $e(t,e){var i,n,o,s,r,a,h;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var l=w([0,0]),u=g(t),c=(u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(l=Qe(t)),t.length),d=[],_=0;_<c;_++){var p=w(t[_]);d.push(e.project(w([p.lat-l.lat,p.lng-l.lng])))}for(_=r=a=h=0,i=c-1;_<c;i=_++)n=d[_],o=d[i],s=n.y*o.x-o.y*n.x,a+=(n.x+o.x)*s,h+=(n.y+o.y)*s,r+=3*s;u=0===r?d[0]:[a/r,h/r],u=e.unproject(m(u));return w([u.lat+l.lat,u.lng+l.lng])}function Qe(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var s=w(t[o]);e+=s.lat,i+=s.lng,n++}return w([e/n,i/n])}var ti,gt={__proto__:null,clipPolygon:Je,polygonCenter:$e,centroid:Qe};function ei(t,e){if(e&&t.length){var i=t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,e=e.y-t.y;return i*i+e*e})(t[n],t[o])>e&&(i.push(t[n]),o=n);o<s-1&&i.push(t[s-1]);return i}(t,e=e*e),n=i.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);o[0]=o[n-1]=1,function t(e,i,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ri(e[a],e[o],e[s],!0),l<h&&(r=a,l=h);n<l&&(i[r]=1,t(e,i,n,o,r),t(e,i,n,r,s))}(i,o,e,0,n-1);var s,r=[];for(s=0;s<n;s++)o[s]&&r.push(i[s]);return r}return t.slice()}function ii(t,e,i){return Math.sqrt(ri(t,e,i,!0))}function ni(t,e,i,n,o){var s,r,a,h=n?ti:si(t,i),l=si(e,i);for(ti=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=si(r=oi(t,e,s=h||l,i,o),i),s===h?(t=r,h=a):(e=r,l=a)}}function oi(t,e,i,n,o){var s,r,a=e.x-t.x,e=e.y-t.y,h=n.min,n=n.max;return 8&i?(s=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(s=t.x+a*(h.y-t.y)/e,r=h.y):2&i?(s=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(s=h.x,r=t.y+e*(h.x-t.x)/a),new p(s,r,o)}function si(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-e)*r)/a)?(o=i.x,e=i.y):0<a&&(o+=s*a,e+=r*a)),s=t.x-o,r=t.y-e,n?s*s+r*r:new p(o,e)}function I(t){return!d(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ai(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),I(t)}function hi(t,e){var i,n,o,s,r,a;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var h=w([0,0]),l=g(t),u=(l.getNorthWest().distanceTo(l.getSouthWest())*l.getNorthEast().distanceTo(l.getNorthWest())<1700&&(h=Qe(t)),t.length),c=[],d=0;d<u;d++){var _=w(t[d]);c.push(e.project(w([_.lat-h.lat,_.lng-h.lng])))}for(i=d=0;d<u-1;d++)i+=c[d].distanceTo(c[d+1])/2;if(0===i)a=c[0];else for(n=d=0;d<u-1;d++)if(o=c[d],s=c[d+1],i<(n+=r=o.distanceTo(s))){a=[s.x-(r=(n-i)/r)*(s.x-o.x),s.y-r*(s.y-o.y)];break}l=e.unproject(m(a));return w([l.lat+h.lat,l.lng+h.lng])}var vt={__proto__:null,simplify:ei,pointToSegmentDistance:ii,closestPointOnSegment:function(t,e,i){return ri(t,e,i)},clipSegment:ni,_getEdgeIntersection:oi,_getBitCode:si,_sqClosestPointOnSegment:ri,isFlat:I,_flat:ai,polylineCenter:hi},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new f([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new f([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-i*Math.log(Math.max(s,1e-10));return new p(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new v(a*i,t.x*i/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},Pt=l({},st,{code:"EPSG:3395",projection:xt,transformation:ht(bt=.5/(Math.PI*xt.R),.5,-bt,.5)}),li=l({},st,{code:"EPSG:4326",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=Pt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=li,ot.Simple=Lt,it.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",function(){i.off(e,this)},this)),this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this}))}})),ui=(A.include({addLayer:function(t){var e;if(t._layerAdd)return e=h(t),this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this;throw new Error("The provided object is not a Layer.")},removeLayer:function(t){var e=h(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?d(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,e=void 0===o.minZoom?e:Math.min(e,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom);this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,e){var i,n;if(c(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:h})),ci=ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,e=new s;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),di=et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(i)return i=this._createImg(i,e&&"IMG"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i;if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"],n=m(n="number"==typeof n?[n,n]:n),o=m("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return b.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var _i=di.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof _i.imagePath&&(_i.imagePath=this._detectIconPath()),(this.options.imagePath||_i.imagePath)+di.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=P("div","leaflet-default-icon-path",document.body),e=pe(t,"background-image")||pe(t,"backgroundImage");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$="leaflet.css"]'))?t.href.substring(0,t.href.length-"leaflet.css".length-1):""}}),pi=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xe(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),M(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&z(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),a=_(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=m((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Pe(e._icon),o=e._map.layerPointToLatLng(n);i&&Z(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),mi=o.extend({options:{icon:new _i,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){c(this,e),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1,i=(i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),M(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(i,"focus",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(M(i,e),i.alt=""),this._shadow=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&k(this._icon,"focus",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(M(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),pi&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new pi(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?m(e.iconSize):m(0,0),e=e.iconAnchor?m(e.iconAnchor):m(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var fi=o.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),gi=fi.extend({options:{fill:!0,radius:10},initialize:function(t,e){c(this,e),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return fi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),t=[t+i,e+i];this._pxBounds=new f(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var vi=gi.extend({initialize:function(t,e,i){if(c(this,e="number"==typeof e?l({},i,{radius:e}):e),this._latlng=w(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:fi.prototype.setStyle,_project:function(){var t,e,i,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),e=a.project([r-o,s]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,s-n]).x,this._radiusY=e.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var yi=fi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){c(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ri,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<e&&(e=c,i=n(t,l,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(this._map)return hi(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=w(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return I(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=I(t),n=0,o=t.length;n<o;n++)i?(e[n]=w(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new f;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new f([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(e=0,i=(o=this._rings[r]).length;e<i-1;e++)(n=ni(o[e],o[e+1],t,e,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=ei(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,h=this._clickTolerance();if(this._pxBounds&&this._pxBounds.contains(t))for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&ii(t,a[o],a[n])<=h)return!0;return!1}});yi._flat=ai;var xi=yi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(this._map)return $e(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},_convertLatLngs:function(t){var t=yi.prototype._convertLatLngs.call(this,t),e=t.length;return 2<=e&&t[0]instanceof v&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){yi.prototype._setLatLngs.call(this,t),I(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(I(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,e=new p(e,e),t=new f(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,o=this._rings.length;n<o;n++)(i=Je(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(e=this._parts[o]).length)-1;s<h;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s,r=this.options;return(!r.filter||r.filter(t))&&(s=bi(t,r))?(s.feature=Zi(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function bi(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Li;if(!a&&!r)return null;switch(r.type){case"Point":return Pi(l,t,i=u(a),e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=u(a[o]),h.push(Pi(l,t,i,e));return new ci(h);case"LineString":case"MultiLineString":return n=Ti(a,"LineString"===r.type?0:1,u),new yi(n,e);case"Polygon":case"MultiPolygon":return n=Ti(a,"Polygon"===r.type?1:2,u),new xi(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=bi({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);c&&h.push(c)}return new ci(h);case"FeatureCollection":for(o=0,s=r.features.length;o<s;o++){var d=bi(r.features[o],e);d&&h.push(d)}return new ci(h);default:throw new Error("Invalid GeoJSON object.")}}function Pi(t,e,i,n){return t?t(e,i):new mi(i,n&&n.markersInheritOptions&&n)}function Li(t){return new v(t[1],t[0],t[2])}function Ti(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?Ti(t[s],e-1,i):(i||Li)(t[s]),o.push(n);return o}function Mi(t,e){return void 0!==(t=w(t)).alt?[i(t.lng,e),i(t.lat,e),i(t.alt,e)]:[i(t.lng,e),i(t.lat,e)]}function zi(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?zi(t[s],I(t[s])?0:e-1,i,n):Mi(t[s],n));return!e&&i&&0<o.length&&o.push(o[0].slice()),o}function Ci(t,e){return t.feature?l({},t.feature,{geometry:e}):Zi(e)}function Zi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Ci(this,{type:"Point",coordinates:Mi(this.getLatLng(),t)})}};function Si(t,e){return new wi(t,e)}mi.include(Tt),vi.include(Tt),gi.include(Tt),yi.include({toGeoJSON:function(t){var e=!I(this._latlngs);return Ci(this,{type:(e?"Multi":"")+"LineString",coordinates:zi(this._latlngs,e?1:0,!1,t)})}}),xi.include({toGeoJSON:function(t){var e=!I(this._latlngs),i=e&&!I(this._latlngs[0]),t=zi(this._latlngs,i?2:e?1:0,!0,t);return Ci(this,{type:(i?"Multi":"")+"Polygon",coordinates:t=e?t:[t]})}}),ui.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ci(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(e){var i,n,t=this.feature&&this.feature.geometry&&this.feature.geometry.type;return"MultiPoint"===t?this.toMultiPoint(e):(i="GeometryCollection"===t,n=[],this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(e),i?n.push(t.geometry):"FeatureCollection"===(t=Zi(t)).type?n.push.apply(n,t.features):n.push(t))}),i?Ci(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n})}});var Mt=Si,Ei=o.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=g(e),c(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:P("img");M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=a(this.fire,this,"load"),e.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;be(this._image,t,e)},_reset:function(){var t=this._image,e=new f(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Z(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:P("video");if(M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=a(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=P("source");r.src=this._url[s],e.appendChild(r)}}}});var Oi=Ei.extend({_initImage:function(){var t=this._image=this._url;M(t,"leaflet-image-layer"),this._zoomAnimated&&M(t,"leaflet-zoom-animated"),this.options.className&&M(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var Ai=o.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof v||d(t))?(this._latlng=w(t),c(this,e)):(c(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(M(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof ci){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error("Unable to get source layer LatLng.");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=m(this.options.offset),i=this._getAnchor(),this._zoomAnimated?Z(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+"px",this._container.style.left=i+"px")},_getAnchor:function(){return[0,0]}}),Bi=(A.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),o.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(c(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}}),Ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ai.prototype.openOn.call(this,t)},onAdd:function(t){Ai.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof fi||this._source.on("preclick",Ae))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof fi||this._source.off("preclick",Ae))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=P("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=P("div",t+"-content-wrapper",e);this._contentNode=P("div",t+"-content",i),Ie(e),Be(this._contentNode),S(e,"contextmenu",Ae),this._tipContainer=P("div",t+"-tip-container",e),this._tip=P("div",t+"-tip",this._tipContainer),this.options.closeButton&&((i=this._closeButton=P("a",t+"-close-button",e)).setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">&#215;</span>',S(i,"click",function(t){O(t),this.close()},this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width="",e.whiteSpace="nowrap",t.offsetWidth),i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="",t.offsetHeight),n=this.options.maxHeight,o="leaflet-popup-scrolled";(n&&n<i?(e.height=n+"px",M):z)(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Z(this._container,t.add(e))},_adjustPan:function(){var t,e,i,n,o,s,r,a;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning?this._autopanning=!1:(t=this._map,e=parseInt(pe(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+e,a=this._containerWidth,(i=new p(this._containerLeft,-e-this._containerBottom))._add(Pe(this._container)),i=t.layerPointToContainerPoint(i),o=m(this.options.autoPanPadding),n=m(this.options.autoPanPaddingTopLeft||o),o=m(this.options.autoPanPaddingBottomRight||o),s=t.getSize(),r=0,i.x+a+o.x>s.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.x<o.x?(s="right",0):(s="left",r+2*(h.x+l.x)),a/2);t=t.subtract(m(e,i,!0)).add(h).add(l),z(n,"leaflet-tooltip-right"),z(n,"leaflet-tooltip-left"),z(n,"leaflet-tooltip-top"),z(n,"leaflet-tooltip-bottom"),M(n,"leaflet-tooltip-"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return m(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Ri=(A.include({openTooltip:function(t,e,i){return this._initOverlay(Ii,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ii,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&(this instanceof ci||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(S(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),S(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){t="function"==typeof t.getElement&&t.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){var e;this._tooltip&&this._map&&(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag?(this._openOnceFlag=!0,(e=this)._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)})):(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),di.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var t=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;return e.html instanceof Element?(me(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:"",e.bgPos&&(e=m(e.bgPos),t.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));di.Default=_i;var Ni=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:b.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!b.ielt9){C(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(e-s.loaded)/200),C(s.el,o),o<1?i=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=P("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(T(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=P("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var t=Math.floor(t/2),e=Math.floor(e/2),i=i-1,o=new p(+t,+e),o=(o.z=i,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new p(o,s),r=(r.z=i+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();b.any3d?be(t.el,e,n):Z(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(i,this._tileZoom),t=e.project(t,this._tileZoom).floor(),e=e.getSize().divideBy(2*i);return new f(t.subtract(e),t.add(e))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n,e=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(e),s=o.getCenter(),r=[],e=this.options.keepBuffer,a=new f(o.getBottomLeft().subtract([e,-e]),o.getTopRight().add([e,-e]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,e){return t.distanceTo(s)-e.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0<e.maxZoom?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return S(i,"load",a(this._tileOnLoad,this,e,i)),S(i,"error",a(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(e.y=t),e["-y"]=t),q(this._url,l(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(a(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=u,i.onerror=u,i.complete||(i.src=K,e=this._tiles[t].coords,T(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",K),Ni.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==K))return Ni.prototype._tileReady.call(this,t,e,i)}});function ji(t,e){return new Di(t,e)}var Hi=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i,n=l({},this.defaultWmsParams);for(i in e)i in this.options||(n[i]=e[i]);var t=(e=c(this,e)).detectRetina&&b.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,i=_(i.project(e[0]),i.project(e[1])),e=i.min,i=i.max,e=(1.3<=this._wmsVersion&&this._crs===li?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(","),i=Di.prototype.getTileUrl.call(this,t);return i+U(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});Di.WMS=Hi,ji.wms=function(t,e){return new Hi(t,e)};var Wi=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),n=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?be(this._container,n,i):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new f(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fi=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");S(t,"mousemove",this._onMouseMove,this),S(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),S(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),k(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1,Z(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,e=e.prev;i?i.prev=e:this._drawLast=e,e?e.next=i:this._drawFirst=i,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new f,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],h[n?"lineTo":"moveTo"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(z(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(M(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Ui(t){return b.canvas?new Fi(t):null}var Vi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)<Math.abs(n+i)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire("dragend",t),!a&&(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(o=t.multiplyBy(-n/2).round()).x||o.y)?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})})):s.fire("moveend")}})),St=(A.addInitHook("addHandler","dragging",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),k(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){S(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){k(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i,n=t.keyCode,o=this._map;if(n in this._panKeys)o._panAnim&&o._panAnim._inProgress||(i=this._panKeys[n],t.shiftKey&&(i=m(i).multiplyBy(3)),o.options.maxBounds&&(i=o._limitOffset(m(i),o.options.maxBounds)),o.options.worldCopyJump?(e=o.wrapLatLng(o.unproject(o.project(o.getCenter()).add(i))),o.panTo(e)):o.panBy(i));else if(n in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Re(t)}}})),Et=(A.addInitHook("addHandler","keyboard",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){k(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=He(t),i=this._map.options.wheelDebounceTime,e=(this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(i-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),e),Re(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),kt=(A.addInitHook("addHandler","scrollWheelZoom",Et),A.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){k(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new p(e.clientX,e.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,"touchend",O),S(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),S(document,"touchend touchcancel contextmenu",this._cancel,this),S(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){k(document,"touchend",O),k(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),k(document,"touchend touchcancel contextmenu",this._cancel,this),k(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});t._simulated=!0,e.target.dispatchEvent(t)}})),Ot=(A.addInitHook("addHandler","tapHold",kt),A.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){M(this._map._container,"leaflet-touch-zoom"),S(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){z(this._map._container,"leaflet-touch-zoom"),k(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,"touchmove",this._onTouchMove,this),S(document,"touchend touchcancel",this._onTouchEnd,this),O(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{i=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(n,this,!0),O(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),k(document,"touchmove",this._onTouchMove,this),k(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),Xi=(A.addInitHook("addHandler","touchZoom",Ot),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=Et,A.TapHold=kt,A.TouchZoom=Ot,t.Bounds=f,t.Browser=b,t.CRS=ot,t.Canvas=Fi,t.Circle=vi,t.CircleMarker=gi,t.Class=et,t.Control=B,t.DivIcon=Ri,t.DivOverlay=Ai,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xe,t.Evented=it,t.FeatureGroup=ci,t.GeoJSON=wi,t.GridLayer=Ni,t.Handler=n,t.Icon=di,t.ImageOverlay=Ei,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ui,t.LineUtil=vt,t.Map=A,t.Marker=mi,t.Mixin=ft,t.Path=fi,t.Point=p,t.PolyUtil=gt,t.Polygon=xi,t.Polyline=yi,t.Popup=Bi,t.PosAnimation=Fe,t.Projection=wt,t.Rectangle=Yi,t.Renderer=Wi,t.SVG=Gi,t.SVGOverlay=Oi,t.TileLayer=Di,t.Tooltip=Ii,t.Transformation=at,t.Util=tt,t.VideoOverlay=ki,t.bind=a,t.bounds=_,t.canvas=Ui,t.circle=function(t,e,i){return new vi(t,e,i)},t.circleMarker=function(t,e){return new gi(t,e)},t.control=Ue,t.divIcon=function(t){return new Ri(t)},t.extend=l,t.featureGroup=function(t,e){return new ci(t,e)},t.geoJSON=Si,t.geoJson=Mt,t.gridLayer=function(t){return new Ni(t)},t.icon=function(t){return new di(t)},t.imageOverlay=function(t,e,i){return new Ei(t,e,i)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,e){return new ui(t,e)},t.map=function(t,e){return new A(t,e)},t.marker=function(t,e){return new mi(t,e)},t.point=m,t.polygon=function(t,e){return new xi(t,e)},t.polyline=function(t,e){return new yi(t,e)},t.popup=function(t,e){return new Bi(t,e)},t.rectangle=function(t,e){return new Yi(t,e)},t.setOptions=c,t.stamp=h,t.svg=Ki,t.svgOverlay=function(t,e,i){return new Oi(t,e,i)},t.tileLayer=ji,t.tooltip=function(t,e){return new Ii(t,e)},t.transformation=ht,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Xi,this},window.L=t});
+//# sourceMappingURL=leaflet.js.map
\ No newline at end of file
diff --git a/store/agents/gis/test/geo.test.mjs b/store/agents/gis/test/geo.test.mjs
new file mode 100644
index 000000000..f9b4245e8
--- /dev/null
+++ b/store/agents/gis/test/geo.test.mjs
@@ -0,0 +1,27 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { readFile } from 'node:fs/promises';
+import { validateGeoJSON, filterFeatures, distanceKm } from '../template/geo.mjs';
+const feature=(type,coordinates,properties={name:'A'})=>({type:'Feature',properties,geometry:{type,coordinates}});
+const collection=features=>({type:'FeatureCollection',features});
+test('all supported geometries validate, while malformed coordinates, open rings and excessive datasets fail',()=>{
+ const ring=[[0,0],[1,0],[1,1],[0,0]];
+ const good=collection([feature('Point',[0,0]),feature('MultiPoint',[[1,2],[2,3]]),feature('LineString',[[0,0],[1,1]]),feature('MultiLineString',[[[0,0],[1,1]]]),feature('Polygon',[ring]),feature('MultiPolygon',[[ring]])]);
+ assert.equal(validateGeoJSON(good),good);
+ for(const bad of [null,{},collection([feature('Point',[190,0])]),collection([feature('Point',[1,NaN])]),collection([feature('Point',[])]),collection([feature('Polygon',[[[0,0],[1,0],[1,1],[0,1]]])]),collection([feature('GeometryCollection',[])]),collection(Array(2001).fill(good.features[0]))])assert.throws(()=>validateGeoJSON(bad));
+});
+test('filtering keeps original identities and exports genuine source features',()=>{
+ const data=collection([feature('Point',[1,2],{name:'Hanoi'}),feature('LineString',[[1,2],[2,3]],{name:'Hanoi route'})]);
+ assert.equal(filterFeatures(data.features,' HANOI ').length,2);
+ const rows=filterFeatures(data.features,'Hanoi','LineString');assert.equal(rows.length,1);assert.equal(rows[0].index,1);assert.equal(rows[0].feature,data.features[1]);
+ assert.equal(filterFeatures(data.features,'missing').length,0);
+});
+test('great-circle distances handle identical points, antipodes and the date line',()=>{
+ assert.equal(distanceKm([10,20],[10,20]),0);
+ assert.ok(Math.abs(distanceKm([0,0],[1,0])-111.195)<.001);
+ assert.ok(Math.abs(distanceKm([179,0],[-179,0])-222.39)<.001);
+ assert.ok(Math.abs(distanceKm([0,0],[180,0])-20015.114)<.001);
+});
+test('both the starter data and vendored world boundaries are valid, real GeoJSON',async()=>{
+ for(const name of ['cities','countries']){const geo=JSON.parse(await readFile(new URL('../template/'+name+'.geojson',import.meta.url)));assert.ok(validateGeoJSON(geo).features.length>0);}
+});
diff --git a/store/agents/gis/test/toolchain.test.mjs b/store/agents/gis/test/toolchain.test.mjs
new file mode 100644
index 000000000..85ef5ec37
--- /dev/null
+++ b/store/agents/gis/test/toolchain.test.mjs
@@ -0,0 +1,48 @@
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const d of scratch) rmSync(d, { recursive: true, force: true }) })
+function tempDir() { const d = mkdtempSync(join(tmpdir(), 'gis-')); scratch.push(d); return d }
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [k, v] of Object.entries(env)) if (v === null) delete merged[k]; else merged[k] = v
+ const r = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: r.status, stdout: r.stdout, stderr: r.stderr }
+}
+
+test('every script the manifest names is executable', () => {
+ for (const s of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/gis/scripts/proof.mjs'])
+ assert.doesNotThrow(() => accessSync(join(here, s), constants.X_OK), s)
+})
+test('doctor always ok (no native toolchain needed)', () => {
+ const { code, stdout } = run(manifest.toolchain.doctor)
+ assert.equal(code, 0); assert.match(stdout, /ok isolated-web-viewer/)
+})
+test('setup is a quiet no-op', () => {
+ assert.deepEqual([run(manifest.toolchain.setup).code, run(manifest.toolchain.setup).stdout, run(manifest.toolchain.setup).stderr], [0, '', ''])
+})
+test('init seeds the first verdict', () => {
+ const ws = tempDir()
+ assert.equal(run(manifest.workspace.init, { cwd: ws, env: { HARNESS_DSH: manifest.id } }).code, 0)
+ assert.equal(JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8')).ready, false)
+})
+test('template is a real interactive map with data', () => {
+ const html = readFileSync(join(here, 'template/index.html'), 'utf8')
+ const geo = readFileSync(join(here, 'template/cities.geojson'), 'utf8')
+ const app = readFileSync(join(here, 'template/atlas.mjs'), 'utf8')
+ assert.match(html, /vendor\/leaflet/); assert.match(app, /cities\.geojson/); assert.match(app, /L\.geoJSON/)
+ assert.ok(JSON.parse(geo).features.length >= 1)
+})
+test('the golden-loop command in SKILL.md matches the shipped proof script', () => {
+ const skill = readFileSync(join(here, 'skills/gis/SKILL.md'), 'utf8')
+ assert.ok(skill.includes('node "$GIS_SKILLS/gis/scripts/proof.mjs"'))
+ assert.equal(manifest.agent.env.GIS_SKILLS, '${dsh}/skills')
+})
diff --git a/store/agents/gis/toolchain/doctor.sh b/store/agents/gis/toolchain/doctor.sh
new file mode 100755
index 000000000..f9c17fe83
--- /dev/null
+++ b/store/agents/gis/toolchain/doctor.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -u
+echo "ok isolated-web-viewer is the runtime (no native toolchain required)"
+command -v node >/dev/null 2>&1 && echo "ok node (for the headless proof)" || echo "warn node missing — headless proof won't run (map still works)"
+exit 0
diff --git a/store/agents/gis/toolchain/init-workspace.sh b/store/agents/gis/toolchain/init-workspace.sh
new file mode 100755
index 000000000..3cfba3cec
--- /dev/null
+++ b/store/agents/gis/toolchain/init-workspace.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "GIS workspace ready — describe a map to make",
+ "findings": [], "artifact": "index.html", "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'GIS workspace initialized by %s\n' "${HARNESS_DSH:-gis}" > .harness-initialized
diff --git a/store/agents/gis/toolchain/setup.sh b/store/agents/gis/toolchain/setup.sh
new file mode 100755
index 000000000..923df16a3
--- /dev/null
+++ b/store/agents/gis/toolchain/setup.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+# GIS needs no native toolchain — the isolated-web-viewer IS the runtime. Optional: node for the proof script.
+set -u
+exit 0
diff --git a/store/agents/godot-studio/.gitignore b/store/agents/godot-studio/.gitignore
new file mode 100644
index 000000000..de0c98dab
--- /dev/null
+++ b/store/agents/godot-studio/.gitignore
@@ -0,0 +1,6 @@
+# Godot import cache + web export — never source.
+.godot/
+build/
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/godot-studio/AGENTS.md b/store/agents/godot-studio/AGENTS.md
new file mode 100644
index 000000000..860408dd7
--- /dev/null
+++ b/store/agents/godot-studio/AGENTS.md
@@ -0,0 +1,9 @@
+# Godot Studio workspace
+
+Read `skills/godot/SKILL.md`. The source project is at the workspace root; the pane follows `build/web/index.html`.
+
+- Start by building the shipped Lumen game so the user has something playable.
+- Keep native gameplay assertions in `scripts/proof.gd` relevant to the mechanics. Export success alone is not browser verification.
+- Run the staged export after meaningful changes, then play the real build and exercise movement, goals, pause and restart.
+- Keep single-threaded Web exports and the Compatibility renderer for the isolated shared viewer. Do not weaken the viewer sandbox to enable threads or storage.
+- A failed build clears ready and preserves prior output. Report current failure rather than pointing at an old game as new evidence.
diff --git a/store/agents/godot-studio/LICENSE b/store/agents/godot-studio/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/godot-studio/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/godot-studio/PROVENANCE.md b/store/agents/godot-studio/PROVENANCE.md
new file mode 100644
index 000000000..c42fbb2c4
--- /dev/null
+++ b/store/agents/godot-studio/PROVENANCE.md
@@ -0,0 +1,7 @@
+# Provenance
+
+Lumen's game logic, drawn geometry, custom export shell, native proof and build
+helpers are original MIT-licensed OpenHarness work. There are no external art,
+font or sound assets. [Godot](https://godotengine.org) is a separately installed
+MIT-licensed game engine. Native QA used Godot 4.4.1 with matching official export
+templates. Neither editor nor templates are redistributed in this package.
diff --git a/store/agents/godot-studio/README.md b/store/agents/godot-studio/README.md
new file mode 100644
index 000000000..41529570a
--- /dev/null
+++ b/store/agents/godot-studio/README.md
@@ -0,0 +1,29 @@
+# Godot Studio · Lumen
+
+Build a playable Godot game from an idea and test it in the Harness pane. The starter is **Lumen**, a small original light garden: guide a spark to six blooms, dash, pause and begin again. Mouse/touch destinations and keyboard controls work in the browser. All visual art is generated by GDScript.
+
+## Start
+
+Install `autonomous/godot-studio` from the Harness Store, with Godot 4.3+ and matching Web export templates. Tested with Godot 4.4.1. Set `GODOT_BIN` for a custom editor path; `GODOT_WEB_TEMPLATE` can point to its matching single-threaded release ZIP.
+
+```sh
+sh "$GODOT_SKILLS/godot/scripts/export-web.sh"
+```
+
+Try: “Turn this into a constellation puzzle. Connect blooms in a particular order and give each level a different pattern.”
+
+## The build loop
+
+The helper snapshots project source into fresh staging, imports it, runs `scripts/proof.gd`, requires a fresh passing receipt, and exports the Web preset. A failed proof/export clears ready without replacing the prior game. Logs live in `.harness/export.log`.
+
+Lumen's nine native checks cover spawn, movement, artwork following gameplay, bounded visual nodes, dash speed, pause, bounds, collecting all blooms, and restart. Headless assertions are distinct from browser proof: the repository's real-browser test plays through all six blooms, pauses, restarts, uses keyboard movement, and repeats a pickup at mobile width. Update both tests when mechanics change.
+
+`scripts/garden.gd` caches its procedural drawing commands once, then animates transforms and color. Keep this retained-art pattern when extending the game: rebuilding every primitive each physics tick can stall WebGL drivers. The release preview measured 60 fps with zero long tasks on the tested Chrome/AMD Metal device; this is a measurement, not a guarantee for every device.
+
+The export uses the Compatibility renderer, single-threaded WASM and no PWA. The shared viewer keeps the game in an opaque-origin sandbox: no persistent browser storage or service workers. Godot 4.4's known optional PWA callback probe is reported as an offline-installation warning there; all other engine errors remain errors.
+
+For optional interaction/performance checks, install Playwright in the shared viewer or set `PLAYWRIGHT_MODULE`, then run the skill's `perf.mjs` with `HARNESS_WORKSPACE` and `build/web/index.html`. `proof.json` exercises actual game pause/restart through its JavaScript bridge; frame results describe that device/browser, not a universal FPS guarantee.
+
+## Credit and stewardship
+
+Godot is the Godot Engine contributors' MIT-licensed project. This original MIT wrapper and Lumen starter are maintained by OpenHarness contributors, not the Godot project. The editor/export templates are installed separately. Report engine issues upstream and wrapper issues here.
diff --git a/store/agents/godot-studio/harness.json b/store/agents/godot-studio/harness.json
new file mode 100644
index 000000000..f4663fdf3
--- /dev/null
+++ b/store/agents/godot-studio/harness.json
@@ -0,0 +1,31 @@
+{
+ "spec": 1,
+ "id": "autonomous/godot-studio",
+ "name": "Godot Studio",
+ "category": "Games",
+ "author": "OpenHarness contributors",
+ "description": "Describe a game; get a real, playable Godot project \u2014 exported to the browser and running live in the pane.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "project.godot",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": ["skills"],
+ "env": {
+ "GODOT_TOOLCHAIN": "${dsh}/toolchain",
+ "GODOT_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [".pck", ".html"]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/godot-studio/package.json b/store/agents/godot-studio/package.json
new file mode 100644
index 000000000..a86506cbf
--- /dev/null
+++ b/store/agents/godot-studio/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@autonomous/godot-studio-harness",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test test/*.test.mjs",
+ "perf": "node skills/godot/scripts/perf.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+}
diff --git a/store/agents/godot-studio/skills/godot/SKILL.md b/store/agents/godot-studio/skills/godot/SKILL.md
new file mode 100644
index 000000000..e8213277d
--- /dev/null
+++ b/store/agents/godot-studio/skills/godot/SKILL.md
@@ -0,0 +1,28 @@
+---
+name: godot
+description: Build Godot games with GDScript, native gameplay assertions and sandboxed Web exports. Use for Godot Studio project and game-mechanic tasks.
+---
+
+# Game source and proof
+
+Project: `project.godot`; scene: `scenes/Main.tscn`; starter mechanics: `scripts/main.gd`. Lumen draws its own art and supports keyboard and pointer/touch destinations.
+
+```sh
+sh "$GODOT_SKILLS/godot/scripts/export-web.sh"
+```
+
+The helper copies source (excluding build/cache directories), imports, runs `scripts/proof.gd`, then exports the Web preset into fresh staging. `GODOT_BIN` selects an editor, and `GODOT_WEB_TEMPLATE` an optional matching single-threaded release template. Node 20+ bootstraps through the package helper.
+
+Proof must instantiate real gameplay and assert meaningful state transitions. On success it writes `{"passed":true,"checks":[...]}` to `HARNESS_BUILD_DIR/proof.json`; on failure exit nonzero. A missing receipt is failure even if Godot exits zero. Keep assertions relevant when replacing the starter. A standalone proof can write to Godot's user data directory when that environment variable is unset.
+
+Use `_physics_process` for movement and keep per-frame work bounded. Preserve keyboard, touch/click, pause and restart when useful for the requested game. The custom `web/shell.html` exposes actual game state through JavaScriptBridge, not a parallel simulated game.
+
+The build verdict means native assertions and export passed. Verify the exported game in the actual shared viewer before claiming browser readiness. A browser playthrough must exercise game results, not just see a canvas.
+
+The viewer requires a single-threaded export (Godot 4.3+), Compatibility renderer, no service worker or persistent browser storage. Keep the editor and templates version-matched. Only Godot 4.4's known optional PWA callback warning is downgraded in the opaque sandbox; other engine errors remain visible.
+
+Optional interaction/performance probe:
+```sh
+HARNESS_WORKSPACE="$PWD" node "$GODOT_SKILLS/godot/scripts/perf.mjs" build/web/index.html
+```
+Uses shared Web Viewer + Playwright and the assertions in `proof.json`. It reports actual interaction frame timing; inspect the recorded renderer and do not extrapolate hardware performance to other devices.
diff --git a/store/agents/godot-studio/skills/godot/scripts/build.mjs b/store/agents/godot-studio/skills/godot/scripts/build.mjs
new file mode 100644
index 000000000..b11de50c9
--- /dev/null
+++ b/store/agents/godot-studio/skills/godot/scripts/build.mjs
@@ -0,0 +1,48 @@
+import {access,cp,mkdtemp,mkdir,readFile,writeFile,rename,rm,stat,readdir} from 'node:fs/promises';
+import {constants} from 'node:fs';
+import {spawnSync} from 'node:child_process';
+import {resolve,join,relative} from 'node:path';
+const ws=resolve(process.env.HARNESS_WORKSPACE||process.cwd()), meta=join(ws,'.harness');
+await mkdir(meta,{recursive:true});
+const verdict=async(ready,summary,findings=[])=>writeFile(join(meta,'verdict.json'),JSON.stringify({spec:1,ready,summary,findings,artifact:ready?'build/web/index.html':null,updatedAt:new Date().toISOString()},null,2)+'\n');
+await verdict(false,'Checking gameplay and exporting Web…');
+let stage,log='';
+try{
+ let bin=process.env.GODOT_BIN;
+ if(!bin){const found=spawnSync('/bin/sh',['-c','command -v godot'],{encoding:'utf8'});bin=found.stdout.trim()||'/Applications/Godot.app/Contents/MacOS/Godot';}
+ await access(bin,constants.X_OK).catch(()=>{throw new Error('Godot not found. Install Godot 4.3+ and matching Web templates, or set GODOT_BIN.');});
+ stage=await mkdtemp(join(meta,'godot-'));
+ const project=join(stage,'project'), output=join(stage,'web');
+ await mkdir(project);
+ const allowed=path=>!relative(ws,path).split(/[\\/]/).some(part=>['.harness','.godot','.git','build','node_modules'].includes(part));
+ for(const entry of await readdir(ws))if(allowed(join(ws,entry)))await cp(join(ws,entry),join(project,entry),{recursive:true,filter:allowed});
+ await mkdir(output);
+ let presets=await readFile(join(project,'export_presets.cfg'),'utf8');
+ if(process.env.GODOT_WEB_TEMPLATE){
+ const template=resolve(process.env.GODOT_WEB_TEMPLATE);await access(template);
+ presets=presets.replace(/^custom_template\/release=.*$/m,'custom_template/release='+JSON.stringify(template));
+ await writeFile(join(project,'export_presets.cfg'),presets);
+ }
+ await access(join(project,'scripts/proof.gd')).catch(()=>{throw new Error('Add scripts/proof.gd with assertions and a proof.json receipt in HARNESS_BUILD_DIR.');});
+ const run=(args)=>{
+ const result=spawnSync(bin,['--headless','--path',project,...args],{env:{...process.env,HARNESS_BUILD_DIR:stage},encoding:'utf8',timeout:180000,maxBuffer:16*1024*1024});
+ log+='\n$ godot '+args.join(' ')+'\n'+(result.stdout||'')+(result.stderr||'');
+ if(result.error||result.status!==0)throw new Error(result.error?.message||'Godot failed; inspect .harness/export.log.');
+ };
+ run(['--editor','--import']);
+ run(['--script','res://scripts/proof.gd']);
+ const proof=JSON.parse(await readFile(join(stage,'proof.json'),'utf8'));
+ if(proof.passed!==true||!Array.isArray(proof.checks)||!proof.checks.length)throw new Error('Gameplay proof did not produce a passing receipt.');
+ run(['--export-release','Web',join(output,'index.html')]);
+ for(const name of ['index.html','index.js','index.pck','index.wasm'])if((await stat(join(output,name))).size===0)throw new Error('Empty export: '+name);
+ const destination=join(ws,'build/web');await mkdir(join(ws,'build'),{recursive:true});
+ // Preserve the previous export until a fresh proof and export both succeed.
+ let previous=false;
+ try{await rename(destination,join(stage,'previous'));previous=true;}catch(error){if(error.code!=='ENOENT')throw error;}
+ try{await rename(output,destination);}catch(error){if(previous)await rename(join(stage,'previous'),destination);throw error;}
+ await writeFile(join(meta,'gameplay-proof.json'),JSON.stringify(proof,null,2)+'\n');
+ await writeFile(join(ws,'build-status.html'),'<!doctype html><meta charset="utf-8"><title>Godot export</title><h1>Gameplay assertions and Web export passed</h1><p>Browser playthrough is a separate check.</p><a href="build/web/index.html">Play the exported game</a>');
+ await verdict(true,'Gameplay assertions and Web export passed',[{severity:'info',kind:'verification',message:'Headless game-state checks passed. Run browser proof and play through the exported build before claiming browser compatibility.'}]);
+ console.log('ok '+proof.checks.length+' gameplay checks; Web export → build/web/index.html');
+}catch(error){await verdict(false,'Game build failed',[{severity:'error',kind:'build',message:error.message}]);console.error(error.message);process.exitCode=1;}
+finally{await writeFile(join(meta,'export.log'),log);if(stage)await rm(stage,{recursive:true,force:true});}
diff --git a/store/agents/godot-studio/skills/godot/scripts/export-web.sh b/store/agents/godot-studio/skills/godot/scripts/export-web.sh
new file mode 100755
index 000000000..1b2aaa404
--- /dev/null
+++ b/store/agents/godot-studio/skills/godot/scripts/export-web.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs"
diff --git a/store/agents/godot-studio/skills/godot/scripts/perf.mjs b/store/agents/godot-studio/skills/godot/scripts/perf.mjs
new file mode 100644
index 000000000..3b885bd05
--- /dev/null
+++ b/store/agents/godot-studio/skills/godot/scripts/perf.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'perf' });
+}
diff --git a/store/agents/godot-studio/store.json b/store/agents/godot-studio/store.json
new file mode 100644
index 000000000..c973b4cc5
--- /dev/null
+++ b/store/agents/godot-studio/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://godotengine.org",
+ "upstream": "https://github.com/godotengine/godot",
+ "license": "MIT",
+ "tagline": "A free and open-source game engine",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/godot-studio/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Build Lumen, run its gameplay assertions, and export the six-seed garden game for the browser.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/godot-studio/starter.jpg",
+ "caption": "Lumen · real Godot game with tested win and restart"
+ }
+ ]
+}
diff --git a/store/agents/godot-studio/template/.gitignore b/store/agents/godot-studio/template/.gitignore
new file mode 100644
index 000000000..1ba2aa6aa
--- /dev/null
+++ b/store/agents/godot-studio/template/.gitignore
@@ -0,0 +1,3 @@
+.godot/
+build/
+*.tmp
diff --git a/store/agents/godot-studio/template/export_presets.cfg b/store/agents/godot-studio/template/export_presets.cfg
new file mode 100644
index 000000000..8a4945cd5
--- /dev/null
+++ b/store/agents/godot-studio/template/export_presets.cfg
@@ -0,0 +1,25 @@
+[preset.0]
+name="Web"
+platform="Web"
+runnable=true
+export_filter="all_resources"
+export_files=PackedStringArray()
+include_filter=""
+exclude_filter="build/*,.harness/*,scripts/proof.gd,web/*"
+export_path="build/web/index.html"
+custom_features=""
+[preset.0.options]
+custom_template/debug=""
+custom_template/release=""
+variant/extensions_support=false
+variant/thread_support=false
+vram_texture_compression/for_desktop=true
+vram_texture_compression/for_mobile=false
+html/export_icon=false
+html/custom_html_shell="res://web/shell.html"
+html/head_include=""
+html/canvas_resize_policy=0
+html/focus_canvas_on_start=true
+html/experimental_virtual_keyboard=false
+progressive_web_app/enabled=false
+progressive_web_app/offline_page=""
diff --git a/store/agents/godot-studio/template/project.godot b/store/agents/godot-studio/template/project.godot
new file mode 100644
index 000000000..6785b26a6
--- /dev/null
+++ b/store/agents/godot-studio/template/project.godot
@@ -0,0 +1,15 @@
+config_version=5
+
+[application]
+config/name="Lumen — a light garden"
+run/main_scene="res://scenes/Main.tscn"
+
+[display]
+window/size/viewport_width=1200
+window/size/viewport_height=700
+window/stretch/mode="canvas_items"
+
+[rendering]
+renderer/rendering_method="gl_compatibility"
+renderer/rendering_method.mobile="gl_compatibility"
+environment/defaults/default_clear_color=Color(0.026, 0.062, 0.083, 1)
diff --git a/store/agents/godot-studio/template/proof.json b/store/agents/godot-studio/template/proof.json
new file mode 100644
index 000000000..4849c9bad
--- /dev/null
+++ b/store/agents/godot-studio/template/proof.json
@@ -0,0 +1 @@
+{"actions":[{"selector":"#game-state[data-ready=\"true\"]","attribute":{"name":"data-ready","value":"true"}},{"selector":"#pause","click":true},{"selector":"#pause","attribute":{"name":"aria-pressed","value":"true"}},{"selector":"#pause","click":true},{"selector":"#pause","attribute":{"name":"aria-pressed","value":"false"}},{"selector":"#restart","click":true},{"selector":"#collected","text":"0"}]}
diff --git a/store/agents/godot-studio/template/scenes/Main.tscn b/store/agents/godot-studio/template/scenes/Main.tscn
new file mode 100644
index 000000000..16fddf839
--- /dev/null
+++ b/store/agents/godot-studio/template/scenes/Main.tscn
@@ -0,0 +1,6 @@
+[gd_scene load_steps=2 format=3 uid="uid://main000000001"]
+
+[ext_resource type="Script" path="res://scripts/main.gd" id="1"]
+
+[node name="Main" type="Node2D"]
+script = ExtResource("1")
diff --git a/store/agents/godot-studio/template/scripts/garden.gd b/store/agents/godot-studio/template/scripts/garden.gd
new file mode 100644
index 000000000..ceb4f1221
--- /dev/null
+++ b/store/agents/godot-studio/template/scripts/garden.gd
@@ -0,0 +1,108 @@
+extends Node2D
+## Retained procedural artwork. Draw each primitive once, then animate CanvasItem
+## transforms/modulation. Re-tessellating everything per tick stalls WebGL drivers.
+const MINT := Color("bcf2ce")
+const AMBER := Color("eaca8e")
+
+class Ink extends Node2D:
+ var paint: Callable
+ func _draw() -> void:
+ paint.call(self)
+
+var flowers: Array[Node2D] = []
+var trail_dots: Array[Node2D] = []
+var burst_rings: Array[Node2D] = []
+var player: Node2D
+var destination: Node2D
+var pause_card: Node2D
+var win_card: Node2D
+
+func layer(parent: Node, paint: Callable) -> Node2D:
+ var ink := Ink.new()
+ ink.paint = paint
+ parent.add_child(ink)
+ return ink
+
+func create(seeds: Array) -> void:
+ layer(self, func(ink: Node2D):
+ ink.draw_rect(Rect2(0,0,1200,700), Color("071218"))
+ for i in range(150):
+ var star := Vector2(fmod(i * 137.508,1200), fmod(i * 211.37,700))
+ ink.draw_circle(star,0.6+float(i%3)*0.35,Color(0.5,0.8,0.75,0.08+float(i%4)*0.025))
+ for radius in range(100,580,80):
+ ink.draw_arc(Vector2(600,350),radius,0,TAU,120,Color("102930"),1,true)
+ ink.draw_line(Vector2(45,350),Vector2(1155,350),Color("133239"),1,true)
+ ink.draw_line(Vector2(600,65),Vector2(600,635),Color("133239"),1,true)
+ ink.draw_arc(Vector2(600,350),285,0,TAU,100,Color("295047"),1,true)
+ ink.draw_string(ThemeDB.fallback_font,Vector2(40,40),"THE QUIET GARDEN / 01",HORIZONTAL_ALIGNMENT_LEFT,-1,13,Color("6a938e"))
+ ink.draw_string(ThemeDB.fallback_font,Vector2(40,675),"GATHER LIGHT. LEAVE A TRAIL.",HORIZONTAL_ALIGNMENT_LEFT,-1,12,Color("6a938e"))
+ )
+ for i in seeds.size():
+ var flower := Node2D.new()
+ flower.position = seeds[i]
+ add_child(flower)
+ flowers.append(flower)
+ layer(flower, func(ink: Node2D):
+ for petal in range(7):
+ var angle := TAU * petal / 7.0
+ ink.draw_arc(Vector2.from_angle(angle)*21,21,angle-1.9,angle+1.9,24,Color(1,1,1,0.45),1.3,true)
+ )
+ layer(flower, func(ink: Node2D): ink.draw_circle(Vector2.ZERO,5,Color.WHITE))
+ layer(flower, func(ink: Node2D): ink.draw_arc(Vector2.ZERO,15,0,TAU,36,Color(1,1,1,0.3),1,true))
+ var number := str(i+1).pad_zeros(2)
+ layer(flower, func(ink: Node2D): ink.draw_string(ThemeDB.fallback_font,Vector2(-5,70),number,HORIZONTAL_ALIGNMENT_LEFT,-1,12,Color(1,1,1,0.6)))
+ for i in range(30):
+ var dot := layer(self, func(ink: Node2D): ink.draw_circle(Vector2.ZERO,7,MINT))
+ dot.visible = false
+ trail_dots.append(dot)
+ # At most six simultaneous pickups; reuse the rings across restarts.
+ for i in seeds.size():
+ var ring := layer(self, func(ink: Node2D): ink.draw_arc(Vector2.ZERO,15,0,TAU,60,MINT,1.5,true))
+ ring.visible = false
+ burst_rings.append(ring)
+ player = layer(self, func(ink: Node2D):
+ for radius in range(28,7,-4): ink.draw_circle(Vector2.ZERO,radius,Color(MINT,0.025))
+ ink.draw_circle(Vector2.ZERO,8,MINT)
+ ink.draw_arc(Vector2.ZERO,13,0,TAU,40,Color(MINT,0.55),1.2,true)
+ ink.draw_line(Vector2(16,0),Vector2(24,0),AMBER,2,true)
+ )
+ destination = layer(self, func(ink: Node2D): ink.draw_arc(Vector2.ZERO,9,0,TAU,30,Color(MINT,0.35),1,true))
+ pause_card = card("A moment of stillness.","Press P to return")
+ win_card = card("The garden is awake.","Press R to begin again")
+
+func card(title: String, detail: String) -> Node2D:
+ return layer(self, func(ink: Node2D):
+ ink.draw_rect(Rect2(360,280,480,140),Color(0.02,0.06,0.08,0.94))
+ ink.draw_string(ThemeDB.fallback_font,Vector2(390,336),title,HORIZONTAL_ALIGNMENT_LEFT,-1,29,MINT)
+ ink.draw_string(ThemeDB.fallback_font,Vector2(390,378),detail,HORIZONTAL_ALIGNMENT_LEFT,-1,17,Color("90ada6"))
+ )
+
+func animate(pos: Vector2, direction: Vector2, elapsed: float, collected: Array[int], trail: Array[Vector2], bursts: Array, target: Vector2, moving: bool, paused: bool, won: bool) -> void:
+ for i in flowers.size():
+ var flower := flowers[i]
+ var lit := i in collected
+ flower.modulate = MINT if lit else AMBER
+ flower.get_child(0).rotation = sin(elapsed*1.2+i)*0.07
+ flower.get_child(0).modulate.a = 1.0 if lit else 0.4
+ flower.get_child(1).scale = Vector2.ONE * (1.4 if lit else 1.0)
+ flower.get_child(2).scale = Vector2.ONE * (1.0+sin(elapsed*2+i)*2.0/15.0)
+ for i in trail_dots.size():
+ var dot := trail_dots[i]
+ dot.visible = i > 0 and i < trail.size()
+ if dot.visible:
+ dot.position = trail[i]
+ dot.scale = Vector2.ONE * maxf(1,7-i*0.19)/7.0
+ dot.modulate.a = (1.0-float(i)/30)*0.22
+ for i in burst_rings.size():
+ var ring := burst_rings[i]
+ ring.visible = i < bursts.size()
+ if ring.visible:
+ ring.position = bursts[i].pos
+ ring.scale = Vector2.ONE * (1.0+bursts[i].age*80.0/15.0)
+ ring.modulate.a = 1.0-bursts[i].age
+ player.position = pos
+ player.rotation = direction.angle()
+ destination.position = target
+ destination.visible = moving and not won
+ pause_card.visible = paused and not won
+ win_card.visible = won
diff --git a/store/agents/godot-studio/template/scripts/main.gd b/store/agents/godot-studio/template/scripts/main.gd
new file mode 100644
index 000000000..f321de20e
--- /dev/null
+++ b/store/agents/godot-studio/template/scripts/main.gd
@@ -0,0 +1,109 @@
+extends Node2D
+## A small, complete game. Procedural art is cached in garden.gd; no external assets.
+const SEEDS := [Vector2(450,350), Vector2(700,200), Vector2(930,350), Vector2(750,525), Vector2(430,530), Vector2(230,190)]
+const START := Vector2(270,350)
+var pos := START
+var target := START
+var direction := Vector2.RIGHT
+var collected: Array[int] = []
+var trail: Array[Vector2] = []
+var bursts: Array = []
+var elapsed := 0.0
+var cooldown := 0.0
+var dash_left := 0.0
+var won := false
+var paused := false
+var moving_to_target := false
+var bridge_tick := 0.0
+var input_bridge: JavaScriptObject
+var command_callback: JavaScriptObject
+var garden: Node2D
+
+func _ready() -> void:
+ garden = preload("res://scripts/garden.gd").new()
+ add_child(garden)
+ garden.create(SEEDS)
+ reset_game()
+ if OS.has_feature("web"):
+ input_bridge = JavaScriptBridge.get_interface("lumen")
+ command_callback = JavaScriptBridge.create_callback(_web_command)
+ input_bridge.command = command_callback
+ publish()
+
+func _web_command(args: Array) -> void:
+ if args[0] == "restart": reset_game()
+ elif args[0] == "pause": paused = not paused
+ elif args[0] == "dash": dash()
+ publish()
+
+func reset_game() -> void:
+ pos = START
+ target = START
+ collected.clear()
+ trail.clear()
+ bursts.clear()
+ elapsed = 0
+ cooldown = 0
+ dash_left = 0
+ won = false
+ paused = false
+ moving_to_target = false
+ update_art()
+
+func dash() -> void:
+ if cooldown <= 0 and not paused and not won:
+ cooldown = 1.4
+ dash_left = 0.18
+
+func _unhandled_input(event: InputEvent) -> void:
+ if event is InputEventKey and event.pressed and not event.echo:
+ if event.keycode == KEY_R or event.keycode == KEY_ENTER: reset_game()
+ if event.keycode == KEY_SPACE: dash()
+ if event.keycode == KEY_P: paused = not paused
+ if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
+ target = get_global_mouse_position()
+ moving_to_target = true
+ if event is InputEventScreenTouch and event.pressed:
+ target = event.position
+ moving_to_target = true
+
+func advance(delta: float, move: Vector2) -> void:
+ if paused or won: return
+ elapsed += delta
+ cooldown = maxf(0, cooldown - delta)
+ dash_left = maxf(0, dash_left - delta)
+ if move.length_squared() > 0:
+ direction = move.normalized()
+ pos += move.limit_length() * (760.0 if dash_left > 0 else 260.0) * delta
+ pos = pos.clamp(Vector2(45,65), Vector2(1155,635))
+ for i in SEEDS.size():
+ if i not in collected and pos.distance_to(SEEDS[i]) < 32:
+ collected.append(i)
+ bursts.append({"pos":SEEDS[i],"age":0.0})
+ won = collected.size() == SEEDS.size()
+
+func _physics_process(delta: float) -> void:
+ var move := Vector2(float(Input.is_key_pressed(KEY_RIGHT) or Input.is_key_pressed(KEY_D)) - float(Input.is_key_pressed(KEY_LEFT) or Input.is_key_pressed(KEY_A)), float(Input.is_key_pressed(KEY_DOWN) or Input.is_key_pressed(KEY_S)) - float(Input.is_key_pressed(KEY_UP) or Input.is_key_pressed(KEY_W)))
+ if move.length_squared() > 0: moving_to_target = false
+ elif moving_to_target:
+ if pos.distance_to(target) < 6: moving_to_target = false
+ else: move = (target - pos).normalized() * minf(1, pos.distance_to(target) / (260 * delta))
+ advance(delta, move)
+ if not paused:
+ trail.push_front(pos)
+ if trail.size() > 30: trail.pop_back()
+ for burst in bursts: burst.age += delta
+ bursts = bursts.filter(func(b): return b.age < 1.0)
+ bridge_tick += delta
+ if bridge_tick > 0.1:
+ publish()
+ bridge_tick = 0
+ update_art()
+
+func update_art() -> void:
+ garden.animate(pos, direction, elapsed, collected, trail, bursts, target, moving_to_target, paused, won)
+
+func publish() -> void:
+ if not OS.has_feature("web"): return
+ var state := {"collected":collected.size(),"total":SEEDS.size(),"won":won,"paused":paused,"seconds":snappedf(elapsed,0.1),"cooldown":snappedf(cooldown,0.1),"x":snappedf(pos.x,0.1),"y":snappedf(pos.y,0.1)}
+ JavaScriptBridge.eval("window.lumen.update(" + JSON.stringify(state) + ")", true)
diff --git a/store/agents/godot-studio/template/scripts/proof.gd b/store/agents/godot-studio/template/scripts/proof.gd
new file mode 100644
index 000000000..62f628f7b
--- /dev/null
+++ b/store/agents/godot-studio/template/scripts/proof.gd
@@ -0,0 +1,49 @@
+extends SceneTree
+## Exercise actual game methods, without JavaScript or a display.
+func _initialize() -> void:
+ call_deferred("run")
+
+func require(condition: bool, message: String) -> void:
+ if not condition:
+ push_error(message)
+ quit(1)
+ assert(false, message)
+
+func run() -> void:
+ var game = load("res://scenes/Main.tscn").instantiate()
+ root.add_child(game)
+ game.set_physics_process(false)
+ require(game.pos == game.START, "player spawn")
+ game.advance(0.1, Vector2.RIGHT)
+ require(game.pos.x > game.START.x, "movement changes player position")
+ game.update_art()
+ require(game.garden.player.position == game.pos, "retained artwork follows actual game state")
+ var visual_count: int = game.garden.get_child_count()
+ for i in range(120): game.update_art()
+ require(game.garden.get_child_count() == visual_count, "animation reuses a bounded set of visual nodes")
+ game.dash()
+ var before: float = game.pos.x
+ game.advance(0.05, Vector2.RIGHT)
+ require(game.pos.x - before > 30, "dash increases speed")
+ game.paused = true
+ before = game.pos.x
+ game.advance(0.2, Vector2.RIGHT)
+ require(game.pos.x == before, "pause stops movement")
+ game.paused = false
+ game.advance(20, Vector2.RIGHT)
+ require(game.pos.x <= 1155, "player stays inside arena")
+ for seed in game.SEEDS:
+ game.pos = seed
+ game.advance(0, Vector2.ZERO)
+ require(game.won and game.collected.size() == 6, "collecting all seeds wins")
+ game.reset_game()
+ require(not game.won and game.collected.is_empty() and game.pos == game.START, "restart clears game state")
+ var output := OS.get_environment("HARNESS_BUILD_DIR")
+ if output.is_empty(): output = "user://"
+ var file := FileAccess.open(output.path_join("proof.json"), FileAccess.WRITE)
+ require(file != null, "proof receipt is writable")
+ file.store_string(JSON.stringify({"passed":true,"checks":["spawn","movement","artwork follows gameplay","bounded visual nodes","dash","pause","bounds","pickups and win","restart"]}))
+ file.close()
+ print("Lumen: all 9 gameplay and rendering assertions passed")
+ game.free()
+ quit(0)
diff --git a/store/agents/godot-studio/template/web/shell.html b/store/agents/godot-studio/template/web/shell.html
new file mode 100644
index 000000000..12ec3b4c3
--- /dev/null
+++ b/store/agents/godot-studio/template/web/shell.html
@@ -0,0 +1,22 @@
+<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Lumen · Godot Studio</title><link rel="icon" href="data:,">
+<style>
+*{box-sizing:border-box}body{margin:0;background:#09171d;color:#e0ebdf;font-family:Arial,Helvetica,sans-serif}header,main,footer{max-width:1440px;margin:auto;padding:26px 42px}header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #29403f}.brand{font-family:Georgia,serif;font-size:30px;letter-spacing:-1px}.eyebrow,small{font:10px monospace;letter-spacing:2px;color:#90ada6}.brand span{color:#d9c497;font-size:14px;margin-right:12px}.live{color:#bcf2ce;font:10px monospace;letter-spacing:1px}.intro{display:flex;align-items:end;justify-content:space-between;margin:18px 0 24px;gap:20px}h1{font:normal 45px Georgia,serif;letter-spacing:-1.3px;margin:9px 0}p{color:#90ada6;font-size:13px;line-height:1.7;margin:0}.score{text-align:right;font:30px Georgia,serif;white-space:nowrap}.score small{display:block;margin-top:8px}.arena{position:relative;border:1px solid #315048;border-radius:14px;overflow:hidden;background:#071218}canvas{width:100%;aspect-ratio:12/7;height:auto;display:block;outline:none;touch-action:none}canvas:focus-visible{outline:2px solid #bcf2ce;outline-offset:-3px}#loading{position:absolute;inset:0;display:grid;place-content:center;gap:15px;text-align:center;background:#071218;font:18px Georgia,serif}#loading[hidden]{display:none}progress{accent-color:#bcf2ce;width:220px;height:3px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:20px}.buttons{display:flex;gap:8px}button{background:#203a35;border:1px solid #456052;color:#dceaca;font-size:12px;padding:11px 17px;border-radius:7px;cursor:pointer}button:hover{background:#304b40}button:disabled{opacity:.45;cursor:wait}button:focus-visible{outline:2px solid #bcf2ce;outline-offset:2px}kbd{display:inline-block;border:1px solid #38534c;border-radius:4px;padding:3px 5px;font:10px monospace;color:#c1d9ca}.help{max-width:740px}footer{display:flex;justify-content:space-between;padding-top:8px;padding-bottom:30px;font:10px monospace;color:#6e948b}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(max-width:650px){header,main,footer{padding:20px}header{padding-block:17px}h1{font-size:34px}.intro{align-items:start}.score{font-size:24px;margin-top:25px}.toolbar{align-items:start;flex-direction:column}.eyebrow{font-size:8px}.live{font-size:8px}.help{font-size:12px}footer{gap:20px;font-size:9px}.intro p{max-width:200px}}
+@media(min-width:900px) and (min-height:700px){.arena{max-width:calc((100dvh - 380px)*12/7);margin-inline:auto}.toolbar{max-width:calc((100dvh - 380px)*12/7);margin-inline:auto}}
+</style>
+<header><div class="brand"><span>✳</span>Lumen</div><div class="live">GODOT STUDIO / PLAYABLE PROJECT</div></header>
+<main><div class="intro"><div><div class="eyebrow">A SMALL GAME ABOUT FINDING YOUR WAY</div><h1>Wake the light garden.</h1><p>Six sleeping blooms. One wandering spark. You.</p></div><div class="score"><span id="collected">0</span> <span style="color:#54776b">/ 06</span><small>BLOOMS AWAKE</small></div></div>
+<div class="arena"><canvas id="canvas" width="1200" height="700" tabindex="0" aria-label="Light garden game. Move with arrows or WASD, click or tap a destination, Space to dash."></canvas><div id="loading"><span id="load-label">Preparing your little world…</span><progress id="progress"></progress></div></div>
+<div class="toolbar"><p class="help">Click or tap a destination · <kbd>W A S D</kbd> / arrows to move · <kbd>SPACE</kbd> to dash<br><span id="story" role="status">Gather all six blooms to wake the garden.</span></p><div class="buttons"><button id="dash" disabled>Dash ↗</button><button id="pause" disabled aria-pressed="false">Pause</button><button id="restart" disabled>Restart ↺</button></div></div>
+<output id="game-state" class="sr" aria-live="off" data-ready="false"></output></main><footer><span>ORIGINAL GDSCRIPT · NO EXTERNAL ASSETS</span><span id="time">00.0 SECONDS</span></footer>
+<script>
+window.lumen={command:null,update(state){const $=id=>document.getElementById(id);window.lumen.state=state;$('game-state').dataset.ready='true';for(const [key,value]of Object.entries(state))$('game-state').dataset[key]=String(value);$('collected').textContent=state.collected;$('story').textContent=state.won?'The garden is awake. A small world, made brighter.':state.paused?'Paused. Take your time.':'Gather all six blooms to wake the garden.';$('pause').textContent=state.paused?'Resume':'Pause';$('pause').setAttribute('aria-pressed',String(state.paused));$('time').textContent=Number(state.seconds).toFixed(1)+' SECONDS';$('dash').textContent=state.cooldown>0?'Recharging…':'Dash ↗';$('dash').disabled=state.cooldown>0||state.won||state.paused;$('pause').disabled=state.won;$('restart').disabled=false;}};
+for(const id of ['dash','pause','restart'])document.getElementById(id).onclick=()=>{if(window.lumen.command)window.lumen.command(id);document.getElementById('canvas').focus();};
+</script><script src="$GODOT_URL"></script><script>
+const engine=new Engine($GODOT_CONFIG);const progress=document.getElementById('progress');
+engine.startGame({canvas:document.getElementById('canvas'),canvasResizePolicy:0,persistentPaths:[],onProgress(current,total){if(total){progress.max=total;progress.value=current;}},onPrintError(message){
+ // Godot 4.4 probes service workers even when PWA export is disabled. An opaque
+ // sandbox intentionally forbids that optional feature; keep every game error fatal.
+ if(message==='Failed to assign PWA callback' && globalThis.origin==='null')console.warn('Offline installation is unavailable in the isolated preview.');
+ else console.error(message);
+}}).then(()=>{document.getElementById('loading').hidden=true;}).catch(error=>{document.getElementById('load-label').textContent='Could not start: '+error.message;progress.hidden=true;console.error(error);});
+</script></html>
diff --git a/store/agents/godot-studio/test/toolchain.test.mjs b/store/agents/godot-studio/test/toolchain.test.mjs
new file mode 100644
index 000000000..ec4fe2db2
--- /dev/null
+++ b/store/agents/godot-studio/test/toolchain.test.mjs
@@ -0,0 +1,8 @@
+import {test,after} from 'node:test';import assert from 'node:assert/strict';import {spawnSync} from 'node:child_process';import {accessSync,constants,mkdtempSync,readFileSync,writeFileSync,rmSync,cpSync,chmodSync} from 'node:fs';import {tmpdir} from 'node:os';import {join} from 'node:path';import {fileURLToPath} from 'node:url';
+const root=fileURLToPath(new URL('..',import.meta.url)),dirs=[];const temp=()=>{const d=mkdtempSync(join(tmpdir(),'godot-test-'));dirs.push(d);return d;};after(()=>dirs.forEach(d=>rmSync(d,{recursive:true,force:true})));
+function fake(){const dir=temp(),bin=join(dir,'godot');writeFileSync(bin,'#!'+process.execPath+'\n'+`const fs=require('node:fs'),path=require('node:path'),args=process.argv.slice(2);if(args.includes('--script')&&!process.env.NO_RECEIPT)fs.writeFileSync(path.join(process.env.HARNESS_BUILD_DIR,'proof.json'),JSON.stringify({passed:true,checks:['test transport']}));if(args.includes('--export-release')){const file=args.at(-1);for(const ext of ['html','js','pck','wasm'])fs.writeFileSync(file.replace(/html$/,ext),'fresh export');}if(process.env.FAIL_EXPORT&&args.includes('--export-release'))process.exitCode=1;`);chmodSync(bin,0o755);return bin;}
+const build=(ws,bin,extra={})=>spawnSync(process.execPath,[join(root,'skills/godot/scripts/build.mjs')],{cwd:ws,env:{...process.env,GODOT_BIN:bin,...extra},encoding:'utf8'});
+test('manifest entrypoints stay executable',()=>{for(const p of ['toolchain/init-workspace.sh','toolchain/setup.sh','toolchain/doctor.sh','skills/godot/scripts/export-web.sh'])accessSync(join(root,p),constants.X_OK);});
+test('export is accepted only after a fresh explicit gameplay proof receipt',()=>{const ws=temp(),bin=fake();cpSync(join(root,'template'),ws,{recursive:true});const r=build(ws,bin);assert.equal(r.status,0,r.stderr);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,true);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');const failed=build(ws,bin,{NO_RECEIPT:'1'});assert.notEqual(failed.status,0);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,false);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');});
+test('a failed native export or missing executable clears ready and preserves prior output',()=>{const ws=temp(),bin=fake();cpSync(join(root,'template'),ws,{recursive:true});assert.equal(build(ws,bin).status,0);for(const [tool,extra]of [[bin,{FAIL_EXPORT:'1'}],[join(ws,'missing'),{}]]){assert.notEqual(build(ws,tool,extra).status,0);const verdict=JSON.parse(readFileSync(join(ws,'.harness/verdict.json')));assert.equal(verdict.ready,false);assert.equal(verdict.artifact,null);assert.equal(readFileSync(join(ws,'build/web/index.html'),'utf8'),'fresh export');}});
+test('source game and proof use real mechanics; single-threaded compatibility export configured',()=>{const cfg=readFileSync(join(root,'template/export_presets.cfg'),'utf8');assert.match(cfg,/variant\/thread_support=false/);assert.match(readFileSync(join(root,'template/scripts/proof.gd'),'utf8'),/game\.advance/);});
diff --git a/store/agents/godot-studio/toolchain/doctor.sh b/store/agents/godot-studio/toolchain/doctor.sh
new file mode 100755
index 000000000..2d55f1b37
--- /dev/null
+++ b/store/agents/godot-studio/toolchain/doctor.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+fail=0
+if [ -n "${GODOT_BIN:-}" ] && [ -x "$GODOT_BIN" ]; then echo "ok godot at $GODOT_BIN"
+elif command -v godot >/dev/null 2>&1; then echo "ok godot on PATH ($(command -v godot))"
+elif [ -x /Applications/Godot.app/Contents/MacOS/Godot ]; then echo "ok godot at /Applications/Godot.app/Contents/MacOS/Godot"
+else echo "miss godot — install Godot 4 and re-run setup"; fail=1; fi
+[ -d "$dsh/skills/godot" ] && echo "ok godot skill" || echo "warn godot skill missing"
+exit $fail
diff --git a/store/agents/godot-studio/toolchain/init-workspace.sh b/store/agents/godot-studio/toolchain/init-workspace.sh
new file mode 100755
index 000000000..02cb9e010
--- /dev/null
+++ b/store/agents/godot-studio/toolchain/init-workspace.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Godot workspace ready — describe a game to make",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+cat > build-status.html <<'HTML'
+<!doctype html><meta charset="utf-8"><title>Godot build</title>
+<h1>Godot Studio</h1><p>No export yet. Describe a game — a playable build will appear here.</p>
+HTML
+printf 'Godot workspace initialized by %s\n' "${HARNESS_DSH:-godot-studio}" > .harness-initialized
diff --git a/store/agents/godot-studio/toolchain/node.sh b/store/agents/godot-studio/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/godot-studio/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/godot-studio/toolchain/runtimes.sh b/store/agents/godot-studio/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/godot-studio/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/godot-studio/toolchain/setup.sh b/store/agents/godot-studio/toolchain/setup.sh
new file mode 100755
index 000000000..a5b5a0751
--- /dev/null
+++ b/store/agents/godot-studio/toolchain/setup.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Install/verify Godot 4 for this harness. cwd = the package install dir.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+find_godot() { if [ -n "${GODOT_BIN:-}" ]; then [ -x "$GODOT_BIN" ] && { echo "$GODOT_BIN"; return 0; }; return 1; fi; command -v godot 2>/dev/null && return 0; [ -x /Applications/Godot.app/Contents/MacOS/Godot ] && { echo /Applications/Godot.app/Contents/MacOS/Godot; return 0; }; return 1; }
+if bin=$(find_godot); then
+ echo "ok godot at $bin"
+ exit 0
+fi
+echo "miss godot — install Godot 4 from https://godotengine.org (macOS app or CLI on PATH) and re-run setup."
+echo " Web export also needs the matching HTML5 export templates (Editor → Export)."
+exit 1
diff --git a/store/agents/home-assistant/.gitignore b/store/agents/home-assistant/.gitignore
new file mode 100644
index 000000000..aa4afc7ff
--- /dev/null
+++ b/store/agents/home-assistant/.gitignore
@@ -0,0 +1,2 @@
+# Never committed.
+node_modules/
diff --git a/store/agents/home-assistant/AGENTS.md b/store/agents/home-assistant/AGENTS.md
new file mode 100644
index 000000000..3cd6ccbf8
--- /dev/null
+++ b/store/agents/home-assistant/AGENTS.md
@@ -0,0 +1,9 @@
+# Home Assistant workspace
+
+Read `skills/home-assistant/SKILL.md`. Author `automations.yaml` and rebuild the Habitat dashboard after changes.
+
+- Ask for actual entity IDs when deployment matters. Starter `demo_*` and `person.demo` entities are explicit examples, not discovered devices.
+- Keep triggers, conditions and actions understandable. Test a passing scenario and an important non-firing scenario.
+- A ready verdict means YAML and local structure checks passed, not that Home Assistant accepted or ran it. Unsupported scenario semantics must remain unmodeled.
+- Do not contact a real installation, call services, or deploy YAML without user authorization. No dashboard control does that.
+- Preserve the user's existing configuration. Source YAML is authoritative; browser scenario edits do not persist.
diff --git a/store/agents/home-assistant/LICENSE b/store/agents/home-assistant/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/home-assistant/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/home-assistant/PROVENANCE.md b/store/agents/home-assistant/PROVENANCE.md
new file mode 100644
index 000000000..7aee93552
--- /dev/null
+++ b/store/agents/home-assistant/PROVENANCE.md
@@ -0,0 +1,9 @@
+# Provenance
+
+The wrapper, Habitat dashboard, local scenario model and demo automations are original OpenHarness work, MIT licensed.
+
+Home Assistant: https://github.com/home-assistant/core — Apache-2.0. No Home Assistant source is vendored and no running instance is required.
+
+YAML parser: https://github.com/eemeli/yaml — yaml 2.8.1, ISC license, installed from the pinned package-lock.json by setup. Its license travels with the installed dependency.
+
+Automation behavior references: https://www.home-assistant.io/docs/automation/trigger/ and https://www.home-assistant.io/docs/scripts/conditions/ . The local model deliberately implements only the documented subset named in README.md; it is not a Home Assistant emulator.
diff --git a/store/agents/home-assistant/README.md b/store/agents/home-assistant/README.md
new file mode 100644
index 000000000..cb7af2b8e
--- /dev/null
+++ b/store/agents/home-assistant/README.md
@@ -0,0 +1,27 @@
+# Home Assistant · Habitat
+
+Turn an automation idea into readable YAML, a visual trigger → condition → action flow, and a local scenario you can try before connecting devices.
+
+Habitat ships three clearly labeled demo automations. Select a rule, change the event and entity states, and trace why it would request actions—or why it would not. Night/day presets, source inspection and YAML download are included. Browser scenarios are temporary explorations; edit `automations.yaml` and rebuild to persist changes.
+
+## Start
+
+Install `autonomous/home-assistant` from the Harness Store. Setup installs the pinned `[email protected]` parser locally; Node 20+ is bootstrapped when needed. No Home Assistant installation, login or device access is required.
+
+```sh
+sh "$HA_SKILLS/home-assistant/scripts/build-automations.sh"
+```
+
+Try: “Make the welcome lights stay off when a guest is sleeping. Show both scenarios.”
+
+## What is verified
+
+The build parses YAML, rejects duplicate keys/unresolved tags, limits aliases and input size, checks basic automation structure, and safely embeds the result. Failed checks clear the ready verdict and preserve the previous dashboard. These are local checks, **not Home Assistant's complete schema or runtime validation**.
+
+The scenario model supports simple state, numeric-state threshold crossing, and fixed-time triggers; simple state and numeric-state conditions; and plain service-call intents. Durations, templates, attribute triggers, entity lists, complex conditions/actions, scheduling and concurrency are not modeled. Unknown semantics never produce a “would run” result. No actions execute.
+
+Use the real installation's configuration check and automation traces before deployment. This package does not connect to or modify an installation. The included `configuration.yaml` is only a local check entrypoint; never overwrite an existing home's configuration with it.
+
+## Credit and stewardship
+
+Home Assistant is the Open Home Foundation community's Apache-2.0 project. This original MIT wrapper, dashboard and example YAML are maintained by OpenHarness contributors; they are not an official Home Assistant product. The separately installed YAML parser is ISC licensed. Home Assistant bugs belong upstream; wrapper issues belong in this repository.
diff --git a/store/agents/home-assistant/harness.json b/store/agents/home-assistant/harness.json
new file mode 100644
index 000000000..700cb5276
--- /dev/null
+++ b/store/agents/home-assistant/harness.json
@@ -0,0 +1,31 @@
+{
+ "spec": 1,
+ "id": "autonomous/home-assistant",
+ "name": "Home Assistant",
+ "category": "Automation",
+ "author": "OpenHarness contributors",
+ "description": "Describe an automation; get real, well-formed YAML for Home Assistant \u2014 automations you can paste or load, a dashboard that shows every rule, and a verdict that proves the YAML is valid.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "automations.yaml",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": ["skills"],
+ "env": {
+ "HA_TOOLCHAIN": "${dsh}/toolchain",
+ "HA_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [".html"]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/home-assistant/package-lock.json b/store/agents/home-assistant/package-lock.json
new file mode 100644
index 000000000..40a823b6c
--- /dev/null
+++ b/store/agents/home-assistant/package-lock.json
@@ -0,0 +1,28 @@
+{
+ "name": "@autonomous/home-assistant-harness",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@autonomous/home-assistant-harness",
+ "dependencies": {
+ "yaml": "2.8.1"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/yaml": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
+ "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
+ "license": "ISC",
+ "bin": {
+ "yaml": "bin.mjs"
+ },
+ "engines": {
+ "node": ">= 14.6"
+ }
+ }
+ }
+}
diff --git a/store/agents/home-assistant/package.json b/store/agents/home-assistant/package.json
new file mode 100644
index 000000000..7bf5cbe2b
--- /dev/null
+++ b/store/agents/home-assistant/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@autonomous/home-assistant-harness",
+ "private": true,
+ "type": "module",
+ "dependencies": { "yaml": "2.8.1" },
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/home-assistant/skills/home-assistant/SKILL.md b/store/agents/home-assistant/skills/home-assistant/SKILL.md
new file mode 100644
index 000000000..62bd70d74
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/SKILL.md
@@ -0,0 +1,20 @@
+---
+name: home-assistant
+description: Author Home Assistant automation YAML and inspect local scenario traces in Habitat. Use for automation design and configuration work, not unrequested device control.
+---
+
+# Automation authoring
+
+Source: `automations.yaml`. Viewer: `dashboard.html`. Read user entity IDs and requirements before replacing the clearly labeled demo entities.
+
+```sh
+sh "$HA_SKILLS/home-assistant/scripts/build-automations.sh"
+```
+
+The builder parses YAML 1.2, rejects duplicate keys/unresolved tags, and checks IDs, aliases and basic trigger/condition/action shape. Both singular legacy keys and plural keys are accepted, but not both in one automation. Home Assistant supports more configurations than this local checker (including blueprints); report that limit, do not silently rewrite unsupported source.
+
+Habitat models a strict subset: simple state changes, numeric threshold entry, fixed times, state/numeric conditions, and service-call intents. Numeric triggers fire on crossing, not merely on an already-high value. Templates, durations, attribute/entity-list triggers, complex actions and other unsupported semantics return “not modeled.” Never present the preview as Home Assistant execution.
+
+For a change, inspect a passing scenario and a near miss (daylight, already-high sensor, person away). Use the real installation's configuration checks and automation traces when deployment is requested. This helper never contacts Home Assistant or invokes services automatically. The local `configuration.yaml` includes the automation file; it is not a replacement for a user's live configuration.
+
+The verdict distinguishes local checks from runtime validation and clears ready on failure. Preserve prior outputs, report errors, and rebuild after source changes. Scenario edits in the browser are temporary; only source YAML persists.
diff --git a/store/agents/home-assistant/skills/home-assistant/scripts/build-automations.sh b/store/agents/home-assistant/skills/home-assistant/scripts/build-automations.sh
new file mode 100755
index 000000000..1b2aaa404
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/scripts/build-automations.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs"
diff --git a/store/agents/home-assistant/skills/home-assistant/scripts/build.mjs b/store/agents/home-assistant/skills/home-assistant/scripts/build.mjs
new file mode 100644
index 000000000..fc868fc2f
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/scripts/build.mjs
@@ -0,0 +1,24 @@
+import {mkdir,readFile,writeFile,rename} from 'node:fs/promises';
+import {resolve,join} from 'node:path';
+import {normalize} from './model.mjs';
+const ws=resolve(process.env.HARNESS_WORKSPACE||process.cwd()),meta=join(ws,'.harness');
+await mkdir(meta,{recursive:true});
+const verdict=async(ready,summary,findings=[])=>writeFile(join(meta,'verdict.json'),JSON.stringify({spec:1,ready,summary,findings,artifact:ready?'dashboard.html':null,updatedAt:new Date().toISOString()},null,2)+'\n');
+await verdict(false,'Checking automation YAML…');
+try{
+ let parseDocument;
+ try{({parseDocument}=await import('yaml'));}catch{throw new Error('YAML parser is missing. Run this harness’s toolchain/setup.sh.');}
+ const source=await readFile(join(ws,'automations.yaml'),'utf8');
+ if(Buffer.byteLength(source)>1024*1024)throw new Error('Keep automations.yaml under 1 MiB.');
+ const doc=parseDocument(source,{uniqueKeys:true,strict:true});
+ if(doc.errors.length||doc.warnings.length)throw new Error([...doc.errors,...doc.warnings].map(e=>e.message).join('\n'));
+ const automations=normalize(doc.toJS({maxAliasCount:50}));
+ const template=await readFile(new URL('dashboard.html',import.meta.url),'utf8');
+ const model=(await readFile(new URL('model.mjs',import.meta.url),'utf8')).replace(/^export /gm,'');
+ const app=await readFile(new URL('dashboard.js',import.meta.url),'utf8');
+ const data=JSON.stringify({automations,source,at:new Date().toISOString()}).replace(/</g,'\\u003c').replace(/\u2028/g,'\\u2028').replace(/\u2029/g,'\\u2029');
+ await writeFile(join(meta,'dashboard.tmp'),template.replace('/*MODEL*/',()=>model).replace('/*APP*/',()=>app).replace('__CONFIG__',()=>data));
+ await rename(join(meta,'dashboard.tmp'),join(ws,'dashboard.html'));
+ await verdict(true,'YAML and local structure checks passed',[{severity:'info',kind:'limits',message:'No Home Assistant instance or devices connected. Local scenario preview models a strict subset, not Home Assistant validation. Replace demo entity IDs before deployment.'}]);
+ console.log('ok '+automations.length+' automations → dashboard.html (local checks only)');
+}catch(error){await verdict(false,'Automation checks failed',[{severity:'error',kind:'config',message:error.message}]);console.error(error.message);process.exitCode=1;}
diff --git a/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.html b/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.html
new file mode 100644
index 000000000..0cfbeb014
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.html
@@ -0,0 +1,12 @@
+<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Habitat · Automation lab</title><link rel="icon" href="data:,">
+<style>
+*{box-sizing:border-box}body{margin:0;background:#f7f4ed;color:#373d34;font-family:Arial,sans-serif}header{display:flex;align-items:center;justify-content:space-between;padding:25px 5%;border-bottom:1px solid #dddcd0}.brand{font:29px Georgia,serif;letter-spacing:-1px}.brand span{color:#b96547;margin-right:10px}.badge{font:10px monospace;color:#7f6555;border:1px solid #d5c6b3;border-radius:20px;padding:9px 12px}main{max-width:1450px;margin:auto;padding:35px 5%}.hero{display:flex;justify-content:space-between;gap:30px;align-items:center}.eyebrow{font:10px monospace;letter-spacing:2px;color:#927558}h1{font:normal 52px Georgia,serif;letter-spacing:-1.6px;line-height:1.07;margin:15px 0}h1 em{color:#a75b3e;font-weight:400}p{font-size:13px;color:#788071;line-height:1.7}.hero p{max-width:560px}.house{width:265px;flex-shrink:0;height:180px}.workspace{display:grid;grid-template-columns:260px minmax(0,1fr);gap:30px;margin-top:35px}.section-label{display:flex;justify-content:space-between;font:10px monospace;letter-spacing:1.8px;color:#8b806e;margin-bottom:16px}#rules{display:grid;gap:9px}button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #a75b3e;outline-offset:3px}.rule{border:1px solid #dddcd0;border-radius:10px;background:transparent;text-align:left;padding:17px 15px;color:#3d483b;line-height:1.5;font-size:13px}.rule[aria-selected=true]{background:#e9eddf;border-color:#a7b18e}.rule small{display:block;font:10px monospace;color:#8a8a74;margin-top:9px}.pane{min-width:0}.pane-head{display:flex;gap:18px;justify-content:space-between}h2{font:normal 27px Georgia,serif;margin:0 0 10px}#mode{font:10px monospace;white-space:nowrap;color:#967451;padding-top:10px}.flow{display:grid;grid-template-columns:1fr 1fr 1fr;gap:13px;margin:22px 0}.step{border:1px solid #d7dbc9;border-radius:10px;padding:20px;min-height:155px;background:#fffdf6}.step .number{font:10px monospace;color:#8d9c7a;letter-spacing:1px}.step h3{font-size:13px;font-weight:400;line-height:1.6;margin:15px 0 5px;overflow-wrap:anywhere}.step code{font-size:10px;line-height:1.5;color:#9c7553;overflow-wrap:anywhere}.step[data-result=true]{border-color:#829969;background:#edf1e3}.step[data-result=false]{border-color:#c98867;background:#faeee2}.lab{border:1px solid #d4d7c8;border-radius:12px;background:#efeee5;padding:24px}.lab-head{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:20px}h3{margin:0;font-size:15px;font-weight:500}.pill{border:1px solid #c5cdb5;border-radius:6px;background:#f9faf1;padding:9px 14px;font-size:11px;color:#55654a}.pill[aria-pressed=true]{background:#dae3ca;border-color:#96a682}.fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}label{display:block;font:10px monospace;color:#85836e;overflow-wrap:anywhere}input{width:100%;background:#fffdf5;border:1px solid #d2d4c5;border-radius:6px;padding:10px;margin-top:7px;font-size:12px;color:#394b38}.state-fields{margin-top:18px;padding-top:18px;border-top:1px solid #dbddce;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.run{margin-top:20px;border:0;background:#465c3e;color:#f4f5de;border-radius:7px;padding:13px 23px;font-size:12px}.result{border-top:1px solid #d6dac9;padding-top:16px;margin-top:20px}.result strong{font:21px Georgia,serif}.result p{margin:8px 0 0}#trace{font:11px/1.8 monospace;padding-left:20px;color:#66735b}.source{margin-top:20px}summary{cursor:pointer;font-size:12px;color:#7e795f}pre{font:11px/1.7 monospace;white-space:pre-wrap;overflow-wrap:anywhere;background:#e9e9de;border-radius:8px;padding:20px}footer{font:10px/1.8 monospace;color:#8d8f7c;margin-top:30px;border-top:1px solid #dcded2;padding-top:20px}@media(max-width:850px){.house{width:180px}.workspace{grid-template-columns:1fr}#rules{grid-template-columns:repeat(3,1fr)}h1{font-size:42px}.flow{gap:7px}.step{padding:13px}}@media(max-width:550px){main{padding-top:24px}.house{display:none}h1{font-size:40px}.badge{font-size:8px}.hero p{font-size:12px}#rules{grid-template-columns:1fr}.rule{padding:12px}.flow{grid-template-columns:1fr}.step{min-height:0;padding:14px}.step h3{margin:7px 0}.fields,.state-fields{grid-template-columns:1fr}.lab{padding:18px}.pane-head{flex-direction:column;gap:0}.workspace{margin-top:24px}.lab-head{flex-wrap:wrap}h2{font-size:24px}}
+</style>
+<header><div class="brand"><span>⌂</span>Habitat</div><div class="badge">LOCAL LAB · NO DEVICES CONNECTED</div></header><main>
+<section class="hero"><div><div class="eyebrow">HOME ASSISTANT / AUTOMATION LAB</div><h1>A home that knows<br><em>what comes next.</em></h1><p>Turn a small intention into a thoughtful automation. Follow the logic, change the scene, and see what would happen—before connecting a thing.</p></div><svg class="house" viewBox="0 0 280 190" aria-label="Conceptual home illustration" role="img"><path d="M22 94L138 22 253 91 138 163Z" fill="#dfe5d2" stroke="#9ca88e"/><path d="M22 94V133L138 204V163M253 91V131L138 204" fill="none" stroke="#9ca88e"/><path d="M58 104V64L137 17 215 65V109L136 157Z" fill="#f5f1df" stroke="#a9ad8c"/><path d="M58 64L136 112 215 65M136 112V157" fill="none" stroke="#a9ad8c"/><path d="M87 82V42L137 12 187 42V80L137 111Z" fill="#d6debf" fill-opacity=".65" stroke="#9da783"/><circle cx="94" cy="112" r="13" fill="#e9c79a"/><circle cx="175" cy="113" r="10" fill="#bdcc9b"/><path d="M126 134V114L148 101V120Z" fill="#b17a57"/><circle cx="137" cy="70" r="4" fill="#aa6443"/><path d="M137 56V44M137 83V95M124 70H112M150 70H162" stroke="#b88657"/></svg></section>
+<div class="workspace"><aside><div class="section-label">YOUR AUTOMATIONS <span id="count"></span></div><div id="rules" role="tablist" aria-label="Automations"></div><details class="source"><summary>View source YAML</summary><pre id="source"></pre><button class="pill" id="download">Download YAML</button></details></aside>
+<section class="pane"><div class="pane-head"><div><h2 id="title"></h2><p id="description"></p></div><span id="mode"></span></div><div class="flow"><div class="step" id="trigger-card"><span class="number">01 / WHEN</span><h3 id="trigger-label"></h3><code id="trigger-detail"></code></div><div class="step" id="condition-card"><span class="number">02 / ONLY IF</span><h3 id="condition-label"></h3><code id="condition-detail"></code></div><div class="step" id="action-card"><span class="number">03 / THEN</span><h3 id="action-label"></h3><code id="action-detail"></code></div></div>
+<div class="lab"><div class="lab-head"><h3>Try a local scenario</h3><div><button class="pill" id="night" aria-pressed="true">Night</button> <button class="pill" id="day" aria-pressed="false">Day</button></div></div><div class="fields"><label>EVENT ENTITY<input id="event-entity"></label><label>PREVIOUS STATE<input id="event-from"></label><label>NEW STATE<input id="event-to"></label><label>EVENT TIME<input id="event-time" type="time" step="1" value="23:00:00"></label></div><div class="state-fields" id="states"></div><button class="run" id="simulate">Preview this event →</button><div class="result" aria-live="polite"><strong id="outcome">What would happen?</strong><p id="explanation">Edit the event and entity states, then trace this automation.</p><ol id="trace"></ol></div></div>
+<footer>YAML + local structure checks passed. Not validated by Home Assistant.<br>Demo entities are placeholders. Scenario preview supports simple state / numeric-state / time triggers and state / numeric-state conditions. Durations, templates, complex actions and other types are explicitly unmodeled. Nothing here calls a service or writes to your home.</footer></section></div></main>
+<script type="application/json" id="config">__CONFIG__</script><script type="module">/*MODEL*/
+/*APP*/</script></html>
diff --git a/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.js b/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.js
new file mode 100644
index 000000000..f1800867f
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/scripts/dashboard.js
@@ -0,0 +1,29 @@
+const $=id=>document.getElementById(id),config=JSON.parse($('config').textContent);
+let selected=0,night=true;
+const node=(tag,text)=>{const n=document.createElement(tag);n.textContent=text;return n;};
+$('count').textContent=String(config.automations.length).padStart(2,'0');$('source').textContent=config.source;
+function render(){
+ const a=config.automations[selected];
+ $('rules').replaceChildren(...config.automations.map((rule,i)=>{const b=node('button',rule.alias);b.className='rule';b.setAttribute('role','tab');b.setAttribute('aria-selected',String(i===selected));b.tabIndex=i===selected?0:-1;b.append(node('small',String(i+1).padStart(2,'0')+' / '+rule.mode.toUpperCase()));b.onclick=()=>{selected=i;render();};b.onkeydown=e=>{if(['ArrowUp','ArrowDown','ArrowLeft','ArrowRight'].includes(e.key)){e.preventDefault();selected=(i+(['ArrowDown','ArrowRight'].includes(e.key)?1:-1)+config.automations.length)%config.automations.length;render();$('rules').children[selected].focus();}};return b;}));
+ $('title').textContent=a.alias;$('description').textContent=a.description;$('mode').textContent=a.mode.toUpperCase()+' MODE';
+ $('trigger-label').textContent=a.triggers.map(x=>x.trigger??x.platform).join(' or ');$('trigger-detail').textContent=a.triggers.map(x=>x.entity_id?x.entity_id+(x.to!==undefined?' → '+x.to:''):x.at||'See source').join(' · ');
+ $('condition-label').textContent=a.conditions.length?a.conditions.map(x=>x.condition).join(' and '):'No conditions';$('condition-detail').textContent=a.conditions.map(x=>x.entity_id+(x.state!==undefined?' = '+x.state:'')).join(' · ');
+ $('action-label').textContent=a.actions.map(x=>x.action??x.service??'Complex action').join(' → ');$('action-detail').textContent=a.actions.map(x=>list(x.target?.entity_id).join(', ')).filter(Boolean).join(' · ');
+ const t=a.triggers[0],kind=t.trigger??t.platform;
+ $('event-entity').value=typeof t.entity_id==='string'?t.entity_id:'';$('event-from').value=kind==='numeric_state'?String(Number(t.above??t.below??0)-100):t.from??'not_home';$('event-to').value=kind==='numeric_state'?String(Number(t.above??t.below??0)+100):t.to??'home';$('event-time').value=t.at&&/^\d\d:\d\d/.test(t.at)?t.at:'23:00:00';
+ const entities=[...new Set(a.conditions.map(x=>x.entity_id).filter(x=>typeof x==='string'))];
+ $('states').replaceChildren(...entities.map(entity=>{const label=node('label',entity),input=document.createElement('input');input.dataset.entity=entity;input.value=entity==='sun.sun'?(night?'below_horizon':'above_horizon'):String(a.conditions.find(x=>x.entity_id===entity)?.state??'home');label.append(input);return label;}));
+ for(const id of ['trigger-card','condition-card','action-card'])delete $(id).dataset.result;
+ $('outcome').textContent='What would happen?';$('explanation').textContent='Edit the event and entity states, then trace this automation.';$('trace').replaceChildren();
+}
+for(const id of ['night','day'])$(id).onclick=()=>{night=id==='night';$('night').setAttribute('aria-pressed',String(night));$('day').setAttribute('aria-pressed',String(!night));const sun=[...$('states').querySelectorAll('input')].find(x=>x.dataset.entity==='sun.sun');if(sun)sun.value=night?'below_horizon':'above_horizon';};
+$('simulate').onclick=()=>{
+ const states=Object.fromEntries([...$('states').querySelectorAll('input')].map(x=>[x.dataset.entity,x.value]));
+ const result=simulate(config.automations[selected],{entity:$('event-entity').value,from:$('event-from').value,to:$('event-to').value,time:$('event-time').value},states);
+ const labels={'would-run':['Would request these actions','Local model matched the event and every condition. No service was called.'],blocked:['Conditions blocked it','The event does not lead to an action under these entity states.'],'no-trigger':['No matching trigger','The event did not match a modeled trigger. Numeric triggers need a threshold crossing.'],unknown:['Not modeled completely','This automation uses features outside the local model. Test it in Home Assistant; this is not a passing trace.']};
+ $('outcome').textContent=labels[result.status][0];$('outcome').dataset.status=result.status;$('explanation').textContent=labels[result.status][1];
+ $('trigger-card').dataset.result=String(result.triggers.some(x=>x.result===true));$('condition-card').dataset.result=String(result.conditions.every(x=>x.result===true));$('action-card').dataset.result=String(result.status==='would-run');
+ $('trace').replaceChildren(...[...result.triggers.map((x,i)=>'Trigger '+(i+1)+': '+(x.result===null?'not modeled':x.result?'matched':'did not match')),...result.conditions.map((x,i)=>'Condition '+(i+1)+': '+(x.result===null?'not modeled':x.result?'passed':'blocked')),...result.actions.map(x=>'Intent only: '+(x.action??x.service)+' '+JSON.stringify(x.target??{})),...(!result.actionKnown?['Action semantics not modeled.']:[])].map(text=>node('li',text)));
+};
+$('download').onclick=()=>{const url=URL.createObjectURL(new Blob([config.source],{type:'application/yaml'})),a=document.createElement('a');a.href=url;a.download='automations.yaml';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);};
+render();
diff --git a/store/agents/home-assistant/skills/home-assistant/scripts/model.mjs b/store/agents/home-assistant/skills/home-assistant/scripts/model.mjs
new file mode 100644
index 000000000..74dbdb36e
--- /dev/null
+++ b/store/agents/home-assistant/skills/home-assistant/scripts/model.mjs
@@ -0,0 +1,70 @@
+// Deliberately small local model. Unsupported HA semantics are unknown, never success.
+export const list=value=>value==null?[]:Array.isArray(value)?value:[value];
+const object=value=>value&&typeof value==='object'&&!Array.isArray(value);
+export function normalize(input){
+ if(!Array.isArray(input)||!input.length||input.length>200)throw new Error('automations.yaml must contain 1–200 automation entries.');
+ const ids=new Set();
+ return input.map((item,index)=>{
+ if(!object(item))throw new Error('Automation '+(index+1)+' must be a mapping.');
+ const id=String(item.id??'');if(!id||ids.has(id))throw new Error('Every automation needs a unique id.');ids.add(id);
+ if(typeof item.alias!=='string'||!item.alias.trim())throw new Error(id+': give the automation a human-readable alias.');
+ const field=(a,b)=>{if(item[a]!==undefined&&item[b]!==undefined)throw new Error(id+': use '+a+' or '+b+', not both.');return list(item[a]??item[b]);};
+ const triggers=field('triggers','trigger'),conditions=field('conditions','condition'),actions=field('actions','action');
+ if(!triggers.length||!actions.length)throw new Error(id+': at least one trigger and action required; blueprints are not resolved by this local checker.');
+ if([...triggers,...conditions,...actions].some(x=>!object(x)))throw new Error(id+': triggers, conditions and actions must be mappings.');
+ if(triggers.some(x=>typeof(x.trigger??x.platform)!=='string'))throw new Error(id+': every trigger needs a trigger/platform type.');
+ if(conditions.some(x=>typeof x.condition!=='string'))throw new Error(id+': every condition needs a condition type.');
+ if(!['single','restart','queued','parallel'].includes(item.mode??'single'))throw new Error(id+': unrecognized automation mode.');
+ return {id,alias:item.alias,description:item.description??'',mode:item.mode??'single',triggers,conditions,actions};
+ });
+}
+const unsupported=(value,allowed)=>Object.keys(value).some(key=>!allowed.includes(key));
+const plain=value=>typeof value==='string'&&!value.includes('{{')&&!value.includes('{%');
+function inRange(value,rule){
+ if(value==null||value===''||!Number.isFinite(Number(value)))return null;
+ if(rule.above===undefined&&rule.below===undefined)return null;
+ if((rule.above!==undefined&&!Number.isFinite(Number(rule.above)))||(rule.below!==undefined&&!Number.isFinite(Number(rule.below))))return null;
+ return (rule.above===undefined||Number(value)>Number(rule.above))&&(rule.below===undefined||Number(value)<Number(rule.below));
+}
+export function checkTrigger(rule,event){
+ const type=rule.trigger??rule.platform;
+ if(type==='state'){
+ if(unsupported(rule,['trigger','platform','entity_id','from','to','id','alias'])||!plain(rule.entity_id)||rule.from===null||rule.to===null)return null;
+ if(event.entity!==rule.entity_id)return false;
+ if((rule.from!==undefined&&!plain(rule.from))||(rule.to!==undefined&&!plain(rule.to)))return null;
+ if(!plain(event.from)||!plain(event.to))return null;
+ return event.from!==event.to&&(rule.from===undefined||event.from===String(rule.from))&&(rule.to===undefined||event.to===String(rule.to));
+ }
+ if(type==='numeric_state'){
+ if(unsupported(rule,['trigger','platform','entity_id','above','below','id','alias'])||!plain(rule.entity_id))return null;
+ if(event.entity!==rule.entity_id)return false;
+ const before=inRange(event.from,rule),after=inRange(event.to,rule);
+ return before===null||after===null?null:!before&&after;
+ }
+ if(type==='time'){
+ if(unsupported(rule,['trigger','platform','at','id','alias'])||!/^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(rule.at))return null;
+ return String(event.time||'').padEnd(8,':00')===String(rule.at).padEnd(8,':00');
+ }
+ return null;
+}
+export function checkCondition(rule,states){
+ if(rule.condition==='state'){
+ if(unsupported(rule,['condition','entity_id','state','alias'])||!plain(rule.entity_id)||!plain(rule.state))return null;
+ return states[rule.entity_id]===undefined?null:String(states[rule.entity_id])===rule.state;
+ }
+ if(rule.condition==='numeric_state'){
+ if(unsupported(rule,['condition','entity_id','above','below','alias'])||!plain(rule.entity_id))return null;
+ return inRange(states[rule.entity_id],rule);
+ }
+ return null;
+}
+export function simulate(automation,event,states){
+ const triggers=automation.triggers.map(rule=>({rule,result:checkTrigger(rule,event)}));
+ const next={...states};if(event.entity)next[event.entity]=event.to;
+ const conditions=automation.conditions.map(rule=>({rule,result:checkCondition(rule,next)}));
+ const trigger=triggers.some(x=>x.result===true)?true:triggers.some(x=>x.result===null)?null:false;
+ const condition=conditions.some(x=>x.result===false)?false:conditions.some(x=>x.result===null)?null:true;
+ const actionKnown=automation.actions.every(rule=>!unsupported(rule,['action','service','target','data','alias'])&&plain(rule.action??rule.service)&&!JSON.stringify(rule).includes('{{')&&!JSON.stringify(rule).includes('{%'));
+ const status=trigger===false?'no-trigger':condition===false?'blocked':trigger===null||condition===null||!actionKnown?'unknown':'would-run';
+ return {status,triggers,conditions,actions:status==='would-run'?automation.actions:[],actionKnown};
+}
diff --git a/store/agents/home-assistant/store.json b/store/agents/home-assistant/store.json
new file mode 100644
index 000000000..ab7eeda88
--- /dev/null
+++ b/store/agents/home-assistant/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://www.home-assistant.io",
+ "upstream": "https://github.com/home-assistant/core",
+ "license": "MIT",
+ "tagline": "Open-source home automation that puts local control first",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/home-assistant/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Preview the demo arrival automation at night and in daylight without connecting to a home.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/home-assistant/starter.jpg",
+ "caption": "Habitat · local YAML scenario simulation"
+ }
+ ]
+}
diff --git a/store/agents/home-assistant/template/.gitignore b/store/agents/home-assistant/template/.gitignore
new file mode 100644
index 000000000..a972fa696
--- /dev/null
+++ b/store/agents/home-assistant/template/.gitignore
@@ -0,0 +1,4 @@
+# Generated by the harness — never source.
+.harness/
+.harness-initialized
+dashboard.html
diff --git a/store/agents/home-assistant/template/automations.yaml b/store/agents/home-assistant/template/automations.yaml
new file mode 100644
index 000000000..867e5d87e
--- /dev/null
+++ b/store/agents/home-assistant/template/automations.yaml
@@ -0,0 +1,57 @@
+# Demo entities below are placeholders, not discovered devices. Replace before deployment.
+- id: welcome_lights
+ alias: A warmer welcome
+ description: Arrive home after dark and bring the living room gently to life.
+ triggers:
+ - trigger: state
+ entity_id: person.demo
+ from: not_home
+ to: home
+ conditions:
+ - condition: state
+ entity_id: sun.sun
+ state: below_horizon
+ actions:
+ - action: light.turn_on
+ target:
+ entity_id: light.demo_living_room
+ data:
+ brightness_pct: 45
+ transition: 3
+ mode: single
+
+- id: quiet_evening
+ alias: Let the evening settle
+ description: At eleven, dim the lights if someone is home.
+ triggers:
+ - trigger: time
+ at: "23:00:00"
+ conditions:
+ - condition: state
+ entity_id: person.demo
+ state: home
+ actions:
+ - action: light.turn_on
+ target:
+ entity_id: light.demo_living_room
+ data:
+ brightness_pct: 15
+ transition: 10
+ mode: single
+
+- id: fresh_air
+ alias: A little fresh air
+ description: When CO₂ crosses 1000 ppm, request the fan while someone is home.
+ triggers:
+ - trigger: numeric_state
+ entity_id: sensor.demo_co2
+ above: 1000
+ conditions:
+ - condition: state
+ entity_id: person.demo
+ state: home
+ actions:
+ - action: fan.turn_on
+ target:
+ entity_id: fan.demo_study
+ mode: single
diff --git a/store/agents/home-assistant/template/configuration.yaml b/store/agents/home-assistant/template/configuration.yaml
new file mode 100644
index 000000000..fe714918f
--- /dev/null
+++ b/store/agents/home-assistant/template/configuration.yaml
@@ -0,0 +1,3 @@
+# Optional Home Assistant check_config entrypoint. This is a local authoring project.
+# Do not replace an existing installation's configuration.yaml with this file.
+automation: !include automations.yaml
diff --git a/store/agents/home-assistant/template/proof.json b/store/agents/home-assistant/template/proof.json
new file mode 100644
index 000000000..1932b2a1d
--- /dev/null
+++ b/store/agents/home-assistant/template/proof.json
@@ -0,0 +1 @@
+{"actions":[{"selector":"#simulate","click":true},{"selector":"#outcome","text":"Would request these actions"},{"selector":"#day","click":true},{"selector":"#simulate","click":true},{"selector":"#outcome","text":"Conditions blocked it"},{"selector":"#night","click":true},{"selector":"#simulate","click":true},{"selector":"#outcome","text":"Would request these actions"}]}
diff --git a/store/agents/home-assistant/test/model.test.mjs b/store/agents/home-assistant/test/model.test.mjs
new file mode 100644
index 000000000..64695dc00
--- /dev/null
+++ b/store/agents/home-assistant/test/model.test.mjs
@@ -0,0 +1,8 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';
+import {normalize,simulate,checkTrigger,checkCondition} from '../skills/home-assistant/scripts/model.mjs';
+const rule=normalize([{id:'a',alias:'Welcome',triggers:[{trigger:'state',entity_id:'person.demo',from:'away',to:'home'}],conditions:[{condition:'state',entity_id:'sun.sun',state:'below_horizon'}],actions:[{action:'light.turn_on'}]}])[0];
+test('state transition and conditions produce intent only',()=>{assert.equal(simulate(rule,{entity:'person.demo',from:'away',to:'home'},{'sun.sun':'below_horizon'}).status,'would-run');assert.equal(simulate(rule,{entity:'person.demo',from:'away',to:'home'},{'sun.sun':'above_horizon'}).status,'blocked');assert.equal(simulate(rule,{entity:'person.demo',from:'home',to:'home'},{'sun.sun':'below_horizon'}).status,'no-trigger');});
+test('numeric triggers require entering strict bounds',()=>{const r={trigger:'numeric_state',entity_id:'sensor.a',above:1000};assert.equal(checkTrigger(r,{entity:'sensor.a',from:'900',to:'1100'}),true);assert.equal(checkTrigger(r,{entity:'sensor.a',from:'1050',to:'1100'}),false);assert.equal(checkTrigger(r,{entity:'sensor.a',from:'900',to:'1000'}),false);assert.equal(checkTrigger(r,{entity:'sensor.a',from:'unknown',to:'1100'}),null);});
+test('unsupported semantics cannot pass',()=>{for(const extra of [{for:'00:02:00'},{attribute:'mode'},{to:'{{ value }}'}])assert.equal(checkTrigger({...rule.triggers[0],...extra},{entity:'person.demo',from:'away',to:'home'}),null);assert.equal(checkCondition({condition:'template',value_template:'true'},{}),null);assert.equal(simulate({...rule,actions:[{delay:10}]},{entity:'person.demo',from:'away',to:'home'},{'sun.sun':'below_horizon'}).status,'unknown');});
+test('modern and legacy keys normalize; duplicates and missing structure fail',()=>{assert.equal(normalize([{id:'a',alias:'A',trigger:{platform:'time',at:'09:00'},action:{action:'light.turn_on'}}])[0].triggers.length,1);assert.throws(()=>normalize([{...rule,triggers:[],actions:[]}]),/trigger/);assert.throws(()=>normalize([rule,rule]),/unique/);assert.throws(()=>normalize([{...rule,trigger:rule.triggers}]),/not both/);});
+test('fixed-time comparison and missing state',()=>{assert.equal(checkTrigger({trigger:'time',at:'23:00:00'},{time:'23:00'}),true);assert.equal(checkTrigger({trigger:'time',at:'25:00'},{time:'25:00'}),null);assert.equal(checkCondition(rule.conditions[0],{}),null);});
diff --git a/store/agents/home-assistant/test/toolchain.test.mjs b/store/agents/home-assistant/test/toolchain.test.mjs
new file mode 100644
index 000000000..67a626bde
--- /dev/null
+++ b/store/agents/home-assistant/test/toolchain.test.mjs
@@ -0,0 +1,7 @@
+import {test,after} from 'node:test';import assert from 'node:assert/strict';import {spawnSync} from 'node:child_process';import {accessSync,constants,mkdtempSync,readFileSync,writeFileSync,rmSync,cpSync} from 'node:fs';import {tmpdir} from 'node:os';import {join,dirname} from 'node:path';import {fileURLToPath} from 'node:url';
+const root=fileURLToPath(new URL('..',import.meta.url)),dirs=[];const temp=()=>{const d=mkdtempSync(join(tmpdir(),'ha-test-'));dirs.push(d);return d;};after(()=>dirs.forEach(d=>rmSync(d,{recursive:true,force:true})));
+const build=ws=>spawnSync(process.execPath,[join(root,'skills/home-assistant/scripts/build.mjs')],{cwd:ws,encoding:'utf8'});
+test('manifest scripts executable and doctor detects the local parser',()=>{for(const p of ['toolchain/init-workspace.sh','toolchain/setup.sh','toolchain/doctor.sh','skills/home-assistant/scripts/build-automations.sh'])accessSync(join(root,p),constants.X_OK);const r=spawnSync('sh',[join(root,'toolchain/doctor.sh')],{cwd:root,encoding:'utf8'});assert.equal(r.status,0,r.stderr);assert.match(r.stdout,/local config-only/);});
+test('real YAML starter builds all three automations without Home Assistant',()=>{const ws=temp();cpSync(join(root,'template'),ws,{recursive:true});const r=build(ws);assert.equal(r.status,0,r.stderr);const v=JSON.parse(readFileSync(join(ws,'.harness/verdict.json')));assert.equal(v.ready,true);assert.match(v.findings[0].message,/No Home Assistant/);assert.match(readFileSync(join(ws,'dashboard.html'),'utf8'),/A warmer welcome/);});
+test('malformed YAML, duplicate keys, aliases and invalid shape clear stale ready',()=>{const ws=temp();cpSync(join(root,'template'),ws,{recursive:true});assert.equal(build(ws).status,0);const previous=readFileSync(join(ws,'dashboard.html'),'utf8');for(const input of ['- id: [broken','- id: a\n id: b\n','- !include secret.yaml','{}','- id: a\n alias: A\n triggers: []\n actions: []']){writeFileSync(join(ws,'automations.yaml'),input);assert.notEqual(build(ws).status,0);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,false);assert.equal(readFileSync(join(ws,'dashboard.html'),'utf8'),previous);}});
+test('HTML-like source is encoded in the data block, not interpreted',()=>{const ws=temp();writeFileSync(join(ws,'automations.yaml'),JSON.stringify([{id:'x',alias:'</script><img src=x onerror=alert(1)>',trigger:{platform:'state',entity_id:'person.x',to:'home'},action:{action:'light.turn_on'}}]));assert.equal(build(ws).status,0);const html=readFileSync(join(ws,'dashboard.html'),'utf8');assert.ok(!html.includes('</script><img'));assert.ok(html.includes('\\u003c/script>'));});
diff --git a/store/agents/home-assistant/toolchain/doctor.sh b/store/agents/home-assistant/toolchain/doctor.sh
new file mode 100755
index 000000000..0c3b53acb
--- /dev/null
+++ b/store/agents/home-assistant/toolchain/doctor.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+if [ ! -f "$dsh/node_modules/yaml/package.json" ]; then echo "miss YAML parser — run toolchain/setup.sh"; exit 1; fi
+if ! command -v node >/dev/null 2>&1; then echo "warn node not on PATH — build uses the managed Node bootstrap"; fi
+echo "ok YAML parser; local config-only authoring and scenario preview"
+echo "note No live Home Assistant instance or device services are contacted"
diff --git a/store/agents/home-assistant/toolchain/init-workspace.sh b/store/agents/home-assistant/toolchain/init-workspace.sh
new file mode 100755
index 000000000..773d6057f
--- /dev/null
+++ b/store/agents/home-assistant/toolchain/init-workspace.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+# Seeds the first verdict and a placeholder dashboard so the pane has something to show.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Home Assistant workspace ready — describe an automation to write",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+cat > dashboard.html <<'HTML'
+<!doctype html><meta charset="utf-8"><title>Automations</title>
+<h1>Home Assistant</h1><p>No automations built yet. Describe one — each rule will appear here.</p>
+HTML
+printf 'Home Assistant workspace initialized by %s\n' "${HARNESS_DSH:-home-assistant}" > .harness-initialized
diff --git a/store/agents/home-assistant/toolchain/node.sh b/store/agents/home-assistant/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/home-assistant/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/home-assistant/toolchain/runtimes.sh b/store/agents/home-assistant/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/home-assistant/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/home-assistant/toolchain/setup.sh b/store/agents/home-assistant/toolchain/setup.sh
new file mode 100755
index 000000000..8ace3e26e
--- /dev/null
+++ b/store/agents/home-assistant/toolchain/setup.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -eu
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+bash "$dsh/toolchain/node.sh" --version
+cd "$dsh"
+# Node bootstrap also makes npm available in its child shell.
+exec bash -c '. "$1/toolchain/runtimes.sh"; harness_node 20 && npm ci --omit=dev --ignore-scripts --no-audit --no-fund' sh "$dsh"
diff --git a/store/agents/openscad/.gitignore b/store/agents/openscad/.gitignore
new file mode 100644
index 000000000..885fac136
--- /dev/null
+++ b/store/agents/openscad/.gitignore
@@ -0,0 +1,11 @@
+# Render output — never source.
+part.stl
+part.step
+*.stl
+*.step
+*.3mf
+*.off
+# Harness bookkeeping.
+.harness/
+.harness-initialized
+toolchain/openscad-cli
diff --git a/store/agents/openscad/AGENTS.md b/store/agents/openscad/AGENTS.md
new file mode 100644
index 000000000..bf94f4a0d
--- /dev/null
+++ b/store/agents/openscad/AGENTS.md
@@ -0,0 +1,15 @@
+# OpenSCAD
+
+Read the `openscad` skill. Build parametric geometry in `model.scad` and render it with
+`sh "$OPENSCAD_SKILLS/openscad/scripts/render-part.sh"`. The shared CAD Viewer opens `part.stl`.
+
+Keep dimensions, units, tolerances and manufacturing assumptions visible. The Ripple starter is
+an editable dry-use vessel, not a certified printable, watertight or food-safe product.
+Render early, inspect the actual part, then iterate.
+
+The helper stages a fresh STL, checks triangle topology, volume and bounds, and updates the verdict.
+It cannot certify wall thickness, material strength, overhangs or fit. Do not claim those checks ran
+when they did not. A failed build preserves the previous export but clears readiness.
+
+OpenSCAD has no native STEP export. Do not run `openscad -o part.step` or promise a true B-rep from
+that command. For editable STEP geometry, use an appropriate CAD workflow such as FreeCAD.
diff --git a/store/agents/openscad/LICENSE b/store/agents/openscad/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/openscad/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/openscad/PROVENANCE.md b/store/agents/openscad/PROVENANCE.md
new file mode 100644
index 000000000..f2ff47326
--- /dev/null
+++ b/store/agents/openscad/PROVENANCE.md
@@ -0,0 +1,7 @@
+# Provenance
+
+The Ripple vessel source, mesh inspector, staged-build helper and instructions are
+original MIT-licensed OpenHarness work. [OpenSCAD](https://openscad.org) is a
+separately installed GPL-2.0 notation-based CAD application. No OpenSCAD code or
+binary is redistributed. Native QA used OpenSCAD 2021.01. The CAD pane is the
+separate autonomous/cad-viewer package, which carries its own upstream notices.
diff --git a/store/agents/openscad/README.md b/store/agents/openscad/README.md
new file mode 100644
index 000000000..d81e45b62
--- /dev/null
+++ b/store/agents/openscad/README.md
@@ -0,0 +1,29 @@
+# OpenSCAD
+
+Describe a shape, then keep changing it through named dimensions. The **Ripple** starter is a
+twisted, fluted vessel: change its height, diameter, wall or rib count and inspect the actual
+3D result in the shared CAD Viewer.
+
+Try: “Make this a shorter desktop organizer with a thicker base and softer ribs.”
+
+The build exports a fresh STL and checks closed-edge topology, nondegenerate triangles, bounds
+and volume. Failed exports do not leave a successful verdict. A valid mesh still needs review for
+your printer, material and intended use; the starter is not food-safe or watertight by certification.
+
+Requires OpenSCAD, Node 20+ and the shared CAD Viewer. `OPENSCAD_BIN` can point to a custom install.
+OpenSCAD does not export native STEP; use a B-rep CAD workflow when that is the deliverable.
+
+```sh
+harness dsh install "$PWD/store/agents/openscad" --link
+harness dsh doctor autonomous/openscad
+```
+
+Upstream: [OpenSCAD](https://openscad.org). This package supplies the workspace, agent skill,
+starter and verification helpers.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/openscad/harness.json b/store/agents/openscad/harness.json
new file mode 100644
index 000000000..f23e0c8c6
--- /dev/null
+++ b/store/agents/openscad/harness.json
@@ -0,0 +1,36 @@
+{
+ "spec": 1,
+ "id": "autonomous/openscad",
+ "name": "OpenSCAD",
+ "category": "CAD",
+ "author": "OpenSCAD",
+ "description": "Parametric OpenSCAD geometry with a live CAD preview, fresh STL exports, and mesh topology, volume and bounds checks.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "model.scad",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "OPENSCAD_TOOLCHAIN": "${dsh}/toolchain",
+ "OPENSCAD_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/cad-viewer",
+ "artifactExtensions": [
+ ".stl",
+ ".3mf"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/openscad/package.json b/store/agents/openscad/package.json
new file mode 100644
index 000000000..2f73914f3
--- /dev/null
+++ b/store/agents/openscad/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/openscad-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/openscad/skills/openscad/SKILL.md b/store/agents/openscad/skills/openscad/SKILL.md
new file mode 100644
index 000000000..744b66f08
--- /dev/null
+++ b/store/agents/openscad/skills/openscad/SKILL.md
@@ -0,0 +1,32 @@
+---
+name: openscad
+description: Create parametric OpenSCAD models, export and inspect fresh meshes, and iterate in the shared CAD Viewer.
+---
+
+# OpenSCAD
+
+Use named millimetre dimensions at the top of `model.scad`, assertions for invalid combinations,
+and small reusable modules. Preserve the user's target machine/material/fit constraints.
+The Ripple starter's height, diameter, wall, ribs and twist are editable; it is not a required style.
+
+```sh
+sh "$OPENSCAD_SKILLS/openscad/scripts/render-part.sh"
+```
+
+Requires Node 20+ and OpenSCAD. The helper resolves `OPENSCAD_BIN`, the toolchain link, PATH or the
+standard macOS app. It runs one real export into a unique staging directory, writes the compiler
+output to `.harness/build.log`, inspects the STL, then replaces `part.stl` only on success.
+`.harness/mesh.json` reports triangles, volume, area, bounds, degenerate faces and open/non-manifold
+edges. Failure always clears the verdict's readiness and artifact rather than endorsing an old mesh.
+
+The STL check welds coordinates to five decimal places and checks paired, oppositely directed edges.
+It does not detect all self-intersections or certify wall thickness, printability, strength or fit.
+Review overhangs, intended orientation, supports, clearances and process-specific wall requirements.
+Don't describe a closed mesh as proof of manufacturing safety.
+
+For manual variants: `openscad -o tall.stl -D height=100 model.scad`. Export 2D contours with
+`openscad -o outline.dxf drawing.scad`. OpenSCAD does not natively export STEP; request/choose a
+true CAD workflow for B-rep editing or machining rather than relabeling a mesh.
+
+Inspect the actual STL in the CAD Viewer: orbit, fit, section and measure as appropriate.
+A source-code screenshot or a successful exit code is not visual verification.
diff --git a/store/agents/openscad/skills/openscad/scripts/build.mjs b/store/agents/openscad/skills/openscad/scripts/build.mjs
new file mode 100644
index 000000000..0fb10b1ac
--- /dev/null
+++ b/store/agents/openscad/skills/openscad/scripts/build.mjs
@@ -0,0 +1,37 @@
+import { access, readFile, writeFile, mkdir, mkdtemp, rename, rm } from 'node:fs/promises';
+import { constants } from 'node:fs';
+import { spawnSync } from 'node:child_process';
+import { delimiter, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { inspectSTL } from './mesh.mjs';
+export async function findExecutable(candidates){
+ for(const candidate of candidates.filter(Boolean))for(const file of candidate.includes('/')?[candidate]:(process.env.PATH||'').split(delimiter).map(dir=>join(dir,candidate))){
+ try{await access(file,constants.X_OK);return file;}catch{}
+ }
+ throw new Error('OpenSCAD not found. Set OPENSCAD_BIN or run harness dsh doctor autonomous/openscad.');
+}
+export async function build(workspace,{bin}={}){
+ const state=join(workspace,'.harness');await mkdir(state,{recursive:true});
+ const atomic=async(path,value)=>{const temporary=path+'.'+process.pid+'.tmp';await writeFile(temporary,value);await rename(temporary,path);};
+ const verdict=value=>atomic(join(state,'verdict.json'),JSON.stringify({spec:1,...value,updatedAt:new Date().toISOString()},null,2)+'\n');
+ let temporary;
+ try{
+ await verdict({ready:false,summary:'Rendering and inspecting the mesh',findings:[],artifact:null});
+ const executable=bin||await findExecutable([process.env.OPENSCAD_BIN,process.env.OPENSCAD_TOOLCHAIN&&join(process.env.OPENSCAD_TOOLCHAIN,'openscad-cli'),'openscad','/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD']);
+ await access(join(workspace,'model.scad'));
+ temporary=await mkdtemp(join(state,'openscad-'));
+ const result=spawnSync(executable,['-o',join(temporary,'part.stl'),join(workspace,'model.scad')],{cwd:workspace,encoding:'utf8',timeout:180000,maxBuffer:10*1024*1024});
+ await atomic(join(state,'build.log'),(result.stdout||'')+(result.stderr||''));
+ if(result.error||result.status!==0)throw new Error('OpenSCAD failed: '+(result.error?.message||'exit '+result.status)+'. See .harness/build.log.');
+ const mesh=await readFile(join(temporary,'part.stl')),report=inspectSTL(mesh);
+ if(!report.watertight||report.volumeMM3<=0)throw new Error('Mesh inspection failed: '+report.nonManifoldEdges+' open/non-manifold edges and '+report.degenerateTriangles+' degenerate triangles.');
+ await atomic(join(workspace,'part.stl'),mesh);await atomic(join(state,'mesh.json'),JSON.stringify(report,null,2)+'\n');
+ await verdict({ready:true,summary:report.triangles.toLocaleString()+' triangles · closed mesh · '+report.bounds.size.map(n=>n.toFixed(1)).join(' × ')+' mm',findings:[{severity:'info',kind:'manufacturing',message:'Closed-mesh checks do not certify wall thickness, strength, overhangs or fit. Review for the intended printer and material.'}],artifact:'part.stl'});
+ return report;
+ }catch(error){await verdict({ready:false,summary:'OpenSCAD build failed',findings:[{severity:'error',kind:'build',message:error.message}],artifact:null});throw error;}
+ finally{if(temporary)await rm(temporary,{recursive:true,force:true});}
+}
+if(process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url)){
+ try{const report=await build(resolve(process.env.HARNESS_WORKSPACE||process.cwd()));console.log('Verified part.stl: '+report.triangles+' triangles, '+report.volumeMM3.toFixed(1)+' mm³');}
+ catch(error){console.error(error.message);process.exitCode=1;}
+}
diff --git a/store/agents/openscad/skills/openscad/scripts/mesh.mjs b/store/agents/openscad/skills/openscad/scripts/mesh.mjs
new file mode 100644
index 000000000..20915e83e
--- /dev/null
+++ b/store/agents/openscad/skills/openscad/scripts/mesh.mjs
@@ -0,0 +1,31 @@
+// Inspect the exported mesh, not OpenSCAD's exit code. Coordinates are millimetres.
+export function inspectSTL(buffer) {
+ const triangles=[];
+ if(buffer.length>=84 && buffer.readUInt32LE(80)*50+84===buffer.length){
+ for(let i=84;i<buffer.length;i+=50)triangles.push([0,1,2].map(v=>[0,1,2].map(axis=>buffer.readFloatLE(i+12+v*12+axis*4))));
+ }else{
+ const source=buffer.toString('utf8');
+ if(!/^\s*solid\b/.test(source)||!/endsolid\b/.test(source))throw new Error('The export is not a complete STL.');
+ const vertices=[...source.matchAll(/\bvertex\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)/g)].map(match=>match.slice(1).map(Number));
+ if(vertices.length%3)throw new Error('The STL has an incomplete triangle.');
+ for(let i=0;i<vertices.length;i+=3)triangles.push(vertices.slice(i,i+3));
+ }
+ if(!triangles.length)throw new Error('The STL is empty.');
+ const min=[Infinity,Infinity,Infinity],max=[-Infinity,-Infinity,-Infinity],edges=new Map();
+ let signedVolume=0,area=0,degenerateTriangles=0;
+ const cross=(a,b)=>[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]];
+ for(const vertices of triangles){
+ if(vertices.some(point=>point.some(value=>!Number.isFinite(value))))throw new Error('The STL contains non-finite coordinates.');
+ for(const point of vertices)point.forEach((value,axis)=>{min[axis]=Math.min(min[axis],value);max[axis]=Math.max(max[axis],value);});
+ const [a,b,c]=vertices,normal=cross(b.map((v,i)=>v-a[i]),c.map((v,i)=>v-a[i])),faceArea=Math.hypot(...normal)/2;
+ area+=faceArea;if(faceArea<1e-10)degenerateTriangles++;
+ const bc=cross(b,c);signedVolume+=a.reduce((sum,value,i)=>sum+value*bc[i],0)/6;
+ const keys=vertices.map(point=>point.map(value=>value.toFixed(5)).join(','));
+ for(let i=0;i<3;i++){
+ const a=keys[i],b=keys[(i+1)%3],key=a<b?a+'|'+b:b+'|'+a;
+ const edge=edges.get(key)||{count:0,balance:0};edge.count++;edge.balance+=a<b?1:-1;edges.set(key,edge);
+ }
+ }
+ const nonManifoldEdges=[...edges.values()].filter(edge=>edge.count!==2||edge.balance!==0).length;
+ return {triangles:triangles.length,bounds:{min,max,size:max.map((v,i)=>v-min[i])},volumeMM3:Math.abs(signedVolume),areaMM2:area,degenerateTriangles,nonManifoldEdges,watertight:!nonManifoldEdges&&!degenerateTriangles};
+}
diff --git a/store/agents/openscad/skills/openscad/scripts/render-part.sh b/store/agents/openscad/skills/openscad/scripts/render-part.sh
new file mode 100755
index 000000000..87483c590
--- /dev/null
+++ b/store/agents/openscad/skills/openscad/scripts/render-part.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd "$(dirname "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs"
diff --git a/store/agents/openscad/store.json b/store/agents/openscad/store.json
new file mode 100644
index 000000000..7d2904f3c
--- /dev/null
+++ b/store/agents/openscad/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://openscad.org",
+ "upstream": "https://github.com/openscad/openscad",
+ "license": "MIT",
+ "tagline": "The Programmers Solid 3D CAD Modeller",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/openscad/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Render the included Ripple vessel and check its mesh closure, volume and dimensions.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/openscad/starter.jpg",
+ "caption": "Ripple · real OpenSCAD STL, inspected closed mesh"
+ }
+ ]
+}
diff --git a/store/agents/openscad/template/model.scad b/store/agents/openscad/template/model.scad
new file mode 100644
index 000000000..4c670cdab
--- /dev/null
+++ b/store/agents/openscad/template/model.scad
@@ -0,0 +1,30 @@
+// Ripple — a parametric, open-top desktop vessel. Units: mm.
+// Set height, diameter, twist and ribs, then run render-part.sh.
+// This is a dry-use object, not a food-safe or watertight container.
+height = 76;
+diameter = 82;
+wall = 2.4;
+floor_thickness = 2.8;
+ribs = 36;
+rib_depth = 2.6;
+twist = 28;
+resolution = 180;
+
+assert(height > floor_thickness && floor_thickness > 0, "height must exceed a positive floor");
+assert(diameter > 2 * (wall + rib_depth) && wall >= 1.2, "keep a useful inner diameter and wall >= 1.2 mm");
+assert(ribs >= 3 && ribs <= 100 && rib_depth >= 0, "use 3–100 ribs and nonnegative rib depth");
+$fn = resolution;
+
+// Continuous polar outline avoids coincident seams between separate ribs.
+module outline() {
+ polygon([for (i = [0:resolution-1])
+ let(angle = i * 360 / resolution,
+ radius = diameter / 2 + rib_depth * (0.5 + 0.5*cos(ribs*angle)))
+ [radius*cos(angle), radius*sin(angle)]]);
+}
+difference() {
+ linear_extrude(height=height, twist=twist, slices=ceil(height/2), convexity=10)
+ outline();
+ translate([0,0,floor_thickness])
+ cylinder(h=height+0.1, r=diameter/2-wall);
+}
diff --git a/store/agents/openscad/test/build.test.mjs b/store/agents/openscad/test/build.test.mjs
new file mode 100644
index 000000000..922da626b
--- /dev/null
+++ b/store/agents/openscad/test/build.test.mjs
@@ -0,0 +1,25 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { build } from '../skills/openscad/scripts/build.mjs';
+const tetra='solid tetra\n'+[[[0,0,0],[0,1,0],[1,0,0]],[[0,0,0],[1,0,0],[0,0,1]],[[0,0,0],[0,0,1],[0,1,0]],[[1,0,0],[0,1,0],[0,0,1]]].map(face=>'facet normal 0 0 0\nouter loop\n'+face.map(v=>'vertex '+v.join(' ')).join('\n')+'\nendloop\nendfacet').join('\n')+'\nendsolid tetra\n';
+test('only a fresh, inspected mesh can replace an older artifact or set ready',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'openscad-build-test-'));
+ try{
+ await writeFile(join(workspace,'model.scad'),'cube(1);');await writeFile(join(workspace,'fixture.stl'),tetra);
+ const bin=join(workspace,'fake-openscad');
+ await writeFile(bin,'#!/bin/sh\ncp fixture.stl "$2"\n',{mode:0o755});
+ const report=await build(workspace,{bin});assert.equal(report.watertight,true);
+ assert.equal(JSON.parse(await readFile(join(workspace,'.harness/verdict.json'))).ready,true);
+ const saved=await readFile(join(workspace,'part.stl'),'utf8');
+ for(const command of ['exit 1','exit 0',': > "$2"']){
+ await writeFile(bin,'#!/bin/sh\n'+command+'\n',{mode:0o755});
+ await assert.rejects(()=>build(workspace,{bin}));
+ const verdict=JSON.parse(await readFile(join(workspace,'.harness/verdict.json')));
+ assert.equal(verdict.ready,false);assert.equal(verdict.artifact,null);
+ assert.equal(await readFile(join(workspace,'part.stl'),'utf8'),saved);
+ }
+ }finally{await rm(workspace,{recursive:true,force:true});}
+});
diff --git a/store/agents/openscad/test/mesh.test.mjs b/store/agents/openscad/test/mesh.test.mjs
new file mode 100644
index 000000000..e17ab75aa
--- /dev/null
+++ b/store/agents/openscad/test/mesh.test.mjs
@@ -0,0 +1,20 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { inspectSTL } from '../skills/openscad/scripts/mesh.mjs';
+const a=[0,0,0],b=[1,0,0],c=[0,1,0],d=[0,0,1];
+export const faces=[[a,c,b],[a,b,d],[a,d,c],[b,c,d]];
+export function ascii(triangles=faces){return 'solid tetra\n'+triangles.map(face=>'facet normal 0 0 0\nouter loop\n'+face.map(v=>'vertex '+v.join(' ')).join('\n')+'\nendloop\nendfacet').join('\n')+'\nendsolid tetra\n';}
+test('ASCII and binary STL agree on real volume, bounds and closure',()=>{
+ const binary=Buffer.alloc(84+faces.length*50);binary.writeUInt32LE(faces.length,80);
+ faces.forEach((face,i)=>face.forEach((point,v)=>point.forEach((n,axis)=>binary.writeFloatLE(n,84+i*50+12+v*12+axis*4))));
+ for(const bytes of [Buffer.from(ascii()),binary]){
+ const report=inspectSTL(bytes);assert.equal(report.watertight,true);assert.equal(report.triangles,4);
+ assert.ok(Math.abs(report.volumeMM3-1/6)<1e-12);assert.deepEqual(report.bounds.size,[1,1,1]);
+ }
+});
+test('open surfaces, inconsistent winding, degenerate faces, empty and malformed exports cannot pass',()=>{
+ assert.equal(inspectSTL(Buffer.from(ascii(faces.slice(0,3)))).watertight,false);
+ assert.equal(inspectSTL(Buffer.from(ascii([faces[0].toReversed(),...faces.slice(1)]))).watertight,false);
+ assert.equal(inspectSTL(Buffer.from(ascii([[a,a,a]]))).watertight,false);
+ for(const input of ['', 'solid x\nendsolid x', 'not stl',ascii().replace('vertex 0 0 0','vertex NaN 0 0')])assert.throws(()=>inspectSTL(Buffer.from(input)));
+});
diff --git a/store/agents/openscad/test/toolchain.test.mjs b/store/agents/openscad/test/toolchain.test.mjs
new file mode 100644
index 000000000..43370cc27
--- /dev/null
+++ b/store/agents/openscad/test/toolchain.test.mjs
@@ -0,0 +1,99 @@
+// The OpenSCAD harness's scripts, run the way Harness runs them: by path, in the directory Harness
+// gives them, with the environment Harness sets.
+//
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync, chmodSync, mkdirSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join, dirname } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const dir of scratch) rmSync(dir, { recursive: true, force: true }) })
+
+function tempDir() {
+ const dir = mkdtempSync(join(tmpdir(), 'openscad-'))
+ scratch.push(dir)
+ return dir
+}
+
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [key, value] of Object.entries(env)) if (value === null) delete merged[key]; else merged[key] = value
+ const result = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: result.status, stdout: result.stdout, stderr: result.stderr }
+}
+
+/** A transport fixture, not evidence of a real OpenSCAD render. */
+function fakeOpenscad() {
+ const dir = tempDir()
+ const bin = join(dir, 'openscad')
+ const faces = [[[0,0,0],[0,1,0],[1,0,0]],[[0,0,0],[1,0,0],[0,0,1]],[[0,0,0],[0,0,1],[0,1,0]],[[1,0,0],[0,1,0],[0,0,1]]]
+ const mesh = 'solid tetra\n' + faces.map(face => 'facet normal 0 0 0\nouter loop\n' + face.map(v => 'vertex '+v.join(' ')).join('\n') + '\nendloop\nendfacet').join('\n') + '\nendsolid tetra\n'
+ writeFileSync(join(dir,'fixture.stl'), mesh)
+ writeFileSync(bin, '#!/bin/sh\n[ "$1" = "-o" ] || exit 0\ncp "'+join(dir,'fixture.stl')+'" "$2"\n')
+ chmodSync(bin, 0o755)
+ return { dir, bin }
+}
+
+test('every script the manifest names is in the folder and executable', () => {
+ for (const script of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/openscad/scripts/render-part.sh']) {
+ assert.doesNotThrow(() => accessSync(join(here, script), constants.X_OK), script)
+ }
+})
+
+test('setup finds an openscad CLI on PATH and says ok', () => {
+ const { dir, bin } = fakeOpenscad()
+ const { code, stdout } = run(manifest.toolchain.setup, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok openscad/)
+})
+
+test('doctor says ok when openscad is on PATH', () => {
+ const { dir } = fakeOpenscad()
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0)
+ assert.match(stdout, /ok openscad/)
+})
+
+test('doctor says miss and fails when openscad is not present', () => {
+ if (existsSync('/Applications/OpenSCAD.app')) return // can't force this case on a machine with the cask installed
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: tempDir() } })
+ assert.equal(code, 1)
+ assert.match(stdout, /miss openscad/)
+})
+
+test('init seeds the first verdict and the initialized marker', () => {
+ const workspace = tempDir()
+ const { code } = run(manifest.workspace.init, { cwd: workspace, env: { HARNESS_DSH: manifest.id } })
+ assert.equal(code, 0)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, false)
+ assert.match(readFileSync(join(workspace, '.harness-initialized'), 'utf8'), new RegExp(manifest.id.replace('/', '/')))
+})
+
+test('render-part.sh renders an artifact and flips the verdict, exactly as SKILL.md writes it', () => {
+ const skill = readFileSync(join(here, 'skills/openscad/SKILL.md'), 'utf8')
+ const command = 'sh "$OPENSCAD_SKILLS/openscad/scripts/render-part.sh"'
+ assert.ok(skill.includes(command), 'SKILL.md should document the one-stop render command')
+ assert.equal(manifest.agent.env.OPENSCAD_SKILLS, '${dsh}/skills')
+
+ const { dir, bin } = fakeOpenscad()
+ const workspace = tempDir()
+ mkdirSync(join(workspace, 'parts'), { recursive: true })
+ writeFileSync(join(workspace, 'model.scad'), 'cube(10);\n')
+ const result = spawnSync('/bin/sh', ['-c', command], {
+ cwd: workspace,
+ env: { ...process.env, OPENSCAD_SKILLS: join(here, 'skills'), PATH: `${dir}:${dirname(process.execPath)}:/usr/bin:/bin`, HARNESS_WORKSPACE: workspace },
+ encoding: 'utf8',
+ })
+ assert.equal(result.status, 0, result.stderr)
+ assert.equal(existsSync(join(workspace, 'part.stl')), true)
+ const verdict = JSON.parse(readFileSync(join(workspace, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, true)
+ assert.equal(verdict.artifact, 'part.stl')
+})
diff --git a/store/agents/openscad/toolchain/doctor.sh b/store/agents/openscad/toolchain/doctor.sh
new file mode 100755
index 000000000..a1bdef64c
--- /dev/null
+++ b/store/agents/openscad/toolchain/doctor.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Exit 0 when this machine can run the harness. Print one line per check; Harness shows them.
+set -u
+fail=0
+if [ -n "${OPENSCAD_BIN:-}" ] && [ -x "$OPENSCAD_BIN" ]; then
+ echo "ok openscad at $OPENSCAD_BIN"
+elif command -v openscad >/dev/null 2>&1; then
+ echo "ok openscad on PATH ($(command -v openscad))"
+elif [ -x "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD" ]; then
+ echo "ok openscad at /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"
+else
+ echo "miss openscad — run toolchain/setup.sh or install from https://openscad.org"
+ fail=1
+fi
+[ -d "$(dirname "$0")/../skills/openscad" ] && echo "ok openscad skill" || echo "warn openscad skill missing"
+exit $fail
diff --git a/store/agents/openscad/toolchain/init-workspace.sh b/store/agents/openscad/toolchain/init-workspace.sh
new file mode 100755
index 000000000..dd1e90504
--- /dev/null
+++ b/store/agents/openscad/toolchain/init-workspace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "OpenSCAD workspace ready — describe a part to model",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'OpenSCAD workspace initialized by %s\n' "${HARNESS_DSH:-openscad}" > .harness-initialized
diff --git a/store/agents/openscad/toolchain/node.sh b/store/agents/openscad/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/openscad/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/openscad/toolchain/runtimes.sh b/store/agents/openscad/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/openscad/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/openscad/toolchain/setup.sh b/store/agents/openscad/toolchain/setup.sh
new file mode 100755
index 000000000..0c6aec582
--- /dev/null
+++ b/store/agents/openscad/toolchain/setup.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Install/verify OpenSCAD for this harness. cwd = the package install dir.
+# OpenSCAD is a desktop CLI; we detect an existing install, otherwise provide an explicit installation instruction.
+set -u
+
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+
+find_openscad() {
+ [ -z "${OPENSCAD_BIN:-}" ] || { [ -x "$OPENSCAD_BIN" ] && { echo "$OPENSCAD_BIN"; return 0; }; }
+ command -v openscad 2>/dev/null && return 0
+ [ -x "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD" ] && { echo "/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD"; return 0; }
+ return 1
+}
+
+if bin=$(find_openscad); then
+ echo "ok openscad at $bin"
+ ln -sf "$bin" "$dsh/toolchain/openscad-cli" 2>/dev/null || true
+ exit 0
+fi
+
+echo "miss openscad — install OpenSCAD from https://openscad.org or set OPENSCAD_BIN, then re-run setup."
+exit 1
diff --git a/store/agents/orca-slicer/.gitignore b/store/agents/orca-slicer/.gitignore
new file mode 100644
index 000000000..2c84b6205
--- /dev/null
+++ b/store/agents/orca-slicer/.gitignore
@@ -0,0 +1,7 @@
+# Sliced output — never source.
+part.gcode
+*.gcode
+# Harness bookkeeping.
+.harness/
+.harness-initialized
+toolchain/slicer-cli
diff --git a/store/agents/orca-slicer/AGENTS.md b/store/agents/orca-slicer/AGENTS.md
new file mode 100644
index 000000000..a21fa30eb
--- /dev/null
+++ b/store/agents/orca-slicer/AGENTS.md
@@ -0,0 +1,18 @@
+# Orca Slicer harness
+
+Read the `orcaslicer` skill. Use `slice-config.json` as the executable profile
+contract and `model.stl` as the input mesh. Build with:
+
+```sh
+sh "$ORCA_SKILLS/orcaslicer/scripts/slice-part.sh"
+```
+
+Show the actual toolpath in `preview.html`. Inspect the first layer, layer stack,
+travel/custom moves, speed coloring, slicer estimates and recorded profile inputs.
+The default Prusa profile is a labeled demo, never a claim about the user's printer.
+Ask for the actual machine and material before preparing a hardware-specific file.
+
+`ready` means freshly sliced and parsed, not watertight, collision-free, printable,
+or print-tested. Never fake a successful receipt, select an old G-code by mtime,
+or substitute PrusaSlicer for OrcaSlicer's different CLI. Preserve old artifacts on
+failure but write a new failed verdict. Do not print, upload, or run post-processors.
diff --git a/store/agents/orca-slicer/LICENSE b/store/agents/orca-slicer/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/orca-slicer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/orca-slicer/PROVENANCE.md b/store/agents/orca-slicer/PROVENANCE.md
new file mode 100644
index 000000000..6abef00b6
--- /dev/null
+++ b/store/agents/orca-slicer/PROVENANCE.md
@@ -0,0 +1,13 @@
+# Provenance
+
+The wrapper, linear G-code parser, Strata inspector and fluted-vessel SCAD/STL
+starter are original OpenHarness work, licensed under the included MIT license.
+
+[OrcaSlicer](https://github.com/OrcaSlicer/OrcaSlicer) is a separately installed
+AGPL-3.0 project derived from PrusaSlicer. No slicer binaries, source code or
+printer/material profiles are redistributed in this package. Demo builds load
+the named profiles from the user's OrcaSlicer installation and record the resolved
+settings in the workspace. Tested with version 2.4.2.
+
+The STL was generated from the included original model.scad using OpenSCAD
+2021.01. It is a demonstration model, not a certified manufacturable product.
diff --git a/store/agents/orca-slicer/README.md b/store/agents/orca-slicer/README.md
new file mode 100644
index 000000000..9c787af02
--- /dev/null
+++ b/store/agents/orca-slicer/README.md
@@ -0,0 +1,61 @@
+# Orca Slicer · Strata
+
+Turn a mesh into a toolpath you can actually inspect. Strata shows the real linear
+moves from OrcaSlicer: scrub 240 layers of the included fluted vessel, orbit the
+stack, isolate a layer, show travel and purge paths, or color by speed.
+
+## First run
+
+Install `autonomous/orca-slicer` from the Harness Store. Install
+[OrcaSlicer 2.4.2](https://github.com/OrcaSlicer/OrcaSlicer/releases) separately,
+then run the harness doctor. Set `ORCA_BIN` for a nonstandard binary.
+The included model and **demo** profiles make a local toolpath study:
+
+```sh
+sh "$ORCA_SKILLS/orcaslicer/scripts/slice-part.sh"
+```
+
+The build produces `part.gcode`, `preview.html`, and a fresh verdict. The default
+Prusa MK3S / 0.4 mm / PLA profile is **not your printer**. Do not send this G-code
+to hardware until you have reviewed the exact machine, filament, temperatures,
+bed origin, first layer and all machine-specific commands in OrcaSlicer.
+
+## Make it yours
+
+Ask: “Adapt this dry-use vessel to 70 mm tall, compare two layer heights, and
+explain the time/filament tradeoff. Do not print it.”
+
+Edit `slice-config.json`, not the descriptive `print-config.md`. Demo profile
+paths resolve against the installed Orca profiles directory; on Linux or a
+nonstandard install set `ORCA_PROFILES_DIR`. Custom mode takes three exported JSON
+profiles, relative to the workspace or absolute. Put inherited parent JSON files
+beside their children; the builder resolves the explicit chain and records the
+flattened settings in `.harness/*-resolved.json`. Missing parents fail rather
+than silently substituting defaults. The model must be an STL inside the workspace.
+
+The original `model.scad` is included alongside its generated STL. Edit it with
+OpenSCAD, re-export the mesh, then re-slice. This harness does not run a CAD build
+automatically.
+
+## What is verified
+
+A new OrcaSlicer process must succeed and produce exactly one fresh, nonempty
+G-code plate with linear extrusion paths. Failed builds clear readiness and
+preserve the previous preview. Logs and receipts live in `.harness/`.
+The starter was sliced with OrcaSlicer 2.4.2 and inspected in a real browser.
+Unit tests additionally cover parsing, profile inheritance and failed builds.
+
+The inspector supports single-tool linear G0/G1 paths, coordinate/extrusion
+modes, resets and units. Arc fitting and post-processing are disabled for this
+workflow. Curved/multitool paths fail explicitly. Travel-only Z-hop heights are
+omitted from the layer list. Custom/purge moves are hidden in model focus by
+default; enable them to inspect the full extent. Estimates come from the slicer,
+not a timed print. No mesh-manifold, collision, thermal, firmware or structural
+safety certification is implied. Nothing is uploaded, printed or connected.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/orca-slicer/harness.json b/store/agents/orca-slicer/harness.json
new file mode 100644
index 000000000..59561665d
--- /dev/null
+++ b/store/agents/orca-slicer/harness.json
@@ -0,0 +1,31 @@
+{
+ "spec": 1,
+ "id": "autonomous/orca-slicer",
+ "name": "Orca Slicer",
+ "category": "Fabrication",
+ "author": "OpenHarness contributors",
+ "description": "Describe a part to print; get G-code \u2014 a printable mesh sliced to your printer's profile, with a print summary (time, filament, layers) live in the pane.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "model.stl",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": ["skills"],
+ "env": {
+ "ORCA_TOOLCHAIN": "${dsh}/toolchain",
+ "ORCA_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [".html", ".gcode"]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/orca-slicer/package.json b/store/agents/orca-slicer/package.json
new file mode 100644
index 000000000..a9ef8f7d4
--- /dev/null
+++ b/store/agents/orca-slicer/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/orca-slicer-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/orca-slicer/skills/orcaslicer/SKILL.md b/store/agents/orca-slicer/skills/orcaslicer/SKILL.md
new file mode 100644
index 000000000..5fa9310b8
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/SKILL.md
@@ -0,0 +1,44 @@
+---
+name: orcaslicer
+description: Slice an STL with explicit OrcaSlicer JSON profiles and inspect actual G-code layers, travel, features and speeds. Use for Orca Slicer harness work.
+---
+
+# Strata workflow
+
+1. Inspect the mesh dimensions and intended use. The included fluted vessel is an
+ original dry-use demo, not a food-safe or pressure-rated design.
+2. Set `slice-config.json`: mode `demo` loads the specified installed Orca
+ profiles; `custom` loads explicit workspace-relative or absolute JSON files.
+ Required keys: `model`, `printer`, `process`, `filament`. Parent profiles
+ must be sibling JSON files. Notes in `print-config.md` do not change settings.
+3. Run the real build:
+
+ ```sh
+ sh "$ORCA_SKILLS/orcaslicer/scripts/slice-part.sh"
+ ```
+
+4. Inspect `.harness/slice.log`, `slice.json` and the three resolved profile
+ files. Open `preview.html`: scrub layers, isolate one, inspect first-layer
+ travel and enable custom/purge moves (hidden by default for model focus).
+5. Review the exact G-code and profiles in OrcaSlicer before any proposed print.
+ Report slicer estimates as estimates and unsupported preview behavior plainly.
+
+## Runtime and limits
+
+Tested with OrcaSlicer 2.4.2. Set `ORCA_BIN` and, if needed,
+`ORCA_PROFILES_DIR`. PrusaSlicer is not a compatible fallback. The builder uses
+a fresh temporary output directory, explicit flattened profiles, disables arc
+fitting and post-processing, and requires one fresh plate. No machine connection
+is made. Builds fail closed; an old preview is not a new successful build.
+
+The linear single-tool inspector handles G0/G1, G20/G21, G90/G91, M82/M83 and G92.
+Curves and multiple tools are rejected. Firmware retraction, leveling, offsets,
+collisions and material behavior are not simulated. Travel-only heights are not
+extrusion layers. Maximum preview: 32 MiB text and 250,000 linear moves.
+
+## Verification language
+
+Ready means “sliced and parsed,” not “safe to print.” The helper does not establish
+watertightness, support adequacy or printer compatibility. Do not assert those
+properties without independent evidence. Do not upload or print without explicit
+user authorization. Preserve the editable mesh source and exact profile inputs.
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/build.mjs b/store/agents/orca-slicer/skills/orcaslicer/scripts/build.mjs
new file mode 100644
index 000000000..e0278ccbc
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/build.mjs
@@ -0,0 +1,41 @@
+import {access,readFile,writeFile,mkdir,mkdtemp,readdir,rename,copyFile,rm,stat} from 'node:fs/promises';
+import {constants} from 'node:fs';import {spawnSync} from 'node:child_process';import {resolve,join,dirname,isAbsolute,relative} from 'node:path';
+import {parseGcode} from './gcode.mjs';
+import {resolveProfile} from './profiles.mjs';
+const ws=resolve(process.env.HARNESS_WORKSPACE||process.cwd()),meta=join(ws,'.harness');await mkdir(meta,{recursive:true});
+const verdict=async(ready,summary,findings=[])=>writeFile(join(meta,'verdict.json'),JSON.stringify({spec:1,ready,summary,findings,artifact:ready?'preview.html':null,updatedAt:new Date().toISOString()},null,2)+'\n');
+await verdict(false,'Loading explicit slicer profiles…');let stage,log='';
+try{
+ const config=JSON.parse(await readFile(join(ws,'slice-config.json'),'utf8'));
+ if(!['demo','custom'].includes(config.mode))throw new Error('slice-config.json mode must be demo or custom.');
+ let bin=process.env.ORCA_BIN;if(!bin){bin=spawnSync('/bin/sh',['-c','command -v orca-slicer || command -v orcaslicer'],{encoding:'utf8'}).stdout.trim()||'/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer';}
+ await access(bin,constants.X_OK).catch(()=>{throw new Error('OrcaSlicer not found. Install OrcaSlicer 2.4.2 or set ORCA_BIN. PrusaSlicer is not a CLI substitute.');});
+ const profiles=process.env.ORCA_PROFILES_DIR||resolve(dirname(bin),'../Resources/profiles');
+ stage=await mkdtemp(join(meta,'slice-'));
+ const settings=[],resolvedProfiles={};
+ for(const key of ['printer','process','filament']){
+ if(typeof config[key]!=='string'||!config[key]||config[key].includes(';'))throw new Error('Provide one '+key+' JSON profile in slice-config.json.');
+ const path=resolve(config.mode==='demo'?profiles:ws,config[key]);
+ const profile=await resolveProfile(path);
+ const flat=join(stage,key+'.json');await writeFile(flat,JSON.stringify(profile,null,2));settings.push(flat);resolvedProfiles[key]=profile;
+ }
+ if(typeof config.model!=='string'||!config.model.toLowerCase().endsWith('.stl'))throw new Error('This workflow slices one STL mesh; specify model in slice-config.json.');
+ const model=resolve(ws,config.model),rel=relative(ws,model);if(isAbsolute(rel)||rel.startsWith('..'))throw new Error('The mesh must be inside this workspace.');await access(model);
+ const output=join(stage,'out');await mkdir(output);
+ const args=['--slice','0','--arrange','1','--ensure-on-bed','--load-settings',settings.slice(0,2).join(';'),'--load-filaments',settings[2],'--outputdir',output,'--enable-arc-fitting=0','--post-process','',model];
+ const result=spawnSync(bin,args,{cwd:stage,encoding:'utf8',timeout:240000,maxBuffer:16*1024*1024});log=(result.stdout||'')+(result.stderr||'');
+ if(result.error||result.status!==0)throw new Error(result.error?.message||'OrcaSlicer failed; inspect .harness/slice.log.');
+ const files=(await readdir(output)).filter(name=>name.endsWith('.gcode'));
+ if(files.length!==1)throw new Error('Expected exactly one freshly sliced G-code plate; got '+files.length+'.');
+ const gcode=await readFile(join(output,files[0]),'utf8'),parsed=parseGcode(gcode);
+ const data={...parsed,config,at:new Date().toISOString(),bytes:Buffer.byteLength(gcode)};
+ const template=await readFile(new URL('preview.html',import.meta.url),'utf8'),app=await readFile(new URL('preview.js',import.meta.url),'utf8');
+ const safe=JSON.stringify(data).replace(/</g,'\\u003c').replace(/\u2028/g,'\\u2028').replace(/\u2029/g,'\\u2029');
+ await writeFile(join(stage,'preview.html'),template.replace('__CONFIG__',()=>safe).replace('/*APP*/',()=>app));
+ await copyFile(join(output,files[0]),join(stage,'part.gcode'));await rename(join(stage,'part.gcode'),join(ws,'part.gcode'));await rename(join(stage,'preview.html'),join(ws,'preview.html'));
+ await writeFile(join(meta,'slice.json'),JSON.stringify({config,stats:parsed.stats,layers:parsed.layers.length,moves:parsed.moves,warnings:parsed.warnings},null,2)+'\n');
+ for(const [key,profile]of Object.entries(resolvedProfiles))await writeFile(join(meta,key+'-resolved.json'),JSON.stringify(profile,null,2)+'\n');
+ await verdict(true,parsed.layers.length+' extrusion heights inspected · not print-tested',[{severity:'warning',kind:'safety',message:config.mode==='demo'?'Demo Prusa profile, not your printer. Do not print this file until printer, material, temperatures and geometry are reviewed.':'A sliced file is not a safety or printability certificate. Review machine-specific G-code in OrcaSlicer before printing.'},...parsed.warnings.map(message=>({severity:'info',kind:'preview',message}))]);
+ console.log('ok '+parsed.layers.length+' extrusion heights → part.gcode + preview.html');
+}catch(error){await verdict(false,'Slice failed',[{severity:'error',kind:'slice',message:error.message}]);console.error(error.message);process.exitCode=1;}
+finally{await writeFile(join(meta,'slice.log'),log);if(stage)await rm(stage,{recursive:true,force:true});}
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/gcode.mjs b/store/agents/orca-slicer/skills/orcaslicer/scripts/gcode.mjs
new file mode 100644
index 000000000..bd97d6417
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/gcode.mjs
@@ -0,0 +1,46 @@
+// Linear FDM toolpaths, in millimetres. Rendering is inspection, not printer validation.
+export function parseGcode(source){
+ if(typeof source!=='string'||source.length>32*1024*1024)throw new Error('G-code must be text under 32 MiB.');
+ const layers=[],map=new Map(),features=[],warnings=new Set();
+ let pos=[0,0,0],offset=[0,0,0],e=0,absolute=true,absoluteE=true,unit=1,feed=0,feature='Custom',lineNumber=0,moves=0;
+ const stats={time:null,filamentMm:null,filamentGrams:null,sourceLayers:null};
+ const bounds={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]};
+ const modelBounds={min:[Infinity,Infinity,Infinity],max:[-Infinity,-Infinity,-Infinity]};
+ const layerAt=z=>{const key=Math.round(z*10000)/10000;if(!map.has(key)){const layer={z:key,segments:[],extrusionMm:0};map.set(key,layer);layers.push(layer);}return map.get(key);};
+ for(const raw of source.split(/\r?\n/)){
+ lineNumber++;
+ let match=raw.match(/^;\s*(?:TYPE|FEATURE):\s*(.+)/i);if(match)feature=match[1].trim();
+ match=raw.match(/^;\s*estimated printing time \(normal mode\)\s*=\s*(.+)/i);if(match)stats.time=match[1].trim();
+ match=raw.match(/^;\s*total layer number:\s*(\d+)/i);if(match)stats.sourceLayers=Number(match[1]);
+ match=raw.match(/^;\s*total filament used \[mm\]\s*=\s*([\d.]+)/i);if(match)stats.filamentMm=Number(match[1]);
+ match=raw.match(/^;\s*total filament used \[g\]\s*=\s*([\d.]+)/i);if(match)stats.filamentGrams=Number(match[1]);
+ const code=raw.split(';')[0].replace(/\([^)]*\)/g,'').trim().toUpperCase();if(!code)continue;
+ const command=code.match(/^(?:N\d+\s*)?([GMT]\d+(?:\.\d+)?)/)?.[1];if(!command)continue;
+ const params=Object.fromEntries([...code.matchAll(/([XYZEF])\s*([-+]?(?:\d*\.)?\d+)/g)].map(m=>[m[1],Number(m[2])]));
+ if(command==='G20'){unit=25.4;continue;}if(command==='G21'){unit=1;continue;}
+ if(command==='G90'){absolute=true;absoluteE=true;continue;}if(command==='G91'){absolute=false;absoluteE=false;continue;}
+ if(command==='M82'){absoluteE=true;continue;}if(command==='M83'){absoluteE=false;continue;}
+ if(command==='G92'){for(const [i,axis]of ['X','Y','Z'].entries())if(params[axis]!==undefined)offset[i]=pos[i]-params[axis]*unit;if(params.E!==undefined)e=params.E*unit;continue;}
+ if(['G2','G02','G3','G03','G5'].includes(command))throw new Error('Curved moves at line '+lineNumber+' are not modeled. Disable arc fitting and re-slice.');
+ if(command==='G28'){warnings.add('Homing assumed to establish the machine origin; firmware offsets and bed leveling are not modeled.');continue;}
+ if(/^T\d/.test(command)&&command!=='T0')throw new Error('Multiple tools are not modeled. Use a single-tool G-code file.');
+ if(!['G0','G00','G1','G01'].includes(command))continue;
+ if(params.F!==undefined)feed=params.F*unit;
+ const next=pos.map((value,i)=>params[['X','Y','Z'][i]]===undefined?value:absolute?params[['X','Y','Z'][i]]*unit+offset[i]:value+params[['X','Y','Z'][i]]*unit);
+ const nextE=params.E===undefined?e:absoluteE?params.E*unit:e+params.E*unit,deltaE=nextE-e;
+ if([...next,nextE,feed].some(v=>!Number.isFinite(v)||Math.abs(v)>1e7))throw new Error('Invalid coordinate at line '+lineNumber);
+ if(Math.hypot(...next.map((v,i)=>v-pos[i]))>0.00001){
+ if(++moves>250000)throw new Error('Preview supports at most 250,000 linear moves.');
+ const extrude=deltaE>0.00001;
+ if(!features.includes(feature))features.push(feature);
+ const layer=layerAt(next[2]);
+ layer.segments.push([...pos,...next,feed/60,features.indexOf(feature),extrude?1:0,lineNumber]);
+ if(extrude){layer.extrusionMm+=deltaE;for(const point of [pos,next])for(let i=0;i<3;i++){bounds.min[i]=Math.min(bounds.min[i],point[i]);bounds.max[i]=Math.max(bounds.max[i],point[i]);if(feature!=='Custom'){modelBounds.min[i]=Math.min(modelBounds.min[i],point[i]);modelBounds.max[i]=Math.max(modelBounds.max[i],point[i]);}}}
+ }
+ pos=next;e=nextE;
+ }
+ const printed=layers.filter(layer=>layer.extrusionMm>0).sort((a,b)=>a.z-b.z);
+ if(!printed.length)throw new Error('No linear extrusion paths found.');
+ if(layers.some(layer=>layer.extrusionMm===0))warnings.add('Travel-only heights are omitted from the layer list (including Z hops and final parking).');
+ return {layers:printed,features,bounds,modelBounds:Number.isFinite(modelBounds.min[0])?modelBounds:bounds,stats,moves,warnings:[...warnings],lines:lineNumber};
+}
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.html b/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.html
new file mode 100644
index 000000000..00c1191af
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.html
@@ -0,0 +1,5 @@
+<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Strata · Toolpath inspector</title><link rel="icon" href="data:,">
+<style>
+*{box-sizing:border-box}body{margin:0;background:#151a20;color:#e2e9e8;font-family:Arial,sans-serif}header{display:flex;justify-content:space-between;align-items:center;padding:23px 32px;border-bottom:1px solid #354047}.brand{font:28px Georgia,serif;letter-spacing:-.8px}.brand span{color:#efa275;margin-right:12px}.mono{font:10px monospace;letter-spacing:1.6px;color:#9daeb1}main{max-width:1550px;margin:auto;padding:30px 32px}.intro{display:flex;align-items:end;justify-content:space-between;margin-bottom:28px;gap:20px}h1{font:normal 38px Georgia,serif;letter-spacing:-1px;margin:10px 0}p{font-size:12px;line-height:1.65;color:#91a3a9;margin:0}a{color:#ffd0a2;font-size:12px;text-decoration:none;padding:11px 16px;border:1px solid #745b4e;border-radius:7px;white-space:nowrap}.layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:24px}.view{position:relative;min-width:0;background:radial-gradient(ellipse at 50% 40%,#21313a,#10171e 70%);border:1px solid #34444d;border-radius:14px;overflow:hidden}.view-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;position:absolute;inset:0 0 auto;z-index:1}.group{display:flex;gap:5px}button,select,input{font:inherit}button,select{background:#1c2b32;color:#bdd0d1;border:1px solid #42545a;border-radius:6px;padding:8px 11px;font-size:11px;cursor:pointer}button[aria-pressed=true]{color:#f4be8b;border-color:#b68b66;background:#35352f}button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid #f4be8b;outline-offset:3px}canvas{display:block;width:100%;height:590px;touch-action:none}.hint{position:absolute;bottom:18px;left:20px;font:9px monospace;letter-spacing:1px;color:#6f8e99}.metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px}.metric{border:1px solid #35434b;border-radius:9px;padding:17px 14px;background:#1a232a}.metric b{font:23px Georgia,serif;display:block;margin-top:10px}.metric span{font:9px monospace;color:#8ea2a9}.metric.wide{grid-column:1/-1}.panel{margin-top:21px;border-top:1px solid #35434b;padding-top:20px}.panel h2{font-size:12px;font-weight:400;margin:0 0 16px;color:#b7c7c8}.layer{font:37px Georgia,serif;color:#f0bf91}.layer small{font-size:18px;color:#738a93}input[type=range]{width:100%;accent-color:#e6ac79;margin:18px 0 10px}label{font:10px monospace;color:#93a8af}.controls{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:13px}.controls select{width:125px}.legend{display:grid;gap:8px;margin-top:18px;font:10px monospace;color:#8fa5ac}.legend span{display:flex;gap:8px;align-items:center}.dot{width:7px;height:7px;border-radius:50%;display:inline-block}.notice{margin-top:22px;background:#2a2623;border:1px solid #5c483c;border-radius:9px;padding:16px 18px;color:#cdb093;font:11px/1.6 Arial,sans-serif}details{margin-top:17px;font:11px/1.7 monospace;color:#819ba7}summary{cursor:pointer}pre{white-space:pre-wrap;overflow-wrap:anywhere}footer{display:flex;justify-content:space-between;font:10px monospace;color:#77909b;padding-top:20px;gap:20px}@media(max-width:1000px){.layout{grid-template-columns:1fr 235px}canvas{height:520px}}@media(max-width:650px){header,main{padding:20px}.layout{grid-template-columns:1fr}h1{font-size:31px}.intro{align-items:start;flex-direction:column}canvas{height:370px}.metrics{grid-template-columns:repeat(3,1fr)}.metric.wide{grid-column:auto}.metric{padding:12px 9px}.metric b{font-size:20px}.panel{margin-top:16px}.view-head{padding:13px 10px}.mono{font-size:8px}footer{font-size:9px}}
+</style>
+<header><div class="brand"><span>≋</span>Strata</div><div class="mono">ORCA SLICER / TOOLPATH INSPECTOR</div></header><main><div class="intro"><div><div class="mono">FROM A SOLID TO A SEQUENCE</div><h1>See what your printer will do.</h1><p>Actual linear moves from the sliced G-code. Explore one layer, or the stack beneath it.</p></div><a href="part.gcode" download>Download G-code ↓</a></div><div class="layout"><section class="view"><div class="view-head"><div class="group"><button id="iso" aria-pressed="true">Isometric</button><button id="top" aria-pressed="false">Top</button><button id="reset">Fit</button></div><span class="mono" id="z-label"></span></div><canvas id="path" tabindex="0" role="img" aria-label="Interactive G-code toolpath. Drag to orbit; scroll to zoom."></canvas><span class="hint">MODEL FOCUS · CUSTOM MOVES HIDDEN UNLESS ENABLED</span></section><aside><div class="metrics"><div class="metric"><span>EXTRUSION HEIGHTS</span><b id="layers"></b></div><div class="metric"><span>SLICER ESTIMATE</span><b id="time"></b></div><div class="metric wide"><span>FILAMENT ESTIMATE</span><b id="filament"></b></div></div><section class="panel"><h2>Layer by layer</h2><div class="layer"><span id="layer-label"></span> <small id="total-label"></small></div><input id="layer" type="range" min="1" value="1" aria-label="Layer"><div class="controls"><button id="previous" aria-label="Previous layer">←</button><button id="play" aria-pressed="false">Play layers</button><button id="next" aria-label="Next layer">→</button></div><div class="controls"><label><input id="stack" type="checkbox" checked> Show stack</label><label><input id="travel" type="checkbox"> Travel</label></div><div class="controls"><label><input id="custom" type="checkbox"> Include custom / purge moves</label></div><div class="controls"><label for="color">Color by</label><select id="color"><option value="feature">Feature</option><option value="speed">Speed</option></select></div><div class="legend" id="legend"></div></section></aside></div><div class="notice" id="notice"></div><details><summary>Profile inputs and preview limits</summary><pre id="config-view"></pre><ul id="warnings"></ul></details><footer><span id="moves"></span><span>LOCAL SLICE · NO PRINTER CONNECTED</span></footer></main><script type="application/json" id="config">__CONFIG__</script><script>/*APP*/</script></html>
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.js b/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.js
new file mode 100644
index 000000000..bf8fd439e
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/preview.js
@@ -0,0 +1,31 @@
+const $=id=>document.getElementById(id),data=JSON.parse($('config').textContent),canvas=$('path'),g=canvas.getContext('2d');
+const palette=['#edb783','#b5d6c1','#73b8bd','#d4cf94','#d68b8e','#8aa9d8','#b49acc'];
+let layer=Math.max(1,Math.round(data.layers.length*.7)),yaw=.6,pitch=.65,zoom=1,topView=false,timer=null,drag;
+$('layers').textContent=data.layers.length;$('time').textContent=data.stats.time||'Not reported';$('filament').textContent=data.stats.filamentGrams!==null?data.stats.filamentGrams.toFixed(1)+' g':data.stats.filamentMm!==null?(data.stats.filamentMm/1000).toFixed(2)+' m':'Not reported';$('layer').max=data.layers.length;$('layer').value=layer;$('total-label').textContent='/ '+data.layers.length;$('config-view').textContent=JSON.stringify(data.config,null,2);$('moves').textContent=data.moves.toLocaleString()+' LINEAR MOVES PARSED';
+$('notice').textContent=data.config.mode==='demo'?'DEMO PROFILE — Prusa MK3S, not your printer. This is a toolpath study, not a print-ready recommendation. Review the exact machine, material, temperatures, origin and first layer before printing.':'Sliced, not print-tested. Review machine-specific G-code, temperatures, bed boundaries and the first layer in OrcaSlicer before printing.';
+for(const text of [...data.warnings,'Geometry preview does not model heater behavior, firmware limits, offsets, bed leveling, collisions, supports adequacy or mechanical printability.']){const li=document.createElement('li');li.textContent=text;$('warnings').append(li);}
+function legend(){
+ $('legend').replaceChildren();for(const [i,name]of ($('color').value==='speed'?['≤20 mm/s','100 mm/s','≥180 mm/s']:data.features).entries()){const row=document.createElement('span'),dot=document.createElement('i');dot.className='dot';dot.style.background=$('color').value==='speed'?['#8ac5df','#bdd495','#e69a6c'][i]:palette[i%palette.length];row.append(dot,document.createTextNode(name));$('legend').append(row);}
+}
+function draw(){
+ const width=canvas.clientWidth,height=canvas.clientHeight,ratio=Math.min(devicePixelRatio||1,2);canvas.width=width*ratio;canvas.height=height*ratio;g.scale(ratio,ratio);g.clearRect(0,0,width,height);
+ const bounds=$('custom').checked?data.bounds:(data.modelBounds||data.bounds),center=bounds.min.map((v,i)=>(v+bounds.max[i])/2),span=Math.max(1,...bounds.max.map((v,i)=>v-bounds.min[i]));const scale=Math.min(width-80,height-110)/span*.85*zoom;
+ const project=p=>{const x=p[0]-center[0],y=p[1]-center[1],z=p[2]-center[2];if(topView)return [width/2+x*scale,height/2-y*scale];const xx=x*Math.cos(yaw)-y*Math.sin(yaw),yy=x*Math.sin(yaw)+y*Math.cos(yaw);return [width/2+xx*scale,height/2+(yy*Math.sin(pitch)-z*Math.cos(pitch))*scale];};
+ const segment=(a,b)=>{const p=project(a),q=project(b);g.moveTo(...p);g.lineTo(...q);};
+ g.lineWidth=.7;g.strokeStyle='#46636a35';g.beginPath();for(let i=-5;i<=5;i++){const v=i*span/10;segment([center[0]-span/2,center[1]+v,0],[center[0]+span/2,center[1]+v,0]);segment([center[0]+v,center[1]-span/2,0],[center[0]+v,center[1]+span/2,0]);}g.stroke();
+ let displayed=0;const start=$('stack').checked?0:layer-1;
+ for(let l=start;l<layer;l++){
+ const active=l===layer-1,groups=new Map();
+ for(const s of data.layers[l].segments){if((!s[8]&&!$('travel').checked)||(!$('custom').checked&&data.features[s[7]]==='Custom'))continue;const color=!s[8]?'#677d8744':!active?'#86abb033':$('color').value==='speed'?'hsl('+Math.max(20,205-s[6]*1.05)+',48%,66%)':palette[s[7]%palette.length];if(!groups.has(color))groups.set(color,[]);groups.get(color).push(s);displayed++;}
+ for(const [color,segments]of groups){g.strokeStyle=color;g.lineWidth=active?1.35:.6;g.beginPath();for(const s of segments)segment(s.slice(0,3),s.slice(3,6));g.stroke();}
+ }
+ $('layer-label').textContent=layer;$('z-label').textContent='Z '+data.layers[layer-1].z.toFixed(2)+' MM';canvas.dataset.layer=String(layer);canvas.dataset.segments=String(displayed);canvas.dataset.projection=topView?'top':'isometric';$('previous').disabled=layer===1;$('next').disabled=layer===data.layers.length;
+}
+function setLayer(value){layer=Math.max(1,Math.min(data.layers.length,Number(value)));$('layer').value=layer;draw();}
+$('layer').oninput=()=>setLayer($('layer').value);$('previous').onclick=()=>setLayer(layer-1);$('next').onclick=()=>setLayer(layer+1);
+function stop(){clearInterval(timer);timer=null;$('play').textContent='Play layers';$('play').setAttribute('aria-pressed','false');}
+$('play').onclick=()=>{if(timer){stop();return;}$('play').textContent='Pause';$('play').setAttribute('aria-pressed','true');timer=setInterval(()=>{if(layer===data.layers.length){stop();return;}setLayer(layer+1);},120);};
+for(const id of ['iso','top'])$(id).onclick=()=>{topView=id==='top';$('iso').setAttribute('aria-pressed',String(!topView));$('top').setAttribute('aria-pressed',String(topView));draw();};
+$('reset').onclick=()=>{yaw=.6;pitch=.65;zoom=1;draw();};for(const id of ['stack','travel','color','custom'])$(id).onchange=()=>{legend();draw();};
+canvas.onpointerdown=e=>{canvas.setPointerCapture(e.pointerId);drag={x:e.clientX,y:e.clientY};};canvas.onpointermove=e=>{if(!drag)return;yaw+=(e.clientX-drag.x)*.009;pitch=Math.max(.1,Math.min(1.5,pitch+(e.clientY-drag.y)*.007));drag={x:e.clientX,y:e.clientY};draw();};canvas.onpointerup=canvas.onpointercancel=()=>{drag=null;};canvas.addEventListener('wheel',e=>{e.preventDefault();zoom=Math.max(.3,Math.min(6,zoom*Math.exp(-e.deltaY*.001)));draw();},{passive:false});canvas.onkeydown=e=>{if(e.key==='ArrowRight'||e.key==='ArrowLeft'){e.preventDefault();setLayer(layer+(e.key==='ArrowRight'?1:-1));}};
+new ResizeObserver(draw).observe(canvas);document.addEventListener('visibilitychange',()=>{if(document.hidden)stop();});legend();draw();
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/profiles.mjs b/store/agents/orca-slicer/skills/orcaslicer/scripts/profiles.mjs
new file mode 100644
index 000000000..2c0f1777c
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/profiles.mjs
@@ -0,0 +1,15 @@
+import {readFile} from 'node:fs/promises';import {resolve,dirname,basename} from 'node:path';
+// Orca's CLI does not reliably flatten shipped profile inheritance. Resolve the
+// explicit sibling chain ourselves; never silently substitute unrelated defaults.
+export async function resolveProfile(file,chain=[]){
+ const path=resolve(file);if(chain.includes(path)||chain.length>=20)throw new Error('Cyclic or overly deep profile inheritance.');
+ const value=JSON.parse(await readFile(path,'utf8'));
+ if(!value||Array.isArray(value)||typeof value!=='object'||typeof value.name!=='string')throw new Error('Invalid profile: '+basename(path));
+ let parent={};
+ if(value.inherits){
+ if(typeof value.inherits!=='string'||basename(value.inherits)!==value.inherits||value.inherits.includes('\\'))throw new Error('Profile parent must be a sibling profile name.');
+ const parentFile=resolve(dirname(path),value.inherits+'.json');
+ try{parent=await resolveProfile(parentFile,[...chain,path]);}catch(error){throw new Error('Cannot resolve '+value.name+' parent '+value.inherits+': '+error.message);}
+ }
+ const merged={...parent,...value,instantiation:'true'};delete merged.inherits;return merged;
+}
diff --git a/store/agents/orca-slicer/skills/orcaslicer/scripts/slice-part.sh b/store/agents/orca-slicer/skills/orcaslicer/scripts/slice-part.sh
new file mode 100755
index 000000000..1b2aaa404
--- /dev/null
+++ b/store/agents/orca-slicer/skills/orcaslicer/scripts/slice-part.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+here="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
+exec bash "$here/../../../toolchain/node.sh" "$here/build.mjs"
diff --git a/store/agents/orca-slicer/store.json b/store/agents/orca-slicer/store.json
new file mode 100644
index 000000000..bc3378c90
--- /dev/null
+++ b/store/agents/orca-slicer/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://orca-slicer.pages.dev",
+ "upstream": "https://github.com/SoftFever/OrcaSlicer",
+ "license": "MIT",
+ "tagline": "An open-source slicer for FFF 3D printers",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/orca-slicer/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Slice the included vessel with the labeled demo profile and inspect its layers. Do not print it.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/orca-slicer/starter.jpg",
+ "caption": "Strata · real Orca G-code, 240 extrusion heights"
+ }
+ ]
+}
diff --git a/store/agents/orca-slicer/template/model.scad b/store/agents/orca-slicer/template/model.scad
new file mode 100644
index 000000000..d86e80685
--- /dev/null
+++ b/store/agents/orca-slicer/template/model.scad
@@ -0,0 +1,7 @@
+// Original small fluted vessel, for slicer exploration. Millimetres, dry use only.
+height=48; diameter=55; wall=2; base=2.4; ribs=18; twist=22; resolution=72;
+difference(){
+ linear_extrude(height=height,twist=twist,slices=24,convexity=10)
+ polygon([for(i=[0:resolution-1])let(a=i*360/resolution,r=diameter/2+1.5*(1+cos(ribs*a))/2)[r*cos(a),r*sin(a)]]);
+ translate([0,0,base])cylinder(h=height+0.1,r=diameter/2-wall,$fn=resolution);
+}
diff --git a/store/agents/orca-slicer/template/model.stl b/store/agents/orca-slicer/template/model.stl
new file mode 100644
index 000000000..0e6081e8e
Binary files /dev/null and b/store/agents/orca-slicer/template/model.stl differ
diff --git a/store/agents/orca-slicer/template/print-config.md b/store/agents/orca-slicer/template/print-config.md
new file mode 100644
index 000000000..0df3a1204
--- /dev/null
+++ b/store/agents/orca-slicer/template/print-config.md
@@ -0,0 +1,11 @@
+# Print intent
+
+The included fluted vessel and slice-config.json are a **demo for toolpath exploration**, not a recommendation for your printer. No printer is connected.
+
+The executable settings are the printer, process and filament JSON profiles named in slice-config.json. This Markdown file is notes only; changing it does not change the slice.
+
+For a real project, set mode to "custom", provide your OrcaSlicer-exported profile paths (relative to the workspace or absolute), and confirm printer model, nozzle, bed dimensions, firmware flavor, material temperatures, cooling, layer height, walls and supports. Inherited profiles must resolve in your installed OrcaSlicer. Do not copy the demo profile onto an unrelated printer.
+
+Run: `sh "$ORCA_SKILLS/orcaslicer/scripts/slice-part.sh"`
+
+The helper loads all three profiles explicitly, arranges one mesh onto the bed, disables arc fitting for the linear inspector, disables post-processing commands, and never uploads or prints. Review machine-specific start/end G-code and geometry in OrcaSlicer before printing.
diff --git a/store/agents/orca-slicer/template/slice-config.json b/store/agents/orca-slicer/template/slice-config.json
new file mode 100644
index 000000000..f217f9162
--- /dev/null
+++ b/store/agents/orca-slicer/template/slice-config.json
@@ -0,0 +1,7 @@
+{
+ "mode": "demo",
+ "model": "model.stl",
+ "printer": "Prusa/machine/Prusa MK3S 0.4 nozzle.json",
+ "process": "Prusa/process/0.20mm Standard @MK3S 0.4.json",
+ "filament": "Prusa/filament/Prusa Generic PLA.json"
+}
diff --git a/store/agents/orca-slicer/test/gcode.test.mjs b/store/agents/orca-slicer/test/gcode.test.mjs
new file mode 100644
index 000000000..eb68f2640
--- /dev/null
+++ b/store/agents/orca-slicer/test/gcode.test.mjs
@@ -0,0 +1,5 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {parseGcode} from '../skills/orcaslicer/scripts/gcode.mjs';
+test('absolute/relative modes, compact words, extrusion resets and speeds',()=>{const p=parseGcode('G21\nG90\nM82\nG0 X10 Y10 Z.2\nG1X20Y10E1F1200\nG92 E0\nM83\nG1 X20 Y20 E.5\nG91\nG1 X-10 E.5\n');assert.equal(p.layers.length,1);assert.equal(p.layers[0].extrusionMm,2);assert.deepEqual(p.layers[0].segments.at(-1).slice(3,6),[10,20,.2]);assert.equal(p.layers[0].segments.at(-1)[6],20);});
+test('G92 changes coordinate origin without moving geometry; inches convert to mm',()=>{const p=parseGcode('G20\nG90\nM83\nG0 X1 Y0 Z.01\nG92 X0\nG1 X1 E.1 F60\n');assert.equal(p.layers[0].segments.at(-1)[3],50.8);assert.ok(Math.abs(p.layers[0].segments.at(-1)[6]-25.4)<1e-6);});
+test('travel-only heights do not become printed layers; retractions do not extrude',()=>{const p=parseGcode('G90\nM83\nG0 Z.2\nG1 X10 E1\nG0 Z.6\nG0 X20\nG0 Z.2\nG1 X30 E-1\nG0 Z.4\nG1 X40 E1\n');assert.deepEqual(p.layers.map(l=>l.z),[.2,.4]);assert.equal(p.layers[0].segments.at(-1)[8],0);assert.match(p.warnings.join(' '),/Travel-only/);});
+test('arc, multitool and empty inputs cannot receive a misleading linear preview',()=>{assert.throws(()=>parseGcode('G2 X3 Y2 E1'),/Curved/);assert.throws(()=>parseGcode('T1\nG1 X10 E1'),/Multiple tools/);assert.throws(()=>parseGcode('G0 X10'),/No linear extrusion/);});
diff --git a/store/agents/orca-slicer/test/toolchain.test.mjs b/store/agents/orca-slicer/test/toolchain.test.mjs
new file mode 100644
index 000000000..6f1d3d780
--- /dev/null
+++ b/store/agents/orca-slicer/test/toolchain.test.mjs
@@ -0,0 +1,35 @@
+// Transport fixtures test failure handling, not the native slicer's correctness.
+import {test} from 'node:test';
+import assert from 'node:assert/strict';
+import {mkdtemp,writeFile,readFile,rm,mkdir,cp,chmod} from 'node:fs/promises';
+import {tmpdir} from 'node:os';
+import {join} from 'node:path';
+import {spawnSync} from 'node:child_process';
+import {fileURLToPath} from 'node:url';
+import {resolveProfile} from '../skills/orcaslicer/scripts/profiles.mjs';
+const root=fileURLToPath(new URL('..',import.meta.url));
+test('profiles resolve sibling inheritance; missing and cyclic parents fail',async()=>{
+ const dir=await mkdtemp(join(tmpdir(),'orca-profiles-'));try{
+ await writeFile(join(dir,'base.json'),JSON.stringify({name:'base',temperature:['220'],density:['1.24']}));
+ await writeFile(join(dir,'child.json'),JSON.stringify({name:'child',inherits:'base',temperature:['210']}));
+ assert.deepEqual(await resolveProfile(join(dir,'child.json')),{name:'child',temperature:['210'],density:['1.24'],instantiation:'true'});
+ await writeFile(join(dir,'base.json'),JSON.stringify({name:'base',inherits:'child'}));
+ await assert.rejects(resolveProfile(join(dir,'child.json')),/Cyclic/);
+ await writeFile(join(dir,'child.json'),JSON.stringify({name:'child',inherits:'missing'}));
+ await assert.rejects(resolveProfile(join(dir,'child.json')),/Cannot resolve/);
+ await writeFile(join(dir,'child.json'),JSON.stringify({name:'child',inherits:'../escape'}));
+ await assert.rejects(resolveProfile(join(dir,'child.json')),/sibling/);
+ }finally{await rm(dir,{recursive:true,force:true});}
+});
+test('fresh output required; failure clears readiness and preserves previous artifacts',async()=>{
+ const dir=await mkdtemp(join(tmpdir(),'orca-build-'));try{
+ await cp(join(root,'template'),dir,{recursive:true});
+ for(const name of ['printer','process','filament'])await writeFile(join(dir,name+'.json'),JSON.stringify({name}));
+ await writeFile(join(dir,'slice-config.json'),JSON.stringify({mode:'custom',model:'model.stl',printer:'printer.json',process:'process.json',filament:'filament.json'}));
+ const binary=join(dir,'fixture');await writeFile(binary,'#!/bin/sh\nwhile [ "$#" -gt 0 ]; do if [ "$1" = "--outputdir" ]; then shift; out="$1"; fi; shift; done\nprintf "G90\\nM83\\nG0 Z.2\\n;TYPE:Outer wall\\nG1 X10 E1 F1200\\n" > "$out/fresh.gcode"\n');await chmod(binary,0o755);
+ const run=()=>spawnSync(process.execPath,[join(root,'skills/orcaslicer/scripts/build.mjs')],{cwd:dir,env:{...process.env,ORCA_BIN:binary,HARNESS_WORKSPACE:dir},encoding:'utf8'});
+ let result=run();assert.equal(result.status,0,result.stderr);const previous=await readFile(join(dir,'preview.html'),'utf8');assert.equal(JSON.parse(await readFile(join(dir,'.harness/verdict.json'))).ready,true);
+ await writeFile(binary,'#!/bin/sh\nexit 0\n');result=run();assert.equal(result.status,1);assert.equal(JSON.parse(await readFile(join(dir,'.harness/verdict.json'))).ready,false);assert.equal(await readFile(join(dir,'preview.html'),'utf8'),previous);
+ await writeFile(binary,'#!/bin/sh\nprintf \'quoted "failure"\\n\' >&2\nexit 2\n');result=run();assert.equal(result.status,1);assert.equal(JSON.parse(await readFile(join(dir,'.harness/verdict.json'))).artifact,null);
+ }finally{await rm(dir,{recursive:true,force:true});}
+});
diff --git a/store/agents/orca-slicer/toolchain/doctor.sh b/store/agents/orca-slicer/toolchain/doctor.sh
new file mode 100755
index 000000000..77db2ab4b
--- /dev/null
+++ b/store/agents/orca-slicer/toolchain/doctor.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -u
+here="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
+sh "$here/setup.sh"
diff --git a/store/agents/orca-slicer/toolchain/init-workspace.sh b/store/agents/orca-slicer/toolchain/init-workspace.sh
new file mode 100755
index 000000000..cbf78a8cc
--- /dev/null
+++ b/store/agents/orca-slicer/toolchain/init-workspace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Orca Slicer workspace ready — describe a part to print",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Orca Slicer workspace initialized by %s\n' "${HARNESS_DSH:-orca-slicer}" > .harness-initialized
diff --git a/store/agents/orca-slicer/toolchain/node.sh b/store/agents/orca-slicer/toolchain/node.sh
new file mode 100644
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/orca-slicer/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/orca-slicer/toolchain/runtimes.sh b/store/agents/orca-slicer/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/orca-slicer/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/orca-slicer/toolchain/setup.sh b/store/agents/orca-slicer/toolchain/setup.sh
new file mode 100755
index 000000000..fd78cded9
--- /dev/null
+++ b/store/agents/orca-slicer/toolchain/setup.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -u
+if [ -n "${ORCA_BIN:-}" ] && [ -x "$ORCA_BIN" ]; then echo "ok OrcaSlicer at $ORCA_BIN"; exit 0; fi
+if command -v orca-slicer >/dev/null 2>&1 || command -v orcaslicer >/dev/null 2>&1 || [ -x /Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer ]; then echo "ok OrcaSlicer found"; exit 0; fi
+echo "miss OrcaSlicer — install 2.4.2 from https://github.com/OrcaSlicer/OrcaSlicer/releases or set ORCA_BIN"
+echo "note PrusaSlicer has a different CLI and is not a substitute"
+exit 1
diff --git a/store/agents/quantum-studio/.gitignore b/store/agents/quantum-studio/.gitignore
new file mode 100644
index 000000000..989339130
--- /dev/null
+++ b/store/agents/quantum-studio/.gitignore
@@ -0,0 +1,4 @@
+# Generated pane — never source. Rebuild from circuit.json with build-quantum.sh.
+index.html
+.harness/
+.harness-initialized
diff --git a/store/agents/quantum-studio/AGENTS.md b/store/agents/quantum-studio/AGENTS.md
new file mode 100644
index 000000000..aee1412ba
--- /dev/null
+++ b/store/agents/quantum-studio/AGENTS.md
@@ -0,0 +1,14 @@
+# Quantum Studio
+
+Read the `quantum` skill. `circuit.json` is the saved circuit; rebuilding generates `index.html` for
+the shared viewer. One canonical engine powers both the build proof and browser, so don't reimplement
+the math in a second place.
+
+Keep the model honest: q0 is the rightmost basis bit. Entangled qubits can have zero-length local
+Bloch vectors without the joint state being empty. Sampling is not hardware execution or a
+mid-circuit collapse simulator. State these distinctions when they matter to the user's question.
+
+Use the interactive timeline, gate editor, phase slider, presets, probabilities and shot sampler.
+Browser edits have undo/redo but are temporary until downloaded and saved as `circuit.json`.
+Rebuild after source edits, assert expected amplitudes for known circuits, then run the browser
+proof and inspect the result. Normalization alone does not establish that an algorithm is correct.
diff --git a/store/agents/quantum-studio/LICENSE b/store/agents/quantum-studio/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/quantum-studio/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/quantum-studio/PROVENANCE.md b/store/agents/quantum-studio/PROVENANCE.md
new file mode 100644
index 000000000..5f2df8220
--- /dev/null
+++ b/store/agents/quantum-studio/PROVENANCE.md
@@ -0,0 +1,9 @@
+# Quantum Studio provenance
+
+The statevector engine, simulator interface, build helpers, fixtures and instructions are original
+OpenHarness work, licensed MIT. This package does not bundle OpenQASM, Qiskit, Cirq or a cloud SDK
+and is not an implementation of those products' full circuit languages.
+
+The engine implements standard complex unitary gates and Born-rule sampling. Conventions are
+documented in the skill and tested against known states: qubit 0 is the rightmost basis bit;
+Bloch vectors represent local reduced states rather than normalized projections.
diff --git a/store/agents/quantum-studio/README.md b/store/agents/quantum-studio/README.md
new file mode 100644
index 000000000..bb1353714
--- /dev/null
+++ b/store/agents/quantum-studio/README.md
@@ -0,0 +1,30 @@
+# Quantum Studio
+
+A local quantum workbench for seeing what gates actually do. Step through a circuit, edit its gates,
+drag the Bloch views, explore phase interference, compare joint probabilities and sample outcomes.
+Bell, GHZ and interference presets give you useful experiments immediately. Undo, redo, JSON import
+and download make the circuit editable, not just a picture.
+
+Try: “Show me why a Bell pair has random individual qubits but correlated measurements.”
+
+Choose **Quantum Studio** in the Harness Store. It needs Node 20+ and the shared Web Viewer, not a
+cloud account or a quantum SDK. The same tested statevector engine runs in the build and browser.
+
+Supported: 1–8 qubits, standard single-qubit/rotation gates, CX, CZ and SWAP, and up to 256 gates.
+No noise model, hardware execution or mid-circuit measurement. Bloch views show reduced states
+without hiding mixedness. Shot results are sampled, so small runs vary.
+
+`circuit.json` is the saved source. Browser edits are temporary until downloaded; rebuilding
+regenerates the preview. Optional Playwright helpers verify real browser interactions and performance.
+
+```sh
+harness dsh install "$PWD/store/agents/quantum-studio" --link
+harness dsh doctor autonomous/quantum-studio
+```
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/quantum-studio/harness.json b/store/agents/quantum-studio/harness.json
new file mode 100644
index 000000000..5750eb8e0
--- /dev/null
+++ b/store/agents/quantum-studio/harness.json
@@ -0,0 +1,35 @@
+{
+ "spec": 1,
+ "id": "autonomous/quantum-studio",
+ "name": "Quantum Studio",
+ "category": "Science",
+ "author": "OpenHarness contributors",
+ "description": "A local statevector workbench with editable circuits, timeline stepping, reduced Bloch views, joint probabilities, phase experiments and shot sampling.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "circuit.json",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "QUANTUM_TOOLCHAIN": "${dsh}/toolchain",
+ "QUANTUM_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [
+ ".html"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/quantum-studio/package.json b/store/agents/quantum-studio/package.json
new file mode 100644
index 000000000..cb579af9a
--- /dev/null
+++ b/store/agents/quantum-studio/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@autonomous/quantum-studio-harness",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test test/*.test.mjs",
+ "perf": "node skills/quantum/scripts/perf.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+}
diff --git a/store/agents/quantum-studio/skills/quantum/SKILL.md b/store/agents/quantum-studio/skills/quantum/SKILL.md
new file mode 100644
index 000000000..3e157aa28
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/SKILL.md
@@ -0,0 +1,46 @@
+---
+name: quantum
+description: Build, explain and verify small quantum circuits in Quantum Studio's editable statevector simulator.
+---
+
+# Quantum Studio
+
+The saved source is `circuit.json`:
+
+```json
+{"name":"Bell state","qubits":["q0","q1"],"gates":[{"gate":"H","target":0},{"gate":"CX","control":0,"target":1}],"shots":1024}
+```
+
+Limits: 1–8 uniquely named qubits, 256 gates, 1–100,000 shots. Gates apply in array order.
+Targets and controls are zero-based. The basis is `|q(n−1)…q1q0⟩`: qubit 0 is the rightmost bit.
+
+Supported gates: H, X, Y, Z, S, T, SDG, TDG, RX, RY, RZ, CX (alias CNOT), CZ, SWAP.
+Rotations use `theta` in radians in JSON; the UI slider displays degrees. Two-qubit gates require
+distinct `control` and `target`. Arbitrary matrices and mid-circuit measurements are not supported.
+Terminal `measure` markers may be present, but the displayed state is premeasurement. The shot
+sampler draws computational-basis outcomes from the joint Born probabilities, without collapse,
+noise, hardware jobs or persistent quantum state.
+
+Bloch vectors are reduced single-qubit expectations. A Bell pair has individually maximally mixed
+qubits (purity 0.5), not unit vectors. Preserve their lengths; do not normalize them for display.
+
+## Build and prove
+
+```sh
+sh "$QUANTUM_SKILLS/quantum/scripts/build-quantum.sh"
+node "$QUANTUM_SKILLS/quantum/scripts/proof.mjs" circuit.json
+node "$QUANTUM_SKILLS/quantum/scripts/screenshot.mjs" "$HARNESS_WORKSPACE/index.html"
+node "$QUANTUM_SKILLS/quantum/scripts/perf.mjs" "$HARNESS_WORKSPACE/index.html"
+```
+
+Build validates the schema and finite normalized state, safely embeds JSON, and updates the verdict.
+Failures clear readiness even if an older HTML export remains. Add assertions for the expected state,
+not just its norm. `engine.mjs` exports `simulate`, `probabilities`, `bloch` and `sampleShots` for tests.
+
+The browser proof also needs Playwright + Chromium (shared viewer installation or `PLAYWRIGHT_MODULE`)
+and a current `proof.json` interaction recipe. It checks actual results, records errors/hashes and
+captures `.harness/last.png`. Inspect the image, stepping, edits, undo/redo and narrow layout.
+
+The user can edit gates, scrub the timeline, change rotation phase and sample shots directly.
+Those edits stay in browser memory. Download the circuit and save it to the workspace to preserve it;
+never imply the viewer wrote back to disk.
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/build-quantum.sh b/store/agents/quantum-studio/skills/quantum/scripts/build-quantum.sh
new file mode 100755
index 000000000..ff207df88
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/build-quantum.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Build and prove the circuit using the same engine as the interactive viewer.
+set -eu
+here="$(CDPATH= cd -- "$(dirname "$0")" && pwd)"
+exec node "$here/build.mjs"
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/build.mjs b/store/agents/quantum-studio/skills/quantum/scripts/build.mjs
new file mode 100644
index 000000000..a6a8d7e0b
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/build.mjs
@@ -0,0 +1,38 @@
+import { readFile, writeFile, mkdir, rename } from 'node:fs/promises';
+import { resolve, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { validateCircuit, simulate, probabilities } from './engine.mjs';
+
+export async function build(workspace) {
+ const directory=fileURLToPath(new URL('.',import.meta.url));
+ await mkdir(join(workspace,'.harness'),{recursive:true});
+ const atomic=async(file,text)=>{
+ const temporary=file+'.'+process.pid+'.tmp';
+ await writeFile(temporary,text);await rename(temporary,file);
+ };
+ const verdict=async(value)=>atomic(join(workspace,'.harness/verdict.json'),JSON.stringify({
+ spec:1,...value,updatedAt:new Date().toISOString()
+ },null,2)+'\n');
+ try{
+ await verdict({ready:false,summary:'Checking circuit and rebuilding the simulator',findings:[],artifact:null});
+ const circuit=validateCircuit(JSON.parse(await readFile(join(workspace,'circuit.json'),'utf8')));
+ const state=simulate(circuit);
+ const [shell,engine,app]=await Promise.all(['studio.html','engine.mjs','studio.js'].map(file=>readFile(join(directory,file),'utf8')));
+ // Escape '<', including </script>, even in a non-executable JSON script element.
+ const payload=JSON.stringify(circuit).replaceAll('<','\\u003c').replaceAll('\u2028','\\u2028').replaceAll('\u2029','\\u2029');
+ const html=shell.replace('<!--CIRCUIT-->',()=>payload)
+ .replace('<!--ENGINE-->',()=>engine.replace(/^export /gm,''))
+ .replace('<!--APP-->',()=>app);
+ await atomic(join(workspace,'index.html'),html);
+ const summary='Statevector verified — '+circuit.qubits.length+' qubits, '+circuit.gates.length+' gates';
+ await verdict({ready:true,summary,findings:[],artifact:'index.html'});
+ return {circuit,probabilities:probabilities(state),summary};
+ }catch(error){
+ await verdict({ready:false,summary:'Circuit build failed',findings:[{severity:'error',kind:'circuit',message:error.message}],artifact:null});
+ throw error;
+ }
+}
+if(process.argv[1] && resolve(process.argv[1])===fileURLToPath(import.meta.url)){
+ try{console.log((await build(resolve(process.env.HARNESS_WORKSPACE || process.cwd()))).summary);}
+ catch(error){console.error(error.message);process.exitCode=1;}
+}
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/engine.mjs b/store/agents/quantum-studio/skills/quantum/scripts/engine.mjs
new file mode 100644
index 000000000..b61148939
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/engine.mjs
@@ -0,0 +1,126 @@
+// One engine for Node proof and the browser. q0 is the least significant bit;
+// basis labels read |q(n-1) ... q1 q0>, matching Qiskit's displayed bitstrings.
+export const GATE_NAMES = ['H', 'X', 'Y', 'Z', 'S', 'T', 'SDG', 'TDG', 'RX', 'RY', 'RZ', 'CX', 'CZ', 'SWAP'];
+const SQ = Math.SQRT1_2;
+const MATRICES = {
+ H:[SQ,0,SQ,0,SQ,0,-SQ,0], X:[0,0,1,0,1,0,0,0], Y:[0,0,0,-1,0,1,0,0],
+ Z:[1,0,0,0,0,0,-1,0], S:[1,0,0,0,0,0,0,1], T:[1,0,0,0,0,0,SQ,SQ],
+ SDG:[1,0,0,0,0,0,0,-1], TDG:[1,0,0,0,0,0,SQ,-SQ]
+};
+export function validateCircuit(value) {
+ if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('A circuit must be a JSON object.');
+ const { qubits, gates } = value;
+ if (!Array.isArray(qubits) || qubits.length < 1 || qubits.length > 8) throw new Error('Use between 1 and 8 qubits.');
+ if (qubits.some(q => typeof q !== 'string' || !q.trim() || q.length > 32) || new Set(qubits).size !== qubits.length) throw new Error('Qubit labels must be unique, nonempty strings (32 characters maximum).');
+ if (!Array.isArray(gates) || gates.length > 256) throw new Error('Use an array of at most 256 gates.');
+ if (value.name !== undefined && (typeof value.name !== 'string' || value.name.length > 200)) throw new Error('Circuit name must be a string of at most 200 characters.');
+ if (value.shots !== undefined && (!Number.isInteger(value.shots) || value.shots < 1 || value.shots > 100000)) throw new Error('Shots must be an integer from 1 to 100000.');
+ let readout = false;
+ const measured = new Set();
+ const index = (q, label) => { if (!Number.isInteger(q) || q < 0 || q >= qubits.length) throw new Error(label + ' must name a qubit index from 0 to ' + (qubits.length-1) + '.'); };
+ const clean = gates.map((op, i) => {
+ if (!op || typeof op !== 'object') throw new Error('Gate ' + (i+1) + ' must be an object.');
+ const gate = op.gate === 'CNOT' ? 'CX' : op.gate;
+ if (!GATE_NAMES.includes(gate) && gate !== 'measure') throw new Error('Unsupported gate: ' + String(gate));
+ index(op.target, 'Gate '+(i+1)+' target');
+ if (gate === 'measure') {
+ if (measured.has(op.target)) throw new Error('Duplicate terminal measurement.');
+ measured.add(op.target); readout = true;
+ return { gate, target: op.target };
+ }
+ if (readout) throw new Error('Only terminal measurements are supported. Move readout after the unitary gates.');
+ const result = { gate, target: op.target };
+ if (['CX','CZ','SWAP'].includes(gate)) {
+ index(op.control, 'Gate '+(i+1)+' control');
+ if (op.control === op.target) throw new Error('A two-qubit gate needs two different qubits.');
+ result.control = op.control;
+ }
+ if (['RX','RY','RZ'].includes(gate)) {
+ if (!Number.isFinite(op.theta)) throw new Error(gate + ' needs a finite theta in radians.');
+ result.theta = op.theta;
+ }
+ return result;
+ });
+ return { name: value.name || 'Untitled circuit', qubits: [...qubits], gates: clean, shots: value.shots ?? 1024 };
+}
+
+function matrix(op) {
+ if (MATRICES[op.gate]) return MATRICES[op.gate];
+ const c = Math.cos(op.theta/2), s = Math.sin(op.theta/2);
+ if (op.gate === 'RX') return [c,0,0,-s,0,-s,c,0];
+ if (op.gate === 'RY') return [c,0,-s,0,s,0,c,0];
+ if (op.gate === 'RZ') return [c,-s,0,0,0,0,c,s];
+ throw new Error('No matrix for ' + op.gate);
+}
+
+export function simulate(value, steps = value.gates?.length) {
+ const circuit = validateCircuit(value);
+ if (!Number.isInteger(steps) || steps < 0 || steps > circuit.gates.length) throw new Error('Step is outside the circuit.');
+ const state = new Float64Array(2 * (1 << circuit.qubits.length)); state[0] = 1;
+ for (const op of circuit.gates.slice(0, steps)) {
+ // A terminal measure marks readout. This returns the premeasurement state;
+ // sampleShots performs Born-rule sampling without pretending to collapse it.
+ if (op.gate === 'measure') continue;
+ const target = 1 << op.target, control = 1 << op.control;
+ if (op.gate === 'SWAP') {
+ for (let i=0;i<state.length/2;i++) if (!(i&target) && (i&control)) {
+ const j = i ^ target ^ control;
+ [state[2*i],state[2*j]]=[state[2*j],state[2*i]];
+ [state[2*i+1],state[2*j+1]]=[state[2*j+1],state[2*i+1]];
+ }
+ continue;
+ }
+ const controlled = op.gate === 'CX' || op.gate === 'CZ';
+ const m = controlled ? MATRICES[op.gate === 'CX' ? 'X' : 'Z'] : matrix(op);
+ for (let i=0;i<state.length/2;i++) {
+ if (i&target || (controlled && !(i&control))) continue;
+ const j=i|target, ar=state[2*i], ai=state[2*i+1], br=state[2*j], bi=state[2*j+1];
+ state[2*i] = m[0]*ar-m[1]*ai + m[2]*br-m[3]*bi;
+ state[2*i+1] = m[0]*ai+m[1]*ar + m[2]*bi+m[3]*br;
+ state[2*j] = m[4]*ar-m[5]*ai + m[6]*br-m[7]*bi;
+ state[2*j+1] = m[4]*ai+m[5]*ar + m[6]*bi+m[7]*br;
+ }
+ }
+ const norm = probabilities(state).reduce((sum,p) => sum+p,0);
+ if (!Number.isFinite(norm) || Math.abs(norm-1)>1e-9) throw new Error('The statevector is not finite and normalized.');
+ return state;
+}
+
+export function probabilities(state) {
+ return Array.from({length:state.length/2}, (_,i) => state[2*i]**2+state[2*i+1]**2);
+}
+
+export function bloch(state, qubit) {
+ const n = Math.log2(state.length/2);
+ if (!Number.isInteger(n) || !Number.isInteger(qubit) || qubit<0 || qubit>=n) throw new Error('Invalid Bloch-vector input.');
+ const mask=1<<qubit;
+ let x=0,y=0,z=0;
+ for(let i=0;i<state.length/2;i++) if(!(i&mask)) {
+ const j=i|mask, ar=state[2*i], ai=state[2*i+1], br=state[2*j], bi=state[2*j+1];
+ x += 2*(ar*br+ai*bi);
+ y += 2*(ar*bi-ai*br);
+ z += ar*ar+ai*ai-br*br-bi*bi;
+ }
+ // A reduced state can lie inside the sphere. Never normalize its vector.
+ const length=Math.hypot(x,y,z);
+ return {x,y,z,length,purity:(1+length*length)/2,p0:(1+z)/2,p1:(1-z)/2};
+}
+
+export function sampleShots(state, shots, random = Math.random) {
+ if (!Number.isInteger(shots) || shots<1 || shots>100000) throw new Error('Shots must be an integer from 1 to 100000.');
+ const probs=probabilities(state), counts=new Array(probs.length).fill(0);
+ const norm=probs.reduce((sum,p)=>sum+p,0);
+ if (!Number.isFinite(norm) || Math.abs(norm-1)>1e-9) throw new Error('Cannot sample an unnormalized state.');
+ for(let shot=0;shot<shots;shot++) {
+ const r=random();
+ if(!Number.isFinite(r) || r<0 || r>=1) throw new Error('Random samples must be in [0, 1).');
+ let cumulative=0;
+ for(let i=0;i<probs.length;i++) {
+ cumulative+=probs[i];
+ if(r<cumulative || i===probs.length-1){counts[i]++;break;}
+ }
+ }
+ return counts;
+}
+
+export function basisLabel(index,n) { return index.toString(2).padStart(n,'0'); }
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/perf.mjs b/store/agents/quantum-studio/skills/quantum/scripts/perf.mjs
new file mode 100644
index 000000000..3b885bd05
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/perf.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'perf' });
+}
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/proof.mjs b/store/agents/quantum-studio/skills/quantum/scripts/proof.mjs
new file mode 100755
index 000000000..ffbd52c71
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/proof.mjs
@@ -0,0 +1,10 @@
+#!/usr/bin/env node
+import { readFileSync } from 'node:fs';
+import { validateCircuit, simulate, probabilities, basisLabel } from './engine.mjs';
+try {
+ if (!process.argv[2]) throw new Error('usage: proof.mjs circuit.json');
+ const circuit = validateCircuit(JSON.parse(readFileSync(process.argv[2], 'utf8')));
+ const state = simulate(circuit), probs = probabilities(state);
+ console.log('SIM OK qubits=' + circuit.qubits.length + ' gates=' + circuit.gates.length + ' norm=' + probs.reduce((a,b)=>a+b,0).toFixed(8));
+ for (const [i, p] of probs.entries()) if (p > 1e-12) console.log('|' + basisLabel(i, circuit.qubits.length) + '⟩ ' + (p * 100).toFixed(6) + '%');
+} catch (error) { console.error('proof: ' + error.message); process.exitCode = 1; }
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/screenshot.mjs b/store/agents/quantum-studio/skills/quantum/scripts/screenshot.mjs
new file mode 100644
index 000000000..4419012c3
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/screenshot.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'proof' });
+}
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/studio.html b/store/agents/quantum-studio/skills/quantum/scripts/studio.html
new file mode 100644
index 000000000..f8fe15430
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/studio.html
@@ -0,0 +1,58 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Quantum Studio — see the invisible</title>
+<style>
+:root{color-scheme:dark;--bg:#101820;--panel:#16212b;--line:#ffffff15;--ink:#e8edf1;--muted:#8596a5;--orange:#ffb26b;--blue:#8abadd;--mint:#bce5c5;--mono:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:13px/1.5 system-ui,-apple-system,sans-serif}button,select,input{font:inherit}button,select{cursor:pointer;color:inherit}button{touch-action:manipulation}button{background:transparent;border:1px solid #ffffff25;border-radius:6px;padding:7px 10px}button:hover{background:#ffffff08;border-color:#ffffff55}button:disabled{opacity:.3;cursor:default}select{background:var(--panel);border:1px solid #ffffff25;border-radius:5px;padding:7px;font-size:11px}input{accent-color:var(--orange)}:focus-visible{outline:2px solid var(--orange);outline-offset:3px}.eyebrow{font:var(--mono);text-transform:uppercase;letter-spacing:1.6px;color:var(--muted)}[hidden]{display:none!important}
+header{height:68px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;gap:10px;align-items:center;font-size:18px;font-weight:600;letter-spacing:-.5px}.brand-mark{font:28px Georgia,serif;color:var(--orange)}.header-actions{display:flex;gap:8px;align-items:center}.header-actions button{font-size:11px}.save{background:var(--orange);color:#342718;border-color:var(--orange)}.save:hover{background:#ffca93;color:#342718}.edited{font:var(--mono);font-size:10px;color:var(--muted);margin-right:8px}
+main{max-width:1560px;padding:28px;margin:auto}.intro{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:24px}h1{font-size:clamp(27px,3vw,42px);line-height:1.13;letter-spacing:-1.4px;font-weight:450;margin:9px 0 10px}h1 em{font:italic 1.08em Georgia,serif;color:var(--orange)}.intro p{margin:0;color:var(--muted);max-width:650px;font-size:12px;line-height:1.7}.norm{font:var(--mono);text-align:right;color:var(--muted);white-space:nowrap}.norm strong{display:block;font-size:21px;font-weight:400;color:var(--mint);margin-bottom:3px}
+.presets{display:flex;gap:9px;margin-bottom:23px;flex-wrap:wrap}.preset{display:flex;gap:9px;align-items:center;text-align:left;font-size:12px;background:var(--panel);padding:11px 15px;border-color:var(--line)}.preset small{font:var(--mono);color:var(--muted);font-size:10px}.preset[aria-pressed=true]{border-color:#ffb26b88;background:#ffb26b09}.preset b{font-weight:500}.preset .symbol{font:17px Georgia,serif;color:var(--orange)}
+.workbench{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);gap:18px}.left{min-width:0;display:flex;flex-direction:column;gap:18px}.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;min-width:0}.card-head{display:flex;justify-content:space-between;align-items:center;padding:19px 21px 12px;gap:10px}.card-head h2{font-size:13px;font-weight:550;letter-spacing:-.1px;margin:0}.card-head .eyebrow{font-size:9px;letter-spacing:1px}.edit-tools{display:flex;gap:5px}.edit-tools button{font-size:10px;padding:4px 7px}
+.circuit{overflow-x:auto;padding:17px 21px 10px;background:radial-gradient(#91a6b117 .6px,transparent .6px) 0 0/16px 16px;min-height:154px}.lane{display:flex;align-items:center;height:61px;width:max-content;min-width:100%;position:relative}.qlabel{width:62px;flex-shrink:0;font:var(--mono);color:var(--blue);overflow:hidden;text-overflow:ellipsis;padding-right:8px}.wire{width:62px;height:61px;position:relative;flex-shrink:0;display:grid;place-items:center}.wire::before{content:'';height:1px;background:#91a6b13d;position:absolute;left:0;right:0;top:50%}.wire.past::before{background:#ffb26b55}.wire .gate{position:relative;z-index:1;width:35px;height:35px;display:grid;place-items:center;padding:0;border:1px solid #d8a36a91;background:#332b24;color:var(--orange);font:12px ui-monospace,monospace;box-shadow:0 0 0 5px var(--panel)}.wire .gate.selected{background:var(--orange);color:#302211}.wire.future{opacity:.35}.wire .connector{position:absolute;z-index:1;top:50%;width:1px;background:#dfa069;pointer-events:none}.wire .control-gate{border-radius:50%;width:12px;height:12px;background:var(--orange);padding:0;box-shadow:0 0 0 4px var(--panel);position:relative;z-index:2}.wire .target-gate{border-radius:50%;font-size:20px;background:var(--panel)}.wire .step-number{position:absolute;bottom:0;font:9px ui-monospace,monospace;color:var(--muted)}
+.timeline{display:flex;align-items:center;gap:12px;padding:13px 21px;border-bottom:1px solid var(--line);border-top:1px solid var(--line)}.timeline button{width:29px;height:27px;padding:0;font-size:15px}.timeline input{flex:1;min-width:40px;height:3px}.timeline output{font:var(--mono);color:var(--orange);min-width:76px;text-align:right}.composer{padding:15px 21px 17px;display:flex;gap:9px;align-items:end;flex-wrap:wrap}.field{display:grid;gap:5px}.field label{font:var(--mono);font-size:9px;color:var(--muted)}.composer button{font-size:11px;padding:8px 12px;background:#2c3c45;border-color:#425c69}.composer #theta-wrap{max-width:125px;flex:1;min-width:95px}.composer input{height:28px;width:100%;margin:0}.step-story{padding:0 21px 18px;font-size:11px;color:var(--muted);min-height:33px}
+.spheres{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));padding:0 12px 16px;gap:5px}.sphere{min-width:0;text-align:center}.sphere canvas{display:block;width:100%;max-width:250px;aspect-ratio:1;margin:auto;cursor:grab;touch-action:none}.sphere .qubit-name{font:var(--mono);color:var(--blue)}.sphere .purity{font:var(--mono);font-size:10px;color:var(--muted)}.sphere .purity b{font-weight:400;color:var(--mint)}.sphere .values{font:9px/1.7 ui-monospace,monospace;color:var(--muted);margin-top:8px}.state-note{padding:13px 21px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;line-height:1.7}.state-note strong{color:var(--orange);font-weight:500}
+.right{display:flex;flex-direction:column;gap:18px;min-width:0}.probabilities{padding:2px 21px 14px;max-height:340px;overflow:auto}.prob-row{display:grid;grid-template-columns:54px 1fr 58px;gap:12px;align-items:center;margin:17px 0;font:var(--mono)}.prob-row .ket{color:var(--blue)}.prob-row .value{text-align:right;color:var(--ink)}.bar{height:17px;background:#ffffff06;position:relative;border-radius:3px}.bar .expected{height:100%;border-radius:3px;background:var(--orange);min-width:0}.bar .observed{position:absolute;top:5px;height:7px;border-radius:2px;background:#f4f3df;left:0}.prob-row small{color:var(--muted);font-size:9px}.sample{padding:15px 21px;border-top:1px solid var(--line)}.sample-controls{display:flex;gap:8px;align-items:center}.sample-controls label{font-size:11px;color:var(--muted)}.sample-controls button{margin-left:auto;background:#243a35;border-color:#4d7663;color:var(--mint);font-size:11px}.sample-status{margin:11px 0 0;font:var(--mono);font-size:10px;color:var(--muted)}.phase-list{padding:0 21px 18px;max-height:240px;overflow:auto}.amplitude{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font:var(--mono);font-size:10px}.amplitude .phase{display:flex;align-items:center;gap:8px;color:var(--muted)}.phase svg{flex-shrink:0}.note{font-size:11px;line-height:1.7;color:var(--muted);padding:17px 21px}.note h3{font-size:12px;color:var(--ink);font-weight:500;margin:0 0 7px}.note p{margin:0}.basis-order{padding:0 21px 15px;font:var(--mono);font-size:9px;color:var(--muted)}.error{padding:12px 16px;margin-bottom:18px;border:1px solid #e38b6c70;color:#ffc4a8;background:#e38b6c0a;border-radius:7px;font-size:12px}.footer{display:flex;justify-content:space-between;gap:12px;padding:18px 0 0;font:var(--mono);font-size:10px;color:var(--muted)}
+@media(max-width:1050px){.workbench{grid-template-columns:1fr 340px}.norm{display:none}main{padding:23px}.spheres{grid-template-columns:repeat(auto-fit,minmax(135px,1fr))}}
+@media(max-width:780px){.workbench{grid-template-columns:1fr}.spheres{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}.right{display:grid;grid-template-columns:1fr 1fr}.right>.card:first-child{grid-row:span 2}.edited{display:none}.intro p{max-width:100%}.presets .preset{flex:1;justify-content:center}.preset small{display:none}}
+@media(max-width:540px){header{height:60px;padding:0 16px}.brand{font-size:15px}.header-actions{gap:5px}.header-actions button{font-size:10px;padding:6px 8px}main{padding:22px 16px}.intro{margin-bottom:19px}h1{font-size:30px}.intro p{font-size:11px}.presets{gap:6px}.preset{padding:9px 8px;font-size:10px}.preset .symbol{font-size:13px}.card-head,.composer{padding-left:16px;padding-right:16px}.card-head h2{font-size:12px}.right{display:flex}.footer{font-size:9px}.footer span:last-child{display:none}.timeline{padding-left:16px;padding-right:16px}.composer{gap:7px}.qlabel{width:42px}.circuit{padding-left:16px}}
+</style>
+</head>
+<body>
+<header><div class="brand"><span class="brand-mark" aria-hidden="true">ψ</span>Quantum Studio</div><div class="header-actions"><span id="edited" class="edited">From circuit.json</span><button id="import">Open circuit</button><button id="download" class="save">Save circuit ↗</button><input id="upload" type="file" accept=".json,application/json" aria-label="Choose circuit JSON" hidden></div></header>
+<main>
+ <div class="intro"><div><span class="eyebrow">A laboratory for the curious</span><h1>Make the invisible <em>visible.</em></h1><p id="description">Build a circuit. Follow a qubit. Watch possibilities become probabilities.</p></div><div class="norm"><strong id="norm">1.0000</strong>Total probability · normalized</div></div>
+ <nav class="presets" aria-label="Circuit presets"><button class="preset" data-preset="bell"><span class="symbol">↔</span><b>Bell pair</b><small>Entanglement</small></button><button class="preset" data-preset="ghz"><span class="symbol">⋈</span><b>GHZ state</b><small>Three become one</small></button><button class="preset" data-preset="phase"><span class="symbol">∿</span><b>Interference</b><small>Phase becomes probability</small></button><button class="preset" data-preset="source"><span class="symbol">⌘</span><b>Your circuit</b></button></nav>
+ <div id="error" class="error" role="alert" hidden></div>
+ <div class="workbench">
+ <div class="left">
+ <section class="card">
+ <div class="card-head"><h2 id="circuit-name">Circuit</h2><div class="edit-tools"><button id="undo" title="Undo edit">Undo</button><button id="redo" title="Redo edit">Redo</button><button id="remove" disabled>Delete gate</button></div></div>
+ <div id="circuit" class="circuit" aria-label="Circuit diagram"></div>
+ <div class="timeline"><button id="back" aria-label="Previous step">‹</button><input id="step" type="range" min="0" max="2" value="2" aria-label="Circuit step"><button id="forward" aria-label="Next step">›</button><output id="step-label">Step 2 / 2</output></div>
+ <div class="composer">
+ <div class="field"><label for="gate">Gate</label><select id="gate" aria-label="Gate type"></select></div>
+ <div class="field"><label for="target">Target</label><select id="target" aria-label="Target qubit"></select></div>
+ <div class="field" id="control-wrap" hidden><label for="control">Control / other</label><select id="control" aria-label="Control qubit"></select></div>
+ <div class="field" id="theta-wrap" hidden><label for="theta">Angle <output id="theta-label">90°</output></label><input id="theta" type="range" min="-180" max="180" step="5" value="90" aria-label="Rotation angle"></div>
+ <button id="add">+ Add gate</button>
+ </div>
+ <div id="step-story" class="step-story" role="status"></div>
+ </section>
+ <section class="card"><div class="card-head"><h2>A window into each qubit</h2><span class="eyebrow">Drag to rotate</span></div><div id="spheres" class="spheres"></div><div id="state-note" class="state-note"></div></section>
+ </div>
+ <div class="right">
+ <section class="card"><div class="card-head"><h2>What could you measure?</h2><span class="eyebrow">Born probabilities</span></div><div id="probabilities" class="probabilities"></div><div id="basis-order" class="basis-order"></div><div class="sample"><div class="sample-controls"><label for="shots">Shots</label><select id="shots"><option>128</option><option selected>1024</option><option>4096</option></select><button id="measure">Sample outcomes</button></div><p id="sample-status" class="sample-status">An ideal simulation. No hardware or noise.</p></div></section>
+ <section class="card"><div class="card-head"><h2>Under the probabilities</h2><span class="eyebrow">Amplitude · phase</span></div><div id="amplitudes" class="phase-list"></div></section>
+ <section class="card note"><h3>Try a small experiment</h3><p id="experiment"></p></section>
+ </div>
+ </div>
+ <footer class="footer"><span>Local statevector simulator · up to 8 qubits</span><span id="runtime">Computed in your browser</span></footer>
+</main>
+<script type="application/json" id="circuit-config"><!--CIRCUIT--></script>
+<script>
+<!--ENGINE-->
+<!--APP-->
+</script>
+</body>
+</html>
diff --git a/store/agents/quantum-studio/skills/quantum/scripts/studio.js b/store/agents/quantum-studio/skills/quantum/scripts/studio.js
new file mode 100644
index 000000000..a64a5e639
--- /dev/null
+++ b/store/agents/quantum-studio/skills/quantum/scripts/studio.js
@@ -0,0 +1,223 @@
+'use strict';
+const $ = id => document.getElementById(id);
+const clone = value => JSON.parse(JSON.stringify(value));
+const original = validateCircuit(JSON.parse($('circuit-config').textContent));
+const PRESETS = {
+ bell:{name:'Bell pair',qubits:['q0','q1'],gates:[{gate:'H',target:0},{gate:'CX',control:0,target:1}],shots:1024},
+ ghz:{name:'GHZ state',qubits:['q0','q1','q2'],gates:[{gate:'H',target:0},{gate:'CX',control:0,target:1},{gate:'CX',control:1,target:2}],shots:1024},
+ phase:{name:'Interference',qubits:['q0'],gates:[{gate:'H',target:0},{gate:'RZ',target:0,theta:Math.PI/2},{gate:'H',target:0}],shots:1024}
+};
+let current=clone(original), step=current.gates.length, selected=-1, past=[], future=[], activePreset='source', counts=null, state, camera={x:.35,y:.65};
+const rotation = gate => ['RX','RY','RZ'].includes(gate);
+const dual = gate => ['CX','CZ','SWAP'].includes(gate);
+function node(tag,attrs={},text) {
+ const el=document.createElement(tag);
+ for(const [key,value] of Object.entries(attrs))el.setAttribute(key,value);
+ if(text!==undefined)el.textContent=text;
+ return el;
+}
+function message(error) { $('error').hidden=!error; $('error').textContent=error?.message||''; }
+function edit(next) {
+ try {
+ const clean=validateCircuit(next);
+ past.push(clone(current));if(past.length>64)past.shift();future=[];
+ current=clean;step=current.gates.length;counts=null;message(null);
+ $('edited').textContent='Exploration · save to keep';
+ configure();render();
+ } catch(error){message(error);}
+}
+function configure() {
+ const shots=String(current.shots);
+ if(![...$('shots').options].some(option=>option.value===shots))$('shots').append(node('option',{value:shots},shots));
+ $('shots').value=shots;
+ for(const id of ['target','control']){
+ const previous=$(id).value;
+ $(id).replaceChildren(...current.qubits.map((name,i)=>node('option',{value:i},name)));
+ $(id).value=Number(previous)<current.qubits.length?previous:'0';
+ if(!$(id).value)$(id).value=id==='target'&&current.qubits.length>1?'1':'0';
+ }
+ if(dual($('gate').value) && $('target').value===$('control').value && current.qubits.length>1) $('control').value=String((Number($('target').value)+1)%current.qubits.length);
+ syncComposer();
+}
+function syncComposer() {
+ $('control-wrap').hidden=!dual($('gate').value);
+ $('theta-wrap').hidden=!rotation($('gate').value);
+ $('theta-label').textContent=$('theta').value+'°';
+ $('add').disabled=dual($('gate').value) && (current.qubits.length<2 || $('target').value===$('control').value);
+}
+function render() {
+ const started=performance.now();
+ state=simulate(current,step);
+ const probabilitiesNow=probabilities(state);
+ $('norm').textContent=probabilitiesNow.reduce((sum,p)=>sum+p,0).toFixed(4);
+ $('circuit-name').textContent=current.name;
+ $('step').max=current.gates.length;$('step').value=step;
+ $('step-label').textContent='Step '+step+' / '+current.gates.length;
+ $('back').disabled=step===0;$('forward').disabled=step===current.gates.length;
+ $('undo').disabled=!past.length;$('redo').disabled=!future.length;$('remove').disabled=selected<0;
+ document.querySelectorAll('[data-preset]').forEach(button=>button.setAttribute('aria-pressed',String(button.dataset.preset===activePreset)));
+ $('description').textContent=activePreset==='bell'?'Two qubits. Individually uncertain, perfectly correlated together. Step back to see where entanglement begins.':activePreset==='ghz'?'Three qubits share one state. Only 000 and 111 can appear when you measure the final circuit.':activePreset==='phase'?'Phase is invisible in a probability chart—until gates make the paths interfere. Select RZ and turn its angle.':'Build a circuit. Follow a qubit. Watch possibilities become probabilities.';
+ $('experiment').textContent=activePreset==='phase'?'Select the RZ gate, move its angle slider, then go to the final step. At 0° the result is 0; at 180° it is 1. Interference turns phase into a measurable difference.':'Move the step slider back before the first controlled gate. Each qubit is pure. Move forward again: the arrows shrink as the qubits become entangled.';
+ const last=current.gates[step-1];
+ $('step-story').textContent=!last?'Start: every qubit is in |0⟩.':last.gate==='measure'?'Terminal readout marker: the views show the premeasurement state. Sample outcomes to see simulated results.':last.gate==='H'?'H creates or recombines superposition on '+current.qubits[last.target]+'.':last.gate==='CX'?'CX flips '+current.qubits[last.target]+' only in branches where '+current.qubits[last.control]+' is 1.':rotation(last.gate)?last.gate+' rotates '+current.qubits[last.target]+' by '+(last.theta*180/Math.PI).toFixed(0)+'°.':'Applied '+last.gate+' to '+current.qubits[last.target]+'.';
+ drawCircuit();drawSpheres();drawProbabilities();drawAmplitudes();
+ $('runtime').textContent=(performance.now()-started).toFixed(1)+' ms · '+(1<<current.qubits.length)+' amplitudes';
+}
+function drawCircuit() {
+ $('circuit').replaceChildren(...current.qubits.map((name,q)=>{
+ const row=node('div',{class:'lane'});row.append(node('span',{class:'qlabel',title:name},name));
+ for(let i=0;i<Math.max(4,current.gates.length+1);i++){
+ const op=current.gates[i],cell=node('div',{class:'wire '+(i<step?'past':'future')});
+ if(op && (op.target===q || (dual(op.gate)&&op.control===q))){
+ const isControl=dual(op.gate)&&op.control===q;
+ if(dual(op.gate)&&q===Math.min(op.control,op.target)){
+ const line=node('span',{class:'connector'});line.style.height=(Math.abs(op.control-op.target)*61)+'px';cell.append(line);
+ }
+ const symbol=isControl?(op.gate==='SWAP'?'×':''):op.gate==='CX'?'⊕':op.gate==='SWAP'?'×':op.gate==='measure'?'M':op.gate;
+ const button=node('button',{class:'gate '+(isControl&&op.gate!=='SWAP'?'control-gate ':'')+(dual(op.gate)&&!isControl?'target-gate ':'')+(selected===i?'selected':''),'aria-label':name+' step '+(i+1)+': '+op.gate,title:'Inspect '+op.gate+' after step '+(i+1)},symbol);
+ button.onclick=()=>{
+ selected=i;step=i+1;counts=null;
+ if(op.gate!=='measure'){
+ $('gate').value=op.gate;$('target').value=String(op.target);
+ if(dual(op.gate))$('control').value=String(op.control);
+ if(rotation(op.gate))$('theta').value=String(Math.round(op.theta*180/Math.PI));
+ syncComposer();
+ }
+ render();
+ };
+ cell.append(button);
+ }
+ if(q===current.qubits.length-1 && op)cell.append(node('span',{class:'step-number'},i+1));
+ row.append(cell);
+ }
+ return row;
+ }));
+}
+function project(vec,cx,cy,r) {
+ const [x,y,z]=vec, c=Math.cos(camera.y),s=Math.sin(camera.y);
+ const xx=x*c-y*s,yy=x*s+y*c;
+ const zz=z*Math.cos(camera.x)-yy*Math.sin(camera.x),depth=z*Math.sin(camera.x)+yy*Math.cos(camera.x);
+ const perspective=1/(1-depth*.08);
+ return [cx+xx*r*perspective,cy-zz*r*perspective,depth];
+}
+function sphere(canvas,vector) {
+ const ratio=Math.min(devicePixelRatio||1,2),size=240;
+ canvas.width=size*ratio;canvas.height=size*ratio;
+ const g=canvas.getContext('2d');g.scale(ratio,ratio);
+ const cx=120,cy=118,r=84;
+ const gradient=g.createRadialGradient(91,82,3,cx,cy,98);
+ gradient.addColorStop(0,'#31414b');gradient.addColorStop(.75,'#1a2a35');gradient.addColorStop(1,'#16212b');
+ g.beginPath();g.arc(cx,cy,r,0,Math.PI*2);g.fillStyle=gradient;g.fill();
+ const path=(make,stroke,dash=[])=>{
+ g.beginPath();g.strokeStyle=stroke;g.lineWidth=.8;g.setLineDash(dash);
+ for(let j=0;j<=120;j++){const p=project(make(j/120*Math.PI*2),cx,cy,r);j?g.lineTo(p[0],p[1]):g.moveTo(p[0],p[1]);}g.stroke();g.setLineDash([]);
+ };
+ for(const latitude of [-.66,-.33,0,.33,.66])path(t=>[Math.cos(t)*Math.sqrt(1-latitude**2),Math.sin(t)*Math.sqrt(1-latitude**2),latitude],'#8aa6b331');
+ for(const angle of [0,Math.PI/4,Math.PI/2,Math.PI*3/4])path(t=>[Math.cos(t)*Math.cos(angle),Math.cos(t)*Math.sin(angle),Math.sin(t)],'#8aa6b334');
+ g.strokeStyle='#8aa6b34a';g.beginPath();g.arc(cx,cy,r,0,Math.PI*2);g.stroke();
+ for(const [v,label] of [[[0,0,1],'|0⟩'],[[0,0,-1],'|1⟩'],[[1,0,0],'x'],[[0,1,0],'y']]){
+ const p=project(v,cx,cy,r*1.14);g.fillStyle='#8fa6b5';g.font='11px ui-monospace,monospace';g.textAlign='center';g.fillText(label,p[0],p[1]+3);
+ }
+ const p=project([vector.x,vector.y,vector.z],cx,cy,r);
+ g.strokeStyle='#ffb26b';g.lineWidth=2.1;g.beginPath();g.moveTo(cx,cy);g.lineTo(p[0],p[1]);g.stroke();
+ const glow=g.createRadialGradient(p[0],p[1],0,p[0],p[1],15);glow.addColorStop(0,'#ffb26b50');glow.addColorStop(1,'#ffb26b00');
+ g.fillStyle=glow;g.fillRect(p[0]-15,p[1]-15,30,30);g.fillStyle='#ffd0a0';g.beginPath();g.arc(p[0],p[1],3.7,0,Math.PI*2);g.fill();
+}
+function drawSpheres() {
+ let mixed=0;
+ $('spheres').replaceChildren(...current.qubits.map((name,q)=>{
+ const vector=bloch(state,q);if(vector.purity<.999999)mixed++;
+ const card=node('div',{class:'sphere'}),canvas=node('canvas',{role:'img','aria-label':name+' Bloch sphere; purity '+vector.purity.toFixed(3)});
+ card.append(node('span',{class:'qubit-name'},name),canvas);
+ sphere(canvas,vector);
+ const purity=node('div',{class:'purity'});purity.append(document.createTextNode('Purity '),node('b',{},vector.purity.toFixed(3)),document.createTextNode(vector.purity<.999999?' · mixed':' · pure'));
+ card.append(purity,node('div',{class:'values'},'x '+vector.x.toFixed(2)+' y '+vector.y.toFixed(2)+' z '+vector.z.toFixed(2)));
+ let drag;
+ canvas.onpointerdown=event=>{canvas.setPointerCapture(event.pointerId);drag={x:event.clientX,y:event.clientY};};
+ canvas.onpointermove=event=>{
+ if(!drag)return;
+ camera.y+=(event.clientX-drag.x)*.012;camera.x=Math.max(-1.2,Math.min(1.2,camera.x+(event.clientY-drag.y)*.008));drag={x:event.clientX,y:event.clientY};
+ document.querySelectorAll('.sphere canvas').forEach((cv,index)=>sphere(cv,bloch(state,index)));
+ };
+ canvas.onpointerup=canvas.onpointercancel=()=>{drag=null;};
+ return card;
+ }));
+ $('state-note').replaceChildren();
+ $('state-note').append(node('strong',{},mixed?'Entangled, not broken. ':'A pure local state. '),document.createTextNode(mixed?'An arrow inside the sphere means that qubit cannot be described independently as a pure state. The full circuit is still a normalized pure state.':'An arrow on the surface describes a pure qubit. Its direction encodes relative phase and the probabilities of 0 and 1.'));
+}
+function drawProbabilities() {
+ const probs=probabilities(state);
+ $('probabilities').replaceChildren(...probs.map((p,i)=>{
+ const row=node('div',{class:'prob-row','data-basis':basisLabel(i,current.qubits.length)});
+ row.append(node('span',{class:'ket'},'|'+basisLabel(i,current.qubits.length)+'⟩'));
+ const track=node('div',{class:'bar'}),bar=node('div',{class:'expected'});
+ bar.style.width=Math.max(0,Math.min(100,p*100))+'%';track.append(bar);
+ if(counts){const observed=node('div',{class:'observed'});observed.style.width=counts[i]/counts.reduce((a,b)=>a+b,0)*100+'%';track.append(observed);}
+ const label=node('span',{class:'value'},(p*100).toFixed(1)+'%');
+ if(counts)label.append(node('br'),node('small',{},counts[i]+' shots'));
+ row.append(track,label);return row;
+ }));
+ $('basis-order').textContent='Bit order: |'+[...current.qubits].reverse().join(' ')+ '⟩ · q0 is the rightmost bit';
+ $('sample-status').textContent=counts?counts.reduce((a,b)=>a+b,0)+' simulated shots · light bars show frequencies':'Exact probabilities before readout · ideal, noiseless simulation';
+}
+function drawAmplitudes() {
+ const amplitudes=[];
+ for(let i=0;i<state.length/2;i++){
+ const real=state[2*i],imag=state[2*i+1];
+ if(real*real+imag*imag<1e-12)continue;
+ const phase=Math.atan2(imag,real),row=node('div',{class:'amplitude'}),left=node('span',{},'|'+basisLabel(i,current.qubits.length)+'⟩ '+real.toFixed(3)+(imag<0?' − ':' + ')+Math.abs(imag).toFixed(3)+'i');
+ const right=node('span',{class:'phase'});
+ const svg=document.createElementNS('http://www.w3.org/2000/svg','svg');svg.setAttribute('width','24');svg.setAttribute('height','24');svg.setAttribute('viewBox','0 0 24 24');
+ const circle=document.createElementNS(svg.namespaceURI,'circle');circle.setAttribute('cx','12');circle.setAttribute('cy','12');circle.setAttribute('r','9');circle.setAttribute('fill','none');circle.setAttribute('stroke','#8abadd55');
+ const line=document.createElementNS(svg.namespaceURI,'line');
+ for(const [key,value] of Object.entries({x1:12,y1:12,x2:12+Math.cos(phase)*8,y2:12-Math.sin(phase)*8,stroke:'#ffb26b','stroke-width':1.5}))line.setAttribute(key,value);
+ svg.append(circle,line);right.append(svg,document.createTextNode((phase*180/Math.PI).toFixed(0)+'°'));row.append(left,right);amplitudes.push(row);
+ }
+ $('amplitudes').replaceChildren(...amplitudes);
+}
+$('gate').replaceChildren(...GATE_NAMES.map(name=>node('option',{value:name},name)));
+for(const id of ['gate','target','control'])$(id).onchange=()=>{if(id==='gate')selected=-1;syncComposer();$('remove').disabled=selected<0;};
+$('theta').oninput=()=>{
+ syncComposer();
+ if(selected>=0 && rotation(current.gates[selected].gate)){
+ const keep=selected,next=clone(current);next.gates[selected].theta=Number($('theta').value)*Math.PI/180;
+ edit(next);selected=keep;render();
+ }
+};
+$('add').onclick=()=>{
+ const next=clone(current),gate=$('gate').value,op={gate,target:Number($('target').value)};
+ if(dual(gate))op.control=Number($('control').value);
+ if(rotation(gate))op.theta=Number($('theta').value)*Math.PI/180;
+ const readout=next.gates.findIndex(op=>op.gate==='measure');
+ next.gates.splice(readout<0?next.gates.length:readout,0,op);
+ selected=-1;activePreset='';edit(next);
+};
+$('remove').onclick=()=>{if(selected<0)return;const next=clone(current);next.gates.splice(selected,1);selected=-1;activePreset='';edit(next);};
+function setStep(value){step=Number(value);counts=null;selected=-1;render();}
+$('step').oninput=event=>setStep(event.target.value);
+$('back').onclick=()=>setStep(Math.max(0,step-1));
+$('forward').onclick=()=>setStep(Math.min(current.gates.length,step+1));
+$('undo').onclick=()=>{if(!past.length)return;future.push(clone(current));current=past.pop();step=current.gates.length;selected=-1;counts=null;activePreset='';configure();render();};
+$('redo').onclick=()=>{if(!future.length)return;past.push(clone(current));current=future.pop();step=current.gates.length;selected=-1;counts=null;configure();render();};
+document.querySelectorAll('[data-preset]').forEach(button=>button.onclick=()=>{
+ activePreset=button.dataset.preset;selected=-1;
+ edit(activePreset==='source'?original:PRESETS[activePreset]);
+ if(activePreset==='phase'){$('gate').value='RZ';$('theta').value='90';selected=1;syncComposer();render();}
+});
+$('measure').onclick=()=>{counts=sampleShots(state,Number($('shots').value));drawProbabilities();};
+$('shots').onchange=()=>edit({...current,shots:Number($('shots').value)});
+$('import').onclick=()=>$('upload').click();
+$('upload').onchange=async event=>{
+ const file=event.target.files[0];if(!file)return;
+ try{
+ if(file.size>1024*1024)throw new Error('Choose a circuit JSON smaller than 1 MB.');
+ const next=JSON.parse(await file.text());validateCircuit(next);activePreset='';selected=-1;edit(next);
+ }catch(error){message(error);}
+ event.target.value='';
+};
+$('download').onclick=()=>{
+ const blob=new Blob([JSON.stringify(current,null,2)+'\n'],{type:'application/json'});
+ const url=URL.createObjectURL(blob),link=node('a',{href:url,download:'circuit.json'});link.click();setTimeout(()=>URL.revokeObjectURL(url),30000);
+ $('edited').textContent='Exported · replace circuit.json to persist';
+};
+configure();render();
diff --git a/store/agents/quantum-studio/store.json b/store/agents/quantum-studio/store.json
new file mode 100644
index 000000000..54c1de647
--- /dev/null
+++ b/store/agents/quantum-studio/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/quantum-studio",
+ "upstream": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/quantum-studio",
+ "license": "MIT",
+ "tagline": "Edit circuits and see superposition, phase and entanglement",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/quantum-studio/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Build a Bell pair and show me its amplitudes, measurement probabilities and local Bloch states.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/quantum-studio/starter.jpg",
+ "caption": "Bell state · step, edit, sample and export"
+ }
+ ]
+}
diff --git a/store/agents/quantum-studio/template/circuit.json b/store/agents/quantum-studio/template/circuit.json
new file mode 100644
index 000000000..6b7e406e0
--- /dev/null
+++ b/store/agents/quantum-studio/template/circuit.json
@@ -0,0 +1,9 @@
+{
+ "name": "Bell state",
+ "qubits": ["q0", "q1"],
+ "gates": [
+ { "gate": "H", "target": 0 },
+ { "gate": "CX", "control": 0, "target": 1 }
+ ],
+ "shots": 1024
+}
diff --git a/store/agents/quantum-studio/template/proof.json b/store/agents/quantum-studio/template/proof.json
new file mode 100644
index 000000000..4dd70593f
--- /dev/null
+++ b/store/agents/quantum-studio/template/proof.json
@@ -0,0 +1,9 @@
+{
+ "actions": [
+ { "selector": "[data-preset=phase]", "click": true },
+ { "selector": "#theta", "fill": "180" },
+ { "selector": "[data-basis='1'] .value", "text": "100.0%" },
+ { "selector": "#theta", "fill": "90" },
+ { "selector": "[data-basis='1'] .value", "text": "50.0%" }
+ ]
+}
diff --git a/store/agents/quantum-studio/test/build.test.mjs b/store/agents/quantum-studio/test/build.test.mjs
new file mode 100644
index 000000000..52565b338
--- /dev/null
+++ b/store/agents/quantum-studio/test/build.test.mjs
@@ -0,0 +1,27 @@
+import assert from 'node:assert/strict';
+import { readFile, writeFile, mkdtemp, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { test } from 'node:test';
+import { build } from '../skills/quantum/scripts/build.mjs';
+
+test('the real build safely embeds data and clears an old success verdict on a failed rebuild',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'quantum-build-'));
+ try{
+ await writeFile(join(workspace,'circuit.json'),JSON.stringify({name:'</script><script>alert("x")</script> $&',qubits:['q0'],gates:[{gate:'H',target:0}]}));
+ const result=await build(workspace);
+ assert.equal(result.probabilities.length,2);
+ const html=await readFile(join(workspace,'index.html'),'utf8');
+ assert.doesNotMatch(html,/<script>alert/);
+ assert.match(html,/\\u003c\/script>/);
+ assert.match(html,/\$&/);
+ assert.equal(JSON.parse(await readFile(join(workspace,'.harness/verdict.json'),'utf8')).ready,true);
+ await writeFile(join(workspace,'circuit.json'),'{"qubits":["q0"],"gates":[{"gate":"CX","control":0,"target":0}]}');
+ await assert.rejects(build(workspace),/different qubits/);
+ const verdict=JSON.parse(await readFile(join(workspace,'.harness/verdict.json'),'utf8'));
+ assert.equal(verdict.ready,false);
+ assert.equal(verdict.artifact,null);
+ assert.match(verdict.findings[0].message,/different qubits/);
+ assert.equal(await readFile(join(workspace,'index.html'),'utf8'),html,'a failed build preserves the previous artifact while reporting failure');
+ }finally{await rm(workspace,{recursive:true,force:true});}
+});
diff --git a/store/agents/quantum-studio/test/engine.test.mjs b/store/agents/quantum-studio/test/engine.test.mjs
new file mode 100644
index 000000000..235e13ac5
--- /dev/null
+++ b/store/agents/quantum-studio/test/engine.test.mjs
@@ -0,0 +1,67 @@
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { validateCircuit,simulate,probabilities,bloch,sampleShots,basisLabel } from '../skills/quantum/scripts/engine.mjs';
+const circuit=(gates,n=1)=>({qubits:Array.from({length:n},(_,i)=>'q'+i),gates});
+const close=(a,b)=>assert.ok(Math.abs(a-b)<1e-10,a+' != '+b);
+
+test('bitstrings use q0 as the rightmost bit; named gates produce known complex amplitudes',()=>{
+ assert.deepEqual(probabilities(simulate(circuit([{gate:'X',target:0}],3))),[0,1,0,0,0,0,0,0]);
+ assert.equal(basisLabel(1,3),'001');
+ const y=simulate(circuit([{gate:'Y',target:0}]));
+ close(y[2],0);close(y[3],1);
+ const h=simulate(circuit([{gate:'H',target:0}]));
+ close(h[0],Math.SQRT1_2);close(h[2],Math.SQRT1_2);
+});
+test('Bloch poles and complex phase signs are correct',()=>{
+ close(bloch(simulate(circuit([])),0).z,1);
+ close(bloch(simulate(circuit([{gate:'X',target:0}])),0).z,-1);
+ close(bloch(simulate(circuit([{gate:'H',target:0}])),0).x,1);
+ close(bloch(simulate(circuit([{gate:'H',target:0},{gate:'S',target:0}])),0).y,1);
+});
+test('Bell and GHZ states have the correct joint probabilities and locally mixed states',()=>{
+ const bell=simulate(circuit([{gate:'H',target:0},{gate:'CX',control:0,target:1}],2));
+ const p=probabilities(bell);
+ close(p[0],.5);close(p[3],.5);close(p[1]+p[2],0);
+ for(const q of [0,1]){close(bloch(bell,q).length,0);close(bloch(bell,q).purity,.5);}
+ const ghz=simulate(circuit([{gate:'H',target:0},{gate:'CX',control:0,target:1},{gate:'CX',control:1,target:2}],3));
+ close(probabilities(ghz)[0],.5);close(probabilities(ghz)[7],.5);
+ const partial=new Float64Array([Math.sqrt(.8),0,0,0,0,0,Math.sqrt(.2),0]);
+ close(bloch(partial,0).length,.6);close(bloch(partial,0).purity,.68);
+});
+test('inverse pairs, phase interference, controlled Z and SWAP preserve the expected state',()=>{
+ for(const [gate,inverse] of [['H','H'],['X','X'],['Y','Y'],['Z','Z'],['S','SDG'],['T','TDG']]){
+ close(simulate(circuit([{gate,target:0},{gate:inverse,target:0}]))[0],1);
+ }
+ for(const gate of ['RX','RY','RZ']){
+ const state=simulate(circuit([{gate,target:0,theta:.723},{gate,target:0,theta:-.723}]));
+ close(state[0],1);close(state[2],0);
+ }
+ const interference=simulate(circuit([{gate:'H',target:0},{gate:'RZ',target:0,theta:Math.PI},{gate:'H',target:0}]));
+ close(probabilities(interference)[1],1);
+ close(probabilities(simulate(circuit([{gate:'X',target:0},{gate:'SWAP',control:0,target:1}],2)))[2],1);
+ const cz=simulate(circuit([{gate:'X',target:0},{gate:'X',target:1},{gate:'CZ',control:0,target:1}],2));
+ close(cz[6],-1);
+});
+test('invalid targets, controls, angles, matrices and mid-circuit measurements fail explicitly',()=>{
+ for(const gates of [[{gate:'H',target:-1}],[{gate:'H',target:1.5}],[{gate:'H',target:8}],[{gate:'CX',control:0,target:0}],[{gate:'CX',target:1}],[{gate:'RY',target:0,theta:NaN}],[{gate:'bogus',target:0,matrix:[1]}],[{gate:'measure',target:0},{gate:'H',target:1}]]){
+ assert.throws(()=>simulate(circuit(gates,2)));
+ }
+ assert.throws(()=>validateCircuit({qubits:['a','a'],gates:[]}));
+ assert.throws(()=>simulate(circuit([]),-1));
+ assert.throws(()=>validateCircuit(circuit([],9)));
+});
+test('terminal readout is explicitly premeasurement; Born-rule shots match deterministic and Bell states',()=>{
+ const state=simulate(circuit([{gate:'H',target:0},{gate:'CX',control:0,target:1},{gate:'measure',target:0},{gate:'measure',target:1}],2));
+ let sample=0;
+ assert.deepEqual(sampleShots(state,100,()=>((sample++)+.5)/100),[50,0,0,50]);
+ assert.deepEqual(sampleShots(simulate(circuit([{gate:'X',target:0}])),10),[0,10]);
+ assert.throws(()=>sampleShots(state,0));
+ assert.throws(()=>sampleShots(state,10,()=>1));
+});
+test('stepping inspects the actual intermediate state',()=>{
+ const cfg=circuit([{gate:'H',target:0},{gate:'CX',control:0,target:1}],2);
+ close(probabilities(simulate(cfg,0))[0],1);
+ close(probabilities(simulate(cfg,1))[1],.5);
+ close(bloch(simulate(cfg,1),0).purity,1);
+ close(bloch(simulate(cfg,2),0).purity,.5);
+});
diff --git a/store/agents/quantum-studio/test/toolchain.test.mjs b/store/agents/quantum-studio/test/toolchain.test.mjs
new file mode 100755
index 000000000..1fd5fa4af
--- /dev/null
+++ b/store/agents/quantum-studio/test/toolchain.test.mjs
@@ -0,0 +1,84 @@
+// Quantum Studio's scripts, run the way Harness runs them: by path, in the directory Harness gives
+// them, with the environment Harness sets.
+//
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync, chmodSync, mkdirSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const dir of scratch) rmSync(dir, { recursive: true, force: true }) })
+
+function tempDir() { const d = mkdtempSync(join(tmpdir(), 'quantum-')); scratch.push(d); return d }
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [k, v] of Object.entries(env)) if (v === null) delete merged[k]; else merged[k] = v
+ const r = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: r.status, stdout: r.stdout, stderr: r.stderr }
+}
+
+/** A fake `node` that a successful headless proof prints: SIM OK qubits=N gates=M. */
+function fakeNode() {
+ const dir = tempDir(); const bin = join(dir, 'node')
+ writeFileSync(bin, '#!/bin/sh\necho "SIM OK qubits=2 gates=3"\nexit 0\n'); chmodSync(bin, 0o755)
+ return { dir, bin }
+}
+
+test('every script the manifest names is in the folder and executable', () => {
+ for (const s of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor,
+ 'skills/quantum/scripts/build-quantum.sh', 'skills/quantum/scripts/proof.mjs'])
+ assert.doesNotThrow(() => accessSync(join(here, s), constants.X_OK), s)
+})
+
+test('setup finds node on PATH and says ok', () => {
+ const { dir } = fakeNode()
+ const { code, stdout } = run(manifest.toolchain.setup, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0); assert.match(stdout, /ok node/)
+})
+
+test('doctor says ok when node is on PATH', () => {
+ const { dir } = fakeNode()
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: `${dir}:/usr/bin:/bin` } })
+ assert.equal(code, 0); assert.match(stdout, /ok node/)
+})
+
+test('doctor says miss and fails when node is absent', () => {
+ const { code, stdout } = run(manifest.toolchain.doctor, { env: { PATH: tempDir() } })
+ assert.equal(code, 1); assert.match(stdout, /miss node/)
+})
+
+test('init seeds the first verdict and the initialized marker', () => {
+ const ws = tempDir()
+ assert.equal(run(manifest.workspace.init, { cwd: ws, env: { HARNESS_DSH: manifest.id } }).code, 0)
+ assert.equal(JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8')).ready, false)
+ assert.ok(existsSync(join(ws, '.harness-initialized')))
+})
+
+test('build-quantum.sh proves, rebuilds index.html and flips the verdict, as SKILL.md documents', () => {
+ const skill = readFileSync(join(here, 'skills/quantum/SKILL.md'), 'utf8')
+ const command = 'sh "$QUANTUM_SKILLS/quantum/scripts/build-quantum.sh"'
+ assert.ok(skill.includes(command))
+ assert.equal(manifest.agent.env.QUANTUM_SKILLS, '${dsh}/skills')
+
+ const ws = tempDir()
+ mkdirSync(join(ws, '.harness'), { recursive: true })
+ writeFileSync(join(ws, 'circuit.json'),
+ JSON.stringify({ name: 't', qubits: ['q0', 'q1'], gates: [{ gate: 'H', target: 0 }] }, null, 2))
+ const r = spawnSync('/bin/sh', ['-c', command], {
+ cwd: ws,
+ env: { ...process.env, QUANTUM_SKILLS: join(here, 'skills'), HARNESS_WORKSPACE: ws },
+ encoding: 'utf8',
+ })
+ assert.equal(r.status, 0, `${r.stderr || ''} ${r.stdout || ''}`)
+ assert.ok(existsSync(join(ws, 'index.html')))
+ const verdict = JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8'))
+ assert.equal(verdict.ready, true)
+ assert.equal(verdict.artifact, 'index.html')
+ assert.match(verdict.summary, /2 qubits, 1 gates/)
+})
diff --git a/store/agents/quantum-studio/toolchain/doctor.sh b/store/agents/quantum-studio/toolchain/doctor.sh
new file mode 100755
index 000000000..bf13e471f
--- /dev/null
+++ b/store/agents/quantum-studio/toolchain/doctor.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Exit 0 when this machine can run Quantum Studio. One line per check; Harness shows them.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+fail=0
+if command -v node >/dev/null 2>&1; then
+ echo "ok node on PATH ($(command -v node))"
+else
+ echo "miss node — run toolchain/setup.sh (Node 18+ for the proof/tests)"
+ fail=1
+fi
+if command -v python3 >/dev/null 2>&1; then
+ echo "ok python3 on PATH (optional)"
+else
+ echo "warn python3 not found (optional)"
+fi
+[ -d "$(dirname "$0")/../skills/quantum" ] && echo "ok quantum skill" || echo "warn quantum skill missing"
+exit $fail
diff --git a/store/agents/quantum-studio/toolchain/init-workspace.sh b/store/agents/quantum-studio/toolchain/init-workspace.sh
new file mode 100755
index 000000000..2134fd66d
--- /dev/null
+++ b/store/agents/quantum-studio/toolchain/init-workspace.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Quantum workspace ready — describe a circuit to simulate",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Quantum workspace initialized by %s\n' "${HARNESS_DSH:-quantum-studio}" > .harness-initialized
+if [ -f circuit.json ]; then
+ script_dir="$(CDPATH= cd "$(dirname "$0")" && pwd)"
+ node "$script_dir/../skills/quantum/scripts/build.mjs"
+fi
diff --git a/store/agents/quantum-studio/toolchain/setup.sh b/store/agents/quantum-studio/toolchain/setup.sh
new file mode 100755
index 000000000..b5b859201
--- /dev/null
+++ b/store/agents/quantum-studio/toolchain/setup.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Verify the tools Quantum Studio needs. cwd = the package install dir.
+# The simulator is fully browser-native, so the only host tool is Node for the headless proof/tests.
+set -u
+dsh="${HARNESS_DSH_DIR:-$PWD}"
+
+if command -v node >/dev/null 2>&1; then
+ echo "ok node on PATH ($(command -v node) $(node --version 2>/dev/null))"
+else
+ echo "miss node — Quantum Studio needs Node 18+ only for its headless proof and tests."
+ echo " Install from https://nodejs.org or 'brew install node', then re-run setup."
+ exit 1
+fi
+
+if command -v python3 >/dev/null 2>&1; then
+ echo "ok python3 on PATH (optional, for extra analysis scripts)"
+else
+ echo "warn python3 not found — optional; not required to run the simulator"
+fi
+[ -d "$dsh/skills/quantum" ] && echo "ok quantum skill" || echo "warn quantum skill missing"
+exit 0
diff --git a/store/agents/score/.gitignore b/store/agents/score/.gitignore
new file mode 100644
index 000000000..aa4afc7ff
--- /dev/null
+++ b/store/agents/score/.gitignore
@@ -0,0 +1,2 @@
+# Never committed.
+node_modules/
diff --git a/store/agents/score/AGENTS.md b/store/agents/score/AGENTS.md
new file mode 100644
index 000000000..486c1b472
--- /dev/null
+++ b/store/agents/score/AGENTS.md
@@ -0,0 +1,16 @@
+# Score harness
+
+Read the `score` skill. Compose in `score.ly` and run:
+
+```sh
+sh "$SCORE_SKILLS/score/scripts/render-score.sh"
+```
+
+The live artifact is `score.html`; preserve PDF, MIDI and editable source.
+Inspect every PDF page and check MIDI timing plus the actual playback controls.
+Report the difference between clean engraving and musical correctness. Never
+count literal bar characters as measures or call a synthesized sketch a recording.
+
+Use trusted LilyPond input only; it can execute Scheme. Do not silently substitute
+a MuseScore CLI. Fresh builds must produce PDF, SVG and MIDI; a failure must clear
+readiness even if old artifacts remain. Browser tempo changes do not edit source.
diff --git a/store/agents/score/LICENSE b/store/agents/score/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/score/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/score/PROVENANCE.md b/store/agents/score/PROVENANCE.md
new file mode 100644
index 000000000..795d5fb21
--- /dev/null
+++ b/store/agents/score/PROVENANCE.md
@@ -0,0 +1,10 @@
+# Provenance
+
+The Folio viewer, MIDI parser, wrapper instructions and “Lighthouse at Dusk”
+composition are original OpenHarness work under the included MIT license.
+
+[LilyPond](https://lilypond.org) is the separately installed notation engine,
+licensed GPL-3.0-or-later. Tested with the official 2.26.0 macOS Intel distribution.
+No LilyPond code, binary, font or sample library is redistributed in this package.
+The viewer displays user-generated engraving as images and uses native Web Audio
+oscillators; no external music, soundfont or audio service is used.
diff --git a/store/agents/score/README.md b/store/agents/score/README.md
new file mode 100644
index 000000000..8bbfd23e1
--- /dev/null
+++ b/store/agents/score/README.md
@@ -0,0 +1,51 @@
+# Score · Folio
+
+Compose in text; read and hear the result. Folio combines LilyPond's real
+engraving with a local MIDI sketch: play/pause, seek, change playback speed,
+adjust volume and zoom the score. Download the printable PDF or the MIDI.
+
+The starter, **Lighthouse at Dusk**, is an original 16-bar piano study in E minor,
+6/8. It engraves to one page and 142 MIDI notes (about 35.6 seconds).
+
+## First run
+
+Install `autonomous/score` from the Harness Store and install
+[LilyPond](https://lilypond.org/download.html) separately. Tested with 2.26.0;
+the source targets 2.24.3 or later. Set `LILYPOND_BIN` if it is not on PATH.
+The managed helper finds Node 20+ without a global npm installation.
+
+```sh
+sh "$SCORE_SKILLS/score/scripts/render-score.sh"
+```
+
+Ask: “Turn the opening into a gentle duet, keep the 6/8 pulse, and render a
+score I can print and listen through.” Edit `score.ly`, then rebuild. The pane
+shows `score.html`; the durable outputs are `score.pdf`, `score.midi` and the
+editable source. Browser tempo/volume/position changes are listening controls,
+not saved changes to the composition.
+
+## Verification and limits
+
+Each build starts unready, invokes LilyPond twice for fresh PDF and SVG pages,
+treats warnings as errors, and parses MIDI note timing. Missing output or bad
+source fails without claiming an old score is new. Inspect `.harness/render.log`
+and `.harness/score.json`. Actual engraving and desktop/mobile browser controls
+were checked; unit fixtures also cover note timing and failure handling.
+
+Playback is a simple triangle-wave sketch, not a sampled piano or a human
+performance. It ignores sustain pedal, instrument changes and expressive
+controllers. MIDI type 0/1 with PPQ timing is supported; maximum preview is
+10,000 notes, one hour and 40 engraved pages. It does not prove a piece is
+playable, musically correct or licensed for use. A `|` in LilyPond is a bar
+**check**, not an instruction that ends a bar; no literal-character measure
+count is reported.
+
+This workflow supports LilyPond sources with layout and MIDI blocks.
+MuseScore conversion is not implemented. LilyPond source can execute Scheme;
+only render trusted sources.
+
+## Credit and stewardship
+
+LilyPond is the LilyPond project's separately installed GPL notation engine.
+The MIT-licensed Folio wrapper, viewer, MIDI inspector and starter composition
+are original OpenHarness work. No LilyPond binary or source is vendored.
diff --git a/store/agents/score/harness.json b/store/agents/score/harness.json
new file mode 100644
index 000000000..bfded0a2e
--- /dev/null
+++ b/store/agents/score/harness.json
@@ -0,0 +1,31 @@
+{
+ "spec": 1,
+ "id": "autonomous/score",
+ "name": "Score",
+ "category": "Music",
+ "author": "OpenHarness contributors",
+ "description": "Compose editable LilyPond music, engrave a real PDF, and explore its MIDI notes with a local playback and score viewer.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "score.ly",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": ["skills"],
+ "env": {
+ "SCORE_TOOLCHAIN": "${dsh}/toolchain",
+ "SCORE_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [".html"]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/score/package.json b/store/agents/score/package.json
new file mode 100644
index 000000000..6b646e7aa
--- /dev/null
+++ b/store/agents/score/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/score-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/score/skills/score/SKILL.md b/store/agents/score/skills/score/SKILL.md
new file mode 100644
index 000000000..531ed86eb
--- /dev/null
+++ b/store/agents/score/skills/score/SKILL.md
@@ -0,0 +1,40 @@
+---
+name: score
+description: Compose trusted LilyPond source, engrave real PDF/SVG pages, inspect MIDI timing and audition notes in the Folio preview. Use for Score harness work.
+---
+
+# Compose, engrave, audition
+
+1. Read `score.ly`. Keep key, meter, tempo, voices, dynamics and instrument names
+ explicit. The original piano study is a starting point, not a musical constraint.
+2. Keep both `\layout { }` and `\midi { }` blocks. Run:
+
+ ```sh
+ sh "$SCORE_SKILLS/score/scripts/render-score.sh"
+ ```
+
+3. LilyPond runs with warnings treated as errors. Correct bar checks, syntax and
+ collisions rather than suppressing warnings. A `|` checks bar position; it
+ does not end a bar. Count musical durations, not literal characters.
+4. Inspect all PDF pages for spacing, collisions, page turns, staff labels and
+ legibility. The fresh receipt reports engraved pages and MIDI notes, not a
+ fabricated measure count.
+5. Use Folio play/pause, seeking, slowdown and the pitch timeline to inspect the
+ actual exported notes. Make compositional edits in source and rebuild.
+6. Hand off `score.pdf`, `score.midi` and `score.ly`. State which checks ran.
+
+## Boundaries
+
+Requires LilyPond (tested 2.26.0) and Node 20+. `LILYPOND_BIN` overrides the
+binary. This workflow does not implement MuseScore export. Only trusted input:
+LilyPond can execute Scheme and read local files.
+
+Fresh staged builds preserve old artifacts on compilation failure and set
+`ready: false`. See `.harness/render.log`. Do not treat previous output as a
+successful new render. Ready means engraving plus MIDI parsing, not proof of
+musical correctness, performability or playback fidelity.
+
+The browser uses a deliberately simple local synth. Pedal/controllers,
+instrument timbres and human expression are not reproduced. Listening controls
+do not persist. The parser supports type 0/1 PPQ MIDI, not SMPTE timing; preview
+limits are 10,000 notes, one hour and 40 SVG pages.
diff --git a/store/agents/score/skills/score/scripts/build.mjs b/store/agents/score/skills/score/scripts/build.mjs
new file mode 100644
index 000000000..ea5a04dfa
--- /dev/null
+++ b/store/agents/score/skills/score/scripts/build.mjs
@@ -0,0 +1,33 @@
+import {readFile,writeFile,mkdir,mkdtemp,readdir,rename,rm,copyFile,access} from 'node:fs/promises';
+import {spawnSync} from 'node:child_process';import {resolve,join} from 'node:path';import {pathToFileURL} from 'node:url';
+import {parseMidi} from './midi.mjs';
+const ws=resolve(process.env.HARNESS_WORKSPACE||process.cwd()),meta=join(ws,'.harness');await mkdir(meta,{recursive:true});
+const verdict=async(ready,summary,findings=[])=>writeFile(join(meta,'verdict.json'),JSON.stringify({spec:1,ready,summary,findings,artifact:ready?'score.html':null,updatedAt:new Date().toISOString()},null,2)+'\n');
+await verdict(false,'Engraving source and checking note timing…');let stage,log='';
+try{
+ const source=await readFile(join(ws,'score.ly'),'utf8');if(source.length>1024*1024)throw new Error('Score source exceeds 1 MiB.');
+ const bin=process.env.LILYPOND_BIN||'lilypond';stage=await mkdtemp(join(meta,'score-'));
+ const run=args=>{const r=spawnSync(bin,args,{cwd:ws,encoding:'utf8',timeout:120000,maxBuffer:8*1024*1024});log+=(r.stdout||'')+(r.stderr||'');if(r.error||r.status!==0)throw new Error(r.error?.message||'LilyPond rejected the score; inspect .harness/render.log.');};
+ const prefix=join(stage,'score');run(['-dwarning-as-error','--pdf','-o',prefix,join(ws,'score.ly')]);
+ const pdf=await readFile(prefix+'.pdf');if(pdf.length<100||pdf.subarray(0,5).toString()!=='%PDF-')throw new Error('LilyPond produced no fresh PDF.');
+ let midiFile=(await readdir(stage)).find(name=>/^score\.(midi|mid)$/.test(name));if(!midiFile)throw new Error('Add a MIDI block to the score: no fresh MIDI was produced.');
+ const midi=parseMidi(await readFile(join(stage,midiFile)));if(midi.notes.length>10000||midi.duration>3600)throw new Error('Playback preview is limited to 10,000 notes and one hour.');
+ run(['-dwarning-as-error','--svg','-o',prefix,join(ws,'score.ly')]);
+ const svg=(await readdir(stage)).filter(name=>/^score(?:-\d+)?\.svg$/.test(name)).sort((a,b)=>a.localeCompare(b,undefined,{numeric:true}));if(!svg.length||svg.length>40)throw new Error('Expected 1–40 SVG score pages.');
+ const pages=[];for(const name of svg){const content=await readFile(join(stage,name),'utf8');if(content.length<100||!content.includes('<svg'))throw new Error('Invalid engraved SVG page.');pages.push(name);}
+ const title=source.match(/\btitle\s*=\s*"([^"]+)"/)?.[1]||'Untitled score';
+ const data={title,pages:pages.map(name=>'score-assets/'+name),midi};
+ const template=await readFile(new URL('preview.html',import.meta.url),'utf8'),app=await readFile(new URL('preview.js',import.meta.url),'utf8');
+ const safe=JSON.stringify(data).replace(/</g,'\\u003c').replace(/\u2028/g,'\\u2028').replace(/\u2029/g,'\\u2029');
+ await writeFile(join(stage,'score.html'),template.replace('__CONFIG__',()=>safe).replace('/*APP*/',()=>app));
+ const assets=join(stage,'assets');await mkdir(assets);for(const name of pages)await rename(join(stage,name),join(assets,name));
+ // Back up only the generated assets directory; never remove source files.
+ const destination=join(ws,'score-assets'),backup=join(stage,'previous-assets');let hadOld=false;
+ try{await rename(destination,backup);hadOld=true;}catch(error){if(error.code!=='ENOENT')throw error;}
+ try{await rename(assets,destination);}catch(error){if(hadOld)await rename(backup,destination);throw error;}
+ await rename(prefix+'.pdf',join(ws,'score.pdf'));await copyFile(join(stage,midiFile),join(ws,'score.midi'));await rename(join(stage,'score.html'),join(ws,'score.html'));
+ await writeFile(join(meta,'score.json'),JSON.stringify({pages:pages.length,notes:midi.notes.length,durationSeconds:midi.duration},null,2)+'\n');
+ await verdict(true,pages.length+' engraved page'+(pages.length===1?'':'s')+' · '+midi.notes.length+' MIDI notes',[{severity:'info',kind:'playback',message:'Simple synthesized MIDI preview, not a performance or proof of musical correctness.'}]);
+ console.log('ok LilyPond → score.pdf + score.midi + score.html');
+}catch(error){await verdict(false,'Score render failed',[{severity:'error',kind:'render',message:error.message}]);console.error(error.message);process.exitCode=1;}
+finally{await writeFile(join(meta,'render.log'),log);if(stage)await rm(stage,{recursive:true,force:true});}
diff --git a/store/agents/score/skills/score/scripts/midi.mjs b/store/agents/score/skills/score/scripts/midi.mjs
new file mode 100644
index 000000000..74a645841
--- /dev/null
+++ b/store/agents/score/skills/score/scripts/midi.mjs
@@ -0,0 +1,30 @@
+// Standard MIDI File reader for note timing and a deliberately simple synth preview.
+export function parseMidi(input){
+ const b=Buffer.from(input);let p=0;
+ const need=n=>{if(p+n>b.length)throw new Error('Truncated MIDI.');};
+ const u8=()=>{need(1);return b[p++];},u16=()=>u8()*256+u8(),u32=()=>u16()*65536+u16();
+ const tag=()=>String.fromCharCode(u8(),u8(),u8(),u8());
+ if(tag()!=='MThd'||u32()!==6)throw new Error('Invalid MIDI header.');
+ const format=u16(),count=u16(),division=u16();if(format>1||!count||count>64||!division||(division&0x8000))throw new Error('Only type 0/1 PPQ MIDI is supported.');
+ const events=[],tempos=[{tick:0,tempo:500000}];let maxTick=0;
+ const vlq=()=>{let v=0;for(let i=0;i<4;i++){const n=u8();v=v*128+(n&127);if(!(n&128))return v;}throw new Error('Invalid MIDI variable length.');};
+ for(let track=0;track<count;track++){
+ if(tag()!=='MTrk')throw new Error('Missing MIDI track.');const length=u32(),end=p+length;need(length);let tick=0,running=0;
+ while(p<end){tick+=vlq();maxTick=Math.max(maxTick,tick);let status=u8();if(status<128){if(!running)throw new Error('Missing MIDI running status.');p--;status=running;}else if(status<240)running=status;
+ if(status===255){const type=u8(),len=vlq();need(len);if(type===81&&len===3)tempos.push({tick,tempo:b[p]*65536+b[p+1]*256+b[p+2]});p+=len;continue;}
+ if(status===240||status===247){const len=vlq();need(len);p+=len;running=0;continue;}
+ const kind=status>>4,ch=status&15;if(kind<8||kind>14)throw new Error('Unsupported MIDI status.');
+ const a=u8(),v=kind===12||kind===13?0:u8();if(a>127||v>127)throw new Error('Invalid MIDI data byte.');
+ if(kind===8||kind===9)events.push({tick,track,ch,pitch:a,velocity:v,on:kind===9&&v>0});
+ if(events.length>100000)throw new Error('MIDI preview is limited to 100,000 note events.');
+ }if(p!==end)throw new Error('MIDI event exceeds its track.');
+ }
+ tempos.sort((a,b)=>a.tick-b.tick);let last=0,seconds=0,tempo=500000;
+ for(const t of tempos){seconds+=(t.tick-last)*tempo/division/1e6;last=t.tick;tempo=t.tempo;if(!tempo)throw new Error('Invalid MIDI tempo.');t.seconds=seconds;}
+ const time=tick=>{let t=tempos[0];for(const item of tempos){if(item.tick>tick)break;t=item;}return t.seconds+(tick-t.tick)*t.tempo/division/1e6;};
+ events.sort((a,b)=>a.tick-b.tick);const active=new Map(),notes=[];
+ for(const event of events){const key=event.track+':'+event.ch+':'+event.pitch;if(event.on){if(!active.has(key))active.set(key,[]);active.get(key).push(event);}else{const start=active.get(key)?.shift();if(start)notes.push({pitch:event.pitch,velocity:start.velocity,track:event.track,start:time(start.tick),duration:Math.max(.01,time(event.tick)-time(start.tick))});}}
+ if([...active.values()].some(a=>a.length))throw new Error('MIDI contains unterminated notes.');
+ if(!notes.length)throw new Error('MIDI contains no notes.');
+ return {notes:notes.sort((a,b)=>a.start-b.start),duration:Math.max(time(maxTick),...notes.map(n=>n.start+n.duration)),tracks:count,tempoChanges:tempos.length-1};
+}
diff --git a/store/agents/score/skills/score/scripts/preview.html b/store/agents/score/skills/score/scripts/preview.html
new file mode 100644
index 000000000..1f93aa126
--- /dev/null
+++ b/store/agents/score/skills/score/scripts/preview.html
@@ -0,0 +1,9 @@
+<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Folio · Score studio</title><link rel="icon" href="data:,">
+<style>
+*{box-sizing:border-box}body{margin:0;background:#ecebe4;color:#253c38;font-family:Arial,sans-serif}header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #cdd1c7;padding:22px 32px}.brand{font:28px Georgia,serif;letter-spacing:-1px}.brand span{margin-right:12px;color:#af774a}.mono{font:10px monospace;letter-spacing:1.5px;color:#76867c}main{max-width:1460px;margin:auto;padding:28px 32px}.intro{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:26px}h1{font:normal 36px Georgia,serif;margin:10px 0}p{font-size:12px;line-height:1.7;color:#6b7a71;margin:0}a{color:inherit;font-size:12px;text-decoration:none;border:1px solid #aebbad;padding:11px 14px;border-radius:6px;display:inline-block}.downloads{display:flex;gap:8px}.layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:26px;align-items:start}.paper-wrap{background:#d9ddd3;border:1px solid #cad0c4;border-radius:12px;padding:24px;overflow:auto;max-height:760px}.pages{margin:auto;min-width:0}.pages img{display:block;width:100%;background:white;box-shadow:0 3px 15px #203c3814;margin-bottom:20px}.pages img:last-child{margin-bottom:0}.card{background:#f9f9f3;border:1px solid #d0d6c9;border-radius:10px;padding:21px}.card h2{font:22px Georgia,serif;margin:0 0 9px}.transport{display:flex;gap:8px;margin:21px 0}button{font:12px Arial,sans-serif;padding:12px 18px;border:1px solid #b3c1b1;border-radius:6px;background:#eaf0e4;color:#263f37;cursor:pointer}#play{background:#284c40;color:#fff;flex:1}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #a66f44;outline-offset:3px}label{display:block;font:10px monospace;letter-spacing:.8px;color:#60766a;margin:19px 0 8px}input[type=range]{width:100%;accent-color:#55795b}input[type=number]{width:70px;padding:8px;border:1px solid #b8c5b6;background:#fff;border-radius:5px;color:#284c40}.time{display:flex;justify-content:space-between;font:12px monospace;margin-top:8px}.stats{border-top:1px solid #d5ddce;margin-top:25px;padding-top:15px;display:grid;grid-template-columns:1fr 1fr;gap:18px}.stats b{font:24px Georgia,serif;display:block;margin-top:7px}.note{padding-top:20px;font-size:11px;line-height:1.7;color:#798577}.roll{margin-top:24px;padding:18px 20px;background:#203e35;border-radius:10px;color:#cfdecf}.roll canvas{display:block;width:100%;height:120px;margin-top:12px}.roll .mono{color:#9bb5a0}footer{padding-top:20px;font:10px monospace;display:flex;justify-content:space-between;gap:12px;color:#839080}#error{color:#9e372d;font-size:12px}#status{font:10px monospace;color:#6b826b;text-transform:uppercase;letter-spacing:1px}@media(max-width:850px){.layout{grid-template-columns:1fr 245px}.paper-wrap{padding:12px}main,header{padding:22px}h1{font-size:30px}}@media(max-width:620px){.intro{align-items:start;flex-direction:column}.layout{grid-template-columns:1fr}.paper-wrap{max-height:630px}.card{order:-1}.stats{grid-template-columns:repeat(3,1fr)}.note{padding-top:14px}h1{font-size:28px}.mono{font-size:8px}.transport{margin:14px 0}}
+</style>
+<header><div class="brand"><span>♮</span>Folio</div><span class="mono">SCORE / ENGRAVE · LISTEN · REFINE</span></header>
+<main><div class="intro"><div><div class="mono">FROM AN IDEA TO THE MUSIC STAND</div><h1 id="title"></h1><p>A real engraved score, with an audible sketch of the notes it contains.</p></div><div class="downloads"><a href="score.pdf" download>Score PDF ↓</a><a href="score.midi" download>MIDI ↓</a></div></div>
+<div class="layout"><section class="paper-wrap" aria-label="Engraved score"><div class="pages" id="pages"></div></section><aside class="card"><h2>Hear the shape.</h2><p>Listen, slow down, and find the phrase you want to change.</p><div class="transport"><button id="play" aria-pressed="false">Play sketch</button><button id="restart" aria-label="Restart playback">↺</button></div><div id="status" role="status">Ready to play</div><label for="seek">POSITION</label><input id="seek" type="range" min="0" step=".05" value="0"><div class="time"><span id="position">0:00</span><span id="duration"></span></div><label for="speed">PLAYBACK SPEED <span id="speed-value">1.00×</span></label><input id="speed" type="range" min=".5" max="1.5" step=".05" value="1"><label for="volume">VOLUME</label><input id="volume" type="range" min="0" max="1" step=".05" value=".35"><label for="zoom">SCORE ZOOM</label><input id="zoom" type="range" min="80" max="160" value="100"><div class="stats"><div><span class="mono">PAGES</span><b id="page-count"></b></div><div><span class="mono">MIDI NOTES</span><b id="note-count"></b></div></div><p class="note">Playback is a simple synthesized MIDI sketch, not a piano recording. Sustain pedal, sound libraries and expressive phrasing are not reproduced. The engraving and downloads come from LilyPond.</p><p id="error" role="alert"></p></aside></div>
+<section class="roll"><span class="mono">PITCH OVER TIME · LIVE PLAYHEAD</span><canvas id="roll" role="img" aria-label="MIDI note timeline with playback position"></canvas></section><footer><span>LOCAL ENGRAVING · NO AUDIO SERVICE</span><span>EDIT SCORE.LY TO COMPOSE</span></footer></main>
+<script type="application/json" id="config">__CONFIG__</script><script>/*APP*/</script></html>
diff --git a/store/agents/score/skills/score/scripts/preview.js b/store/agents/score/skills/score/scripts/preview.js
new file mode 100644
index 000000000..112d66da6
--- /dev/null
+++ b/store/agents/score/skills/score/scripts/preview.js
@@ -0,0 +1,24 @@
+const $=id=>document.getElementById(id),data=JSON.parse($('config').textContent),midi=data.midi;
+$('title').textContent=data.title;$('page-count').textContent=data.pages.length;$('note-count').textContent=midi.notes.length;
+for(const [i,page]of data.pages.entries()){const img=document.createElement('img');img.src=page;img.alt='Engraved score, page '+(i+1);$('pages').append(img);}
+const fmt=s=>Math.floor(s/60)+':'+String(Math.floor(s%60)).padStart(2,'0');
+$('duration').textContent=fmt(midi.duration);$('seek').max=midi.duration;
+let audio,master,playing=false,position=0,origin=0,originTime=0,speed=1,index=0,voices=new Set();
+const now=()=>playing?Math.min(midi.duration,origin+(audio.currentTime-originTime)*speed):position;
+function silence(){for(const voice of voices){try{voice.stop();}catch{}}voices.clear();}
+function pause(){position=now();playing=false;silence();$('play').textContent='Play sketch';$('play').setAttribute('aria-pressed','false');$('status').textContent='Paused';draw();}
+async function play(){
+ try{if(!audio){audio=new AudioContext();master=audio.createGain();master.gain.value=Number($('volume').value);master.connect(audio.destination);}await audio.resume();if(position>=midi.duration)position=0;origin=position;originTime=audio.currentTime;index=midi.notes.findIndex(n=>n.start>=position-.001);if(index<0)index=midi.notes.length;playing=true;$('play').textContent='Pause';$('play').setAttribute('aria-pressed','true');$('status').textContent='Playing MIDI sketch';$('error').textContent='';}
+ catch(error){$('error').textContent='Audio unavailable: '+error.message;pause();}
+}
+function sound(note,when,duration){
+ const oscillator=audio.createOscillator(),gain=audio.createGain();oscillator.type='triangle';oscillator.frequency.value=440*2**((note.pitch-69)/12);
+ const peak=Math.min(.1,note.velocity/127*.09),end=when+Math.max(.03,duration);gain.gain.setValueAtTime(0,when);gain.gain.linearRampToValueAtTime(peak,when+.012);gain.gain.exponentialRampToValueAtTime(Math.max(.0001,peak*.35),Math.max(when+.02,end-.03));gain.gain.linearRampToValueAtTime(0,end+.07);oscillator.connect(gain);gain.connect(master);oscillator.start(when);oscillator.stop(end+.08);voices.add(oscillator);oscillator.onended=()=>{voices.delete(oscillator);oscillator.disconnect();gain.disconnect();};
+}
+function seek(value){const was=playing;if(was)pause();position=Math.max(0,Math.min(midi.duration,Number(value)));if(was)void play();draw();}
+$('play').onclick=()=>playing?pause():void play();$('restart').onclick=()=>seek(0);$('seek').oninput=()=>seek($('seek').value);$('speed').oninput=()=>{const was=playing;if(was)pause();speed=Number($('speed').value);$('speed-value').textContent=speed.toFixed(2)+'×';if(was)void play();};$('volume').oninput=()=>{if(master)master.gain.setTargetAtTime(Number($('volume').value),audio.currentTime,.03);};$('zoom').oninput=()=>{$('pages').style.width=$('zoom').value+'%';};
+const canvas=$('roll'),g=canvas.getContext('2d'),low=Math.min(...midi.notes.map(n=>n.pitch))-2,high=Math.max(...midi.notes.map(n=>n.pitch))+2;
+function draw(){const w=canvas.clientWidth,h=canvas.clientHeight,ratio=Math.min(devicePixelRatio||1,2);canvas.width=w*ratio;canvas.height=h*ratio;g.scale(ratio,ratio);g.fillStyle='#27493d';for(let i=0;i<9;i++)g.fillRect(i*w/8,0,1,h);const t=now();for(const n of midi.notes){g.fillStyle=n.start<=t&&n.start+n.duration>t?'#f3cc8e':n.track%2?'#97bba1':'#d7d7a2';g.fillRect(n.start/midi.duration*w,(high-n.pitch)/(high-low)*h,Math.max(2,n.duration/midi.duration*w-1),Math.max(2,h/(high-low)-1));}g.fillStyle='#fff6d8';g.fillRect(t/midi.duration*w,0,1.5,h);$('position').textContent=fmt(t);$('seek').value=t;canvas.dataset.position=t.toFixed(3);canvas.dataset.playing=String(playing);}
+setInterval(()=>{if(!playing)return;const t=now();while(index<midi.notes.length&&midi.notes[index].start<t+.16*speed){const n=midi.notes[index++];sound(n,Math.max(audio.currentTime,originTime+(n.start-origin)/speed),n.duration/speed);}if(t>=midi.duration){pause();position=midi.duration;$('status').textContent='Finished';}},40);
+function frame(){if(playing)draw();requestAnimationFrame(frame);}new ResizeObserver(draw).observe(canvas);draw();requestAnimationFrame(frame);
+document.addEventListener('visibilitychange',()=>{if(document.hidden&&playing)pause();});
diff --git a/store/agents/score/skills/score/scripts/render-score.sh b/store/agents/score/skills/score/scripts/render-score.sh
new file mode 100755
index 000000000..6ecca2bbd
--- /dev/null
+++ b/store/agents/score/skills/score/scripts/render-score.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+exec bash "$HERE/../../../toolchain/node.sh" "$HERE/build.mjs"
diff --git a/store/agents/score/store.json b/store/agents/score/store.json
new file mode 100644
index 000000000..97582bc82
--- /dev/null
+++ b/store/agents/score/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://lilypond.org",
+ "upstream": "https://github.com/lilypond/lilypond",
+ "license": "MIT",
+ "tagline": "Music notation for everyone",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/score/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Engrave Lighthouse at Dusk and give me a printable score plus a MIDI playback sketch.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/score/starter.jpg",
+ "caption": "Folio · original piano study, PDF and MIDI"
+ }
+ ]
+}
diff --git a/store/agents/score/template/.gitignore b/store/agents/score/template/.gitignore
new file mode 100644
index 000000000..c11118816
--- /dev/null
+++ b/store/agents/score/template/.gitignore
@@ -0,0 +1,8 @@
+# Generated by the harness — never source.
+.harness/
+.harness-initialized
+score.pdf
+out/
+*.midi
+score.html
+score-assets/
diff --git a/store/agents/score/template/score.ly b/store/agents/score/template/score.ly
new file mode 100644
index 000000000..0d224c85f
--- /dev/null
+++ b/store/agents/score/template/score.ly
@@ -0,0 +1,47 @@
+\version "2.24.3"
+\header {
+ title = "Lighthouse at Dusk"
+ subtitle = "A small study in motion"
+ composer = "OpenHarness"
+ tagline = ##f
+}
+\paper {
+ #(set-paper-size "a4")
+ top-margin = 16\mm
+ bottom-margin = 16\mm
+ left-margin = 18\mm
+ right-margin = 18\mm
+ system-system-spacing.basic-distance = #21
+}
+global = { \key e \minor \time 6/8 \tempo "Quietly, with space" 4. = 54 }
+right = \relative c'' {
+ \global
+ b4.\p( e8 fis g) | fis4.( e4 d8) |
+ e4( b8) g4( a8) | b2. \breathe \break |
+ g'4.\mp( fis8 e d) | e4.( b4 a8) |
+ g4( a8 b4 d8) | fis2. \breathe \break |
+ e4.\mf( g8 fis e) | d4.( fis8 e d) |
+ c4( e8) b4( d8) | a2. \breathe \break |
+ b4.\mp( e8 fis g) | fis4( e8) d4( b8) |
+ e4.\>( fis4 d8) | e2.\pp\fermata \bar "|."
+}
+left = \relative c {
+ \global \clef bass
+ e8 b' e g e b | d, a' d fis d a |
+ c, g' c e c g | b, fis' b dis b fis |
+ e b' e g e b | c, g' c e c g |
+ a, e' a c a e | b fis' b dis b fis |
+ e b' e g e b | d, a' d fis d a |
+ c, g' c e c g | a, e' a c a e |
+ e b' e g e b | d, a' d fis d a |
+ b, fis' b dis b fis | <e, b' e>2.\fermata
+}
+\score {
+ \new PianoStaff \with { instrumentName = "Piano" }
+ <<
+ \new Staff = "right" \with { midiInstrument = "acoustic grand" } \right
+ \new Staff = "left" \with { midiInstrument = "acoustic grand" } \left
+ >>
+ \layout { indent = 10\mm }
+ \midi { }
+}
diff --git a/store/agents/score/test/toolchain.test.mjs b/store/agents/score/test/toolchain.test.mjs
new file mode 100644
index 000000000..099d9d492
--- /dev/null
+++ b/store/agents/score/test/toolchain.test.mjs
@@ -0,0 +1,6 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {mkdtempSync,writeFileSync,readFileSync,rmSync} from 'node:fs';import {tmpdir} from 'node:os';import {join} from 'node:path';import {spawnSync} from 'node:child_process';import {fileURLToPath} from 'node:url';import {parseMidi} from '../skills/score/scripts/midi.mjs';
+const root=fileURLToPath(new URL('..',import.meta.url));
+const file=bytes=>Buffer.from([77,84,104,100,0,0,0,6,0,0,0,1,0,96,77,84,114,107,0,0,0,bytes.length,...bytes]);
+test('MIDI note duration, running status, tempo and velocity-zero note off',()=>{const data=parseMidi(file([0,255,81,3,7,161,32,0,144,60,100,96,60,0,0,255,47,0]));assert.equal(data.notes.length,1);assert.equal(data.notes[0].duration,.5);assert.equal(data.notes[0].pitch,60);});
+test('MIDI rejects truncation, missing notes, hanging notes and unsupported timing',()=>{assert.throws(()=>parseMidi(Buffer.from('bad')),/Truncated/);assert.throws(()=>parseMidi(file([0,255,47,0])),/no notes/);assert.throws(()=>parseMidi(file([0,144,60,100,0,255,47,0])),/unterminated/);});
+test('missing source or runtime clears a previous successful verdict and preserves old PDF',()=>{const ws=mkdtempSync(join(tmpdir(),'score-failure-'));try{writeFileSync(join(ws,'score.pdf'),'previous');const run=()=>spawnSync(process.execPath,[join(root,'skills/score/scripts/build.mjs')],{env:{...process.env,HARNESS_WORKSPACE:ws,LILYPOND_BIN:join(ws,'missing')},encoding:'utf8'});assert.equal(run().status,1);assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).ready,false);writeFileSync(join(ws,'score.ly'),'invalid');assert.equal(run().status,1);assert.equal(readFileSync(join(ws,'score.pdf'),'utf8'),'previous');assert.equal(JSON.parse(readFileSync(join(ws,'.harness/verdict.json'))).artifact,null);}finally{rmSync(ws,{recursive:true,force:true});}});
diff --git a/store/agents/score/toolchain/doctor.sh b/store/agents/score/toolchain/doctor.sh
new file mode 100755
index 000000000..f2fc0f9bf
--- /dev/null
+++ b/store/agents/score/toolchain/doctor.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+sh "$HERE/setup.sh" || { echo "miss LilyPond — install from https://lilypond.org/download.html or set LILYPOND_BIN"; exit 1; }
+echo "ok LilyPond + Node; PDF/SVG engraving and MIDI playback available"
diff --git a/store/agents/score/toolchain/init-workspace.sh b/store/agents/score/toolchain/init-workspace.sh
new file mode 100755
index 000000000..78a8da4c0
--- /dev/null
+++ b/store/agents/score/toolchain/init-workspace.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+# Seeds the first verdict so the pane header has something before the first prompt.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Score workspace ready — describe a piece to engrave",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Score workspace initialized by %s\n' "${HARNESS_DSH:-score}" > .harness-initialized
diff --git a/store/agents/score/toolchain/node.sh b/store/agents/score/toolchain/node.sh
new file mode 100755
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/score/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/score/toolchain/runtimes.sh b/store/agents/score/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/score/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/score/toolchain/setup.sh b/store/agents/score/toolchain/setup.sh
new file mode 100755
index 000000000..c3ee1029a
--- /dev/null
+++ b/store/agents/score/toolchain/setup.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+bash "$HERE/node.sh" --version
+if [ -n "${LILYPOND_BIN:-}" ]; then "$LILYPOND_BIN" --version; else lilypond --version; fi
diff --git a/store/agents/sheet-docs/.gitignore b/store/agents/sheet-docs/.gitignore
new file mode 100644
index 000000000..81591ca53
--- /dev/null
+++ b/store/agents/sheet-docs/.gitignore
@@ -0,0 +1,8 @@
+# Generated office output — never source.
+out/
+*.docx
+*.xlsx
+*.pptx
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/sheet-docs/AGENTS.md b/store/agents/sheet-docs/AGENTS.md
new file mode 100644
index 000000000..22eae4995
--- /dev/null
+++ b/store/agents/sheet-docs/AGENTS.md
@@ -0,0 +1,17 @@
+# Sheet & Docs Studio
+
+Read the `sheetsdoc` skill. Edit `doc.json`, then run:
+
+```sh
+sh "$SSD_SKILLS/sheetsdoc/scripts/export.sh"
+```
+
+Produce real DOCX, formula-driven XLSX and a fresh PDF. Inspect every rendered
+page, reconcile numbers to source, and test changed spreadsheet inputs before
+handoff. A conversion success is not a layout or factual-quality certificate.
+
+Use `comparison` for the shared-source regional report; generic `sheet.rows`
+supports literal values only. Label demonstration figures as synthetic. Do not
+invent causal explanations or unsupported finance claims. Do not promise PPTX.
+An old PDF after a failed conversion must never receive a ready verdict. Keep
+source and artifacts; exported workbook edits do not sync back to the report.
diff --git a/store/agents/sheet-docs/LICENSE b/store/agents/sheet-docs/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/sheet-docs/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/sheet-docs/PROVENANCE.md b/store/agents/sheet-docs/PROVENANCE.md
new file mode 100644
index 000000000..e735c0792
--- /dev/null
+++ b/store/agents/sheet-docs/PROVENANCE.md
@@ -0,0 +1,13 @@
+# Provenance
+
+The structured source, synthetic regional data, OOXML writer and wrapper are
+original OpenHarness work licensed under MIT. No real company or audited
+financial result is represented.
+
+[LibreOffice](https://www.libreoffice.org) is installed separately and used for
+document-to-PDF conversion and workbook recalculation. No LibreOffice code,
+binary or fonts are redistributed here. The portable writer requires only Node;
+a complete preview requires LibreOffice. Native QA used LibreOfficeDev
+26.8.0.0.alpha0 from the isolated Codex runtime; other versions require local
+doctor/build checks. The generated workbook was independently checked with a
+spreadsheet calculation engine. That QA tool is not a package dependency.
diff --git a/store/agents/sheet-docs/README.md b/store/agents/sheet-docs/README.md
new file mode 100644
index 000000000..3e5b33482
--- /dev/null
+++ b/store/agents/sheet-docs/README.md
@@ -0,0 +1,59 @@
+# Sheet & Docs Studio
+
+One editable source, three real deliverables: a clean Word report, a formula-driven
+Excel workbook and a freshly converted PDF in the document viewer. The regional
+revenue starter derives prose, totals, changes and growth rates from the same
+inputs—changing a number updates the story on the next build.
+
+## First run
+
+Install `autonomous/sheet-docs` from the Harness Store. Install
+[LibreOffice](https://www.libreoffice.org/download/) separately, or set
+`SOFFICE_BIN`. The managed helper resolves Node 20+.
+
+```sh
+sh "$SSD_SKILLS/sheetsdoc/scripts/export.sh"
+```
+
+Ask: “Adapt this report to my regional figures, explain the largest changes, and
+give me a Word report, a recalculating spreadsheet and a reviewed PDF.”
+
+Edit `doc.json`, not generated output. `comparison` takes a currency code, two
+period labels and region/prior/current rows. It produces real SUM, difference and
+growth formulas with zero-denominator handling. The workbook freezes headers,
+distinguishes editable blue inputs from calculated values, and includes units
+and provenance. The starter is explicitly synthetic, not a real company's results.
+
+For a general document, omit `comparison` and use `sheet: {name, rows}` with a
+rectangular table of literal strings/numbers. Title, subtitle, paragraphs and
+source text stay editable. Generic sheets allow 1–10 columns and 1,000 rows;
+the Word report shows at most 30 data rows. Custom layouts require changes to the
+portable OOXML writer. PPTX and arbitrary spreadsheet formulas are not implemented.
+
+## Artifacts and verification
+
+- `out.docx`: editable, styled Word document with a real table and headings.
+- `out.xlsx`: editable workbook, recalculated and re-saved by LibreOffice.
+- `out.pdf`: fresh Word-to-PDF conversion, shown in the shared Doc Viewer.
+
+Every build clears readiness before validating input. Fresh staging and an
+isolated LibreOffice profile prevent stale files or an open desktop session from
+being mistaken for a new export. Failures preserve the previous successful
+preview but mark it unready. Without LibreOffice, DOCX/XLSX are still produced,
+but the build exits incomplete and no PDF readiness is claimed.
+
+The starter was converted by real LibreOffice, visually reviewed, and independently
+imported and recalculated with a changed-input/restored-input check. Conversion
+does not prove factual accuracy or flawless pagination for arbitrary new content.
+Review every page and reconcile inputs before handoff. See `.harness/export.log`
+and `.harness/export.json`.
+
+Direct edits to an exported workbook can recalculate that workbook, but do not
+change `doc.json` or the Word report. Rebuild from source to refresh all three.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/sheet-docs/harness.json b/store/agents/sheet-docs/harness.json
new file mode 100644
index 000000000..6b5aaac84
--- /dev/null
+++ b/store/agents/sheet-docs/harness.json
@@ -0,0 +1,35 @@
+{
+ "spec": 1,
+ "id": "autonomous/sheet-docs",
+ "name": "Sheet & Docs Studio",
+ "category": "Office",
+ "author": "OpenHarness contributors",
+ "description": "Create editable DOCX documents and XLSX spreadsheets from structured source, with optional LibreOffice PDF previews.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "doc.json",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "SSD_TOOLCHAIN": "${dsh}/toolchain",
+ "SSD_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/doc-viewer",
+ "artifactExtensions": [
+ ".pdf"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/sheet-docs/package.json b/store/agents/sheet-docs/package.json
new file mode 100644
index 000000000..4c034c09d
--- /dev/null
+++ b/store/agents/sheet-docs/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "@autonomous/sheet-docs-harness",
+ "private": true,
+ "type": "module",
+ "scripts": { "test": "node --test test/*.test.mjs" },
+ "engines": { "node": ">=20" }
+}
diff --git a/store/agents/sheet-docs/skills/sheetsdoc/SKILL.md b/store/agents/sheet-docs/skills/sheetsdoc/SKILL.md
new file mode 100644
index 000000000..239db9a1e
--- /dev/null
+++ b/store/agents/sheet-docs/skills/sheetsdoc/SKILL.md
@@ -0,0 +1,48 @@
+---
+name: sheetsdoc
+description: Build coordinated editable DOCX reports, formula-driven XLSX workbooks and fresh LibreOffice PDF previews from structured source. Use for Sheet & Docs Studio work.
+---
+
+# Shared-source document workflow
+
+1. Inspect `doc.json`, audience, units, periods and provenance. The starter uses
+ explicitly synthetic nominal USD and calendar quarters, not actual financials.
+2. For a comparison report, edit `comparison.currency`, the two `periods` and
+ `rows` of region/prior/current values. Inputs must be finite and nonnegative.
+ The writer derives report prose, totals and growth; do not type parallel totals.
+3. Or use `sheet: {name, rows}` for a generic literal-data report. Keep rows
+ rectangular, 1–10 columns, at most 1,000 rows. Word shows the first 30 data rows.
+ Title, subtitle, paragraphs and source text are normal editable strings.
+4. Build:
+
+ ```sh
+ sh "$SSD_SKILLS/sheetsdoc/scripts/export.sh"
+ ```
+
+5. Inspect every PDF page. Check line breaks, tables, margins and source labels.
+ Open/recalculate the workbook, change one input, confirm dependent results and
+ restore it. Reconcile report totals and prose to the same source.
+6. Hand off DOCX, XLSX and PDF with the source and the checks actually performed.
+
+## Formula and source semantics
+
+Comparison workbooks contain SUM, subtraction and guarded growth formulas.
+Zero prior revenue yields “n.a.”, not zero percent. Blue numbers are editable
+inputs; calculated values are dark. Cached formula values come from the same
+inputs and the build re-saves the workbook with LibreOffice. Generic text beginning
+with = stays literal and does not execute a user-supplied formula.
+
+Exports do not round-trip to source. Editing out.xlsx updates its formulas only;
+edit doc.json and rebuild to update the report and PDF together. Arbitrary formulas,
+charts, PPTX and automated claims of accounting correctness are outside this writer.
+
+## Runtime and failures
+
+Node 20+ and LibreOffice are required for the complete preview; use SOFFICE_BIN for
+a nonstandard installation. Conversion runs with an isolated temporary profile,
+not the user's open office session. The helper writes pending/failed verdicts,
+requires fresh outputs, and never blesses an old PDF. Without LibreOffice it can
+write the Office files but exits incomplete. Logs and receipts live in .harness.
+
+Restyling is implemented in the portable OOXML writer. After changing it, verify
+the actual exported document in an office runtime and inspect rendered pages.
diff --git a/store/agents/sheet-docs/skills/sheetsdoc/scripts/build.mjs b/store/agents/sheet-docs/skills/sheetsdoc/scripts/build.mjs
new file mode 100644
index 000000000..7cf419397
--- /dev/null
+++ b/store/agents/sheet-docs/skills/sheetsdoc/scripts/build.mjs
@@ -0,0 +1,20 @@
+import {readFile,writeFile,mkdir,mkdtemp,rename,rm,access} from 'node:fs/promises';
+import {spawnSync} from 'node:child_process';import {resolve,join} from 'node:path';import {pathToFileURL} from 'node:url';
+import {write,prepare} from './ooxml.mjs';
+const ws=resolve(process.env.HARNESS_WORKSPACE||process.cwd()),meta=join(ws,'.harness');await mkdir(meta,{recursive:true});
+const verdict=async(ready,summary,findings=[])=>writeFile(join(meta,'verdict.json'),JSON.stringify({spec:1,ready,summary,findings,artifact:ready?'out.pdf':null,updatedAt:new Date().toISOString()},null,2)+'\n');
+await verdict(false,'Building editable documents and a fresh PDF…');let stage,log='';
+try{
+ const raw=await readFile(join(ws,'doc.json'),'utf8');if(raw.length>2*1024*1024)throw new Error('doc.json exceeds 2 MiB.');const source=JSON.parse(raw),model=prepare(source);
+ stage=await mkdtemp(join(meta,'documents-'));const sizes=write(stage,source);
+ let bin=process.env.SOFFICE_BIN;if(!bin){bin=spawnSync('/bin/sh',['-c','command -v soffice'],{encoding:'utf8'}).stdout.trim();if(!bin){const mac='/Applications/LibreOffice.app/Contents/MacOS/soffice';try{await access(mac);bin=mac;}catch{}}}
+ if(!bin){for(const name of ['out.docx','out.xlsx'])await rename(join(stage,name),join(ws,name));throw new Error('DOCX and XLSX were built, but PDF preview is unavailable. Install LibreOffice or set SOFFICE_BIN. An old PDF is not a new preview.');}
+ const pdfDir=join(stage,'pdf'),recalcDir=join(stage,'recalculated');await mkdir(pdfDir);await mkdir(recalcDir);
+ const convert=(format,out,file)=>{const result=spawnSync(bin,['-env:UserInstallation='+pathToFileURL(join(stage,'profile')).href,'--headless','--convert-to',format,'--outdir',out,file],{cwd:stage,encoding:'utf8',timeout:120000,maxBuffer:8*1024*1024});log+=(result.stdout||'')+(result.stderr||'');if(result.error||result.status!==0)throw new Error(result.error?.message||'LibreOffice conversion failed; inspect .harness/export.log.');};
+ convert('pdf',pdfDir,join(stage,'out.docx'));const pdf=await readFile(join(pdfDir,'out.pdf'));if(pdf.length<100||pdf.subarray(0,5).toString()!=='%PDF-')throw new Error('LibreOffice produced no fresh PDF.');
+ convert('xlsx',recalcDir,join(stage,'out.xlsx'));const xlsx=await readFile(join(recalcDir,'out.xlsx'));if(xlsx.length<500||xlsx.subarray(0,2).toString()!=='PK')throw new Error('LibreOffice produced no fresh recalculated workbook.');
+ await rename(join(stage,'out.docx'),join(ws,'out.docx'));await rename(join(recalcDir,'out.xlsx'),join(ws,'out.xlsx'));await rename(join(pdfDir,'out.pdf'),join(ws,'out.pdf'));
+ await writeFile(join(meta,'export.json'),JSON.stringify({source:'doc.json',summary:model.summary,rows:model.sheet.length-1,bytes:{docx:sizes.docx,xlsx:xlsx.length,pdf:pdf.length},verification:'Fresh DOCX-to-PDF conversion and XLSX re-save by LibreOffice; visual review still required.'},null,2)+'\n');
+ await verdict(true,'Editable DOCX + recalculated XLSX + fresh PDF',[{severity:'info',kind:'review',message:'Review the generated pages and inputs. Conversion is not a factual or layout-quality certificate.'}]);console.log('ok out.docx + out.xlsx + out.pdf');
+}catch(error){await verdict(false,'Document export incomplete',[{severity:'error',kind:'export',message:error.message}]);console.error(error.message);process.exitCode=1;}
+finally{await writeFile(join(meta,'export.log'),log);if(stage)await rm(stage,{recursive:true,force:true});}
diff --git a/store/agents/sheet-docs/skills/sheetsdoc/scripts/export.sh b/store/agents/sheet-docs/skills/sheetsdoc/scripts/export.sh
new file mode 100755
index 000000000..6ecca2bbd
--- /dev/null
+++ b/store/agents/sheet-docs/skills/sheetsdoc/scripts/export.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+exec bash "$HERE/../../../toolchain/node.sh" "$HERE/build.mjs"
diff --git a/store/agents/sheet-docs/skills/sheetsdoc/scripts/ooxml.mjs b/store/agents/sheet-docs/skills/sheetsdoc/scripts/ooxml.mjs
new file mode 100755
index 000000000..32850596e
--- /dev/null
+++ b/store/agents/sheet-docs/skills/sheetsdoc/scripts/ooxml.mjs
@@ -0,0 +1,157 @@
+#!/usr/bin/env node
+/**
+ * ooxml.mjs — a zero-dependency, pure-Node writer for minimal-but-valid OOXML documents.
+ *
+ * Ships the lightweight, always-testable path for Sheet & Docs Studio: with only Node (no python,
+ * no LibreOffice) it can write a real .docx and real .xlsx from a small declarative source, so the
+ * harness and its repo runner verify the artifact pipeline on every machine. PDF conversion is an
+ * optional layer on top (LibreOffice) and is not required by this helper.
+ *
+ * CLI: node ooxml.mjs <workspaceDir>
+ * reads <workspaceDir>/doc.json
+ * writes <workspaceDir>/out.docx, <workspaceDir>/out.xlsx
+ *
+ * Library: import { buildDocx, buildXlsx, write } from './ooxml.mjs'
+ */
+import { deflateRawSync } from 'node:zlib'
+import { readFileSync, writeFileSync } from 'node:fs'
+import { join } from 'node:path'
+
+// ---------------------------------------------------------------------------
+// Minimal ZIP writer (store + deflate entries, no external deps)
+// ---------------------------------------------------------------------------
+const CRC_TABLE = (() => {
+ const table = new Uint32Array(256)
+ for (let n = 0; n < 256; n++) {
+ let c = n
+ for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1
+ table[n] = c >>> 0
+ }
+ return table
+})()
+
+export function crc32(buf) {
+ let c = 0xffffffff
+ for (let i = 0; i < buf.length; i++) c = CRC_TABLE[(c ^ buf[i]) & 0xff] ^ (c >>> 8)
+ return (c ^ 0xffffffff) >>> 0
+}
+
+function u16(v) { const b = Buffer.alloc(2); b.writeUInt16LE(v, 0); return b }
+function u32(v) { const b = Buffer.alloc(4); b.writeUInt32LE(v, 0); return b }
+function utf8(s) { return Buffer.from(s, 'utf8') }
+
+/** files: [{name, data: Buffer|string}] -> ZIP Buffer (deflate with stored fallback). */
+export function zip(files) {
+ const entries = files.map(f => {
+ const name = utf8(f.name)
+ const data = Buffer.isBuffer(f.data) ? f.data : utf8(f.data)
+ const crc = crc32(data)
+ const deflated = deflateRawSync(data, { level: 9 })
+ const use = deflated.length < data.length ? deflated : data
+ const method = use === data ? 0 : 8
+ return { name, data, crc, enc: use, method }
+ })
+ const chunks = []
+ let offset = 0
+ const central = []
+ for (const e of entries) {
+ const lfh = Buffer.concat([
+ u32(0x04034b50), u16(20), u16(0), u16(e.method), u16(0), u16(0),
+ u32(e.crc), u32(e.enc.length), u32(e.data.length),
+ u16(e.name.length), u16(0), e.name,
+ ])
+ chunks.push(lfh, e.enc)
+ central.push({
+ name: e.name, crc: e.crc, encSize: e.enc.length, size: e.data.length,
+ method: e.method, offset,
+ })
+ offset += lfh.length + e.enc.length
+ }
+ const cdStart = offset
+ const cdParts = central.map(c =>
+ Buffer.concat([
+ u32(0x02014b50), u16(20), u16(20), u16(0), u16(c.method), u16(0), u16(0),
+ u32(c.crc), u32(c.encSize), u32(c.size),
+ u16(c.name.length), u16(0), u16(0), u16(0), u16(0), u32(0),
+ u32(c.offset), c.name,
+ ]))
+ const cdSize = cdParts.reduce((a, p) => a + p.length, 0)
+ const eocd = Buffer.concat([
+ u32(0x06054b50), u16(0), u16(0), u16(entries.length), u16(entries.length),
+ u32(cdSize), u32(cdStart), u16(0),
+ ])
+ return Buffer.concat([...chunks, ...cdParts, eocd])
+}
+
+// Portable report writer. Native LibreOffice conversion is a separate verified step.
+const esc=value=>{const s=String(value);if(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/.test(s))throw new Error('Text contains invalid XML control characters.');return s.replace(/[<>&'"]/g,c=>({'<':'&lt;','>':'&gt;','&':'&amp;',"'":'&apos;','"':'&quot;'}[c]));};
+const NS='http://schemas.openxmlformats.org/';
+const xml=body=>'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+body;
+const relationship=(id,type,target)=>'<Relationship Id="'+id+'" Type="'+NS+'officeDocument/2006/relationships/'+type+'" Target="'+target+'"/>';
+const rels=items=>xml('<Relationships xmlns="'+NS+'package/2006/relationships">'+items.join('')+'</Relationships>');
+const types=items=>xml('<Types xmlns="'+NS+'package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/>'+items.map(([path,type])=>'<Override PartName="/'+path+'" ContentType="application/vnd.openxmlformats-officedocument.'+type+'+xml"/>').join('')+'</Types>');
+const col=i=>{let s='';for(let n=i+1;n>0;n=Math.floor((n-1)/26))s=String.fromCharCode(65+(n-1)%26)+s;return s;};
+function text(value,label,max=2000){if(typeof value!=='string'||!value.trim()||value.length>max)throw new Error(label+' must be nonempty text under '+max+' characters.');esc(value);return value;}
+export function prepare(source){
+ if(!source||typeof source!=='object'||Array.isArray(source))throw new Error('doc.json must be an object.');
+ const title=text(source.title,'title',200),subtitle=source.subtitle?text(source.subtitle,'subtitle',400):'',paragraphs=source.paragraphs||[];
+ if(!Array.isArray(paragraphs)||paragraphs.length>40)throw new Error('Provide at most 40 paragraphs.');paragraphs.forEach(p=>text(p,'paragraph',10000));
+ const model={title,subtitle,paragraphs:[...paragraphs],source:source.source?text(source.source,'source',2000):'Source: workspace doc.json',table:[],sheet:[],name:'Data',summary:null};
+ if(source.comparison){
+ const c=source.comparison;if(!Array.isArray(c.periods)||c.periods.length!==2)c.periods=null;
+ if(!c.periods)throw new Error('comparison.periods needs two labels.');c.periods.forEach(p=>text(p,'period',40));
+ if(!/^[A-Z]{3}$/.test(c.currency))throw new Error('comparison.currency needs a three-letter currency code.');const currency=c.currency;
+ let money;try{money=n=>new Intl.NumberFormat('en-US',{style:'currency',currency,maximumFractionDigits:0}).format(n);money(0);}catch{throw new Error('Invalid comparison currency.');}
+ if(!Array.isArray(c.rows)||!c.rows.length||c.rows.length>200)throw new Error('comparison.rows needs 1–200 regions.');
+ const names=new Set(),rows=c.rows.map(row=>{text(row.region,'region',80);if(names.has(row.region))throw new Error('Region names must be unique.');names.add(row.region);for(const key of ['prior','current'])if(typeof row[key]!=='number'||!Number.isFinite(row[key])||row[key]<0||row[key]>1e12)throw new Error('Revenue inputs must be nonnegative finite numbers up to 1e12.');return {...row,delta:row.current-row.prior,growth:row.prior===0?null:(row.current-row.prior)/row.prior};});
+ const prior=rows.reduce((n,r)=>n+r.prior,0),current=rows.reduce((n,r)=>n+r.current,0),delta=current-prior,growth=prior===0?null:delta/prior,largest=Math.max(...rows.map(r=>r.delta)),leaders=rows.filter(r=>r.delta===largest).map(r=>r.region);
+ model.summary={prior,current,delta,growth,leaders,currency};model.name='Regional revenue';model.periods=c.periods;model.currency=currency;
+ model.paragraphs.unshift('Revenue '+(delta>=0?'increased':'decreased')+' by '+money(Math.abs(delta))+(growth===null?'':', or '+(Math.abs(growth)*100).toFixed(1)+'%')+', from '+money(prior)+' in '+c.periods[0]+' to '+money(current)+' in '+c.periods[1]+'. '+(largest>0?leaders.join(' and ')+' contributed the largest absolute increase ('+money(largest)+(leaders.length>1?' each':'')+').':'No region recorded a positive increase.'));
+ const percent=n=>n===null?'n.a.':(n*100).toFixed(1)+'%';
+ model.table=[[ 'Region',...c.periods,'Change','Growth'],...rows.map(r=>[r.region,money(r.prior),money(r.current),money(r.delta),percent(r.growth)]),['Total',money(prior),money(current),money(delta),percent(growth)]];
+ model.sheet=[[ 'Region',...c.periods,'Change ('+currency+')','Growth'],...rows.map((r,i)=>[r.region,r.prior,r.current,{formula:'C'+(i+7)+'-B'+(i+7),value:r.delta},{formula:'IF(B'+(i+7)+'=0,"n.a.",D'+(i+7)+'/B'+(i+7)+')',value:r.growth===null?'n.a.':r.growth}])];
+ const total=rows.length+7;model.sheet.push(['Total',{formula:'SUM(B7:B'+(total-1)+')',value:prior},{formula:'SUM(C7:C'+(total-1)+')',value:current},{formula:'C'+total+'-B'+total,value:delta},{formula:'IF(B'+total+'=0,"n.a.",D'+total+'/B'+total+')',value:growth===null?'n.a.':growth}]);
+ model.note='Amounts in '+currency+'. Growth is (current - prior) / prior; a zero prior value is shown as n.a. Totals and narrative are derived from the inputs, not typed separately.';
+ }else{
+ const sheet=source.sheet;if(!sheet||!Array.isArray(sheet.rows)||!sheet.rows.length||sheet.rows.length>1000)throw new Error('Provide comparison data or sheet.rows (1–1000 rows).');
+ model.name=sheet.name||'Data';if(!model.name||model.name.length>31||/[\\/*?:[\]]/.test(model.name)||model.name.startsWith("'")||model.name.endsWith("'"))throw new Error('Invalid worksheet name.');
+ const width=sheet.rows[0].length;if(!width||width>10)throw new Error('Generic sheets support 1–10 columns.');
+ for(const row of sheet.rows){if(!Array.isArray(row)||row.length!==width)throw new Error('Sheet rows must be rectangular.');for(const cell of row)if(typeof cell!=='string'&&(typeof cell!=='number'||!Number.isFinite(cell)))throw new Error('Sheet cells must be literal text or finite numbers.');else esc(cell);}
+ model.sheet=sheet.rows;model.table=sheet.rows.slice(0,31);model.note=sheet.rows.length>31?'The document displays the first 30 data rows; the workbook contains every row.':'Text beginning with = is stored as literal text. Generated cells do not execute user-supplied formulas.';
+ }
+ return model;
+}
+export function buildDocx(source){
+ const m=prepare(source);
+ const p=(value,style='Normal')=>'<w:p><w:pPr><w:pStyle w:val="'+style+'"/></w:pPr><w:r><w:t xml:space="preserve">'+esc(value)+'</w:t></w:r></w:p>';
+ const width=9360,cols=m.table[0].length,first=cols===5?2500:Math.floor(width/cols),rest=Math.floor((width-first)/(cols-1||1)),widths=Array.from({length:cols},(_,i)=>i===0?first:i===cols-1?width-first-rest*(cols-2):rest);
+ const table='<w:tbl><w:tblPr><w:tblW w:w="'+width+'" w:type="dxa"/><w:tblLayout w:type="fixed"/><w:tblBorders>'+['top','left','bottom','right','insideH'].map(edge=>'<w:'+edge+' w:val="single" w:sz="4" w:color="D8DDD8"/>').join('')+'</w:tblBorders><w:tblCellMar><w:top w:w="100" w:type="dxa"/><w:left w:w="100" w:type="dxa"/><w:bottom w:w="100" w:type="dxa"/><w:right w:w="100" w:type="dxa"/></w:tblCellMar></w:tblPr><w:tblGrid>'+widths.map(w=>'<w:gridCol w:w="'+w+'"/>').join('')+'</w:tblGrid>'+m.table.map((row,r)=>'<w:tr><w:trPr>'+(r===0?'<w:tblHeader/>':'')+'<w:cantSplit/></w:trPr>'+row.map((value,i)=>'<w:tc><w:tcPr><w:tcW w:w="'+widths[i]+'" w:type="dxa"/>'+(r===0?'<w:shd w:fill="E8EDE8"/>':'')+'</w:tcPr><w:p><w:pPr><w:spacing w:after="0"/><w:jc w:val="'+(i?'right':'left')+'"/></w:pPr><w:r><w:rPr><w:sz w:val="20"/>'+((r===0||(m.summary&&r===m.table.length-1))?'<w:b/>':'')+'</w:rPr><w:t>'+esc(value)+'</w:t></w:r></w:p></w:tc>').join('')+'</w:tr>').join('')+'</w:tbl>';
+ const body=p(m.title,'Title')+(m.subtitle?p(m.subtitle,'Subtitle'):'')+p('At a glance','Heading1')+m.paragraphs.map(v=>p(v)).join('')+p(m.summary?'Revenue by region':'Working data','Heading1')+table+p(m.note,'Caption')+p('Source and use','Heading1')+p(m.source);
+ const document=xml('<w:document xmlns:w="'+NS+'wordprocessingml/2006/main" xmlns:r="'+NS+'officeDocument/2006/relationships"><w:body>'+body+'<w:sectPr><w:footerReference w:type="default" r:id="rId2"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1080" w:right="1440" w:bottom="1080" w:left="1440" w:header="500" w:footer="500"/></w:sectPr></w:body></w:document>');
+ const styles=xml('<w:styles xmlns:w="'+NS+'wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Arial" w:hAnsi="Arial"/><w:sz w:val="22"/><w:color w:val="202820"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="140" w:line="276" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:pPr><w:keepNext/><w:spacing w:after="180"/></w:pPr><w:rPr><w:b/><w:color w:val="000000"/><w:sz w:val="48"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:pPr><w:spacing w:after="320"/><w:keepNext/></w:pPr><w:rPr><w:color w:val="667066"/><w:sz w:val="22"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><w:basedOn w:val="Normal"/><w:pPr><w:keepNext/><w:spacing w:before="260" w:after="120"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:b/><w:color w:val="000000"/><w:sz w:val="27"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="Caption"/><w:basedOn w:val="Normal"/><w:pPr><w:spacing w:before="140" w:after="180"/></w:pPr><w:rPr><w:sz w:val="18"/><w:color w:val="667066"/></w:rPr></w:style></w:styles>');
+ const footer=xml('<w:ftr xmlns:w="'+NS+'wordprocessingml/2006/main">'+p('SHEET & DOCS STUDIO | Editable source: doc.json','Caption')+'</w:ftr>');
+ return zip([{name:'[Content_Types].xml',data:types([['word/document.xml','wordprocessingml.document.main'],['word/styles.xml','wordprocessingml.styles'],['word/footer1.xml','wordprocessingml.footer']])},{name:'_rels/.rels',data:rels([relationship('rId1','officeDocument','word/document.xml')])},{name:'word/document.xml',data:document},{name:'word/styles.xml',data:styles},{name:'word/footer1.xml',data:footer},{name:'word/_rels/document.xml.rels',data:rels([relationship('rId1','styles','styles.xml'),relationship('rId2','footer','footer1.xml')])}]);
+}
+export function buildXlsx(source){
+ const m=prepare(source),last=m.sheet.length+5,width=m.sheet[0].length,lastCol=col(width-1);
+ const cell=(value,r,c,style)=>{const ref=col(c)+r;let content;if(typeof value==='object'){content=(typeof value.value==='string'?' t="str"':'')+'><f>'+esc(value.formula)+'</f><v>'+esc(value.value)+'</v>';}else if(typeof value==='number')content='><v>'+value+'</v>';else content=' t="inlineStr"><is><t xml:space="preserve">'+esc(value)+'</t></is>';return '<c r="'+ref+'" s="'+style+'"'+content+'</c>';};
+ const rows=[
+ '<row r="1" ht="35" customHeight="1">'+cell(m.title,1,0,1)+'</row>',
+ '<row r="2" ht="25" customHeight="1">'+cell(m.subtitle,2,0,5)+'</row>',
+ '<row r="4" ht="42" customHeight="1">'+cell(m.source,4,0,5)+'</row>',
+ ...m.sheet.map((row,i)=>'<row r="'+(i+6)+'" ht="28" customHeight="1">'+row.map((v,c)=>cell(v,i+6,c,i===0?2:m.summary?(i===m.sheet.length-1?(c===4?8:7):c===1||c===2?3:c===4?6:4):typeof v==='number'?4:0)).join('')+'</row>'),
+ '<row r="'+(last+2)+'" ht="46" customHeight="1">'+cell(m.note,last+2,0,5)+'</row>',
+ '<row r="'+(last+4)+'" ht="36" customHeight="1">'+cell(m.summary?'Blue cells are editable inputs. Black cells calculate change, growth and totals. Edit doc.json and rebuild to refresh the Word/PDF report.':'Edit doc.json and rebuild to refresh all deliverables together.',last+4,0,5)+'</row>'
+ ];
+ const columns='<col min="1" max="1" width="25" customWidth="1"/>'+(width>1?'<col min="2" max="'+width+'" width="20" customWidth="1"/>':'');
+ const merges=width>1?'<mergeCells count="5">'+[1,2,4,last+2,last+4].map(r=>'<mergeCell ref="A'+r+':'+lastCol+r+'"/>').join('')+'</mergeCells>':'';
+ const worksheet=xml('<worksheet xmlns="'+NS+'spreadsheetml/2006/main"><dimension ref="A1:'+lastCol+(last+4)+'"/><sheetViews><sheetView showGridLines="0" workbookViewId="0"><pane ySplit="6" topLeftCell="A7" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="22"/><cols>'+columns+'</cols><sheetData>'+rows.join('')+'</sheetData><autoFilter ref="A6:'+lastCol+(m.summary?last-1:last)+'"/>'+merges+'<printOptions horizontalCentered="1"/><pageMargins left="0.5" right="0.5" top="0.6" bottom="0.6" header="0.2" footer="0.2"/><pageSetup paperSize="1" orientation="landscape" fitToWidth="1" fitToHeight="0"/></worksheet>');
+ const money=m.summary?'&quot;'+m.currency+' &quot;#,##0;(&quot;'+m.currency+' &quot;#,##0);&quot;-&quot;':'#,##0.00;(#,##0.00);&quot;-&quot;';
+ const font=(color,bold=false,size=11)=>'<font><sz val="'+size+'"/><color rgb="FF'+color+'"/><name val="Arial"/>'+(bold?'<b/>':'')+'</font>';
+ const xf=(fontId=0,fillId=0,numFmtId=0,borderId=0,wrap=false)=>'<xf numFmtId="'+numFmtId+'" fontId="'+fontId+'" fillId="'+fillId+'" borderId="'+borderId+'" xfId="0" applyNumberFormat="1" applyFont="1" applyFill="1" applyAlignment="1" applyBorder="1"><alignment vertical="center"'+(wrap?' wrapText="1"':'')+'/></xf>';
+ const styles=xml('<styleSheet xmlns="'+NS+'spreadsheetml/2006/main"><numFmts count="2"><numFmt numFmtId="164" formatCode="'+money+'"/><numFmt numFmtId="165" formatCode="0.0%;(0.0%);&quot;-&quot;"/></numFmts><fonts count="6">'+font('253E34')+font('172D24',true,22)+font('FFFFFF',true)+font('2563A8')+font('66766B',false,10)+font('253E34',true)+'</fonts><fills count="3"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill><fill><patternFill patternType="solid"><fgColor rgb="FF315443"/><bgColor indexed="64"/></patternFill></fill></fills><borders count="2"><border/><border><top style="thin"><color rgb="FFAABCAF"/></top></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="9">'+xf()+xf(1)+xf(2,2)+xf(3,0,164)+xf(0,0,164)+xf(4,0,0,0,true)+xf(0,0,165)+xf(5,0,164,1)+xf(5,0,165,1)+'</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>');
+ const workbook=xml('<workbook xmlns="'+NS+'spreadsheetml/2006/main" xmlns:r="'+NS+'officeDocument/2006/relationships"><sheets><sheet name="'+esc(m.name)+'" sheetId="1" r:id="rId1"/></sheets><definedNames><definedName name="_xlnm.Print_Area" localSheetId="0">&apos;'+esc(m.name.replace(/'/g,"''"))+'&apos;!$A$1:$'+lastCol+'$'+(last+4)+'</definedName></definedNames><calcPr calcId="191029" fullCalcOnLoad="1" forceFullCalc="1"/></workbook>');
+ return zip([{name:'[Content_Types].xml',data:types([['xl/workbook.xml','spreadsheetml.sheet.main'],['xl/worksheets/sheet1.xml','spreadsheetml.worksheet'],['xl/styles.xml','spreadsheetml.styles']])},{name:'_rels/.rels',data:rels([relationship('rId1','officeDocument','xl/workbook.xml')])},{name:'xl/workbook.xml',data:workbook},{name:'xl/_rels/workbook.xml.rels',data:rels([relationship('rId1','worksheet','worksheets/sheet1.xml'),relationship('rId2','styles','styles.xml')])},{name:'xl/worksheets/sheet1.xml',data:worksheet},{name:'xl/styles.xml',data:styles}]);
+}
+export function write(workspaceDir,source){const docx=buildDocx(source),xlsx=buildXlsx(source);writeFileSync(join(workspaceDir,'out.docx'),docx);writeFileSync(join(workspaceDir,'out.xlsx'),xlsx);return {docx:docx.length,xlsx:xlsx.length};}
+if(process.argv[1]&&process.argv[1].endsWith('/ooxml.mjs')){const workspace=process.argv[2];if(!workspace)throw new Error('Usage: node ooxml.mjs WORKSPACE');console.log(write(workspace,JSON.parse(readFileSync(join(workspace,'doc.json'),'utf8'))));}
diff --git a/store/agents/sheet-docs/store.json b/store/agents/sheet-docs/store.json
new file mode 100644
index 000000000..3a5e73e48
--- /dev/null
+++ b/store/agents/sheet-docs/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/sheet-docs",
+ "upstream": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/sheet-docs",
+ "license": "MIT",
+ "tagline": "Editable documents and spreadsheets from structured source",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/sheet-docs/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Build the synthetic regional report with matching Word prose, spreadsheet formulas and a fresh PDF.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/sheet-docs/starter.jpg",
+ "caption": "One source · editable DOCX, recalculated XLSX and PDF"
+ }
+ ]
+}
diff --git a/store/agents/sheet-docs/template/.gitignore b/store/agents/sheet-docs/template/.gitignore
new file mode 100644
index 000000000..08671f052
--- /dev/null
+++ b/store/agents/sheet-docs/template/.gitignore
@@ -0,0 +1,7 @@
+# Generated artifacts — never source.
+out.docx
+out.xlsx
+out.pdf
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/sheet-docs/template/doc.json b/store/agents/sheet-docs/template/doc.json
new file mode 100644
index 000000000..211bf990a
--- /dev/null
+++ b/store/agents/sheet-docs/template/doc.json
@@ -0,0 +1,37 @@
+{
+ "title": "Quarterly revenue, in focus",
+ "subtitle": "Regional revenue review | Q2:26 | Demonstration report",
+ "paragraphs": [
+ "The comparison describes revenue, not cash collected, profit, or a forecast. The inputs alone do not establish what caused the change. Review the regional detail before drawing conclusions about pricing, mix or demand."
+ ],
+ "source": "Synthetic demonstration data created for this starter. Calendar quarters Q1:26 and Q2:26; nominal USD, unscaled. No real company, audited results or external data source is represented.",
+ "comparison": {
+ "currency": "USD",
+ "periods": [
+ "Q1:26",
+ "Q2:26"
+ ],
+ "rows": [
+ {
+ "region": "North",
+ "prior": 12400,
+ "current": 13200
+ },
+ {
+ "region": "South",
+ "prior": 8100,
+ "current": 9400
+ },
+ {
+ "region": "East",
+ "prior": 15200,
+ "current": 16100
+ },
+ {
+ "region": "West",
+ "prior": 9800,
+ "current": 10500
+ }
+ ]
+ }
+}
diff --git a/store/agents/sheet-docs/test/toolchain.test.mjs b/store/agents/sheet-docs/test/toolchain.test.mjs
new file mode 100644
index 000000000..3f2af3e5a
--- /dev/null
+++ b/store/agents/sheet-docs/test/toolchain.test.mjs
@@ -0,0 +1,9 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {mkdtempSync,readFileSync,writeFileSync,rmSync,chmodSync} from 'node:fs';import {tmpdir} from 'node:os';import {join} from 'node:path';import {fileURLToPath} from 'node:url';import {spawnSync} from 'node:child_process';import {inflateRawSync} from 'node:zlib';import {prepare,buildDocx,buildXlsx} from '../skills/sheetsdoc/scripts/ooxml.mjs';
+const root=fileURLToPath(new URL('..',import.meta.url)),source=JSON.parse(readFileSync(join(root,'template/doc.json')));
+function unzip(b){const files={};let p=0;while(b.readUInt32LE(p)===0x04034b50){const method=b.readUInt16LE(p+8),size=b.readUInt32LE(p+18),n=b.readUInt16LE(p+26),extra=b.readUInt16LE(p+28),name=b.subarray(p+30,p+30+n).toString(),start=p+30+n+extra,data=b.subarray(start,start+size);files[name]=(method===8?inflateRawSync(data):data).toString();p=start+size;}return files;}
+test('one source drives accurate narrative, table totals and formula caches',()=>{const m=prepare(source);assert.equal(m.summary.prior,45500);assert.equal(m.summary.current,49200);assert.equal(m.summary.delta,3700);assert.deepEqual(m.summary.leaders,['South']);assert.match(m.paragraphs[0],/8.1%/);assert.match(m.paragraphs[0],/South/);const x=unzip(buildXlsx(source));assert.match(x['xl/worksheets/sheet1.xml'],/<f>SUM\(C7:C10\)<\/f><v>49200/);assert.match(x['xl/worksheets/sheet1.xml'],/IF\(B7=0,&quot;n.a.&quot;,D7\/B7\)/);assert.match(x['xl/styles.xml'],/&quot;USD &quot;#,##0/);const d=unzip(buildDocx(source));assert.match(d['word/document.xml'],/South contributed the largest/);assert.match(d['word/document.xml'],/w:tblHeader/);});
+test('changed inputs update prose and totals; zero denominators are unavailable',()=>{const s=structuredClone(source);s.comparison.rows[0].current=20000;assert.deepEqual(prepare(s).summary.leaders,['North']);s.comparison.rows.forEach(r=>r.prior=0);const m=prepare(s);assert.equal(m.summary.growth,null);assert.equal(m.table.at(-1).at(-1),'n.a.');});
+test('invalid numbers, duplicate regions, XML controls and malformed rows fail',()=>{const s=structuredClone(source);s.comparison.rows[0].prior=Infinity;assert.throws(()=>prepare(s),/finite/);s.comparison.rows[0].prior=1;s.comparison.rows[1].region='North';assert.throws(()=>prepare(s),/unique/);assert.throws(()=>prepare({...source,title:'bad\u0001'}),/XML/);assert.throws(()=>prepare({title:'T',sheet:{rows:[['a','b'],[1]]}}),/rectangular/);});
+test('generic text remains literal including formula-looking text and XML markup',()=>{const parts=unzip(buildXlsx({title:'T',sheet:{name:'Data',rows:[['a','b'],['=WEBSERVICE("x")','<script>']]}}));assert.match(parts['xl/worksheets/sheet1.xml'],/inlineStr/);assert.match(parts['xl/worksheets/sheet1.xml'],/&lt;script&gt;/);assert.doesNotMatch(parts['xl/worksheets/sheet1.xml'],/<f>/);});
+test('failed conversion cannot bless an old PDF or overwrite previous Office artifacts',()=>{const ws=mkdtempSync(join(tmpdir(),'sheets-failure-'));try{writeFileSync(join(ws,'doc.json'),JSON.stringify(source));for(const name of ['out.pdf','out.docx','out.xlsx'])writeFileSync(join(ws,name),'previous');const binary=join(ws,'fixture');writeFileSync(binary,'#!/bin/sh\nexit 0\n');chmodSync(binary,0o755);const result=spawnSync(process.execPath,[join(root,'skills/sheetsdoc/scripts/build.mjs')],{env:{...process.env,HARNESS_WORKSPACE:ws,SOFFICE_BIN:binary},encoding:'utf8'});assert.equal(result.status,1);const verdict=JSON.parse(readFileSync(join(ws,'.harness/verdict.json')));assert.equal(verdict.ready,false);assert.equal(verdict.artifact,null);for(const name of ['out.pdf','out.docx','out.xlsx'])assert.equal(readFileSync(join(ws,name),'utf8'),'previous');}finally{rmSync(ws,{recursive:true,force:true});}});
+test('a one-column generic workbook has valid column bounds and no self-merges',()=>{const parts=unzip(buildXlsx({title:'List',sheet:{name:'Items',rows:[['Item'],['One']]}})),xml=parts['xl/worksheets/sheet1.xml'];assert.doesNotMatch(xml,/min="2" max="1"|mergeCell ref="A1:A1"/);assert.match(xml,/<col min="1" max="1"/);});
diff --git a/store/agents/sheet-docs/toolchain/doctor.sh b/store/agents/sheet-docs/toolchain/doctor.sh
new file mode 100755
index 000000000..27ccb534e
--- /dev/null
+++ b/store/agents/sheet-docs/toolchain/doctor.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+sh "$HERE/setup.sh"
+echo "ok Node + LibreOffice; build the source to verify document conversion"
diff --git a/store/agents/sheet-docs/toolchain/init-workspace.sh b/store/agents/sheet-docs/toolchain/init-workspace.sh
new file mode 100755
index 000000000..5ba835082
--- /dev/null
+++ b/store/agents/sheet-docs/toolchain/init-workspace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Runs once in a fresh workspace (cwd = the workspace) after the template copy.
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Sheet & Docs workspace ready — tell me the document to write",
+ "findings": [], "artifact": null, "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Sheet & Docs workspace initialized by %s\n' "${HARNESS_DSH:-sheet-docs}" > .harness-initialized
diff --git a/store/agents/sheet-docs/toolchain/node.sh b/store/agents/sheet-docs/toolchain/node.sh
new file mode 100755
index 000000000..a527a9f1d
--- /dev/null
+++ b/store/agents/sheet-docs/toolchain/node.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$@"
diff --git a/store/agents/sheet-docs/toolchain/runtimes.sh b/store/agents/sheet-docs/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/sheet-docs/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/sheet-docs/toolchain/setup.sh b/store/agents/sheet-docs/toolchain/setup.sh
new file mode 100755
index 000000000..c24fcee56
--- /dev/null
+++ b/store/agents/sheet-docs/toolchain/setup.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
+bash "$HERE/node.sh" --version
+if [ -n "${SOFFICE_BIN:-}" ]; then "$SOFFICE_BIN" --version; elif command -v soffice >/dev/null 2>&1; then soffice --version; elif [ -x /Applications/LibreOffice.app/Contents/MacOS/soffice ]; then /Applications/LibreOffice.app/Contents/MacOS/soffice --version; else echo "miss LibreOffice — install from https://www.libreoffice.org/download/ or set SOFFICE_BIN for PDF preview and workbook recalculation"; exit 1; fi
diff --git a/store/agents/web-studio/.gitignore b/store/agents/web-studio/.gitignore
new file mode 100644
index 000000000..b0ab68025
--- /dev/null
+++ b/store/agents/web-studio/.gitignore
@@ -0,0 +1,3 @@
+# Harness bookkeeping.
+.harness/
+.harness-initialized
diff --git a/store/agents/web-studio/AGENTS.md b/store/agents/web-studio/AGENTS.md
new file mode 100644
index 000000000..aa75be451
--- /dev/null
+++ b/store/agents/web-studio/AGENTS.md
@@ -0,0 +1,13 @@
+# Web Studio
+
+Build the user's interactive page in this workspace. Read the `web` skill. The shared viewer serves
+`index.html` and sibling assets over HTTP and reloads saved changes; no separate server is needed.
+
+The starter, Field, is a generative instrument with three shapes, live controls, keyboard shortcuts,
+reduced-motion support and PNG export. It is a starting point, not a constraint on the user's idea.
+Keep the first frame meaningful and make the primary interaction obvious. Support touch, keyboard,
+narrow screens and a still/reduced-motion state.
+
+Run the skill's browser proof after meaningful changes. Maintain `proof.json` with actual control
+actions and assertions of their results; inspect the screenshot. Never infer readiness or 60 fps
+from a file's existence. Report missing browser tooling or failed checks explicitly.
diff --git a/store/agents/web-studio/LICENSE b/store/agents/web-studio/LICENSE
new file mode 100644
index 000000000..d3eab18ed
--- /dev/null
+++ b/store/agents/web-studio/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 OpenHarness contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/web-studio/PROVENANCE.md b/store/agents/web-studio/PROVENANCE.md
new file mode 100644
index 000000000..498e284cb
--- /dev/null
+++ b/store/agents/web-studio/PROVENANCE.md
@@ -0,0 +1,6 @@
+# Provenance
+
+Field's WebGL shaders, geometry, interface, starter source and instructions are
+original MIT-licensed OpenHarness work. It uses browser APIs directly, without a
+vendored graphics framework, external image/font assets or a network service.
+The preview is the separate autonomous/isolated-web-viewer package.
diff --git a/store/agents/web-studio/README.md b/store/agents/web-studio/README.md
new file mode 100644
index 000000000..db6c0e2b0
--- /dev/null
+++ b/store/agents/web-studio/README.md
@@ -0,0 +1,27 @@
+# Web Studio
+
+Turn an idea into an interactive page in the live preview. The included **Field** starter is a
+generative instrument: explore Orbit, Weave and Bloom, rotate with your pointer, adjust the shape,
+pause time and export a PNG. Touch, keyboard and reduced motion are supported. No network or build
+step is needed to use the starter.
+
+Try: “Make a calming, interactive sculpture with three distinct shapes and a way to save a frame.”
+
+Install from the Harness Store, choose **Web Studio** in New Harness, and select an empty folder.
+For a local checkout:
+
+```sh
+harness dsh install "$PWD/store/agents/web-studio" --link
+harness dsh doctor autonomous/web-studio
+```
+
+Requires the shared Web Viewer (Node 20+). Optional agent-side browser verification uses Playwright
+and the page's `proof.json`. GPU and software-renderer performance differ; the probe reports the
+actual renderer. Changes to the page are saved files; controls and exported PNGs do not rewrite it.
+
+## Credit and stewardship
+
+The original wrapper and starter are MIT-licensed OpenHarness work. See
+[PROVENANCE.md](PROVENANCE.md) for upstream tools, datasets and their separate
+licenses. No upstream ownership or endorsement is implied. Wrapper issues belong
+in OpenHarness; upstream maintainers are welcome to take stewardship of a package.
diff --git a/store/agents/web-studio/harness.json b/store/agents/web-studio/harness.json
new file mode 100644
index 000000000..39020cf6a
--- /dev/null
+++ b/store/agents/web-studio/harness.json
@@ -0,0 +1,34 @@
+{
+ "spec": 1,
+ "id": "autonomous/web-studio",
+ "name": "Web Studio",
+ "category": "Web",
+ "author": "OpenHarness contributors",
+ "description": "Build interactive pages and generative instruments with live previews, accessible controls, image export and real browser verification.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "index.html",
+ "init": "toolchain/init-workspace.sh"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": [
+ "skills"
+ ],
+ "env": {
+ "WEB_SKILLS": "${dsh}/skills"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": {
+ "use": "autonomous/isolated-web-viewer",
+ "artifactExtensions": [
+ ".html"
+ ]
+ },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/web-studio/package.json b/store/agents/web-studio/package.json
new file mode 100644
index 000000000..5de138398
--- /dev/null
+++ b/store/agents/web-studio/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "@autonomous/web-studio-harness",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "test": "node --test test/*.test.mjs",
+ "perf": "node skills/web/scripts/perf.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+}
diff --git a/store/agents/web-studio/skills/web/SKILL.md b/store/agents/web-studio/skills/web/SKILL.md
new file mode 100644
index 000000000..2c559a25e
--- /dev/null
+++ b/store/agents/web-studio/skills/web/SKILL.md
@@ -0,0 +1,38 @@
+---
+name: web
+description: Build and verify interactive HTML experiences in Web Studio's live, sandboxed preview.
+---
+
+# Web Studio
+
+`index.html` is the entry point. Local JS, CSS, images and ES modules work through the shared viewer;
+use relative URLs. No bundler is required. Prefer local assets for a reliable first open.
+
+Field's starter uses WebGL2 with a Canvas 2D fallback. Its geometry, palette and controls are all
+editable. Keep GPU resources and geometry buffers reusable; coalesce continuous updates in rAF.
+Pause animation when hidden and respect reduced motion. Controls must still work when paused.
+A new visual direction can replace the starter entirely when that serves the user's request.
+
+## Verify the experience
+
+Keep `proof.json` aligned with the current page. Each action names a CSS `selector`, followed by
+`click: true`, `fill` or `select`; assertions use exact `text` or
+`attribute: {"name":"aria-pressed","value":"true"}`. Include a state change and its meaningful result.
+
+```sh
+node "$WEB_SKILLS/web/scripts/screenshot.mjs" "$HARNESS_WORKSPACE/index.html"
+node "$WEB_SKILLS/web/scripts/perf.mjs" "$HARNESS_WORKSPACE/index.html"
+```
+
+The proof runs the real sandboxed HTTP viewer, checks the actions and browser errors, saves
+`.harness/last.png` and a dependency-hashed `browser-proof.json`, and refreshes the verdict.
+Inspect the image and test a narrow viewport as well as desktop.
+
+The performance probe drives those controls while measuring rAF delays and long tasks, rather than
+measuring an idle page. Target ≥55 fps and <2% slow frames. Record the hardware/renderer and dataset;
+a software WebGL renderer is not a measurement of the user's GPU. `PLAYWRIGHT_CHANNEL=chrome` can
+measure installed Chrome. Do not label an unmeasured or failing page “60 fps.”
+
+Helpers need Playwright plus Chromium, installed in the shared isolated-web-viewer package or addressed by
+`PLAYWRIGHT_MODULE` (absolute path to `playwright/index.mjs`). Missing tooling is a failed proof,
+not permission to report success. The preview itself needs only Node 20+.
diff --git a/store/agents/web-studio/skills/web/scripts/perf.mjs b/store/agents/web-studio/skills/web/scripts/perf.mjs
new file mode 100644
index 000000000..3b885bd05
--- /dev/null
+++ b/store/agents/web-studio/skills/web/scripts/perf.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'perf' });
+}
diff --git a/store/agents/web-studio/skills/web/scripts/screenshot.mjs b/store/agents/web-studio/skills/web/scripts/screenshot.mjs
new file mode 100755
index 000000000..4419012c3
--- /dev/null
+++ b/store/agents/web-studio/skills/web/scripts/screenshot.mjs
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+import { existsSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { pathToFileURL } from 'node:url';
+const candidates = [
+ ...(process.env.HARNESS_VIEWER_DIR ? [pathToFileURL(resolve(process.env.HARNESS_VIEWER_DIR, 'probe.mjs'))] : []),
+ new URL('../../../../isolated-web-viewer/probe.mjs', import.meta.url),
+ new URL('../../../../../viewers/isolated-web-viewer/probe.mjs', import.meta.url)
+];
+const path = candidates.find(file => existsSync(file));
+if (!path) {
+ console.error('Install or update autonomous/isolated-web-viewer to run browser verification.');
+ process.exitCode = 2;
+} else {
+ const { probe } = await import(path.href);
+ await probe({ mode: 'proof' });
+}
diff --git a/store/agents/web-studio/store.json b/store/agents/web-studio/store.json
new file mode 100644
index 000000000..93255ee49
--- /dev/null
+++ b/store/agents/web-studio/store.json
@@ -0,0 +1,16 @@
+{
+ "homepage": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/web-studio",
+ "upstream": "https://github.com/autonomous-ai/openharness/tree/main/store/agents/web-studio",
+ "license": "MIT",
+ "tagline": "Interactive web experiences, live in the pane",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/web-studio/starter.jpg"
+ ],
+ "examples": [
+ {
+ "prompt": "Open the Field starter, explore its three shapes, and export a still I can keep.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/web-studio/starter.jpg",
+ "caption": "Field · live WebGL instrument and PNG export"
+ }
+ ]
+}
diff --git a/store/agents/web-studio/template/index.html b/store/agents/web-studio/template/index.html
new file mode 100644
index 000000000..baa2c31fc
--- /dev/null
+++ b/store/agents/web-studio/template/index.html
@@ -0,0 +1,272 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Field — a motion playground</title>
+<style>
+:root{color-scheme:dark;--bg:#101513;--panel:#161c19;--line:#ffffff16;--ink:#edf0df;--muted:#929e92;--acid:#d4ee91;--mono:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}
+*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 system-ui,-apple-system,sans-serif}button,input{font:inherit}button{color:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:2px solid var(--acid);outline-offset:4px}button{touch-action:manipulation}
+header{height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:1px solid var(--line)}.brand{display:flex;gap:12px;align-items:center;font-size:21px;font-weight:650;letter-spacing:-1px}.brand svg{color:var(--acid)}.eyebrow{font:var(--mono);text-transform:uppercase;letter-spacing:1.6px;color:var(--muted)}.header-note{display:flex;align-items:center;gap:18px}.status{font:var(--mono);color:var(--acid);display:flex;align-items:center;gap:7px}.status i{width:5px;height:5px;background:currentColor;border-radius:100%}
+main{display:grid;grid-template-columns:minmax(0,1fr) 284px;min-height:calc(100dvh - 110px)}.scene{position:relative;min-height:600px;overflow:hidden}.scene canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}.intro{position:absolute;top:35px;left:32px;pointer-events:none;z-index:1}.intro h1{font-size:clamp(44px,5.6vw,82px);font-weight:450;line-height:1.01;letter-spacing:-4px;margin:13px 0 19px}.intro h1 em{font-family:Georgia,serif;font-weight:400;color:var(--acid)}.intro p{font-size:13px;line-height:1.7;color:var(--muted);max-width:224px}.scene-label{position:absolute;bottom:24px;left:32px;font:var(--mono);color:var(--muted)}.scene-label strong{color:var(--ink);font-weight:500}.scene-tools{position:absolute;bottom:24px;right:26px;display:flex;gap:6px}.scene-tools button{background:#17201bd9;border:1px solid #ffffff24;padding:8px 12px;border-radius:7px;font:var(--mono);backdrop-filter:blur(8px)}.scene-tools button:hover{border-color:var(--acid)}
+aside{border-left:1px solid var(--line);padding:30px 25px;display:flex;flex-direction:column;background:var(--panel)}.aside-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:27px}.aside-title h2{font-size:15px;letter-spacing:-.3px;font-weight:550;margin:0}.aside-title span{font:var(--mono);color:var(--muted)}.presets{display:grid;gap:8px}.preset{display:flex;align-items:center;gap:13px;padding:12px;background:transparent;border:1px solid var(--line);border-radius:8px;text-align:left;transition:background .15s,border-color .15s}.preset:hover{background:#ffffff05;border-color:#ffffff40}.preset[aria-pressed=true]{background:#d4ee910b;border-color:#d4ee9170}.preset .glyph{width:37px;height:37px;display:grid;place-items:center;border:1px solid #ffffff1a;border-radius:50%;color:var(--acid);font-size:23px;font-family:Georgia,serif}.preset b{display:block;font-size:13px;font-weight:500}.preset small{display:block;color:var(--muted);font-size:10px}.preset .key{margin-left:auto;color:var(--muted);font:var(--mono)}
+.controls{border-top:1px solid var(--line);margin-top:27px;padding-top:24px}.control{margin-bottom:25px}.control>div{display:flex;justify-content:space-between;margin-bottom:11px}.control label{font-size:12px}.control output{font:var(--mono);color:var(--acid)}input[type=range]{width:100%;height:3px;accent-color:var(--acid);cursor:pointer;display:block}.check{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin:4px 0 27px;cursor:pointer}.check input{accent-color:var(--acid);width:15px;height:15px}.export{margin-top:auto;width:100%;padding:12px 16px;border:0;background:var(--acid);color:#1a2416;border-radius:7px;text-align:left;display:flex;justify-content:space-between;font-size:12px;font-weight:600}.export:hover{background:#e4ffac}.small-note{font-size:10px;text-align:center;color:var(--muted);margin:11px 0 0}.footer{min-height:40px;border-top:1px solid var(--line);padding:10px 30px;display:flex;justify-content:space-between;gap:16px;font:var(--mono);color:var(--muted)}.footer kbd{font:inherit;color:var(--ink)}.toast{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);padding:10px 16px;background:var(--acid);color:#162014;border-radius:7px;pointer-events:none;font-size:12px;z-index:4}.toast:empty{display:none}
+@media(max-width:850px){main{grid-template-columns:minmax(0,1fr) 235px}aside{padding:24px 18px}.intro h1{font-size:54px;letter-spacing:-2px}.intro p{max-width:160px}.scene-tools{bottom:65px;right:16px}.header-note .eyebrow{display:none}}
+@media(max-width:600px){header{height:60px;padding:0 20px}main{display:flex;flex-direction:column;min-height:0}.scene{height:510px;min-height:0}.intro{top:24px;left:22px}.intro h1{font-size:50px}.intro p{max-width:165px;font-size:12px}.scene-label{left:22px;bottom:20px}.scene-tools{bottom:19px;right:16px}aside{border-left:0;border-top:1px solid var(--line);padding:22px}.aside-title{margin-bottom:18px}.presets{grid-template-columns:repeat(3,1fr);gap:6px}.preset{display:block;padding:10px}.preset .glyph{margin-bottom:8px}.preset small,.preset .key{display:none}.controls{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:22px;padding-top:22px}.control{margin-bottom:0}.control:last-child{grid-column:1/-1}.check{margin:23px 0}.export{margin-top:0}.footer{padding:12px 20px;font-size:9px}.footer>span:last-child{display:none}}
+@media(prefers-reduced-motion:reduce){*{transition:none!important}}
+</style>
+</head>
+<body>
+<header>
+ <div class="brand"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" aria-hidden="true"><ellipse cx="13" cy="13" rx="11" ry="5" stroke="currentColor" transform="rotate(-40 13 13)"/><ellipse cx="13" cy="13" rx="11" ry="5" stroke="currentColor" transform="rotate(40 13 13)"/></svg>Field<span class="eyebrow" style="margin-left:9px;letter-spacing:1px">/ Web Studio</span></div>
+ <div class="header-note"><span class="eyebrow">A playground for motion</span><span class="status"><i></i><span id="play-state">LIVE</span></span></div>
+</header>
+<main>
+ <section class="scene" aria-label="Interactive field">
+ <canvas id="field" role="img" aria-label="A luminous, three-dimensional field of flowing lines. Move your pointer to turn it."></canvas>
+ <div class="intro"><span class="eyebrow">Study <span id="study">001</span> / In your hands</span><h1>A little<br>room for<br><em>wonder.</em></h1><p>Move slowly. Change a shape.<br>See where curiosity takes you.</p></div>
+ <div class="scene-label"><strong id="scene-name">Orbit</strong> &nbsp; / &nbsp; <span id="line-count">112</span> paths<br><span id="seed-label">SEED 042</span></div>
+ <div class="scene-tools"><button id="shuffle" title="New variation (R)">↻ Variation</button><button id="pause" aria-pressed="false" title="Pause or play (Space)">Ⅱ Pause</button></div>
+ </section>
+ <aside aria-label="Field controls">
+ <div class="aside-title"><h2>Shape the field</h2><span>01—03</span></div>
+ <div class="presets" role="group" aria-label="Shape presets">
+ <button class="preset" data-preset="orbit" aria-pressed="true"><span class="glyph" aria-hidden="true">◎</span><span><b>Orbit</b><small>Everything comes around</small></span><span class="key">1</span></button>
+ <button class="preset" data-preset="weave" aria-pressed="false"><span class="glyph" aria-hidden="true">≋</span><span><b>Weave</b><small>Threads finding a rhythm</small></span><span class="key">2</span></button>
+ <button class="preset" data-preset="bloom" aria-pressed="false"><span class="glyph" aria-hidden="true">✳</span><span><b>Bloom</b><small>A different kind of flower</small></span><span class="key">3</span></button>
+ </div>
+ <div class="controls">
+ <div class="control"><div><label for="flow">Flow</label><output id="flow-value" for="flow">0.6×</output></div><input id="flow" type="range" min="0" max="1.5" step="0.1" value="0.6"></div>
+ <div class="control"><div><label for="detail">Detail</label><output id="detail-value" for="detail">112</output></div><input id="detail" type="range" min="48" max="160" step="8" value="112"></div>
+ <div class="control"><div><label for="spread">Spread</label><output id="spread-value" for="spread">64%</output></div><input id="spread" type="range" min="20" max="100" step="1" value="64"></div>
+ </div>
+ <label class="check" for="follow">Follow your pointer<input id="follow" type="checkbox" checked></label>
+ <button class="export" id="export">Keep this moment <span aria-hidden="true">↗</span></button>
+ <p class="small-note">Save the canvas as a PNG. Yours to keep.</p>
+ </aside>
+</main>
+<footer class="footer"><span><kbd>Space</kbd> pause &nbsp; · &nbsp; <kbd>R</kbd> new variation &nbsp; · &nbsp; <kbd>1–3</kbd> shape</span><span id="timing">Drawn locally · no network</span></footer>
+<div class="toast" id="toast" role="status"></div>
+<script>
+'use strict';
+const $ = id => document.getElementById(id);
+const canvas = $('field');
+const gl = canvas.getContext('webgl2', { alpha: false, antialias: false, preserveDrawingBuffer: true });
+const ctx = gl ? null : canvas.getContext('2d', { alpha: false });
+const media = matchMedia('(prefers-reduced-motion: reduce)');
+let running = !media.matches, preset = 'orbit', seed = 42, time = 1.9, flow = .6, detail = 112, spread = .64;
+let width = 1, height = 1, pixelRatio = 1, pointer = { x: 0, y: 0 }, view = { x: 0, y: 0 }, frame = 0, last = 0, reportAt = 0, drawMs = 0;
+const TAU = Math.PI * 2;
+const curve = Array.from({ length: 113 }, (_, j) => {
+ const u = j / 112 * TAU;
+ return { c: Math.cos(u), s: Math.sin(u), c2: Math.cos(2*u), s2: Math.sin(2*u), c3: Math.cos(3*u), s3: Math.sin(3*u), c5: Math.cos(5*u), s5: Math.sin(5*u) };
+});
+const backdrop = document.createElement('canvas');
+let backdropKey = '';
+function redraw() { if (!running) draw(); }
+// The field is one GPU draw call. The 2D renderer below is a compatibility fallback.
+function shader(type, source) {
+ const value=gl.createShader(type); gl.shaderSource(value,source); gl.compileShader(value);
+ if(!gl.getShaderParameter(value,gl.COMPILE_STATUS))throw new Error(gl.getShaderInfoLog(value));
+ return value;
+}
+function program(vertex,fragment) {
+ const value=gl.createProgram(),vs=shader(gl.VERTEX_SHADER,vertex),fs=shader(gl.FRAGMENT_SHADER,fragment);
+ gl.attachShader(value,vs);gl.attachShader(value,fs);gl.linkProgram(value);gl.deleteShader(vs);gl.deleteShader(fs);
+ if(!gl.getProgramParameter(value,gl.LINK_STATUS))throw new Error(gl.getProgramInfoLog(value));
+ return value;
+}
+let fieldProgram,backgroundProgram,fieldBuffer,indexBuffer,gpuDetail=0,vertexCount=0,vertices;
+if(gl){
+ fieldProgram=program(
+ '#version 300 es\nin vec3 position;in vec4 shade;uniform vec2 viewport;uniform vec2 center;uniform mat3 turn;uniform float radius;out vec4 ink;'+
+ 'void main(){vec3 p=turn*position;vec2 pixel=center+p.xy*radius*(3.7/(3.7-p.z));gl_Position=vec4(pixel.x/viewport.x*2.-1.,1.-pixel.y/viewport.y*2.,0.,1.);ink=shade;}',
+ '#version 300 es\nprecision highp float;in vec4 ink;out vec4 color;void main(){color=ink;}'
+ );
+ backgroundProgram=program(
+ '#version 300 es\nout vec2 uv;void main(){vec2 p=vec2(float((gl_VertexID<<1)&2),float(gl_VertexID&2));uv=vec2(p.x,1.-p.y);gl_Position=vec4(p*2.-1.,0.,1.);}',
+ '#version 300 es\nprecision highp float;uniform vec2 viewport;uniform vec2 center;uniform float radius;in vec2 uv;out vec4 color;'+
+ 'void main(){vec2 p=uv*viewport;float t=clamp(length(p-center)/(radius*1.75),0.,1.);vec3 bg=mix(vec3(.153,.188,.153),vec3(.063,.082,.075),smoothstep(0.,1.,t));vec2 d=mod(p-18.,30.);color=vec4(bg+vec3(.025)*step(d.x,1.)*step(d.y,1.),1.);}'
+ );
+ fieldBuffer=gl.createBuffer();
+ indexBuffer=gl.createBuffer();
+}
+function gpuDraw(cx,cy,radius,start) {
+ gl.viewport(0,0,canvas.width,canvas.height);
+ gl.disable(gl.BLEND);gl.useProgram(backgroundProgram);
+ gl.uniform2f(gl.getUniformLocation(backgroundProgram,'viewport'),width,height);
+ gl.uniform2f(gl.getUniformLocation(backgroundProgram,'center'),cx,cy);
+ gl.uniform1f(gl.getUniformLocation(backgroundProgram,'radius'),radius);
+ gl.drawArrays(gl.TRIANGLES,0,3);
+ gl.useProgram(fieldProgram);gl.bindBuffer(gl.ARRAY_BUFFER,fieldBuffer);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indexBuffer);
+ if(gpuDetail!==detail){
+ gpuDetail=detail;vertices=new Float32Array(detail*curve.length*7);
+ const indices=new Uint16Array(detail*(curve.length-1)*2);let k=0;
+ for(let ring=0;ring<detail;ring++)for(let i=0;i<curve.length-1;i++){
+ indices[k++]=ring*curve.length+i;indices[k++]=ring*curve.length+i+1;
+ }
+ vertexCount=indices.length;gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indices,gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER,vertices.byteLength,gl.DYNAMIC_DRAW);
+ }
+ const phase=(time*.24+(seed%10000)*.073)%TAU,cp=Math.cos(phase),sp=Math.sin(phase),cp2=Math.cos(phase*.15),sp2=Math.sin(phase*.15);
+ let k=0;
+ for(let ring=0;ring<detail;ring++){
+ const v=ring/detail*TAU,cv=Math.cos(v),sv=Math.sin(v),wave=Math.sin(v*3+phase);
+ const tube=.32+spread*.2+wave*.08,weaveZ=.1*Math.cos(v*2+phase),bloomZ=Math.sin(v+phase);
+ const hue=(preset==='orbit'?62+63*ring/detail:preset==='weave'?157+36*ring/detail:16+48*ring/detail)/360;
+ const light=.55+.13*Math.sin(v+phase),chroma=.6*(1-Math.abs(2*light-1));
+ const rgb=[0,4,2].map(offset=>light+chroma*(Math.max(0,Math.min(1,Math.abs((hue*6+offset)%6-3)-1))-.5));
+ for(const u of curve){
+ let x,y,z;
+ if(preset==='orbit'){const r=.83+tube*u.c;x=r*cv;y=r*sv;z=tube*u.s+.14*wave;}
+ else if(preset==='weave'){const r=.77+.28*(u.c3*cv-u.s3*sv);x=r*(u.c2*cp2-u.s2*sp2);y=r*(u.s2*cp2+u.c2*sp2);z=.47*(u.s3*cv+u.c3*sv)+weaveZ;}
+ else{const wave=u.c5*cp-u.s5*sp,r=(.7+.24*wave)*(.68+.38*cv);x=r*u.c;y=r*u.s;z=.35*sv+.21*wave*bloomZ;}
+ vertices[k++]=x;vertices[k++]=y;vertices[k++]=z;
+ vertices[k++]=rgb[0];vertices[k++]=rgb[1];vertices[k++]=rgb[2];vertices[k++]=.22+.24*(.5+.5*sv);
+ }
+ }
+ gl.bufferSubData(gl.ARRAY_BUFFER,0,vertices);
+ const position=gl.getAttribLocation(fieldProgram,'position'),shade=gl.getAttribLocation(fieldProgram,'shade');
+ gl.enableVertexAttribArray(position);gl.vertexAttribPointer(position,3,gl.FLOAT,false,28,0);
+ gl.enableVertexAttribArray(shade);gl.vertexAttribPointer(shade,4,gl.FLOAT,false,28,12);
+ gl.uniform2f(gl.getUniformLocation(fieldProgram,'viewport'),width,height);
+ gl.uniform2f(gl.getUniformLocation(fieldProgram,'center'),cx,cy);
+ const ax=.74+view.y*.8,ay=-.45+view.x*.9,sx=Math.sin(ax),cxr=Math.cos(ax),sy=Math.sin(ay),cyr=Math.cos(ay);
+ gl.uniformMatrix3fv(gl.getUniformLocation(fieldProgram,'turn'),false,[cyr,0,-sy,sx*sy,cxr,sx*cyr,cxr*sy,-sx,cxr*cyr]);
+ gl.uniform1f(gl.getUniformLocation(fieldProgram,'radius'),radius);
+ gl.enable(gl.BLEND);gl.blendFunc(gl.SRC_ALPHA,gl.ONE);gl.drawElements(gl.LINES,vertexCount,gl.UNSIGNED_SHORT,0);
+ gl.disableVertexAttribArray(position);gl.disableVertexAttribArray(shade);gl.disable(gl.BLEND);
+ drawMs=performance.now()-start;
+}
+function resize() {
+ const rect = canvas.getBoundingClientRect();
+ width = rect.width; height = rect.height; pixelRatio = Math.min(devicePixelRatio || 1, 2);
+ canvas.width = Math.round(width * pixelRatio); canvas.height = Math.round(height * pixelRatio);
+ if(ctx)ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
+ draw();
+}
+function draw() {
+ const start = performance.now();
+ const narrow = width < 550, cx = width * (narrow ? .58 : .61), cy = height * (narrow ? .73 : .53);
+ const scale = Math.min(width * (narrow ? .30 : .285), height * .35) * (.7 + spread * .48);
+ if(gl){gpuDraw(cx,cy,scale,start);return;}
+ const key = [width,height,pixelRatio,spread].join(':');
+ if (key !== backdropKey) {
+ backdropKey = key; backdrop.width = canvas.width; backdrop.height = canvas.height;
+ const bg = backdrop.getContext('2d', { alpha: false }); bg.scale(pixelRatio,pixelRatio);
+ bg.fillStyle = '#101513'; bg.fillRect(0,0,width,height);
+ const background = bg.createRadialGradient(cx,cy,0,cx,cy,scale*1.75);
+ background.addColorStop(0,'#273027'); background.addColorStop(.55,'#18231b'); background.addColorStop(1,'#101513');
+ bg.fillStyle=background; bg.fillRect(0,0,width,height);
+ bg.fillStyle='#8ea08819';
+ for(let y=18;y<height;y+=30) for(let x=18;x<width;x+=30) bg.fillRect(x,y,1,1);
+ }
+ ctx.drawImage(backdrop,0,0,width,height);
+ const ax = .74 + view.y * .8, ay = -.45 + view.x * .9;
+ const sx = Math.sin(ax), coX = Math.cos(ax), sy = Math.sin(ay), coY = Math.cos(ay);
+ const phase = time * .24 + seed * .073, cp = Math.cos(phase), sp = Math.sin(phase), cp2 = Math.cos(phase*.15), sp2 = Math.sin(phase*.15);
+ ctx.globalCompositeOperation = 'screen';
+ for (let ring = 0; ring < detail; ring++) {
+ const v = ring / detail * TAU, cv = Math.cos(v), sv = Math.sin(v), ripple = Math.sin(v * 3 + phase) * .08;
+ const hue = preset === 'orbit' ? 62 + 63 * ring / detail : preset === 'weave' ? 157 + 36 * ring / detail : 16 + 48 * ring / detail;
+ if (ring % 4 === 0) {
+ ctx.strokeStyle = 'hsla(' + hue + ',60%,' + (55 + 13 * Math.sin(v + phase)) + '%,' + (.2 + .42 * (.5 + .5 * sv)) + ')';
+ ctx.lineWidth = .8; ctx.beginPath();
+ }
+ const tube = .32 + spread * .2 + ripple, orbitZ = .14 * Math.sin(v*3+phase), weaveZ = .1*Math.cos(v*2+phase), bloomZ = Math.sin(v+phase);
+ for (let j = 0; j < curve.length; j++) {
+ const u = curve[j];
+ let x, y, z;
+ if (preset === 'orbit') {
+ const radial = .83 + tube * u.c;
+ x = radial * cv; y = radial * sv;
+ z = tube * u.s + orbitZ;
+ } else if (preset === 'weave') {
+ const radial = .77 + .28 * (u.c3*cv-u.s3*sv);
+ x = radial * (u.c2*cp2-u.s2*sp2);
+ y = radial * (u.s2*cp2+u.c2*sp2);
+ z = .47 * (u.s3*cv+u.c3*sv) + weaveZ;
+ } else {
+ const wave = u.c5*cp-u.s5*sp, radial = (.7 + .24 * wave) * (.68 + .38 * cv);
+ x = radial * u.c; y = radial * u.s;
+ z = .35 * sv + .21 * wave * bloomZ;
+ }
+ const yy = y * coX - z * sx, zz = y * sx + z * coX;
+ const xx = x * coY + zz * sy, depth = -x * sy + zz * coY;
+ const perspective = 3.7 / (3.7 - depth);
+ const px = cx + xx * scale * perspective, py = cy + yy * scale * perspective;
+ if (j === 0) ctx.moveTo(px, py); else ctx.lineTo(px, py);
+ }
+ if (ring % 4 === 3 || ring === detail-1) ctx.stroke();
+ }
+ ctx.globalCompositeOperation = 'source-over';
+ drawMs = performance.now() - start;
+}
+function tick(now) {
+ frame = 0;
+ if (!running || document.hidden) return;
+ const delta = last ? Math.min((now - last) / 1000, .05) : 0;
+ last = now; time += delta * flow;
+ view.x += (pointer.x - view.x) * .07; view.y += (pointer.y - view.y) * .07;
+ draw();
+ if (now - reportAt > 600) { $('timing').textContent = drawMs.toFixed(1) + ' ms / draw · rendered locally'; reportAt = now; }
+ frame = requestAnimationFrame(tick);
+}
+function syncPlayback() {
+ $('pause').textContent = running ? 'Ⅱ Pause' : '▷ Play';
+ $('pause').setAttribute('aria-pressed', String(!running));
+ $('play-state').textContent = running ? 'LIVE' : 'STILL';
+ if (frame) cancelAnimationFrame(frame);
+ frame = 0; last = 0;
+ if (running && !document.hidden) frame = requestAnimationFrame(tick);
+ else { draw(); $('timing').textContent = 'Still frame · ' + drawMs.toFixed(1) + ' ms to draw'; }
+}
+function selectPreset(value) {
+ preset = value;
+ document.querySelectorAll('[data-preset]').forEach(button => button.setAttribute('aria-pressed', String(button.dataset.preset === value)));
+ const names = { orbit: 'Orbit', weave: 'Weave', bloom: 'Bloom' };
+ $('scene-name').textContent = names[value];
+ $('study').textContent = String(Object.keys(names).indexOf(value) + 1).padStart(3, '0');
+ redraw();
+}
+function variation() { seed = (seed * 1664525 + 1013904223) >>> 0; $('seed-label').textContent = 'SEED ' + String(seed).padStart(3, '0'); redraw(); }
+document.querySelectorAll('[data-preset]').forEach(button => button.onclick = () => selectPreset(button.dataset.preset));
+$('pause').onclick = () => { running = !running; syncPlayback(); };
+$('shuffle').onclick = variation;
+$('flow').oninput = event => { flow = Number(event.target.value); $('flow-value').textContent = flow.toFixed(1) + '×'; redraw(); };
+$('detail').oninput = event => { detail = Number(event.target.value); $('detail-value').textContent = detail; $('line-count').textContent = detail; redraw(); };
+$('spread').oninput = event => { spread = Number(event.target.value) / 100; $('spread-value').textContent = event.target.value + '%'; redraw(); };
+function point(event) {
+ if (!$('follow').checked) return;
+ const rect = canvas.getBoundingClientRect();
+ pointer.x = (event.clientX - rect.left) / width - .5; pointer.y = (event.clientY - rect.top) / height - .5;
+ if (!running) { view = { ...pointer }; draw(); }
+}
+canvas.addEventListener('pointermove', point);
+canvas.addEventListener('pointerdown', event => { canvas.setPointerCapture(event.pointerId); point(event); });
+$('follow').onchange = () => { pointer = { x: 0, y: 0 }; if (!running) { view = { ...pointer }; draw(); } };
+document.addEventListener('visibilitychange', syncPlayback);
+media.addEventListener('change', event => { if (event.matches) { running = false; syncPlayback(); } });
+document.addEventListener('keydown', event => {
+ if (/INPUT|BUTTON|SELECT|TEXTAREA/.test(event.target.tagName) || event.metaKey || event.ctrlKey || event.altKey) return;
+ if (event.code === 'Space') { event.preventDefault(); running = !running; syncPlayback(); }
+ if (event.key.toLowerCase() === 'r') variation();
+ if (['1','2','3'].includes(event.key)) selectPreset(['orbit','weave','bloom'][Number(event.key) - 1]);
+});
+let toastTimer;
+$('export').onclick = () => {
+ draw();
+ canvas.toBlob(blob => {
+ if (!blob) return;
+ const url = URL.createObjectURL(blob), link = document.createElement('a');
+ link.href = url; link.download = 'field-' + preset + '-' + seed + '.png'; link.click();
+ setTimeout(() => URL.revokeObjectURL(url), 30000);
+ $('toast').textContent = 'A little wonder, saved.';
+ clearTimeout(toastTimer); toastTimer = setTimeout(() => $('toast').textContent = '', 2200);
+ }, 'image/png');
+};
+new ResizeObserver(resize).observe(canvas);
+resize(); syncPlayback();
+</script>
+</body>
+</html>
diff --git a/store/agents/web-studio/template/proof.json b/store/agents/web-studio/template/proof.json
new file mode 100644
index 000000000..4452364f1
--- /dev/null
+++ b/store/agents/web-studio/template/proof.json
@@ -0,0 +1,10 @@
+{
+ "actions": [
+ { "selector": "[data-preset=bloom]", "click": true },
+ { "selector": "#scene-name", "text": "Bloom" },
+ { "selector": "#spread", "fill": "72" },
+ { "selector": "#spread-value", "text": "72%" },
+ { "selector": "[data-preset=orbit]", "click": true },
+ { "selector": "#scene-name", "text": "Orbit" }
+ ]
+}
diff --git a/store/agents/web-studio/test/toolchain.test.mjs b/store/agents/web-studio/test/toolchain.test.mjs
new file mode 100644
index 000000000..8e8e2ee7a
--- /dev/null
+++ b/store/agents/web-studio/test/toolchain.test.mjs
@@ -0,0 +1,54 @@
+// Web Studio's scripts, run the way Harness runs them.
+// node --test test/*.test.mjs
+import assert from 'node:assert/strict'
+import { spawnSync } from 'node:child_process'
+import { accessSync, constants, existsSync, mkdtempSync, readFileSync, writeFileSync, rmSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { after, test } from 'node:test'
+
+const here = fileURLToPath(new URL('..', import.meta.url))
+const manifest = JSON.parse(readFileSync(join(here, 'harness.json'), 'utf8'))
+const scratch = []
+after(() => { for (const d of scratch) rmSync(d, { recursive: true, force: true }) })
+function tempDir() { const d = mkdtempSync(join(tmpdir(), 'web-studio-')); scratch.push(d); return d }
+function run(script, { cwd = here, env = {} } = {}) {
+ const merged = { ...process.env }
+ for (const [k, v] of Object.entries(env)) if (v === null) delete merged[k]; else merged[k] = v
+ const r = spawnSync(join(here, script), { cwd, env: merged, encoding: 'utf8' })
+ return { code: r.status, stdout: r.stdout, stderr: r.stderr }
+}
+
+test('every script the manifest names is executable', () => {
+ for (const s of [manifest.workspace.init, manifest.toolchain.setup, manifest.toolchain.doctor, 'skills/web/scripts/screenshot.mjs'])
+ assert.doesNotThrow(() => accessSync(join(here, s), constants.X_OK), s)
+})
+
+test('doctor always ok (no native toolchain needed)', () => {
+ const { code, stdout } = run(manifest.toolchain.doctor)
+ assert.equal(code, 0); assert.match(stdout, /ok isolated-web-viewer/)
+})
+
+test('setup is a quiet no-op', () => {
+ const { code, stdout, stderr } = run(manifest.toolchain.setup)
+ assert.deepEqual([code, stdout, stderr], [0, '', ''])
+})
+
+test('init seeds the first verdict', () => {
+ const ws = tempDir()
+ assert.equal(run(manifest.workspace.init, { cwd: ws, env: { HARNESS_DSH: manifest.id } }).code, 0)
+ assert.equal(JSON.parse(readFileSync(join(ws, '.harness/verdict.json'), 'utf8')).ready, false)
+})
+
+test('template is a real, loadable html page with an interaction', () => {
+ const html = readFileSync(join(here, 'template/index.html'), 'utf8')
+ assert.match(html, /<canvas/); assert.match(html, /pointermove/); assert.match(html, /requestAnimationFrame/)
+ assert.match(html, /<title>/)
+})
+
+test('the golden-loop command in SKILL.md matches the shipped proof script', () => {
+ const skill = readFileSync(join(here, 'skills/web/SKILL.md'), 'utf8')
+ assert.ok(skill.includes('node "$WEB_SKILLS/web/scripts/screenshot.mjs"'))
+ assert.equal(manifest.agent.env.WEB_SKILLS, '${dsh}/skills')
+})
diff --git a/store/agents/web-studio/toolchain/doctor.sh b/store/agents/web-studio/toolchain/doctor.sh
new file mode 100755
index 000000000..b4b0f04b7
--- /dev/null
+++ b/store/agents/web-studio/toolchain/doctor.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -u
+echo "ok isolated-web-viewer is the runtime (no native toolchain required)"
+command -v node >/dev/null 2>&1 && echo "ok node (for the headless proof)" || echo "warn node missing — headless proof screenshot.mjs won't run (page still works)"
+exit 0
diff --git a/store/agents/web-studio/toolchain/init-workspace.sh b/store/agents/web-studio/toolchain/init-workspace.sh
new file mode 100755
index 000000000..caf390ee9
--- /dev/null
+++ b/store/agents/web-studio/toolchain/init-workspace.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -u
+mkdir -p .harness
+cat > .harness/verdict.json <<'JSON'
+{ "spec": 1, "ready": false, "summary": "Web workspace ready — describe a page to build",
+ "findings": [], "artifact": "index.html", "updatedAt": "2026-09-18T00:00:00Z" }
+JSON
+printf 'Web workspace initialized by %s\n' "${HARNESS_DSH:-web-studio}" > .harness-initialized
diff --git a/store/agents/web-studio/toolchain/setup.sh b/store/agents/web-studio/toolchain/setup.sh
new file mode 100755
index 000000000..b95e20fc1
--- /dev/null
+++ b/store/agents/web-studio/toolchain/setup.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Web Studio needs no native toolchain — the viewer IS the runtimeaine. Optional: node for the proof script.
+set -u
+exit 0
diff --git a/store/showcase/data-studio/starter.jpg b/store/showcase/data-studio/starter.jpg
new file mode 100644
index 000000000..4137b0389
Binary files /dev/null and b/store/showcase/data-studio/starter.jpg differ
diff --git a/store/showcase/firmware-studio/starter.jpg b/store/showcase/firmware-studio/starter.jpg
new file mode 100644
index 000000000..bc5f083ca
Binary files /dev/null and b/store/showcase/firmware-studio/starter.jpg differ
diff --git a/store/showcase/freecad/starter.jpg b/store/showcase/freecad/starter.jpg
new file mode 100644
index 000000000..454e5c716
Binary files /dev/null and b/store/showcase/freecad/starter.jpg differ
diff --git a/store/showcase/gis/starter.jpg b/store/showcase/gis/starter.jpg
new file mode 100644
index 000000000..e64120b93
Binary files /dev/null and b/store/showcase/gis/starter.jpg differ
diff --git a/store/showcase/godot-studio/starter.jpg b/store/showcase/godot-studio/starter.jpg
new file mode 100644
index 000000000..c909a2576
Binary files /dev/null and b/store/showcase/godot-studio/starter.jpg differ
diff --git a/store/showcase/home-assistant/starter.jpg b/store/showcase/home-assistant/starter.jpg
new file mode 100644
index 000000000..15c1bfd06
Binary files /dev/null and b/store/showcase/home-assistant/starter.jpg differ
diff --git a/store/showcase/openscad/starter.jpg b/store/showcase/openscad/starter.jpg
new file mode 100644
index 000000000..832b63974
Binary files /dev/null and b/store/showcase/openscad/starter.jpg differ
diff --git a/store/showcase/orca-slicer/starter.jpg b/store/showcase/orca-slicer/starter.jpg
new file mode 100644
index 000000000..3feaf00d5
Binary files /dev/null and b/store/showcase/orca-slicer/starter.jpg differ
diff --git a/store/showcase/quantum-studio/starter.jpg b/store/showcase/quantum-studio/starter.jpg
new file mode 100644
index 000000000..f1f7b5f94
Binary files /dev/null and b/store/showcase/quantum-studio/starter.jpg differ
diff --git a/store/showcase/score/starter.jpg b/store/showcase/score/starter.jpg
new file mode 100644
index 000000000..4a7b7f150
Binary files /dev/null and b/store/showcase/score/starter.jpg differ
diff --git a/store/showcase/sheet-docs/starter.jpg b/store/showcase/sheet-docs/starter.jpg
new file mode 100644
index 000000000..dab35ca31
Binary files /dev/null and b/store/showcase/sheet-docs/starter.jpg differ
diff --git a/store/showcase/web-studio/starter.jpg b/store/showcase/web-studio/starter.jpg
new file mode 100644
index 000000000..6412c7115
Binary files /dev/null and b/store/showcase/web-studio/starter.jpg differ
diff --git a/store/tools/browser/README.md b/store/tools/browser/README.md
new file mode 100644
index 000000000..ffd8543b8
--- /dev/null
+++ b/store/tools/browser/README.md
@@ -0,0 +1,51 @@
+# Group A browser verification
+
+These tests exercise real templates through the shared Web Viewer's opaque-origin iframe.
+They cover data loading, user interactions, downloads, errors, and responsive layout.
+
+Install Playwright and Chromium in your development environment. If Playwright is not available
+through normal module resolution, set `PLAYWRIGHT_MODULE` to its absolute `index.mjs` path.
+For the release benchmark, also install Chrome and run from the repository root:
+
+```sh
+PLAYWRIGHT_CHANNEL=chrome node --test --test-concurrency=1 store/tools/browser/*.test.mjs
+```
+
+Set `HARNESS_QA_DIR` to a directory outside the workspace to retain screenshots. Tests create
+temporary workspaces and remove only those they created. Headless Chromium and loopback servers
+need permission to run outside restrictive macOS sandboxes.
+
+The reusable runtime probe ships with `store/viewers/isolated-web-viewer/probe.mjs`. The harness proof/perf
+commands call it through the installed viewer dependency. Put `proof.json` in a generated workspace
+to describe a real interaction and an assertion of its result; adapt the starter recipe when changing
+the product. It accepts CSS selectors with `click`, `fill`, `select`, exact `text`, and `attribute`
+checks. A missing recipe, a browser error, or a failed assertion fails the probe.
+
+Proof runs write `.harness/browser-proof.json` (including hashes of loaded local resources) and
+`.harness/last.png`. Performance runs exercise the recipe during sampling and record frame rate,
+95th-percentile frame intervals, slow-frame proportion, long tasks, and interaction rounds in
+`.harness/perf.json`. These are browser frame timings on the test machine, not end-to-photon latency
+or proof of performance on every device.
+
+Use `PLAYWRIGHT_CHANNEL=chrome` to benchmark installed Chrome with the machine's GPU. On this
+Intel Mac the default headless-shell browser uses SwiftShader, while Chrome uses the Radeon/Metal
+renderer. Reports include that distinction. Keep performance tests serial so they do not compete
+for the same GPU. Proof mode also updates `.harness/verdict.json`, including on failure.
+
+## Native output checks
+
+Native browser tests are opt-in: first run the real package build, then set
+`GODOT_QA_WORKSPACE`, `ORCA_QA_WORKSPACE`, `FIRMWARE_QA_WORKSPACE`,
+`SCORE_QA_WORKSPACE` and `SHEET_DOCS_QA_WORKSPACE` to those project directories.
+Without them, the corresponding tests report skips, not native success.
+The document test also requires the shared Doc Viewer's pinned PDF.js dependency.
+
+`showcase.mjs` captures 1600×1000 JPEGs directly from actual interactive previews.
+It uses the same native workspace variables and writes only the matching folders
+under `store/showcase/`. To capture the PDF reader, run its test with
+`HARNESS_SHOWCASE_DIR` set to the absolute `store/showcase` directory. CAD images
+come from the actual CAD Viewer with the inspected STL/STEP loaded, not a mockup.
+
+These new harnesses use `autonomous/isolated-web-viewer`. Existing packages keep
+their separate trusted `autonomous/web-viewer` behavior; this release does not
+change their storage or iframe contract.
diff --git a/store/tools/browser/VERIFICATION.md b/store/tools/browser/VERIFICATION.md
new file mode 100644
index 000000000..ef2fe67fb
--- /dev/null
+++ b/store/tools/browser/VERIFICATION.md
@@ -0,0 +1,55 @@
+# Group A release evidence — 2026-09-20
+
+These are observed results, not certificates of arbitrary future projects.
+Native tools were run in isolated temporary workspaces on an Intel Mac; no
+printer, microcontroller or Home Assistant installation was contacted.
+
+## Automated checks
+
+- 93 package tests passed, including parsers, mathematical reference cases,
+ validation, fresh-output requirements and failed-build regressions. Transport
+ fixtures do not stand in for the native runs below.
+- 24 isolated-viewer tests passed: sandbox/CORS boundaries, path handling, file
+ limits, watchers, process lifecycle and managed Node invocation.
+- 21 real browser checks passed, covering desktop/narrow layouts, downloads, state changes,
+ invalid imports and HTML-like input. Optional native tests require real built
+ workspaces; absent variables result in explicit skips.
+- All 12 package manifests conform to the Harness contract. All 12 skills pass
+ the skill validator. Runtime copies match the canonical helper.
+- Five interaction/performance probes (Web, Data, Quantum, GIS, Godot) measured
+ 56–60 fps, p95 16.7–16.8 ms and zero long tasks on this machine. Renderer and loaded
+ resource hashes are recorded by the probe. Software WebGL can be much slower;
+ these are not portable hardware-performance guarantees. A separate default
+ headless Chromium run passed functional checks but missed Web Studio's frame
+ budget at 50.7 fps on SwiftShader; the release benchmark uses installed Chrome
+ with the AMD Metal renderer, not software rendering.
+
+## Actual native outputs
+
+| Harness | Runtime and observed result |
+| --- | --- |
+| OpenSCAD | 2021.01: Ripple STL, 14,756 triangles, closed edge topology, approximately 87.2 × 87.2 × 76 mm; real CAD view, zoom/orbit/reset inspected. |
+| FreeCAD | 1.1.3: Pocket STEP re-imported as two valid closed solids, approximately 48,839 mm³ combined volume; actual enclosure/lid preview and zoom/reset inspected. |
+| Orca Slicer | 2.4.2: flattened named demo profiles, fresh G-code, 240 extrusion heights; slicer estimates 30.76 g and 3h23m4s. Layer, stack, projection, download and narrow layout tested. Not printed. |
+| Firmware | PlatformIO Core 6.1.18, espressif32 6.10.0: real ESP32 build; static RAM 21,464 / 327,680 bytes; flash 269,197 / 1,310,720 bytes. Dashboard tabs, log filter and firmware download tested. Not flashed. |
+| Godot | 4.4.1 with matching export templates: nine native gameplay/rendering assertions and a real browser playthrough collecting all six seeds, win, restart, pause and mobile input. Single-threaded Web export. Caching procedural artwork fixed an observed 9 fps regression: the final Chrome/AMD Metal probe measured 60 fps, p95 16.7 ms, no slow frames or long tasks over 25 pause/restart interaction rounds. |
+| Score | LilyPond 2.26.0: warning-free PDF/SVG, one visually reviewed page, 142 MIDI notes, about 35.56 seconds. Playback, seek, speed, pause, downloads and narrow layout tested. Synthesized sketch, not a piano recording. |
+| Sheet & Docs | LibreOfficeDev 26.8.0.0.alpha0: real DOCX-to-PDF and XLSX re-save. Full report and native workbook PDF visually inspected. Independent spreadsheet import/recalculation verified 45,500 → 49,200, +3,700, 8.131868%; changing an input recalculates, restoring it restores totals. |
+| Home Assistant | yaml 2.8.1 parses the real starter; local state/time/threshold scenarios tested. Unsupported semantics return unknown. No claim of Home Assistant runtime validation. |
+
+Web, Data, Quantum and GIS execute entirely in their actual browser starters.
+Quantum's single canonical statevector engine is checked against basis, phase,
+inverse, entangled-state and reduced-state reference cases. GIS ships pinned
+Leaflet and Natural Earth data for an offline first view.
+
+## Publication assets and boundaries
+
+The 12 store JPEGs are direct 1600×1000 captures of these outputs, under 350 KB
+each. No invented UI, simulated build logs or AI-generated product screenshots.
+Browser controls that do not persist say so; exports provide a save path.
+
+The new isolated-web-viewer is a separate dependency. Existing trusted
+web-viewer consumers retain their original behavior and are not migrated.
+Native engines remain separate prerequisites; package docs name tested versions
+and binary overrides. Success is not manufacturing, electrical, accounting,
+musical or production-home certification.
diff --git a/store/tools/browser/data-studio.test.mjs b/store/tools/browser/data-studio.test.mjs
new file mode 100644
index 000000000..b3c7828c8
--- /dev/null
+++ b/store/tools/browser/data-studio.test.mjs
@@ -0,0 +1,67 @@
+import assert from 'node:assert/strict';
+import { readFile } from 'node:fs/promises';
+import { test, before, after } from 'node:test';
+import { chromium, preview } from './helpers.mjs';
+import { parseCSV } from '../../agents/data-studio/template/data.mjs';
+
+let browser;
+before(async () => { browser = await (await chromium()).launch({ headless: true }); });
+after(async () => { await browser?.close(); });
+
+test('Data Studio charts actual workspace data, filters, changes metrics, inspects points and exports the selected rows', async () => {
+ const run = await preview(browser, 'store/agents/data-studio/template');
+ try {
+ const frame = await run.open();
+ await frame.locator('#total').filter({ hasText: '203,000' }).waitFor();
+ assert.equal(await frame.locator('#leader').textContent(), 'East');
+ assert.equal(await frame.locator('#plot .point').count(), 16);
+ console.log('screenshot:', await run.screenshot('data-studio-desktop'));
+ for (const group of ['East', 'South', 'West']) await frame.getByRole('button', { name: group, exact:true }).click();
+ assert.equal(await frame.locator('#total').textContent(), '54,600');
+ await frame.getByRole('button', { name: 'Bars', exact:true }).click();
+ assert.equal(await frame.locator('#plot rect.point').count(), 4);
+ await frame.getByRole('button', { name: 'North · 2025-Q1 · 12,400', exact:true }).click();
+ assert.equal(await frame.locator('#table tbody tr').count(), 1);
+ assert.match(await frame.locator('#table-note').textContent(), /Inspecting North/);
+ await frame.getByLabel('From period').selectOption('2025-Q3');
+ assert.equal(await frame.locator('#total').textContent(), '29,000');
+ const download = run.page.waitForEvent('download');
+ await frame.getByRole('button', { name: /Export selection/ }).click();
+ const csv = parseCSV(await readFile(await (await download).path(),'utf8'));
+ assert.equal(csv.rows.length, 2);
+ assert.equal(csv.rows[0].region, 'North');
+ await frame.getByRole('button', { name: 'North', exact:true }).click();
+ await frame.getByText('A fresh perspective starts with a selection.', {exact:true}).waitFor();
+ assert.equal(await frame.locator('#export').isDisabled(),true);
+ await frame.getByRole('button', { name: 'Reset filters', exact:true }).click();
+ await frame.locator('summary').click();
+ await frame.getByLabel('Value column').selectOption('units');
+ assert.equal(await frame.locator('#total').textContent(), '5,071');
+ await run.page.setViewportSize({width:390,height:844});
+ assert.equal(await frame.locator('html').evaluate(el=>el.scrollWidth<=el.clientWidth),true);
+ console.log('screenshot:', await run.screenshot('data-studio-mobile'));
+ assert.deepEqual(run.errors,[]);
+ } finally { await run.close(); }
+});
+
+test('an uploaded CSV changes the schema, safely displays text, and reports malformed data without sample fallbacks', async () => {
+ const run = await preview(browser,'store/agents/data-studio/template');
+ try {
+ const frame=await run.open();
+ await frame.locator('#total').filter({hasText:'203,000'}).waitFor();
+ await frame.locator('#upload').setInputFiles({name:'experiment.csv',mimeType:'text/csv',buffer:Buffer.from('month,team,value\nJan,"North, coast",1.5\nFeb,"North, coast",2.5\nFeb,<img src=x onerror=alert(1)>,-1')});
+ await frame.locator('#total').filter({hasText:'3'}).waitFor();
+ assert.equal(await frame.locator('#total').textContent(),'3');
+ assert.equal(await frame.locator('#regions img').count(),0);
+ assert.equal(await frame.getByRole('button',{name:'North, coast',exact:true}).count(),1);
+ assert.equal(await frame.locator('#plot .point').count(),4);
+ await frame.locator('#upload').setInputFiles({name:'invalid.csv',mimeType:'text/csv',buffer:Buffer.from('a,b,c\n"unclosed,1,2')});
+ await frame.getByRole('alert').waitFor();
+ assert.match(await frame.locator('#error-message').textContent(), /no closing quote/);
+ assert.equal(await frame.locator('#dashboard').isVisible(),false);
+ assert.equal(await frame.locator('#export').isDisabled(),true);
+ await frame.getByRole('button',{name:'Reload data.csv'}).click();
+ await frame.locator('#total').filter({hasText:'203,000'}).waitFor();
+ assert.deepEqual(run.errors,[]);
+ } finally {await run.close();}
+});
diff --git a/store/tools/browser/firmware-studio.test.mjs b/store/tools/browser/firmware-studio.test.mjs
new file mode 100644
index 000000000..5b98dad23
--- /dev/null
+++ b/store/tools/browser/firmware-studio.test.mjs
@@ -0,0 +1,5 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {chromium,preview} from './helpers.mjs';
+test('Signal: actual build metrics, log filter, configuration, pins and firmware download',{skip:!process.env.FIRMWARE_QA_WORKSPACE},async()=>{
+ const browser=await(await chromium()).launch({headless:true}),p=await preview(browser,process.env.FIRMWARE_QA_WORKSPACE,{file:'build-status.html'});
+ try{const f=await p.open();assert.match(await f.locator('#flash-detail').textContent(),/269,?197/);assert.match(await f.locator('#ram-detail').textContent(),/21,?464/);await f.locator('#filter').fill('not-present-log-line');assert.equal(await f.locator('#log').textContent(),'No log lines match.');await f.locator('#tab-config').click();assert.match(await f.locator('#config').textContent(),/[email protected]/);await f.locator('#tab-pins').click();assert.ok((await f.locator('#pins').textContent()).length>10);await f.locator('#tab-log').click();await f.locator('#filter').fill('');const download=p.page.waitForEvent('download');await f.locator('#artifacts a').first().click();assert.ok((await download).suggestedFilename().length>0);await f.locator('body').evaluate(()=>window.scrollTo(0,0));await p.screenshot('firmware-studio-desktop');await p.page.setViewportSize({width:390,height:844});assert.equal(await f.locator('body').evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);await f.locator('body').evaluate(()=>window.scrollTo(0,0));await p.screenshot('firmware-studio-mobile');assert.deepEqual(p.errors,[]);}finally{await p.close();await browser.close();}
+});
diff --git a/store/tools/browser/gis.test.mjs b/store/tools/browser/gis.test.mjs
new file mode 100644
index 000000000..62fcf6542
--- /dev/null
+++ b/store/tools/browser/gis.test.mjs
@@ -0,0 +1,60 @@
+import assert from 'node:assert/strict';
+import { test, before, after } from 'node:test';
+import { readFile } from 'node:fs/promises';
+import { chromium, preview } from './helpers.mjs';
+let browser;
+before(async()=>{browser=await(await chromium()).launch({headless:true});});
+after(async()=>{await browser?.close();});
+test('Atlas loads fully offline, filters and selects features, pans, zooms, measures and exports actual GeoJSON',async()=>{
+ const run=await preview(browser,'store/agents/gis/template');
+ try{
+ const requests=[];
+ await run.context.route('**/*',route=>{const url=new URL(route.request().url());if(!['127.0.0.1','localhost'].includes(url.hostname)){requests.push(url.href);return route.abort();}return route.continue();});
+ const frame=await run.open();await frame.locator('#count').filter({hasText:'4'}).waitFor();
+ await frame.locator('.leaflet-overlay-pane path[fill="#e5ead8"]').first().waitFor({state:'attached'});
+ assert.equal(await frame.locator('.leaflet-overlay-pane path[fill="#e5ead8"]').count(),177);
+ assert.equal(await frame.locator('#error').isVisible(),false);
+ console.log('screenshot:',await run.screenshot('gis-desktop'));
+ await frame.getByLabel('Search features').fill('Hanoi');assert.equal(await frame.locator('#count').textContent(),'1');
+ await frame.locator('.feature').click();assert.equal(await frame.locator('#details h2').textContent(),'Hanoi');
+ const download=run.page.waitForEvent('download');await frame.locator('#export').click();
+ const file=await download;const exported=JSON.parse(await readFile(await file.path(),'utf8'));
+ assert.equal(exported.features.length,1);assert.deepEqual(exported.features[0].geometry.coordinates,[105.8342,21.0278]);
+ await frame.getByLabel('Search features').fill('nowhere');assert.equal(await frame.locator('#empty').isVisible(),true);
+ assert.equal(await frame.locator('#export').isDisabled(),true);
+ await frame.getByLabel('Search features').fill('');await frame.locator('#fit').click();
+ const before=await frame.locator('#bounds-label').textContent();await frame.getByRole('button',{name:'Zoom in',exact:true}).click();
+ assert.notEqual(await frame.locator('#bounds-label').textContent(),before);
+ const map=frame.locator('#map'),box=await map.boundingBox();
+ const panBefore=await frame.locator('#bounds-label').textContent();
+ await run.page.mouse.move(box.x+box.width*.5,box.y+box.height*.5);await run.page.mouse.down();await run.page.mouse.move(box.x+box.width*.6,box.y+box.height*.55,{steps:5});await run.page.mouse.up();
+ await frame.locator('#bounds-label').filter({hasText:panBefore}).waitFor({state:'hidden',timeout:5000});
+ assert.notEqual(await frame.locator('#bounds-label').textContent(),panBefore);
+ await frame.locator('#measure').click();
+ await map.click({position:{x:box.width*.35,y:box.height*.4}});await map.click({position:{x:box.width*.65,y:box.height*.6}});
+ assert.match(await frame.locator('#measurement').textContent(),/km · great-circle estimate/);
+ await frame.locator('#clear-measure').click();assert.match(await frame.locator('#measurement').textContent(),/Tap two/);
+ await run.page.setViewportSize({width:390,height:844});
+ await frame.locator('#map').scrollIntoViewIfNeeded();
+ assert.equal(await frame.locator('html').evaluate(el=>el.scrollWidth<=el.clientWidth),true);
+ console.log('screenshot:',await run.screenshot('gis-mobile'));
+ assert.deepEqual(requests,[]);assert.deepEqual(run.errors,[]);
+ }finally{await run.close();}
+});
+test('Atlas imports points, lines and polygons safely, rejects malformed data, and preserves the previous valid layer',async()=>{
+ const run=await preview(browser,'store/agents/gis/template');
+ try{
+ const frame=await run.open();await frame.locator('#count').filter({hasText:'4'}).waitFor();
+ const name='<img src=x onerror="window.injected=1">';
+ const features=[{type:'Feature',properties:{name},geometry:{type:'Point',coordinates:[0,0]}},{type:'Feature',properties:{name:'Route'},geometry:{type:'LineString',coordinates:[[0,0],[1,1]]}},{type:'Feature',properties:{name:'Area'},geometry:{type:'Polygon',coordinates:[[[0,0],[1,0],[1,1],[0,0]]]}}];
+ await frame.locator('#upload').setInputFiles({name:'my places.geojson',mimeType:'application/geo+json',buffer:Buffer.from(JSON.stringify({type:'FeatureCollection',features}))});
+ await frame.locator('#count').filter({hasText:'3'}).waitFor();
+ await frame.locator('.feature').first().click();assert.equal(await frame.locator('#details h2').textContent(),name);
+ assert.equal(await frame.locator('#details img').count(),0);
+ await frame.locator('#type').selectOption('Polygon');assert.equal(await frame.locator('#count').textContent(),'1');
+ await frame.locator('#upload').setInputFiles({name:'bad.geojson',mimeType:'application/geo+json',buffer:Buffer.from('{bad')});
+ await frame.locator('#error').waitFor();assert.match(await frame.locator('#error').textContent(),/previous layer is unchanged/);
+ assert.equal(await frame.locator('#count').textContent(),'1');
+ assert.deepEqual(run.errors,[]);
+ }finally{await run.close();}
+});
diff --git a/store/tools/browser/godot-studio.test.mjs b/store/tools/browser/godot-studio.test.mjs
new file mode 100644
index 000000000..0df6795a7
--- /dev/null
+++ b/store/tools/browser/godot-studio.test.mjs
@@ -0,0 +1,14 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {cp} from 'node:fs/promises';import {chromium,preview} from './helpers.mjs';
+test('real Godot export plays through all pickups, pauses, restarts and supports narrow screens',{skip:!process.env.GODOT_QA_WORKSPACE},async()=>{
+ const browser=await(await chromium()).launch({headless:true,...(process.env.PLAYWRIGHT_CHANNEL?{channel:process.env.PLAYWRIGHT_CHANNEL}:{})});
+ const p=await preview(browser,null,{file:'build/web/index.html',context:{viewport:{width:1600,height:1100}},prepare:ws=>cp(process.env.GODOT_QA_WORKSPACE+'/build',ws+'/build',{recursive:true})});
+ try{
+ const f=await p.open();await f.locator('#game-state[data-ready="true"]').waitFor({state:'attached',timeout:120000});await f.locator('#loading').waitFor({state:'hidden'});const canvas=f.locator('#canvas');
+ for(const [i,[x,y]]of [[450,350],[700,200],[930,350],[750,525],[430,530],[230,190]].entries()){
+ const box=await canvas.boundingBox();await canvas.click({position:{x:x/1200*box.width,y:y/700*box.height}});await f.locator('#game-state[data-collected="'+(i+1)+'"]').waitFor({state:'attached',timeout:15000});
+ }
+ assert.equal(await f.locator('#game-state').getAttribute('data-won'),'true');await f.locator('#restart').click();assert.equal(await f.locator('#collected').textContent(),'0');await f.locator('#pause').click();assert.equal(await f.locator('#pause').getAttribute('aria-pressed'),'true');const before=await f.locator('#game-state').getAttribute('data-x');await canvas.press('ArrowRight');assert.equal(await f.locator('#game-state').getAttribute('data-x'),before);await f.locator('#pause').click();
+ await canvas.focus();await p.page.keyboard.down('ArrowRight');await f.locator('#game-state').evaluate(async el=>{const start=Number(el.dataset.x);await new Promise((resolve,reject)=>{const at=performance.now();function tick(){if(Number(el.dataset.x)>start+25)resolve();else if(performance.now()-at>4000)reject(new Error('keyboard did not move player'));else requestAnimationFrame(tick);}tick();});});await p.page.keyboard.up('ArrowRight');
+ console.log(await p.screenshot('godot-studio-desktop'));await p.page.setViewportSize({width:390,height:844});assert.equal(await f.locator('html').evaluate(x=>x.scrollWidth<=x.clientWidth),true);await f.locator('#restart').click();const box=await canvas.boundingBox();await canvas.click({position:{x:450/1200*box.width,y:350/700*box.height}});await f.locator('#game-state[data-collected="1"]').waitFor({state:'attached',timeout:15000});console.log(await p.screenshot('godot-studio-mobile'));assert.deepEqual(p.errors,[]);
+ }finally{await p.close();await browser.close();}
+});
diff --git a/store/tools/browser/helpers.mjs b/store/tools/browser/helpers.mjs
new file mode 100644
index 000000000..04af5ab34
--- /dev/null
+++ b/store/tools/browser/helpers.mjs
@@ -0,0 +1,51 @@
+import { once } from 'node:events';
+import { mkdtemp, mkdir, cp, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { pathToFileURL, fileURLToPath } from 'node:url';
+import { createHtmlViewer } from '../../viewers/isolated-web-viewer/viewer.mjs';
+
+// Optional developer dependency; no machine-specific path is shipped in the package.
+export async function chromium() {
+ try {
+ return (await import(process.env.PLAYWRIGHT_MODULE
+ ? pathToFileURL(resolve(process.env.PLAYWRIGHT_MODULE)).href : 'playwright')).chromium;
+ } catch (error) {
+ throw new Error('Install Playwright + Chromium, or set PLAYWRIGHT_MODULE to playwright/index.mjs.', { cause: error });
+ }
+}
+
+export const root = fileURLToPath(new URL('../../../', import.meta.url));
+
+export async function preview(browser, template, options = {}) {
+ const workspace = await mkdtemp(join(tmpdir(), 'group-a-preview-'));
+ if (template) await cp(resolve(root, template), workspace, { recursive: true });
+ if (options.prepare) await options.prepare(workspace);
+ const server = await createHtmlViewer(workspace);
+ server.listen(0, '127.0.0.1');
+ await once(server, 'listening');
+ const context = await browser.newContext({ viewport: { width: 1440, height: 960 }, reducedMotion: 'reduce', ...options.context });
+ const page = await context.newPage();
+ const errors = [];
+ page.on('pageerror', error => errors.push(error.message));
+ page.on('console', message => { if (message.type() === 'error') errors.push(message.text()); });
+ const url = `http://127.0.0.1:${server.address().port}/?file=${encodeURIComponent(options.file || 'index.html')}`;
+ return {
+ workspace, server, context, page, url, errors,
+ frame: () => page.frameLocator('#preview'),
+ async open() { await page.goto(url); return this.frame(); },
+ async screenshot(name) {
+ const directory = process.env.HARNESS_QA_DIR || join(workspace, '.harness');
+ await mkdir(directory, { recursive: true });
+ const output = join(directory, name + '.png');
+ await page.screenshot({ path: output, fullPage: true });
+ return output;
+ },
+ async close() {
+ await context.close();
+ server.closeAllConnections();
+ await new Promise(resolve => server.close(resolve));
+ await rm(workspace, { recursive: true, force: true });
+ }
+ };
+}
diff --git a/store/tools/browser/home-assistant.test.mjs b/store/tools/browser/home-assistant.test.mjs
new file mode 100644
index 000000000..4fd20a7b8
--- /dev/null
+++ b/store/tools/browser/home-assistant.test.mjs
@@ -0,0 +1,17 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {spawnSync} from 'node:child_process';import {join} from 'node:path';import {readFile,writeFile} from 'node:fs/promises';import {chromium,preview,root} from './helpers.mjs';
+test('Habitat traces day/night, threshold crossing, YAML export and mobile layout',async()=>{
+ const browser=await(await chromium()).launch({headless:true});
+ const p=await preview(browser,'store/agents/home-assistant/template',{file:'dashboard.html',prepare:async ws=>{const r=spawnSync(process.execPath,[join(root,'store/agents/home-assistant/skills/home-assistant/scripts/build.mjs')],{cwd:ws,encoding:'utf8'});assert.equal(r.status,0,r.stderr);}});
+ try{
+ const f=await p.open();await f.locator('#simulate').click();assert.equal(await f.locator('#outcome').getAttribute('data-status'),'would-run');await f.locator('#day').click();await f.locator('#simulate').click();assert.equal(await f.locator('#outcome').getAttribute('data-status'),'blocked');
+ await f.getByRole('tab',{name:/fresh air/}).click();await f.locator('#simulate').click();assert.equal(await f.locator('#outcome').getAttribute('data-status'),'would-run');await f.locator('#event-from').fill('1100');await f.locator('#simulate').click();assert.equal(await f.locator('#outcome').getAttribute('data-status'),'no-trigger');
+ await f.getByRole('tab',{name:/warmer welcome/}).click();await f.locator('#night').click();await f.locator('#simulate').click();await f.locator('body').evaluate(()=>window.scrollTo(0,0));console.log(await p.screenshot('home-assistant-desktop'));
+ await f.locator('summary').click();const pending=p.page.waitForEvent('download');await f.locator('#download').click();const download=await pending;assert.equal(await readFile(await download.path(),'utf8'),await readFile(join(p.workspace,'automations.yaml'),'utf8'));
+ await p.page.setViewportSize({width:390,height:844});assert.equal(await f.locator('html').evaluate(x=>x.scrollWidth<=x.clientWidth),true);console.log(await p.screenshot('home-assistant-mobile'));assert.deepEqual(p.errors,[]);
+ }finally{await p.close();await browser.close();}
+});
+test('Habitat renders hostile aliases as text and unsupported duration as unknown',async()=>{
+ const browser=await(await chromium()).launch({headless:true});const p=await preview(browser,null,{file:'dashboard.html',prepare:async ws=>{
+ await writeFile(join(ws,'automations.yaml'),JSON.stringify([{id:'x',alias:'</script><img src=x onerror="window.pwned=1">',triggers:[{trigger:'state',entity_id:'person.demo',to:'home',for:'00:02:00'}],actions:[{action:'light.turn_on'}]}]));const r=spawnSync(process.execPath,[join(root,'store/agents/home-assistant/skills/home-assistant/scripts/build.mjs')],{cwd:ws,encoding:'utf8'});assert.equal(r.status,0,r.stderr);
+ }});try{const f=await p.open();await f.locator('#simulate').click();assert.equal(await f.locator('#outcome').getAttribute('data-status'),'unknown');assert.equal(await f.locator('body').evaluate(()=>window.pwned),undefined);assert.equal(await f.locator('img').count(),0);assert.deepEqual(p.errors,[]);}finally{await p.close();await browser.close();}
+});
diff --git a/store/tools/browser/orca-slicer.test.mjs b/store/tools/browser/orca-slicer.test.mjs
new file mode 100644
index 000000000..5cc44e4d2
--- /dev/null
+++ b/store/tools/browser/orca-slicer.test.mjs
@@ -0,0 +1,5 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {cp,readFile} from 'node:fs/promises';import {chromium,preview} from './helpers.mjs';
+test('real sliced G-code drives layer, stack, projection and download controls',{skip:!process.env.ORCA_QA_WORKSPACE},async()=>{
+ const browser=await(await chromium()).launch({headless:true});const p=await preview(browser,null,{file:'preview.html',context:{viewport:{width:1600,height:1000}},prepare:async ws=>{for(const name of ['preview.html','part.gcode'])await cp(process.env.ORCA_QA_WORKSPACE+'/'+name,ws+'/'+name);}});
+ try{const f=await p.open();await f.locator('#path[data-layer]').waitFor();const initial=Number(await f.locator('#path').getAttribute('data-segments'));await f.locator('#layer').fill('1');assert.equal(await f.locator('#path').getAttribute('data-layer'),'1');assert.ok(Number(await f.locator('#path').getAttribute('data-segments'))<initial);await f.locator('#next').click();assert.equal(await f.locator('#layer-label').textContent(),'2');await f.locator('#top').click();assert.equal(await f.locator('#path').getAttribute('data-projection'),'top');await f.locator('#iso').click();await f.locator('#layer').fill('168');await f.locator('#stack').uncheck();const single=Number(await f.locator('#path').getAttribute('data-segments'));await f.locator('#stack').check();assert.ok(Number(await f.locator('#path').getAttribute('data-segments'))>single);await f.locator('#color').selectOption('speed');await f.locator('#color').selectOption('feature');console.log(await p.screenshot('orca-slicer-desktop'));const pending=p.page.waitForEvent('download');await f.getByRole('link',{name:/Download G-code/}).click();const download=await pending;assert.deepEqual(await readFile(await download.path()),await readFile(p.workspace+'/part.gcode'));await p.page.setViewportSize({width:390,height:844});assert.equal(await f.locator('html').evaluate(x=>x.scrollWidth<=x.clientWidth),true);console.log(await p.screenshot('orca-slicer-mobile'));assert.deepEqual(p.errors,[]);}finally{await p.close();await browser.close();}
+});
diff --git a/store/tools/browser/probe.test.mjs b/store/tools/browser/probe.test.mjs
new file mode 100644
index 000000000..d6b8a86ce
--- /dev/null
+++ b/store/tools/browser/probe.test.mjs
@@ -0,0 +1,38 @@
+import assert from 'node:assert/strict';
+import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
+import { join } from 'node:path';
+import { tmpdir } from 'node:os';
+import { test } from 'node:test';
+import { probe } from '../../viewers/isolated-web-viewer/probe.mjs';
+import { build } from '../../agents/quantum-studio/skills/quantum/scripts/build.mjs';
+import { root } from './helpers.mjs';
+
+for(const harness of ['web-studio','data-studio','quantum-studio','gis']){
+ test(harness+' meets the frame budget while its actual controls are being exercised',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'group-a-perf-'));
+ try{
+ await cp(join(root,'store/agents',harness,'template'),workspace,{recursive:true});
+ if(harness==='quantum-studio')await build(workspace);
+ const report=await probe({target:join(workspace,'index.html'),mode:'perf',seconds:3});
+ if(process.env.HARNESS_QA_DIR)await writeFile(join(process.env.HARNESS_QA_DIR,harness+'-perf.json'),JSON.stringify(report,null,2));
+ assert.equal(report.passed,true,report.errors.join('; '));
+ assert.ok(report.interactionRounds>1);
+ assert.ok(report.dependencies.some(file=>file.path==='index.html'));
+ if(harness==='data-studio')assert.ok(report.dependencies.some(file=>file.path==='data.csv'));
+ console.log(harness+': '+report.fps.toFixed(1)+' fps, p95 '+report.frameP95Ms.toFixed(1)+' ms, '+report.longTasks+' long tasks');
+ }finally{await rm(workspace,{recursive:true,force:true});}
+ });
+}
+test('a page that paints but throws or fails an interaction cannot pass the shared proof',async()=>{
+ const workspace=await mkdtemp(join(tmpdir(),'group-a-bad-proof-'));
+ try{
+ await writeFile(join(workspace,'index.html'),'<button onclick="throw new Error(\'interaction broke\')">Click</button><output>waiting</output>');
+ await writeFile(join(workspace,'proof.json'),JSON.stringify({actions:[{selector:'button',click:true},{selector:'output',text:'done'}]}));
+ const previous=process.exitCode;
+ const report=await probe({target:join(workspace,'index.html')});
+ process.exitCode=previous;
+ assert.equal(report.passed,false);
+ assert.match(report.errors.join(' '),/interaction broke|expected/);
+ assert.equal(JSON.parse(await readFile(join(workspace,'.harness/browser-proof.json'),'utf8')).passed,false);
+ }finally{await rm(workspace,{recursive:true,force:true});}
+});
diff --git a/store/tools/browser/quantum-studio.test.mjs b/store/tools/browser/quantum-studio.test.mjs
new file mode 100644
index 000000000..c2d558876
--- /dev/null
+++ b/store/tools/browser/quantum-studio.test.mjs
@@ -0,0 +1,74 @@
+import assert from 'node:assert/strict';
+import { readFile, writeFile } from 'node:fs/promises';
+import { join } from 'node:path';
+import { test, before, after } from 'node:test';
+import { chromium, preview } from './helpers.mjs';
+import { build } from '../../agents/quantum-studio/skills/quantum/scripts/build.mjs';
+import { simulate, probabilities } from '../../agents/quantum-studio/skills/quantum/scripts/engine.mjs';
+
+let browser;
+before(async()=>{browser=await(await chromium()).launch({headless:true});});
+after(async()=>{await browser?.close();});
+const prepare=workspace=>build(workspace);
+test('Quantum Studio steps through entanglement, edits phase, samples, undoes and exports a real circuit',async()=>{
+ const run=await preview(browser,'store/agents/quantum-studio/template',{prepare});
+ try{
+ const frame=await run.open();
+ await frame.locator('#circuit-name').filter({hasText:'Bell state'}).waitFor();
+ const probability=bits=>frame.locator('[data-basis="'+bits+'"] .value').textContent();
+ assert.equal(await probability('00'),'50.0%');
+ assert.equal(await probability('11'),'50.0%');
+ assert.match(await frame.locator('#state-note').textContent(),/Entangled/);
+ assert.equal(await frame.locator('.purity b').first().textContent(),'0.500');
+ await frame.getByRole('button',{name:/Bell pair/}).click();
+ console.log('screenshot:',await run.screenshot('quantum-studio-desktop'));
+ await frame.getByLabel('Circuit step',{exact:true}).fill('1');
+ assert.equal(await probability('01'),'50.0%');
+ assert.equal(await frame.locator('.purity b').first().textContent(),'1.000');
+ await frame.getByRole('button',{name:/Interference/}).click();
+ await frame.getByLabel('Rotation angle',{exact:true}).fill('180');
+ assert.equal(await probability('1'),'100.0%');
+ await frame.getByRole('button',{name:'Sample outcomes',exact:true}).click();
+ assert.match(await probability('1'),/1024 shots/);
+ await frame.getByRole('button',{name:'Undo',exact:true}).click();
+ assert.equal(await probability('1'),'50.0%');
+ await frame.getByRole('button',{name:'Redo',exact:true}).click();
+ assert.equal(await probability('1'),'100.0%');
+ const download=run.page.waitForEvent('download');
+ await frame.getByRole('button',{name:/Save circuit/}).click();
+ const cfg=JSON.parse(await readFile(await(await download).path(),'utf8'));
+ assert.ok(Math.abs(probabilities(simulate(cfg))[1]-1)<1e-10);
+ await frame.getByRole('button',{name:/GHZ state/}).click();
+ assert.equal(await probability('111'),'50.0%');
+ assert.equal(await frame.locator('.sphere').count(),3);
+ await frame.getByLabel('Gate type').selectOption('X');
+ await frame.getByLabel('Target qubit').selectOption('0');
+ await frame.getByRole('button',{name:'+ Add gate',exact:true}).click();
+ assert.equal(await probability('001'),'50.0%');
+ await run.page.setViewportSize({width:390,height:844});
+ assert.equal(await frame.locator('html').evaluate(el=>el.scrollWidth<=el.clientWidth),true);
+ console.log('screenshot:',await run.screenshot('quantum-studio-mobile'));
+ assert.deepEqual(run.errors,[]);
+ }finally{await run.close();}
+});
+test('untrusted circuit strings are data in the actual browser',async()=>{
+ const run=await preview(browser,'store/agents/quantum-studio/template',{prepare:async workspace=>{
+ await writeFile(join(workspace,'circuit.json'),JSON.stringify({name:'</script><img src=x onerror=alert(1)>',qubits:['<b>q0</b>'],gates:[]}));
+ await build(workspace);
+ }});
+ try{
+ const frame=await run.open();
+ await frame.locator('#circuit-name').filter({hasText:'</script>'}).waitFor();
+ assert.equal(await frame.locator('img').count(),0);
+ assert.equal(await frame.locator('#circuit b').count(),0);
+ await frame.locator('#upload').setInputFiles({name:'bad.json',mimeType:'application/json',buffer:Buffer.from('{"qubits":["q0"],"gates":[{"gate":"H","target":-1}]}')});
+ await frame.getByRole('alert').waitFor();
+ assert.match(await frame.locator('#error').textContent(),/qubit index/);
+ assert.equal(await frame.locator('#norm').textContent(),'1.0000','invalid edits leave the previous valid circuit intact');
+ assert.deepEqual(run.errors,[]);
+ }finally{await run.close();}
+});
+test('custom shot counts survive load, sampling, edits, undo and circuit export',async()=>{
+ const run=await preview(browser,'store/agents/quantum-studio/template',{prepare:async ws=>{const file=join(ws,'circuit.json'),data=JSON.parse(await readFile(file,'utf8'));data.shots=73;await writeFile(file,JSON.stringify(data));await build(ws);}});
+ try{const f=await run.open();assert.equal(await f.locator('#shots').inputValue(),'73');await f.locator('#measure').click();assert.match(await f.locator('#sample-status').textContent(),/^73 simulated shots/);await f.locator('#shots').selectOption('128');await f.getByRole('button',{name:'Undo',exact:true}).click();assert.equal(await f.locator('#shots').inputValue(),'73');const pending=run.page.waitForEvent('download');await f.getByRole('button',{name:/Save circuit/}).click();const download=await pending;assert.equal(JSON.parse(await readFile(await download.path(),'utf8')).shots,73);assert.deepEqual(run.errors,[]);}finally{await run.close();}
+});
diff --git a/store/tools/browser/score.test.mjs b/store/tools/browser/score.test.mjs
new file mode 100644
index 000000000..fea366fc6
--- /dev/null
+++ b/store/tools/browser/score.test.mjs
@@ -0,0 +1,9 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {chromium,preview} from './helpers.mjs';
+test('Folio: real engraving, MIDI transport, tempo, seek, downloads and narrow layout',{skip:!process.env.SCORE_QA_WORKSPACE},async()=>{
+ const browser=await(await chromium()).launch({headless:true});const p=await preview(browser,process.env.SCORE_QA_WORKSPACE,{file:'score.html'});
+ try{const f=await p.open();await f.locator('#pages img').waitFor();assert.ok(await f.locator('#pages img').evaluate(img=>img.complete&&img.naturalWidth>0));assert.equal(await f.locator('#note-count').textContent(),'142');await f.locator('#play').click();await p.page.waitForTimeout(700);assert.equal(await f.locator('#play').getAttribute('aria-pressed'),'true');assert.ok(Number(await f.locator('#roll').getAttribute('data-position'))>.4);await f.locator('#play').click();const before=await f.locator('#roll').getAttribute('data-position');await p.page.waitForTimeout(150);assert.equal(await f.locator('#roll').getAttribute('data-position'),before);
+ await f.locator('#speed').fill('0.75');assert.equal(await f.locator('#speed-value').textContent(),'0.75×');await f.locator('#seek').fill('10');await p.page.waitForTimeout(50);assert.equal(await f.locator('#position').textContent(),'0:10');await f.locator('#restart').click();assert.equal(await f.locator('#position').textContent(),'0:00');
+ const download=p.page.waitForEvent('download');await f.getByText('Score PDF ↓',{exact:true}).click();assert.equal((await download).suggestedFilename(),'score.pdf');
+ await f.locator('body').evaluate(()=>window.scrollTo(0,0));await p.screenshot('score-desktop');await p.page.setViewportSize({width:390,height:844});await f.locator('body').evaluate(()=>window.scrollTo(0,0));assert.equal(await f.locator('body').evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);await p.screenshot('score-mobile');assert.deepEqual(p.errors,[]);
+ }finally{await p.close();await browser.close();}
+});
diff --git a/store/tools/browser/sheet-docs.test.mjs b/store/tools/browser/sheet-docs.test.mjs
new file mode 100644
index 000000000..58058d175
--- /dev/null
+++ b/store/tools/browser/sheet-docs.test.mjs
@@ -0,0 +1,7 @@
+import {test} from 'node:test';import assert from 'node:assert/strict';import {spawn} from 'node:child_process';import {createServer} from 'node:net';import {once} from 'node:events';import {join} from 'node:path';import {mkdir} from 'node:fs/promises';import {chromium,root} from './helpers.mjs';
+test('Sheet & Docs: actual PDF text, navigation, find and zoom in Doc Viewer',{skip:!process.env.SHEET_DOCS_QA_WORKSPACE},async()=>{
+ const portServer=createServer();portServer.listen(0,'127.0.0.1');await once(portServer,'listening');const port=portServer.address().port;await new Promise(r=>portServer.close(r));
+ const child=spawn(process.execPath,[join(root,'store/viewers/doc-viewer/viewer.mjs')],{env:{...process.env,HARNESS_WORKSPACE:process.env.SHEET_DOCS_QA_WORKSPACE,HARNESS_VIEWER_PORT:String(port),DOC_VIEWER_OPEN:'off'},stdio:['ignore','pipe','pipe']});const browser=await(await chromium()).launch({headless:true});
+ try{await once(child.stdout,'data');const page=await browser.newPage({viewport:{width:1600,height:1000}}),errors=[];page.on('pageerror',e=>errors.push(e.message));await page.goto('http://127.0.0.1:'+port+'/?file=out.pdf');await page.locator('canvas').first().waitFor();await page.waitForFunction(()=>document.querySelector('#page-count')?.textContent.includes('1'));await page.getByRole('button',{name:'Find in document',exact:true}).click();await page.locator('#find-input').fill('South');await page.waitForFunction(()=>document.querySelector('#find-count')?.textContent.includes('2'));await page.locator('#find-close').click();const before=await page.locator('#btn-zoom').textContent();await page.locator('#btn-zoom-in').click();assert.notEqual(await page.locator('#btn-zoom').textContent(),before);await page.locator('#btn-zoom-out').click();await page.locator('#btn-zoom').click();await page.getByRole('menuitem',{name:/Fit page/}).click();await page.waitForTimeout(200);if(process.env.HARNESS_QA_DIR){await mkdir(process.env.HARNESS_QA_DIR,{recursive:true});await page.screenshot({path:join(process.env.HARNESS_QA_DIR,'sheet-docs-desktop.png')});}if(process.env.HARNESS_SHOWCASE_DIR){const directory=join(process.env.HARNESS_SHOWCASE_DIR,'sheet-docs');await mkdir(directory,{recursive:true});await page.screenshot({path:join(directory,'starter.jpg'),type:'jpeg',quality:85});}assert.deepEqual(errors,[]);
+ }finally{await browser.close();child.kill('SIGTERM');await once(child,'exit').catch(()=>{});}
+});
diff --git a/store/tools/browser/showcase.mjs b/store/tools/browser/showcase.mjs
new file mode 100644
index 000000000..efa9ae6ea
--- /dev/null
+++ b/store/tools/browser/showcase.mjs
@@ -0,0 +1,9 @@
+// Capture real local outputs. Native projects must have been built independently.
+import {mkdir,stat} from 'node:fs/promises';import {spawnSync} from 'node:child_process';import {join} from 'node:path';import assert from 'node:assert/strict';
+import {chromium,preview,root} from './helpers.mjs';import {build as quantumBuild} from '../../agents/quantum-studio/skills/quantum/scripts/build.mjs';
+const browser=await(await chromium()).launch({headless:true,channel:process.env.PLAYWRIGHT_CHANNEL||undefined});
+const entries=[['web-studio','store/agents/web-studio/template','index.html'],['data-studio','store/agents/data-studio/template','index.html'],['quantum-studio','store/agents/quantum-studio/template','index.html'],['gis','store/agents/gis/template','index.html'],['home-assistant','store/agents/home-assistant/template','dashboard.html'],['godot-studio',process.env.GODOT_QA_WORKSPACE,'build/web/index.html'],['firmware-studio',process.env.FIRMWARE_QA_WORKSPACE,'build-status.html'],['orca-slicer',process.env.ORCA_QA_WORKSPACE,'preview.html'],['score',process.env.SCORE_QA_WORKSPACE,'score.html']];
+try{for(const [id,template,file]of entries){if(!template){console.log('skip '+id+': provide its *_QA_WORKSPACE');continue;}
+ const p=await preview(browser,template,{file,context:{viewport:{width:1600,height:1000}},prepare:id==='quantum-studio'?quantumBuild:id==='home-assistant'?async ws=>{const r=spawnSync(process.execPath,[join(root,'store/agents/home-assistant/skills/home-assistant/scripts/build.mjs')],{cwd:ws,encoding:'utf8'});assert.equal(r.status,0,r.stderr);}:undefined});
+ try{const f=await p.open();await f.locator('body').waitFor();if(id==='godot-studio')await f.locator('#game-state[data-ready="true"]').waitFor({timeout:45000});if(id==='gis')await f.locator('.leaflet-interactive').first().waitFor();if(id==='home-assistant')await f.locator('#simulate').click();await p.page.waitForTimeout(800);await f.locator('body').evaluate(()=>window.scrollTo(0,0));assert.deepEqual(p.errors,[]);const directory=join(root,'store/showcase',id);await mkdir(directory,{recursive:true});const output=join(directory,'starter.jpg');await p.page.screenshot({path:output,type:'jpeg',quality:85});const size=(await stat(output)).size;assert.ok(size<350*1024,'Store image too large: '+id);console.log(id+': 1600×1000 JPEG, '+size+' bytes');}finally{await p.close();}
+}}finally{await browser.close();}
diff --git a/store/tools/browser/viewer.test.mjs b/store/tools/browser/viewer.test.mjs
new file mode 100644
index 000000000..1cef12e30
--- /dev/null
+++ b/store/tools/browser/viewer.test.mjs
@@ -0,0 +1,38 @@
+import assert from 'node:assert/strict';
+import { writeFile } from 'node:fs/promises';
+import { join } from 'node:path';
+import { test, before, after } from 'node:test';
+import { chromium, preview } from './helpers.mjs';
+
+let browser;
+before(async () => { browser = await (await chromium()).launch({ headless: true }); });
+after(async () => { await browser?.close(); });
+
+test('a real sandbox loads sibling data, ES modules and streaming WASM, but cannot access its parent', async () => {
+ const run = await preview(browser, null, { prepare: async workspace => {
+ await writeFile(join(workspace, 'index.html'), `<!doctype html><html><body><output id="result">Loading</output><script type="module">
+ import { label } from './logic.mjs';
+ const data = await (await fetch('./data.json')).json();
+ const wasm = await WebAssembly.instantiateStreaming(fetch('./engine.wasm'));
+ let isolated = false;
+ try { parent.document.body; } catch { isolated = true; }
+ document.querySelector('output').textContent = label + data.value + ':' + !!wasm.instance + ':' + isolated;
+ </script></body></html>`);
+ await writeFile(join(workspace, 'data.json'), '{"value":42}');
+ await writeFile(join(workspace, 'logic.mjs'), 'export const label = "Loaded:";');
+ await writeFile(join(workspace, 'engine.wasm'), Buffer.from([0,97,115,109,1,0,0,0]));
+ }});
+ try {
+ const frame = await run.open();
+ await frame.getByText('Loaded:42:true:true', { exact: true }).waitFor();
+ assert.deepEqual(run.errors, []);
+ await run.page.getByLabel('Preview width').selectOption('390');
+ assert.equal((await run.page.locator('#preview').boundingBox()).width, 390);
+ await run.page.getByRole('button', { name: 'Live', exact: true }).click();
+ await writeFile(join(run.workspace, 'data.json'), '{"value":43}');
+ await run.page.getByRole('status').filter({ hasText: 'Changes waiting' }).waitFor();
+ assert.equal(await frame.locator('output').textContent(), 'Loaded:42:true:true');
+ await run.page.getByRole('button', { name: 'Paused', exact: true }).click();
+ await frame.getByText('Loaded:43:true:true', { exact: true }).waitFor();
+ } finally { await run.close(); }
+});
diff --git a/store/tools/browser/web-studio.test.mjs b/store/tools/browser/web-studio.test.mjs
new file mode 100644
index 000000000..a55ae2d59
--- /dev/null
+++ b/store/tools/browser/web-studio.test.mjs
@@ -0,0 +1,51 @@
+import assert from 'node:assert/strict';
+import { test, before, after } from 'node:test';
+import { chromium, preview } from './helpers.mjs';
+
+let browser;
+before(async () => { browser = await (await chromium()).launch({ headless: true }); });
+after(async () => { await browser?.close(); });
+
+test('Field renders immediately, reacts to real controls, respects reduced motion and exports its canvas', async () => {
+ const run = await preview(browser, 'store/agents/web-studio/template');
+ try {
+ const frame = await run.open();
+ await frame.getByRole('heading', { name: 'A little room for wonder.' }).waitFor();
+ const canvas = frame.locator('#field');
+ const pixels = () => canvas.evaluate(canvas => canvas.toDataURL());
+ const initial = await pixels();
+ assert.ok(initial.length > 20000, 'the first frame already contains the artwork');
+ assert.equal(await frame.locator('#play-state').textContent(), 'STILL');
+ await run.page.waitForTimeout(120);
+ assert.equal(await pixels(), initial, 'reduced motion does not start an animation');
+ console.log('screenshot:', await run.screenshot('web-studio-desktop'));
+ await frame.getByRole('button', { name: /Weave/ }).click();
+ assert.equal(await frame.locator('#scene-name').textContent(), 'Weave');
+ assert.notEqual(await pixels(), initial);
+ await frame.getByLabel('Detail', { exact: true }).fill('64');
+ assert.equal(await frame.locator('#line-count').textContent(), '64');
+ await frame.getByRole('button', { name: /Variation/ }).click();
+ assert.notEqual(await frame.locator('#seed-label').textContent(), 'SEED 042');
+ const box = await canvas.boundingBox();
+ const beforePointer = await pixels();
+ await run.page.mouse.move(box.x + box.width * .85, box.y + box.height * .75);
+ assert.notEqual(await pixels(), beforePointer, 'pointer moves rotate the actual artwork');
+ await frame.getByRole('button', { name: '▷ Play', exact: true }).click();
+ assert.equal(await frame.locator('#play-state').textContent(), 'LIVE');
+ const moving = await pixels();
+ await run.page.waitForTimeout(180);
+ assert.notEqual(await pixels(), moving);
+ await frame.getByRole('button', { name: 'Ⅱ Pause', exact: true }).click();
+ const download = run.page.waitForEvent('download');
+ await frame.getByRole('button', { name: /Keep this moment/ }).click();
+ const file = await download;
+ assert.match(file.suggestedFilename(), /^field-weave-\d+\.png$/);
+ assert.equal(await file.failure(), null);
+ await run.page.setViewportSize({ width: 390, height: 844 });
+ await frame.getByRole('button', { name: /Bloom/ }).click();
+ await frame.locator('body').evaluate(body => body.scrollTo(0, 0));
+ assert.equal(await frame.locator('html').evaluate(el => el.scrollWidth <= el.clientWidth), true);
+ console.log('screenshot:', await run.screenshot('web-studio-mobile'));
+ assert.deepEqual(run.errors, []);
+ } finally { await run.close(); }
+});
diff --git a/store/viewers/isolated-web-viewer/LICENSE b/store/viewers/isolated-web-viewer/LICENSE
new file mode 100644
index 000000000..a499cd17e
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Autonomous, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/viewers/isolated-web-viewer/README.md b/store/viewers/isolated-web-viewer/README.md
new file mode 100644
index 000000000..bc83794b3
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/README.md
@@ -0,0 +1,52 @@
+# Isolated Web Viewer
+
+A shared live preview for local HTML, CSS, JavaScript, data and WebAssembly. Node.js 20+ is the
+only preview dependency. No bundler or second application server is needed.
+
+Declare `"viewer": { "use": "autonomous/isolated-web-viewer" }` in a harness manifest. The pane follows the
+HTML artifact named by the verdict, or the newest matching file; an empty file selection falls
+back to `index.html`. A harness can still override the viewer URL for a fixed entry point.
+
+The toolbar includes fitted, mobile, tablet and desktop widths, manual reload, and a Live/Pause
+switch so file changes do not interrupt an interaction you are inspecting.
+
+## Isolation and asset loading
+
+The iframe permits scripts, downloads and pointer lock, but deliberately omits `allow-same-origin`.
+It cannot read the parent shell, use origin-backed local storage or register a service worker.
+Use downloaded files to persist interactive edits. Godot Web exports must be single-threaded and
+not depend on SharedArrayBuffer or a service worker.
+
+A random, per-server capability prefix lets the opaque-origin iframe fetch sibling assets with
+CORS. Relative JSON/CSV/GeoJSON requests, ES modules and streaming WASM work inside the sandbox.
+Normal `/files/` URLs do not receive CORS permission; use relative paths, not hardcoded root paths.
+Do not expose or reuse the capability URL as a public sharing mechanism.
+
+The server is read-only, loopback-only, and rejects hidden paths, `node_modules` and symlinks that
+escape the workspace or expose hidden files. It streams ordinary files up to 32 MiB; WASM and PCK
+game assets have a bounded 128 MiB allowance. This is a local preview, not a production web server.
+
+## Verification tooling
+
+`probe.mjs` is an optional agent/developer helper. Install Playwright and Chromium in this package
+(`npm install --no-save playwright` and `npx playwright install chromium`), or set `PLAYWRIGHT_MODULE`
+to an existing absolute `playwright/index.mjs` path. It does not install dependencies on import.
+
+Harness wrappers call the probe with a workspace `proof.json`: selectors, actual control changes
+and assertions of exact text or attributes. Proof mode runs the real sandbox, checks browser errors,
+captures `.harness/last.png`, records loaded-file hashes in `browser-proof.json`, and refreshes the
+verdict, including on failure. A missing assertion recipe or browser is not a successful proof.
+
+Performance mode runs interactions while sampling frame delays and long tasks. It records the
+canvas renderer; `PLAYWRIGHT_CHANNEL=chrome` selects installed Chrome when a real GPU benchmark
+is needed instead of headless-shell's software WebGL. Frame timing is not end-to-photon latency.
+
+```sh
+harness dsh check store/viewers/isolated-web-viewer
+harness dsh install "$PWD/store/viewers/isolated-web-viewer" --link
+node --test --test-concurrency=1 store/viewers/isolated-web-viewer/test/*.test.mjs
+node --test --test-concurrency=1 store/tools/browser/*.test.mjs
+```
+
+Built for OpenHarness by its contributors, MIT. No third-party packages are required to serve a
+preview; Playwright is separate optional verification tooling.
diff --git a/store/viewers/isolated-web-viewer/doctor.sh b/store/viewers/isolated-web-viewer/doctor.sh
new file mode 100755
index 000000000..5c46a5fdb
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/doctor.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# Exit 0 when this machine can run the viewer: only Node 20 or newer is needed — this machine's, or
+# Harness's own when it has none or too old a one (runtimes.sh, as viewer.sh finds it).
+set -u
+# shellcheck source=runtimes.sh
+. "$(dirname "$0")/runtimes.sh"
+harness_node 20 || exit 1
+echo "ok node $(node --version)"
diff --git a/store/viewers/isolated-web-viewer/harness.json b/store/viewers/isolated-web-viewer/harness.json
new file mode 100644
index 000000000..2998d122d
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/harness.json
@@ -0,0 +1,17 @@
+{
+ "spec": 1,
+ "kind": "viewer",
+ "id": "autonomous/isolated-web-viewer",
+ "name": "Isolated Web Viewer",
+ "category": "Code",
+ "author": "OpenHarness contributors",
+ "description": "An opaque-origin HTML preview with capability-scoped assets, responsive controls and interaction-based verification.",
+ "toolchain": {
+ "doctor": "./doctor.sh"
+ },
+ "viewer": {
+ "command": "./viewer.sh",
+ "url": "http://127.0.0.1:${port}/?file=${artifact}",
+ "artifactExtensions": [".html"]
+ }
+}
diff --git a/store/viewers/isolated-web-viewer/preview.html b/store/viewers/isolated-web-viewer/preview.html
new file mode 100644
index 000000000..a160b8c18
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/preview.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<html lang="en">
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Isolated Web Viewer</title>
+<link rel="icon" href="data:,">
+<style>
+ :root { color-scheme: light dark; font: 12px/1.4 system-ui, sans-serif; --line: light-dark(#dadbd8, #343633); --bg: light-dark(#f7f8f5, #1b1e1b); }
+ * { box-sizing: border-box; }
+ body { margin: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
+ header { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
+ #file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px ui-monospace, monospace; min-width: 32px; }
+ #status { display: flex; gap: 6px; align-items: center; margin-left: auto; opacity: .75; white-space: nowrap; font-size: 11px; }
+ #status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #92978c; }
+ #status[data-live="true"]::before { background: #5e9c48; }
+ button, select { color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; cursor: pointer; }
+ button:hover, select:hover { background: #8882; }
+ :focus-visible { outline: 2px solid #699f4c; outline-offset: 2px; }
+ #stage { flex: 1; min-height: 0; display: flex; justify-content: center; overflow: auto; background-image: radial-gradient(#8883 .6px, transparent .6px); background-size: 12px 12px; }
+ iframe { width: 100%; height: 100%; flex-shrink: 0; border: 0; background: white; }
+ #stage.sized { padding: 12px; }
+ #stage.sized iframe { border: 1px solid var(--line); border-radius: 8px; }
+ @media (max-width: 480px) { header { gap: 6px; padding: 6px 8px; } #file { max-width: 90px; } #status { font-size: 0; } button, select { font-size: 11px; padding: 5px; } }
+</style>
+<header>
+ <span id="file"></span>
+ <span id="status" role="status">Connecting…</span>
+ <select id="size" aria-label="Preview width"><option value="fit">Fit</option><option value="390">Mobile · 390</option><option value="768">Tablet · 768</option><option value="1280">Desktop · 1280</option></select>
+ <button id="live" aria-pressed="true" title="Pause automatic reloads while exploring">Live</button>
+ <button id="reload" title="Reload preview">Reload</button>
+</header>
+<main id="stage"><iframe id="preview" title="Workspace preview" sandbox="allow-scripts allow-downloads allow-pointer-lock" allow="fullscreen; autoplay; gamepad" allowfullscreen></iframe></main>
+<script>
+ const prefix = '__PREVIEW_PREFIX__';
+ const requested = new URLSearchParams(location.search).get('file') || 'index.html';
+ const parts = requested.split(/[\\/]/);
+ const file = parts.some(part => !part || part.startsWith('.')) ? 'index.html' : parts.join('/');
+ const frame = document.querySelector('#preview');
+ const status = document.querySelector('#status');
+ const live = document.querySelector('#live');
+ let automatic = true, connected = false, changed = false, watchFailed = false;
+ document.querySelector('#file').textContent = file;
+ document.querySelector('#file').title = file;
+ const updateStatus = () => {
+ status.textContent = watchFailed ? 'Use Reload' : !automatic ? (changed ? 'Changes waiting' : 'Paused') : connected ? 'Live' : 'Reconnecting…';
+ status.dataset.live = String(automatic && connected && !watchFailed);
+ };
+ const reload = () => { changed = false; frame.src = prefix + file.split('/').map(encodeURIComponent).join('/') + '?v=' + Date.now(); updateStatus(); };
+ document.querySelector('#reload').addEventListener('click', reload);
+ live.addEventListener('click', () => {
+ automatic = !automatic;
+ live.setAttribute('aria-pressed', String(automatic));
+ live.textContent = automatic ? 'Live' : 'Paused';
+ if (automatic && changed) reload();
+ updateStatus();
+ });
+ document.querySelector('#size').addEventListener('change', event => {
+ const size = event.target.value;
+ frame.style.width = size === 'fit' ? '100%' : size + 'px';
+ document.querySelector('#stage').classList.toggle('sized', size !== 'fit');
+ });
+ reload();
+ const events = new EventSource('/events');
+ events.onopen = () => { connected = true; updateStatus(); };
+ events.onerror = () => { connected = false; updateStatus(); };
+ events.addEventListener('change', () => { changed = true; if (automatic) reload(); else updateStatus(); });
+ events.addEventListener('watch-error', () => { watchFailed = true; updateStatus(); });
+</script>
+</html>
+</html>
diff --git a/store/viewers/isolated-web-viewer/probe.mjs b/store/viewers/isolated-web-viewer/probe.mjs
new file mode 100644
index 000000000..3bf16ae63
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/probe.mjs
@@ -0,0 +1,142 @@
+// Optional browser verification. Uses the real opaque-origin HTTP preview.
+import { once } from 'node:events';
+import { readFile, writeFile, mkdir } from 'node:fs/promises';
+import { createHash } from 'node:crypto';
+import { dirname, resolve, relative, join, isAbsolute } from 'node:path';
+import { pathToFileURL } from 'node:url';
+import { createHtmlViewer } from './viewer.mjs';
+
+export async function probe({ mode = 'proof', target = process.argv[2] || 'index.html', seconds = Number(process.argv[3] || 3) } = {}) {
+ const artifact = resolve(target);
+ const workspace = resolve(process.env.HARNESS_WORKSPACE || dirname(artifact));
+ const file = relative(workspace, artifact);
+ if (isAbsolute(file) || file.startsWith('..')) throw new Error('The artifact must be inside HARNESS_WORKSPACE.');
+ if (!Number.isFinite(seconds) || seconds < 1 || seconds > 30) throw new Error('Measure for 1 to 30 seconds.');
+ const output = join(workspace, '.harness');
+ await mkdir(output, { recursive: true });
+ const report = { mode, artifact: file, at: new Date().toISOString(), passed: false, interactionVerified: false, errors: [], dependencies: [] };
+ const reportPath = join(output, mode === 'perf' ? 'perf.json' : 'browser-proof.json');
+ let server, browser;
+ try {
+ try { await readFile(artifact); }
+ catch (error) { if (error.code === 'ENOENT') throw new Error(file + ' missing — create the page before verifying it.'); throw error; }
+ let chromium;
+ try { ({ chromium } = await import(process.env.PLAYWRIGHT_MODULE ? pathToFileURL(resolve(process.env.PLAYWRIGHT_MODULE)).href : 'playwright')); }
+ catch { throw new Error('Playwright is missing. Install it in the web-viewer package, or set PLAYWRIGHT_MODULE to playwright/index.mjs.'); }
+ let recipe;
+ try { recipe = JSON.parse(await readFile(join(workspace, 'proof.json'), 'utf8')); }
+ catch (error) { if (error.code !== 'ENOENT') throw error; }
+ if (recipe && (!Array.isArray(recipe.actions) || recipe.actions.length > 128)) throw new Error('proof.json needs an actions array (at most 128 steps).');
+ const changed = (recipe?.actions || []).some(action => action.click || action.fill !== undefined || action.select !== undefined);
+ const asserted = (recipe?.actions || []).some(action => action.text !== undefined || action.attribute);
+ if (!changed || !asserted) throw new Error('Add proof.json with a real interaction and an assertion of its result.');
+ server = await createHtmlViewer(workspace);
+ server.listen(0, '127.0.0.1'); await once(server, 'listening');
+ const base = 'http://127.0.0.1:' + server.address().port;
+ browser = await chromium.launch({ headless: true, ...(process.env.PLAYWRIGHT_CHANNEL ? { channel: process.env.PLAYWRIGHT_CHANNEL } : {}) });
+ const page = await browser.newPage({ viewport: { width: 1600, height: 1000 } });
+ const resources = new Set([file]);
+ page.on('pageerror', error => report.errors.push(error.message));
+ page.on('console', message => { if (message.type() === 'error') report.errors.push(message.text()); });
+ page.on('response', response => {
+ const url = new URL(response.url());
+ if (url.origin !== base) return;
+ const match = url.pathname.match(/^\/preview\/[a-f0-9]{48}\/(.+)/);
+ if (match) resources.add(decodeURIComponent(match[1]));
+ if (response.status() >= 400) report.errors.push('HTTP ' + response.status() + ': ' + url.pathname.replace(/\/preview\/[a-f0-9]+\//, '/'));
+ });
+ await page.goto(base + '/?file=' + encodeURIComponent(file), { waitUntil: 'load' });
+ const frame = page.frameLocator('#preview');
+ await frame.locator('body').waitFor();
+ const perform = async () => {
+ for (const action of recipe.actions) {
+ if (typeof action.selector !== 'string') throw new Error('Every proof action needs a CSS selector.');
+ const locator = frame.locator(action.selector);
+ await locator.waitFor({ state: 'visible', timeout: 10000 });
+ if (action.click) await locator.click();
+ if (action.fill !== undefined) await locator.fill(String(action.fill));
+ if (action.select !== undefined) await locator.selectOption(String(action.select));
+ if (action.text !== undefined) {
+ const actual = (await locator.textContent()).trim();
+ if (actual !== String(action.text)) throw new Error(action.selector + ': expected "' + action.text + '", got "' + actual + '"');
+ }
+ if (action.attribute) {
+ const actual = await locator.getAttribute(action.attribute.name);
+ if (actual !== String(action.attribute.value)) throw new Error(action.selector + ': unexpected ' + action.attribute.name + '=' + actual);
+ }
+ }
+ };
+ await perform();
+ report.interactionVerified = true;
+ if (mode === 'perf') {
+ const sampling = frame.locator('body').evaluate((_body, duration) => new Promise(resolve => {
+ const frames = [], tasks = [];
+ const observer = new PerformanceObserver(list => { for (const task of list.getEntries()) tasks.push(task.duration); });
+ observer.observe({ type: 'longtask', buffered: false });
+ const start = performance.now();
+ const tick = now => {
+ frames.push(now);
+ if (now - start < duration * 1000) requestAnimationFrame(tick);
+ else {
+ observer.disconnect();
+ const deltas = frames.slice(1).map((time,i) => time - frames[i]);
+ const sorted = [...deltas].sort((a,b) => a-b);
+ resolve({
+ fps: (frames.length-1)*1000/(frames.at(-1)-frames[0]),
+ frameP95Ms: sorted[Math.floor(sorted.length*.95)] || 0,
+ droppedPct: 100*deltas.filter(ms=>ms>25).length/Math.max(1,deltas.length),
+ samples: deltas.length, longTasks: tasks.length,
+ blockedMs: tasks.reduce((sum,duration)=>sum+Math.max(0,duration-50),0)
+ });
+ }
+ };
+ requestAnimationFrame(tick);
+ }), seconds);
+ const until = Date.now() + seconds*1000;
+ let rounds=0;
+ try {
+ while (Date.now() < until) {
+ await perform(); rounds++;
+ await page.mouse.move(150+rounds*47%1050, 300+rounds*31%500);
+ await page.waitForTimeout(50);
+ }
+ } finally { Object.assign(report, await sampling); }
+ report.interactionRounds = rounds;
+ report.renderers = await frame.locator('canvas').evaluateAll(canvases => canvases.map(canvas => {
+ const gl=canvas.getContext('webgl2');
+ if(!gl)return {type:'canvas2d',width:canvas.width,height:canvas.height};
+ const extension=gl.getExtension('WEBGL_debug_renderer_info');
+ return {type:'webgl2',width:canvas.width,height:canvas.height,renderer:extension?gl.getParameter(extension.UNMASKED_RENDERER_WEBGL):'unknown'};
+ }));
+ if (report.fps < 55 || report.droppedPct >= 2) throw new Error('Frame budget missed during interaction: ' + report.fps.toFixed(1) + ' fps, ' + report.droppedPct.toFixed(1) + '% slow frames.');
+ }
+ await page.screenshot({ path: join(output, 'last.png'), fullPage: true });
+ for (const path of resources) {
+ const absolute = resolve(workspace,path), inside = relative(workspace,absolute);
+ if (isAbsolute(inside) || inside.startsWith('..')) continue;
+ report.dependencies.push({ path: inside, sha256: createHash('sha256').update(await readFile(absolute)).digest('hex') });
+ }
+ if (report.errors.length) throw new Error('The browser reported errors: ' + report.errors.join('; '));
+ report.passed = true;
+ console.log(mode === 'perf' ? 'ok ' + report.fps.toFixed(1) + ' fps during ' + report.interactionRounds + ' interaction rounds' : 'ok page and interaction assertions passed');
+ console.log('evidence: ' + reportPath);
+ } catch (error) {
+ report.errors.push(error.message);
+ console.error(error.message);
+ process.exitCode = 1;
+ } finally {
+ await browser?.close();
+ if (server) { server.closeAllConnections(); await new Promise(resolve => server.close(resolve)); }
+ await writeFile(reportPath, JSON.stringify(report,null,2)+'\n');
+ if (mode === 'proof') {
+ const verdict = {
+ spec: 1, ready: report.passed,
+ summary: report.passed ? 'Browser and interaction assertions verified' : 'Browser verification failed',
+ findings: report.errors.map(message => ({ severity: 'error', kind: 'browser', message })),
+ artifact: file, updatedAt: new Date().toISOString()
+ };
+ await writeFile(join(output,'verdict.json'),JSON.stringify(verdict,null,2)+'\n');
+ }
+ }
+ return report;
+}
diff --git a/store/viewers/isolated-web-viewer/runtimes.sh b/store/viewers/isolated-web-viewer/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/viewers/isolated-web-viewer/store.json b/store/viewers/isolated-web-viewer/store.json
new file mode 100644
index 000000000..27d911642
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/store.json
@@ -0,0 +1,3 @@
+{
+ "license": "MIT"
+}
diff --git a/store/viewers/isolated-web-viewer/test/edges.test.mjs b/store/viewers/isolated-web-viewer/test/edges.test.mjs
new file mode 100644
index 000000000..656acdbac
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/test/edges.test.mjs
@@ -0,0 +1,174 @@
+// The edges of the preview server, in process: requests a browser never sends, files it cannot
+// serve, and the watcher and heartbeat the live reload depends on (driven directly, not waited for).
+import assert from 'node:assert/strict';
+import { once } from 'node:events';
+import fs from 'node:fs';
+import { chmod, mkdtemp, rm, truncate, writeFile } from 'node:fs/promises';
+import { syncBuiltinESMExports } from 'node:module';
+import { connect } from 'node:net';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { after, before, test } from 'node:test';
+import { createHtmlViewer } from '../viewer.mjs';
+
+let workspace, server, base, port, watcher, heartbeat;
+
+// The server's fs.watch and setInterval, captured as it makes them, so a test can fire them.
+before(async () => {
+ workspace = await mkdtemp(join(tmpdir(), 'web-viewer-edges-'));
+ await writeFile(join(workspace, 'index.html'), '<h1>Hello</h1>');
+ const realWatch = fs.watch;
+ const realSetInterval = globalThis.setInterval;
+ fs.watch = (...args) => { watcher = realWatch(...args); return watcher; };
+ syncBuiltinESMExports();
+ globalThis.setInterval = (fn, ms) => { heartbeat = { fn, ms }; return realSetInterval(fn, ms); };
+ try {
+ server = await createHtmlViewer(workspace);
+ } finally {
+ fs.watch = realWatch;
+ syncBuiltinESMExports();
+ globalThis.setInterval = realSetInterval;
+ }
+ server.listen(0, '127.0.0.1');
+ await once(server, 'listening');
+ port = server.address().port;
+ base = `http://127.0.0.1:${port}`;
+});
+after(async () => {
+ server.closeAllConnections();
+ if (server.listening) await new Promise((resolve) => server.close(resolve));
+ await rm(workspace, { recursive: true, force: true });
+});
+
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+
+/** A raw request, for what fetch would refuse to send or would normalise first. */
+function raw(text) {
+ return new Promise((resolve, reject) => {
+ const socket = connect(port, '127.0.0.1', () => socket.write(text));
+ let answer = '';
+ socket.on('data', (chunk) => { answer += chunk; });
+ socket.on('end', () => resolve(answer));
+ socket.on('error', reject);
+ });
+}
+
+/** An open event stream: everything it has said so far, and a way to wait for more. */
+async function subscribe() {
+ const stop = new AbortController();
+ const response = await fetch(base + '/events', { signal: stop.signal });
+ const reader = response.body.getReader();
+ const stream = { text: '', ended: false };
+ let pending = null; // one read at a time, kept across timeouts so no chunk is lost
+ stream.read = async (ms) => {
+ const deadline = Date.now() + ms;
+ while (!stream.ended && Date.now() < deadline) {
+ pending ??= reader.read().catch(() => ({ done: true }));
+ const result = await Promise.race([pending, sleep(Math.max(1, deadline - Date.now())).then(() => null)]);
+ if (!result) break;
+ pending = null;
+ if (result.done) stream.ended = true;
+ else stream.text += new TextDecoder().decode(result.value);
+ if (stream.stopWhen?.(stream.text)) break;
+ }
+ return stream.text;
+ };
+ stream.until = async (needle, ms = 5000) => {
+ stream.stopWhen = (text) => text.includes(needle);
+ await stream.read(ms);
+ stream.stopWhen = null;
+ return stream.text.includes(needle);
+ };
+ stream.stop = () => stop.abort();
+ assert.ok(await stream.until(': connected'));
+ return stream;
+}
+
+test('the watcher reloads on a visible change, ignores hidden paths, and reports its own failure', async () => {
+ const events = await subscribe();
+ const reloads = () => events.text.split('event: change').length - 1;
+ try {
+ await events.read(500); // FSEvents may still report the workspace being written just before the watch began
+ const quiet = reloads();
+ watcher.emit('change', 'change', '.git/index');
+ watcher.emit('change', 'change', 'node_modules/x/index.js');
+ await events.read(300); // a reload scheduled for those would arrive in here
+ assert.equal(reloads(), quiet, 'hidden paths do not reload the preview');
+ watcher.emit('change', 'rename', null); // FSEvents may not name the file: still a change
+ const deadline = Date.now() + 5000;
+ while (reloads() === quiet && Date.now() < deadline) await events.read(100);
+ assert.equal(reloads(), quiet + 1);
+ assert.match(events.text, /event: change\ndata: reload\n\n/);
+ watcher.emit('error', new Error('watch stopped'));
+ assert.ok(await events.until('event: watch-error\ndata: Use Reload to see changes.'));
+ } finally { events.stop(); }
+});
+
+test('the heartbeat keeps an open stream alive every 15 s', async () => {
+ assert.equal(heartbeat.ms, 15000);
+ const events = await subscribe();
+ try {
+ heartbeat.fn();
+ assert.ok(await events.until(': alive'));
+ } finally { events.stop(); }
+});
+
+test('HEAD of the shell answers without a body', async () => {
+ const head = await fetch(base + '/', { method: 'HEAD' });
+ assert.equal(head.status, 200);
+ assert.match(head.headers.get('content-type'), /text\/html/);
+ assert.equal((await head.arrayBuffer()).byteLength, 0);
+});
+
+test('only GET subscribes to events, and paths outside /files/ or naming no file are not found', async () => {
+ assert.equal((await fetch(base + '/events', { method: 'HEAD' })).status, 404);
+ assert.equal((await fetch(base + '/elsewhere')).status, 404);
+ assert.equal((await fetch(base + '/files/')).status, 404);
+ assert.match(await raw('GET /files//etc/hosts HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: close\r\n\r\n'), /^HTTP\/1\.1 404/);
+ assert.match(await raw('GET /files/x%2F.. HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: close\r\n\r\n'), /^HTTP\/1\.1 404/, 'the workspace folder itself is not a file');
+});
+
+test('a request with no Host header is refused, and an unparseable target is a 400, not a crash', async () => {
+ assert.match(await raw('GET /files/index.html HTTP/1.0\r\n\r\n'), /^HTTP\/1\.1 403/);
+ assert.match(await raw('GET http://a:99999/ HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: close\r\n\r\n'), /^HTTP\/1\.1 400/);
+ assert.equal((await fetch(base + '/files/index.html')).status, 200, 'still serving');
+});
+
+test('a file of a type it does not know is served as bytes, and the browser is told not to guess', async () => {
+ await writeFile(join(workspace, 'model.stl'), 'solid x\nendsolid x\n');
+ const response = await fetch(base + '/files/model.stl');
+ assert.equal(response.status, 200);
+ assert.equal(response.headers.get('content-type'), 'application/octet-stream');
+ assert.equal(response.headers.get('x-content-type-options'), 'nosniff');
+ assert.match(await response.text(), /endsolid/);
+});
+
+test('a file over 32 MiB is refused with 413', async () => {
+ await writeFile(join(workspace, 'huge.bin'), '');
+ await truncate(join(workspace, 'huge.bin'), 32 * 1024 * 1024 + 1);
+ const response = await fetch(base + '/files/huge.bin');
+ assert.equal(response.status, 413);
+ assert.match(await response.text(), /smaller than 32 MiB/);
+});
+
+test('a file that cannot be read ends its response instead of hanging or crashing', { skip: process.getuid?.() === 0 && 'root reads anything' }, async () => {
+ await writeFile(join(workspace, 'locked.txt'), 'secret');
+ await chmod(join(workspace, 'locked.txt'), 0o000);
+ try {
+ await assert.rejects(async () => { await (await fetch(base + '/files/locked.txt')).text(); });
+ } finally {
+ await chmod(join(workspace, 'locked.txt'), 0o644);
+ }
+ assert.equal((await fetch(base + '/files/index.html')).status, 200, 'still serving');
+});
+
+test('closing the server ends the streams still open and stops watching', async () => {
+ const events = await subscribe();
+ let watcherClosed = false;
+ watcher.once('close', () => { watcherClosed = true; });
+ server.closeAllConnections();
+ await new Promise((resolve) => server.close(resolve));
+ await events.read(5000);
+ assert.equal(events.ended, true, 'the stream ended');
+ assert.equal(watcherClosed, true);
+});
diff --git a/store/viewers/isolated-web-viewer/test/process.test.mjs b/store/viewers/isolated-web-viewer/test/process.test.mjs
new file mode 100644
index 000000000..2cde6197a
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/test/process.test.mjs
@@ -0,0 +1,161 @@
+// viewer.mjs as Harness runs it: `node viewer.mjs` with HARNESS_WORKSPACE and HARNESS_VIEWER_PORT,
+// refusing to start without them, and closing cleanly (open streams included) on SIGTERM or SIGINT. And
+// the manifest's commands, viewer.sh and doctor.sh, on a PATH of only what they use: they find Node
+// through runtimes.sh — this machine's, or Harness's own under HOME (~/.harness/runtime/current-node),
+// the Node a fresh Mac with none on PATH gets.
+import assert from 'node:assert/strict';
+import { spawn, spawnSync } from 'node:child_process';
+import { chmod, mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promises';
+import { createServer } from 'node:net';
+import { tmpdir } from 'node:os';
+import { existsSync } from 'node:fs';
+import { dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { after, before, test } from 'node:test';
+
+const viewer = fileURLToPath(new URL('../viewer.mjs', import.meta.url));
+const pkg = dirname(viewer);
+// A bash line tracer's hooks (BASH_ENV sourcing a DEBUG trap that appends to SHCOV_OUT), passed through when set.
+const TRACER = Object.fromEntries(['BASH_ENV', 'SHCOV_OUT'].filter((k) => process.env[k]).map((k) => [k, process.env[k]]));
+let workspace;
+before(async () => {
+ workspace = await mkdtemp(join(tmpdir(), 'web-viewer-process-'));
+ await writeFile(join(workspace, 'index.html'), '<h1>Hello, process</h1>');
+});
+after(() => rm(workspace, { recursive: true, force: true }));
+
+const freePort = () => new Promise((resolve) => {
+ const probe = createServer().listen(0, '127.0.0.1', () => { const { port } = probe.address(); probe.close(() => resolve(port)); });
+});
+
+function start(env) {
+ const { HARNESS_WORKSPACE, HARNESS_VIEWER_PORT, ...rest } = process.env;
+ const child = spawn(process.execPath, [viewer], { env: { ...rest, ...env }, stdio: ['ignore', 'pipe', 'pipe'] });
+ const out = { stdout: '', stderr: '' };
+ child.stdout.on('data', (chunk) => { out.stdout += chunk; });
+ child.stderr.on('data', (chunk) => { out.stderr += chunk; });
+ const exited = new Promise((resolve) => child.on('exit', (code, signal) => resolve({ code, signal, ...out })));
+ return { child, out, exited };
+}
+
+test('refuses to start without a workspace', async () => {
+ const { code, stderr } = await start({ HARNESS_VIEWER_PORT: '4310' }).exited;
+ assert.notEqual(code, 0);
+ assert.match(stderr, /HARNESS_WORKSPACE is required\./);
+});
+
+test('refuses a port that is not a port', async () => {
+ for (const port of [undefined, 'abc', '0', '70000', '43.5']) {
+ const env = { HARNESS_WORKSPACE: workspace };
+ if (port !== undefined) env.HARNESS_VIEWER_PORT = port;
+ const { code, stderr } = await start(env).exited;
+ assert.notEqual(code, 0, String(port));
+ assert.match(stderr, /HARNESS_VIEWER_PORT must be a valid port\./, String(port));
+ }
+});
+
+for (const signal of ['SIGTERM', 'SIGINT']) {
+ test(`serves on the given loopback port and exits cleanly on ${signal}, ending open streams`, async () => {
+ const port = await freePort();
+ const run = start({ HARNESS_WORKSPACE: workspace, HARNESS_VIEWER_PORT: String(port) });
+ const deadline = Date.now() + 10_000;
+ while (!run.out.stdout.includes(`[web-viewer] http://127.0.0.1:${port}/`)) {
+ assert.ok(Date.now() < deadline, `the viewer did not start: ${run.out.stderr}`);
+ await new Promise((resolve) => setTimeout(resolve, 25));
+ }
+ const base = `http://127.0.0.1:${port}`;
+ assert.match(await (await fetch(base + '/files/index.html')).text(), /Hello, process/);
+ const stream = await fetch(base + '/events');
+ const reader = stream.body.getReader();
+ await reader.read();
+ run.child.kill(signal);
+ const { code } = await run.exited;
+ assert.equal(code, 0, 'a clean exit, not death by signal');
+ const rest = await reader.read().catch(() => ({ done: true }));
+ assert.equal(rest.done, true, 'the stream was closed');
+ });
+}
+
+const scratches = [];
+after(() => Promise.all(scratches.map((dir) => rm(dir, { recursive: true, force: true }))));
+/** A fresh temp directory, removed after the tests. */
+async function scratch(name) {
+ const dir = await mkdtemp(join(tmpdir(), `web-viewer-${name}-`));
+ scratches.push(dir);
+ return dir;
+}
+
+/** A PATH of bash, dirname and cat, plus `node` when given (a path to link, or a script body). */
+async function binWith(node) {
+ const bin = await scratch('bin');
+ for (const tool of ['bash', 'dirname', 'cat']) await symlink(['/bin', '/usr/bin'].map((d) => join(d, tool)).find((p) => existsSync(p)), join(bin, tool));
+ if (node?.startsWith('#!')) { await writeFile(join(bin, 'node'), node); await chmod(join(bin, 'node'), 0o755); }
+ else if (node) await symlink(node, join(bin, 'node'));
+ return bin;
+}
+
+/** A HOME, with Harness's own Node recorded in it when `node` is given (a path). */
+async function homeWith(node) {
+ const home = await scratch('home');
+ if (node) {
+ await mkdir(join(home, '.harness', 'runtime'), { recursive: true });
+ await writeFile(join(home, '.harness', 'runtime', 'current-node'), node);
+ }
+ return home;
+}
+
+/** A node that is the real one but says it is 18.20.4. */
+async function oldNode() {
+ const old = await scratch('old-node');
+ const fake = 'Object.defineProperty(process, "versions", { value: { ...process.versions, node: "18.20.4" } })'; // no single quote: it goes inside one
+ // `node -v` is answered by the binary before any --import, so the stand-in answers it itself.
+ await writeFile(join(old, 'node'), `#!/bin/sh\n[ "$1" = -v ] && { echo v18.20.4; exit 0; }\nexec '${process.execPath}' --import 'data:text/javascript,${encodeURIComponent(fake)}' "$@"\n`);
+ await chmod(join(old, 'node'), 0o755);
+ assert.equal(spawnSync(join(old, 'node'), ['-p', 'process.versions.node'], { encoding: 'utf8' }).stdout.trim(), '18.20.4', 'the stand-in reports an old Node');
+ return join(old, 'node');
+}
+
+const noHarnessNode = (home) => `miss node >= 20, and Harness's own Node is not in ${home}/.harness/runtime — run \`harness start\` once to lay it down\n`;
+
+test('the manifest runs doctor.sh and viewer.sh, from the package', async () => {
+ const { toolchain, viewer: own } = JSON.parse(await readFile(new URL('../harness.json', import.meta.url), 'utf8'));
+ assert.deepEqual([toolchain.doctor, own.command], ['./doctor.sh', './viewer.sh']);
+});
+
+test('doctor.sh passes on Node 20 or newer — this machine\'s or Harness\'s own — and fails on an older one or none, run as Harness runs it', async () => {
+ const { toolchain } = JSON.parse(await readFile(new URL('../harness.json', import.meta.url), 'utf8'));
+ const doctor = async (bin, home) => {
+ const r = spawnSync('/bin/sh', ['-c', toolchain.doctor], { cwd: pkg, env: { PATH: bin, HOME: home, ...TRACER }, encoding: 'utf8' });
+ return [r.status, r.stdout];
+ };
+ const ok = [0, `ok node ${process.version}\n`];
+ assert.deepEqual(await doctor(await binWith(process.execPath), await homeWith()), ok, `node ${process.version}`);
+ assert.deepEqual(await doctor(await binWith(), await homeWith(process.execPath)), ok, 'no node on PATH, Harness\'s own');
+ const bare = await homeWith();
+ assert.deepEqual(await doctor(await binWith(await oldNode()), bare), [1, noHarnessNode(bare)]);
+ assert.deepEqual(await doctor(await binWith(), bare), [1, noHarnessNode(bare)]);
+ const old = await oldNode();
+ assert.deepEqual(await doctor(await binWith(old), await homeWith(old)), [1, "miss node >= 20 — this machine's newest is v18.20.4, Harness's own; update Harness\n"]);
+});
+
+test('viewer.sh serves from a login shell with no node on PATH on Harness\'s own Node, and exits cleanly on SIGTERM; with no Node at all, a miss', async () => {
+ const bin = await binWith();
+ const port = await freePort();
+ const child = spawn('/bin/sh', ['-c', 'exec ./viewer.sh'], { cwd: pkg, env: { PATH: bin, HOME: await homeWith(process.execPath), HARNESS_WORKSPACE: workspace, HARNESS_VIEWER_PORT: String(port), ...TRACER }, stdio: ['ignore', 'pipe', 'pipe'] });
+ let stdout = '', stderr = '';
+ child.stdout.on('data', (chunk) => { stdout += chunk; });
+ child.stderr.on('data', (chunk) => { stderr += chunk; });
+ const exited = new Promise((resolve) => child.on('exit', (code) => resolve(code)));
+ const deadline = Date.now() + 10_000;
+ while (!stdout.includes(`[web-viewer] http://127.0.0.1:${port}/`)) {
+ assert.ok(Date.now() < deadline, `the viewer did not start: ${stderr}`);
+ await new Promise((resolve) => setTimeout(resolve, 25));
+ }
+ assert.match(await (await fetch(`http://127.0.0.1:${port}/files/index.html`)).text(), /Hello, process/);
+ child.kill('SIGTERM');
+ assert.equal(await exited, 0, 'exec: the signal reaches node, which exits cleanly');
+
+ const home = await homeWith();
+ const none = spawnSync('/bin/sh', ['-c', './viewer.sh'], { cwd: pkg, env: { PATH: bin, HOME: home, HARNESS_WORKSPACE: workspace, HARNESS_VIEWER_PORT: String(port), ...TRACER }, encoding: 'utf8' });
+ assert.deepEqual([none.status, none.stdout], [1, noHarnessNode(home)]);
+});
diff --git a/store/viewers/isolated-web-viewer/test/viewer.test.mjs b/store/viewers/isolated-web-viewer/test/viewer.test.mjs
new file mode 100644
index 000000000..92ed44196
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/test/viewer.test.mjs
@@ -0,0 +1,130 @@
+import assert from 'node:assert/strict';
+import { once } from 'node:events';
+import { cp, mkdir, mkdtemp, readFile, rm, symlink, truncate, writeFile } from 'node:fs/promises';
+import { request } from 'node:http';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { after, before, test } from 'node:test';
+import { createHtmlViewer } from '../viewer.mjs';
+
+let root, workspace, server, base;
+before(async () => {
+ root = await mkdtemp(join(tmpdir(), 'openharness-html-'));
+ workspace = join(root, 'workspace');
+ await cp(fileURLToPath(new URL('../../../examples/hello-world/template', import.meta.url)), workspace, { recursive: true });
+ await mkdir(join(workspace, 'pages'));
+ await writeFile(join(workspace, 'pages', 'demo.html'), '<h1>A nested page</h1>');
+ await writeFile(join(workspace, 'pages', 'style.css'), 'h1 { color: green; }');
+ await writeFile(join(workspace, '.env'), 'PRIVATE=do-not-serve');
+ await writeFile(join(root, 'outside.txt'), 'outside the workspace');
+ await symlink(join(root, 'outside.txt'), join(workspace, 'outside.txt'));
+ await symlink(join(workspace, '.env'), join(workspace, 'hidden.txt'));
+ server = await createHtmlViewer(workspace);
+ server.listen(0, '127.0.0.1');
+ await once(server, 'listening');
+ base = `http://127.0.0.1:${server.address().port}`;
+});
+after(async () => {
+ if (server) {
+ server.closeAllConnections();
+ await new Promise(resolve => server.close(resolve));
+ }
+ if (root) await rm(root, { recursive: true, force: true });
+});
+
+test('serves the actual Hello World page and a sandboxed preview shell', async () => {
+ const shell = await fetch(base);
+ assert.equal(shell.status, 200);
+ const html = await shell.text();
+ assert.match(html, /sandbox="allow-scripts allow-downloads allow-pointer-lock"/);
+ assert.doesNotMatch(html, /allow-same-origin/);
+ const page = await fetch(base + '/files/index.html');
+ assert.equal(page.status, 200);
+ assert.match(page.headers.get('content-type'), /text\/html/);
+ assert.equal(page.headers.get('cache-control'), 'no-store');
+ assert.match(await page.text(), /Hello, world!/);
+ const css = await fetch(base + '/files/pages/style.css');
+ assert.match(css.headers.get('content-type'), /text\/css/);
+ assert.match(await css.text(), /green/);
+ assert.match(await (await fetch(base + '/files/pages/demo.html')).text(), /nested page/);
+});
+
+test('only the unguessable preview path grants an opaque sandbox access to public assets', async () => {
+ const html = await (await fetch(base)).text();
+ const prefix = html.match(/const prefix = '(\/preview\/[a-f0-9]{48}\/)'/)[1];
+ const response = await fetch(base + prefix + 'pages/style.css', { headers: { Origin: 'null' } });
+ assert.equal(response.status, 200);
+ assert.equal(response.headers.get('access-control-allow-origin'), 'null');
+ assert.equal(response.headers.get('referrer-policy'), 'no-referrer');
+ assert.equal(response.headers.get('access-control-allow-credentials'), null);
+ assert.equal((await fetch(base + '/files/pages/style.css')).headers.get('access-control-allow-origin'), null);
+ assert.equal((await fetch(base)).headers.get('access-control-allow-origin'), null);
+ assert.equal((await fetch(base + '/preview/wrong/pages/style.css')).status, 404);
+ for (const file of ['.env', 'outside.txt', 'hidden.txt', '%2e%2e%2foutside.txt']) {
+ assert.equal((await fetch(base + prefix + file)).status, 404, file);
+ }
+ await writeFile(join(workspace, 'engine.wasm'), Buffer.from([0,97,115,109,1,0,0,0]));
+ assert.equal((await fetch(base + prefix + 'engine.wasm')).headers.get('content-type'), 'application/wasm');
+});
+
+test('WASM engines and PCK assets have a bounded 128 MiB allowance for real Godot exports', async () => {
+ for (const name of ['large.wasm', 'large.pck']) {
+ await writeFile(join(workspace,name),'');
+ await truncate(join(workspace,name),44*1024*1024);
+ assert.equal((await fetch(base+'/files/'+name,{method:'HEAD'})).status,200);
+ await truncate(join(workspace,name),128*1024*1024+1);
+ assert.equal((await fetch(base+'/files/'+name,{method:'HEAD'})).status,413);
+ }
+});
+
+test('a workspace edit notifies the live preview and serves the new content', { timeout: 5000 }, async () => {
+ const stop = new AbortController();
+ try {
+ const response = await fetch(base + '/events', { signal: stop.signal });
+ const reader = response.body.getReader();
+ await reader.read(); // Connected; the subscription exists before the write.
+ await writeFile(join(workspace, 'index.html'), '<h1>Hello, Ada!</h1>');
+ let events = '';
+ while (!events.includes('event: change')) {
+ const { value, done } = await reader.read();
+ assert.equal(done, false);
+ events += new TextDecoder().decode(value);
+ }
+ assert.match(await (await fetch(base + '/files/index.html')).text(), /Hello, Ada!/);
+ } finally { stop.abort(); }
+});
+
+test('rejects traversal, private files, and symlinks that escape or expose hidden files', async () => {
+ for (const path of ['/files/%2e%2e%2foutside.txt', '/files/.env', '/files/outside.txt', '/files/hidden.txt', '/files/pages', '/files/%00']) {
+ assert.equal((await fetch(base + path)).status, 404, path);
+ }
+ assert.equal((await fetch(base + '/files/%ZZ')).status, 400);
+});
+
+test('is read-only and refuses a non-loopback Host header', async () => {
+ assert.equal((await fetch(base + '/files/index.html', { method: 'POST', body: 'replace' })).status, 405);
+ assert.equal((await fetch(base + '/files/index.html', { method: 'HEAD' })).status, 200);
+ const status = await new Promise((resolve, reject) => {
+ const req = request(base, { headers: { host: 'untrusted.example' } }, res => { res.resume(); resolve(res.statusCode); });
+ req.on('error', reject);
+ req.end();
+ });
+ assert.equal(status, 403);
+});
+
+test('shows a recoverable empty state before a page exists', async () => {
+ const missing = await fetch(base + '/files/later.html');
+ assert.equal(missing.status, 404);
+ assert.match(await missing.text(), /No preview yet/);
+ await writeFile(join(workspace, 'later.html'), '<p>Now ready</p>');
+ assert.match(await (await fetch(base + '/files/later.html')).text(), /Now ready/);
+});
+
+test('Web Studio declares this viewer and the URL follows its actual artifact', async () => {
+ const example = JSON.parse(await readFile(new URL('../../../agents/web-studio/harness.json', import.meta.url), 'utf8'));
+ const viewer = JSON.parse(await readFile(new URL('../harness.json', import.meta.url), 'utf8'));
+ assert.equal(example.viewer.use, viewer.id);
+ assert.equal(new URL(viewer.viewer.url.replace('${port}', '4310').replace('${artifact}', example.workspace.marker)).searchParams.get('file'), example.workspace.marker);
+ assert.equal(new URL(viewer.viewer.url.replace('${port}', '4310').replace('${artifact}', 'build-status.html')).searchParams.get('file'), 'build-status.html');
+});
diff --git a/store/viewers/isolated-web-viewer/viewer.mjs b/store/viewers/isolated-web-viewer/viewer.mjs
new file mode 100644
index 000000000..2e2b6d340
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/viewer.mjs
@@ -0,0 +1,107 @@
+// A shared, dependency-free preview. Only public files inside the workspace are served.
+import { createReadStream, watch } from 'node:fs';
+import { randomBytes } from 'node:crypto';
+import { readFile, realpath, stat } from 'node:fs/promises';
+import { createServer } from 'node:http';
+import { extname, isAbsolute, join, relative, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const mime = {
+ '.html': 'text/html; charset=utf-8', '.css': 'text/css; charset=utf-8',
+ '.js': 'text/javascript; charset=utf-8', '.mjs': 'text/javascript; charset=utf-8',
+ '.json': 'application/json', '.svg': 'image/svg+xml', '.png': 'image/png',
+ '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.gif': 'image/gif',
+ '.ico': 'image/x-icon', '.woff': 'font/woff', '.woff2': 'font/woff2', '.txt': 'text/plain; charset=utf-8',
+ '.csv': 'text/csv; charset=utf-8', '.geojson': 'application/geo+json', '.wasm': 'application/wasm',
+ '.mp3': 'audio/mpeg', '.ogg': 'audio/ogg', '.wav': 'audio/wav', '.mp4': 'video/mp4', '.webm': 'video/webm',
+};
+const hidden = (path) => path.split(/[\\/]/).some((part) => part.startsWith('.') || part === 'node_modules');
+
+export async function createHtmlViewer(workspace) {
+ const root = await realpath(workspace);
+ // An opaque-origin sandbox needs CORS to fetch its own data and modules. A secret path
+ // grants access to this preview without exposing the workspace to arbitrary null origins.
+ const previewPrefix = `/preview/${randomBytes(24).toString('hex')}/`;
+ const shell = (await readFile(new URL('preview.html', import.meta.url), 'utf8'))
+ .replace('__PREVIEW_PREFIX__', previewPrefix);
+ const clients = new Set();
+ let pending;
+ const watcher = watch(root, { recursive: true }, (_event, name) => {
+ if (name && hidden(String(name))) return;
+ clearTimeout(pending);
+ pending = setTimeout(() => {
+ for (const client of clients) client.write('event: change\ndata: reload\n\n');
+ }, 80);
+ });
+ const heartbeat = setInterval(() => {
+ for (const client of clients) client.write(': alive\n\n');
+ }, 15000);
+ heartbeat.unref();
+
+ const server = createServer(async (req, res) => {
+ res.setHeader('cache-control', 'no-store');
+ res.setHeader('x-content-type-options', 'nosniff');
+ res.setHeader('referrer-policy', 'no-referrer');
+ const end = (status, message) => { res.writeHead(status, { 'content-type': 'text/plain; charset=utf-8' }); res.end(message); };
+ if (!/^(127\.0\.0\.1|localhost)(:\d+)?$/.test(req.headers.host ?? '')) return end(403, 'Loopback requests only.');
+ if (req.method !== 'GET' && req.method !== 'HEAD') return end(405, 'Read-only preview.');
+ let path;
+ try { path = decodeURIComponent(new URL(req.url, 'http://127.0.0.1').pathname); }
+ catch { return end(400, 'Invalid path.'); }
+ if (path === '/') {
+ res.writeHead(200, { 'content-type': 'text/html; charset=utf-8' });
+ return res.end(req.method === 'HEAD' ? undefined : shell);
+ }
+ if (path === '/events' && req.method === 'GET') {
+ res.writeHead(200, { 'content-type': 'text/event-stream', connection: 'keep-alive' });
+ res.write(': connected\n\n');
+ clients.add(res);
+ res.on('close', () => clients.delete(res));
+ return;
+ }
+ const sandboxed = path.startsWith(previewPrefix);
+ if (!sandboxed && !path.startsWith('/files/')) return end(404, 'Not found.');
+ if (sandboxed) {
+ res.setHeader('access-control-allow-origin', 'null');
+ res.setHeader('vary', 'Origin');
+ }
+ const requested = path.slice(sandboxed ? previewPrefix.length : '/files/'.length);
+ if (!requested || isAbsolute(requested) || hidden(requested)) return end(404, 'Not found.');
+ try {
+ const file = await realpath(join(root, requested));
+ const inside = relative(root, file);
+ if (isAbsolute(inside) || inside.startsWith('..') || hidden(inside)) return end(404, 'Not found.');
+ const info = await stat(file);
+ if (!info.isFile()) return end(404, 'Not found.');
+ const extension = extname(file).toLowerCase();
+ // Godot's standard single-threaded WASM engine is already larger than 32 MiB.
+ const limitMiB = ['.wasm', '.pck'].includes(extension) ? 128 : 32;
+ if (info.size > limitMiB * 1024 * 1024) return end(413, 'Preview files must be smaller than ' + limitMiB + ' MiB.');
+ res.writeHead(200, { 'content-type': mime[extension] ?? 'application/octet-stream' });
+ if (req.method === 'HEAD') return res.end();
+ createReadStream(file).on('error', () => res.destroy()).pipe(res);
+ } catch { end(404, 'No preview yet. Ask the agent to create index.html.'); }
+ });
+ watcher.on('error', () => {
+ for (const client of clients) client.write('event: watch-error\ndata: Use Reload to see changes.\n\n');
+ });
+ server.on('close', () => {
+ watcher.close();
+ clearTimeout(pending);
+ clearInterval(heartbeat);
+ for (const client of clients) client.end();
+ });
+ return server;
+}
+
+if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
+ if (!process.env.HARNESS_WORKSPACE) throw new Error('HARNESS_WORKSPACE is required.');
+ const port = Number(process.env.HARNESS_VIEWER_PORT);
+ if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error('HARNESS_VIEWER_PORT must be a valid port.');
+ const server = await createHtmlViewer(process.env.HARNESS_WORKSPACE);
+ server.listen(port, '127.0.0.1', () => console.log(`[web-viewer] http://127.0.0.1:${port}/`));
+ for (const signal of ['SIGINT', 'SIGTERM']) process.once(signal, () => {
+ server.closeAllConnections();
+ server.close();
+ });
+}
diff --git a/store/viewers/isolated-web-viewer/viewer.sh b/store/viewers/isolated-web-viewer/viewer.sh
new file mode 100755
index 000000000..6877d9b01
--- /dev/null
+++ b/store/viewers/isolated-web-viewer/viewer.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# The pane. Harness runs this here with HARNESS_VIEWER_PORT and HARNESS_WORKSPACE, through a login shell
+# whose PATH may hold no node: runtimes.sh finds this machine's or Harness's own. viewer.mjs itself
+# checks both variables.
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+# shellcheck source=runtimes.sh
+. "$here/runtimes.sh"
+harness_node 20 || exit 1
+exec node "$here/viewer.mjs"