@recursiv/sdk 0.7.73 → 0.7.74
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/README.md +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/resources/moderation.d.ts +41 -0
- package/dist/resources/moderation.js +22 -0
- package/llm.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,6 +117,7 @@ for await (const chunk of r.agents.chatStream(agent.id, { message: 'Hello!' }))
|
|
|
117
117
|
| `r.github` | GitHub integration |
|
|
118
118
|
| `r.integrations` | External service connections |
|
|
119
119
|
| `r.admin` | User management, stats, content reports (`listReports`, `resolveReport`, `dismissReport`) |
|
|
120
|
+
| `r.moderation` | Moderation actions: `publicLog`, `mine`, `appeal`; staff `apply`, `resolveAppeal`, `list({ target_type?, target_id? })` (one target's recorded actions, newest first, at most 100; none named = the network's latest; 0.7.74) and `reverse(actionId)` (sent once: a repeat answers 404 `action_not_found`; 0.7.74); agent grants `listAgentGrants`, `grantAgent`, `revokeAgent` |
|
|
120
121
|
| `r.dispatcher` | Task queue, claims, signals, outcomes, webhooks |
|
|
121
122
|
| `r.goals` | Org goals with task rollups (group dispatcher tasks) |
|
|
122
123
|
| `r.protocols` | Private Minds safety: `sourceControls` (current enablement and saved choices; filter with `control`, each item may carry a `display` label), `setSourceControl`, `onSourceControlChange`, `reportSource`. Delegated accounts: `nativeSocialAccounts`, `startNativeSocialConnection`, `finishNativeSocialConnection`, `disconnectNativeSocialAccount`. Native follows: `nativeFollowStates` (every connected account's state for one source, one read), `nativeFollowState`, `prepareNativeFollow`, `submitNativeFollow`, `nativeFollowStatus` (native following or pending approval, distinct from a Minds feed subscription; preserve the complete signed Nostr list). Native reposts and undo: `nativeRepostState`, `prepareNativeRepost`, `submitNativeRepost`, `nativeRepostStatus` (public posts, explicit approval, connected account, no uncertain retries). Native likes and unlikes: `nativeLikeState`, `prepareNativeLike`, `submitNativeLike`, `nativeLikeStatus` (connected authority, app enablement and explicit approval; resume pending actions instead of duplicating them). Reviewed replies and optional linked posts: `prepareNativeReply`, `submitNativeReply`, `nativeReplyStatus`, `nativeReplyHistory`, `prepareNativeReplyRemoval`, `removeNativeReply` (require deployed API support and app enablement). Keyless shared post links: `sharedNetworks(projectId)`, `getSharedConversation(projectId, { protocol, post, readRef? })`. Member public reading: `searchPublicPosts` (selected account required for Bluesky/ActivityPub; public Nostr search), `getConnectedSocialConversation` (preserve result readerAccountId/readRef), `publicNetworks`, `searchPublicProfiles`, `getPublicProfile`, `getPublicAuthorFeed`, `getFollowingFeed`, `getPublicConversation`, `getPublicTrends`, `getPublicTrendFeed`; radar stories: `getPublicRadarStory` (one story by id with its posts; one that left the radar within its minimum lifetime, or within the last half hour, still answers live with `liveUntil` and the story that continues it; one that has left for longer comes with its archived copy and the live story it continues as; the id may be a World Today edition story's, and the answer then names it in `editionStory` under the story's radar id), keyless `getSharedRadarStory(projectId, { cluster })` and `getSharedRadarPosts(projectId, { cluster })` (keyless reads carry images and videos only from outlets and members marked `visitorMedia`; signed-in reads keep all media, so a share card uses only those); the Viral read (fastest-moving posts across Bluesky, the Fediverse, Nostr and Minds, each against its own network's pace; 0.7.59): `getPublicViral({ network?, category?, media?: 'video', limit?: 5 | 10 | 20 | 40, cursor?, compass? })` under the member's key and keyless `getSharedViral(projectId, params)` (visitors: `compass` `all` or `hide` only; a visitor's `media: 'video'` read can carry items whose video the server withheld, so filter with the exported `viralItemHasVideo` before a video player; `item.post` narrows on `item.protocol`). `status: 'off'` resolves with no items until the app enables the read, and `getSharedViral` also resolves an older API's 401 `missing_api_key` as off; `getPublicViral` throws every 401 and 403, so a session failure is never read as off; private app subscriptions: `listSubscriptions`, `subscribeToProfile`, `unsubscribeFromProfile`, `onSubscriptionChange`. `list` returns bounded adapter `maturity`, `limitations`, and exhaustive `supported`/`planned`/`unsupported` implementation capabilities (not provider health or enablement); settings, candidate refresh/status, search, and read-only quarantined candidate review via `listCandidates` / `getCandidate` |
|
package/dist/index.d.ts
CHANGED
|
@@ -208,7 +208,7 @@ export type { ReportTargetType, ReportStatus, CreateReportInput, ReportRecord, R
|
|
|
208
208
|
export { JudgmentsResource, isJudgmentSharedWordsError } from './resources/judgments.js';
|
|
209
209
|
export type { JudgmentSubjectKind, JudgmentSource, JudgmentOverrideMethod, PostLabelsStatus, PostLabelsQuery, PostLabelsSubject, PostLabelsCategory, PostLabelsPolitics, PostJudgmentRecord, PostJudgment, PostSafetyAttribution, PostLabelsCategoryView, PostLabelsSummaryView, PostLabelsFullView, PostLabels, DisputeJudgmentInput, JudgmentDispute, ReviewJudgmentInput, JudgmentReviewUpheld, JudgmentReviewAwaitingReviewer, JudgmentReviewOverridden, JudgmentReview, JudgmentSharedWordsDetails, JudgmentSharedWordsError, } from './resources/judgments.js';
|
|
210
210
|
export { ModerationResource } from './resources/moderation.js';
|
|
211
|
-
export type { ModerationTargetType, ModerationActionType, ModerationAppealStatus, ModerationPrinciple, PublicModerationAction, PublicModerationLog, OwnModerationAppeal, OwnModerationAction, OwnModerationLog, ApplyModerationActionInput, AgentModerationMode, AgentModerationGrant, } from './resources/moderation.js';
|
|
211
|
+
export type { ModerationTargetType, ModerationActionType, ModerationAppealStatus, ModerationPrinciple, PublicModerationAction, PublicModerationLog, OwnModerationAppeal, OwnModerationAction, OwnModerationLog, ApplyModerationActionInput, ModerationAction, ListModerationActionsParams, RecordedModerationTargetType, AgentModerationMode, AgentModerationGrant, } from './resources/moderation.js';
|
|
212
212
|
export { LinkPreviewResource } from './resources/link-preview.js';
|
|
213
213
|
export { SEARCH_SECTIONS, SearchResource } from './resources/search.js';
|
|
214
214
|
export type { SearchAnswer, SearchGroup, SearchOmitReason, SearchParams, SearchPerson, SearchRelated, SearchResponse, SearchSection, SearchStory, SearchTopic } from './resources/search.js';
|
|
@@ -63,6 +63,30 @@ export interface ApplyModerationActionInput {
|
|
|
63
63
|
actor_type?: 'human' | 'ai' | 'system';
|
|
64
64
|
source_report_id?: string;
|
|
65
65
|
}
|
|
66
|
+
/** Where an action can be recorded: `source_item` is one open-network post withheld from promotion surfaces. */
|
|
67
|
+
export type RecordedModerationTargetType = ModerationTargetType | 'source_item';
|
|
68
|
+
/** One recorded action as staff read it (GET /moderation/actions): who did what to which target, and why. */
|
|
69
|
+
export interface ModerationAction {
|
|
70
|
+
id: string;
|
|
71
|
+
target_type: RecordedModerationTargetType;
|
|
72
|
+
target_id: string;
|
|
73
|
+
action: ModerationActionType;
|
|
74
|
+
label: string | null;
|
|
75
|
+
reason: string | null;
|
|
76
|
+
/** The moderator or agent who acted; null for a system or classifier action. */
|
|
77
|
+
actor_id: string | null;
|
|
78
|
+
actor_type: 'human' | 'ai' | 'system';
|
|
79
|
+
source_report_id: string | null;
|
|
80
|
+
expires_at: string | null;
|
|
81
|
+
/** Null while the action is in force. */
|
|
82
|
+
reversed_at: string | null;
|
|
83
|
+
created_at: string;
|
|
84
|
+
}
|
|
85
|
+
/** Both fields, for one target's history; neither, for the network's latest actions. */
|
|
86
|
+
export interface ListModerationActionsParams {
|
|
87
|
+
target_type?: RecordedModerationTargetType;
|
|
88
|
+
target_id?: string;
|
|
89
|
+
}
|
|
66
90
|
/** What a granted agent may do on the report queue: shadow reads it; act also resolves and dismisses. */
|
|
67
91
|
export type AgentModerationMode = 'shadow' | 'act';
|
|
68
92
|
/** A network admin's grant letting one AI agent work the report queue. */
|
|
@@ -88,6 +112,23 @@ export declare class ModerationResource {
|
|
|
88
112
|
success: true;
|
|
89
113
|
id: string;
|
|
90
114
|
}>>;
|
|
115
|
+
/**
|
|
116
|
+
* Admin (0.7.74): recorded actions, newest first (at most 100), inside the caller's
|
|
117
|
+
* network and a bound key's app. Name a target (both fields) for its history,
|
|
118
|
+
* e.g. to reverse a ban still in force; name none for the latest actions.
|
|
119
|
+
*/
|
|
120
|
+
list(params?: ListModerationActionsParams): Promise<SingleResponse<ModerationAction[]>>;
|
|
121
|
+
/**
|
|
122
|
+
* Admin (0.7.74): reverse an action; the target's state is derived again from what is
|
|
123
|
+
* still in force (an account is unbanned when its last ban goes) and the
|
|
124
|
+
* public log shows the reversal. Sent once, never retried: a repeat of a
|
|
125
|
+
* reversal that landed answers 404 `action_not_found` (`NotFoundError`), as
|
|
126
|
+
* does an action already reversed. A reviewed label override answers 409
|
|
127
|
+
* `use_judgment_review`.
|
|
128
|
+
*/
|
|
129
|
+
reverse(actionId: string): Promise<SingleResponse<{
|
|
130
|
+
success: true;
|
|
131
|
+
}>>;
|
|
91
132
|
/**
|
|
92
133
|
* List decisions affecting the caller or content they own. This remains
|
|
93
134
|
* reachable through a valid key while the account is suspended or banned.
|
|
@@ -15,6 +15,28 @@ export class ModerationResource {
|
|
|
15
15
|
apply(input) {
|
|
16
16
|
return this.client.post('/moderation/actions', input);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Admin (0.7.74): recorded actions, newest first (at most 100), inside the caller's
|
|
20
|
+
* network and a bound key's app. Name a target (both fields) for its history,
|
|
21
|
+
* e.g. to reverse a ban still in force; name none for the latest actions.
|
|
22
|
+
*/
|
|
23
|
+
list(params = {}) {
|
|
24
|
+
return this.client.get('/moderation/actions', {
|
|
25
|
+
target_type: params.target_type,
|
|
26
|
+
target_id: params.target_id,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Admin (0.7.74): reverse an action; the target's state is derived again from what is
|
|
31
|
+
* still in force (an account is unbanned when its last ban goes) and the
|
|
32
|
+
* public log shows the reversal. Sent once, never retried: a repeat of a
|
|
33
|
+
* reversal that landed answers 404 `action_not_found` (`NotFoundError`), as
|
|
34
|
+
* does an action already reversed. A reviewed label override answers 409
|
|
35
|
+
* `use_judgment_review`.
|
|
36
|
+
*/
|
|
37
|
+
reverse(actionId) {
|
|
38
|
+
return this.client.post(`/moderation/actions/${encodeURIComponent(actionId)}/reverse`, undefined, { retry: false });
|
|
39
|
+
}
|
|
18
40
|
/**
|
|
19
41
|
* List decisions affecting the caller or content they own. This remains
|
|
20
42
|
* reachable through a valid key while the account is suspended or banned.
|
package/llm.md
CHANGED
|
@@ -820,6 +820,7 @@ const { data: quote } = await r.appSubscriptions.previewTierChange({ tier: 'pro'
|
|
|
820
820
|
await r.appSubscriptions.changeTier({ tier: 'pro', proration_date: quote.prorationDate })
|
|
821
821
|
```
|
|
822
822
|
- `r.admin` — Admin operations (user management, stats, network settings); content reports: `listReports({ status? })`, `resolveReport(id)`, `dismissReport(id)` (project-bound keys see only their app's reports)
|
|
823
|
+
- `r.moderation` — Moderation actions. Staff (admin key), 0.7.74: `const { data: actions } = await r.moderation.list({ target_type: 'user', target_id: userId })` reads one target's recorded actions (`ModerationAction`: `id`, `target_type` incl. `source_item`, `action`, `label`, `reason`, `actor_id`, `actor_type`, `source_report_id`, `expires_at`, `reversed_at`, `created_at`), newest first, at most 100, inside the caller's network and a project-bound key's app; `list()` with no target reads the network's latest. Unban = reverse each ban still in force: `for (const a of actions.filter(a => a.action === 'ban' && !a.reversed_at)) await r.moderation.reverse(a.id)`; the target's state is derived again from what is still in force. `reverse` is sent once, never retried: 404 `action_not_found` (`NotFoundError`) means already reversed or not in the caller's scope; 409 `use_judgment_review` means a reviewed label override (change it with `r.judgments.review`). An older SDK has neither method. Also `apply`, `publicLog`, `mine`, `appeal`, `resolveAppeal`, and agent grants `listAgentGrants`, `grantAgent(agentId, 'shadow' | 'act')`, `revokeAgent`.
|
|
823
824
|
- `r.judgments` (0.7.71) — Jev's labels of one post. `get({ kind: 'post' | 'network_post', id })`: switch on `data.view` — `'full'` for the post's author and staff (`judgments` with answers, `safety` verdict, `viral.withheld`; staff also `reviewer_ids`, `review_note`), `'summary'` for other members (`category`, `politics` band in words with its `judgment_id`; never a probability or cell). `data.status === 'unavailable'` (returned, not thrown): hide label actions. `getPublic(projectId, { kind, id })` on an anonymous client: `view: 'category'` only. `dispute(judgmentId, { question_key: 'placement', proposed: 'cm' | … | 'not_political', note? })` (safety: `question_key: 'safety'`, author only): the author's dispute is an appeal; a repeat answers `existing: true`. Staff: `review(judgmentId, { outcome: 'uphold' } | { outcome: 'override', proposed, note?, apply_to_shared? })`, sent once (never retried): a compass override answers 202 `{ status: 'awaiting_reviewer', agreeing, needed }` until a second reviewer (or an agreeing Jev re-judge) proposes the same; a safety override to `'none'` that would free other posts throws 409 `shared_words` (`isJudgmentSharedWordsError(e)`, `e.details.shared_posts`) until resent with `apply_to_shared: true`. Budgets (60 reads/hour, 25 of one author's posts, 20 disputes/day) throw `RateLimitError` with `scope: 'action'` at once. Example: `const { data } = await r.judgments.get({ kind: 'post', id }); if (data.status === 'ok' && data.view === 'summary' && data.politics) await r.judgments.dispute(data.politics.judgment_id, { question_key: 'placement', proposed: 'not_political' })`
|
|
824
825
|
- `r.inviteCodes` / `r.inviteCodesAdmin` — Invite code management
|
|
825
826
|
- `r.organizationSettings` / `r.organizationSecurity` — Org configuration
|