Commit Graph

50 Commits

Author SHA1 Message Date
cita-777 c94e3148dd Let operators deploy recent dev Docker tags without manual lookup
The update center already allowed manual Docker tag deploys, but operators
still had to know and paste dev or branch tags by hand. This change keeps the
stable Docker Hub candidate as the main path while automatically surfacing the
most recent non-stable tags and their digests for one-click deployment.

Constraint: Stable Docker Hub discovery must remain the default candidate path
Constraint: Existing deploy API and helper protocol should stay unchanged
Rejected: Promote dev tags into the primary stable candidate slot | would blur stable and experimental release semantics
Rejected: Add a brand new backend deploy endpoint for recent tags | existing targetTag/targetDigest deploy path already covers the need
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep stable and recent non-stable Docker tag discovery distinct unless product semantics deliberately change
Tested: Focused vitest for update-center services/routes/UI, npm run typecheck, npm run repo:drift-check, npm run build:web, npm run docs:build, git diff --check
Not-tested: Full npm test remains red because tmp/sub2api frontend suites are still broken in this repo snapshot
2026-04-18 15:28:03 +08:00
cita-777 87fb5149e6 Let operators deploy dev Docker Hub tags from the update center
The update center previously surfaced stable Docker Hub candidates but
left dev and branch-tag rollouts stranded in SSH and Helm commands.
This adds a repo-native manual Docker tag entrypoint in Settings so
operators can deploy dev, branch, temporary, or sha tags through the
existing helper flow without changing the backend deploy contract.

Constraint: Keep the existing helper API and digest-aware Helm contract unchanged
Constraint: Preserve stable Docker Hub candidate discovery for default reminders
Rejected: Expand automatic Docker Hub discovery to all branch tags | would blur stable release reminders with operator-only rollout targets
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep automatic candidate detection stable-first; manual tag deploy is the escape hatch for non-stable tags
Tested: update-center focused vitest suite; typecheck; build:web; docs:build; repo:drift-check
Not-tested: Full npm test remains red due to unrelated tmp/sub2api frontend suites and an existing firstByteTimeout unhandled error
2026-04-17 22:43:47 +08:00
cita-777 f67ade2e59 Keep dev green after moving the active worktree snapshot
The transferred dev snapshot was not publication-ready yet: full tests still
failed because worktree-local docs resolution assumed a repo-root node_modules
tree, some protocol expectations no longer matched the refactored request
bridges, oauth/account-token route tests reused stale modules after resetting
DATA_DIR, and model discovery still fired unawaited default-token writes.

This follow-up makes the moved dev branch self-consistent and green again by
stabilizing module/test isolation, awaiting token mirroring writes, and
aligning narrow tests with the current transformer and request-builder
contracts.

