Skip to content
Back to skills

The Dealer

ASecurity

Operate a The Dealer collaboration node from Codex, Claude Code, or Antigravity: start with zero-config same-machine multi-agent dispatch, then join encrypted cross-machine and cross-team P2P networks to discover peers, send tasks and files, manage inbound approvals, and configure routes and sources.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentstypescriptrustgosqlnodeapi

Works with

  • claude code
  • cursor
  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add sensebeing/the-dealer --skill the-dealer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of The Dealer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for The Dealer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sensebeing-the-dealer/badge)](https://www.skillsdirectory.com/skills/sensebeing-the-dealer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: the-dealer
description: Operate a The Dealer collaboration node from Codex, Claude Code, or Antigravity: start with zero-config same-machine multi-agent dispatch, then join encrypted cross-machine and cross-team P2P networks to discover peers, send tasks and files, manage inbound approvals, and configure routes and sources.
---

# The Dealer

Use `dealer` with Node 22.23.3 or newer. From a checkout, use
`node --experimental-strip-types bin/dealer.js`. Set `DEALER_STATE_DIR` to
select an isolated node; the default is `~/.dealer`. Every command accepts
`--json` before or after its subcommand. Nonzero exit means failure; inspect
stderr's JSON error instead of treating failure as an empty result.

`the-dealer` is a **same-machine multi-agent collaboration and dispatch system
first**, and a cross-machine/cross-team P2P collaboration network only after a
network is mounted. Prefer Step 1 for local workspaces; mount a network only
when work must reach another machine or teammate.

## Setup and extension entry points

For first-time onboarding use [the-dealer-setup](../the-dealer-setup/SKILL.md).
For personal, project and team automation use
[the-dealer-extend](../the-dealer-extend/SKILL.md). This skill owns daily operation.

```sh
dealer setup probe --root . --json
dealer setup invite-prompt --network team --peer-member bob --ttl 1h --json
dealer setup binding-preset --host codex --mode fixed --topic collab.request.v4 --session-id review --json
```

Setup commands print read-only proposals both offline and with dealerd running.
Choose spawn for independent tasks, fixed for a dedicated conversation, or
inbox-only for manual handling. Apply generated bindings through validated
receiver configuration; host availability alone does not verify its CLI contract.

## Step 1 — same-machine collaboration (zero network config)

Start the local node and address it directly. No `network mount`, passphrase,
or peer discovery is involved, yet the message still goes through the same
gate, dispatcher, policies, and executors.

```sh
dealer node up --profile personal-dev --member alice --name laptop --skills agent-runtime --json
dealer send --network local --to member:alice --topic collab.request.v1 --body '{"summary":"Run the local quality sweep"}' --json
dealer send --network local --to skill:agent-runtime --topic triage --body '{"area":"agent-runtime"}' --json
```

`local` is only a stable scope name. Self-originated deliveries bypass
`approval_required` knocks but still respect `dnd` and `closed`. A linked
project's `defaultNetworkId` is the scope its source plugins emit on.

## Step 2 — cross-machine and cross-team P2P extension

Agree on a `networkId` and shared passphrase, then mount the same network on
every participating machine. Selectors, gates, policies, and executors keep
working unchanged inside the encrypted network.

```sh
dealer network mount sensebeing --passphrase "$TEAM_SECRET" --member alice --name laptop --json
dealer peers list --network sensebeing --json
dealer send --network sensebeing --to member:bob --topic collab.request.v1 --body '{"summary":"Review the release"}' --json
```

Pick the connectivity mode before mounting:

- **Same LAN** — UDP multicast and subnet broadcast on port 45873 discover peers
  automatically. Nothing else is needed.
- **Tailscale** — each node unicasts encrypted discovery beacons to every online
  `tailscale status` peer on UDP 45873 and dials the routed `100.64.0.0/10`
  address. Nothing else is needed once Tailscale runs on both machines.
- **Self-hosted headless relay** — when machines share neither a LAN nor full
  Tailscale coverage, run one always-on node with
  `dealer node up --profile headless-relay --json` and publish its endpoint as a
  seed: `dealer project init --root . --bootstrap-peers relay-host:port --json`
  writes `onboarding.bootstrapPeers` for every linked member, or add
  `--seed relay-host:port` to `dealer network mount`. Nodes gossip sealed
  discovery beacons and verified peer cards through the seed, and relay frames
  and attachments through it whenever direct TCP to the advertised endpoint
  fails. When the target is offline, the seed durably spools the sealed frame
  (deduplicated by envelope ID, 256 entries per target, 7-day TTL) and its
  content-addressed attachments, then drains in FIFO order when that target
  reconnects. Relay nodes never read message payloads; frames stay sealed with
  the network key and only members that can unseal them are accepted.

Use `dealer node up --advertised-host <host> --json` (or set
`DEALER_ADVERTISED_HOST` for `dealerd`) when a machine must advertise a specific
routable address instead of the detected LAN IP.

## Inspect and connect

```sh
dealer node status --json
dealer node up --profile personal-dev --member alice --name laptop --skills ios-crash,runtime --json
dealer network mount sensebeing --passphrase "$TEAM_SECRET" [--default-for-member] --json
dealer network default sensebeing [on|off] --json
dealer network list --json
dealer node card --network sensebeing --json
dealer peers list --network sensebeing --skill ios-crash --status idle --json
dealer peers resolve member:bob --network sensebeing --json
dealer peers prune --network sensebeing --unreachable --json
```

`node up` starts a detached `dealerd`; commands then use its private Unix
socket. `dealerd` can also run in the foreground under a process supervisor.
Stop it with SIGTERM/SIGINT. Configuration and identity persist in stateDir;
protect it because it contains network passphrases and private keys. A lock
prevents two processes from controlling one stateDir. Following a crash,
verify the PID in `runtime.lock/owner.json` has stopped before removing that
lock and restarting. Never remove a live node's lock.

Use `--seed host:port,host:port` for explicit bootstrap endpoints. A seed also
relays frames and attachments when a peer's advertised endpoint is unreachable,
so one reachable `headless-relay` node connects machines that share no LAN.
Network mounts can include `--gate approval_required`, `--default-for-member`, and a descriptive
`--role`; role is local metadata, not an authorization grant. Use
`dealer network default <networkId> [on|off] --json` to inspect or toggle whether this
node is the default recipient for its member on that network (signed into its `NodeCard`
and persisted in `config.json`, isolated per network). When one node for a member declares
`defaultForMember`, `member:<name>` (and team-registry routing) targets only that default
node and queues in outbox if it is offline instead of falling back to another online
machine; if two nodes for the same member both claim default on the same network, routing
fails explicitly with `AmbiguousDefaultMemberNodeError`. Explicit `member@nodeName`,
`ed25519:` selectors, and existing thread `reply`/`ask`/`settle` routes always keep their
explicit node target. Wait for peer
discovery before resolving a newly connected member. Current transport uses
encrypted TCP plus local discovery and sealed relay fallback; this is not a
claim of production QUIC/NAT traversal.

`dealer network invite sensebeing --ttl 1h --json` returns a
`dealer-net://v1/...` URI. Mount the quoted URI as the network argument. It
contains the secret: share it only with the intended team. Expiry is checked
when importing; it cannot revoke an already learned passphrase.

## Send an authorized request

```sh
dealer send --network sensebeing --to member:bob --topic collab.request.v1 --body '{"summary":"Review the runtime boundary"}' --attach ./spec.md --attach ./repro.log --json
dealer send --network sensebeing --auto-route --topic triage --body '{"category":"ios-crash"}' --json
dealer broadcast --network sensebeing --topic team.announcement --body 'Review window starts now' --json
```

For repeatable requests, use `dealer send --idempotency-key <key>` with the same non-empty key on retries; the sender reuses the durable outbox obligation instead of emitting another request.

Choose exactly one of `--to` and `--auto-route`. Selectors include
`member:bob`, `bob@laptop`, `skill:ios-crash`, and a full `ed25519:` NodeId.
`--urgency normal|high|critical` maps critical to the wire's urgent priority.
JSON object bodies also become the structured payload. Routing first uses
explicit selectors, then capabilities, then configured agent/API judges.
Configure a judge before relying on freeform auto-routing.

Attachments travel as BLAKE3 content-addressed blob tickets. The receiving
runtime fetches and verifies them into its private `attachments/` directory
before executing, exposing paths in `payload.localAttachments`. A relay seed
that spooled the message also retains its verified attachment copies, so the
original sender may go offline; without a spooling seed, the sender must remain
available until fetching finishes.

A `pending_approval` receipt means delivered to the gate, `queued` means
waiting, and `dispatched` means handed to an executor—not agent completion.
Broadcast has no per-peer delivery acknowledgements. Do not claim execution
from a successful broadcast command alone.

## Offline delivery and the outbox

Addressed unicast or multicast sends (`send`, `reply`, `ask`, `settle`) do not fail the
whole operation when the target peer is unreachable and a durable outbox is configured:
the structured result reports a queued outcome owned by the local outbox. That outcome is
a confirmed durable obligation, not evidence of execution. Acknowledge your current inbox
lease and end the turn; do not poll, sleep, or re-send the same message.

Broadcast is best-effort and is never queued per peer: it has no per-peer
acknowledgements, so a successful broadcast command does not prove any member received it.

```sh
dealer outbox list --json
dealer outbox list --network sensebeing --status queued --json
dealer outbox flush --json
dealer outbox flush --id <message-id> --json
dealer outbox flush --force --json
dealer outbox requeue --id <message-id> --json
```

Redrive is automatic and settles an obligation only through the target's signed
receipt; unsigned, forged, mismatched or rejected receipts fail the item instead of
keeping it queued. The verified peer directory persists across restarts, and a relay
seed's spool (when configured) holds the frame and verified attachments until the
target reconnects. A peer that slept and woke without restarting keeps the same signed
card, so transport's own live evidence (a fresh sealed beacon or the peer's tunnel)
triggers the redrive; a target that stayed online but timed out is reconciled on its
normal backoff and answered idempotently by the receiver's delivery ledger. The
authoritative state machine, receipt semantics and durable storage layout live in
[`docs/architecture.md`](../../docs/architecture.md).

Forgeries, signature failures, receipt mismatches and other protocol errors are
never converted into queued receipts. They fail the command (or mark a redrive item
`failed`) and must be investigated rather than retried blindly.

## Inbound gate

```sh
dealer gate mode approval_required --network sensebeing --json
dealer gate list --network sensebeing --json
dealer gate approve ENVELOPE_OR_APPROVAL_ID --trust-sender --json
dealer gate reject ENVELOPE_OR_APPROVAL_ID --reason 'Outside current scope' --json
dealer gate trusted --network sensebeing --json
dealer gate trust member:alice --network sensebeing --json
dealer gate untrust member:alice --network sensebeing --json
dealer gate mode dnd --json
dealer gate drain --json
```

Modes are `open`, `approval_required`, `dnd`, and `closed`. A network override
wins over the default gate mode. `drain` explicitly dispatches DND backlog;
it is not an inspection command. `--trust-sender` and `dealer gate trust`
durably trust a node (`node:<id>` or `ed25519:...`) and/or claimed member
(`member:<name>` or bare name) within the specified shared-secret network.
Members are not independently certified identities: only mount networks whose
members you trust. Trusted senders skip `approval_required` knocks (symmetric
with locally originated deliveries), while `dnd` still queues them, `closed`
still rejects them, and higher-priority custom gate rules/hooks still run first.
Mode changes do not revoke persisted trust; revoke grants explicitly with
`dealer gate untrust` (note `approve --trust-sender` records both `node` and
non-empty `member` entries, and `untrust` returns any `remaining` entries).

