Skip to content

Move first-party plugin API calls onto useSdk() - #4033

Merged
SawyerHood merged 1 commit into
thread-list/2-plugin-scaffoldfrom
thread-list/6-first-party-use-sdk
Sep 22, 2026
Merged

SawyerHood merged 1 commit into
thread-list/2-plugin-scaffoldfrom
thread-list/6-first-party-use-sdk

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

useSdk() should not ship with a single consumer. Two first-party frontends reached the public API by other means: plugin-api-docs hand-rolled fetch("/api/v1/plugins") and the catalog search with ad-hoc JSON parsing, and side-chat's sendToMain RPC was a pure pass-through to bb.sdk.threads.queuedMessages.create.

What changed

  • plugin-api-docs: loadPluginReferences(sdk, signal) over sdk.plugins.list() and sdk.plugins.catalog.search({ query: "" }), with a Vitest setup and first tests for the plugin.
  • side-chat: the message action calls sdk.threads.queuedMessages.create directly; the sendToMain RPC, its contract entry, and its server test are deleted.
  • Testing harness: sdk fakes are now nested ({ threads: { queuedMessages: { create } } }) through a recursive proxy; unfaked methods still throw with the dot-path.
  • Guide: the new-thread composer example spawns from the frontend.

theme-preview's RPCs were reviewed and left alone: they enrich the catalog and re-apply on disk changes, which is real server work.

Prerequisite: #4031.

How you verified

side-chat app and server suites, plugin-api-docs suite, plugin SDK harness suite (nested fake case added), bundled types build, guide parity suite.

🤖 Generated with Claude Code

AGENT GENERATED

plugin-api-docs read installed plugins and the catalog with hand-rolled
fetches; side-chat proxied a queued-message create through its own RPC.
Both now call the public client directly, and the RPC method plus its
contract entry are deleted. The testing harness's sdk fakes learn nested
sub-areas so threads.queuedMessages.create can be faked, and the guide's
composer example spawns from the frontend.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@SawyerHood
SawyerHood force-pushed the thread-list/6-first-party-use-sdk branch from 08d9a48 to 21c33ed Compare September 22, 2026 00:08
@SawyerHood
SawyerHood marked this pull request as ready for review September 22, 2026 00:15
@SawyerHood
SawyerHood merged commit 879eb86 into main Sep 22, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the thread-list/6-first-party-use-sdk branch September 22, 2026 00:18
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.

1 participant