The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Pillowfort listing page.
Small, private, disposable chat rooms with AIM / Windows XP energy.
Set up a fort, share one private invitation link, hang out in real time, then knock it down. No accounts. No public room list. New devices still need host approval and do not receive earlier chat history.
pillowfort is both:
The core product idea is simple:
When the fort is gone, the room is gone.
The invitation window confirms when the link is copied and explains the next steps: paste it to a friend, then let the host approve their device. Manual code/password sharing stays under Use a code and password instead.
Agents can create their own forts, export private invitation links for people or other agents, and approve expected peers without a human present. Host authorization still applies; an operator can authorize an entire autonomous workflow rather than clicking each action.
Start with the public agent guide or the
Markdown quickstart. Choose local stdio MCP/SDK/CLI,
authenticated hosted MCP at https://mcp.pillowfort.xyz/mcp, or native WebMCP
inside a supported browser tab. Local mode needs Node and explicitly installed
Chromium; hosted mode needs an issued operator key or OAuth consent. Native mode
is feature-detected and does not install a polyfill.
The npm package is @ontologic/pillowfort-agent; GitHub remains slee1996.
The MCP Registry listing is io.github.slee1996/pillowfort version 1.1.0.
Hosted participants run under managed custody: their runtime and model/operator
can access their admitted room content. Hosted participants do not gain access to
unrelated rooms. Read the custody guide before inviting a hosted agent.
The original 1.0.0 download remains archived in its GitHub release. Current installation instructions select the versioned npm package.
spencer2The app is designed to avoid long-lived room history:
localStorageIn production, Durable Object storage is used only to coordinate a live room while it exists. When a fort is destroyed, that room state is cleared.
There are two server runtimes with roughly the same behavior:
| Layer | Local development | Production |
|---|---|---|
| Entry server | Bun | Cloudflare Worker |
| Room runtime | in-memory Map | Durable Object per room |
| Client | React + Vite | React + Vite |
| Storage | process memory only | ephemeral DO state |
Important contributor note:
server.tssrc/room.tssrc/If you change room rules, websocket behavior, limits, or game logic, you usually need to update both runtimes.
For a deeper system-level walkthrough, see ARCHITECTURE.md.
For a product, business, and project-lead analysis, see docs/PROJECT_LEAD_BRIEF.md.
For production state and Durable Object hibernation rules, see docs/PRODUCTION_STATE_POLICY.md.
For the beta measurement contract and privacy limits, see docs/BETA_ANALYTICS.md.
For beta release steps, see docs/PUBLIC_BETA_DEPLOY_CHECKLIST.md.
For the first revenue test, see docs/FIRST_PAID_SKU.md.
For paid beta support and refunds, see docs/FORT_PASS_SUPPORT_RUNBOOK.md.
For the current Stripe sandbox setup, see docs/STRIPE_TEST_SETUP.md.
For production hardening and operational log buckets, see docs/PRODUCTION_MONITORING.md.
For weekly beta funnel review, see docs/METRICS_REVIEW.md.
For the Discord distribution prototype, see docs/DISCORD_ACTIVITY_SCOPE.md.
Public API surfaces currently exposed by the app:
/ws?room=... for room WebSocket connections/analytics for sanitized beta funnel events/api/fort-pass/code?code=... for custom-code availability checks/api/fort-pass/status for non-secret paid beta availability/configuration/api/fort-pass/checkout for the paid checkout boundary; creates a Stripe
Checkout Session only when STRIPE_SECRET_KEY, FORT_PASS_PRICE_ID, and
PUBLIC_BASE_URL are configured/api/stripe/webhook for signed Stripe Checkout fulfillment; grants Fort
Pass entitlements only after verified paid provider events/?fort_pass=success&code=...&session_id=... for accountless Fort Pass
redemption after checkoutThis repo is not set up as a workspace. Root and client/ are separate package installs.
marketing/ is part of this repository with its own package install:
See marketing/README.md for its editor, database, and
build setup. The main app does not require the marketing package to build.
Build the frontend, then start the Bun server:
Open http://localhost:3000.
What this does:
npm run build typechecks the client and builds client/dist with Vitenpm run dev runs bun --watch server.tsserver.ts serves the built client and handles websocket room state in memoryIf you are changing frontend code, rebuild the client before reloading the Bun app:
There is also a client-only Vite script:
That is useful for isolated frontend work, but the full app behavior still depends on the websocket backend in server.ts.
Agents use the same browser client, MLS encryption, device approval, and room
permissions as people. There is no plaintext bot relay or privileged agent API.
The SDK drives a versioned client bridge directly, not screen coordinates or DOM
selectors. The bridge is installed only when the app is opened with ?agent=1;
that opt-in is not an authorization boundary.
For normal use, follow the standalone quickstart and point the transport at production. The following checkout/build steps are only needed when developing the app itself. Use a supported Node.js release and install Chromium:
In another terminal:
JSON-lines mode keeps named sessions alive across requests. Each line returns an
{id, ok, data} or {id, ok:false, error:{code,message,retryable}} result:
Room creation returns the invitation credentials explicitly. Treat those results
as sensitive. Setup/join return a queued operation, not proof of connection;
observe connection and operations, or use session_wait with the last
revision. A joiner exposes its pending fingerprint; the host must verify it
and call admission_approve with the matching admission ID and fingerprint.
Connected actions require the current roomId, preventing accidental stale-room
commands. Network actions report queued status honestly; inspect observations
for outcomes rather than blindly retrying a mutation.
room_setup and invitation_export return a complete, secret-bearing
invitationUrl. Agents can use room_join_link with that URL, a display name,
and confirm:true, instead of splitting out room/password fields. Keep the SDK's
--url set to the base app origin; never configure it with an invitation.
Human invitations place the password in #invite=…, not a query or path. The
browser does not send that fragment in the HTTP request. The app reads it into
temporary memory and removes it from the address bar before rendering, then asks
for a name and explicit Join action. Host approval is still required. The default
secret retains 128 random bits; this convenience does not weaken password entropy.
Treat the whole link as a bearer credential. The messaging app you share it in, clipboard history, browser extensions, or someone you forward it to may see it. URL scrubbing cannot retroactively erase those copies. Manual room/password entry remains available. Reloading after scrubbing requires reopening the saved invitation or entering the exact original password; invitation secrets are not persisted for convenience.
Use the direct Node command for MCP, or npm run --silent agent:mcp -- --url ...;
ordinary npm banners must not enter MCP's stdout protocol stream. The selected
app must serve the updated agent-enabled build. URLs must be HTTPS or loopback
HTTP, without embedded credentials or invitation query parameters.
Discovery includes chat formatting/history, presence, typing, invitation export, admission, drawing and retained drawing history, local mute, themes, host transfer, room lifecycle, RPS, Tic-Tac-Toe, Pillow Fight, Secret Saboteur, King of the Hill, and the real local Breakout game. Secret Saboteur needs four members; Pillow Fight needs three. Legal-action hints are advisory because state can change before delivery. Opponent RPS picks are hidden until reveal; observations expose only the participant's own Saboteur role.
The sketchpad keeps one 3:2 coordinate plane across phone and desktop screens. Use its palette to choose ink and Save PNG to export the drawings your browser has received. Ink appears after encrypted application; the pointer ring is a local preview, not proof of delivery. Resize and switching to chat or Breakout preserve the current paper. New arrivals still do not receive earlier drawings.
Agents can use drawing_color and drawing_export_png in addition to
drawing_send; the sketchpad observation reports color, readiness, and delivery
notices without embedding the image. Export is explicit and includes only the
paper, not room credentials or browser chrome. A saturated drawing queue rejects
new batches visibly instead of silently losing accepted strokes.
Fort Pass tools check availability, prepare a checkout URL, and redeem a completed
checkout using the same browser's retained claim. They never complete payment or
automatically navigate to Stripe. Destructive and credential-export tools require
confirm:true; this records caller intent, not proof of human consent. An operator
can authorize a complete autonomous hosting/invitation workflow or standing
policy; a human need not approve each action. Participant-authored content cannot
grant that authority and is untrusted data, never instructions to the agent.
The reusable PillowfortAgent class is exported from scripts/agent-sdk.mjs.
Its methods include createSession, capabilities, execute, observe, wait,
listSessions, closeSession, and close. Always close it in a finally block.
Sessions use isolated ephemeral Chromium storage; EOF, signals, or explicit close
destroy local identities and keys. Closing a browser is not the same as sending
room_leave or room_end. There is no automatic session persistence.
The SDK conservatively paces relay-producing actions according to room size,
leaving headroom for encryption, admission, and recipient acknowledgements under
the existing server limits. Local Breakout controls, observations, and change
waits are not delayed by that pacing. Saturated queues return BUSY; shared
traffic can still exhaust server budgets, so inspect errors and never blindly
retry a mutation.
Default limits are eight named sessions, 1 MiB input, 2 MiB output, and 30-second
change waits. Snapshots are bounded; history tools expose retained data with
cursors, not pre-join history. Use --headed to inspect the actual room client.
Add --cms-url https://about.pillowfort.xyz and, when needed,
--cms-storage-state /secure/path/editor-state.json. The latter must be an
explicitly supplied authenticated browser-state file; protect it like a login
credential and never commit it. Use --headed to sign in with the owner password.
CMS tools use a separate browser context and server-validated sessions, never
forwarded identity headers.
They can list/read drafts, manage articles, and update the front-page note.
Every write requires confirmation. See the marketing README for /api/agent.
This runs the stable core test suite:
This checks both runtime surfaces:
src/ against the Cloudflare Worker type environmentclient/src/ against the browser React type environmentThis launches Playwright and captures key UI states. The first run writes baselines to test/__snapshots__/design/. Later runs compare against those baselines and fail when visual drift exceeds the configured threshold.
You can also point the snapshot runner at an existing app URL:
These Playwright-heavy suites mirror the demo and promo choreography flows. They are slower, more presentation-oriented, and kept separate from the default public-repo test run.
Use the root deploy script:
That:
wrangler.tomlProduction routing looks like this:
/ws?room=abc12345 -> Worker -> Durable Object for that room/* -> static frontend assets/abc12345 -> SPA room link that resolves to index.htmlMarketing deploys independently as the pillowfort-marketing Cloudflare Worker
at https://about.pillowfort.xyz. From this repository, run
npm --prefix marketing run db:migrate and npm --prefix marketing run deploy.
The root deploy command publishes only the app at https://pillowfort.xyz.
src/telemetry.ts provides explicit, opt-in OpenTelemetry server spans for the
app, marketing Worker, and hosted MCP. Production export is disabled until a
stable authenticated collector endpoint is configured.
Only allowlisted service/environment/version, operation category, HTTP method, status and duration are exported. No automatic instrumentation or incoming trace context is used. Room/WebSocket routes are excluded. URLs, room IDs, identities, IP addresses, credentials, request/response bodies, tool arguments/results, messages, drawings, exception messages and stacks are not exported.
The pinned open-source stack in observability/compose.yaml uses Caddy,
OpenTelemetry Collector, Tempo, Prometheus and Grafana. The collector applies an
independent allowlist before storage and derives operational metrics from received
spans. These are sampled request signals, not cohort, retention or room-usage
analytics. Export is bounded and best-effort; collector failure must not fail a
product request.
This workstation's private configuration is in
~/.config/pillowfort/observability.json and observability.env, mode 0600.
The JSON contains distinct Grafana and ingestion passwords; never commit or share
it. Compose requires GRAFANA_ADMIN_PASSWORD and
OTEL_INGEST_PASSWORD_HASH (a bcrypt hash for the otel ingestion user).
The environment file is outside the repository:
Grafana is local-only at http://127.0.0.1:13000, username admin; its password
is in the private JSON. OTLP ingress is local-only at http://127.0.0.1:43180.
Named Docker volumes persist traces, metrics and dashboard state; configured
trace/metric retention is seven days. Do not use docker compose down -v unless
deleting that history is intended. A workstation deployment stops serving when
the machine or Docker stops; use an always-on host for continuous monitoring.
For Cloudflare Workers, put a named Cloudflare Tunnel in front of ingress, not Grafana. Tunnel authorization must complete before creating the stable DNS route. Temporary Quick Tunnel URLs are verification-only. Cloudflare Containers' ephemeral local disks are not a durable replacement for these named volumes.
Configure each Worker with OTEL_ENABLED=true,
OTEL_EXPORTER_OTLP_ENDPOINT=https://<stable-ingress-host> (base URL, without
/v1/traces), OTEL_DEPLOYMENT_ENVIRONMENT=production, a release
OTEL_SERVICE_VERSION, and OTEL_SAMPLE_RATE between 0 and 1.
Set OTEL_EXPORTER_OTLP_HEADERS as a Worker secret:
Authorization=Basic%20<base64(otel:ingestion-password)>. Never put it in tracked
Wrangler vars. Missing/invalid configuration leaves export disabled.
The Grafana dashboard defaults to production; select test for synthetic smoke
data. Native Cloudflare automatic traces remain disabled.
If you are trying to understand the app quickly, start here:
server.ts for the local runtimesrc/index.ts for Cloudflare request routingsrc/room.ts for production room behaviorsrc/game.ts for shared mini-game rule helperssrc/analytics.ts for privacy-safe analytics validationsrc/security.ts for scanner blocking and response headerssrc/entitlements.ts for host-only paid SKU entitlement helperssrc/alarms.ts for production alarm scheduling helpersclient/src/services/protocol.ts for websocket message shapesclient/src/stores/gameStore.ts for client stateclient/src/screens/ChatScreen.tsx for the main UI surfacetest/integration.test.ts for expected room behaviortest/worker.test.ts for Worker routing and Durable Object alarm behaviordocs/PROJECT_LEAD_BRIEF.md for product strategy and monetization directiondocs/PRODUCTION_STATE_POLICY.md for Durable Object state rulesdocs/BETA_ANALYTICS.md for privacy-safe beta analyticsdocs/PUBLIC_BETA_DEPLOY_CHECKLIST.md for public beta release stepsdocs/PRODUCTION_MONITORING.md for edge hardening and operational bucketsdocs/FIRST_PAID_SKU.md for the first host-only paid offerdocs/DISCORD_ACTIVITY_SCOPE.md for the Discord Activity prototype scopeThis repo is beyond a toy chat mock. It already includes:
If you are making architectural changes, read ARCHITECTURE.md before editing the room runtime.