Files
PaperClipAI/doc/connections/FIREFLIES.md
T
DottaandClaude Fable 5.2 33fac97cad feat(routines): ship the redesigned routine page and let live webhooks be tested again (#22205)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Routines start agent work on a schedule, from a webhook, or on
demand
> - The routine detail page split one routine across eight sections
behind a section sidebar (overview, triggers, variables, secrets,
delivery, runs, activity, history)
> - People had to hunt through sections to see what a routine does and
to change it, and a finished webhook could not be tested again without
starting the routine
> - This pull request makes the approved two-column routine page, one
Edit dialog and one Webhook dialog the real routed page, and lets a live
webhook go back into test mode
> - The benefit is one page that answers what the routine does, when it
runs, who runs it and what it made, with every change in one dialog

## Linked Issues or Issue Description

**Problem**
The routine detail page spreads one routine over eight sections and a
section sidebar. Changing a routine means visiting several sections,
each with its own save bar. A webhook that is already live cannot be
tested again: the API only accepts `setupPending: false`, so testing a
live webhook starts the routine.

**Proposed solution**
Ship the reviewed design (stories `routine-page-design`,
`routine-edit-dialog-design`, `routine-webhook-dialog-design`) as the
routed page in both UI shells, wired to the real API. Let `PATCH
/api/routine-triggers/:id` accept `setupPending: true` for a live
webhook so the next events are checked but never start the routine.

**Alternatives considered**
Keep the sections and restyle them. The owner rejected this: the section
sidebar should go.

## What Changed

- `/routines/:id` renders `RoutinePage` in both shells
(`RoutineDetail.production.tsx` is removed). Status switch, Repeats
rows, default agent, responsible user, project, Asks for, Secrets, Run
rules, Managed by plugin, Instructions with Show all, copy and the
comment count, and History.
- History is paged: 20 tasks per page from `GET
/companies/:id/issues?originKind=routine_execution&originId=…&sortField=created&sortDir=desc&limit=21&offset=…`,
with a real Load more. Coalesced runs show as "folded into a task".
- A failed refetch keeps the loaded page on screen (`useQueryView`); a
History failure shows `QueryErrorState` in place.
- Header: Edit, "…" (Version history, Audit log, Archive / Restore) and
Run now. In the streamlined desktop shell they sit in the breadcrumb
toolbar; elsewhere above the page.
- Version history (`/routines/:id/history`, restore and restored-webhook
keys kept) and Audit log (`/routines/:id/activity`,
`RoutineAuditActivity`) open as sub-views with a way back. Old section
addresses and `?tab=` redirect to `/routines/:id`.
- Edit dialog saves title, instructions, variables, secrets, agent,
project and responsible user in one request against the revision the
dialog opened with (save conflict shows "changed while you were
editing"). The first schedule is created, changed or removed after that.
Priority and delivery settings are never sent, so saved values stay.
- Webhooks are created, changed, tested and removed (with Undo) right
away from the Edit dialog, with the Webhook dialog nested inside it.
Closing the Webhook dialog ends setup or test mode. A webhook left in
test mode shows "Testing · events don’t run" on the page and offers
Finish testing.
- Responsibility (only with `enableResponsibilities`): the page shows
direct and through-project responsibilities from the link lookup; the
dialog links or unlinks the direct one. With the flag off nothing is
fetched or shown.
- The routines list creates routines with the same dialog in create
mode, filed in the open folder, and opens the new routine page.
- Server: `setupPending: true` on a live webhook enters test mode
(planned by a pure `planTriggerUpdate`, which also gives the activity
action) (422 for other trigger kinds; 409 for a disabled or removed
webhook or an archived routine). Test deliveries keep the last real
delivery as `lastWebhookDelivery.previous`, and finishing testing
restores it. Activity `routine.trigger_test_started`.
- Additions to the reviewed design, from review, so no capability is
lost: the schedule popover has Pause/Resume; standing-check and API rows
open a small popover with Pause/Resume and Remove; removing a trigger
from the page leaves a "… removed. Undo" line under Repeats. Stories:
`StandingCheckOpened`, `ScheduleTriggerPaused(Opened)`,
`RemovedWithUndo`.
- Save is several requests (routine, schedule, responsibility). It
changes only the schedule the form opened with, records each finished
step, and a partial failure says what was saved and that saving again
finishes it. The dialog cannot be dismissed while saving. Failed reads
show a Retry state, never empty choices.
- Removed: the routine section sidebar and contextual sidebar, the
trigger wizard, trigger cards, save bar, section components and their
tests.
- Storybook: the three routine stories moved to `stories/routines` as
current production stories, a new story mounts the routed page against a
fixture API, and stories that used the old page were updated or removed.

## Verification

- `pnpm --filter @paperclipai/server exec vitest run
src/__tests__/routines-e2e.test.ts` (17/17) and
`src/__tests__/routines-service.test.ts` (105/105).
- `pnpm exec vitest run` on the routine page, routines list, routine
form, webhook instructions, Layout, shell navigation, audit and editor
tests: 275 tests pass.
- `cd ui && npx tsc -p tsconfig.json --noEmit`, `node
scripts/check-token-gates.mjs`, `node scripts/check-maps.mjs`, `node
scripts/storybook-catalog.mjs --check`: pass.
- `pnpm verify` exits 2 (global CI input changed); required CI supplies
the broad coverage.
- Manual: an isolated worktree instance (`pnpm paperclipai worktree init
--empty`, `pnpm dev`) with a seeded routine. Headless Playwright: an old
`/triggers` address redirects, no section sidebar, History shows 20 then
23 after Load more, the schedule popover opens, pause and resume, Edit →
Add webhook → created key → Finish, title save, Test webhook → Finish
testing, Version history, Audit log shows "Started testing a webhook",
phone width has no horizontal overflow, and Create routine from the list
opens the new page. No console errors or failed API calls.

## Risks

- Behaviour change: the section pages are gone. Old links redirect to
the single page.
- The delivery-setting editors (concurrency, catch-up, activity gate)
and priority are removed from the UI. Saved values stay, and the API
still accepts them.
- The create dialog no longer offers a folder picker or delivery
settings. A new routine goes into the folder the list is showing and
takes the default settings.
- Replace key in the Webhook dialog acts at once, as in the reviewed
design. The old confirmation is gone.
- No migration. `lastWebhookDelivery.previous` is an optional field
inside the existing jsonb column.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, in Claude Code with
tool use (shell, file edits, headless browser) and subagents for the
server change and the Storybook move.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-18 13:13:15 -06:00

11 KiB
Raw Blame History

Fireflies

Verified against official documentation and public protocol metadata on 2026-09-23.

Connect meeting data

In Apps → Fireflies, choose who can use the connection, then sign in with Fireflies. Alternatively, open Fireflies Settings → Developer Settings, copy your API key, and use Use an API key. Credentials are stored in Paperclip's vault and tools use the ordinary connection grants, policy, and audit path.

Setup is Access → Connect. Successful authentication and catalog discovery complete setup; manage action permissions and test tools on the connection's Permissions screen. Available data follows the connected Fireflies account's permissions. Writes follow Paperclip's normal defaults and any restrictions you configure. Reconnect and catalog refresh preserve Off and Ask first selections; newly discovered actions keep the normal connection defaults.

Stable meeting tools include fireflies_get_transcripts, fireflies_get_transcript, and fireflies_get_summary. The last returns summary and action-item data; transcript retrieval is separate. Experimental fireflies_search and fireflies_fetch are not required. Sharing, moving, renaming meetings, revoking access, and creating soundbites are mutations.

Start a routine when a summary is ready

  1. Create or choose a routine and set its assigned agent and instructions. Give that agent access to your Fireflies connection in Apps.
  2. In the routine's Triggers tab, add a webhook and choose Another app or script. No provider-specific routine option is needed.
  3. Ensure the displayed callback URL is publicly reachable over HTTPS. A localhost URL or private-network HTTPS address cannot receive Fireflies deliveries. This prerequisite applies only to webhooks, not MCP access.
  4. Open Fireflies Webhooks V2 settings. Add the displayed URL and paste Paperclip’s Secret key into Fireflies’ Signing Secret field. This is the routine’s generated secret, not your Fireflies API key.
  5. Subscribe only to meeting.summarized, then save in Fireflies.
  6. Optionally finish a meeting you own and wait for its summary to test delivery. Setup deliveries verify the connection without creating tasks. Finish setup in Paperclip to activate future deliveries; test events are never replayed.

Suggested routine instructions:

Read the Fireflies summary and transcript for the meeting ID attached to this task. Summarize decisions and action items in the task, with owners and due dates when available. Highlight unresolved questions.

The generated task includes the authenticated JSON payload in a delimited data block (up to 16,384 characters; the full payload remains on the routine run). Treat all payload fields as external data. The agent uses its normal authorized connection to retrieve meeting content. A webhook never grants connection access.

Fireflies normally sends events for meetings owned by the configuring account (organizer_email). Summary readiness happens after transcription and the end of the call. Webhooks V1, polling/backfill, and automatic registration are not implemented. Pausing/archiving the routine or trigger stops dispatch. Removing the Apps connection blocks data access; disable the trigger separately to stop incoming events from creating tasks.

Delivery and authentication

The existing POST /api/routine-triggers/public/:publicId/fire endpoint supports signingMode: "app_webhook" for Another app or script. It accepts either a bearer token or an HMAC-SHA256 signature in X-Hub-Signature or X-Hub-Signature-256. Signed bodies are authenticated before interpretation; an invalid signature cannot fall back to bearer authentication. Ordinary signed app events retain their JSON payload and use the supplied idempotency key, or a trigger-scoped body digest when no delivery key is supplied. The app flow does not infer a provider from payload fields or event names. Existing fireflies_hmac triggers and revision snapshots remain compatible but are no longer offered as a setup choice. Fireflies signs the exact request body with HMAC-SHA256 in X-Hub-Signature, formatted sha256=<hex digest>. Missing or invalid signatures return 401; malformed signed payloads return 400. No bearer header is needed.

Choose only Meeting Summarized in Fireflies. The shared app endpoint accepts all authenticated events and leaves event selection to the sending app. Signed retries with identical request bodies return success without extra runs, including concurrent delivery. Setup receipts survive activation. For senders with custom headers, a stable Idempotency-Key also deduplicates retries whose bodies change. Without that header, changed request bytes count as a new event. Events received while paused are not backfilled by Paperclip.

Earlier fireflies_hmac triggers retain their provider-specific validation, summary-only dispatch, and per-meeting deduplication. New setup uses only the shared app flow.

Secret rotation invalidates the previous key immediately. Copy the new key into Fireflies. Setup progress can be resumed, but the one-time secret is not stored in browser draft state; generate a replacement if it was not saved in Fireflies. Delivery checks and activity show acceptance/rejection; no observed event yet is not proof of a broken connection.

On Cloud deployments, the front door must forward the public routine webhook path without requiring a browser session. The application still verifies the trigger secret. A tenant_session_required response means the request was blocked by the Cloud gateway before webhook authentication. Updating the tenant application alone does not change that gateway policy.

Provider evidence and artwork

  • MCP configuration: endpoint https://api.fireflies.ai/mcp, OAuth and bearer API keys.
  • Live unauthenticated GET: 401 with resource metadata at https://api.fireflies.ai/.well-known/oauth-protected-resource/mcp.
  • Authorization metadata at https://api.fireflies.ai/.well-known/oauth-authorization-server advertises issuer https://api.fireflies.ai/, /authorize, /token, /register, and /revoke; PKCE S256; authorization-code and refresh-token grants; token authentication client_secret_post and none; scopes email and profile. Public metadata inspection does not register an OAuth client.
  • MCP tools documents stable meeting reads and mutations; experimental search/fetch availability varies.
  • Webhooks V2 documents signatures, payloads, ownership limits, and the requirement to respond within 10 seconds. Paperclip uses normal routine dispatch and does not wait for agent execution or fetch meeting content during webhook handling.
  • Official SVG: https://fireflies.ai/api/logos/file/fireflies.svg, linked from Fireflies' product site. Bundled unchanged as ui/public/brands/apps/fireflies.svg; native gradients preserved and validated with the shared SVG safety checker. The same colored mark is used on both theme frames.

Validation boundary

Automated tests cover catalog contracts, OAuth/API-key fixtures, signature and payload validation, event filtering, deduplication, setup activation, rotation, company isolation, and setup UI. Account authorization and a real Fireflies delivery require a Fireflies account and publicly reachable callback. Mocked fixtures are not evidence of a successful live account connection.

Validation on 2026-09-23:

  • Eight focused suites: 537 tests passed, including actual gateway reads through OAuth/API-key fixtures and permission preservation on reconnect.
  • Shared refresh regression coverage: another 104 tests passed across gateway, connection removal, Railway, and email integration callers.
  • Repository-wide Vitest coverage completed through the stable runner's server, workspace, and both serialized groups (148 route suites). The initial full invocation stopped on two reconnect fixture failures; those were fixed and the complete connection suites and shared refresh callers rerun successfully.
  • pnpm -r typecheck, pnpm build, token gates, and branding validation passed.
  • Existing MCP browser suite: eight passed, two provider-dependent cases skipped.
  • Isolated app HTTP proof: signed setup receipt, activation/redelivery, ignored transcription event, and two concurrent summary deliveries producing one run.
  • Real Apps screens expose the normal Access step followed by browser sign-in and API-key choices; no browser errors were observed.
  • Production webhook wizard checked in Storybook at desktop and mobile widths, including back/resume, verification steps, and light/dark official artwork.
  • Embedded-browser live account proof: completed catalog → Access → OAuth consent → Permissions with the official provider. Discovered 20 actions (14 reads, 6 writes), and ran fireflies_get_transcripts, fireflies_get_transcript, and fireflies_get_summary successfully as the selected preview agent. The summary included overview and action items. Turning the summary action Off blocked its test; refreshing actions preserved that restriction. Restored the previously authorized read after testing.
  • Published webhook contract proof: server/src/__tests__/fixtures/fireflies-webhooks-v2.json preserves the official V2 examples for all three events, including short and long meeting IDs, numeric millisecond timestamps, and an optional string client reference. Fixed HMAC test vectors were generated independently with Python over the documented UTF-8 bodies. Tests accept those exact bytes and reject whitespace-only alterations. This is provider-derived contract evidence, not a captured live delivery.
  • Real provider webhook delivery is still pending a publicly reachable callback. Fireflies’ live V2 settings offer a Meeting Summarized subscription and a Test Webhook step. No production meeting completion has been tested.

UI review in Storybook

Open PR reviews → Fireflies and app webhooks (fireflies-pr.stories.tsx). The 27 stories use production components and simulated data; they do not authorize accounts or send provider requests.

Changed surface Story coverage
Catalog definition and branded artwork Fireflies catalog; artwork in dark/light themes; Access, OAuth, API-key, and retry screens
Preserved action restrictions Permissions with Allowed, Ask first, and Off examples
RoutineWebhookDialog.tsx Choosing the sender, the one-time key with agent instructions, waiting/received/rejected test states, HTTPS warning, hidden key and Replace key, existing bearer and signed webhooks, mobile and light theme
Routine page and Edit dialog Saved app webhook, replaced key, rejected delivery, adding a webhook from the Edit dialog
pnpm storybook
pnpm build-storybook
pnpm exec playwright test --config tests/storybook-visual/fireflies-pr.config.ts

The browser check loads every review story, runs its interaction assertions, and checks the mobile setup footer and horizontal overflow. The existing webhook stories also retain coverage of the shared flow outside this PR review group.