> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Parley as a Meet activity

> Plan and current state for running Parley scenarios inside Meet rooms and retiring the standalone Parley app.

Parley becomes an activity inside Meet rooms instead of a separate app. A host
opens **Scenario** from the Activities menu, presents a published scenario's
public briefing to the room, and participants claim human roles. The standalone
`parley.tuturuuu.com` app retires behind permanent redirects once Meet covers
every Parley route. Both halves ship behind flags that default to off.

## What Parley does that Meet lacks

| Capability | Parley today | Meet today |
| - | - | - |
| Scenario library | Published scenarios with briefing, roles and categories at `/` and `/scenarios/[id]` | None |
| Scenario session | `create_parley_session` creates a meeting plus an immutable snapshot in `private.parley_sessions` | Meet refuses Parley-session meetings (`Open this scenario in Parley`) |
| Roleplay AI | Mira uses the snapshot's private instructions; public Google Search is off | Mira uses Meet instructions; search can be on |
| Facilitator notes | Host-only observations, decisions and debrief in `private.parley_observations` | None |
| Review | `/sessions` archive and `/sessions/[meetingId]` review with the private rubric | Meeting details at `/[wsId]/meetings/[meetingId]` |
| Access | Verified `@tuturuuu.com` accounts or an enabled `private.parley_members` entry (`hasParleyAccess`) | Workspace membership, room policy and guest admission |
| Authoring | `/manage/scenarios` and Infrastructure **Platform administration → Parley** | None |

## Activity design

The activity is a registry entry (`live-parley`) in
`packages/meet-core/src/features/call/tools/registry.ts`, so it opens in a
stage pane like Q\&A or Icebreaker and follows the same rules for who may browse
the hub (`roomTools.canUse`, or room activity runners for workspace co-hosts).

State lives in the room's existing live-activities state on the Meet realtime
Durable Object and travels over the existing `activity.read` /
`activity.command` channel. The room is the authority:

* `parley.present` sets or clears the scenario. Only people who run room
  activities (`canMeetRealtimeRunActivities`) may send it. The room issues a
  fresh `scenarioId` and drops every role claim each time.
* `parley.claim` takes or releases one human-controlled role. Any admitted
  participant may send it. It names the `scenarioId` on their screen, so a
  claim made for an earlier scenario is refused. One role per person, and one
  person per role.
* The room snapshot carries the public scenario fields and the claims. Nothing
  private enters the room: role briefs, AI instructions, the rubric and
  references never leave the server.

A host picks a scenario from `GET /api/meet-call/[meetingId]/parley-scenarios`,
which requires the meeting's host or room activity runner and `hasParleyAccess`
for the signed-in account. It returns at most 100 published scenarios through
`listScenarios`, which already blanks role briefs. Presenting copies only the
title, category, briefing and role names into the room. A host can already
broadcast free text through Icebreaker, so presenting a briefing adds no new
trust.

Rate limits and size limits are the live-activities ones: one shared action
budget per account per minute, a 112 KiB view and a 256 KiB stored state.
No new Cloudflare operation type is introduced; each command is one Durable
Object message, as for every other activity.

### Flags

| Flag | Where | Default | Effect |
| - | - | - | - |
| `MEET_LIVE_PARLEY_ENABLED` | `packages/realtime/src/meet/live-parley.ts` (compile-time constant) | `false` | Off: the room refuses `parley.*` commands, omits `parley` from every view, Meet does not list the activity, and the scenario route returns 404. |
| `PARLEY_MEET_REDIRECT` | `apps/parley` runtime variable | unset (off) | `on`: the Parley proxy answers mapped routes with a 308 to Meet before authentication. |

Turn on the realtime flag in a release that deploys the realtime Worker before
the Meet app. A room that runs older code refuses `parley.*` commands as
malformed, so the panel shows its outdated-version notice instead of failing
silently.

## Data and permission mapping

| Parley concept | Meet activity equivalent | Slice |
| - | - | - |
| Published scenario (`private.parley_scenarios`, public fields) | Picker list from the scenario route | 1 |
| Briefing shown to the room | `parley.present` room snapshot | 1 |
| Roles (`human`, `ai`, `observer`) | Role list; only `human` roles can be claimed | 1 |
| Parley access (`hasParleyAccess`) | Required to list scenarios; presenting needs room activity runner | 1 |
| Immutable snapshot (`private.parley_sessions`) | Write a snapshot keyed by the Meet meeting when a scenario is presented, without making the meeting a Parley-only session | 2 |
| Mira scenario roleplay | Per-meeting scenario instructions and search off when a snapshot exists, not per `MEETING_APP` | 2 |
| Facilitator notes (`private.parley_observations`) | Host-only notes section in the activity | 2 |
| Session review and rubric | Meeting details page section, facilitator only | 3 |
| Scenario authoring | Stays in Infrastructure; `/manage/scenarios` retires | 3 |