Gate pending approval items are in-memory; DND queue entries and trusted
senders persist on disk in `gate-dnd.json` (`dealer gate trusted` reads a
snapshot without starting the daemon when offline). CAS policy watermarks
(`dedup-watermarks.json`), identity, mounts, configuration, source cursors,
the dispatch ledger, `mailbox.sqlite`, wake targets, thread routes, the verified
peer directory (`peers.json`), the outbox (`outbox.json` + `outbox-blobs/`) and
relay-spool entries persist on disk. A persisted `dispatching` or `failed` entry
must be reconciled with the external executor before retrying.

## Sources, routes, profiles and plugins

```sh
dealer route add --type local-agent --command codex --json
dealer route add --type llm-api --endpoint https://example.org/v1/chat/completions --model MODEL --json
dealer source add --type webhook --port 8787 --token "$WEBHOOK_TOKEN" --json
dealer source add --type poll-watermark --url http://127.0.0.1:9000/events --interval-ms 10000 --json
dealer source add --type script --command /path/to/source --args '["--jsonl"]' --json
```

`--config file.json` supplies plugin-specific settings. Only configure trusted
commands and endpoints: routes and sources execute locally or send task
content to the selected model service. Install source definitions once; do
not repeatedly add them while checking status.

Read [profile-and-patch-spec.md](references/profile-and-patch-spec.md) to
select profiles, overlay node configuration, bind Orca waves, and set rotation.
Read [writing-custom-plugins.md](references/writing-custom-plugins.md) to
implement a Source, RouteJudge, GateRule, DispatchPolicy, or WorkExecutor.

## Project and personal plugins

The three tiers are the built-in profile, repository-owned project modules, and
personal configuration/modules. Only load trusted local code.

```sh
dealer project init --root ./project --id project --network team --skills triage --json
dealer project init --root ./project --id project --network team --bootstrap-peers relay-host:45874 --json
dealer project link ./project --json
dealer project list --json
dealer project status --project project --json
dealer project unlink project --json
dealer plugin add --name personal-hook --module plugins/personal-hook.ts --config ./settings.json --json
```

