@recursiv/sdk 0.7.44 → 0.7.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import type { DiscoveryLearning } from './discovery-learning.js';
2
1
  import type { DiscoveryLayout, Post } from '../types.js';
2
+ import type { DiscoveryLearning } from './discovery-learning.js';
3
3
  import type { PostsResource } from './posts.js';
4
4
  import type { ProtocolsResource, SocialNetwork, SocialPost } from './protocols.js';
5
5
  export type DiscoveryRecommendationKind = 'groups' | 'people' | 'tags';
@@ -73,7 +73,9 @@ export class DiscoveryFeedSession {
73
73
  async read(stream) {
74
74
  const params = { limit: 25, ...(this.category ? { category: this.category } : {}), discovery: true };
75
75
  if (stream.protocol === 'minds') {
76
- const response = await this.posts.list({ ...params, sort: 'new', ...(stream.cursor ? { cursor: stream.cursor } : { offset: stream.offset }) });
76
+ // Discover leads with what is moving now: the REST hot order (engagement
77
+ // decayed by age). Hot pages by offset; the server sends no cursor for it.
78
+ const response = await this.posts.list({ ...params, sort: 'hot', ...(stream.cursor ? { cursor: stream.cursor } : { offset: stream.offset }) });
77
79
  stream.offset += response.meta.scanned ?? response.meta.limit;
78
80
  const next = response.meta.next_cursor ?? undefined;
79
81
  stream.done = !response.meta.has_more || !!next && (next === stream.cursor || stream.used.includes(next));
@@ -1,6 +1,5 @@
1
- import type { DiscoveryLayout } from '../types.js';
2
1
  import type { HttpClient } from '../client.js';
3
- import type { PaginatedResponse, PaginationParams, SingleResponse } from '../types.js';
2
+ import type { DiscoveryLayout, PaginatedResponse, PaginationParams, SingleResponse } from '../types.js';
4
3
  /** Canonical protocol operation names returned by the adapter registry. */
5
4
  export declare const PROTOCOL_CAPABILITY_OPERATIONS: readonly ["discover", "stream", "backfill", "search", "resolveIdentity", "fetchProfile", "fetchThread", "publish", "reply", "react", "repost", "follow", "delete", "health", "checkpoint"];
6
5
  export declare const PROTOCOL_CAPABILITY_STATUSES: readonly ["supported", "planned", "unsupported"];
@@ -844,11 +843,14 @@ export interface SocialPost {
844
843
  replyCount: number | null;
845
844
  likeCount: number | null;
846
845
  repostCount: number | null;
846
+ /** Pixel dimensions when the source declares them (Bluesky aspect ratio, Mastodon attachment meta), so a card can take the clip's shape before it loads. */
847
847
  media: Array<{
848
848
  type: 'image' | 'video';
849
849
  url: string;
850
850
  alt: string;
851
851
  poster?: string;
852
+ width?: number;
853
+ height?: number;
852
854
  }>;
853
855
  hasAdditionalContent: boolean;
854
856
  /** At most one independently filtered quoted post. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursiv/sdk",
3
- "version": "0.7.44",
3
+ "version": "0.7.45",
4
4
  "description": "TypeScript SDK for the Recursiv API",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",