Files
archived-gitea-ai-assistant/package.json
jeffusion ec2029a942 feat(review): add token-aware context control with tokenlens
Replace hardcoded char-count context limits with token-based budgets using
tokenlens (data from models.dev). TokenCounter provides 3-tier context window
lookup: dynamic catalog (refreshed every 24h) → static tokenlens → 128k default.

- specialist-agent: token budget from model context window instead of MAX_CONTEXT_CHARS=100k
- critic-agent/reflexion-agent: tokenCounter.clip() instead of diff.slice(0, 3000/2000)
- diff-extractor: raw diff clipping at 30k tokens
- engine.ts: refreshCatalog() at startup, stopRefresh() at shutdown

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00

59 lines
1.5 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"name": "gitea-assistant",
"version": "1.0.0",
"description": "Gitea功能增强助手包含AI代码审核功能",
"engines": {
"bun": ">=1.2.5"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.78.0",
"@google/genai": "^1.43.0",
"@hono/zod-validator": "^0.4.3",
"@qdrant/js-client-rest": "^1.16.2",
"axios": "^1.8.3",
"dotenv": "^16.4.7",
"hono": "^4.11.9",
"lodash-es": "^4.17.21",
"openai": "^4.87.3",
"tokenlens": "^1.3.1",
"zod": "^3.25.1",
"zod-to-json-schema": "^3.25.1"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^11.0.6",
"@types/bun": "^1.3.10",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.13.10",
"concurrently": "^9.2.1",
"semantic-release": "^24.2.9",
"typescript": "^5.8.2"
},
"files": [
"./dist/*"
],
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"dev": "concurrently -k -p [{name}] -n backend,frontend -c blue,green \"bun run dev:backend\" \"bun run dev:frontend\"",
"dev:backend": "bun run --watch src/index.ts",
"dev:frontend": "cd frontend && bun run dev",
"build": "rm -rf dist && tsc",
"start": "bun run src/index.ts",
"start:prod": "bun run dist/index.js",
"lint": "biome check src/",
"test": "bun test"
},
"keywords": [
"code-review",
"gitea",
"ai",
"bun",
"typescript"
],
"author": "",
"license": "MIT"
}