artifact_fetch.rs

artifact_fetch.rs is a command for coding agents from NetMindAI-Open/NarraNexus. It costs 0 tokens per session (1,030 once invoked), scanned A, original, Apache-2.0.

A Rust-side file proxy for showing local test artifacts inside a desktop webview. A webview is the browser-like part of a desktop app that displays its interface.

In plain words
What is it for?
Use it to load locally generated test artifacts into an iframe when direct browser requests are blocked by mixed-content rules.
Why use it?
The webview blocks some local HTTP content when the app page uses HTTPS, so the proxy retrieves the file outside the webview and returns it in a form the interface can display.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/netmindai-open/narranexus/artifact_fetch.rs
Clone the repo
git clone --depth 1 https://github.com/NetMindAI-Open/NarraNexus

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for artifact_fetch.rs

README.md
[![agentmods](https://agentmods.dev/badge/commands/netmindai-open/narranexus/artifact_fetch.rs.svg)](https://agentmods.dev/commands/netmindai-open/narranexus/artifact_fetch.rs)
Your own site
<a href="https://agentmods.dev/commands/netmindai-open/narranexus/artifact_fetch.rs"><img src="https://agentmods.dev/badge/commands/netmindai-open/narranexus/artifact_fetch.rs.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,030 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01030
Opus 5 $0.00000 $0.00515
Sonnet 5 $0.00000 $0.00206
Haiku 4.5 $0.00000 $0.00103

Measured 4d ago against content hash 0f99e1addd2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

artifact_fetch.rs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.mindflow/mirror/tauri/src-tauri/src/commands/artifact_fetch.rs.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

artifact_fetch.rs — Rust-side artifact bytes proxy for the dmg

Why it exists

In the dmg the Tauri webview origin is https://tauri.localhost (HTTPS) while the local backend serves on http://localhost:8000 (HTTP). WKWebView classifies any HTTP subresource loaded from an HTTPS document as "active mixed content" and blocks it silently — both iframe loads and fetch() from JS. The artifact panel rendered as a white iframe for every test artifact (P0 reported 2026-05-27).

Header-level fixes (X-Frame-Options removal, frame-ancestors, Cross-Origin-Resource-Policy: cross-origin) are necessary but not sufficient — they only matter once the request actually reaches the server. Mixed content blocking fires earlier, in the network layer.

HTTP requests originated by Rust (not the WKWebView) are immune to the mixed-content blocker. This command pulls the artifact bytes via reqwest and ships them back to the frontend as base64 over the IPC channel. The frontend reconstructs a Blob and uses a blob: URL as the iframe src. blob URLs inherit the creator document's origin (https://tauri.localhost), so the iframe load is same-origin — the mixed-content rule never applies.

Surface

fetch_artifact_via_backend(url: String) -> Result<ArtifactBytes, String>

ArtifactBytes:

  • status: u16 — backend HTTP status (frontend checks === 200).
  • content_type: String — verbatim Content-Type header, defaults to application/octet-stream if absent.
  • bytes_base64: String — base64-encoded body. IPC only ships JSON, so binary bytes need this round-trip.

Security: SSRF guard

The validator (validate(&str) -> Result<Url, String>) enforces a strict whitelist before reqwest sees the URL:

  • scheme ∈ {http, https}
  • host ∈ {localhost, 127.0.0.1, ::1}
  • port ∈ {8000} (the bundled backend port — keep this list in sync with state::bundled_services if we ever move the backend off 8000)
  • path prefix starts with /api/public/artifacts/

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 92 lines · 0 tokens per session scan A 0f99e1addd2a

Subscribe to this mod's changes

artifact_fetch.rs is a command published in the GitHub repository NetMindAI-Open/NarraNexus (85 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,030 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.