β chore: fix all Biome lint errors, base on dev branch#23
β chore: fix all Biome lint errors, base on dev branch#23warengonzaga merged 6 commits intodevfrom
Conversation
π¦ Package Build Flow β Monorepo Buildπ Pull Request Build β Pre-release package for testing PR changes
π₯ Quick Install (changed packages)npm i @tinyclaw/types@2.0.0-patch.ac44432 @tinyclaw/plugins@2.0.0-patch.ac44432 @tinyclaw/plugin-channel-discord@2.0.0-patch.ac44432 @tinyclaw/plugin-channel-friends@2.0.0-patch.ac44432 @tinyclaw/plugin-provider-openai@2.0.0-patch.ac44432 tinyclaw@2.0.0-patch.ac44432This package was built automatically by the Package Build Flow action. |
There was a problem hiding this comment.
Pull request overview
This PR rebases onto dev and resolves Biome (bun run lint) failures across the repository, primarily via automated formatting/import fixes plus a few manual refactors and targeted lint suppressions.
Changes:
- Replace bare Node.js stdlib imports (
fs,path,crypto, etc.) withnode:protocol equivalents and clean up unused imports/vars. - Refactor lint-triggering patterns (e.g., assignment-in-condition loops, implicit
anyinletdeclarations) and adjust tests/code formatting. - Fix wildcard-path regex escaping in
packages/shield/src/matcher.tsand add a couple ofbiome-ignoresuppressions for intentional regex patterns.
Reviewed changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/vite.config.ts | Use node:path import protocol. |
| src/web/tests/server.test.ts | Adjust ANSI stripping regex + minor test variable changes. |
| src/web/tests/security-db.test.ts | Template literals + optional chaining adjustment in assertion. |
| src/web/tests/main.test.ts | Remove unused test hooks/imports. |
| src/web/src/server.ts | Use node: stdlib imports; add explicit unknown typing for request bodies; rename unused catch vars. |
| src/web/src/security-db.ts | Use node: stdlib imports. |
| src/landing/vite.config.ts | Use node:path import protocol. |
| src/cli/tests/ui/banner.test.ts | Remove unused jest import from bun:test usage. |
| src/cli/tests/purge.test.ts | Use node: stdlib imports. |
| src/cli/tests/config.test.ts | Use node:path import protocol. |
| src/cli/tests/commands/start.test.ts | Remove unused jest import; minor numeric NaN check tweak. |
| src/cli/tests/commands/setup.test.ts | Remove unused jest import; NaN check + small boolean simplifications. |
| src/cli/tests/commands/backup.test.ts | Convert string concatenations to template literals. |
| src/cli/tests/cli-router.test.ts | Use node:path import protocol. |
| src/cli/src/ui/banner.ts | Convert concatenations to template literals. |
| src/cli/src/supervisor.ts | Use node:child_process import protocol. |
| src/cli/src/index.ts | Convert concatenations to template literals. |
| src/cli/src/commands/start.ts | Use node: stdlib imports; adjust unused types/vars; minor optional-call change. |
| src/cli/src/commands/setup.ts | Use node: stdlib imports; convert concatenations to template literals. |
| src/cli/src/commands/setup-web.ts | Use node: stdlib imports. |
| src/cli/src/commands/seed.ts | Use node: stdlib imports. |
| src/cli/src/commands/purge.ts | Use node: stdlib imports; convert concatenations to template literals. |
| src/cli/src/commands/config.ts | Convert concatenations to template literals. |
| src/cli/src/commands/backup.ts | Use node: dynamic imports; convert concatenations to template literals; minor null-safe trim. |
| plugins/channel/plugin-channel-friends/src/tools.ts | Prefer Number.isNaN. |
| plugins/channel/plugin-channel-friends/src/server.ts | Optional chaining on Map access in SSE push client management. |
| plugins/channel/plugin-channel-friends/src/index.ts | Use node: stdlib imports. |
| plugins/channel/plugin-channel-discord/tests/index.test.ts | Optional-call when invoking plugin pairing tools. |
| packages/shield/tests/parser.test.ts | Replace non-null assertions with optional chaining in expectations. |
| packages/shield/src/parser.ts | Refactor regex exec loop to avoid assignment-in-condition; prefer Number.isNaN. |
| packages/shield/src/matcher.ts | Harden wildcard path regex escaping; template literals for domain suffix matching. |
| packages/shell/tests/executor.test.ts | Use node: stdlib imports. |
| packages/shell/src/permissions.ts | Template literals in string/regex construction. |
| packages/sandbox/src/index.ts | Use node: stdlib imports. |
| packages/nudge/tests/nudge.test.ts | Remove unused mock import; optional chaining on handler list. |
| packages/memory/tests/memory-engine.test.ts | Use node: stdlib imports; replace non-null assertions with optional chaining in expectations. |
| packages/matcher/tests/matcher.test.ts | Replace non-null assertions with optional chaining in expectations. |
| packages/learning/src/index.ts | Use node: stdlib imports; rename unused params/catch vars. |
| packages/intercom/tests/intercom.test.ts | Replace non-null assertions with optional chaining in expectations. |
| packages/intercom/src/index.ts | Rename unused sequence var (still unused). |
| packages/heartware/tests/soul-generator.test.ts | Use node: stdlib imports; adjust forEach callback body. |
| packages/heartware/tests/meta.test.ts | Use node: stdlib imports; update require to node:fs. |
| packages/heartware/src/tools.ts | Rename unused catch vars. |
| packages/heartware/src/soul-traits.ts | Remove unused type import. |
| packages/heartware/src/soul-generator.ts | Use node:crypto import protocol. |
| packages/heartware/src/sandbox.ts | Use node:path import protocol. |
| packages/heartware/src/meta.ts | Use node: stdlib imports; template literal for truncation marker. |
| packages/heartware/src/manager.ts | Use node: stdlib imports; rename unused catch vars. |
| packages/heartware/src/loader.ts | Remove unused import; rename unused catch vars. |
| packages/heartware/src/backup.ts | Use node: stdlib imports; rename unused catch vars. |
| packages/heartware/src/audit.ts | Use node: stdlib imports; template literals for log lines; rename unused catch vars. |
| packages/delegation/tests/* | Replace non-null assertions with optional chaining in expectations; node: stdlib imports where applicable. |
| packages/delegation/src/types.ts | Remove unused type import. |
| packages/delegation/src/tools.ts | Remove/rename unused imports/constants/functions to satisfy lint. |
| packages/delegation/src/templates.ts | Remove unused type import. |
| packages/delegation/src/runner.ts | Add explicit LLMResponse typing; rename unused function. |
| packages/delegation/src/orientation.ts | Template literal for truncation. |
| packages/delegation/src/lifecycle.ts | Remove unused type imports. |
| packages/delegation/src/compat.ts | Add explicit Provider typing for previously implicit any. |
| packages/delegation/src/background.ts | Remove unused type imports. |
| packages/core/tests/update-checker.test.ts | Use node: stdlib imports; replace non-null assertions with optional chaining in expectations. |
| packages/core/src/update-checker.ts | Prefer Number.isNaN. |
| packages/core/src/loop.ts | Remove unused type import; rename unused locals. |
| packages/core/src/database.ts | Use node: stdlib imports; rename unused locals; template literal concat tweak. |
| packages/config/src/tools.ts | Prefer Number.isNaN. |
| packages/compactor/tests/compactor.test.ts | Use node: stdlib imports; replace non-null assertions with optional chaining in expectations. |
| packages/compactor/src/rules.ts | Add Biome ignore for intentional emoji regex; template literals. |
| packages/compactor/src/optimizer.ts | Rename unused regex constant; template literal concat tweak. |
| packages/compactor/src/dictionary.ts | Template literal concat tweak. |
π§ Container Build Complete - PR BuildBuild Status: β
Success π¦ Pull ImageDocker Hub: docker pull warengonzaga/tinyclaw:pr-73f3ee9GHCR: docker pull ghcr.io/warengonzaga/tinyclaw:pr-73f3ee9π Build Details
π·οΈ Image Tagsβ’ π Testing Your Changes
π Quick Start# Pull and run the container
Docker Hub: docker pull warengonzaga/tinyclaw:pr-73f3ee9
docker run <your-options> <image>π Security Scan Resultsπ Pre-Build Security Checksβ
Source Code Scan: 0 vulnerabilities found π³ Container Image Vulnerabilities
π Detailed Security ReportsView detailed vulnerability reports in the GitHub Security tab. π€ Powered by Container Build Flow Action v1.2.0 |
|
@copilot apply changes based on the comments in this thread |
Applied all 7 review comment fixes in commit
|
π¦ Package Build Flow β Monorepo Buildπ Pull Request Build β Pre-release package for testing PR changes
π₯ Quick Install (changed packages)npm i @tinyclaw/types@2.0.0-pr.d70213b @tinyclaw/plugins@2.0.0-pr.d70213b @tinyclaw/plugin-channel-discord@2.0.0-pr.d70213b @tinyclaw/plugin-channel-friends@2.0.0-pr.d70213b @tinyclaw/plugin-provider-openai@2.0.0-pr.d70213b tinyclaw@2.0.0-pr.d70213bThis package was built automatically by the Package Build Flow action. |
447f5f6 to
b4ff148
Compare
π¦ Package Build Flow β Monorepo Buildπ Pull Request Build β Pre-release package for testing PR changes
π₯ Quick Install (changed packages)npm i @tinyclaw/types@2.0.0-pr.9e09860 @tinyclaw/plugins@2.0.0-pr.9e09860 @tinyclaw/plugin-channel-discord@2.0.0-pr.9e09860 @tinyclaw/plugin-channel-friends@2.0.0-pr.9e09860 @tinyclaw/plugin-provider-openai@2.0.0-pr.9e09860 tinyclaw@2.0.0-pr.9e09860This package was built automatically by the Package Build Flow action. |
π¦ Package Build Flow β Monorepo Buildπ Pull Request Build β Pre-release package for testing PR changes
π₯ Quick Install (changed packages)npm i @tinyclaw/types@2.0.0-pr.73f3ee9 @tinyclaw/plugins@2.0.0-pr.73f3ee9 @tinyclaw/plugin-channel-discord@2.0.0-pr.73f3ee9 @tinyclaw/plugin-channel-friends@2.0.0-pr.73f3ee9 @tinyclaw/plugin-provider-openai@2.0.0-pr.73f3ee9 tinyclaw@2.0.0-pr.73f3ee9This package was built automatically by the Package Build Flow action. |
β¦rkflows (#20) * βοΈ setup: add Biome linter with CI integration * β chore: apply Biome lint and formatting fixes across codebase * βοΈ setup: add CodeQL analysis and Dependabot dependency scanning * π§ update (ci): merge commit lint into CI workflow as commits job * π§ update (ci): change Dependabot labels to security and infra * π§ update (release): use GH_PAT token in checkout to bypass branch ruleset (#22) * Initial plan * π§ update (release): use GH_PAT token in checkout to bypass branch ruleset Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> * β chore: fix all Biome lint errors, base on dev branch (#23) * β chore: initial plan for lint fixes * β chore: fix all 14 bun lint errors using Biome * π§ update: address code review comments on dead code and invariant handling * π§ update: fix regex pattern in correction patterns for better matching * βοΈ setup: add CI tolerance for bot commits and update AGENTS.md * π§ update: reorder correction patterns for consistency --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Waren Gonzaga <opensource@warengonzaga.com> * π§ update: optimize Base32 decoding by trimming trailing '=' characters * π§ update: improve condition evaluation by refining keyword extraction * π§ update (delegation): replace any casts with proper type annotations - use QueryTier type instead of any for tier casts in background.ts and tools.ts - use err instanceof Error guard instead of err: any in runner.ts - use Parameters<TemplateManager['update']>[1] for template updates - replace non-null assertions with optional chaining in templates.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (config): use nullish coalescing instead of non-null assertion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (heartware): use typed error intersection instead of any cast Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (nudge): replace any casts with proper type annotations - type PulseJob extension instead of any for __touchActivity property - import and use OutboundSource type in categoryToSource return type - map companion category to agent source value - replace any with unknown in intercom handler signatures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (sandbox): use typed record cast instead of any for globalThis access Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (shield): improve type safety and add biome-ignore comments - use nullish coalescing instead of non-null assertion for toolName - reformat keywords chain for readability - add biome-ignore comments for intentional any usage in tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (discord): add biome-ignore comment for intentional any in test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (cli): replace any casts with proper type annotations - use nullish coalescing for non-null assertions in setup.ts, supervisor.ts, banner.ts - use typed record cast for dynamic property access in start.ts shutdown handlers - replace any with unknown in test mock signatures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * π§ update (web): replace any casts with proper type annotations - add typed server parameter for getClientIP instead of any - use explicit fallback instead of non-null assertion for claimToken - add null check before returning recovery attempt record in security-db - replace any with unknown in test mock signatures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * βοΈ setup: update husky prepare script to ensure compatibility * π§ update (nudge): add IntercomEvent interface to fix TS18046 errors --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
packages/core/src/database.tsβ Remove unused prepared statements (_updateEpisodicAccessStmt,_pruneEpisodicEventsStmt)src/cli/src/commands/start.tsβ Remove redundant optional chaining inside channel guardsrc/cli/src/commands/start.tsβ Remove unused primary provider config reads (_primaryBaseUrl,_primaryApiKeyRef)src/cli/src/commands/start.tsβ Remove unused_matcherinitialization and importsrc/web/tests/server.test.tsβ FixcookieMatchguard with explicit throw and direct accessplugins/channel/plugin-channel-friends/src/server.tsβ Store Set in local variable for deterministic addpackages/intercom/src/index.tsβ Remove unused sequence counter and_seqvariableOriginal prompt
Fix all the bun lint errors and usue the dev branch as the base code and PR sent to dev branch not main branch.
[Chronological Review: The conversation began with the user requesting to fix all errors in bun lint using biome and to create a pull request (PR) to the dev branch. The user then expressed concerns about the impact of GitHub Actions and rulesets on changelog modifications. They questioned whether it was appropriate to make changes directly to the main branch and noted that the PR still used old workflows despite Commit Lint being part of CI. The user acknowledged that the latest changes were still in the dev branch and mentioned moving the codebase to dev in the PR.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including user concerns about workflows and changelog management.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: - "Fix all the bun lint errors and PR it to dev branch." - "Will that affect it?" - Concerns about changelog modifications. - "Is this the correct approach?" - Validation on changelog changes. - Session Context: The conversation focused on fixing linting errors, managing changelog updates, and ensuring proper CI workflows. - User Intent Evolution: The user transitioned from requesting fixes to expressing concerns about workflows and changelog management.- Technical Foundation:
- Bun Lint: A tool for identifying and fixing linting errors in code.
- Biome: A tool mentioned for linting purposes.
- GitHub Actions: Used for CI/CD processes and managing workflows.
- Codebase Status:
- No specific files were detailed, but the focus was on resolving linting issues and managing changelog updates.
- Problem Resolution:
- Issues Encountered: Concerns about the impact of GitHub Actions rules on changelog modifications.
- Solutions Implemented: User has moved the codebase to the dev branch.
- Debugging Context: Ongoing discussions about workflow consistency and changelog management.
- Progress Tracking:
- Completed Tasks: User has moved the codebase to the dev branch.
- Partially Complete Work: Fixing bun lint errors and creating a PR is still pending.
- Active Work State:
- Current Focus: Fixing bun lint errors and managing changelog updates.
- Recent Context: User expressed concerns about workflows and changelog modifications.
- Immediate Context: User was addressing the state of the dev branch and PR workflows.
- Recent Operations:
- Last Agent Commands: User requested to fix bun lint errors and delegate tasks to the cloud agent.
- Tool Results Summary: No specific results were provided, but the focus remains on resolving linting issues.
- Pre-Summary State: The agent was addressing user concerns about workflows and changelog modifications.
- Operation Context: The commands executed were aimed at fixing code issues and ensuring proper workflow management.
- Continuation Plan:
- [Pending Task 1]: Fix all bun lint errors and create a PR to the dev branch.
- [Pending Task 2]: Validate the approach to changelog modifications in relation to GitHub Actions rule...
Created from VS Code.
π¬ We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.