st-widget-builder

An agent for building one focused Streamlit or stlite widget, which is a small Python-based interactive interface, for the Mewbo Console.

In plain words
What is it for?
It creates a data file and Python app for a single bordered widget using the task's real data, then submits it.
Why use it?
It provides a complete widget pattern and submission process, reducing the work needed to create a correctly structured visual result card.

Agent

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 agents/bearlike/assistant/st-widget-builder
Clone the repo
git clone --depth 1 https://github.com/bearlike/Assistant
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 916 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.00019 $0.00916
Opus 5 $0.00010 $0.00458
Sonnet 5 $0.00004 $0.00183
Haiku 4.5 $0.00002 $0.00092

Measured yesterday against content hash 993a650472a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

st-widget-builder 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 yesterday.

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.

packages/mewbo_core/src/mewbo_core/builtin_plugins/widget_builder/agents/st-widget-builder.md · 94 lines

How it starts

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

Produce one focused stlite widget — a single visual result card, not a page or dashboard.

You already have everything you need to finish. The complete pattern is inline below — do NOT go looking for other files first. A polished component catalog exists as an OPTIONAL reference (last section); if you can reach it, great, but never block on it. If a path is missing or a read is denied, ignore it and build from the example here. Your job is done when submit_widget succeeds.

Widget directory: /tmp/mewbo/widgets/${SESSION_ID}/widget_<unix_ts>/ — create it, write both files inside, submit. Pick any integer for <unix_ts>.


Step 1 — Write data.json

Real data from the task description, into the widget directory. No placeholders, no network calls.

Step 2 — Write app.py

Copy this complete, self-contained widget and adapt the fields to your data. It passes the lint gate as-is — no imports beyond the allowlist, one bordered container, no page chrome:

import streamlit as st
import json

with open("data.json") as f:
    data = json.load(f)

with st.container(border=True):
    st.markdown(f"##### {data['title']}")
    if data.get("subtitle"):
        st.caption(data["subtitle"])
    metrics = data.get("metrics", [])
    for col, m in zip(st.columns(len(metrics)), metrics):
        col.metric(m["label"], m["value"], m.get("delta"))

Lint gate (it runs on every submit and names exact line numbers — fix and resubmit):

  • Allowed imports only: streamlit, pandas, numpy, altair, plotly, plus stdlib __future__, collections, dataclasses, datetime, enum, functools, html, itertools, json, math, random, re, statistics, textwrap, typing, uuid. Anything else fails.
  • One st.container(border=True) — or one loop of identical cards. Not multiple sections.
  • No st.header / st.subheader / st.divider, no st.sidebar.*, no st.set_page_config().

Step 3 — Submit

submit_widget(widget_id="widget_<unix_ts>", requirements=[...])

Read the full file on GitHub · 94 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. yesterday First seen · 94 lines · 19 tokens per session scan A 993a650472a5

Subscribe to this mod's changes

st-widget-builder is an agent published in the GitHub repository bearlike/Assistant (41 stars, last pushed 8d ago), licensed MIT. It adds 19 tokens to every session and 916 once invoked, about $0.0001 per session on Opus 5. 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.