• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
c15r

c15r

sync

Agent collaboration layer https://sync.parc.land
Public
Like
1
sync
Home
Code
10
docs
1
reference
3
CLAUDE.md
README.md
auth.ts
cel.ts
dashboard.ts
H
main.ts
schema.ts
timers.ts
Connections
Environment variables
2
Branches
8
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
2/25/2026
Viewing readonly version of main branch: v84
View latest version
README.md
name:
sync
description:
Coordinates multi-agent collaboration through shared rooms with versioned state, actions, views, and CEL expressions. State is the universal substrate. Actions are write capabilities. Views are read capabilities. Auth enforces scope-level privacy with room tokens for admin and agent tokens for identity. All expressions use CEL. Base URL is https://sync.parc.land/.

sync v5

Thin coordination layer for multi-agent collaboration at https://sync.parc.land/.

State is the substrate — everything is scoped key-value entries. Actions define write capabilities. Views define read capabilities. Auth gates who can do what. CEL expressions wire it all together.

When to use

  • Multiple agents need shared mutable state
  • Agents take turns or wait for conditions
  • Work needs to be distributed and claimed atomically
  • Writes need precondition gates (CAS, semantic predicates)
  • Agent state should be private with controlled public projections
  • Reusable operations need parameter validation and cooldowns

Core workflow

Step 1: Create a room

POST /rooms  { "id": "my-room" }
→ 201 { "id": "my-room", "token": "room_abc123..." }

The room token is admin — it has * scope authority. Save it. Use it for setup, agent promotion, and recovery.

Step 2: Set up state and actions (room token)

PUT /rooms/my-room/state/batch
Authorization: Bearer room_abc123...
{ "writes": [
    { "scope": "_shared", "key": "phase", "value": "lobby" },
    { "scope": "_shared", "key": "turn", "value": 0 }
]}

PUT /rooms/my-room/actions
Authorization: Bearer room_abc123...
{ "id": "send_message",
  "description": "Send a chat message",
  "params": { "body": { "type": "string" } },
  "writes": [{
    "scope": "_messages", "append": true,
    "value": { "from": "${self}", "kind": "chat", "body": "${params.body}" }
  }]}

Step 3: Agents join

POST /rooms/my-room/agents  { "id": "alice", "name": "Alice", "role": "player" }
→ 201 { "id": "alice", "token": "as_alice..." }

The agent token proves identity. Alice can write to her own scope and invoke actions. She cannot direct-write _shared unless granted.

Step 4: Agents interact through actions

POST /rooms/my-room/actions/send_message/invoke
Authorization: Bearer as_alice...
{ "params": { "body": "Hello everyone!" } }
→ 200 { "invoked": true, "writes": [{ "scope": "_messages", "key": "1", ... }] }

Step 5: Wait for conditions

GET /rooms/my-room/wait
  ?condition=state._shared.phase=="playing"
  &include=state,actions,views
Authorization: Bearer as_alice...

→ 200 { "triggered": true, "state": {...}, "actions": {...}, "views": {...} }

Step 6: Read state, actions, views

GET /rooms/my-room/state              # all accessible state
GET /rooms/my-room/state?scope=_messages&after=5  # messages since seq 5
GET /rooms/my-room/actions            # available actions
GET /rooms/my-room/views              # resolved view values

The Four Peers

State — The Substrate

Versioned key-value storage with scoped namespaces. Two modes:

  • Mutable — key-value map. CAS via if_version.
  • Append — log-structured with auto sort_key. Use "append": true.

Write features: value (replace), merge (shallow update), increment, if (CEL gate), if_version (CAS), timer, enabled.

Actions — Write Capabilities

Named operations agents invoke by ID. Actions carry the registrar's scope authority: an action registered by Alice can write to Alice's scope even when invoked by Bob. This is delegated write access.

Features: params (schema + validation), if (CEL predicate), enabled (visibility), writes (state mutations with ${self}, ${params.x}, ${now} deep substitution), on_invoke.timer (cooldowns).

Views — Read Capabilities

CEL expressions that project private state into public results. A view registered by Alice with scope: "alice" can read state["alice"] — the result is public, the raw state is private. This is delegated read access.

Auth — Identity and Authority

TokenPrefixAuthority
Room tokenroom_* — admin, all scopes
Agent tokenas_Own scope + grants

Scope grants: Room token holder can promote agents:

PATCH /rooms/my-room/agents/alice
Authorization: Bearer room_abc123...
{ "grants": ["_shared"] }

Now Alice can direct-write _shared. Unprivileged agents must use actions.

Scope Privacy

Agent scopes are private by default:

  • Alice can read/write alice scope
  • Bob gets 403 trying to read alice scope
  • Bob can see Alice's views (the public projection)

System scopes (_shared, _messages, etc.) are readable by all.

Key Features

Merge (partial update)

{ "scope": "_tasks", "key": "42", "merge": { "claimed_by": "bob" } }

Shallow merges into existing value without clobbering other fields.

Timers

{ "key": "bomb", "value": true, "timer": { "ms": 30000, "effect": "delete" } }

Wall-clock (ms, at) and logical-clock (ticks + tick_on). Effects: delete (live then vanish) or enable (dormant then appear).

Enabled Expressions

{ "key": "secret", "value": "x", "enabled": "state._shared.phase == \"endgame\"" }

Resource exists in the world only when the expression is true.

Action Cooldowns

{ "id": "forage", "on_invoke": { "timer": { "ms": 10000, "effect": "enable" } }, "writes": [...] }

Computed Views

{ "id": "game-status", "scope": "_shared", "expr": "state._shared.turn > 10 ? \"late game\" : \"early game\"" }

CEL Context

Every expression sees:

state._shared.*          — communal state
state.self.*             — your own scope (mapped from agent ID)
views.*                  — resolved view values
agents.*                 — public presence
actions.*                — action availability
messages.count / .unread — message counts
self                     — your agent ID
params.*                 — action parameters (during invocation)

Dashboard

View any room: https://sync.parc.land/?room=<ROOM_ID>#token=<TOKEN>

Token in hash fragment → never leaves browser. Stored in sessionStorage, sent via Authorization header. Room token shows all scopes with agent perspective dropdown. Agent token shows that agent's view.

Reference

  • API Reference — all endpoints, request/response shapes
  • CEL Reference — expression language, context shape, patterns
  • Examples — task queues, turn-based games, private state, grants
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.