`init` creates `.dealer/project.json` and `.dealer/plugins/`, refusing overwrite.
Without flags it uses the current directory, its basename as project ID, and
that ID as default network. `--bootstrap-peers host:port,...` writes
`onboarding.bootstrapPeers`, so every machine that links the project mounts the
network with those relay seeds. Put project TypeScript/ESM plugins in
`.dealer/plugins/*.ts` and list their root-relative paths in manifest `plugins`.
`link` defaults to the caller's current directory. It loads modules immediately
and persists the link for restart; it does not mount the default network.

Personal overrides default to `~/.dealer/projects/<id>.patch.json`, or use
`project link --user-patch ./custom.json`. A patch can supply `skills` and
`pluginConfig: { "plugin-name": { ...settings } }`; per-plugin settings shallowly
override manifest config. Skills are merged/deduplicated and remain after unlink.
Standalone user modules such as `~/.dealer/plugins/personal-hook.ts` are installed
by `plugin add`, with module paths relative to stateDir (`DEALER_STATE_DIR` can
replace `~/.dealer`). `--config` is a JSON object file relative to the caller.

`status` returns linked manifests, loaded plugin names, and personal plugins.
Unlink cleans up only the project's registrations; it retains project files,
personal patches and personal plugins. Restart loads projects then user plugins.
Relink applies updated configuration; restart after changing module source due
to Node's import cache. `topics.<kind>.defaultExecutor` selects the receiving node's default executor for that topic when `payload.executor` is omitted (or blank). `defaultNetworkId` remains metadata.
See [the plugin guide](../../docs/plugin-guide.md#3-three-tier-onboarding-built-in-project-user)
for the manifest, factory context and lifecycle contracts.


## Local inbox

The `inbox` executor retains messages and materialized attachments in the durable
`mailbox.json` ledger. Each message is routed to a logical mailbox (`default`,
`stream:<streamKey>` for wave/fixed bindings (including `orca-wave`), `task:<messageId>` for spawn bindings (including `orca-spawn`), or an
explicit `semantic.targetMailbox` / `payload.mailbox`). A mailbox has at most one
unacknowledged delivery lease (`dlv_<12hex>`), so re-running `check` returns the same
batch until it is acknowledged; newer mail queues behind the lease and is never mixed
into it. `list` is a read-only view and never mints a lease. Commands work against the
running daemon (streaming control socket with keepalives) or directly against the saved
mailbox when offline.

```sh
dealer inbox check --json
dealer inbox check --mailbox stream:alerts --wait --timeout-ms 900000 --json
dealer inbox check --ack <dlv_id> --json
dealer inbox ack <dlv_id> --mailbox stream:alerts --json
dealer inbox list --mailbox stream:alerts --limit 20 --json
dealer inbox list --all --json
```

`--peek` previews the current mailbox, including an outstanding lease, without
minting or mutating a lease. Repeating `ack` for the same lease is an idempotent
no-op; an unknown or mismatched lease fails loudly. Legacy `~/.dealer/inbox.json`
data is migrated once into the `default` mailbox on startup.

Executors durably enqueue mail and record a `wakeTarget` before injecting
anything into a terminal. `WakeupRedriveService` is the only wakeup owner. On
new mail and on a timer it re-reads `mailbox.json`, verifies the authoritative
Orca workspace/terminal idle gate, then sends exactly one single-line pointer:

```text
You have N Dealer message(s) in <mailbox> [hint]. Run `dealer inbox check --mailbox <mailbox> --json`.
```

If an unacknowledged lease predates newer queued mail, the pointer names the
lease instead (`Unacknowledged Dealer batch <dlv> + N newer message(s)`) and
includes the `--ack <dlv>` recovery command. A busy, timed-out, or unverifiable
terminal is never typed into: retries use 1s → 2s → 5s → 10s backoff, and a
daemon restart re-arms every pending target from disk. Acknowledge the batch
after handling it, then end your turn; when the mailbox reaches
`rotateAfterWaves`, the next wave opens a new agent session tab in the same
Orca workspace once the retiring slot's own agent and its child worktrees are
done, then closes the retired tab after the replacement launch commits (an
unsent draft in the retired tab does not block rotation; the tab is never reset
with `/new`). Fixed
Orca workspaces default to `rotateAfterWaves: 1`, so each wave gets its own tab
and the first wakeup never takes over a conversation tab you already have open.
Pending leases, wake targets, and thread routes are not lost on restart.

## Ask, reply, settle, and inspect a thread

These commands are non-blocking: they return as soon as the signed envelope is
dispatched. The other side is woken by the durable mailbox pointer, so never
poll or wait for a reply in the same turn.

```sh
dealer ask --network local --to member:bob --target-mailbox worktree:bob-wt \
  --subject 'Runtime boundary' --body '{"question":"Who owns retries?"}' --json
dealer ask --reply-to <inbound-envelope-id> --body 'Follow-up question' --json
dealer reply <inbound-envelope-id> --body 'The dispatcher owns retries' --json
dealer settle <inbound-envelope-id> --outcome succeeded --summary 'Verified' --json
dealer thread show <envelope-or-thread-id> --json
dealer thread prune <message-id> --json
```

`ask --reply-to`, `reply`, and `settle` resolve the thread's reverse route
(peer node, network, topic, target mailbox, reply mailbox) and can acknowledge
the local lease by passing `--ack <dlv_id>`; the lease is only acknowledged
after the send actually commits (a live handoff or a durable outbox queue), so
a failed send leaves it intact for a retry. `dealer settle` requires
`--outcome` (`succeeded`, `failed`, or `cancelled`) and a `--summary` (or body
fallback). `thread show` returns the merged thread state and both directional
records; it works through the daemon or directly against the saved mailbox.
If a send failed without queueing and left an unconfirmed orphan outbound
thread record, `dealer thread prune <message-id>` removes only that `outbound:`
leg and recomputes the thread state; it refuses `inbound:` ids and refuses a
message the outbox still holds as `queued` or `delivered` unless you pass
`--force`.
Inside Orca, `ORCA_WORKTREE_ID`/`ORCA_TERMINAL_HANDLE` bind the caller's
worktree or terminal automatically. Mutating caller operations also capture
`ANTIGRAVITY_CONVERSATION_ID`, `CLAUDE_CODE_SESSION_ID`/`CLAUDE_SESSION_ID`, or
`CODEX_THREAD_ID`/`CODEX_SESSION_ID`, plus `ORCA_PANE_KEY`/`ORCA_AGENT_PANE`.
When that workspace sleeps, incoming thread mail reuses the restored pane or
resumes the recorded conversation in a background tab with auto-permissions,
without taking over a sibling tab. Session rotation starts a fresh conversation
and clears the previous session/pane identity while durably recording the retired
session ID. Newly configured sessions reset the wave count and take effect immediately.
`interactiveCommand` is the fresh-session launch command and must not contain
`{sessionId}`. Custom host commands retain their model flags when resuming. For
opaque wrappers, configure both a fresh `interactiveCommand` (for example,
`custom-wrapper --auto`) and a matching `resumeCommand` with an unquoted standalone
`{sessionId}` token (for example, `custom-wrapper --auto --session {sessionId}`).
Rotation and recovery after rotation use the fresh command; incompatible launch
settings are cleared when the caller host changes. `inbox list` and `inbox check
--peek` do not change these bindings. Omit `--mailbox` for two-way ask/reply/
settle conversations; each side wakes the other's Orca terminal. `dealer ask`
defaults to `collab.question.v1` when `--topic` is omitted, and
`--target-mailbox worktree:<name>` addresses a named Orca worktree.
For plain messages, address a logical mailbox with
`dealer send --mailbox <id> --reply-mailbox <id> --subject '...'`. When
`dealer send` runs inside Orca without an explicit `--reply-mailbox`, it binds
replies to the caller's worktree mailbox unless that caller is already the
topic's bound workspace/mailbox; non-Orca callers continue to use the topic binding.
# Lifecycle and updates

Use `dealer node down` for a graceful drain and shutdown, or `dealer node restart` to drain and start again; if the drain cannot quiesce, the daemon keeps serving and the result reports `stopped:false` (`--force` is the explicit override). `dealer self-update` fast-forwards a clean `main` checkout and repairs installed skill links. Running daemons expose a `runtimeFingerprint`; edits to host or linked project files are detected by the daemon's own watcher, which schedules an idle-gated automatic drain and restart. Ordinary commands never restart the daemon synchronously.

Orca conversation identity and continuation policy belong to the receiver-owned
`plugins-orca` driver configuration; the generic mailbox stores opaque
`driverConfig` and fences asynchronous launch and settlement with `bindingRevision`.
A concurrent rebind preserves the newer conversation and redrives its pending mail.

Files in this skill

  • SKILL.md21.7 KB
  • agents/openai.yaml206 B
  • references/profile-and-patch-spec.md5.4 KB
  • references/writing-custom-plugins.md4.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.