@recursiv/sdk 0.7.48 → 0.7.50
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.
- package/dist/index.d.ts +2 -2
- package/dist/resources/communities.d.ts +4 -0
- package/dist/resources/communities.js +4 -0
- package/dist/resources/curator.d.ts +42 -0
- package/dist/resources/e2ee.d.ts +40 -0
- package/dist/resources/e2ee.js +20 -6
- package/dist/resources/posts.d.ts +5 -0
- package/dist/resources/posts.js +4 -0
- package/dist/resources/protocols.d.ts +12 -0
- package/dist/resources/protocols.js +9 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export { UsersResource } from './resources/users.js';
|
|
|
144
144
|
export { CommunitiesResource } from './resources/communities.js';
|
|
145
145
|
export { ChatResource } from './resources/chat.js';
|
|
146
146
|
export { E2eeResource } from './resources/e2ee.js';
|
|
147
|
-
export type { E2eeDevice, E2eeEnvelope, E2eeEvent, E2eeKeyPackageStatus } from './resources/e2ee.js';
|
|
147
|
+
export type { E2eeDevice, E2eeEnvelope, E2eeEvent, E2eeKeyPackageStatus, E2eeObjectDownload, E2eeObjectUpload } from './resources/e2ee.js';
|
|
148
148
|
export { ProjectsResource } from './resources/projects.js';
|
|
149
149
|
export { AgentsResource, SUPPORTED_MODELS } from './resources/agents.js';
|
|
150
150
|
export { EvidenceResource } from './resources/evidence.js';
|
|
@@ -180,7 +180,7 @@ export { VideoResource } from './resources/video.js';
|
|
|
180
180
|
export type { VideoUploadCreds, CreateVideoUploadResult, VideoStatusInfo, VideoPlaybackToken, } from './resources/video.js';
|
|
181
181
|
export { AppSubscriptionsResource } from './resources/app-subscriptions.js';
|
|
182
182
|
export type { AppSubscriptionCheckoutResult, AppSubscriptionPortalResult, AppSubscriptionStatusResult, } from './resources/app-subscriptions.js';
|
|
183
|
-
export type { CuratorSource, CuratorPrompt, CuratorRunInput, CuratorRunResult, CuratorTodayEdition, CuratorTodayResponse, CuratorTodaySource, CuratorTodayStory, } from './resources/curator.js';
|
|
183
|
+
export type { CuratorSource, CuratorPrompt, CuratorRunInput, CuratorRunResult, CuratorTodayEdition, CuratorTodayExcerpt, CuratorTodayLeadImage, CuratorTodayRadar, CuratorTodayReaction, CuratorTodayResponse, CuratorTodaySource, CuratorTodayStory, } from './resources/curator.js';
|
|
184
184
|
export { ReportsResource } from './resources/reports.js';
|
|
185
185
|
export type { ReportTargetType, ReportStatus, CreateReportInput, ReportRecord, ResolveReportInput, } from './resources/reports.js';
|
|
186
186
|
export { ModerationResource } from './resources/moderation.js';
|
|
@@ -8,6 +8,10 @@ export declare class CommunitiesResource {
|
|
|
8
8
|
/** Get a community by ID */
|
|
9
9
|
get(id: string): Promise<SingleResponse<CommunityDetail>>;
|
|
10
10
|
/** List members of a community */
|
|
11
|
+
/** Groups related to this one, ranked by shared members; the caller's own groups are left out. */
|
|
12
|
+
related(id: string, params?: {
|
|
13
|
+
limit?: number;
|
|
14
|
+
}): Promise<PaginatedResponse<Community>>;
|
|
11
15
|
members(id: string, params?: PaginationParams): Promise<PaginatedResponse<CommunityMember>>;
|
|
12
16
|
/** Create a new community */
|
|
13
17
|
create(input: CreateCommunityInput): Promise<SingleResponse<CreatedCommunity>>;
|
|
@@ -12,6 +12,10 @@ export class CommunitiesResource {
|
|
|
12
12
|
return this.client.get(`/communities/${id}`);
|
|
13
13
|
}
|
|
14
14
|
/** List members of a community */
|
|
15
|
+
/** Groups related to this one, ranked by shared members; the caller's own groups are left out. */
|
|
16
|
+
related(id, params) {
|
|
17
|
+
return this.client.get(`/communities/${encodeURIComponent(id)}/related`, params);
|
|
18
|
+
}
|
|
15
19
|
members(id, params) {
|
|
16
20
|
return this.client.get(`/communities/${id}/members`, params);
|
|
17
21
|
}
|
|
@@ -116,6 +116,40 @@ export interface CuratorTodaySource {
|
|
|
116
116
|
url: string;
|
|
117
117
|
published_at: string | null;
|
|
118
118
|
}
|
|
119
|
+
/** One outlet's own words about a world story, quoted with the outlet. */
|
|
120
|
+
export interface CuratorTodayExcerpt {
|
|
121
|
+
outlet: string;
|
|
122
|
+
lane: CuratorOutletLane;
|
|
123
|
+
title: string;
|
|
124
|
+
url: string;
|
|
125
|
+
text: string;
|
|
126
|
+
}
|
|
127
|
+
/** An image a Minds member posted about the story. */
|
|
128
|
+
export interface CuratorTodayLeadImage {
|
|
129
|
+
url: string;
|
|
130
|
+
post_id: string;
|
|
131
|
+
author_name: string | null;
|
|
132
|
+
author_username: string | null;
|
|
133
|
+
}
|
|
134
|
+
/** A post the topic radar counted under the story. Remote posts carry no link to their own network. */
|
|
135
|
+
export interface CuratorTodayReaction {
|
|
136
|
+
cluster_id: string;
|
|
137
|
+
network: 'bluesky' | 'activitypub' | 'nostr' | 'minds';
|
|
138
|
+
text: string;
|
|
139
|
+
published_at: string;
|
|
140
|
+
likes: number;
|
|
141
|
+
reposts: number;
|
|
142
|
+
replies: number;
|
|
143
|
+
/** Minds reactions only: the post to open. */
|
|
144
|
+
post_id?: string;
|
|
145
|
+
}
|
|
146
|
+
/** The topic radar cluster a world story seeded. */
|
|
147
|
+
export interface CuratorTodayRadar {
|
|
148
|
+
cluster_id: string;
|
|
149
|
+
kind: 'breaking' | 'viral' | 'story';
|
|
150
|
+
sources: Partial<Record<'outlet' | 'hackernews' | 'bluesky' | 'activitypub' | 'nostr' | 'minds', number>>;
|
|
151
|
+
reactions: CuratorTodayReaction[];
|
|
152
|
+
}
|
|
119
153
|
/** Distinct outlets per lane behind a world story. */
|
|
120
154
|
export interface CuratorTodayLaneMix {
|
|
121
155
|
mainstream: number;
|
|
@@ -152,6 +186,14 @@ export interface CuratorTodayStory {
|
|
|
152
186
|
reply_count: number;
|
|
153
187
|
/** Minds posts in the same shape as `sdk.posts.list()`. May be empty for a world story. */
|
|
154
188
|
posts: Post[];
|
|
189
|
+
/** World stories only: up to three outlet teasers, one per outlet. */
|
|
190
|
+
excerpts?: CuratorTodayExcerpt[];
|
|
191
|
+
/** World stories only: 'outlet' when the dek is an outlet's sentence, 'editor' when the world editor model wrote it. */
|
|
192
|
+
dek_origin?: 'outlet' | 'editor' | null;
|
|
193
|
+
/** World stories only: the first image among the story's Minds posts. */
|
|
194
|
+
lead_image?: CuratorTodayLeadImage | null;
|
|
195
|
+
/** World stories only: the radar cluster the story seeded, or null. */
|
|
196
|
+
radar?: CuratorTodayRadar | null;
|
|
155
197
|
}
|
|
156
198
|
export interface CuratorTodayEdition {
|
|
157
199
|
id: string;
|
package/dist/resources/e2ee.d.ts
CHANGED
|
@@ -43,6 +43,19 @@ export interface E2eeKeyPackageStatus {
|
|
|
43
43
|
* Requires the `e2eeV2` network feature flag and a key acting as the account
|
|
44
44
|
* owner (agent-scoped keys are refused). The realm is the network id.
|
|
45
45
|
*/
|
|
46
|
+
/** A reserved encrypted attachment object: PUT exactly `length` bytes of ciphertext to `uploadUrl`, then complete it. */
|
|
47
|
+
export interface E2eeObjectUpload {
|
|
48
|
+
reference: string;
|
|
49
|
+
uploadUrl: string;
|
|
50
|
+
uploadExpiresAt: string;
|
|
51
|
+
length: number;
|
|
52
|
+
}
|
|
53
|
+
/** A short-lived URL for a confirmed encrypted attachment object. */
|
|
54
|
+
export interface E2eeObjectDownload {
|
|
55
|
+
reference: string;
|
|
56
|
+
downloadUrl: string;
|
|
57
|
+
length: number;
|
|
58
|
+
}
|
|
46
59
|
export declare class E2eeResource {
|
|
47
60
|
private client;
|
|
48
61
|
constructor(client: HttpClient);
|
|
@@ -109,4 +122,31 @@ export declare class E2eeResource {
|
|
|
109
122
|
}): Promise<SingleResponse<{
|
|
110
123
|
ackedSeq: number;
|
|
111
124
|
}>>;
|
|
125
|
+
/**
|
|
126
|
+
* Reserve an encrypted attachment object in an encrypted conversation.
|
|
127
|
+
* `length` is the ciphertext size (recursiv-attachment-v1); the key never
|
|
128
|
+
* leaves the client, it travels inside the MLS message.
|
|
129
|
+
*/
|
|
130
|
+
createObject(conversationId: string, input: {
|
|
131
|
+
device_id: string;
|
|
132
|
+
length: number;
|
|
133
|
+
}): Promise<SingleResponse<E2eeObjectUpload>>;
|
|
134
|
+
/** Confirm an upload; it counts only if the stored size equals the reserved length. */
|
|
135
|
+
completeObject(objectId: string, input: {
|
|
136
|
+
device_id: string;
|
|
137
|
+
}): Promise<SingleResponse<{
|
|
138
|
+
reference: string;
|
|
139
|
+
length: number;
|
|
140
|
+
}>>;
|
|
141
|
+
/** A short-lived download URL for a confirmed object in a conversation you can read. */
|
|
142
|
+
objectDownload(objectId: string, params: {
|
|
143
|
+
device_id: string;
|
|
144
|
+
}): Promise<SingleResponse<E2eeObjectDownload>>;
|
|
145
|
+
/** Remove an object you uploaded. Copies recipients already downloaded stay theirs. */
|
|
146
|
+
deleteObject(objectId: string, params: {
|
|
147
|
+
device_id: string;
|
|
148
|
+
}): Promise<SingleResponse<{
|
|
149
|
+
reference: string;
|
|
150
|
+
deleted: boolean;
|
|
151
|
+
}>>;
|
|
112
152
|
}
|
package/dist/resources/e2ee.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* E2EE v2 ciphertext transport. The server relays envelopes and public
|
|
3
|
-
* credentials only; encryption happens in the shared core on each device.
|
|
4
|
-
* Requires the `e2eeV2` network feature flag and a key acting as the account
|
|
5
|
-
* owner (agent-scoped keys are refused). The realm is the network id.
|
|
6
|
-
*/
|
|
7
1
|
export class E2eeResource {
|
|
8
2
|
client;
|
|
9
3
|
constructor(client) {
|
|
@@ -44,4 +38,24 @@ export class E2eeResource {
|
|
|
44
38
|
acknowledge(conversationId, input) {
|
|
45
39
|
return this.client.post(`/e2ee/conversations/${encodeURIComponent(conversationId)}/ack`, input);
|
|
46
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Reserve an encrypted attachment object in an encrypted conversation.
|
|
43
|
+
* `length` is the ciphertext size (recursiv-attachment-v1); the key never
|
|
44
|
+
* leaves the client, it travels inside the MLS message.
|
|
45
|
+
*/
|
|
46
|
+
createObject(conversationId, input) {
|
|
47
|
+
return this.client.post(`/e2ee/conversations/${encodeURIComponent(conversationId)}/objects`, input);
|
|
48
|
+
}
|
|
49
|
+
/** Confirm an upload; it counts only if the stored size equals the reserved length. */
|
|
50
|
+
completeObject(objectId, input) {
|
|
51
|
+
return this.client.post(`/e2ee/objects/${encodeURIComponent(objectId)}/complete`, input);
|
|
52
|
+
}
|
|
53
|
+
/** A short-lived download URL for a confirmed object in a conversation you can read. */
|
|
54
|
+
objectDownload(objectId, params) {
|
|
55
|
+
return this.client.get(`/e2ee/objects/${encodeURIComponent(objectId)}`, params);
|
|
56
|
+
}
|
|
57
|
+
/** Remove an object you uploaded. Copies recipients already downloaded stay theirs. */
|
|
58
|
+
deleteObject(objectId, params) {
|
|
59
|
+
return this.client.delete(`/e2ee/objects/${encodeURIComponent(objectId)}?device_id=${encodeURIComponent(params.device_id)}`);
|
|
60
|
+
}
|
|
47
61
|
}
|
|
@@ -12,6 +12,11 @@ export declare class PostsResource {
|
|
|
12
12
|
}>>>;
|
|
13
13
|
/** List posts the authenticated caller has upvoted. */
|
|
14
14
|
liked(params?: Pick<ListPostsParams, 'limit' | 'offset' | 'cursor'>): Promise<PaginatedResponse<Post>>;
|
|
15
|
+
/** Posts similar to this one (embedding neighbours), in the app's scope. */
|
|
16
|
+
similar(id: string, params?: {
|
|
17
|
+
limit?: number;
|
|
18
|
+
organization_id?: string;
|
|
19
|
+
}): Promise<PaginatedResponse<Post>>;
|
|
15
20
|
/** Get a single post with replies */
|
|
16
21
|
get(id: string): Promise<SingleResponse<PostDetail>>;
|
|
17
22
|
/** Create a new post */
|
package/dist/resources/posts.js
CHANGED
|
@@ -15,6 +15,10 @@ export class PostsResource {
|
|
|
15
15
|
liked(params) {
|
|
16
16
|
return this.list({ ...params, liked: true });
|
|
17
17
|
}
|
|
18
|
+
/** Posts similar to this one (embedding neighbours), in the app's scope. */
|
|
19
|
+
similar(id, params) {
|
|
20
|
+
return this.client.get(`/posts/${encodeURIComponent(id)}/similar`, params);
|
|
21
|
+
}
|
|
18
22
|
/** Get a single post with replies */
|
|
19
23
|
get(id) {
|
|
20
24
|
return this.client.get(`/posts/${id}`);
|
|
@@ -1123,6 +1123,18 @@ export declare class ProtocolsResource {
|
|
|
1123
1123
|
post: string;
|
|
1124
1124
|
readRef?: string;
|
|
1125
1125
|
}): Promise<SingleResponse<SocialConversation>>;
|
|
1126
|
+
/** Public, app-moderated actor identity without member subscription/account state. */
|
|
1127
|
+
getSharedProfile(projectId: string, params: {
|
|
1128
|
+
protocol: string;
|
|
1129
|
+
actor: string;
|
|
1130
|
+
}): Promise<SingleResponse<Omit<SocialProfile, 'subscription'>>>;
|
|
1131
|
+
/** Bounded original public posts by one actor, with current app moderation. */
|
|
1132
|
+
getSharedAuthorFeed(projectId: string, params: {
|
|
1133
|
+
protocol: string;
|
|
1134
|
+
actor: string;
|
|
1135
|
+
limit?: number;
|
|
1136
|
+
cursor?: string;
|
|
1137
|
+
}): Promise<SingleResponse<SocialAuthorFeed>>;
|
|
1126
1138
|
/** Public, app-moderated discovery without account authority. Enrichment uses cached judgments only. */
|
|
1127
1139
|
getSharedTrends(projectId: string, params: {
|
|
1128
1140
|
protocol: string;
|
|
@@ -80,6 +80,15 @@ export class ProtocolsResource {
|
|
|
80
80
|
protocol: params.protocol, post: params.post, readRef: params.readRef,
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
+
/** Public, app-moderated actor identity without member subscription/account state. */
|
|
84
|
+
getSharedProfile(projectId, params) {
|
|
85
|
+
return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/profile`, { protocol: params.protocol, actor: params.actor });
|
|
86
|
+
}
|
|
87
|
+
/** Bounded original public posts by one actor, with current app moderation. */
|
|
88
|
+
getSharedAuthorFeed(projectId, params) {
|
|
89
|
+
return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/author-feed`, { protocol: params.protocol, actor: params.actor,
|
|
90
|
+
limit: params.limit, cursor: params.cursor });
|
|
91
|
+
}
|
|
83
92
|
/** Public, app-moderated discovery without account authority. Enrichment uses cached judgments only. */
|
|
84
93
|
getSharedTrends(projectId, params) {
|
|
85
94
|
return this.client.get(`/protocols/public/${encodeURIComponent(projectId)}/trends`, { protocol: params.protocol, limit: params.limit, cursor: params.cursor,
|