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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
feat(store): add interactive studio viewer with bounded jobs and run history
Dee16bceeb09bed
diff --git a/docs/plans/2026-09-17-002-remaining-harnesses.md b/docs/plans/2026-09-17-002-remaining-harnesses.mdindex 1d3719ca9..06e811ea0 100644--- a/docs/plans/2026-09-17-002-remaining-harnesses.md+++ b/docs/plans/2026-09-17-002-remaining-harnesses.md@@ -23,6 +23,10 @@ and official Comfy MCP. Godogen and OpenMontage already exist.## Verification boundary+The user confirmed: **use this Mac and local simulations**. The end-to-end acceptance matrix+covers the shipped local workflows on this machine; native service/hardware connections are+separate optional paths and must not be presented as tested here.+This Mac initially has no Ableton Live, Docker/OpenFOAM, Blender/Bonsai, or robot hardware.Local examples must identify their actual engine and provenance. A procedural preview,simulation, fixture, or protocol-contract test cannot count as live upstream verification.diff --git a/store/tools/studio_fetch.py b/store/tools/studio_fetch.pynew file mode 100644index 000000000..0b41a17c6--- /dev/null+++ b/store/tools/studio_fetch.py@@ -0,0 +1,32 @@+"""Fetch reviewed source pins without installing a service or changing user configuration."""+import json+import os+from pathlib import Path+import subprocess++root = Path(__file__).resolve().parent.parent+sources = json.loads((root / "upstream.lock.json").read_text())+for source in sources:+ target = root / source["directory"]+ def git(*args):+ return subprocess.check_output(["git", "-C", str(target), *args], text=True,+ env={**os.environ, "GIT_LFS_SKIP_SMUDGE": "1"}).strip()+ if not (target / ".git").exists():+ target.mkdir(parents=True, exist_ok=True)+ git("init", "-q")+ git("remote", "add", "origin", source["url"])+ if source.get("sparse"):+ git("sparse-checkout", "init", "--cone")+ git("sparse-checkout", "set", *source["sparse"])+ if git("remote", "get-url", "origin") != source["url"]:+ raise SystemExit(f"Unexpected upstream remote in {target}")+ try:+ current = git("rev-parse", "HEAD")+ except subprocess.CalledProcessError:+ current = ""+ if current != source["commit"]:+ if current and git("status", "--porcelain"):+ raise SystemExit(f"Save your edits in {target} before changing its source pin")+ git("fetch", "--depth", "1", "--filter=blob:none", "origin", source["commit"])+ git("checkout", "--detach", source["commit"])+ print(f'ok {source["name"]} at {source["commit"][:12]}', flush=True)diff --git a/store/tools/studio_runtime.py b/store/tools/studio_runtime.pynew file mode 100644index 000000000..8b8ea016c--- /dev/null+++ b/store/tools/studio_runtime.py@@ -0,0 +1,132 @@+"""Portable runner copied into each independently installable studio package."""+import json+import math+import os+from pathlib import Path+import subprocess+import sys+import tempfile+import time+import uuid+++def workspace():+ return Path(os.environ.get("HARNESS_WORKSPACE", os.getcwd())).resolve()+++def package():+ return Path(__file__).resolve().parent.parent+++def contained(path):+ target = Path(path).resolve()+ target.relative_to(workspace())+ return target+++def atomic_json(path, data):+ path = contained(path)+ path.parent.mkdir(parents=True, exist_ok=True)+ with tempfile.NamedTemporaryFile(mode="w", dir=path.parent, prefix=".studio-", delete=False) as f:+ json.dump(data, f, indent=2, allow_nan=False)+ f.write("\n")+ temp = f.name+ os.replace(temp, path)+++def command(argv, cwd=None, timeout=120, env=None):+ """No shell interpolation; keep complete logs as output, bound execution time."""+ result = subprocess.run([str(x) for x in argv], cwd=cwd, timeout=timeout,+ env=env, text=True, capture_output=True)+ if result.returncode:+ raise RuntimeError((result.stderr or result.stdout)[-1600:] or f"{argv[0]} exited {result.returncode}")+ return result.stdout+++def parameters(config, values):+ if not isinstance(values, dict) or set(values) - {c["id"] for c in config["controls"]}:+ raise ValueError("Invalid studio controls")+ result = {}+ for c in config["controls"]:+ value = values.get(c["id"], c["value"])+ if c["type"] == "number":+ if type(value) not in (int, float) or not math.isfinite(value) or not c["min"] <= value <= c["max"]:+ raise ValueError(f'{c["label"]} is outside its range')+ if c.get("integer") and value != int(value):+ raise ValueError(f'{c["label"]} must be a whole number')+ elif c["type"] == "select":+ if value not in [o["value"] for o in c["options"]]:+ raise ValueError(f'Unknown {c["label"]}')+ elif not isinstance(value, str) or len(value) > c.get("maxLength", 500):+ raise ValueError(f'Invalid {c["label"]}')+ result[c["id"]] = value+ return result+++def metric(label, value, unit=""):+ return {"label": label, "value": value, "unit": unit}+++def previous_runs():+ base = contained(workspace() / "out/runs")+ rows = []+ for p in sorted(base.glob("*/result.json"))[-100:]:+ try:+ rows.append(json.loads(contained(p).read_text()))+ except (ValueError, OSError):+ continue+ return rows+++def execute(actions):+ root = workspace()+ config = json.loads((package() / "studio.config.json").read_text())+ action = sys.argv[1] if len(sys.argv) > 1 else config["actions"][0]["id"]+ started = time.monotonic()+ verdict_path = root / ".harness/verdict.json"+ verdict = {"spec": 1, "ready": False, "summary": "Preparing the studio run", "findings": [],+ "phases": [{"id": "run", "name": "Make", "state": "active"},+ {"id": "inspect", "name": "Inspect", "state": "pending"}]}+ try:+ if action not in actions:+ raise ValueError(f"Unknown action: {action}")+ source = contained(root / "studio.json")+ if source.stat().st_size > 16384:+ raise ValueError("studio.json is too large")+ project = json.loads(source.read_text())+ p = parameters(config, project["parameters"])+ atomic_json(verdict_path, verdict)+ run_id = time.strftime("%Y%m%dT%H%M%S", time.gmtime()) + "-" + uuid.uuid4().hex[:8]+ output = contained(root / "out/runs" / run_id)+ output.mkdir(parents=True)+ print(f'{config["title"]}: {action}', flush=True)+ result = actions[action](p, output)+ artifacts = []+ for artifact in result.pop("files", []):+ file = contained(output / artifact["name"])+ file.relative_to(output)+ if not file.is_file() or not file.stat().st_size:+ raise ValueError(f'Missing output: {artifact["name"]}')+ artifacts.append({"label": artifact["label"], "path": str(file.relative_to(root))})+ result.update({"spec": 1, "id": run_id, "action": action, "parameters": p,+ "createdAt": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),+ "durationSeconds": round(time.monotonic() - started, 3), "artifacts": artifacts,+ "upstream": json.loads((package() / "upstream.lock.json").read_text())})+ atomic_json(output / "result.json", result)+ atomic_json(root / "out/latest.json", result)+ verdict.update({"ready": True, "summary": f'{result["title"]} · {result["engine"]}',+ "artifact": str((output / "result.json").relative_to(root)),+ "phases": [{"id": "run", "name": "Make", "state": "done"},+ {"id": "inspect", "name": "Inspect", "state": "done"}],+ "updatedAt": result["createdAt"]})+ atomic_json(verdict_path, verdict)+ print(f'Ready: {result["title"]}', flush=True)+ except Exception as exc:+ verdict.update({"summary": str(exc)[:500], "findings": [{"severity": "error", "kind": "run-failed", "message": str(exc)[:1000]}],+ "phases": [{"id": "run", "name": "Make", "state": "failed"}]})+ try:+ atomic_json(verdict_path, verdict)+ except (ValueError, OSError):+ pass+ print(str(exc), file=sys.stderr)+ raise SystemExit(1) from excdiff --git a/store/tools/sync-studios.mjs b/store/tools/sync-studios.mjsnew file mode 100644index 000000000..7b455f58b--- /dev/null+++ b/store/tools/sync-studios.mjs@@ -0,0 +1,18 @@+// Like runtimes.sh, the small Python runner must travel with sparse package installs.+import {readFileSync,writeFileSync,existsSync,readdirSync} from 'node:fs';+import {fileURLToPath} from 'node:url';+import {join} from 'node:path';+const root=fileURLToPath(new URL('../',import.meta.url));+let failed=false;+for(const name of readdirSync(join(root,'agents'))){+ const dir=join(root,'agents',name);+ if(!existsSync(join(dir,'studio.config.json')))continue;+ for(const script of ['studio_runtime.py','studio_fetch.py']){+ const canonical=readFileSync(join(root,'tools',script),'utf8');+ const file=join(dir,'toolchain',script);+ if(existsSync(file)&&readFileSync(file,'utf8')===canonical)continue;+ if(process.argv.includes('--check')){console.error(`${name}: ${script} differs`);failed=true;}+ else writeFileSync(file,canonical);+ }+}+process.exitCode=failed?1:0;diff --git a/store/viewers/studio-viewer/.gitignore b/store/viewers/studio-viewer/.gitignorenew file mode 100644index 000000000..4b66d1e7f--- /dev/null+++ b/store/viewers/studio-viewer/.gitignore@@ -0,0 +1,4 @@+node_modules/+test-results/+coverage/+.nyc_output/diff --git a/store/viewers/studio-viewer/LICENSE b/store/viewers/studio-viewer/LICENSEnew file mode 100644index 000000000..a499cd17e--- /dev/null+++ b/store/viewers/studio-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/studio-viewer/README.md b/store/viewers/studio-viewer/README.mdnew file mode 100644index 000000000..738dc0d33--- /dev/null+++ b/store/viewers/studio-viewer/README.md@@ -0,0 +1,19 @@+# Studio Viewer++A shared host for the eight specialist studios. Each harness supplies `studio.config.json`,+`view.mjs`, and `toolchain/run.sh`; the viewer provides bounded file access, live state,+validated controls, one running job at a time, cancellation, history, and artifact downloads.+It has no production npm dependencies. The package installs independently.++Run `./setup.sh`, then launch with `HARNESS_WORKSPACE`, `HARNESS_DSH_DIR`, and+`HARNESS_VIEWER_PORT`. `studio.json` belongs to the workspace; configurations and executable+code belong to the installed harness. A failed run preserves the previous successful result.+Run provenance is visible beside the output, including when a starter is a local simulation.++Development: `npm ci`, `npm test`, and `npm run test:browser`. See `TESTING.md` for the+coverage matrix and the difference between local workflows and external integrations.++## Credit and stewardship++OpenHarness contributors maintain this MIT-licensed viewer. Domain packages credit their+respective upstream authors. Bugs in this host belong in OpenHarness.diff --git a/store/viewers/studio-viewer/doctor.sh b/store/viewers/studio-viewer/doctor.shnew file mode 100755index 000000000..61e60d11b--- /dev/null+++ b/store/viewers/studio-viewer/doctor.sh@@ -0,0 +1,7 @@+#!/usr/bin/env bash+set -euo pipefail+cd "$(dirname "$0")"+. ./runtimes.sh+harness_node 22+node --check server.mjs+echo 'ok Studio Viewer · local workspaces, interactive surfaces, run history'diff --git a/store/viewers/studio-viewer/harness.json b/store/viewers/studio-viewer/harness.jsonnew file mode 100644index 000000000..d9c73fcc4--- /dev/null+++ b/store/viewers/studio-viewer/harness.json@@ -0,0 +1,11 @@+{+ "spec": 1,+ "kind": "viewer",+ "id": "autonomous/studio-viewer",+ "name": "Studio Viewer",+ "category": "Creative tools",+ "author": "OpenHarness contributors",+ "description": "An interactive workbench for experiments, instruments, simulations, and creative tools. Keep every run, compare results, and take your work with you.",+ "toolchain": { "setup": "setup.sh", "doctor": "doctor.sh" },+ "viewer": { "command": "viewer.sh", "url": "http://127.0.0.1:${port}/" }+}diff --git a/store/viewers/studio-viewer/package-lock.json b/store/viewers/studio-viewer/package-lock.jsonnew file mode 100644index 000000000..4cf00d700--- /dev/null+++ b/store/viewers/studio-viewer/package-lock.json@@ -0,0 +1,1134 @@+{+ "name": "openharness-studio-viewer",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "openharness-studio-viewer",+ "devDependencies": {+ "c8": "10.1.3",+ "playwright": "1.58.2"+ }+ },+ "node_modules/@bcoe/v8-coverage": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz",+ "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@isaacs/cliui": {+ "version": "8.0.2",+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "string-width": "^5.1.2",+ "string-width-cjs": "npm:string-width@^4.2.0",+ "strip-ansi": "^7.0.1",+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",+ "wrap-ansi": "^8.1.0",+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@istanbuljs/schema": {+ "version": "0.1.6",+ "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz",+ "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@pkgjs/parseargs": {+ "version": "0.11.0",+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "engines": {+ "node": ">=14"+ }+ },+ "node_modules/@types/istanbul-lib-coverage": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",+ "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/ansi-regex": {+ "version": "6.3.0",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz",+ "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"+ }+ },+ "node_modules/ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/balanced-match": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "18 || 20 || >=22"+ }+ },+ "node_modules/brace-expansion": {+ "version": "5.0.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^4.0.2"+ },+ "engines": {+ "node": "20 || >=22"+ }+ },+ "node_modules/c8": {+ "version": "10.1.3",+ "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz",+ "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "@bcoe/v8-coverage": "^1.0.1",+ "@istanbuljs/schema": "^0.1.3",+ "find-up": "^5.0.0",+ "foreground-child": "^3.1.1",+ "istanbul-lib-coverage": "^3.2.0",+ "istanbul-lib-report": "^3.0.1",+ "istanbul-reports": "^3.1.6",+ "test-exclude": "^7.0.1",+ "v8-to-istanbul": "^9.0.0",+ "yargs": "^17.7.2",+ "yargs-parser": "^21.1.1"+ },+ "bin": {+ "c8": "bin/c8.js"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "monocart-coverage-reports": "^2"+ },+ "peerDependenciesMeta": {+ "monocart-coverage-reports": {+ "optional": true+ }+ }+ },+ "node_modules/cliui": {+ "version": "8.0.1",+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "string-width": "^4.2.0",+ "strip-ansi": "^6.0.1",+ "wrap-ansi": "^7.0.0"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/cliui/node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cliui/node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/cliui/node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cliui/node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cliui/node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/cliui/node_modules/wrap-ansi": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/eastasianwidth": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/emoji-regex": {+ "version": "9.2.2",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/escalade": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/find-up": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "locate-path": "^6.0.0",+ "path-exists": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/foreground-child": {+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",+ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "cross-spawn": "^7.0.6",+ "signal-exit": "^4.0.1"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.2",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/get-caller-file": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": "6.* || 8.* || >= 10.*"+ }+ },+ "node_modules/glob": {+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",+ "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "foreground-child": "^3.1.0",+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "package-json-from-dist": "^1.0.0",+ "path-scurry": "^1.11.1"+ },+ "bin": {+ "glob": "dist/esm/bin.mjs"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/glob/node_modules/balanced-match": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/glob/node_modules/brace-expansion": {+ "version": "2.1.7",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz",+ "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/glob/node_modules/minimatch": {+ "version": "9.0.9",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.2"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/html-escaper": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",+ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/is-fullwidth-code-point": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/istanbul-lib-coverage": {+ "version": "3.2.2",+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",+ "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/istanbul-lib-report": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",+ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "istanbul-lib-coverage": "^3.0.0",+ "make-dir": "^4.0.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/istanbul-reports": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz",+ "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "html-escaper": "^2.0.0",+ "istanbul-lib-report": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/jackspeak": {+ "version": "3.4.3",+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "@isaacs/cliui": "^8.0.2"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ },+ "optionalDependencies": {+ "@pkgjs/parseargs": "^0.11.0"+ }+ },+ "node_modules/locate-path": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-locate": "^5.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/make-dir": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",+ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "semver": "^7.5.3"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/minimatch": {+ "version": "10.2.6",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "brace-expansion": "^5.0.8"+ },+ "engines": {+ "node": "18 || 20 || >=22"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/minipass": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",+ "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=16 || 14 >=14.17"+ }+ },+ "node_modules/p-limit": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "yocto-queue": "^0.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/p-locate": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "p-limit": "^3.0.2"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/package-json-from-dist": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",+ "dev": true,+ "license": "BlueOak-1.0.0"+ },+ "node_modules/path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-scurry": {+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",+ "dev": true,+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "lru-cache": "^10.2.0",+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"+ },+ "engines": {+ "node": ">=16 || 14 >=14.18"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/playwright": {+ "version": "1.58.2",+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz",+ "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "playwright-core": "1.58.2"+ },+ "bin": {+ "playwright": "cli.js"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "fsevents": "2.3.2"+ }+ },+ "node_modules/playwright-core": {+ "version": "1.58.2",+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz",+ "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "playwright-core": "cli.js"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/require-directory": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/signal-exit": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/string-width": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "eastasianwidth": "^0.2.0",+ "emoji-regex": "^9.2.2",+ "strip-ansi": "^7.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/string-width-cjs": {+ "name": "string-width",+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/string-width-cjs/node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/string-width-cjs/node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/string-width-cjs/node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^6.2.2"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"+ }+ },+ "node_modules/strip-ansi-cjs": {+ "name": "strip-ansi",+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/strip-ansi-cjs/node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/test-exclude": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz",+ "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "@istanbuljs/schema": "^0.1.2",+ "glob": "^10.4.1",+ "minimatch": "^10.2.2"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/v8-to-istanbul": {+ "version": "9.3.0",+ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",+ "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "@jridgewell/trace-mapping": "^0.3.12",+ "@types/istanbul-lib-coverage": "^2.0.1",+ "convert-source-map": "^2.0.0"+ },+ "engines": {+ "node": ">=10.12.0"+ }+ },+ "node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/wrap-ansi": {+ "version": "8.1.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^6.1.0",+ "string-width": "^5.0.1",+ "strip-ansi": "^7.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/wrap-ansi-cjs": {+ "name": "wrap-ansi",+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^4.0.0",+ "string-width": "^4.1.0",+ "strip-ansi": "^6.0.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/wrap-ansi-cjs/node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/y18n": {+ "version": "5.0.8",+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/yargs": {+ "version": "17.7.3",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz",+ "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cliui": "^8.0.1",+ "escalade": "^3.1.1",+ "get-caller-file": "^2.0.5",+ "require-directory": "^2.1.1",+ "string-width": "^4.2.3",+ "y18n": "^5.0.5",+ "yargs-parser": "^21.1.1"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/yargs-parser": {+ "version": "21.1.1",+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/yargs/node_modules/ansi-regex": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/yargs/node_modules/emoji-regex": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/yargs/node_modules/string-width": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^8.0.0",+ "is-fullwidth-code-point": "^3.0.0",+ "strip-ansi": "^6.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/yargs/node_modules/strip-ansi": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/yocto-queue": {+ "version": "0.1.0",+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ }+ }+}diff --git a/store/viewers/studio-viewer/package.json b/store/viewers/studio-viewer/package.jsonnew file mode 100644index 000000000..45b87b0ef--- /dev/null+++ b/store/viewers/studio-viewer/package.json@@ -0,0 +1,10 @@+{+ "name": "openharness-studio-viewer",+ "private": true,+ "type": "module",+ "scripts": {+ "test": "node --test test/*.test.mjs",+ "test:browser": "node test/studios.e2e.mjs"+ },+ "devDependencies": { "playwright": "1.58.2", "c8": "10.1.3" }+}diff --git a/store/viewers/studio-viewer/runtimes.sh b/store/viewers/studio-viewer/runtimes.shnew file mode 100755index 000000000..7223c78dc--- /dev/null+++ b/store/viewers/studio-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/studio-viewer/server.mjs b/store/viewers/studio-viewer/server.mjsnew file mode 100644index 000000000..7d78c09dd--- /dev/null+++ b/store/viewers/studio-viewer/server.mjs@@ -0,0 +1,158 @@+import http from 'node:http';+import {readFile, writeFile, mkdir, readdir, realpath, stat} from 'node:fs/promises';+import {resolve, join, relative, sep, extname} from 'node:path';+import {fileURLToPath} from 'node:url';+import {createHash} from 'node:crypto';+import {spawn} from 'node:child_process';++const UI = fileURLToPath(new URL('./web/', import.meta.url));+const TYPES = {'.html':'text/html; charset=utf-8','.css':'text/css; charset=utf-8','.mjs':'text/javascript; charset=utf-8','.js':'text/javascript; charset=utf-8','.json':'application/json','.svg':'image/svg+xml','.png':'image/png','.jpg':'image/jpeg','.wav':'audio/wav','.mid':'audio/midi','.mp4':'video/mp4','.txt':'text/plain; charset=utf-8','.csv':'text/csv','.ifc':'application/octet-stream','.zip':'application/zip'};++export class Problem extends Error {+ constructor(status, message) { super(message); this.status = status; }+}+export async function confined(root, path) {+ const base = await realpath(root);+ const target = await realpath(resolve(base, path));+ if (target !== base && !target.startsWith(base + sep)) throw new Problem(403, 'This file is outside the workspace.');+ return target;+}+async function jsonFile(root, path) {+ const target = await confined(root, path);+ if ((await stat(target)).size > 8 * 1024 * 1024) throw new Problem(413, 'This file is too large to preview.');+ return JSON.parse(await readFile(target, 'utf8'));+}+export function validateParameters(config, parameters) {+ if (!parameters || Array.isArray(parameters) || typeof parameters !== 'object') throw new Problem(400, 'Provide the studio controls.');+ const keys = new Set(config.controls.map(c => c.id));+ if (Object.keys(parameters).some(k => !keys.has(k))) throw new Problem(400, 'Unknown studio control.');+ const out = {};+ for (const c of config.controls) {+ const v = parameters[c.id] ?? c.value;+ if (c.type === 'number') {+ if (typeof v !== 'number' || !Number.isFinite(v) || v < c.min || v > c.max || (c.integer && !Number.isInteger(v))) throw new Problem(400, `${c.label} must be between ${c.min} and ${c.max}.`);+ } else if (c.type === 'select') {+ if (!c.options.some(o => o.value === v)) throw new Problem(400, `Choose a valid ${c.label.toLowerCase()}.`);+ } else if (typeof v !== 'string' || v.length > (c.maxLength ?? 500)) throw new Problem(400, `${c.label} is too long or invalid.`);+ out[c.id] = v;+ }+ return out;+}+async function body(req) {+ let raw = '';+ for await (const chunk of req) {+ raw += chunk;+ if (Buffer.byteLength(raw) > 16384) throw new Problem(413, 'The request is too large.');+ }+ try { return JSON.parse(raw); } catch { throw new Problem(400, 'The request must be JSON.'); }+}+function revision(project) { return createHash('sha256').update(JSON.stringify(project)).digest('hex').slice(0,16); }+async function optionalJSON(root, path, fallback) {+ try { return await jsonFile(root, path); } catch (e) { if (e.code === 'ENOENT') return fallback; throw e; }+}++export async function createStudio({workspace, packageDir, port = 0, jobTimeout = 900000}) {+ workspace = await realpath(workspace);+ packageDir = await realpath(packageDir);+ const config = await jsonFile(packageDir, 'studio.config.json');+ let job = null;+ let child = null;+ let timer = null;+ const project = async () => jsonFile(workspace, 'studio.json');+ const readState = async () => {+ const p = await project();+ const result = await optionalJSON(workspace, 'out/latest.json', null);+ const history = [];+ let entries = [];+ try { entries = await readdir(await confined(workspace, 'out/runs')); } catch (e) { if (e.code !== 'ENOENT') throw e; }+ for (const id of entries.sort().reverse().slice(0,40)) {+ try {+ const r = await jsonFile(workspace, `out/runs/${id}/result.json`);+ history.push({id, title:r.title, engine:r.engine, createdAt:r.createdAt, metrics:r.metrics, action:r.action});+ } catch { /* An in-progress or damaged result never hides previous runs. */ }+ }+ return {config, project:p, revision:revision(p), result, history, job};+ };+ const endChild = () => {+ if (child) {+ try { process.kill(-child.pid, 'SIGTERM'); } catch { child.kill('SIGTERM'); }+ }+ };+ const server = http.createServer(async (req,res) => {+ const send = (status, data, type = 'application/json; charset=utf-8') => {+ res.writeHead(status, {'Content-Type':type, 'Cache-Control':'no-store', 'X-Content-Type-Options':'nosniff', 'Content-Security-Policy':"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; media-src 'self' blob:; connect-src 'self'; frame-ancestors 'self'"});+ res.end(type.startsWith('application/json') ? JSON.stringify(data) : data);+ };+ try {+ const expectedHost = `127.0.0.1:${server.address().port}`;+ if (req.headers.host !== expectedHost && req.headers.host !== `localhost:${server.address().port}`) throw new Problem(403, 'Open this studio on its local address.');+ if (req.headers.origin && req.headers.origin !== `http://${req.headers.host}`) throw new Problem(403, 'Requests must come from this studio.');+ const url = new URL(req.url, `http://${expectedHost}`);+ const path = decodeURIComponent(url.pathname);+ if (req.method === 'GET' && path === '/api/state') return send(200, await readState());+ if (req.method === 'GET' && path === '/api/run') {+ const id = url.searchParams.get('id');+ if (!/^[a-zA-Z0-9-]+$/.test(id ?? '')) throw new Problem(400, 'Choose a run from the history.');+ return send(200, await jsonFile(workspace, `out/runs/${id}/result.json`));+ }+ if (req.method === 'POST' && path === '/api/cancel') {+ if (!child) throw new Problem(409, 'There is no run to stop.');+ job = {...job, status:'cancelled', message:'Run stopped. Your last result is safe.'};+ endChild();+ return send(200, {ok:true});+ }+ if (req.method === 'POST' && path === '/api/run') {+ if (child) throw new Problem(409, 'A run is already in progress.');+ if (!req.headers['content-type']?.startsWith('application/json')) throw new Problem(415, 'Send studio controls as JSON.');+ const input = await body(req);+ const action = config.actions.find(a => a.id === input.action);+ if (!action) throw new Problem(400, 'Choose a studio action.');+ const p = await project();+ if (input.revision !== revision(p)) throw new Problem(409, 'The agent changed this project. Refresh to load its latest controls.');+ const parameters = validateParameters(config,input.parameters);+ await confined(workspace, 'studio.json');+ await writeFile(join(workspace,'studio.json'), JSON.stringify({...p,parameters},null,2)+'\n');+ const script = await confined(packageDir,'toolchain/run.sh');+ job = {status:'running', action:action.id, label:action.label, startedAt:new Date().toISOString(), message:'Preparing your run…', log:''};+ child = spawn(script, [action.id], {cwd:workspace, detached:true, env:{...process.env,HARNESS_WORKSPACE:workspace,HARNESS_DSH_DIR:packageDir},stdio:['ignore','pipe','pipe']});+ const handleOutput = data => {job.log = (job.log + data.toString()).slice(-6000); job.message = data.toString().trim().split('\n').at(-1).slice(0,240);};+ child.stdout.on('data',handleOutput); child.stderr.on('data',handleOutput);+ child.on('error', error => {job = {...job,status:'failed',message:error.message};});+ child.on('close', code => {+ clearTimeout(timer); timer = null; child = null;+ if (job.status === 'running') job = {...job,status:code === 0 ? 'done':'failed',message:code === 0 ? 'Your new result is ready.':`Run failed. ${job.message}`};+ });+ timer = setTimeout(() => {job = {...job,status:'failed',message:'This run reached its time limit. Your last result is safe.'}; endChild();},jobTimeout);+ return send(202,{ok:true});+ }+ if (req.method !== 'GET' && req.method !== 'HEAD') throw new Problem(405,'This action is not supported.');+ let root = UI, file = path === '/' ? 'index.html':path.slice(1);+ if (path === '/domain.mjs') {root = packageDir; file = 'view.mjs';}+ if (path.startsWith('/artifacts/')) {+ root = workspace; file = path.slice('/artifacts/'.length);+ if (!file.startsWith('out/')) throw new Problem(403, 'Only studio outputs can be downloaded.');+ }+ const target = await confined(root,file);+ const s = await stat(target);+ if (!s.isFile()) throw new Problem(404,'This file is not available.');+ if (s.size > 256*1024*1024) throw new Problem(413,'Open this large artifact from your workspace.');+ const type = TYPES[extname(target)] ?? 'application/octet-stream';+ if (url.searchParams.has('download')) res.setHeader('Content-Disposition',`attachment; filename="${target.split(sep).at(-1).replace(/[^a-zA-Z0-9._-]/g,'_')}"`);+ const data = req.method === 'HEAD' ? Buffer.alloc(0):await readFile(target);+ // JSON artifacts are already serialized bytes, unlike API responses.+ if (type === 'application/json') return send(200,JSON.parse(data.length ? data.toString():'null'));+ return send(200,data,type);+ } catch(error) {+ const status = error.status ?? (error.code === 'ENOENT' ? 404:500);+ return send(status,{error:status === 500 ? 'The studio could not read the project. Check studio.json and the latest result.':error.message});+ }+ });+ await new Promise((ok,fail) => {server.once('error',fail); server.listen(port,'127.0.0.1',ok);});+ return {server, url:`http://127.0.0.1:${server.address().port}`, close:async () => {clearTimeout(timer); endChild(); server.closeAllConnections(); await new Promise(ok => server.close(ok));}};+}++if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {+ const studio = await createStudio({workspace:process.env.HARNESS_WORKSPACE,packageDir:process.env.HARNESS_DSH_DIR,port:Number(process.env.HARNESS_VIEWER_PORT)});+ console.log(`Studio ready at ${studio.url}`);+ for (const signal of ['SIGTERM','SIGINT']) process.once(signal,async () => {await studio.close();process.exit(0);});+}diff --git a/store/viewers/studio-viewer/setup.sh b/store/viewers/studio-viewer/setup.shnew file mode 100755index 000000000..bc5f70fae--- /dev/null+++ b/store/viewers/studio-viewer/setup.sh@@ -0,0 +1,6 @@+#!/usr/bin/env bash+set -euo pipefail+cd "$(dirname "$0")"+. ./runtimes.sh+harness_node 22+exec ./doctor.shdiff --git a/store/viewers/studio-viewer/store.json b/store/viewers/studio-viewer/store.jsonnew file mode 100644index 000000000..891e0b1e4--- /dev/null+++ b/store/viewers/studio-viewer/store.json@@ -0,0 +1,5 @@+{+ "homepage": "https://github.com/autonomous-ai/openharness",+ "license": "MIT",+ "screenshots": []+}diff --git a/store/viewers/studio-viewer/test/viewer.test.mjs b/store/viewers/studio-viewer/test/viewer.test.mjsnew file mode 100644index 000000000..4f0e3e4d5--- /dev/null+++ b/store/viewers/studio-viewer/test/viewer.test.mjs@@ -0,0 +1,85 @@+import {test} from 'node:test';+import assert from 'node:assert/strict';+import {mkdtemp,mkdir,writeFile,readFile,symlink,rm,realpath} from 'node:fs/promises';+import http from 'node:http';+import {tmpdir} from 'node:os';+import {join} from 'node:path';+import {createStudio,confined,validateParameters} from '../server.mjs';++const config={title:'Test studio',controls:[{id:'speed',label:'Speed',type:'number',value:2,min:1,max:5,integer:true},{id:'mode',label:'Mode',type:'select',value:'a',options:[{value:'a'},{value:'b'}]},{id:'name',label:'Name',type:'text',value:'hello',maxLength:20}],actions:[{id:'run',label:'Make'}]};+const project={spec:1,parameters:{speed:2,mode:'a',name:'hello'}};+async function fixture(t,script='exit 0',jobTimeout=1000){+ const root=await realpath(await mkdtemp(join(tmpdir(),'studio-test-'))),workspace=join(root,'workspace'),packageDir=join(root,'package');+ await mkdir(workspace);await mkdir(join(packageDir,'toolchain'),{recursive:true});+ await writeFile(join(workspace,'studio.json'),JSON.stringify(project));+ await writeFile(join(packageDir,'studio.config.json'),JSON.stringify(config));+ await writeFile(join(packageDir,'view.mjs'),'export function mount(){}');+ await writeFile(join(packageDir,'toolchain/run.sh'),'#!/bin/sh\n'+script+'\n',{mode:0o755});+ const studio=await createStudio({workspace,packageDir,jobTimeout});+ t.after(async()=>{await studio.close();await rm(root,{recursive:true,force:true});});+ const req=async(path,body,headers={})=>{const r=await fetch(studio.url+path,body===undefined?{headers}:{method:'POST',headers:{'Content-Type':'application/json',...headers},body:typeof body==='string'?body:JSON.stringify(body)});return {status:r.status,type:r.headers.get('content-type'),data:await r.text()};};+ const state=async()=>JSON.parse((await req('/api/state')).data);+ const run=async(parameters=project.parameters)=>req('/api/run',{action:'run',parameters,revision:(await state()).revision});+ return {root,workspace,packageDir,studio,req,state,run};+}+async function until(get,predicate){for(let i=0;i<150;i++){const v=await get();if(predicate(v))return v;await new Promise(r=>setTimeout(r,10));}throw Error('condition timed out');}++test('controls reject invalid input, retain defaults, and enforce native types',()=>{+ assert.deepEqual(validateParameters(config,{}),project.parameters);+ for(const p of [null,[],2,{extra:1},{speed:NaN},{speed:'2'},{speed:0},{speed:1.2},{mode:'c'},{name:2},{name:'x'.repeat(21)}])assert.throws(()=>validateParameters(config,p),e=>e.status===400);+ assert.deepEqual(validateParameters(config,{speed:3,mode:'b',name:'there'}),{speed:3,mode:'b',name:'there'});+ const simple={controls:[{id:'v',label:'Value',type:'text',value:''}]};+ assert.throws(()=>validateParameters(simple,{v:'x'.repeat(501)}));+});+test('serves the complete local UI and only the installed domain module',async t=>{+ const f=await fixture(t);+ for(const path of ['/','/studio.css','/tokens.css','/studio.mjs','/graphics.mjs','/domain.mjs'])assert.equal((await f.req(path)).status,200,path);+ assert.equal((await f.req('/not-present')).status,404);+ assert.equal((await f.req('/%E0%A4%A')).status,500);+ const s=await f.state();assert.deepEqual(s.project,project);assert.deepEqual(s.history,[]);assert.equal(s.result,null);+ const head=await fetch(f.studio.url+'/',{method:'HEAD'});assert.equal(await head.text(),'');+});+test('rejects cross-site requests, unsupported methods, invalid JSON, unknown actions, and stale revisions',async t=>{+ const f=await fixture(t);+ assert.equal((await f.req('/api/run',{}, {Origin:'https://example.com'})).status,403);+ const wrongHost=await new Promise((ok,fail)=>{const r=http.get(f.studio.url,{headers:{Host:'evil.example'}},res=>{res.resume();res.on('end',()=>ok(res.statusCode));});r.on('error',fail);});+ assert.equal(wrongHost,403);+ assert.equal((await f.req('/api/run','abc')).status,400);+ assert.equal((await f.req('/api/run','x'.repeat(17000))).status,413);+ assert.equal((await f.req('/api/run',{}, {'Content-Type':'text/plain'})).status,415);+ assert.equal((await f.req('/api/run',{action:'bad'})).status,400);+ assert.equal((await f.req('/api/run',{action:'run',revision:'old'})).status,409);+ assert.equal((await f.req('/unknown',{})).status,405);+ assert.equal((await f.req('/api/cancel',{})).status,409);+});+test('runs one fixed command, persists controls, reports output, and permits reruns',async t=>{+ const f=await fixture(t,'echo rendering; sleep 0.1; echo finished');+ assert.equal((await f.run({...project.parameters,speed:4})).status,202);+ assert.equal((await f.run()).status,409);+ const done=await until(f.state,s=>s.job.status==='done');assert.match(done.job.log,/rendering/);assert.match(done.job.log,/finished/);assert.equal(done.project.parameters.speed,4);+ assert.equal((await f.run()).status,202);await until(f.state,s=>s.job.status==='done');+});+test('failed, cancelled, and timed-out jobs retain the previous artifact',async t=>{+ for(const [script,timeout,expected] of [['echo oh-no >&2; exit 2',1000,'failed'],['sleep 10',20,'failed'],['sleep 10',1000,'cancelled']]){+ const f=await fixture(t,script,timeout);await mkdir(join(f.workspace,'out'));await writeFile(join(f.workspace,'out/latest.json'),'{}');+ assert.equal((await f.run()).status,202);+ if(expected==='cancelled')assert.equal((await f.req('/api/cancel',{})).status,200);+ const s=await until(f.state,s=>s.job.status===expected);assert.deepEqual(s.result,{});+ }+});+test('records successful history, reads chosen runs, ignores incomplete results',async t=>{+ const f=await fixture(t);await mkdir(join(f.workspace,'out/runs/first'),{recursive:true});await mkdir(join(f.workspace,'out/runs/incomplete'));await mkdir(join(f.workspace,'out/runs/broken'));+ await writeFile(join(f.workspace,'out/runs/first/result.json'),JSON.stringify({id:'first',title:'My run',metrics:[],engine:'actual'}));await writeFile(join(f.workspace,'out/runs/broken/result.json'),'not json');+ assert.equal((await f.state()).history.length,1);assert.equal((await f.req('/api/run?id=first')).status,200);assert.equal((await f.req('/api/run?id=../studio')).status,400);assert.equal((await f.req('/api/run?id=missing')).status,404);+});+test('confines files after symlink resolution and serves artifact downloads',async t=>{+ const f=await fixture(t);await mkdir(join(f.workspace,'out'));await writeFile(join(f.root,'secret.txt'),'private');await symlink(join(f.root,'secret.txt'),join(f.workspace,'out/escape.txt'));+ await writeFile(join(f.workspace,'out/sound.wav'),'RIFF');await writeFile(join(f.workspace,'out/data.json'),'{}');await writeFile(join(f.workspace,'out/unknown.xyz'),'hello');+ assert.equal((await f.req('/artifacts/out/escape.txt')).status,403);assert.equal((await f.req('/artifacts/studio.json')).status,403);assert.equal((await f.req('/artifacts/out')).status,403);assert.equal((await f.req('/artifacts/out/')).status,404);+ for(const name of ['sound.wav','data.json','unknown.xyz'])assert.equal((await f.req('/artifacts/out/'+name)).status,200);+ const r=await fetch(f.studio.url+'/artifacts/out/sound.wav?download');assert.match(r.headers.get('content-disposition'),/attachment/);assert.equal(await r.text(),'RIFF');+ assert.equal(await confined(f.workspace,'.'),f.workspace);await assert.rejects(confined(f.workspace,'../secret.txt'),e=>e.status===403);+});+test('rejects oversized and malformed state without disclosing filesystem paths',async t=>{+ const f=await fixture(t);await writeFile(join(f.workspace,'studio.json'),'x'.repeat(8*1024*1024+1));assert.equal((await f.req('/api/state')).status,413);await writeFile(join(f.workspace,'studio.json'),'broken');const r=await f.req('/api/state');assert.equal(r.status,500);assert.ok(!r.data.includes(f.workspace));+});diff --git a/store/viewers/studio-viewer/viewer.sh b/store/viewers/studio-viewer/viewer.shnew file mode 100755index 000000000..b4e181dc8--- /dev/null+++ b/store/viewers/studio-viewer/viewer.sh@@ -0,0 +1,6 @@+#!/usr/bin/env bash+set -euo pipefail+cd "$(dirname "$0")"+. ./runtimes.sh+harness_node 22+exec node server.mjsdiff --git a/store/viewers/studio-viewer/web/graphics.mjs b/store/viewers/studio-viewer/web/graphics.mjsnew file mode 100644index 000000000..044fc4cc4--- /dev/null+++ b/store/viewers/studio-viewer/web/graphics.mjs@@ -0,0 +1,17 @@+export function el(tag, text, className){const node=document.createElement(tag);if(text!==undefined)node.textContent=text;if(className)node.className=className;return node;}+export function toolbar(stage, buttons){const bar=el('div','','domain-toolbar');for(const [label,click] of buttons){const b=el('button',label);b.type='button';b.addEventListener('click',()=>click(b));bar.append(b);}stage.append(bar);return bar;}+export function badge(stage,text){const n=el('span',text,'domain-badge');stage.append(n);return n;}+export function label(stage,text){const n=el('div',text,'domain-label');stage.append(n);return n;}+export function canvas(stage, draw, signal){+ const c=el('canvas');c.setAttribute('role','img');stage.append(c);const ctx=c.getContext('2d');let animate=true,raf,frame=0;+ const paint=t=>{const box=c.getBoundingClientRect(),dpr=Math.min(devicePixelRatio||1,2);if(c.width!==Math.round(box.width*dpr)||c.height!==Math.round(box.height*dpr)){c.width=Math.round(box.width*dpr);c.height=Math.round(box.height*dpr);}ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,box.width,box.height);if(animate&&!document.hidden)frame=t/1000;draw(ctx,box.width,box.height,frame);raf=requestAnimationFrame(paint);};raf=requestAnimationFrame(paint);signal.addEventListener('abort',()=>cancelAnimationFrame(raf));return {element:c,motion:value=>{animate=value;}};+}+export function grid(ctx,w,h,spacing=32){ctx.strokeStyle='#ffffff0a';ctx.lineWidth=1;for(let x=0;x<w;x+=spacing){ctx.beginPath();ctx.moveTo(x,0);ctx.lineTo(x,h);ctx.stroke();}for(let y=0;y<h;y+=spacing){ctx.beginPath();ctx.moveTo(0,y);ctx.lineTo(w,y);ctx.stroke();}}+export function round(ctx,x,y,w,h,r,fill,stroke){ctx.beginPath();ctx.roundRect(x,y,w,h,r);if(fill){ctx.fillStyle=fill;ctx.fill();}if(stroke){ctx.strokeStyle=stroke;ctx.stroke();}}+export function line(ctx,points,color,width=2){ctx.strokeStyle=color;ctx.lineWidth=width;ctx.beginPath();points.forEach(([x,y],i)=>i?ctx.lineTo(x,y):ctx.moveTo(x,y));ctx.stroke();}+export function circle(ctx,x,y,r,color){ctx.fillStyle=color;ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fill();}+export function words(ctx,text,x,y,color='#c5d7c2',size=11){ctx.fillStyle=color;ctx.font=`${size}px -apple-system, sans-serif`;ctx.fillText(text,x,y);}+let audio;+export async function tone(frequency,seconds=.3,type='sine',gain=.12){+ audio??=new AudioContext();await audio.resume();const osc=audio.createOscillator(),amp=audio.createGain();osc.type=type;osc.frequency.value=frequency;osc.connect(amp);amp.connect(audio.destination);const now=audio.currentTime;amp.gain.setValueAtTime(0,now);amp.gain.linearRampToValueAtTime(gain,now+.02);amp.gain.exponentialRampToValueAtTime(.001,now+seconds);osc.start();osc.stop(now+seconds+.02);+}diff --git a/store/viewers/studio-viewer/web/index.html b/store/viewers/studio-viewer/web/index.htmlnew file mode 100644index 000000000..1264d5ba7--- /dev/null+++ b/store/viewers/studio-viewer/web/index.html@@ -0,0 +1,28 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8">+ <meta name="viewport" content="width=device-width,initial-scale=1">+ <title>Harness Studio</title>+ <link rel="stylesheet" href="/studio.css">+</head>+<body>+ <main id="app" aria-busy="true">+ <header class="topbar"><a class="wordmark" href="/" aria-label="Reload studio"><span class="mark">h</span> HARNESS <span class="muted">/ STUDIO</span></a><span id="connection" class="connection">Connecting</span></header>+ <section class="heading"><div><p class="eyebrow" id="category">MAKE SOMETHING GOOD</p><h1 id="title">Opening your studio…</h1><p id="description" class="description">Your workspace will appear here.</p></div><div class="heading-actions"><button id="reset" class="quiet">Reset controls</button><button id="run" class="primary" disabled>Run</button></div></section>+ <div id="notice" class="notice" role="status" hidden></div>+ <div id="remote" class="notice" hidden>The agent saved new controls. <button id="refresh">Load update</button></div>+ <section class="workspace">+ <div class="canvas-column">+ <div class="stage-frame"><div class="stage-heading"><span id="scene-label">WORKBENCH</span><button id="motion" class="icon-button" aria-pressed="true">Pause motion</button></div><div id="stage" class="stage" aria-label="Interactive workbench"></div><div class="stage-caption"><span id="hint">Explore. Adjust. Make it yours.</span><span id="provenance">Waiting for a run</span></div></div>+ <div class="metrics" id="metrics" aria-label="Run measurements"></div>+ <section class="result-panel"><div class="panel-heading"><h2 id="result-title">Your next idea starts here</h2><span id="run-time" class="muted"></span></div><p id="result-description" class="muted">Adjust the controls, then make your first run.</p><div id="artifacts" class="artifacts"></div><details id="job-details" hidden><summary>Run details</summary><pre id="log"></pre></details></section>+ </div>+ <aside class="inspector" aria-label="Studio controls"><div class="panel-heading"><h2>Make it yours</h2><span id="dirty" class="small-label">SAVED</span></div><form id="controls"></form><div id="extra-actions" class="extra-actions"></div><div class="tip"><span class="spark">✳</span><p id="tip">Every run is saved. Follow a hunch.</p></div><section class="history-section"><div class="panel-heading"><h2>Recent explorations</h2><button id="latest" class="text-button" hidden>Back to latest</button></div><ol id="history" class="history"></ol></section></aside>+ </section>+ <footer><span id="credit"></span><span>Made with curiosity.</span></footer>+ </main>+ <div id="announcement" class="sr-only" aria-live="polite"></div>+ <script type="module" src="/studio.mjs"></script>+</body>+</html>diff --git a/store/viewers/studio-viewer/web/studio.css b/store/viewers/studio-viewer/web/studio.cssnew file mode 100644index 000000000..1ea8475f0--- /dev/null+++ b/store/viewers/studio-viewer/web/studio.css@@ -0,0 +1,6 @@+@import url('/tokens.css');+*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:4px}a{color:inherit}button{border:1px solid var(--line);border-radius:9px;padding:9px 13px;background:transparent;color:inherit;transition:background .15s,transform .15s}button:hover:enabled{background:var(--hover)}button:active:enabled{transform:translateY(1px)}[hidden]{display:none!important}#app{max-width:1600px;padding:0 30px;margin:auto}.topbar{height:66px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.wordmark{text-decoration:none;font-size:10px;font-weight:750;letter-spacing:2px;display:flex;gap:9px;align-items:center}.mark{display:grid;place-items:center;width:24px;height:24px;background:var(--ink);color:var(--paper);border-radius:7px;font:italic 24px Georgia;letter-spacing:0}.muted{color:var(--muted)}.connection{font-size:11px;display:flex;align-items:center;gap:7px}.connection:before{content:"";width:6px;height:6px;background:var(--accent);border-radius:100%}.heading{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px 0 24px}.eyebrow{font-size:9px;letter-spacing:2px;font-weight:750;color:var(--accent);margin:0 0 7px}h1{font-size:34px;line-height:1.12;letter-spacing:-1.2px;margin:0;font-weight:650}.description{color:var(--muted);max-width:640px;margin:9px 0 0;font-size:13px}.heading-actions{display:flex;align-items:center;gap:9px;flex-shrink:0}.primary{background:var(--accent);border-color:var(--accent);color:white;box-shadow:0 3px 7px #0000000d;white-space:nowrap;font-weight:650}.primary:hover:enabled{background:var(--accent);filter:brightness(1.08)}.quiet{border-color:transparent;color:var(--muted);font-size:12px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 264px;gap:24px}.canvas-column{min-width:0}.stage-frame{border-radius:16px;background:var(--stage);color:var(--stage-ink);overflow:hidden;box-shadow:0 4px 16px #00000008}.stage-heading{display:flex;justify-content:space-between;align-items:center;padding:15px 20px;font-size:9px;letter-spacing:1.7px;font-weight:600}.icon-button{font-size:10px;color:inherit;border-color:#ffffff24;padding:5px 8px;letter-spacing:0}.icon-button:hover:enabled{background:#ffffff15}.stage{position:relative;min-height:370px;isolation:isolate}.stage svg{display:block;width:100%;height:auto}.stage canvas{display:block;width:100%;height:370px}.stage-caption{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:12px 20px;font-size:10px;color:#b2bcb9;border-top:1px solid #ffffff14}.stage-caption span:last-child{text-align:right;color:var(--stage-accent)}.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:15px 0}.metric{padding:17px;background:var(--card);border:1px solid var(--line);border-radius:12px}.metric-label{font-size:10px;color:var(--muted)}.metric-value{display:block;font-size:23px;letter-spacing:-.6px;margin-top:4px}.metric-unit{font-size:11px;color:var(--muted);margin-left:5px;letter-spacing:0}.metric-label:before{content:"";display:inline-block;background:var(--accent);width:5px;height:5px;border-radius:50%;margin:0 6px 1px 0}.result-panel{padding:16px 2px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}h2{font-size:12px;font-weight:650;letter-spacing:-.15px;margin:0}.panel-heading .muted{font-size:10px}.result-panel>p{font-size:12px;margin:7px 0 14px}.artifacts{display:flex;flex-wrap:wrap;gap:8px}.artifact{display:inline-flex;align-items:center;gap:7px;text-decoration:none;border:1px solid var(--line);padding:7px 10px;background:var(--card);border-radius:8px;font-size:11px}.artifact:hover{border-color:var(--accent)}.inspector{border-left:1px solid var(--line);padding-left:24px}.small-label{font-size:8px;letter-spacing:1px;color:var(--muted)}#controls{margin:23px 0 10px}.control{display:block;margin-bottom:22px}.control-head{display:flex;justify-content:space-between;align-items:center;margin:0 0 9px;font-size:11px;font-weight:550}.control output{font-variant-numeric:tabular-nums;color:var(--accent);font-size:11px}.control input[type=range]{width:100%;accent-color:var(--accent);display:block;height:5px;cursor:ew-resize;margin:12px 0}.control select,.control input[type=text]{background:var(--card);border:1px solid var(--line);border-radius:8px;width:100%;padding:9px 10px;color:var(--ink);font-size:12px}.control small{display:block;color:var(--muted);font-size:10px;margin-top:6px}.extra-actions{display:flex;gap:8px;flex-direction:column}.extra-actions button{text-align:left;font-size:11px}.extra-actions button:before{content:'↗';margin-right:8px;color:var(--accent)}.tip{display:flex;gap:10px;background:var(--tint);padding:13px;border-radius:10px;margin:20px 0 27px}.spark{color:var(--accent);font-size:19px}.tip p{font-size:11px;margin:1px 0;color:var(--muted)}.history{list-style:none;margin:14px 0 0;padding:0}.history button{display:flex;align-items:center;width:100%;gap:10px;border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left;padding:12px 0;font-size:11px}.history button:hover:enabled{background:transparent;color:var(--accent)}.history button[aria-current=true]{color:var(--accent)}.history-dot{width:7px;height:7px;background:var(--accent);border-radius:50%;flex-shrink:0}.history-content{flex:1;min-width:0}.history-title{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-time{display:block;font-size:9px;color:var(--muted);margin-top:3px}.history-value{font-size:11px;font-variant-numeric:tabular-nums}.text-button{border:0;font-size:10px;padding:0;color:var(--accent)}.notice{border:1px solid var(--line);border-left:3px solid var(--accent);padding:11px 14px;margin-bottom:16px;background:var(--card);font-size:12px;border-radius:6px}.notice.error{border-left-color:#b84636;color:#8b382d}footer{border-top:1px solid var(--line);margin-top:30px;padding:16px 0;display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:9px}pre{white-space:pre-wrap;word-break:break-word;max-height:160px;overflow:auto;font:11px/1.5 ui-monospace,monospace;background:var(--card);padding:12px;border-radius:8px}summary{font-size:11px;color:var(--muted);cursor:pointer;margin-top:15px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.domain-toolbar{position:absolute;z-index:2;bottom:17px;left:20px;right:20px;display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.domain-toolbar button{background:#ffffff10;border-color:#ffffff2e;color:var(--stage-ink);font-size:11px;padding:7px 12px}.domain-toolbar button:hover{background:#ffffff20}.domain-toolbar button[aria-pressed=true]{background:var(--stage-accent);color:var(--stage);border-color:transparent}.domain-label{position:absolute;z-index:1;left:22px;top:5px;max-width:70%;font-size:11px;color:#b6c5bd}.domain-badge{position:absolute;top:8px;right:20px;font-size:9px;letter-spacing:1px;border:1px solid #ffffff20;border-radius:20px;padding:5px 9px;color:var(--stage-accent)}.domain-readout{position:absolute;left:24px;bottom:70px;font-size:12px;color:var(--stage-accent)}.domain-readout strong{display:block;font-size:32px;font-weight:500;color:var(--stage-ink)}.keyboard{position:absolute;bottom:66px;left:12%;right:12%;height:95px;display:flex;gap:3px}.key{flex:1;background:#f6f0df;border:0;border-radius:0 0 7px 7px;color:#706856;display:flex;justify-content:center;align-items:end;padding-bottom:10px;font-size:10px;box-shadow:inset 0 -5px #ddd5bd}.key:hover:enabled,.key[aria-pressed=true]{background:var(--stage-accent);transform:translateY(2px)}.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;padding:18px 25px 75px}.gallery button{padding:0;overflow:hidden;border:1px solid #ffffff24;border-radius:12px;background:#ffffff07}.gallery img{width:100%;height:145px;object-fit:cover;display:block}.gallery figcaption{padding:7px 10px;color:var(--stage-ink);font-size:10px;text-align:left}.gallery button[aria-pressed=true]{outline:2px solid var(--stage-accent);outline-offset:3px}.domain-dialog{position:absolute;inset:20px;background:var(--stage);border:1px solid #ffffff40;border-radius:14px;padding:20px;z-index:5;overflow:auto}.domain-dialog img{width:100%;max-height:280px;object-fit:contain}.domain-dialog button{float:right;color:var(--stage-ink)}.domain-empty{display:grid;place-items:center;min-height:300px;color:var(--stage-accent);font-size:13px;text-align:center;padding:35px}.chart-tooltip{position:absolute;top:12px;left:24px;font-size:11px;color:var(--stage-accent)}.row-buttons{display:flex;gap:7px}.comparison{color:var(--accent);font-size:11px;padding:10px 0}+@media(min-width:1300px){.stage canvas{height:450px}.stage{min-height:450px}.workspace{grid-template-columns:minmax(0,1fr) 285px}}+@media(max-width:850px){#app{padding:0 19px}.workspace{gap:17px;grid-template-columns:minmax(0,1fr) 215px}.inspector{padding-left:17px}h1{font-size:28px}.heading{gap:12px}.heading-actions{flex-direction:column-reverse;align-items:flex-end}.stage-caption{align-items:start;font-size:9px;padding:11px 15px}.metrics{gap:8px}.metric{padding:12px}.metric-value{font-size:21px}}+@media(max-width:620px){#app{padding:0 15px}.topbar{height:52px}.wordmark{font-size:9px;letter-spacing:1px}.heading{padding:23px 0 20px;align-items:flex-start}.heading-actions .quiet{display:none}.heading-actions .primary{font-size:11px;padding:9px 10px;margin-top:21px}.description{font-size:11px}h1{font-size:27px}.eyebrow{font-size:8px}.workspace{grid-template-columns:1fr}.inspector{border-left:0;border-top:1px solid var(--line);padding:20px 0 0}#controls{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.stage{min-height:310px}.stage canvas{height:310px}.stage-heading{padding:12px 15px}.stage-caption{flex-direction:column;gap:4px}.stage-caption span:last-child{text-align:left}.tip{margin:15px 0 20px}.history-section{margin-top:20px}.gallery{padding:20px 15px 80px}.gallery img{height:110px}.keyboard{left:8%;right:8%}.metrics{margin:12px 0}.metric-label{font-size:9px}.metric-value{font-size:20px}.metric-unit{font-size:9px}.metric-label:before{display:none}footer{margin-top:20px}.domain-readout strong{font-size:26px}}+@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}diff --git a/store/viewers/studio-viewer/web/studio.mjs b/store/viewers/studio-viewer/web/studio.mjsnew file mode 100644index 000000000..aa1b91ba4--- /dev/null+++ b/store/viewers/studio-viewer/web/studio.mjs@@ -0,0 +1,73 @@+const $ = id => document.getElementById(id);+const text = (tag, value, className) => {const e=document.createElement(tag);e.textContent=value;if(className)e.className=className;return e;};+let state, parameters, domain, dirty=false, selected=null, motion=!matchMedia('(prefers-reduced-motion: reduce)').matches, lastResult='', pending=false;+const abort = new AbortController();+const artifactURL = path => '/artifacts/'+path.split('/').map(encodeURIComponent).join('/');+const announce = message => {$('announcement').textContent=message;};+function notice(message, error=false) {$('notice').textContent=message;$('notice').hidden=!message;$('notice').classList.toggle('error',error);}+async function api(path, body) {const r=await fetch(path,body ? {method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}:{});const v=await r.json();if(!r.ok)throw Error(v.error);return v;}+function setParameter(id,value) {+ parameters[id]=value;dirty=true;$('dirty').textContent='UNSAVED';+ const input=document.querySelector(`[name="${CSS.escape(id)}"]`);if(input){input.value=value;input.dispatchEvent(new Event('studio-value'));}+ domain?.update(parameters,selected??state.result,motion);+}+function controls(config) {+ $('controls').replaceChildren();+ for(const c of config.controls){+ const label=text('label','', 'control'), head=text('span','', 'control-head'), caption=text('span',c.label), output=text('output','');+ let input;+ if(c.type==='select'){input=document.createElement('select');for(const o of c.options){const opt=text('option',o.label);opt.value=o.value;input.append(opt);}}+ else{input=document.createElement('input');input.type=c.type==='number'?'range':'text';if(c.type==='number'){input.min=c.min;input.max=c.max;input.step=c.step??1;}else input.maxLength=c.maxLength??500;}+ input.name=c.id;input.id=`control-${c.id}`;input.value=parameters[c.id];label.htmlFor=input.id;+ const update=()=>{output.value=c.type==='number'?`${input.value}${c.unit?' '+c.unit:''}`:'';};update();input.addEventListener('studio-value',update);+ input.addEventListener('input',()=>{update();setParameter(c.id,c.type==='number'?Number(input.value):input.value);});+ head.append(caption,output);label.append(head,input);if(c.hint)label.append(text('small',c.hint));$('controls').append(label);+ }+}+function renderResult(result){+ $('metrics').replaceChildren();$('artifacts').replaceChildren();+ for(const m of result?.metrics??[]){const card=text('div','', 'metric'),label=text('span',m.label,'metric-label'),value=text('span',String(m.value),'metric-value');if(m.unit)value.append(text('span',m.unit,'metric-unit'));card.append(label,value);$('metrics').append(card);}+ $('result-title').textContent=result?.title??'Your next idea starts here';$('result-description').textContent=result?.description??state.config.empty;+ $('provenance').textContent=result?.engine??state.config.previewLabel;+ $('run-time').textContent=result?new Date(result.createdAt).toLocaleTimeString([],{hour:'2-digit',minute:'2-digit'}):'';+ for(const a of result?.artifacts??[]){const link=text('a',`↓ ${a.label}`,'artifact');link.href=artifactURL(a.path)+'?download';link.download='';$('artifacts').append(link);}+ domain?.update(parameters,result,motion);+}+function renderHistory(){+ $('history').replaceChildren();+ for(const r of state.history){const item=document.createElement('li'),button=document.createElement('button');button.type='button';button.setAttribute('aria-current',String(selected?.id===r.id));const content=text('span','', 'history-content');content.append(text('span',r.title,'history-title'),text('span',`${r.engine} · ${new Date(r.createdAt).toLocaleTimeString([],{hour:'2-digit',minute:'2-digit'})}`,'history-time'));button.append(text('span','','history-dot'),content);if(r.metrics?.[0])button.append(text('span',r.metrics[0].value,'history-value'));button.addEventListener('click',async()=>{try{selected=await api(`/api/run?id=${encodeURIComponent(r.id)}`);$('latest').hidden=false;renderResult(selected);renderHistory();announce(`Viewing ${r.title}`);}catch(e){notice(e.message,true);}});item.append(button);$('history').append(item);}+ if(!state.history.length)$('history').append(text('li','Your first run will live here.','muted'));+}+async function run(action){+ if(pending)return;+ pending=true;notice('');$('run').disabled=true;+ try{await api('/api/run',{action,parameters,revision:state.revision});dirty=false;selected=null;await refresh();announce('Run started.');}catch(e){notice(e.message,true);}finally{pending=false;$('run').disabled=state?.job?.status==='running';}+}+async function refresh(){+ try{+ const next=await api('/api/state');+ const changed=state&&next.revision!==state.revision;+ if(!state){state=next;parameters={...state.project.parameters};const c=state.config;document.title=c.title+' · Harness';$('title').textContent=c.title;$('description').textContent=c.description;$('category').textContent=c.category.toUpperCase();$('scene-label').textContent=c.scene.toUpperCase();$('hint').textContent=c.hint;$('tip').textContent=c.tip;$('credit').textContent=c.credit;$('run').textContent=c.actions[0].label;for(const [key,value] of Object.entries(c.theme??{}))document.documentElement.style.setProperty('--'+key,value);controls(c);for(const a of c.actions.slice(1)){const b=text('button',a.label);b.type='button';b.title=a.description??a.label;b.addEventListener('click',()=>run(a.id));$('extra-actions').append(b);}const module=await import('/domain.mjs');domain=module.mount($('stage'),{getParameters:()=>parameters,setParameter,announce,artifactURL,signal:abort.signal,run:()=>run(c.actions[0].id)});}+ state=next;+ if(changed&&dirty){$('remote').hidden=false;}else if(changed){parameters={...state.project.parameters};controls(state.config);$('remote').hidden=true;}+ $('connection').textContent='Workspace connected';$('app').setAttribute('aria-busy','false');+ $('dirty').textContent=dirty?'UNSAVED':'SAVED';+ const running=state.job?.status==='running';$('run').disabled=running||pending;+ $('job-details').hidden=!state.job;$('log').textContent=state.job?.log??'';+ if(state.job?.status==='failed')notice(state.job.message,true);+ else if(running){notice(state.job.message);if(!$('cancel')){const b=text('button','Stop run');b.id='cancel';b.addEventListener('click',async()=>{try{await api('/api/cancel',{});await refresh();}catch(e){notice(e.message,true);}});$('notice').append(' ',b);}}+ else if(state.job?.status==='cancelled')notice(state.job.message);+ else if(state.job?.status==='done')notice('');+ const stamp=state.result?.id??'';+ if(stamp!==lastResult||changed||!lastResult){lastResult=stamp;renderResult(selected??state.result);renderHistory();}+ }catch(e){$('connection').textContent='Reconnecting';notice(e.message,true);}+}+$('run').addEventListener('click',()=>run(state.config.actions[0].id));+$('controls').addEventListener('submit',e=>e.preventDefault());+$('reset').addEventListener('click',()=>{for(const c of state.config.controls)setParameter(c.id,c.value);notice('Controls reset. Run to save a new exploration.');});+$('refresh').addEventListener('click',()=>{parameters={...state.project.parameters};dirty=false;controls(state.config);$('remote').hidden=true;$('dirty').textContent='SAVED';domain.update(parameters,selected??state.result,motion);});+$('latest').addEventListener('click',()=>{selected=null;$('latest').hidden=true;renderResult(state.result);renderHistory();});+$('motion').addEventListener('click',()=>{motion=!motion;setMotion();});+function setMotion(){$('motion').setAttribute('aria-pressed',String(motion));$('motion').textContent=motion?'Pause motion':'Resume motion';domain?.update(parameters,selected??state?.result,motion);}+setMotion();await refresh();const poll=setInterval(refresh,1200);+window.addEventListener('pagehide',()=>{clearInterval(poll);abort.abort();domain?.destroy?.();},{once:true});diff --git a/store/viewers/studio-viewer/web/tokens.css b/store/viewers/studio-viewer/web/tokens.cssnew file mode 100644index 000000000..f2d604455--- /dev/null+++ b/store/viewers/studio-viewer/web/tokens.css@@ -0,0 +1 @@+:root{--paper:#f3f2ec;--card:#faf9f5;--ink:#232b25;--muted:#7b8178;--line:#dbdfd3;--hover:#e6eadf;--accent:#47764e;--tint:#e7ecdf;--stage:#18271f;--stage-ink:#eef3df;--stage-accent:#bcdf8d}