Constraint: The fix set had to stay narrow and unblock the new dev branch without reworking the broader transferred refactor
Rejected: Revert the transferred snapshot | would lose the user's requested dev-branch continuation point
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: If more DATA_DIR-scoped API test files start flaking under shared workers, reset modules before importing singleton db/config modules instead of relying on process env mutation alone
Tested: git diff --check; npm run typecheck; npm run repo:drift-check; npm test
Not-tested: Live OAuth/provider flows outside the mocked test harness
2026-04-17 19:59:14 +08:00
Cita ef1962d10b [codex] rename site API request wording (#423)
* rename site api request wording

* replace real site example domains
2026-04-05 19:16:08 +08:00
Cita 19bfed2e33 [codex] refresh integration and settings docs for current UI and provider coverage (#398)
* docs: refresh integration and settings guides

* docs: address review follow-up
2026-04-02 17:28:27 +08:00
Cita 1407f754b1 [codex] add Fedora desktop rpm packaging (#390)
* add Fedora desktop rpm packaging

* harden desktop packaging yaml assertion
2026-04-02 12:53:28 +08:00
Bainily 596d1b93cb feat(server): add proactive channel probes and load-aware stable routing / 服务端新增主动探活与负载感知稳定路由 (#330)
* wip: preserve local changes before upstream merge

* Improve proxy routing stability and add stable-first strategy

* Sync explicit-group routing strategy to eligible source routes

* Fix proxy retry and runtime health review issues

* fix: make proxy channel retry attempts configurable

* fix: harden proxy retry recovery and bookkeeping

* fix: address pr 257 review comments

* feat(proxy): add sticky session channel coordination

* feat(server): add proactive channel probes and load-aware stable routing

* test(server): stabilize session load routing selection assertion

* fix(proxy): harden codex forwarding stability

* fix(router): rotate stable-first channels by healthy order

* fix(server): address probe review feedback

* fix(server): address probe review follow-ups

* fix(ci): address CodeQL and core test failures

* feat(server): refine stable-first routing recovery and observation

* Finish PR 330 settings and review fixes

* Fix chat site endpoint CI mock

* Address latest PR 330 review comments

---------

Co-authored-by: Cita <juricek.chen@gmail.com>
2026-04-02 09:49:04 +08:00
Cita 5fffcb6d66 feat: support CIDR admin allowlists (#377) 2026-04-01 21:06:13 +08:00
Cita 5d54e92dc6 docs: add management API guide (#334) 2026-03-30 22:53:33 +08:00
Cita 9eb33df6d4 [codex] add automatic update-center reminders (#333)
* add automatic update-center reminders

* fix update-center reminder review issues
2026-03-30 22:37:24 +08:00
Cita 01481be511 [codex] Add digest-safe k3s update-center assets (#326)
* Add digest-safe k3s update-center assets

* Harden k3s update-center assets

* Trim k3s env secret names safely
2026-03-30 17:17:24 +08:00
Cita d47c3c4a29 Support digest-aware update center rollbacks (#318) 2026-03-29 22:16:39 +08:00
Cita 11583c51b9 [codex] add K3s update center (#314)
* add k3s update center

* fix update center status timeouts

* Polish update center settings UI

* Document k3s update center

* Refocus update center docs for users

* Clarify k3s migration path in docs
2026-03-29 17:43:49 +08:00
Cita 8ebfc39745 [codex] add harness engineering guardrails (#284)
* refactor: add harness engineering guardrails

* fix: address harness review feedback

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
2026-03-26 21:22:36 +08:00
Cita bf969c136a docs: capture full-scope consolidation finish 2026-03-23 14:32:11 +08:00
Cita 5d78658af9 fix: address review feedback and code scanning alerts 2026-03-22 23:41:45 +08:00
Cita 9290e51ecc refactor: consolidate single-source routing and protocol helpers 2026-03-22 21:27:09 +08:00
cita 940bc1d71c add site announcements 2026-03-20 11:24:29 +08:00
ciat-777 bfb7ea180f Refine DownstreamKeys management page 2026-03-16 14:41:29 +08:00
ciat-777 7e7add1343 docs: add downstream key ui and site link plan 2026-03-16 13:32:56 +08:00
ciat-777 1a2268cedb fix: update documentation to clarify default admin token for desktop installer on first launch 2026-03-15 23:08:49 +08:00
ciat-777 6ca08c1052 fix: update desktop server configuration for consistent port handling and access 2026-03-15 23:08:49 +08:00
ciat-777 7bd48a3c6f fix: improve tester timeouts and telegram proxy config 2026-03-14 16:18:43 +08:00
cita c640b36c96 feat: add deployment documentation and disable automatic PORT value generation in render.yaml 2026-03-11 13:37:31 +08:00
cita 742581efaa feat: Add Render deployment configuration and documentation, including a deploy button in README. 2026-03-11 13:21:19 +08:00
cita 15ea4db4d9 Refactor code structure for improved readability and maintainability 2026-03-10 16:38:21 +08:00
cita 8a3ab0f625 docs: add model refresh health design 2026-03-10 15:28:57 +08:00
cita cd031b732f feat: enhance response serialization for compact mode
- Added support for preserving native response.compaction payloads when compact serialization is requested in `serializeResponsesFinalPayload`.
- Implemented serialization of compact mode as `response.compaction` instead of an ordinary response object.
- Introduced a new type `ResponsesFinalSerializationMode` to manage serialization modes.
- Refactored `serializeResponsesFinalPayload` to handle different serialization modes and usage payloads.
- Added tests to ensure correct behavior for compact serialization and preservation of upstream payloads.
- Updated favicon assets and documentation configuration for VitePress.
2026-03-10 01:28:34 +08:00
cita 0f8176cd04 feat: Implement compatibility strategies for responses and chat endpoints
- Added `routeCompatibility.ts` to handle response compatibility for different endpoints.
- Introduced `chatEndpointStrategy.ts` to manage chat endpoint recovery and downgrading logic.
- Created tests for chat formats and input file handling in `chatFormatsCore.test.ts` and `inputFile.test.ts`.
- Developed `endpointCompatibility.ts` to define compatibility checks and header building for various endpoints.
- Implemented protocol lifecycle management in `protocolLifecycle.ts` and corresponding tests in `protocolModel.test.ts`.
- Enhanced tooltip functionality with a new `TooltipLayer` component and associated tests.
- Refactored existing components to improve tooltip handling and ensure proper rendering in the application.
2026-03-09 22:48:10 +08:00
cita 15d4b207cc feat: rewrite user journey documentation and enhance input file handling in responses 2026-03-09 18:25:09 +08:00
cita 136a038538 feat(tests): enhance modelTesterSession tests and add proxy logs tests
- Updated modelTesterSession tests to serialize assistant history as output_text and removed mime_type from input_file.
- Introduced new tests for stats proxy logs routes, covering paginated log retrieval and detailed log views with parsed billing details.
- Added server-driven tests for ProxyLogs component to validate API interactions and UI rendering based on server data.
2026-03-09 13:48:39 +08:00
cita 7bd3114ea0 feat: implement proxy input file resolution and storage
- Added `inputFiles.ts` for handling input file resolution, including validation and normalization of file types.
- Introduced `proxyFileStore.ts` for managing file storage, retrieval, and deletion with owner-based isolation.
- Created tests for proxy file storage functionality in `proxyFileStore.test.ts`.
- Developed `proxyInputFileResolver.ts` to resolve input files in OpenAI and response formats.
- Added utility functions for handling reasoning signatures in `reasoningTransport.ts` and corresponding tests.
- Enhanced shared input file transformers in `inputFile.ts` for better file handling and type inference.
2026-03-08 22:10:31 +08:00
cita 55b1ae564e feat: update error messages in NewApiAdapter tests to use correct Chinese translations
feat: enhance proxy usage parser to include cache read and creation tokens

feat: add billing details to ProxyLog interface and implement related formatting functions

fix: correct mojibake issues in source files and add regression test for mojibake detection

chore: add SQL migration for billing details in proxy_logs table

test: improve site speed button tests to ensure proper state updates without DOM lookups
2026-03-06 17:10:01 +08:00
cita 2a810facb8 feat: implement macOS notarization and ad-hoc signing in afterSign script
feat: add run-server script to manage server execution and compatibility checks

feat: create main application logic for desktop with window management, server handling, and auto-updater

test: add unit tests for desktop runtime helpers

feat: implement desktop server environment configuration and health check

test: add tests for server configuration and desktop routes

feat: add native module guard for better-sqlite3 compatibility

test: add tests for native module guard functionality

test: add comprehensive tests for account verification feedback handling

feat: implement account verification feedback helpers

chore: add TypeScript configuration for desktop builds
2026-03-06 16:24:41 +08:00
cita e281e45e84 feat: add comprehensive tests for token candidates and proxy log path metadata
- Implemented tests for the `/api/models/token-candidates` endpoint to verify model availability and token coverage scenarios.
- Added tests for `composeProxyLogMessage` to ensure proper formatting of log messages with downstream and upstream metadata.
- Created utility functions for parsing proxy log path metadata and handling missing token hints.
- Developed tests for the `Sites` and `TokenRoutes` components to validate UI behavior and interactions, including scrolling and group expansion.
- Introduced a custom hook `useAnimatedVisibility` for managing visibility animations in components.
- Enhanced the documentation link for site resources.
2026-03-04 13:46:31 +08:00
cita 9ff138f0b5 feat: 添加 Telegram 通知支持,更新配置和文档 2026-03-03 17:25:27 +08:00
ciat-777 cf6b2285fb feat: 更新文档,添加项目架构和界面预览部分 2026-03-03 15:13:52 +08:00
ciat-777 eff6f22f6d Add unit tests for backupService to validate import/export functionality 2026-03-03 14:50:59 +08:00
ciat-777 515d083b2c feat: 添加 Zeabur 一键部署指南和相关变量说明 2026-03-02 21:08:07 +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
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
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 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 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 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 63481caa8b Refactor code structure for improved readability and maintainability 2026-02-28 17:30:34 +08:00
cita 2ecc23730d chore: initialize clean metapi repository 2026-02-28 00:36:28 +08:00