Skip to content

Conversation

@pirhoo
Copy link
Owner

@pirhoo pirhoo commented Nov 28, 2025

Summary

This PR adds comprehensive support for Bluesky starter packs to Trotsky, implementing four new step classes with full pagination, iteration, and filtering capabilities:

  • StepStarterPack - Get a single starter pack by URI
  • StepStarterPacks - Get multiple starter packs by their URIs with iteration support
  • StepSearchStarterPacks - Search for starter packs (API not yet deployed to production)
  • StepActorStarterPacks - Get all starter packs created by a specific actor

Key Features

  • ✅ Full pagination support using cursor-based iteration
  • .each() support for iterating through collections
  • .when() filtering support
  • .take() limit support
  • ✅ Comprehensive test coverage (45 new tests, all passing)
  • ✅ TypeScript types for all APIs
  • ✅ Consistent API patterns following existing steps

API Endpoints Used

  • app.bsky.graph.getStarterPack - Get single starter pack
  • app.bsky.graph.getStarterPacks - Get multiple starter packs
  • app.bsky.graph.searchStarterPacks - Search starter packs (⚠️ not yet available in production)
  • app.bsky.graph.getActorStarterPacks - Get actor's starter packs

Examples

// Get a single starter pack
await Trotsky.init(agent)
  .starterPack("at://did:plc:example/app.bsky.graph.starterpack/packid")
  .run()

// Get multiple starter packs
await Trotsky.init(agent)
  .starterPacks([uri1, uri2])
  .each()
  .tap((step) => console.log(step.context.uri))
  .run()

// Search for starter packs
await Trotsky.init(agent)
  .searchStarterPacks({ q: "TypeScript" })
  .take(10)
  .each()
  .run()

// Get an actor's starter packs
await Trotsky.init(agent)
  .actor("alice.bsky.social")
  .starterPacks()
  .each()
  .tap((step) => console.log(step.context.creator.handle))
  .run()

Files Changed

Core Implementation:

  • lib/core/StepStarterPack.ts - Single starter pack retrieval
  • lib/core/StepStarterPacks.ts - Multiple starter packs with pagination
  • lib/core/StepStarterPacksEntry.ts - Entry wrapper for iteration
  • lib/core/StepSearchStarterPacks.ts - Search functionality
  • lib/core/StepActorStarterPacks.ts - Actor's starter packs
  • lib/core/Trotsky.ts - Added starter pack methods
  • lib/core/mixins/ActorMixins.ts - Added starterPacks() to actor steps
  • lib/trotsky.ts - Exported new classes

Tests (45 new tests):

  • tests/core/StepStarterPack.test.ts - 11 tests
  • tests/core/StepStarterPacks.test.ts - 13 tests
  • tests/core/StepSearchStarterPacks.test.ts - 10 tests
  • tests/core/StepActorStarterPacks.test.ts - 11 tests

Documentation:

  • docs/guide/features.md - Updated feature matrix

Test Results

Test Suites: 1 skipped, 34 passed, 34 of 35 total
Tests:       1 skipped, 145 passed, 146 total
Time:        397.54s

All tests passing with no regressions to existing functionality.

Notes

  • The searchStarterPacks API endpoint is not yet deployed to production Bluesky servers. Tests work in the test environment, but production usage will receive XRPCNotSupported errors until the API is deployed.
  • All implementations follow the established Trotsky patterns for consistency
  • Full TypeScript type safety maintained throughout

@pirhoo pirhoo merged commit c7063c9 into main Nov 28, 2025
2 checks passed
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