Skip to content

Commit

Permalink
fix jsdocs comments
Browse files Browse the repository at this point in the history
  • Loading branch information
madjin committed Dec 29, 2024
1 parent 9808603 commit 4a6be4e
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 42 deletions.
2 changes: 0 additions & 2 deletions packages/adapter-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const __dirname = path.dirname(__filename); // get the name of the directory
* @class
* @extends DatabaseAdapter<Pool>
* @implements IDatabaseCacheAdapter
*/
**/
export class PostgresDatabaseAdapter
extends DatabaseAdapter<Pool>
implements IDatabaseCacheAdapter
Expand Down
2 changes: 0 additions & 2 deletions packages/client-discord/src/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ export class AudioMonitor {
/**
* Class representing a VoiceManager.
* @extends EventEmitter
*/
**/
export class VoiceManager extends EventEmitter {
private processingVoice: boolean = false;
private transcriptionTimeout: NodeJS.Timeout | null = null;
Expand Down
2 changes: 0 additions & 2 deletions packages/client-farcaster/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { sendCast } from "./actions";

/**
* Class representing a Farcaster Post Manager.
*/
**/
export class FarcasterPostManager {
private timeout: NodeJS.Timeout | undefined;
Expand Down
2 changes: 0 additions & 2 deletions packages/client-farcaster/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export function castId({ hash, agentId }: { hash: string; agentId: string }) {
* @param {string} props.hash - The hash to be casted to UUID.
* @param {string} props.agentId - The agentId to be casted to UUID.
* @returns {string} - The UUID format generated from the hash and agentId.
*/
**/
export function castUuid(props: { hash: string; agentId: string }) {
return stringToUuid(castId(props));
}
Expand Down
2 changes: 0 additions & 2 deletions packages/client-github/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ export class GitHubClient {
async createMemoriesFromFiles() {
console.log("Create memories");
const searchPath = this.config.path
? path.join(this.repoPath, this.config.path, "**/*")
: path.join(this.repoPath, "**/*");

const files = await glob(searchPath, { nodir: true });

Expand Down
2 changes: 0 additions & 2 deletions packages/client-lens/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { getProfilePictureUri, handleBroadcastResult, omit } from "./utils";
* @param {Map<string, any>} opts.cache - The cache for storing data.
* @param {PrivateKeyAccount} opts.account - The private key account for authentication.
* @param {string} opts.profileId - The profile ID for the client.
*/
**/
export class LensClient {
runtime: IAgentRuntime;
account: PrivateKeyAccount;
Expand Down
2 changes: 0 additions & 2 deletions packages/client-lens/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import StorjProvider from "./providers/StorjProvider";
* sending them using the LensClient and IAgentRuntime provided during initialization.
*
* @class LensPostManager
*/
**/
export class LensPostManager {
private timeout: NodeJS.Timeout | undefined;
Expand Down
2 changes: 0 additions & 2 deletions packages/client-slack/src/actions/send-message.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const MESSAGE_CACHE_TTL = 5000; // 5 seconds TTL

/**
* Class representing an action to send a message using Slack API.
*/
**/
export class SendMessageAction {
/**
* Constructor for creating a new instance of the class.
Expand Down
2 changes: 0 additions & 2 deletions packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ export type InterestChats = {
* Class representing a Message Manager for handling messages in a Telegram bot.
* @param {Telegraf<Context>} bot - The Telegraf instance for the bot.
* @param {IAgentRuntime} runtime - The runtime information for the agent.
*/
**/
export class MessageManager {
public bot: Telegraf<Context>;
private runtime: IAgentRuntime;
Expand Down
2 changes: 0 additions & 2 deletions packages/client-twitter/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ Thread of Tweets You Are Replying To:

/**
* Class representing a TwitterInteractionClient.
*/
**/
export class TwitterInteractionClient {
client: ClientBase;
runtime: IAgentRuntime;
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export class MemoryCacheAdapter implements ICacheAdapter {

/**
* Cache adapter that uses the filesystem to store data.
*/
**/
export class FsCacheAdapter implements ICacheAdapter {
/**
* Constructor for creating an instance with the specified data directory.
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const defaultMatchCount = 10;
/**
* Represents a MemoryManager that interacts with memory objects in a database table.
* @implements {IMemoryManager}
*/
**/
export class MemoryManager implements IMemoryManager {
/**
* The AgentRuntime instance associated with this manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,6 @@ export type Products = {
* @property {ProductVenue} [product_venue] - The venue of the product.
* @property {string} [approximate_quote_24h_volume] - The approximate trading volume in the last 24 hours.
* @property {Record<string, any>} [future_product_details] - Details of future product.
*/
**/
export type Product = {
product_id: string;
price: string;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-echochambers/src/echoChamberClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const RETRY_DELAY = 5000;

/**
* Represents a client for interacting with the Echo Chamber API.
*/
**/
export class EchoChamberClient {
private runtime: IAgentRuntime;
private config: EchoChamberConfig;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-node/src/services/llama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ interface QueuedMessage {
* Represents a Llama Service that extends Service class.
* Manages initialization, model loading, queue processing, completions, and embeddings.
* Supports using local GGUF model or Ollama API for completions and embeddings.
*/
**/
export class LlamaService extends Service {
private llama: Llama | undefined;
private model: LlamaModel | undefined;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-solana/src/providers/trustScoreProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ interface RecommenderData {
* @property {number} averageRiskScore - The average risk score given by recommenders.
* @property {number} averageConsistencyScore - The average consistency score given by recommenders.
* @property {RecommenderData[]} recommenders - An array of RecommenderData objects containing information about recommenders.
*/
**/
interface TokenRecommendationSummary {
tokenAddress: string;
averageTrustScore: number;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-starknet/src/providers/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ export const PORTFOLIO_TOKENS = {

/**
* Class representing a Token Provider.
*/
**/
export class TokenProvider {
private cache: Cache;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-starknet/src/utils/ERC20Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export type TransferCall = {

/**
* ERC20Token class representing an ERC20 token contract.
*/
**/
export class ERC20Token {
abi: any;
contract: Contract;
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-story/src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,6 @@ export type IPLicenseDetails = {
* @property {string} licenseTermsId - The unique identifier for the license terms
* @property {string} blockNumber - The block number when the license was created
* @property {string} blockTime - The timestamp when the license was created
*/
**/
export type IPLicenseTerms = {
id: string;
ipId: Address;
Expand Down
4 changes: 0 additions & 4 deletions packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ interface Transaction {
/**
* TrustScoreDatabase class for managing trust score related data in the database.
* @class
*/
**/
export class TrustScoreDatabase {
private db: Database;
Expand Down Expand Up @@ -328,8 +326,6 @@ export class TrustScoreDatabase {
* - trade
* - simulation_trade
* - transactions
*/
**/
private initializeSchema() {
// Enable Foreign Key Support
this.db.exec(`PRAGMA foreign_keys = ON;`);
Expand Down
51 changes: 51 additions & 0 deletions scripts/fix_jsdoc_comments.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Exit on error
set -e

# Timestamp for backup
timestamp=$(date +%Y%m%d_%H%M%S)
backup_file="ts_files_backup_${timestamp}.tar.gz"

echo "Creating backup of all .ts files..."
find . -name "*.ts" -print0 | tar czf "$backup_file" --null -T -

echo -e "\nSearching for stray JSDoc closings after proper closings..."
affected_files=$(find . -name "*.ts" -exec rg "\*/\s*\n\s*\*\*/" --multiline -l {} \;)

if [ -z "$affected_files" ]; then
echo "No files found with stray JSDoc closings."
echo "Backup created at: $backup_file"
exit 0
fi

echo -e "\nFound stray closings in these files:"
echo "$affected_files"

echo -e "\nHere are the problematic sections (with context):"
find . -name "*.ts" -exec rg "\*/\s*\n\s*\*\*/" --multiline -B 2 -A 2 {} \;

echo -e "\nBackup created at: $backup_file"
read -p "Do you want to proceed with fixing these files? (y/N): " confirm

if [[ $confirm =~ ^[Yy]$ ]]; then
echo "Fixing files..."
# Delete the line with **/ that comes after a line with */
find . -name "*.ts" -exec sed -i -e '/\*\//{ N; /\*\/.*\n.*\*\*\//{ d; }; P; D; }' {} \;

echo -e "\nChecking for remaining issues..."
remaining=$(find . -name "*.ts" -exec rg "\*/\s*\n\s*\*\*/" --multiline -l {} \;)

if [ -z "$remaining" ]; then
echo "All issues fixed successfully!"
else
echo "Warning: Some issues remain. You might want to check these files:"
echo "$remaining"
fi

echo -e "\nIf you need to restore from backup, use:"
echo "tar xzf $backup_file"
else
echo "Operation cancelled. No files were modified."
echo "Backup file remains at: $backup_file"
fi

0 comments on commit 4a6be4e

Please sign in to comment.