### Install Playwright browsers and system dependencies Source: https://github.com/hew3d/hew/blob/main/app/e2e/README.md First-time setup on a machine: fetches browser binaries and system dependencies (requires sudo). For binaries only without sudo, use the alternative command. ```bash pnpm --dir app e2e:install ``` ```bash pnpm --dir app exec playwright install chromium webkit ``` -------------------------------- ### Start services with podman compose Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Use `podman compose up -d` to start the same compose file as Docker, including the `sed` rewrite of `relay.conf`. ```sh podman compose up -d ``` -------------------------------- ### Install from a mirror using var_release_base Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Points the installer at an HTTP directory laid out like a release (hew-web-vX.Y.Z.tar.gz, hew-relay-vX.Y.Z-linux-.tar.gz, and a latest text file). Persisted inside the container so --update and the weekly timer keep using it. ```sh var_release_base=http://192.168.1.50:8000 ./hew-web.sh ``` -------------------------------- ### Install the relay binary and unit Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Install the hew-relay binary to /usr/local/bin and the systemd unit to /etc/systemd/system, then clean up temporary files. ```sh sudo install -m 755 /tmp/hew-relay/hew-relay /usr/local/bin/hew-relay sudo install -m 644 /tmp/hew-relay/hew-relay.service /etc/systemd/system/hew-relay.service rm -rf /tmp/hew-relay /tmp/hew-relay.tar.gz ``` -------------------------------- ### Install dependencies Source: https://github.com/hew3d/hew/blob/main/workers/bug-intake/README.md Run from the workers/bug-intake directory to install required npm packages. ```sh cd workers/bug-intake && npm install ``` -------------------------------- ### Start Quadlet services and enable linger Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Reload systemd, start the pod service, and enable linger so the user service runs without a login session. ```sh systemctl --user daemon-reload systemctl --user start hew-pod.service loginctl enable-linger "$USER" # lets the user service run without a login session ``` -------------------------------- ### One-time host setup (Linux): install WebKitWebDriver, xvfb, and tauri-driver Source: https://github.com/hew3d/hew/blob/main/shells/tauri/e2e/README.md Install the native WebDriver and virtual display required for headless testing. The package name varies by distribution; both ship the same /usr/bin/WebKitWebDriver binary. tauri-driver installs into ~/.cargo/bin without sudo. ```bash # WebKitWebDriver — the native driver tauri-driver delegates to (needs sudo). # The package was renamed; both ship the same /usr/bin/WebKitWebDriver binary: sudo apt-get install -y webkitgtk-webdriver # newer Ubuntu # sudo apt-get install -y webkit2gtk-driver # Debian / older Ubuntu # A headless session also needs a virtual display: sudo apt-get install -y xvfb # tauri-driver itself (no sudo; installs into ~/.cargo/bin): cargo install tauri-driver --locked ``` -------------------------------- ### Verify installation Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Check that the Content-Security-Policy and X-Content-Type-Options headers are present on the response. ```sh curl -sI http:/// | grep -i "content-security-policy\|x-content-type" ``` -------------------------------- ### Run the app in a browser Source: https://github.com/hew3d/hew/blob/main/README.md Starts the development server for the web app. ```sh pnpm --dir app dev ``` -------------------------------- ### Install nginx Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Install nginx and curl on Debian/Ubuntu. Adjust package manager commands for other distros. ```sh sudo apt update sudo apt install -y nginx curl ``` -------------------------------- ### hew.guide.angular Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Creates an angular guide. This is a Standard command in the hew.guide namespace. ```APIDOC ## hew.guide.angular ### Description Creates an angular guide. ### Namespace `hew.guide` ### Command `angular` ### Tier Standard ``` -------------------------------- ### hew.guide.line Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Creates a line guide. This is a Standard command in the hew.guide namespace. ```APIDOC ## hew.guide.line ### Description Creates a line guide. ### Namespace `hew.guide` ### Command `line` ### Tier Standard ``` -------------------------------- ### Install Hew via Homebrew tap Source: https://github.com/hew3d/hew/blob/main/CHANGELOG.md Installs the Hew app and puts hew-cli on the PATH on macOS. ```bash brew install --cask hew3d/tap/hew ``` -------------------------------- ### Run the desktop shell Source: https://github.com/hew3d/hew/blob/main/README.md Starts the Tauri desktop shell in development mode. ```sh pnpm --dir shells/tauri dev ``` -------------------------------- ### Manifest JSON structure with all arrays and versioned fields Source: https://github.com/hew3d/hew/blob/main/docs/dev/HEW_FILE_FORMAT.md Complete example of the manifest.json object. All arrays are emitted in ascending dense-id order (array index equals the entry's own id field). Field comments indicate version requirements and optionality, e.g. 'attrs' is v14+ and omitted when empty, 'faceless' is v21+ optional, 'owner' is v13+ optional, 'owner_object' is v17+ optional, 'owner_group' is v19+ optional, 'tags' on sketches is v20+ optional, 'tags' on guides is v21+ optional, 'from'/'to' on line guides is v22+ optional, 'camera' is v13+ and omitted if never saved, 'axes' is v13+ and omitted at world identity, 'section_plane' is v16+ and omitted when no plane is placed, 'scenes' is v16+ and omitted when empty. ```jsonc { "format_version": 22, "geometry_version": 8, "app": "hew", "app_version": "1.2.1", "materials": [ { "id": 0, "sid": 0, "name": "Red", "color": [220, 50, 40, 255], "texture": { // omitted entirely for a flat-color material "asset": "textures/tex_0.png", "format": "png", // "png" | "jpg" "world_size": [1.0, 1.0] // meters per image tile [width, height], both > 0 } } ], "objects": [ { "id": 0, "sid": 1, "geometry": "geometry/obj_0.bin", "base_material": 0, "name": "Counter_Base", "tags": [["Architecture", "Walls"], ["Level", "L1"]], "attrs": { // v14+; omitted entirely when empty "com.example.shelving": { "part_no": "SHLF-204", "load_kg": 35.5 } } } ], "groups": [ { "id": 0, "sid": 4, "members": [ {"kind":"object","id":0}, {"kind":"group","id":1} ], "name": "MyGroup", "tags": [["Architecture"]] } ], "components": [ { "id": 0, "sid": 5, "name": "MyComponent", "members": [ {"kind":"object","id":2}, {"kind":"object","id":3}, {"kind":"instance","id":1} ] } // NodeRefs at v15+; bare // object ids at v14- ], "instances": [ { "id": 0, "sid": 6, "def": 0, "pose": [1,0,0,0, 0,1,0,0, 0,0,1,0], "name": "Chair_1", "tags": [["Furniture"]] } ], "sketches": [ { "id": 0, "sid": 7, "plane": [0.0, 0.0, 1.0, 0.0], "vertices": [ {"id":0, "p":[0.0, 0.0, 0.0]} ], "edges": [ {"id":0, "from":0, "to":1, "curve":0} ], "regions": [ {"id":0, "outer":[0,1,2,3], "holes":[[4,5,6]], "faceless": true} ], // "faceless" is v21+, optional; // omitted = the loop has a face "curves": [ {"id":0, "center":[1.0, 2.0, 0.0], "radius":0.75, "kind":"polygon"} ], // v10+; "kind" is v12+, optional "owner": 0, // v13+, optional; dense `components[]` id. Omitted = // world-owned (the only possibility before v13) "owner_object": 0, // v17+, optional; dense `objects[]` id. Omitted = // not owned by an Object (the only possibility before v17) "owner_group": 0, // v19+, optional; dense `groups[]` id. Omitted = // in no group (the only possibility before v19) "tags": [["Site"]] // v20+, optional; omitted = untagged } ], "guides": [ { "id": 0, "sid": 8, "kind": "line", "p": [0.0, 0.0, 0.0], "dir": [1.0, 0.0, 0.0], "tags": [["Rig"]] }, // v21+, optional; omitted = untagged { "id": 2, "sid": 10, "kind": "line", "p": [0.0, 1.0, 0.0], "dir": [0.0, 0.0, 1.0], "from": 0.0, "to": 0.0127 }, // v22+, optional; omitted = runs on forever { "id": 1, "sid": 9, "kind": "point", "p": [2.0, 3.0, 0.0] } ], "annotations": [ { "id": 0, "kind": "linear", "a": { "node": {"kind":"object","id":0}, "p": [0.0, 0.0, 0.0] }, "b": { "node": {"kind":"object","id":0}, "p": [1.0, 0.0, 0.0] }, "offset": [0.0, -0.5, 0.0], "plane": [0.0, 0.0, 1.0, 0.0] }, { "id": 1, "kind": "radial", "radial_kind": "diameter", "a": { "p": [1.0, 0.5, 0.0] }, // "a" omits "node": a free anchor "curve": { "center": [0.5, 0.5, 0.0], "radius": 0.5, "plane": [0.0, 0.0, 1.0, 0.0] }, "leader_dir": [1.0, 0.0, 0.0] }, { "id": 2, "kind": "leader", "a": { "node": {"kind":"object","id":0}, "p": [0.0, 0.0, 1.0] }, "offset": [0.2, 0.2, 0.0], "text": "Cut here", "detached": true } ], "roots": [ {"kind":"object","id":0}, {"kind":"instance","id":0} ], "tags": [ {"path": ["Architecture", "Walls"], "sid": 10}, {"path": ["Mock Walls"], "sid": 11, "hidden": true} ], "camera": { // v13+; omitted entirely if never saved "projection": "perspective", // "perspective" | "parallel" "fov_deg": 45.0, "eye": [4.0, -6.0, 3.0], "target": [0.0, 0.0, 0.0], "up": [0.0, 0.0, 1.0] }, "axes": { "origin": [1.0, 2.0, 0.0], // v13+; omitted entirely at world identity "x": [0.0, 1.0, 0.0], "y": [-1.0, 0.0, 0.0] }, "section_plane": { // v16+; omitted entirely when no plane is placed "origin": [0.0, 0.3, 0.0], "normal": [0.0, 1.0, 0.0], // unit; points at the side the cut REMOVES "active": true }, "scenes": [ // v16+; omitted entirely when empty; array order = tab order { "sid": 42, "name": "Assembled", "description": "Everything, three-quarter view.", "camera": { "projection": "perspective", "fov_deg": 45.0, ``` -------------------------------- ### hew.guide.point Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Creates a point guide. This is a Standard command in the hew.guide namespace. ```APIDOC ## hew.guide.point ### Description Creates a point guide. ### Namespace `hew.guide` ### Command `point` ### Tier Standard ``` -------------------------------- ### Native rootless Podman pod setup Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Create a pod sharing one network namespace, run the relay and web containers, and publish only nginx's port. ```sh podman pod create --name hew -p 8080:80 podman run -d --pod hew --name hew-relay --env-file relay.env \ ghcr.io/hew3d/hew-relay:X.Y.Z podman run -d --pod hew --name hew-web \ -v ./www:/var/www/hew:ro,Z \ -v ./nginx.conf:/etc/nginx/conf.d/hew.conf:ro,Z \ -v ./relay.conf:/etc/nginx/hew.d/relay.conf:ro,Z \ docker.io/library/nginx:alpine ``` -------------------------------- ### Run hew-web.sh installer from GitHub Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Installs Hew into a Debian LXC container on Proxmox VE. Run from the Proxmox host shell. Use this form, not `curl ... | bash`, because the wizard's whiptail dialogs need the terminal on stdin. ```sh bash -c "$(curl -fsSL https://raw.githubusercontent.com/hew3d/hew/main/scripts/hew-web.sh)" ``` -------------------------------- ### POST /report/ Source: https://github.com/hew3d/hew/blob/main/workers/bug-intake/README.md Starts a new upload with its first piece. Validates the piece and upload metadata before creating a new upload session. ```APIDOC ## [POST] /report/ ### Description Starts a new upload with its first piece. Validates the piece and upload metadata before creating a new upload session. ### Method POST ### Endpoint /report/ (also /report) ### Parameters #### Request Body - **Content-Type** (string) - Required - Must be `application/gzip` - **Hew-Upload-Length** (integer) - Required - Declared total compressed size of the whole report - **Body** (binary) - Required - The first piece of the report, must be either the whole report or exactly `pieceBytes` ### Request Example { "Content-Type": "application/gzip", "Hew-Upload-Length": 123456, "body": "" } ### Response #### Success Response (201) - **id** (string) - Report ID - **token** (string) - Upload token (43-char base64url) - **pieceBytes** (integer) - Maximum piece size in bytes #### Response Example { "id": "HEW-XXXX-XXXX", "token": "<43-char base64url>", "pieceBytes": 1900000 } #### Error Responses - **400** - Invalid request (including a first piece that is neither the whole report nor exactly `pieceBytes`) - **411** - Missing Content-Length - **413** - Too large - **429** - Rate limited - **507** - Storage full - **5xx** - Unavailable ``` -------------------------------- ### Open a menu item Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Open a menu and select an item, e.g., Object > Subtract. ```javascript h.menu('Object', 'Subtract') ``` -------------------------------- ### Start and verify the relay Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Enable and start the hew-relay service, then check both loopback and nginx endpoints. Both should return a JSON with service and contract fields. A full relay returns 503 with Retry-After. ```sh sudo systemctl enable --now hew-relay curl -s http://127.0.0.1:8787/relay/ curl -s http:///relay/ ``` -------------------------------- ### hew.guide.clear Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Clears guides. This is a Standard command in the hew.guide namespace. ```APIDOC ## hew.guide.clear ### Description Clears guides. ### Namespace `hew.guide` ### Command `clear` ### Tier Standard ``` -------------------------------- ### Check if the app is served Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Verify the app is available at the expected local URL before running a shot script. ```bash curl -sf http://localhost:5199/ ``` -------------------------------- ### Start Docker compose and test relay endpoint Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Starts the Docker Compose stack and verifies the relay endpoint from the host. The relay must be enabled for the curl command to succeed. ```sh docker compose up -d curl -s http://127.0.0.1:8080/relay/ # from the host, if the relay is enabled ``` -------------------------------- ### Open a submenu item Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Open a submenu and select an item, e.g., Camera > Standard Views > Iso. ```javascript h.menu('Camera', 'Standard Views', 'Iso') ``` -------------------------------- ### Type a value and press Enter Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Type a value at 70 ms per character, then press Enter with a 400 ms delay. ```javascript h.type('20,12') ``` ```javascript h.key('Enter', 400) ``` -------------------------------- ### Unattended install with var_* overrides Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Sets var_relay, var_upload_key, and var_https to run hew-web.sh without prompts. Falls back silently to defaults when not attached to a real terminal or when whiptail is missing. ```sh var_relay=yes var_upload_key=yes var_https=none ./hew-web.sh ``` -------------------------------- ### Install the canonical nginx config Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Copy the nginx config from the tarball's deploy/ directory, enable it, and reload nginx. For conf.d layouts, place the file at /etc/nginx/conf.d/hew.conf instead. ```sh sudo cp /var/www/hew/deploy/nginx.conf /etc/nginx/sites-available/hew sudo ln -sf /etc/nginx/sites-available/hew /etc/nginx/sites-enabled/hew sudo rm -f /etc/nginx/sites-enabled/default sudo mkdir -p /etc/nginx/hew.d sudo nginx -t && sudo systemctl reload nginx ``` -------------------------------- ### Zoom extents Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Zoom the view to fit all objects. ```javascript h.zoomExtents() ``` -------------------------------- ### hew-cli mcp Source: https://github.com/hew3d/hew/blob/main/docs/API_GUIDE.md Starts an MCP (Model Context Protocol) server, optionally connecting to a running instance. ```APIDOC ## Command: hew-cli mcp ### Description Starts an MCP (Model Context Protocol) server, optionally connecting to a running instance. ### Method CLI ### Endpoint hew-cli mcp [--live [--launch] [--instance ] [--document ]] ### Parameters #### Options - **--live** (flag) - Optional. Sends to a running app. - **--launch** (flag) - Optional. Launches an instance if not running. - **--instance** (integer) - Optional. Process ID of the running instance. - **--document** (string) - Optional. Document reference. ### Request Example hew-cli mcp --live ### Response #### Success Response - Starts an MCP server. ``` -------------------------------- ### Verify share-relay upload and retrieval with curl Source: https://github.com/hew3d/hew/blob/main/workers/share-relay/README.md PUT a file to /drop with an Origin header; expect a JSON response with a token. A follow-up GET on /drop/ should return the same bytes once, then 404 on a second try. ```bash curl -i -X PUT --data-binary @somefile https://share.hew3d.com/drop -H 'Origin: https://app.hew3d.com' ``` -------------------------------- ### GET / Source: https://github.com/hew3d/hew/blob/main/workers/share-relay/README.md Identity route that returns service information and configuration. Used by desktop clients for connection testing. ```APIDOC ## [GET] / ### Description Returns service identity and configuration. Used by desktop clients for connection testing. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **service** (string) - Service name - **contract** (integer) - Contract version - **maxBytes** (integer) - Maximum upload size in bytes - **ttlMs** (integer) - Time-to-live in milliseconds - **auth** (string) - Authentication mode: "none" or "bearer" #### Response Example { "service": "hew-relay", "contract": 1, "maxBytes": 33554432, "ttlMs": 600000, "auth": "none" } ``` -------------------------------- ### Click an Outliner row via text Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Click a UI element by its exact text, e.g., an Outliner row. ```javascript h.clickUi(page.getByText('Object 1', { exact: true })) ``` -------------------------------- ### Run a shot script with debug and capture load Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Run a shot script from the shots directory with debug stills and a capture load limit. Requires the app to be served at http://localhost:5199/. ```bash DEBUG_SHOTS=1 CAPTURE_MAX_LOAD=20 node shots/.mjs ``` -------------------------------- ### Update web app via full replace Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Performs a full replacement of the web app by downloading the latest release, clearing old contents, extracting, and reinstalling the nginx config. Requires sudo and nginx installed. Ends with an nginx config test and reload. ```sh curl -fsSL "$(curl -fsSL https://api.github.com/repos/hew3d/hew/releases/latest \ | grep -o '"browser_download_url": *"[^"]*hew-web-[^"]*\.tar\.gz"' \ | cut -d'"' -f4)" -o /tmp/hew-web.tar.gz sudo rm -rf /var/www/hew/* sudo tar -xzf /tmp/hew-web.tar.gz -C /var/www/hew rm /tmp/hew-web.tar.gz sudo cp /var/www/hew/deploy/nginx.conf /etc/nginx/sites-available/hew sudo rm -rf /var/www/hew/deploy sudo nginx -t && sudo systemctl reload nginx ``` -------------------------------- ### Install dependencies for share-relay Worker Source: https://github.com/hew3d/hew/blob/main/workers/share-relay/README.md Run from the workers/share-relay directory. Pulls in wrangler; this directory is intentionally outside the pnpm workspace and manages its own node_modules. ```bash cd workers/share-relay && npm install ``` -------------------------------- ### Update Hew inside the container Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Updates an existing install by running the same script inside the container. Recognizes an existing install by `/etc/hew/install.env`. The container gets a `/usr/bin/update` command that does exactly that. ```sh pct enter 105 update ``` -------------------------------- ### Click a rail tool via role Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Click a UI element by its accessible role and name, e.g., a rail tool. ```javascript h.clickUi(page.getByRole('radio', { name: 'Circle' })) ``` -------------------------------- ### Set EXTRA_ALLOWED_ORIGINS via wrangler dev Source: https://github.com/hew3d/hew/blob/main/workers/share-relay/DASHBOARD-SETUP.md Use this command to set the EXTRA_ALLOWED_ORIGINS variable for a local wrangler dev session. Replace the example origin with your own. This is only needed for the unsupported split-origin layout. ```bash wrangler dev --var 'EXTRA_ALLOWED_ORIGINS:https://hew.example.org' ``` -------------------------------- ### Set up container layout for Docker or Podman Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Creates the common directory structure for running the web app in a container. Downloads the latest web release, extracts it, copies the nginx config and optionally the relay config, then removes the deploy folder. ```sh mkdir -p hew-web && cd hew-web curl -fsSL "$(curl -fsSL https://api.github.com/repos/hew3d/hew/releases/latest \ | grep -o '"browser_download_url": *"[^"]*hew-web-[^"]*\.tar\.gz"' \ | cut -d'"' -f4)" -o hew-web.tar.gz mkdir -p www && tar -xzf hew-web.tar.gz -C www && rm hew-web.tar.gz cp www/deploy/nginx.conf . cp www/deploy/hew.d/relay.conf . # only if you're running the relay rm -rf www/deploy ``` -------------------------------- ### Build and run Hew Source: https://github.com/hew3d/hew/blob/main/docs/dev/DEVELOPMENT.md Builds all Rust crates, installs JS/TS dependencies, compiles the WASM bindings, and starts the UI and desktop shell dev servers. The WASM build is required before the UI dev server runs. ```sh cargo build --workspace # build every Rust crate pnpm install # install JS/TS dependencies wasm-pack build crates/wasm-api --target web --out-dir ../../app/src/wasm/pkg pnpm --dir app dev # UI dev server (web build) pnpm --dir shells/tauri dev # desktop shell dev ``` -------------------------------- ### Install Hew via Flatpak remote Source: https://github.com/hew3d/hew/blob/main/packaging/pages/index.html Adds the self-hosted Flatpak remote for Hew and installs the com.hew3d.Hew application. ```bash flatpak remote-add --if-not-exists hew https://hew3d.github.io/hew-packages/flatpak/com.hew3d.Hew.flatpakrepo flatpak install hew com.hew3d.Hew ``` -------------------------------- ### Install Hew via Gentoo overlay Source: https://github.com/hew3d/hew/blob/main/packaging/pages/index.html Adds the Hew Gentoo overlay, syncs it, accepts the ~amd64 and ~arm64 keywords for media-gfx/hew-bin, and installs the package. ```bash eselect repository add hew3d git https://github.com/hew3d/gentoo-overlay.git emerge --sync hew3d echo 'media-gfx/hew-bin ~amd64 ~arm64' | sudo tee /etc/portage/package.accept_keywords/hew-bin sudo emerge media-gfx/hew-bin ``` -------------------------------- ### Build and test everything the verification gate covers Source: https://github.com/hew3d/hew/blob/main/README.md Runs the verification script that builds and tests the project. ```sh scripts/verify.sh ``` -------------------------------- ### Install wasm-pack Source: https://github.com/hew3d/hew/blob/main/docs/dev/DEVELOPMENT.md Installs the pinned version of wasm-pack used to compile the kernel to WebAssembly. ```sh scripts/install-wasm-pack.sh ``` -------------------------------- ### hew.query.entity Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Reads back properties of an entity, including guides. Guides expose origin, direction, stretch, and tags. ```APIDOC ## [QUERY] hew.query.entity ### Description Reads back properties of an entity, including guides. Guides expose origin, direction, stretch, and tags. ### Method QUERY ### Endpoint hew.query.entity ### Parameters #### Request Body - **entity** (object) - Required - The entity locator (e.g., a guide id). ### Response #### Success Response (200) - **origin** (array) - The guide's origin point. - **direction** (array) - The guide's direction vector. - **stretch** (object) - `from` and `to` meters along the direction from the origin; `null` for an end that runs forever. - **tags** (array) - Paths, as a node's; a guide with a hidden tag is in the document but neither drawn nor snapped to. #### Response Example ```json { "origin": [0.0, 0.0, 0.0], "direction": [1.0, 0.0, 0.0], "stretch": {"from": 0.0, "to": null}, "tags": ["hidden"] } ``` ``` -------------------------------- ### Running desktop E2E: build, run, and typecheck commands Source: https://github.com/hew3d/hew/blob/main/shells/tauri/e2e/README.md Build the harness-enabled debug binary, run the desktop E2E (tauri-driver is started by wdio.conf.ts), and typecheck the config and specs. Use xvfb-run for headless sessions. The binary lands at src-tauri/target/debug/; override with HEW_DESKTOP_BIN if needed. ```bash # 1. Build the harness-enabled debug binary (rebuilds the web app with the harness) pnpm --dir shells/tauri e2e:build # 2. Run the desktop E2E (start tauri-driver is handled by wdio.conf.ts) pnpm --dir shells/tauri e2e # headless (no desktop session): xvfb-run -a pnpm --dir shells/tauri e2e # typecheck the config + specs without running them: pnpm --dir shells/tauri e2e:typecheck ``` -------------------------------- ### Install Hew via Arch Linux pacman repository Source: https://github.com/hew3d/hew/blob/main/packaging/pages/index.html Adds the signed pacman repository for Hew on Arch Linux (x86_64 only). Run once to import the GPG key, add the repository to /etc/pacman.conf, and install the hew-bin package. ```bash curl -O https://hew3d.github.io/hew-packages/pacman/hew-packaging.gpg sudo pacman-key --add hew-packaging.gpg sudo pacman-key --lsign-key "$(gpg --with-colons --show-keys hew-packaging.gpg | awk -F: '/^fpr/{print $10; exit}')" sudo tee -a /etc/pacman.conf <<'EOF' [hew] SigLevel = Required Server = https://hew3d.github.io/hew-packages/pacman/$arch EOF sudo pacman -Sy hew-bin ``` -------------------------------- ### Run conformance suite against live deployment Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Run the black-box conformance suite against a live relay deployment. Requires Node ≥ 23.6. Set HEW_RELAY_URL to the public origin and HEW_RELAY_PREFIX_ONLY=1 when the origin proxies only /relay/ to the relay. Add HEW_RELAY_UPLOAD_KEY if the relay requires one. If the only failure is a Content-Length over maxBytes timing out, the proxy buffers request bodies; rerun with HEW_RELAY_BUFFERS_BODY=1 to skip those cases. ```sh cd workers/share-relay HEW_RELAY_URL=https://hew.example.org HEW_RELAY_PREFIX_ONLY=1 npm run test:contract # add HEW_RELAY_UPLOAD_KEY=... if the relay requires one ``` -------------------------------- ### Update relay binary via drop-in swap Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Downloads the latest relay binary for the current architecture and installs it over the existing one. The systemd unit and env file rarely change. Restarts the hew-relay service after installation. ```sh curl -fsSL "$(curl -fsSL https://api.github.com/repos/hew3d/hew/releases/latest \ | grep -o "\"browser_download_url\": *\"[^\"]*hew-relay-[^\"]*-linux-${ARCH}\\.tar\\.gz\"" \ | cut -d'"' -f4)" -o /tmp/hew-relay.tar.gz sudo tar -xzf /tmp/hew-relay.tar.gz -C /tmp hew-relay sudo install -m 755 /tmp/hew-relay /usr/local/bin/hew-relay rm /tmp/hew-relay /tmp/hew-relay.tar.gz sudo systemctl restart hew-relay ``` -------------------------------- ### hew.meta.hello Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Initializes a connection to the HEW host. Must be the first request on any connection; the host responds with protocol version, application identity, granted profile, negotiated encoding, and open documents. ```APIDOC ## [JSON-RPC] hew.meta.hello ### Description Initializes a connection to the HEW host. Must be the first request on any connection; the host responds with protocol version, application identity, granted profile, negotiated encoding, and open documents. ### Method JSON-RPC ### Endpoint hew.meta.hello ### Parameters #### Request Body - **protocol** (integer) - Required - Protocol version the client supports. - **token** (string) - Required - Authentication token. - **client** (object) - Required - Client identification: `name` (string) and `version` (string). - **encodings** (array of strings) - Required - List of supported encodings (e.g., `["json"]`). ### Request Example ```json {"jsonrpc": "2.0", "id": 0, "method": "hew.meta.hello", "params": {"protocol": 1, "token": "…", "client": {"name": "hew-cli", "version": "0.10.0"}, "encodings": ["json"]}} ``` ### Response #### Success Response - **protocol** (integer) - Protocol version supported by the host. - **app** (object) - Application identity: `name` (string) and `version` (string). - **profile** (string) - Granted profile (e.g., `"app"`). - **encoding** (string) - Negotiated encoding (e.g., `"json"`). - **documents** (array of objects) - List of open documents, each with `id`, `title`, and `path`. #### Response Example ```json {"jsonrpc": "2.0", "id": 0, "result": {"protocol": 1, "app": {"name": "hew", "version": "1.0.0"}, "profile": "app", "encoding": "json", "documents": [{"id": "doc_1", "title": "Bird feeder", "path": "…"}]}} ``` ### Error Handling - Requests before a successful `hello` are rejected with error code `-32004` (not ready). - If the host cannot serve the requested protocol version, it answers with an error naming the versions it speaks. ``` -------------------------------- ### Run bug-intake tests with npm test Source: https://github.com/hew3d/hew/blob/main/workers/bug-intake/README.md Runs the test suite for the bug-intake worker using Node's built-in test runner and native TypeScript stripping. No install step is needed for the tests themselves; npm install is only required for wrangler dev or deploy. ```sh cd workers/bug-intake npm test # node --test src/*.test.ts ``` -------------------------------- ### Set and get custom attributes on entities Source: https://github.com/hew3d/hew/blob/main/docs/API_GUIDE.md Use hew-cli dispatch hew.attr.set and hew.attr.get to store namespaced JSON on entities. The get command returns the stored dictionary; writing to reserved namespaces like hew.* refuses with reserved_attr_namespace. ```sh hew-cli dispatch hew.attr.set \ '{"target": "obj_7", "ns": "com.example.bom", "key": "sku", "value": {"part": "TOP-1200", "qty": 1}}' \ --file table.hew hew-cli dispatch hew.attr.get '{"target": "obj_7"}' --file table.hew # {"result": {"com.example.bom": {"sku": {"part": "TOP-1200", "qty": 1}}}} ``` -------------------------------- ### Verify deployment Source: https://github.com/hew3d/hew/blob/main/workers/bug-intake/README.md Checks the route returns identity JSON, tests a gzip upload with commit, and opens the admin page. The upload must be real gzip; a 201 response confirms success. ```sh curl -s https://app.hew3d.com/report/ # {"service":"hew-bug-intake","format":1,"maxBytes":94371840,"pieceBytes":1900000} # The body of each request must be real gzip. With a local bundle.json: gzip -c bundle.json > bundle.json.gz curl -s -i -X POST https://app.hew3d.com/report/ \ -H 'Content-Type: application/gzip' \ -H "Hew-Upload-Length: $(stat -f%z bundle.json.gz)" \ --data-binary @bundle.json.gz # 201 {"id":"HEW-...-...","token":"...","pieceBytes":1900000} for a bundle # under one piece — it's both START and the whole upload in this case. # Then finish it: curl -s -i -X POST https://app.hew3d.com/report/HEW-XXXX-XXXX/commit \ -H 'Hew-Upload-Token: ' # 201 {"id":"HEW-XXXX-XXXX"}; confirm the notification email arrives at NOTIFY_TO # Then, signed into Access as the maintainer: open https://app.hew3d.com/report/admin/ ``` -------------------------------- ### hew.guide.clear Source: https://github.com/hew3d/hew/blob/main/docs/API_REFERENCE.gen.md Deletes all guides. No parameters are required. ```APIDOC ## hew.guide.clear ### Description Deletes all guides. No parameters are required. ### Method N/A (RPC-style) ### Endpoint hew.guide.clear ### Parameters #### Request Body None ### Request Example {} ### Response #### Success Response Empty object #### Response Example {} ### Refusals None ``` -------------------------------- ### Run full pre-push gate scripts/verify-full.sh Source: https://github.com/hew3d/hew/blob/main/CLAUDE.md Runs verify, replay, and Chromium E2E tests. Mirrors blocking CI and should be run before pushing. ```bash scripts/verify-full.sh ``` -------------------------------- ### Build and test the replay runner Source: https://github.com/hew3d/hew/blob/main/docs/dev/DIAGNOSTICS.md Builds the kernel's WASM bindings for Node and replays every fixture in fixtures/ to check its digest. Run from tools/replay-runner. ```sh cd tools/replay-runner npm run build # builds the kernel's WASM bindings for Node (one-time, # or whenever the kernel changes) npm test # replays every fixture in fixtures/ and checks its digest ``` -------------------------------- ### GET /report/admin/ Source: https://github.com/hew3d/hew/blob/main/workers/bug-intake/README.md Returns the reports list as HTML. This endpoint is Access-protected. ```APIDOC ## [GET] /report/admin/ ### Description Returns the reports list as HTML. This endpoint is Access-protected. ### Method GET ### Endpoint /report/admin/ ### Response #### Success Response (200) HTML content ``` -------------------------------- ### Quadlet pod unit for reboot survival Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Minimal `~/.config/containers/systemd/hew.pod` to publish port 8080 and enable the pod at default target. ```ini [Pod] PublishPort=8080:80 [Install] WantedBy=default.target ``` -------------------------------- ### hew.attr.get Source: https://github.com/hew3d/hew/blob/main/docs/agents/HEW_API.md Gets an attribute value. This is a required command in the hew.attr namespace. ```APIDOC ## hew.attr.get ### Description Gets an attribute value. ### Namespace `hew.attr` ### Command `get` ### Tier Required ``` -------------------------------- ### Run the gate with npm test Source: https://github.com/hew3d/hew/blob/main/tools/replay-runner/README.md Runs the replay gate, loading every fixtures/*.json and replaying each into a new Scene. Prints PASS/FAIL per fixture with state hashes. Exit code is 0 only if all fixtures pass; nonzero otherwise. ```sh npm test # or: npm start / node run.mjs ``` -------------------------------- ### Parse a Collada .dae file with Document::from_str Source: https://github.com/hew3d/hew/blob/main/crates/vendor/dae-parser/README.md Parses a Collada 1.4.1 document from a string using Document::from_str, then navigates the parsed data structures to access geometry, sources, and vertices. The example asserts the parsed cube mesh data and input semantics. ```rust use std::str::FromStr; use dae_parser::*; let dae_file = r##" 1970-01-01T00:00:00Z 1970-01-01T00:00:00Z 1 1 1 1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1