Slice 2 must replace the `parleySession && MEETING_APP !== 'parley'` refusals in
`call-access.ts` and `meeting-ai/server/access.ts` with a Parley-access check
for scenario meetings, so existing Parley rooms open in Meet with the same
admission rule they have today.

## Redirect map

`apps/parley/src/meet-redirect.ts` maps each Parley page to Meet. The locale
prefix (`/en`, `/vi`) and the query string carry over, and room codes stay
unchanged because both apps encode the same meeting ids. Every redirect is a
308\. Authentication callbacks, `/api/*`, `/login`, `/verify-token` and
`/access-denied` are never redirected, so in-flight sessions and API clients
keep working until the Worker retires.

| Parley route | Meet target |
| - | - |
| `/` | `/` (signed-in Meet sends this to personal meetings) |
| `/r/[code]` | `/r/[code]` |
| `/r/[code]/preview` | `/r/[code]/preview` |
| `/sessions` | `/personal/meetings` |
| `/sessions/new` | `/personal/meetings` |
| `/sessions/[meetingId]` | `/personal/meetings/[meetingId]` |
| `/scenarios/[scenarioId]` | `/personal/meetings` |
| `/manage/scenarios` | `/personal/meetings` (authoring lives in Infrastructure) |
| any other page | `/` |

Do not turn `PARLEY_MEET_REDIRECT` on before slice 2 lets Meet open Parley
sessions and slice 3 moves review: room and review links would otherwise land
on Meet's refusal. Browsers cache 308 responses, so a premature switch cannot
be undone for visitors who already followed it.

## Retirement steps

List only; each step needs the release authority and stays out of this change.

1. Enable `MEET_LIVE_PARLEY_ENABLED` after slice 2, deploy realtime then Meet.
2. Set `PARLEY_MEET_REDIRECT=on` for the `tuturuuu-parley` Worker and verify
   every row of the redirect map on the deployed Worker.
3. After a redirect-only period, replace the Parley Worker with a minimal
   redirect Worker or a Cloudflare redirect rule for `parley.tuturuuu.com`.
4. Remove the `tuturuuu-parley` Worker, its `NEXT_INC_CACHE_R2_BUCKET`
   (`tuturuuu-parley-cache`), the `MEETING_AI_PROVIDER` service binding and the
   `MEET_LIVE` Durable Object reference to `tuturuuu-meet`.
5. Keep the `parley.tuturuuu.com` custom domain and DNS record while redirects
   serve traffic; remove them only after traffic is negligible.
6. Remove `parley-cloudflare.yaml`, `parley-offline-diagnostic.yaml`, the
   `deploy-parley-cloudflare` job in `vercel-production.yaml`, and the Parley
   entries in `tuturuuu.ci.ts`.
7. Remove the `parley` entries in `packages/utils/src/internal-domain-entries.ts`
   and the central auth registry, then `apps/parley`.
8. Keep `private.parley_*` tables and the access list; Meet reads them.

## Risks

* Meet admitting Parley sessions (slice 2) widens Meet's runtime to scenario
  meetings. The admission rule must stay `hasParleyAccess` plus room admission.
* Mira behavior keys on `MEETING_APP === 'parley'` today. Until it keys on the
  meeting, a Parley scenario in Meet runs Mira with Meet instructions and search.
* The room snapshot holds public scenario text up to the 112 KiB view limit; a
  very long briefing reports `activity_full` instead of truncating.
* Redirects are permanent. Stage them only after the Meet targets work.
* Parley-specific CI holds in `tuturuuu.ci.ts` remain until retirement.

Regression coverage: `live-parley.test.ts` (room authority, flags and stale
claims), `parley-panel.test.tsx` (presenting, claiming and refusals),
`parley-scenarios/route.test.ts` (flag, host and Parley-access checks, public
fields and the 100-item bound), `registry.test.ts` (flagged registration),
`meet-redirect.test.ts` (redirect map) and `apps/parley/src/proxy.test.ts`
(flag off by default, 308 before authentication, callbacks kept).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.