Commit Graph

882 Commits

Author SHA1 Message Date
ciat-777 555f6e15ab feat: enhance tool call handling and serialization in chat formats
- Added support for tool calls in NormalizedFinalResponse type.
- Implemented functions to collect and serialize tool calls from OpenAI and Claude responses.
- Updated convertClaudeRequestToOpenAiBody to handle tool use and tool result messages.
- Enhanced normalizeUpstreamFinalResponse to include tool calls in the response structure.
- Introduced utility functions for safe JSON stringification and parsing.
- Improved conversion functions for OpenAI tools to Anthropic format and vice versa.
- Updated input handling in convertOpenAiBodyToMessagesBody and convertOpenAiBodyToResponsesBody to accommodate tool messages.
- Refactored serialization logic in serializeFinalResponse and buildSyntheticOpenAiChunks to include tool calls.
2026-03-02 22:18:13 +08:00
ciat-777 515d083b2c feat: 添加 Zeabur 一键部署指南和相关变量说明 2026-03-02 21:08:07 +08:00
ciat-777 ed2b30c347 fix: 更新 Dockerfile,添加缺失的依赖项安装 2026-03-02 20:51:20 +08:00
ciat-777 605c5e1959 refactor: 更新未知平台的端点优先级逻辑 2026-03-02 20:46:02 +08:00
ciat-777 487bd23a02 Add platform adapters and tests for CLIProxyAPI, OneHub, Sub2API, and title hint detection
- Implemented `CliProxyApiAdapter` with detection logic for CLIProxyAPI.
- Added tests for `CliProxyApiAdapter` to verify detection and response handling.
- Created `OneHubAdapter` with methods for fetching models and user groups.
- Added tests for `OneHubAdapter` to ensure correct fallback and response parsing.
- Developed `Sub2ApiAdapter` with detection and user info fetching capabilities.
- Added comprehensive tests for `Sub2ApiAdapter` covering various scenarios.
- Introduced `TitleHintPlatform` type and detection logic based on HTML title.
- Implemented tests for title hint detection to identify platforms from URLs.
2026-03-02 20:26:02 +08:00
ciat-777 897273fad4 fix: 更新 Zeabur 部署链接和按钮样式 2026-03-02 17:34:08 +08:00
cita 264a12ed00 feat: 添加 Zeabur 部署模板和相关文档 2026-03-02 16:14:59 +08:00
cita 9471d3359b Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-02 15:35:44 +08:00
cita 946907d66c Refactor code structure for improved readability and maintainability 2026-03-02 15:35:40 +08:00
Cita 515fcf1aaf Merge pull request #16 from cita-777/imgbot
[ImgBot] Optimize images
2026-03-02 14:46:13 +08:00
ImgBotApp 24f4b4aa56 [ImgBot] Optimize images
*Total -- 13,493.63kb -> 8,824.35kb (34.6%)

/docs/screenshots/account-balance.png -- 152.01kb -> 86.31kb (43.22%)
/docs/logos/drafts/logo1.png -- 5,242.26kb -> 3,141.12kb (40.08%)
/docs/screenshots/token-management.png -- 156.86kb -> 97.87kb (37.61%)
/docs/logos/logo.png -- 123.83kb -> 77.82kb (37.15%)
/docs/logos/logo-icon-128.png -- 34.64kb -> 21.89kb (36.81%)
/docs/logos/logo-icon-512.png -- 477.52kb -> 308.22kb (35.45%)
/src/web/public/logo.png -- 477.52kb -> 308.22kb (35.45%)
/docs/logos/drafts/logo2.png -- 1,789.13kb -> 1,186.45kb (33.69%)
/docs/logos/drafts/logo3.png -- 1,230.31kb -> 844.78kb (31.34%)
/docs/logos/logo-icon-64.png -- 9.81kb -> 6.77kb (30.99%)
/docs/screenshots/accounts.png -- 474.50kb -> 328.72kb (30.72%)
/docs/screenshots/dashboard.png -- 680.18kb -> 473.10kb (30.44%)
/docs/screenshots/model-marketplace.png -- 566.33kb -> 394.13kb (30.41%)
/docs/screenshots/routes.png -- 598.34kb -> 419.06kb (29.96%)
/docs/logos/logo-banner.png -- 94.92kb -> 67.79kb (28.58%)
/docs/screenshots/account-management.png -- 680.25kb -> 496.13kb (27.07%)
/docs/logos/logo-banner-sm.png -- 31.83kb -> 23.79kb (25.26%)
/docs/logos/logo-full.png -- 121.20kb -> 90.99kb (24.92%)
/docs/screenshots/allapi-hub-backup.png -- 193.06kb -> 145.82kb (24.47%)
/docs/screenshots/site-management.png -- 78.36kb -> 61.36kb (21.7%)
/docs/logos/logo-full-sm.png -- 40.96kb -> 32.34kb (21.06%)
/src/web/public/favicon-64.png -- 5.31kb -> 4.31kb (18.96%)
/docs/logos/logo-icon-32.png -- 2.84kb -> 2.32kb (18.11%)
/docs/screenshots/account-credentials.png -- 231.67kb -> 205.04kb (11.5%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2026-03-02 06:42:36 +00:00
cita a3f55a83f9 Refactor code structure for improved readability and maintainability 2026-03-02 14:37:49 +08:00
cita f6389a999a feat(tests): add comprehensive tests for TokenRouter and related components
- Implement tests for TokenRouter downstream policy, covering allowedRouteIds and site weight multipliers.
- Add tests for TokenRouter patterns and model mapping, including regex pattern matching and model mapping precedence.
- Create tests for BrandIcon component to verify brand detection logic.
- Develop tests for Accounts page, focusing on rebind panel behavior and refresh action on error.
- Introduce fuzzy search utility tests to validate substring and subsequence matching.
- Implement navigation focus helpers tests for building and parsing focus paths.
- Add progressive render tests to ensure correct initial and next visible counts.
- Create route model candidates index tests to validate route candidate indexing and matching logic.
2026-03-02 13:33:35 +08:00
cita 99c9e145c3 feat: 更新 Dockerfile 2026-03-01 18:17:04 +08:00
cita 5c1bbd0c62 feat: 更新 Dockerfile 和启动脚本,改用 Debian slim 基础镜像,增强 Node.js ABI 兼容性检查 2026-03-01 17:52:36 +08:00
cita 05a5ee9b9e feat: enhance upstream endpoint handling with new passthrough header extraction and response management
- Introduced new types for endpoint preferences to support 'responses'.
- Added functions to extract safe passthrough headers, Claude-specific headers, and responses-specific headers.
- Implemented logic to ensure proper handling of stream accept headers.
- Updated endpoint resolution logic to prioritize 'responses' in certain contexts.
- Enhanced request building for 'messages' and 'responses' endpoints with improved body sanitization and header management.
- Added comprehensive documentation for new features and usage instructions.
2026-03-01 17:26:50 +08:00
cita af63df808d Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-01 16:19:17 +08:00
cita 906e8328d6 feat: 添加发布工作流和启动脚本,支持直接运行预打包的 Release 产物 2026-03-01 16:19:14 +08:00
Cita a667aad3d0 Update Star History Chart link with version 2026-03-01 16:08:40 +08:00
cita e41b6b7993 feat: 增强设置功能,支持当前识别的管理 IP 和白名单更新逻辑 2026-03-01 15:39:13 +08:00
cita 4d6cd683b3 Merge branch 'main' of https://github.com/cita-777/metapi 2026-03-01 15:21:19 +08:00
cita 4e22b379a8 feat: Add support for OpenAI Responses endpoint and enhance proxy retry logic
- Updated proxyRetryPolicy to retry on all 4xx and 5xx status codes.
- Introduced 'responses' target format in TestChatRequestPayload.
- Implemented extractResponsesContent function to handle responses format in ModelTester.
- Enhanced ModelTester to support responses target format and display appropriate labels.
- Updated ProxyLogs to extract and display upstream paths from error messages.
- Added tests to ensure responses target format is preserved during payload sync.
- Created responses proxy route to handle requests to the new OpenAI Responses endpoint.
- Updated upstreamEndpoint logic to include responses endpoint handling.
- Added modelService tests to validate token route rebuilding logic.
2026-03-01 15:21:16 +08:00
Cita d6698e5da0 Update Star History chart link and parameters 2026-03-01 01:19:44 +08:00
cita 44af9a91cf feat: add sorting and pinning functionality for accounts and sites
- Introduced `isPinned` and `sortOrder` fields in the `accounts` and `sites` tables to allow users to pin and sort their accounts and sites.
- Updated API routes to handle pinning and sorting operations for accounts and sites.
- Enhanced the frontend to support sorting by balance and custom order, as well as toggling the pin status of accounts and sites.
- Added tests for sorting and reordering logic to ensure correct functionality.
- Updated documentation to reflect changes in token management and new features.
2026-02-28 23:45:30 +08:00
cita 08eaf11ea2 feat: 添加 Docker 发布工作流以支持多架构镜像构建 2026-02-28 22:50:46 +08:00
cita f75459f8bf feat: 添加表存在性检查以确保数据库模式的完整性 2026-02-28 22:26:05 +08:00
cita 9405d468d9 Add initial database schema and journal entries for token management
- Created a new snapshot JSON file (0003_snapshot.json) defining the schema for tables including account_tokens, accounts, checkin_logs, events, model_availability, proxy_logs, route_channels, settings, sites, token_model_availability, and token_routes.
- Added columns, indexes, and foreign key constraints for each table to ensure data integrity and relationships.
- Introduced a journal JSON file (_journal.json) to track schema versions and changes, including entries for version 6 with relevant tags and timestamps.
2026-02-28 22:20:28 +08:00
cita 2eeebbd686 docs: 修复 README.md 中的格式问题,移除多余的反引号 2026-02-28 17:45:02 +08:00
cita 9892770052 docs: 清理 README.md,移除冗余链接和占位符 2026-02-28 17:36:14 +08:00
cita 63481caa8b Refactor code structure for improved readability and maintainability 2026-02-28 17:30:34 +08:00
cita 20eec09211 docs: 更新 README.md,优化内容格式和结构 2026-02-28 00:40:13 +08:00
cita 2ecc23730d chore: initialize clean metapi repository 2026-02-28 00:36:28 +08:00