3 1 0 1 5 2 3 4 1 1 4 5

"##; let document = Document::from_str(dae_file).unwrap(); let cube = document.local_map::().unwrap().get_str("Cube-mesh").unwrap(); let sources_map = document.local_map::().unwrap(); let vertices_map = document.local_map::().unwrap(); // sources.get("Cube-mesh-positions").unwrap(); assert_eq!(cube.id.as_ref().unwrap(), "Cube-mesh"); let mesh = cube.element.as_mesh().unwrap(); let tris = mesh.elements[0].as_triangles().unwrap(); assert_eq!( tris.data.as_deref().unwrap(), &[3, 1, 0, 1, 5, 2, 3, 4, 1, 1, 4, 5] ); assert_eq!(tris.inputs[0].semantic, Semantic::Vertex); let vertices = vertices_map.get_raw(&tris.inputs[0].source).unwrap(); assert_eq!(vertices.id, "Cube-mesh-vertices"); let source = sources_map .get_raw(&vertices.position_input().source) .unwrap(); assert_eq!(source.id.as_deref(), Some("Cube-mesh-positions")); ``` -------------------------------- ### hew.guide.point Source: https://github.com/hew3d/hew/blob/main/docs/API_REFERENCE.gen.md Adds a construction guide point. Requires a position. ```APIDOC ## hew.guide.point ### Description Adds a construction guide point. Requires a position. ### Method N/A (RPC-style) ### Endpoint hew.guide.point ### Parameters #### Request Body - **position** (any) - Required - Position point ### Request Example { "position": [0, 0, 0] } ### Response #### Success Response - **guide** (string) - The guide identifier #### Response Example { "guide": "guide-789" } ### Refusals - `degenerate_guide` — The guide needs a definite direction. Drag a little further before dropping it. - `unknown_entity` - `locator_missed` - `ambiguous_locator` - `no_such_point` ``` -------------------------------- ### Download and extract the app Source: https://github.com/hew3d/hew/blob/main/docs/SELF_HOSTING.md Download the latest hew-web tarball from GitHub releases and extract it to /var/www/hew. ```sh sudo mkdir -p /var/www/hew curl -fsSL "$(curl -fsSL https://api.github.com/repos/hew3d/hew/releases/latest \ | grep -o '"browser_download_url": *"[^"]*hew-web-[^"]*\.tar\.gz"' \ | cut -d'"' -f4)" -o /tmp/hew-web.tar.gz sudo tar -xzf /tmp/hew-web.tar.gz -C /var/www/hew rm /tmp/hew-web.tar.gz ``` -------------------------------- ### Toggle axes visibility Source: https://github.com/hew3d/hew/blob/main/tools/launch-reel/SHOTS.md Show or hide the axes in the view. ```javascript h.view('Axes', false) ```