Skip to content

feat(desktop): add team sharing to community catalog - #3995

Open
wpfleger96 wants to merge 1 commit into
duncan/team-catalog-backendfrom
duncan/team-catalog-desktop
Open

feat(desktop): add team sharing to community catalog#3995
wpfleger96 wants to merge 1 commit into
duncan/team-catalog-backendfrom
duncan/team-catalog-desktop

Conversation

@wpfleger96

@wpfleger96 wpfleger96 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Stack: #5112 → this PR

Stacks on the team catalog backend PR (#5112). Contains all desktop/src/**, desktop/tests/**, and desktop/playwright.config.ts changes — 32 files, +4,322/−693 lines.

TS parse layer

teamCatalogRelay.ts decodes kind 30178 projection events into TeamCatalogEntry records. catalogRelay.ts generalizes the persona catalog relay into a shared base that both persona and team catalog hooks extend, eliminating the per-kind duplication in the previous persona-only implementation.

Hooks

useTeamCatalogRelay.ts subscribes to the team catalog kind, applies freshness ordering, and exposes the decoded entries. useAgentsDataRefresh.ts gains team catalog invalidation alongside the existing persona refresh path.

CommunityCatalogDialog

Single unified surface replacing the two former separate dialogs. Agents and Teams appear as labeled sections; the selection helper (communityCatalogSelection.ts) handles preferred-loading, vanished-item repair (explicit selection cleared when the encoded key leaves live data), and cross-section auto-init. All selection transitions are covered by 15 deterministic unit tests in communityCatalogSelection.test.mjs.

TeamShareDialog

Publishes and unshares catalog entries via the backend set_team_shared Tauri command (both share and unshare transitions call set_team_shared).

e2e + screenshots

team-catalog.spec.ts covers the full browse + adopt flow. team-catalog-screenshots.spec.ts produces the 8-image pixel-regression set (comment 5208042093).

Deletion

PersonaCatalogDialog.tsx is removed; persona browsing now lives inside the unified CommunityCatalogDialog.

@wpfleger96
wpfleger96 requested a review from a team as a code owner July 31, 2026 19:36
wpfleger96 pushed a commit that referenced this pull request Jul 31, 2026
wpfleger96 pushed a commit that referenced this pull request Jul 31, 2026
@wpfleger96
wpfleger96 force-pushed the duncan/team-catalog-desktop branch from 5c11456 to 8bd3c8e Compare July 31, 2026 20:18
wpfleger96 pushed a commit that referenced this pull request Jul 31, 2026
wpfleger96 pushed a commit that referenced this pull request Jul 31, 2026
@wpfleger96

Copy link
Copy Markdown
Member Author

Catalog browse (collapsed members)

Browsing a community team — description and member list with model summary. Members show a chevron indicating they're expandable.
catalog-browse

Member expanded

Reviewer row expanded — metadata card (Type / Preferred model / Preferred runtime / Preferred provider) + agent instruction rendered via Markdown.
catalog-member-expanded

Team instructions

Team-level instructions section rendered below the description, using the same Markdown treatment as the persona catalog.
catalog-team-instructions

Added state

After adding — action reads "Added to my teams" and is disabled.
catalog-added

Empty catalog

catalog-empty

Share dialog — not shared

share-not-shared

Share dialog — published

share-published

@wpfleger96
wpfleger96 force-pushed the duncan/team-catalog-desktop branch from 28c614f to a4c603a Compare July 31, 2026 21:32
@wpfleger96

Copy link
Copy Markdown
Member Author

Team catalog — browse

Community catalog list showing shared team cards with member counts and publisher attribution.
catalog-browse

Team catalog — member expanded

Detail pane with a member row expanded: AgentDefinitionMetadata (model/runtime/provider) and member system prompt.
catalog-member-expanded

Team catalog — team instructions

Detail pane with all members collapsed, showing the team-level instructions section below the description.
catalog-team-instructions

Team catalog — added state

Detail pane after adding a team; action reads "Added to my teams".
catalog-added

Team catalog — empty state

Empty catalog when no teams have been shared to the community.
catalog-empty

Team share dialog — not shared

Share settings panel with the catalog-share Switch unchecked (not shared).
share-not-shared

Team share dialog — shared/published

Share dialog with the catalog-share Switch checked; team queued for publication.
share-published

wpfleger96 pushed a commit that referenced this pull request Jul 31, 2026
@wpfleger96
wpfleger96 force-pushed the duncan/team-catalog-desktop branch 6 times, most recently from 8ed79f3 to f573bdc Compare August 4, 2026 18:53

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing on Wes's behalf. Requesting changes for two security blockers in the catalog review surface:

  1. Verify relay events before they can affect paging, coordinate selection, attribution, or displayed content. fetchCatalogEvents currently inserts every raw RelayEvent returned by the socket into byId and derives oldestCreatedAt from it; sharedCatalogHeads then trusts the raw id, pubkey, created_at, tags, and content. RelayClient.fetchEvents is only a transport fetch and does not verify signatures. A forged/unsigned 30178 event can therefore appear under another publisher, claim or retract their coordinate ahead of a valid signed head, and control the pagination cursor. The backend re-fetch and verification correctly prevents adoption, but it does not protect browsing, publisher attribution, remote image loads, or denial/shadowing of legitimate entries. Please verify ID + signature on a fresh wire-shaped object before adding an event to the paging map or deriving a cursor/head from it, and add regressions for a forged newer head, forged author/content, malformed signature, and an invalid event attempting to control until. The equivalent hardening and tests already exist in PR #4220 for kind 30175; this shared helper should preserve that invariant for both 30175 and 30178 rather than regress it.

  2. Render executable team/member instructions byte-for-byte, not as Markdown, and reject non-reviewable controls at the adoption boundary. TeamCatalogDialog.tsx passes both team.instructions and member.systemPrompt through the chat Markdown renderer. Markdown can conceal spoiler bodies, link destinations, and image sources, so the instructions reviewed in the dialog can differ materially from the plaintext later executed by the adopted agents. The current team catalog validators only enforce schema/size bounds, so bidi/default-ignorable controls can also make reviewed text differ from execution. Please use the literal instruction-review component/invariant from PR #4220 and apply its executable-text validation to team instructions and every member prompt before publication/adoption. Add coverage proving Markdown syntax stays literal, hidden controls fail closed, and accepted bytes are preserved exactly through adoption.

The feature has unusually substantial coverage otherwise: this head adds/changes 62 test/spec/fixture files, including the Rust adoption/pending/sharing/reconcile suites, TS relay/parser tests, and Playwright catalog/screenshot specs. CI is green at e64aa20ff81e236ca068aab3b9ad93142fb839e3, but the existing fixtures use placeholder sig: "sig" values and therefore do not exercise the first trust boundary.

@wpfleger96
wpfleger96 force-pushed the duncan/team-catalog-desktop branch from e64aa20 to 131a906 Compare August 6, 2026 16:39
wpfleger96 pushed a commit that referenced this pull request Aug 6, 2026
@wpfleger96

Copy link
Copy Markdown
Member Author

Community Catalog — browse (teams section)

Team list with name, member count, description, and "Add team" footer.
catalog-browse

Community Catalog — member expanded

Per-member row expanded showing Type, Preferred model/runtime/provider, and agent instruction.
catalog-member-expanded

Community Catalog — team instructions

Team instructions section collapsed above member rows.
catalog-team-instructions

Community Catalog — already added

Footer button reads "Added to my teams" (disabled) after the team is adopted.
catalog-added

Community Catalog — empty state

Both agents and teams empty: "Nothing shared yet" placeholder.
catalog-empty

Share dialog — not yet shared

Share dialog before enabling catalog access.
share-not-shared

Share dialog — published

Share dialog with catalog toggle on and published toast.
share-published

@wpfleger96

Copy link
Copy Markdown
Member Author

Community Catalog — browse (teams section)

Team list with name, member count, description, and "Add team" footer.
catalog-browse

Community Catalog — member expanded

Per-member row expanded showing Type, Preferred model/runtime/provider, and agent instruction.
catalog-member-expanded

Community Catalog — team instructions

Team instructions section collapsed above member rows.
catalog-team-instructions

Community Catalog — already added

Footer button reads "Added to my teams" (disabled) after the team is adopted.
catalog-added

Community Catalog — empty state

Both agents and teams empty: "Nothing shared yet" placeholder.
catalog-empty

Community Catalog — both sections

Agents and Teams section headers both visible with one shared entry each.
catalog-both-sections

Share dialog — not yet shared

Share dialog before enabling catalog access.
share-not-shared

Share dialog — published

Share dialog with catalog toggle on and published toast.
share-published

…e2e tests

Parse layer (teamCatalogRelay.ts, catalogRelay.ts) decodes kind 30178 projection
events and feeds the catalog hooks. CommunityCatalogDialog unifies the Agents and
Teams sections in a single browsable surface with selection-state helpers
(communityCatalogSelection.ts) covering preferred-loading, vanished-item repair,
and cross-section auto-init. TeamShareDialog publishes and unshares catalog entries.
Playwright e2e suite covers the full catalog flow and screenshot regression set.
PersonaCatalogDialog is removed; persona browsing now lives inside the unified dialog.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96
wpfleger96 force-pushed the duncan/team-catalog-desktop branch from 3bcca7e to f869c80 Compare August 6, 2026 21:10
@wpfleger96
wpfleger96 changed the base branch from main to duncan/team-catalog-backend August 6, 2026 21:10
@wpfleger96 wpfleger96 changed the title feat(desktop): implement 30178 team catalog sharing for the community catalog feat(desktop): add community catalog UI, team share dialog, and e2e tests Aug 6, 2026
@wpfleger96 wpfleger96 changed the title feat(desktop): add community catalog UI, team share dialog, and e2e tests feat(desktop): add team sharing to community catalog Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants