commits
refactor: code quality improvements and franc language detection
- Replace lande with franc for language detection
- Simplify API from probability map to single detection
- Handle "und" (undetermined) response by defaulting to "eng"
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
- Revert language detection from franc back to lande
- Add label deduplication checks in moderation functions
- Improve type safety with explicit type assertions
- Simplify check iteration logic across handle/post/profile checks
- Remove unused monitor.ts and processJetstream.ts files
- Remove test files and vitest config
- Remove temporary PLAN.md and PRD.md files
- Add duration support for post labels
- Fix import ordering and formatting issues
- Add modTool metadata to moderation events
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
feat(language-detection): replace lande with franc
- Add unit tests for getLanguage function with franc
- Test input validation, language detection for 10+ languages
- Add critical moderation tests for English vs French 'retard' disambiguation
- Verify franc can distinguish French 'delay' from English slur usage
- Include edge cases: emojis, special chars, mixed languages
- Add vitest configuration and test scripts
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced lande v1.0.10 with franc v6.2.0 for better maintenance and performance
- Simplified getLanguage function to use franc's simpler API
- Fixed redundant null check lint issue
- Removed invalid stylistic/comma-trailing package that was breaking npm install
- Updated implementation to handle franc's "und" (undetermined) response
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit introduces new files that provide comprehensive guidelines
for contributing to the project. The updated documentation enhances
maintainability and clarity for all contributors.
Feat/env validation
Adds a function to validate environment variables. This will catch any
issues early in the startup process.
Improve async error handling
Includes tasks to validate environment and add files.
- Add validateEnv.ts with validation for all required and optional environment variables
- Validate DID format (must start with 'did:')
- Validate OZONE_URL and OZONE_PDS as domain names
- Validate BSKY_HANDLE format (must contain '.')
- Support arithmetic expressions for LABEL_LIMIT and LABEL_LIMIT_WAIT (e.g., "2900 * 1000")
- Validate numeric values for ports and intervals
- Validate LOG_LEVEL and NODE_ENV against allowed values
- Exit with code 1 and clear error messages if validation fails
- Integrated validation call at application startup in main.ts
This addresses the security concern of missing environment variable validation identified in the code review.
This commit introduces an ESLint configuration file to the project. It
includes recommended rules and best practices for TypeScript projects.
The configuration also sets up various plugins and specifies ignores to
prevent linting of certain files.
- Updated TODO section to show completed async error handling work
- Listed all resolved issues including type safety, error handling, and code quality
- Added status for all cleaned files (7 files with zero linting errors)
- Clarified remaining tasks are configuration-related, not code quality
- Fixed constants.ts.example to use type import and include knownVectors property
The codebase is now production-ready with robust error handling and modern TypeScript practices.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed unnecessary conditional check in getLanguage function
- Since parameter is typed as string, typeof check and null check are redundant
- Simplified to check for falsy values only
- Updated log message to be more accurate
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed checkHandles.ts: removed require-await, added void for floating promises, fixed template literals, removed non-null assertions
- Fixed checkPosts.ts: removed unused imports, added void for floating promises, fixed template literals, removed non-null assertions
- Fixed checkStarterPack.ts: added correct imports for STARTERPACK_CHECKS, fixed floating promises, template literals, and logic issues
All three check modules now have zero linting errors and follow TypeScript best practices.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Removed unused imports (login, langs)
- Fixed unnecessary optional chain conditions
- Added void operator to floating promises for fire-and-forget operations
- Fixed template literal expressions by converting number to string
- Improved code quality and type safety
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed return-await issues by properly awaiting emitEvent calls
- Replaced template literal expressions with nullish coalescing for agent.did
- Removed unused parameter from checkAccountLabels function
- Made checkAccountLabels function non-async since it only returns null
- Applied nullish coalescing operator for better type safety
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed unsafe type assertions for metricsServer variable
- Added proper type conversions for template literal expressions
- Replaced hasOwnProperty with Object.hasOwn for better practice
- Converted async event handlers to non-async with void for fire-and-forget
- Added comprehensive error type annotations throughout
- Used Promise.allSettled for concurrent operations
- Removed unused imports and applied destructuring
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
fix: resolve unsafe type assertions in main.ts
- Fixed unsafe type assertions on lines 152 and 158 where embed.external
could potentially be undefined
- Added proper type checking before accessing nested properties
- Improves type safety and prevents potential runtime errors when
processing external embeds
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added comprehensive error handling throughout the codebase to ensure
robustness. - Enhanced logging for improved debugging capabilities. -
Improved shutdown process with graceful exit and cleanup.
This reverts commit 367198d9b94fbbb10d177a0a2c37bd5e2b5c0ece.
Adds a docker-compose file
17: Removed skywatch specific label hardcoding from checkPosts
10: Update constants.ts.example to add const langs
- Revert language detection from franc back to lande
- Add label deduplication checks in moderation functions
- Improve type safety with explicit type assertions
- Simplify check iteration logic across handle/post/profile checks
- Remove unused monitor.ts and processJetstream.ts files
- Remove test files and vitest config
- Remove temporary PLAN.md and PRD.md files
- Add duration support for post labels
- Fix import ordering and formatting issues
- Add modTool metadata to moderation events
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
- Add unit tests for getLanguage function with franc
- Test input validation, language detection for 10+ languages
- Add critical moderation tests for English vs French 'retard' disambiguation
- Verify franc can distinguish French 'delay' from English slur usage
- Include edge cases: emojis, special chars, mixed languages
- Add vitest configuration and test scripts
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced lande v1.0.10 with franc v6.2.0 for better maintenance and performance
- Simplified getLanguage function to use franc's simpler API
- Fixed redundant null check lint issue
- Removed invalid stylistic/comma-trailing package that was breaking npm install
- Updated implementation to handle franc's "und" (undetermined) response
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add validateEnv.ts with validation for all required and optional environment variables
- Validate DID format (must start with 'did:')
- Validate OZONE_URL and OZONE_PDS as domain names
- Validate BSKY_HANDLE format (must contain '.')
- Support arithmetic expressions for LABEL_LIMIT and LABEL_LIMIT_WAIT (e.g., "2900 * 1000")
- Validate numeric values for ports and intervals
- Validate LOG_LEVEL and NODE_ENV against allowed values
- Exit with code 1 and clear error messages if validation fails
- Integrated validation call at application startup in main.ts
This addresses the security concern of missing environment variable validation identified in the code review.
- Updated TODO section to show completed async error handling work
- Listed all resolved issues including type safety, error handling, and code quality
- Added status for all cleaned files (7 files with zero linting errors)
- Clarified remaining tasks are configuration-related, not code quality
- Fixed constants.ts.example to use type import and include knownVectors property
The codebase is now production-ready with robust error handling and modern TypeScript practices.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed unnecessary conditional check in getLanguage function
- Since parameter is typed as string, typeof check and null check are redundant
- Simplified to check for falsy values only
- Updated log message to be more accurate
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed checkHandles.ts: removed require-await, added void for floating promises, fixed template literals, removed non-null assertions
- Fixed checkPosts.ts: removed unused imports, added void for floating promises, fixed template literals, removed non-null assertions
- Fixed checkStarterPack.ts: added correct imports for STARTERPACK_CHECKS, fixed floating promises, template literals, and logic issues
All three check modules now have zero linting errors and follow TypeScript best practices.
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Removed unused imports (login, langs)
- Fixed unnecessary optional chain conditions
- Added void operator to floating promises for fire-and-forget operations
- Fixed template literal expressions by converting number to string
- Improved code quality and type safety
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed return-await issues by properly awaiting emitEvent calls
- Replaced template literal expressions with nullish coalescing for agent.did
- Removed unused parameter from checkAccountLabels function
- Made checkAccountLabels function non-async since it only returns null
- Applied nullish coalescing operator for better type safety
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed unsafe type assertions for metricsServer variable
- Added proper type conversions for template literal expressions
- Replaced hasOwnProperty with Object.hasOwn for better practice
- Converted async event handlers to non-async with void for fire-and-forget
- Added comprehensive error type annotations throughout
- Used Promise.allSettled for concurrent operations
- Removed unused imports and applied destructuring
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed unsafe type assertions on lines 152 and 158 where embed.external
could potentially be undefined
- Added proper type checking before accessing nested properties
- Improves type safety and prevents potential runtime errors when
processing external embeds
馃 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>