Skip to content

About

@toolbox/widgets: the shared widget core and portable bundle format for the Toolbox family of apps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@toolbox/widgets

Status: external_UAT — released for acceptance testing outside the team. status

Site: https://acsdd.github.io/toolbox-widgets/ — The project landing page.

Shared widget core and portable bundle format for the Toolbox family of apps:

App Repo Role
Toolbox (desktop) toolbox-desktop Electron app — already ships the three widgets natively
NAS companion toolbox-nas Local NAS daemon + web UI
MCP server toolbox-mcp Local MCP server + ops panel

Widgets

  • crypto-watch — CoinGecko market data: watchlist validation, price refresh, 1/3/6-month price series with downsampling.
  • gmail-announcer — read-only Gmail IMAP checks (unread count, recent messages) with friendly error messages. Never stores credentials.
  • resource-monitor — CPU, memory and disk stats plus a Windows top-process list.

Model Farm

The llamafarm module powers the Model Farm feature in the CLI, MCP panel and desktop app:

  • Machine detection (detectMachine) — RAM, cores, GPU VRAM and the local Ollama runtime, with injected probes for testing.
  • HuggingFace catalog (fetchCatalog, fetchModelById) — top models per pipeline task, measured by their real GGUF/safetensors file size.
  • Fit scoring (scoreModels) — green/yellow/red against a now (93% of free RAM) or total budget, with GPU offload hints.
  • Numeric grading (gradeMachine, gradeSetup) — the PC and each model rated 0–100 on memory, GPU, compute and storage against fixed reference ceilings; the setup grade is weakest-link weighted and names the bottleneck. gradeLetter / gradeLabel map scores to A+…F and plain-language labels.
  • Ollama install (planOllamaInstall, pullIntoOllama, Modelfile helpers) — a single ollama pull hf.co/owner/repo:quant, or a GPU-split Modelfile. The quantization is normalized to a scheme Ollama understands; a label it cannot use falls back to the repository default (:latest) and says so.

Gateway observer

The gateway module reads the local AstrLink API gateway through its own read-only CLI (~/.astrlink/bin/astrlink):

  • fetchGatewayStatus — providers and subscription health, routing posture, capture/audit settings, privacy policies and the alerts that follow from them.
  • fetchGatewayRequests — a bounded page of recent request records plus a count / failure / token / latency summary, filterable by status and service.
  • gatewayAlerts — the pure alert rules: disconnected subscriptions, expired or expiring tokens, no enabled provider, body capture on, privacy off or warn-only, and subscription identity enforcement.
  • GatewayCliError / availability — not-installed, not-running, blocked or error, so callers can show a useful state instead of failing.

Metadata only: the CLI also returns prompt previews, event trajectories, cursors and account hints — none of them are parsed or copied. Nothing here changes a gateway setting, opens its database, or reads a request or response body.

import { fetchGatewayStatus } from '@toolbox/widgets'

const status = await fetchGatewayStatus()
if (status.availability !== 'ready') console.log(status.error)
for (const alert of status.alerts) console.log(alert.level, alert.message)

Portable bundle format

Any app can export its widget setup and another can import it. Bundles are plain, versioned JSON — settings only, secrets are never included. Widgets that need credentials carry a credentialsRef: a vault key name that the importing app resolves against its own local vault.

{
  "format": "toolbox-widgets",
  "formatVersion": 1,
  "exportedAt": "2026-11-09T00:00:00.000Z",
  "widgets": [
    { "widget": "crypto-watch", "settings": { "watchlist": ["bitcoin", "ethereum"] } },
    {
      "widget": "gmail-announcer",
      "settings": { "email": "me@example.com", "notifications": true },
      "credentialsRef": "gmail/app-password"
    },
    { "widget": "resource-monitor", "settings": { "diskPath": "C:\\", "showProcesses": true } }
  ]
}
import { parseBundleJson, serializeBundle } from '@toolbox/widgets'

const json = serializeBundle(entries)       // export
const bundle = parseBundleJson(json)        // import (validates everything)

Development

Requires Node.js 22+.

npm install
npm run build     # rebuild dist/ — it is committed on purpose, see below
npm test          # build + node:test suite
npm run typecheck

dist/ is committed because consumers install this package straight from git, where dependency lifecycle scripts may not run. CI fails if the committed dist/ drifts from src/, so rebuild and commit it with every change.

Release

This repo is published before toolbox-mcp: the MCP server consumes it as a file: dependency and reads the Marketplace registry from this repo's default branch, so a new registry entry only reaches the live Marketplace once main is pushed here.

npm run build          # refresh the committed dist/
git tag v0.2.1
git push origin main --tags

License

MIT — see LICENSE.

About

@toolbox/widgets: the shared widget core and portable bundle format for the Toolbox family of apps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages