-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(new-plugin): truth social #2537
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe pull request introduces a comprehensive Truth Social Client, a TypeScript-based package for interacting with the Truth Social API. The implementation includes modules for API interaction, post management, user engagement, search functionality, and environment configuration. The client provides capabilities for authentication, posting, searching, and managing interactions with robust error handling and rate limiting mechanisms. Changes
Possibly related PRs
Suggested Labels
Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🧹 Nitpick comments (11)
packages/client-truth-social/tsup.config.ts (2)
8-8
: Remove misleading comment about CommonJS.The format is correctly set to ESM, but the comment suggests CommonJS targeting.
- format: ["esm"], // Ensure you're targeting CommonJS + format: ["esm"],
3-20
: Enable TypeScript declaration files.Add the
dts
option to generate TypeScript declaration files for better TypeScript support.export default defineConfig({ entry: ["src/index.ts"], outDir: "dist", sourcemap: true, clean: true, format: ["esm"], + dts: true, external: [
packages/client-truth-social/src/index.ts (1)
35-38
: Ensure all components are stoppedIn the
stop
method, onlythis.post.stop()
is called. To prevent resource leaks, ensure thatthis.interaction
andthis.search
(if initialized) are also stopped.Apply this diff:
async stop() { await this.post.stop(); + await this.interaction.stop(); + if (this.search) { + await this.search.stop(); + } // Add other stop logic as needed }packages/client-truth-social/src/environment.ts (1)
4-4
: Remove unnecessaryprocess
declarationThe declaration of
process
is unnecessary since it's globally available in Node.js. This could lead to conflicts.Remove line 4.
packages/client-truth-social/src/utils.ts (1)
44-47
: Use consistent logging mechanismReplace
console.error
withelizaLogger.error
for consistent logging throughout the application.Apply this diff:
} catch (error) { - console.error("Error sending truth:", error); + elizaLogger.error("Error sending truth:", error); throw error; }Repeat this change for other instances of
console.error
.packages/client-truth-social/src/api.ts (2)
105-108
: Improve error logging inauthenticate
methodThe error handling in the
authenticate
method provides limited information, which may hinder debugging.Consider logging additional error details, such as
error.response.data
, to aid in troubleshooting authentication failures.
317-333
: Handle exceptions individually when processing target user postsIn the loop for processing target user posts, an exception for one user might prevent processing of subsequent users.
Consider wrapping each user's processing logic in its own try-catch block to ensure that an error with one user does not affect others.
packages/client-truth-social/src/interactions.ts (1)
294-343
: Separate error handling inhandleTruthInteractions
An error in processing one part (e.g., mentions) may prevent the rest of the method from executing.
Refactor to handle errors for each section independently to ensure full execution of the interaction handling.
packages/client-truth-social/src/types.ts (1)
36-39
: Adjust types inhashtags
historyIn
TruthSearchResults
, theuses
andaccounts
fields withinhashtags.history
are typed asstring
, but they may represent numeric values.Change the types of
uses
andaccounts
tonumber
if they represent counts.packages/client-truth-social/README.md (2)
107-121
: Add language specifier to the file tree code block.Specify the language for the fenced code block to improve syntax highlighting.
-``` +```txt🧰 Tools
🪛 Markdownlint (0.37.0)
107-107: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
123-131
: Simplify dependencies section.The repeated "depends on types.ts" statements can be simplified for better readability.
-api.ts depends on types.ts -base.ts depends on types.ts -post.ts depends on types.ts -interactions.ts depends on types.ts -search.ts depends on types.ts -environment.ts depends on types.ts -utils.ts depends on types.ts -index.ts depends on types.ts -environment.ts depends on types.ts +All modules depend on types.ts: +- api.ts +- base.ts +- post.ts +- interactions.ts +- search.ts +- environment.ts +- utils.ts +- index.ts🧰 Tools
🪛 LanguageTool
[grammar] ~123-~123: This phrase is duplicated. You should probably use “depends on” only once.
Context: ...ts
└── utils.ts- `api.ts` depends on `types.ts` - `base.ts` depends on `types.ts` - `post.ts` depends on `typ... (PHRASE_REPETITION) --- [grammar] ~125-~125: This phrase is duplicated. You should probably use “depends on” only once. Context: ....ts` depends on `types.ts` - `post.ts` depends on `types.ts` - `interactions.ts` depends on `types.ts` - `search.ts` depends on `t... (PHRASE_REPETITION) --- [grammar] ~127-~127: This phrase is duplicated. You should probably use “depends on” only once. Context: ...s` depends on `types.ts` - `search.ts` depends on `types.ts` - `environment.ts` depends on `types.ts` - `utils.ts` depends on `ty... (PHRASE_REPETITION) --- [grammar] ~129-~129: This phrase is duplicated. You should probably use “depends on” only once. Context: ...ts` depends on `types.ts` - `utils.ts` depends on `types.ts` - `index.ts` depends on `types.ts` - `environment.ts` depends ... (PHRASE_REPETITION) </details> </details> </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between cfd1f48c3f13a55c8bad632b430e0ddd00fd275c and c06e56f7e8bed4c7a5ff66a1efffd36ab57c5c3f. </details> <details> <summary>📒 Files selected for processing (14)</summary> * `packages/client-truth-social/README.md` (1 hunks) * `packages/client-truth-social/eslint.config.mjs` (1 hunks) * `packages/client-truth-social/package.json` (1 hunks) * `packages/client-truth-social/src/api.ts` (1 hunks) * `packages/client-truth-social/src/base.ts` (1 hunks) * `packages/client-truth-social/src/environment.ts` (1 hunks) * `packages/client-truth-social/src/index.ts` (1 hunks) * `packages/client-truth-social/src/interactions.ts` (1 hunks) * `packages/client-truth-social/src/post.ts` (1 hunks) * `packages/client-truth-social/src/search.ts` (1 hunks) * `packages/client-truth-social/src/types.ts` (1 hunks) * `packages/client-truth-social/src/utils.ts` (1 hunks) * `packages/client-truth-social/tsconfig.json` (1 hunks) * `packages/client-truth-social/tsup.config.ts` (1 hunks) </details> <details> <summary>✅ Files skipped from review due to trivial changes (2)</summary> * packages/client-truth-social/eslint.config.mjs * packages/client-truth-social/tsconfig.json </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 GitHub Actions: smoke-test</summary> <details> <summary>packages/client-truth-social/package.json</summary> [warning] Unsupported Node.js engine version. Wanted: 23.3.0, Current: 23.6.0 --- [error] Missing workspace dependency: @ai16z/eliza is listed as a dependency but not present in the workspace --- [warning] Local package.json exists but node_modules is missing. Run package installation </details> </details> <details> <summary>🪛 LanguageTool</summary> <details> <summary>packages/client-truth-social/README.md</summary> [duplication] ~68-~68: Possible typo: you repeated a word. Context: ...LENGTH: Number, the maximum length of a post - POST_INTERVAL_MIN: Number, the minimum inter... (ENGLISH_WORD_REPEAT_RULE) --- [uncategorized] ~86-~86: If this is a compound adjective that modifies the following noun, use a hyphen. Context: ...ttom) - Raw API communication - Rate limiting - Authentication 2. **Client Lay... (EN_COMPOUND_ADJECTIVE_INTERNAL) --- [grammar] ~123-~123: This phrase is duplicated. You should probably use “depends on” only once. Context: ...ts └── utils.ts
api.ts
depends ontypes.ts
base.ts
depends ontypes.ts
post.ts
depends on `typ...(PHRASE_REPETITION)
[grammar] ~125-~125: This phrase is duplicated. You should probably use “depends on” only once.
Context: ....tsdepends on
types.ts`
post.ts
depends ontypes.ts
interactions.ts
depends ontypes.ts
search.ts
depends on `t...(PHRASE_REPETITION)
[grammar] ~127-~127: This phrase is duplicated. You should probably use “depends on” only once.
Context: ...sdepends on
types.ts`
search.ts
depends ontypes.ts
environment.ts
depends ontypes.ts
utils.ts
depends on `ty...(PHRASE_REPETITION)
[grammar] ~129-~129: This phrase is duplicated. You should probably use “depends on” only once.
Context: ...tsdepends on
types.ts`
utils.ts
depends ontypes.ts
index.ts
depends ontypes.ts
environment.ts
depends ...(PHRASE_REPETITION)
[uncategorized] ~135-~135: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... ontypes.ts
Safety Notes
- Rate Limiting
- Built-in rate limit management
...(EN_COMPOUND_ADJECTIVE_INTERNAL)
🪛 Markdownlint (0.37.0)
packages/client-truth-social/README.md
107-107: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
🪛 Biome (1.9.4)
packages/client-truth-social/src/base.ts
[error] 10-10: Don't use 'BigInt' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'bigint' instead(lint/complexity/noBannedTypes)
🪛 Gitleaks (8.21.2)
packages/client-truth-social/src/api.ts
14-14: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🔇 Additional comments (4)
packages/client-truth-social/src/utils.ts (1)
106-117
:⚠️ Potential issueHandle asynchronous iteration correctly
The
getUserStatuses
method returns an asynchronous iterator. Ensure it's properly handled to avoid missed data or unhandled promises.Modify the code to correctly await the asynchronous iterator:
const comments = client.truthApi.getUserStatuses({ username: currentPost.account.username, limit: 1, sinceId: currentPost.in_reply_to_id }); -for await (const comment of comments) { +for await (const comment of comments) { await processThread(comment, depth + 1); }Ensure that the
for await...of
loop correctly iterates over the asynchronous iterator.Likely invalid or redundant comment.
packages/client-truth-social/src/search.ts (1)
1-235
: Code looks goodThe implementation is correct and follows best practices.
packages/client-truth-social/src/api.ts (1)
49-55
: Verify rate limit header parsing incheckRateLimit
Ensure that the rate limit headers (
x-ratelimit-limit
,x-ratelimit-remaining
,x-ratelimit-reset
) are parsed correctly, accounting for their data types and formats.packages/client-truth-social/src/interactions.ts (1)
21-46
: Ensure placeholders intruthShouldRespondTemplate
are correctly replacedVerify that all placeholders like
{{agentName}}
and{{truthUserName}}
in thetruthShouldRespondTemplate
are replaced during runtime to prevent template strings from appearing in the final output.
external: [ | ||
"dotenv", // Externalize dotenv to prevent bundling | ||
"fs", // Externalize fs to use Node.js built-in module | ||
"path", // Externalize other built-ins if necessary | ||
"@reflink/reflink", | ||
"@node-llama-cpp", | ||
"https", | ||
"http", | ||
"agentkeepalive", | ||
// Add other modules you want to externalize | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Add these dependencies to the externals list
external: [
"dotenv",
"fs",
"path",
"@reflink/reflink",
"@node-llama-cpp",
"https",
"http",
"agentkeepalive",
"@ai16z/eliza",
"glob",
"zod",
"whatwg-url",
// Add other modules you want to externalize
],
🔗 Analysis chain
Complete the external dependencies list.
The comment suggests more externals might be needed. Consider adding other dependencies from your package.json to prevent bundling issues.
Run this script to identify potential external dependencies:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Find dependencies in package.json that might need to be externalized
jq -r '.dependencies, .peerDependencies | keys[]' packages/client-truth-social/package.json 2>/dev/null
Length of output: 126
async stop(runtime: IAgentRuntime) { | ||
elizaLogger.log("Stopping Truth Social client"); | ||
// Implement stop logic | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Implement stop logic in TruthClientInterface
The stop
method currently only logs a message. Implement the logic to stop the TruthManager
instance to ensure all processes are terminated properly.
Add the following:
async stop(runtime: IAgentRuntime) {
elizaLogger.log("Stopping Truth Social client");
+ if (this.manager) {
+ await this.manager.stop();
+ }
}
Ensure that manager
is accessible within TruthClientInterface
.
Committable suggestion skipped: line range outside the PR's diff.
|
||
elizaLogger.log("Truth Social client started"); | ||
|
||
const manager = new TruthManager(runtime, this.enableSearch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix undefined 'enableSearch' property
At line 47, this.enableSearch
is used but not defined in TruthClientInterface
. This will cause a runtime error.
Apply this diff to define enableSearch
:
export const TruthClientInterface: Client = {
+ enableSearch: boolean, // Add this property
async start(runtime: IAgentRuntime) {
Alternatively, pass enableSearch
as a parameter to the start
method.
Committable suggestion skipped: line range outside the PR's diff.
TRUTHSOCIAL_DRY_RUN: z | ||
.string() | ||
.transform((val) => val.toLowerCase() === "true"), | ||
TRUTHSOCIAL_USERNAME: z.string().min(1, "Truth Social username is required"), | ||
TRUTHSOCIAL_PASSWORD: z.string().min(1, "Truth Social password is required"), | ||
MAX_TRUTH_LENGTH: z | ||
.string() | ||
.pipe(z.coerce.number().min(0).int()) | ||
.default(DEFAULT_MAX_TRUTH_LENGTH.toString()), | ||
POST_INTERVAL_MIN: z | ||
.string() | ||
.pipe(z.coerce.number().min(0).int()) | ||
.default("90"), | ||
POST_INTERVAL_MAX: z | ||
.string() | ||
.pipe(z.coerce.number().min(0).int()) | ||
.default("180"), | ||
ACTION_INTERVAL: z | ||
.string() | ||
.pipe(z.coerce.number().min(0).int()) | ||
.default("300000"), // 5 minutes | ||
ENABLE_ACTION_PROCESSING: z | ||
.string() | ||
.transform((val) => val.toLowerCase() === "true") | ||
.default("true"), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct default value placement in Zod schema
The default()
method should be called before transformations to ensure defaults are applied when the environment variable is undefined.
Apply this diff:
TRUTHSOCIAL_DRY_RUN: z
- .string()
+ .string().default("false")
.transform((val) => val.toLowerCase() === "true"),
Make similar adjustments for other fields with defaults.
Committable suggestion skipped: line range outside the PR's diff.
public truthApi: TruthSocialApi; | ||
public profile: any; | ||
public requestQueue: RequestQueue; | ||
public lastCheckedPostId: BigInt = BigInt(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use 'bigint' instead of 'BigInt' for consistency
In TypeScript, the lowercase 'bigint' should be used as the type annotation.
Apply this diff to fix the issue:
- public lastCheckedPostId: BigInt = BigInt(0);
+ public lastCheckedPostId: bigint = BigInt(0);
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public lastCheckedPostId: BigInt = BigInt(0); | |
public lastCheckedPostId: bigint = BigInt(0); |
🧰 Tools
🪛 Biome (1.9.4)
[error] 10-10: Don't use 'BigInt' as a type.
Use lowercase primitives for consistency.
Safe fix: Use 'bigint' instead
(lint/complexity/noBannedTypes)
private async trackUserEngagement( | ||
username: string, | ||
interactionType: string, | ||
points: number = 1 | ||
): Promise<void> { | ||
const engagement = this.userEngagementCache.get(username) || { | ||
interactions: 0, | ||
lastInteraction: new Date(), | ||
interactionTypes: new Set<string>() | ||
}; | ||
|
||
if (Date.now() - engagement.lastInteraction.getTime() > this.ENGAGEMENT_WINDOW) { | ||
engagement.interactions = 0; | ||
engagement.interactionTypes.clear(); | ||
} | ||
|
||
engagement.interactions += points; | ||
engagement.lastInteraction = new Date(); | ||
engagement.interactionTypes.add(interactionType); | ||
this.userEngagementCache.set(username, engagement); | ||
|
||
// Check if we should follow based on diverse engagement | ||
if (engagement.interactions >= this.ENGAGEMENT_THRESHOLD && | ||
engagement.interactionTypes.size >= 2) { | ||
try { | ||
const profile = await this.lookupUser(username); | ||
const alreadyFollowing = await this.checkIfFollowing(profile.id); | ||
|
||
if (!alreadyFollowing) { | ||
await this.followUser(profile.id); | ||
elizaLogger.log(`Following ${username} after ${engagement.interactions} points across ${engagement.interactionTypes.size} types`); | ||
} | ||
} catch (error) { | ||
elizaLogger.error(`Error following ${username}:`, error); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Address potential concurrency issues with userEngagementCache
The userEngagementCache
is modified in asynchronous contexts, which could lead to race conditions.
Ensure thread safety when updating shared data structures in asynchronous code. Synchronize access or redesign to prevent concurrent modifications.
if (timeSinceLastInteraction > this.conversationTimeout) { | ||
elizaLogger.log(`Conversation ${threadId} timed out after ${timeSinceLastInteraction/1000/60} minutes`); | ||
this.conversationDepths.delete(threadId); | ||
this.conversationTimeouts.delete(threadId); | ||
return true; // Allow new conversation to start | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify return value logic in shouldContinueConversation
Returning true
after a conversation times out may unintentionally allow continuation of expired conversations.
Consider returning false
when the conversation has timed out to prevent further replies in the same thread.
{ | ||
"name": "@ai16z/client-truth", | ||
"version": "0.1.5-alpha.5", | ||
"description": "Truth Social client integration for AI16Z agents", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@ai16z/eliza": "workspace:*", | ||
"glob": "11.0.0", | ||
"zod": "3.23.8" | ||
}, | ||
"devDependencies": { | ||
"tsup": "8.3.5" | ||
}, | ||
"scripts": { | ||
"build": "tsup --format esm --dts", | ||
"dev": "tsup --format esm --dts --watch", | ||
"lint": "eslint . --fix" | ||
}, | ||
"peerDependencies": { | ||
"whatwg-url": "7.1.0" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add engines field to specify Node.js version requirements.
Add Node.js version constraints to prevent version mismatches like the current warning (wanted 23.3.0, got 23.6.0).
{
"name": "@ai16z/client-truth",
+ "engines": {
+ "node": "^23.3.0"
+ },
...
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{ | |
"name": "@ai16z/client-truth", | |
"version": "0.1.5-alpha.5", | |
"description": "Truth Social client integration for AI16Z agents", | |
"main": "dist/index.js", | |
"type": "module", | |
"types": "dist/index.d.ts", | |
"dependencies": { | |
"@ai16z/eliza": "workspace:*", | |
"glob": "11.0.0", | |
"zod": "3.23.8" | |
}, | |
"devDependencies": { | |
"tsup": "8.3.5" | |
}, | |
"scripts": { | |
"build": "tsup --format esm --dts", | |
"dev": "tsup --format esm --dts --watch", | |
"lint": "eslint . --fix" | |
}, | |
"peerDependencies": { | |
"whatwg-url": "7.1.0" | |
} | |
} | |
{ | |
"name": "@ai16z/client-truth", | |
"engines": { | |
"node": "^23.3.0" | |
}, | |
"version": "0.1.5-alpha.5", | |
"description": "Truth Social client integration for AI16Z agents", | |
"main": "dist/index.js", | |
"type": "module", | |
"types": "dist/index.d.ts", | |
"dependencies": { | |
"@ai16z/eliza": "workspace:*", | |
"glob": "11.0.0", | |
"zod": "3.23.8" | |
}, | |
"devDependencies": { | |
"tsup": "8.3.5" | |
}, | |
"scripts": { | |
"build": "tsup --format esm --dts", | |
"dev": "tsup --format esm --dts --watch", | |
"lint": "eslint . --fix" | |
}, | |
"peerDependencies": { | |
"whatwg-url": "7.1.0" | |
} | |
} |
🧰 Tools
🪛 GitHub Actions: smoke-test
[warning] Unsupported Node.js engine version. Wanted: 23.3.0, Current: 23.6.0
[error] Missing workspace dependency: @ai16z/eliza is listed as a dependency but not present in the workspace
[warning] Local package.json exists but node_modules is missing. Run package installation
"dependencies": { | ||
"@ai16z/eliza": "workspace:*", | ||
"glob": "11.0.0", | ||
"zod": "3.23.8" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Missing @ai16z/eliza package in workspace
The workspace configuration is correct, but the @ai16z/eliza package doesn't exist in the workspace. Either:
- Add the missing package to the workspace
- Remove the dependency if it's no longer needed
- Update the reference if the package name has changed
🔗 Analysis chain
Fix workspace dependency configuration.
The pipeline is failing due to missing @ai16z/eliza
workspace dependency. Ensure the workspace is properly configured and the dependency is available.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check workspace configuration
cat pnpm-workspace.yaml || cat package.json | jq '.workspaces'
Length of output: 114
Script:
#!/bin/bash
# Check if @ai16z/eliza package exists
fd --type directory "eliza" packages/
Length of output: 64
Script:
#!/bin/bash
# Search for package.json files containing eliza
fd package.json packages/ --exec grep -l "eliza" {} \;
Length of output: 2025
Script:
#!/bin/bash
# Search for package.json files containing @ai16z/eliza as package name
fd package.json packages/ --exec jq -r 'select(.name == "@ai16z/eliza") | .name' {} \;
Length of output: 91
🧰 Tools
🪛 GitHub Actions: smoke-test
[warning] Unsupported Node.js engine version. Wanted: 23.3.0, Current: 23.6.0
[error] Missing workspace dependency: @ai16z/eliza is listed as a dependency but not present in the workspace
[warning] Local package.json exists but node_modules is missing. Run package installation
- Node.js 14+ | ||
- TypeScript 4.5+ | ||
- @ai16z/eliza framework |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update Node.js version requirement.
The Node.js version requirement (14+) conflicts with the package.json engine requirement (^23.3.0).
-Node.js 14+
+Node.js 23.3+
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- Node.js 14+ | |
- TypeScript 4.5+ | |
- @ai16z/eliza framework | |
- Node.js 23.3+ | |
- TypeScript 4.5+ | |
- @ai16z/eliza framework |
Truth Social Client
A TypeScript client for interacting with Truth Social's API, built on top of the @ai16z/eliza framework for AI-powered social media interactions.
System Overview
This client provides automated interaction capabilities with Truth Social, including:
Core Components
API Layer (
api.ts
)Base Client (
base.ts
)Post Management (
post.ts
)Interactions (
interactions.ts
)Search (
search.ts
)Environment (
environment.ts
)Supporting Files
types.ts
): TypeScript interfaces and typesutils.ts
): Shared utilities and helper functionsindex.ts
): Main entry point and client initializationRequirements
Dependencies
Environment Variables
Setup
npm install
npm start
Architecture
The system follows a layered architecture:
API Layer (Bottom)
Client Layer
Feature Layer
Interface Layer (Top)
File Dependencies
api.ts
depends ontypes.ts
base.ts
depends ontypes.ts
post.ts
depends ontypes.ts
interactions.ts
depends ontypes.ts
search.ts
depends ontypes.ts
environment.ts
depends ontypes.ts
utils.ts
depends ontypes.ts
index.ts
depends ontypes.ts
environment.ts
depends ontypes.ts
Safety Notes
Rate Limiting
Content Safety
Error Handling
Usage Warning
This client includes search and interaction capabilities that should be used responsibly.Be aware of:
Always test with
TRUTHSOCIAL_DRY_RUN=true
before live deployment.Summary by CodeRabbit
New Features
Documentation
Configuration
Core Capabilities