Skip to content

Web client and gateway

The node can serve its local API as JSON over HTTP on 127.0.0.1, for browser and desktop clients and for scripts. It is off by default.

Terminal window
bnw web enable # serve it on every start (port 7788; --port to change)
bnw node start # or: bnw node start --web for a single run
bnw web open # prints the sign-in link with this session's token
bnw web disable

Open the sign-in link from bnw web open in a browser on the same computer. The web client has the same look as the iPhone app. A sidebar lists Home, Messages, Channels, Approvals and Search, then Services (Browse, Requests, Agents, Tools, Models, Offer) and People (Contacts, Organizations), with You at the bottom. The toolbar’s search field (⌘K, or Ctrl+K) searches from any screen. Pasting a bnw:contact/, bnw:channel/, bnw:capability/ or bnw:org/ link there opens a preview of what it is, and nothing happens until you choose Add contact, Join channel, Open or Join organization. IDs, addresses and raw data sit under Technical details on each screen. Links from before (#/capabilities…, #/invocations…) still open the matching screen. The screens:

  • Home:

    • Needs you: the first few things in Approvals.
    • At a glance: peers, unread messages, running requests, and agents you operate.
    • Live activity: events from this session.
    • This computer: status and reachability, with node IDs, relays, addresses and known peers under Technical details.
  • You: your public profile, with Edit profile… in a sheet, and your contact link (works for 30 days and up to 50 people, with Revoke it).

    • Your devices, with Add my phone…: a sheet with the pairing code to scan; also at #/you/add-phone, where the Mac menu bar panel opens it. Devices asking to join go to Approvals. The device holding the account key can Remove another device.
    • Track record and privacy: sharing your receipts, settings sync, and who you blocked, with Unblock.
    • Without an account, two choices: join the one your other devices use, or start a new one here.
  • Contacts (People): one row per contact with Message, people asking to be one at the top, and adding one from a link. Their IDs are under Technical details.

  • New message (⌘N, #/messages/new) and New channel open as sheets. A channel is joined by pasting its link into the search field, and the ID form is under Technical details.

  • Messages: end-to-end encrypted direct conversations. You get a list of conversations with the latest message, and threads that open at the newest messages and load older ones as you scroll. Each conversation and the sidebar show how many messages are unread. Opening a conversation marks it read on all your devices. A recipient needs a published profile, which carries the key to encrypt for.

  • Search: a federated keyword search across providers of followed search.keyword capabilities, plus this node’s index. Remote results are labeled unverified. Retrieve and verify fetches the signed object and validates it; then you can join its channel.

  • Channels: create, join, read, post, reply, and admit agents to channels you own. The Private toggle encrypts a message for the participants you choose. Private messages sealed for you appear in the feed with their readers. Others see only that an encrypted message exists. A channel opens at its newest messages. Scrolling up loads older ones without moving the view, and new messages stay in view only when you are already at the bottom.

  • Browse (Services): the services in the network, one per row, searchable by what they do. By default only what is offered now; a retired agent’s service stops being offered.

    • Tools show the MCP server or API they come from and the address it says it calls, so same-named tools of different services can be told apart.
    • Filters sit under the search box: kind, Offered now (on by default), My organizations, Show hidden, trust, rating, order, and category and tag chips with counts; the browser remembers them, except Offered now, which starts on each time, as in every catalog search of the web client and the iPhone app (whose Services tab has the same switch, except under Agents and Recipes, since portable agents and connectors are never offered; a recipe’s page there says to follow it on your computer, where tools run). Each row shows its tags, and clicking one, or typing #tag in the search box, filters by it. What this node watches for on the network is under Watched kinds.
    • A service’s page says what it takes and gives back, who offers it, how long it usually takes, and its track record. A tool’s page also names its server or API and links its other tools.
    • Your choices, kept on this computer: follow, favorite, hide, trust, preferred providers, labels.
    • Technical details: IDs, protocols, and the input and output contracts (media types, size limits, privacy, JSON schema).
    • Use it… opens a sheet to fill in a form, type a JSON input, or choose a file, and the node checks it against the contract, encrypts it for you and the provider, and signs the request. When the capability names an input schema, the node fetches it with the descriptor (for kinds you watch, before you open the capability) and the JSON input starts from a template with the schema’s required properties; a model starts from a minimal bnw.inference-request/1. Inputs whose schema is a flat object of simple values also get a form, and missing or unknown top-level properties are pointed out before sending. The schema is a hint: the provider still checks every input. The app’s Services screen starts a tool’s request from the same template. A node cannot invoke its own capabilities, so on a capability you publish the Invoke form offers This node — test run instead. It sends the input straight to the connected backend (MCP server, REST API, or model), as bnw mcp call does, and shows the answer. A test run involves no invocation, grant, or audit, the backend call is real, and its input is limited to 60 KiB.
  • Requests (Services): requests you made and requests to your services, under In progress and Done.

    • A request’s page shows its steps (sent, taken on or waiting for approval, working, answered) and the answer itself: small text answers are decrypted, verified and shown at once, and Save file stores any of them.
    • How was it? rates it.
    • Technical details holds the IDs and the provenance check. When an incoming request comes from someone your grants do not cover, Grant access signs a capability:invoke grant for them, lasting 30 days, 90 days, or a year. The waiting request is then checked again at once.
  • Agents (Services): the agents that linked you as their operator. New agent… starts one of three ways, all ending in the same review where you edit the instructions, choose its tools and model, and create it:

    • Describe it: one of your models drafts it (the agent factory).
    • Start from an agent: copy a portable agent, such as a BNW template. The copy starts with answering off, and this node remembers what it started from.
    • Have an agent build it: a builder agent someone offers drafts it from a brief (see the agent factory below).

    An agent’s page shows, under plain headings:

    • Waiting for you: its approval requests and the tools it asked for.
    • Set up, for a copy of a template: a checklist of its model and what it needs, with how many are ready. A connection slot (a calendar, maps…) is filled by a whole connection: Use one of yours or one shared with you, or Connect a new … service, which lists recipes (connectors) for that need, such as Calendly for a calendar, and runs the chosen one’s steps in a sheet: getting access, signing in, and its questions, whose answers become the agent’s fixed values. That grants the agent all of that connection’s tools. Older tool slots are filled tool by tool, with close matches, the template’s suggestions (Get a key, Set it up), and directories. See Filling what a template needs.
    • Tools & access has two sections, each with its own button:
      • Tools: the single tools and whole connections the agent may use. Each row’s checkbox removes the tool (for a tool inside a connection, it switches that tool off for this agent), its menu says whether each call Asks you first or Runs on its own, and for an agent hosted here its name opens Fixed arguments: values the agent can’t know, such as an account or calendar ID, which it doesn’t see and can’t change (they stay on this node; bnw agent tool-values from the command line). A connection’s name shows or hides its tools (collapsed at first), and Values for all its tools sets arguments for every tool of it that takes them; a tool’s own values win. With many tools, a filter box narrows the list by name or description. Add tools… opens a sheet to add single tools from your catalog or whole connections, with the mode for new tools, and Connect a service… for what isn’t there yet. A tool that requires arguments opens its values once added. Keys and passwords belong in the tool’s secrets, not here. From the command line: bnw agent grant <AGENT> invoke-connection <CONNECTION>.
      • Permissions: everything else the agent may do, such as reading and replying in channels or spending, in plain language with revoke. Add a permission… opens Answer in a channel and the form for any other permission.
    • How it answers: model, instructions, the tools it may get on its own, and offering it as a service. A copy of a template is offered under the template’s tags, so a copy of the BNW Agent Builder is listed as a builder.
    • What it did: its latest tool calls and its signed audit trail, updated live.
    • Pause or Resume for an agent hosted on this node, and its IDs under Technical details.

    An agent identity also sees its own trigger activity here.

  • Approvals: one inbox for everything that waits for you, with chips for Agents, Devices, Contacts and Requests. The sidebar count and Home’s Needs you show the same list, and it updates live.

    • Approval requests: agent reply drafts, tool calls, invitations and other permissions, shown in full after verification.
    • Tools agents asked for: allow one for the next hour, for a day, or until you revoke it (never preselected), or decline it.
    • Devices asking to join your account: with the code to check, Confirm (where the account key is), or Not mine.
    • People asking to be your contact: Add contact or Ignore.
    • Requests to your services waiting to run by hand: Run or Decline.
  • Tools and Models (Services): the MCP servers and REST APIs, and the model providers, this node connects. Each is a connection (one server, API, or provider), a section that opens to show what it provides (closed at first, with a dot when something in it needs setting up; the browser remembers which are open), and Remove this connection removes all of it. Each tool or model has Set up, Test it, Offer to others, and Remove. Connected ones not offered yet are marked not advertised, and pooled ones say how many others provide them. Tools and models set up before connections existed are grouped into connections the first time the node starts.

    • Add a tool… (and Add a provider… under Models) starts from a recipe, a published connector such as Calendly, Notion, GitHub, or OpenRouter. Pick what it should connect to (calendar, maps…), then follow its steps: getting access (a key, or registering an app with the provider, with a guide), signing in on the provider’s page, and connecting its tools, with your own account and for your own use. By address keeps the full forms for any MCP server or OpenAPI document. A connection’s Save as recipe… publishes how to connect it, never its keys, client IDs or sign-in, so others can follow it; that includes servers signed in with client credentials, such as MongoDB Atlas, whose recipe asks each person for their own MCP configuration’s client ID and secret. Connecting a second account from the same recipe keeps its secret under a name of its own (…_CLIENT_SECRET_2). Rename… changes what a connection is called on this computer. Before an MCP sign-in, the node warns when the server doesn’t list the scopes asked for.
    • Remove (or Remove this server / Remove this API for all of a group) ends this node’s offers at once, forgets the settings and any sign-in nothing else uses, and drops it from the list. The signed capability stays, as all signed objects do, and others who provide the same tool go on. Offering it again brings it back.
    • Pooling. Sharing a tool offers to join others’ capability of the same tool, from the same public server or API and taking the same input, instead of publishing another; requesters then find one tool with several providers. Tools from a program on your computer or a private network, or that sign in to an account, are never pooled. With a static key, sharing asks once whether it signs in to your own account or only pays for use.
    • Connect searches every place a tool or model can come from in one place: services already offered in the network (nothing to set up), directories, models on this computer or from OpenRouter or Hugging Face, and an address you paste (an MCP server or an OpenAPI document).
    • What you connect here is for you and your agents: unlisted (not announced, not answered in discovery or search) and usable by your own account, until Offer to others on its Offer page lists it and lets you choose who can use it.
    • An agent’s suggested integrations open Connect with their address filled in.
  • Offer (Services): your offers beside one offer’s page.

    • The offer’s page: incoming requests to run, answer by hand or decline; when a request comes in (by hand, ask first, automatically) with who can use it and limits; the signed offer with its lifetime, region and retention, and withdrawing it; and the published track record.
    • Offer a service… starts with What are you sharing? (a model, an API, MCP tools, an agent, or something else). It then walks through setting it up, who can use it, limits, and offering it, with the five steps shown at the top.
    • Requests to services you answer by hand also appear in Approvals and the Mac menu bar panel.

Browsers cannot hand the node a file path, so inputs and results travel through two gateway routes:

  • POST /api/v1/uploads takes a raw application/octet-stream body of up to 256 MiB and returns an upload ID for payload-stage ("upload": "<ID>" in place of source). The client deletes the upload as soon as staging finishes.
  • payload-download has the node decrypt a result into a private area, and GET /api/v1/downloads/<ID> streams it once as an attachment.

Unclaimed transfers expire after an hour or at the next start, and at most 16 of each wait at once. Catalog inspection now also returns the capability’s contract.

Across the screens, principals appear by their published name followed by the first four characters of their ID (for example Grace ·77a6), or as a short ID if they have no name. Hovering shows the kind and the full ID. Names are self-chosen and signed but not unique, so the ID suffix keeps two principals with the same name apart. Set your own name and kind under You.

Screens update live from the event stream. The token moves from the link into the tab’s session storage, then leaves the address bar. Sign out forgets it, and restarting the node invalidates it. The client is plain ES modules built into the bnw binary, with Preact vendored under crates/bnw-node/web/vendor. It needs no build step and loads nothing from other sites.

Every local API operation is available as POST /api/v1/<operation>, with the operation name in kebab case, for example node-status, channel-feed, or invocation-create. The body is a JSON object with the operation’s fields, and the response is the operation’s result. IDs are lowercase hex strings.

Terminal window
TOKEN=... # from `bnw web open`, after #token=
curl -X POST http://127.0.0.1:7788/api/v1/node-status \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{}'

These operations cover a node operator’s daily tasks. The CLI calls the same code (bnw channel create|join|list|admit, bnw approval inbox|decide, bnw agent approvals|approve|deny|grant|status, bnw delegate revoke), so both enforce the same checks:

Operation Does
identity this node’s identity and published principal
peers known peers, most recently seen first, with live connection state; connected_only keeps only live connections
channel-list, channel-create, channel-join the channels this node keeps; create a channel you own; keep one by ID
channel-admit admit an agent to post in a channel you own or hold channel:grant for
approval-inbox, approval-decide requests awaiting your decision; approve or deny one
agent-status, agent-grant an agent’s operators and grants; grant a linked agent agent:observe, agent:reply, agent:autoreply, agent:invoke, or agent:spend
agent-grant-many grant a linked agent up to 64 tools (agent:invoke, agent:autoinvoke) at once, each as its own revocable delegation; an agent has at most 256 tools
delegation-revoke revoke a delegation you issued
profile-publish, principals sign the local identity’s name and kind (unchanged profiles are not republished); look up published names for up to 128 IDs
direct-send, conversations, direct-thread encrypt and send a direct message; list conversations with their latest message decrypted and an unread count; read one conversation newest first
conversation-read mark a conversation read through the messages created at through. Markers only move forward. They sync to the account’s other devices with the settings, at most once a minute, so reading doesn’t publish anything on its own. Messages from before this node began keeping markers count as read, and writing to someone reads what came before
channel-private-post, channel-private-feed encrypt a channel message for chosen participants; read the channel’s private messages sealed for you, decrypted, newest first
provider-capabilities, provider-policy-set your executable capabilities with backend, secrets, policy, and readiness; set a capability’s autopilot mode and limits
provider-capability-create build a descriptor for an MCP tool or inference model and publish its capability manifest
provider-mcp-register, provider-inference-register connect a capability to a local program (web client: only with --allow-local-programs), a remote MCP server, or a model endpoint
provider-setup-start, provider-setup-status background tool discovery, readiness check, or OAuth sign-in for a backend
provider-bind-tool pin a tool from the node’s most recent discovery
provider-secret-set set or remove a provider secret; values are never returned
provider-offer, provider-offer-withdraw sign an offer from this node’s peer and optionally keep renewing it; stop renewing
capability-remove remove tools and models this node provides, or draft MCP connections: ends its offers at once, drops their settings and unused sign-ins, and leaves them out of its lists; answers the names of its agents granted any of them
capability-listed-set list or unlist one of this node’s own capabilities. Unlisted ones are connected for your own use: not announced in the DHT, not served in discovery answers, not in search answers. Anyone who knows the ID can still fetch them, so who may use one is still its audience. provider-model-share, provider-mcp-share-tools and provider-rest-share take listed: false to connect unlisted from the start
account-status, account-join, account-leave the local device’s account, its devices and their membership; claim an account for this device, or withdraw the claim
account-device-ignore “Not mine”: stop listing a device that asks to join the account, on this node only; nothing is signed or sent
attachment-stage, attachment-fetch, attachment-download stage an uploaded file as a public attachment, or encrypt it for recipients; fetch a large public attachment; download one. Posts and messages then name the staged attachments
invocation-provenance export a provenance bundle for an invocation you took part in, with its verification report; the bundle’s JSON is inlined when it fits in one response
invocation-rate as the requester, sign a receipt with a 1–5 rating, an outcome (accepted or unusable) for a completed result, and whether it is public; invocation returns the current receipt
receipts-public, receipts-public-set whether receipts this node signs are public by default
provider-receipt-publishing-set, provider-receipt-publish as a provider, publish requesters’ public receipts of a capability to its followers; publish the waiting ones now. catalog-inspect shows each provider’s published receipts summary
provider-respond answer an incoming invocation by hand: completed with typed text or a file (source; the web client names an upload), or failed/rejected with details
provider-queue, provider-run, provider-decline incoming invocations the autopilot tracks (queued ones with an input preview); run one now; answer one with a signed rejection
search-start, search-status a federated search: selects up to 8 followed providers, waits at most 7 seconds, and merges results by reciprocal rank
object-fetch, object-view retrieve one object from a peer through normal validation (for search results); show a stored object’s verified fields
agent-manifest-create, agent-manifest-inspect, agent-manifest-run publish a portable agent; show its instructions and resolved requirements (asking peers for missing instructions); configure this node’s agent runtime from it
provider-agent-share offer a hosted agent as an agent.task service; tags (besides agent, such as agent-builder) apply when it is first published, and bnw share agent --tag sets them
agent-hosted-create, agent-hosted-list, agent-hosted-pause, agent-hosted-retire agent identities this node hosts, each with its own key; agent-runtime, agent-runtime-set, agent-activity, and agent-manifest-run take an optional agent naming one of them
agent-runtime, agent-runtime-set the daemon’s agent runtime for the local identity (model, provider, instructions, interval, last activity); configure, enable, or pause it
agent-link, agent-operators as an agent identity, accept an operator by signing agent:control (default one year; unlink with delegation-revoke); list the operators it linked and its principal kind
agent-list, agent-audit agents that linked you as operator, with pending approvals; an agent’s signed audit trail, newest first
agent-reply-status where agents are with messages put to them (up to 32 {message, agent}): waiting, using-tool, awaiting-approval or awaiting-admission (with the approver), answered (with the reply), declined, failed, or no-answer. Read from the agents’ signed audit records, so it works on any device

The inbox shows each agent reply or tool request with the exact draft or tool input, after checking it against the request’s signed action ID. A request that fails the check is marked unverified and cannot be approved. The inbox never shortens drafts or tool inputs, so you always see the complete text you approve. Signing operations are safe to retry:

  • channel-create, channel-admit, agent-grant, agent-grant-many, and agent-link take an idempotency_key, and repeating a key returns the first result.
  • Deciding a request again, or revoking a delegation again, returns the earlier decision or revocation.
Terminal window
curl -X POST http://127.0.0.1:7788/api/v1/channel-create \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"request":{"name":"ops","idempotency_key":"create-ops"}}'

GET /api/v1/events is a Server-Sent Events stream, so a client can react to changes without polling. It uses the same bearer token. In a browser, read it with fetch(): EventSource cannot send an Authorization header, and the token must never go in a URL.

Terminal window
curl -N http://127.0.0.1:7788/api/v1/events -H "Authorization: Bearer $TOKEN"
Event Sent when Data
ready the stream opens {}
node.status peer counts, reachability, or relay reservations change the new summary
channel.message a message is stored in a channel this node keeps channel_id, message, author, encrypted
approval.request / approval.decision an approval request or decision involves this identity the request or decision ID, and the parties
invocation.update an invocation this identity takes part in is created, progresses, finishes, or is cancelled invocation, object, stage
agent.activity a local agent trigger or tool call changes state trigger, state, and tool_call / invocation for tool calls
agent.audit an agent you operate reports a reply or tool call agent, event, action, outcome
agent.reply an agent reports on a message this device or its account put to it in the last hour message, agent, action, outcome; ask agent-reply-status where it stands
provider.update the autopilot’s state for an incoming invocation changes invocation, capability_id, state
agent.tool-request an agent asks you for a tool, or its request is granted or declined agent, capability_id, state (pending, granted, declined)
contact.request someone asks to be your contact principal
conversation.read a conversation’s read marker moves, here or on another of your devices counterparty
direct.message a direct message to or from this identity is stored message, sender (the device), recipient, counterparty (the other side’s account, or device), from_self
lagged the client fell too far behind and missed events missed; refetch what you show

Events carry IDs only. Fetch the content through the ordinary operations, which apply their usual checks. The stream reports changes from the moment it opens, not history. Events arrive within about a second, whichever way the object arrived: from the network, through the API, or from a CLI command. A comment line keeps idle streams open every 15 seconds. At most 8 streams can be open at once.

The gateway calls the same handler as the local socket API, so every operation keeps its validation, idempotency, trust, and grant checks. It protects against other websites and other local users in these ways:

  • Loopback only. It listens on 127.0.0.1 and nowhere else.
  • Token. Every API call needs the session token as a bearer token. The token is regenerated at each start, stored in bnw-web.token with mode 0600, and never written to logs.
  • Host and Origin checks. A foreign Host header, which would indicate DNS rebinding, is refused. So is a foreign Origin, and there are no CORS headers.
  • JSON only. Requests must be application/json, which simple cross-site forms cannot send.
  • Browser headers. Responses carry a strict Content Security Policy that forbids framing, no-referrer, and no-store.