Skip to content

Midnight City — Midnight City agents + midnight-wallet toolbox (bring your own API token) - #28

Open
notsoblack wants to merge 1 commit into
hypercycle-development:mainfrom
notsoblack:midnight-addon-pr
Open

notsoblack wants to merge 1 commit into
hypercycle-development:mainfrom
notsoblack:midnight-addon-pr

Conversation

@notsoblack

Copy link
Copy Markdown
Collaborator

What

Midnight City (midnight-addon): a renderer-only tab that puts a user's Midnight City agents and the midnight-wallet toolbox in one panel.

  • Agents — live status, location, control channel, health / hunger, skills with progress, inventory chips, load stats.
  • Bring your own account. Nothing is hard-coded to one user. Each person pastes their own Midnight City API token in the add-on's Settings (stored via addonAPI.settings, sent only as a bearer header to the observer they configure) and Sync from account lists their agents. Agents can also be added by hand by ID, so the panel works with no token at all. The first agent is auto-selected on boot.
  • Wallet strip — address, balance, network and the connected midnight-wallet MCP server.
  • Toolbox — every tool on every connected MCP server, grouped by functional prefix (Wallet, Localnet, Contracts, Grants, Swaps, Dust, Config, Transactions, Utilities). Zero-arg tools run in one click; the rest take JSON arguments. Built on listServers → listTools → callTool, so it adapts to whatever the servers expose rather than hard-coding tool names.

Permissions

"permissions": ["wallet:read", "mcp:read", "mcp:call"]

Minimum set for the above: read the wallet snapshot, discover tools on servers the user has already connected, and call them. No wallet:sign — the add-on never signs or broadcasts on its own; every transaction is an explicit click on a wallet tool the user chose to connect.

Source, build, licence

  • No build step. renderer/ (index.html, app.js, style.css — vanilla JS, ~1,100 lines) is hand-written source, not output. It is force-added past the repo's addons/*/renderer/ ignore rule, as CONTRIBUTING.md asks; git status --ignored confirms all three files are in the patch. No package.json, no dependencies, no lockfile.
  • Licence: MIT (addons/midnight-addon/LICENSE, Copyright © 2026 Mauricio Prieto Davila (notsoblack)), same as graph-addon and loops-addon.

Network egress (for the judgment queue)

One fetch in app.js: the Midnight City observer REST API (www.midnight.city, user-overridable in Settings) for agent status and the account agent list. Reads need no token; the bearer token is only attached when the user has saved one. No other hosts. Wallet and toolbox data come through the Mosaic bridge, not the network.

Gates

Both run locally against main at 401ed68:

adjudicate.mjs → VERDICT: REVIEW — hard gates pass; 1 item(s) need human judgment (network egress, above)
checks.mjs     → CHECKS: OK — gates pass; 0 item(s) for review.

tab.icon is Star (in the app's icon set), minAppVersion is 0.1.13, the app version the add-on was exercised against.

What I exercised, and what I did not

Exercised in Mosaic Companion 0.1.13 (dev-source add-on, tab mount): agent sync with a token and by-hand add, selection persistence across reloads, toolbox listing across all connected servers (midnight-wallet 44 tools grouped as above), zero-arg tool calls, wallet strip, and the layout at the sidebar's default width and at ~650px. Not exercised: an account with zero agents behind a valid token, and a revoked token (both render the existing "add a token" state, not an error path I have seen live).

One logical commit, Signed-off-by present.

/cc @zephyrnova — same submission path as Stargate Graph (#3) and Stargate Loops (#4).

Renderer-only add-on that shows a user's Midnight City agents (bring-your-own
API token, stored in add-on settings) — live status, vitals, skills, inventory
— alongside the wallet snapshot and a grouped toolbox over every connected MCP
server. Permissions: wallet:read, mcp:read, mcp:call. No build step; renderer/
is hand-written source and force-added past the renderer/ ignore rule.

Signed-off-by: Mauricio Fabian Prieto Davila <mauricio240887@gmail.com>
@notsoblack

Copy link
Copy Markdown
Collaborator Author

CI note — the adjudicate failure is in the pinned-surface checkout step, not in this submission.

addon-pr.yml clones mosaic-companion with --branch "$REF" where REF comes from addon-surface.json → app.describe. That field currently reads v0.1.13-71-gb7719b7 (a git describe string, not a ref), so the clone fails with fatal: Remote branch v0.1.13-71-gb7719b7 not found. The surface's own app.commit is b7719b7e…, and the v0.1.14 tag resolves to exactly that commit — so the pin is correct, only the describe label is unusable as a branch name (it was written from a checkout that did not have the tag). It will fail the same way for any PR opened after #26.

Running both gates locally against main@401ed68 passes for this add-on:

  • adjudicate.mjs → hard gates PASS (one judgment item: network egress, described above)
  • checks.mjs → CHECKS: OK

Happy to adjust anything on the add-on side; this one looks like it needs a tooling fix on describe/--branch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant