refactor: centralize token tracking and clean up console output (#3)

* refactor: centralize token tracking and clean up console output

- Remove manual token tracking in agent.ts
- Track tokens through tokenTracker.trackUsage()
- Clean up verbose console output
- Add ESLint configuration
- Fix TypeScript linting issues

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: simplify sleep function and use console.log consistently

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: remove color modifiers from console.log statements

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
This commit is contained in:
devin-ai-integration[bot]
2025-01-31 15:25:28 +08:00
committed by GitHub
parent 966ef5d026
commit f99608909c
10 changed files with 71 additions and 87 deletions

View File

@@ -6,7 +6,9 @@
"build": "tsc",
"dev": "npx ts-node src/agent.ts",
"search": "npx ts-node src/test-duck.ts",
"rewrite": "npx ts-node src/tools/query-rewriter.ts"
"rewrite": "npx ts-node src/tools/query-rewriter.ts",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix"
},
"keywords": [],
"author": "",
@@ -20,6 +22,9 @@
},
"devDependencies": {
"@types/node": "^22.10.10",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"eslint": "^8.56.0",
"ts-node": "^10.9.2",
"typescript": "^5.7.3"
}