A request from X (@vfrpn). Read from the Comate VS Code extension BaiduComate.comate 4.14.1 (its bundled Comate CLI, @comate/zulu 1.7.16): unpacked into its own folder and read, never run. - Sign-in: the CLI's own flow. A fresh clientId opens comate.baidu.com/zh/login?track=COMATE_CLI, /api/client/generate/token is polled every 2s for 3 minutes, and /api/client/key turns the token into the account's license, the credential. A license copied from comate.baidu.com/user can be pasted instead (checked at /api/key/valid/<license>). - Models: the account's list from POST /api/v2/api/models/available, as the CLI reads it; "auto" alone when it can't be read. - Chat: one Comate agent turn per request (conversation, task, execute SSE) as a custom agent in the client's own shape (isProjectAgent, agentPrompt, no server tools). ANSWER deltas and reasoning go out as content and reasoning_content, TOKEN_USAGE as usage. code 401 is a 401, code 429 / QUOTA_EXCEED / DOWNGRADE a 429. Tools ride as JSON text, as in catpaw; images are refused with 400. - Usage: Comate has no quota a license can read outside Baidu's network, so the card says only whether the license holds. Run (mica, mote was at load 41; sandbox HOME): bun test packages/comate, 22 pass; bun scripts/check.mjs, exit 0 (registry.json and comate ok). Broken by hand: dropping the login-name header, the code 401 mapping and the trim of the answer's leading newlines turned 5 tests red; put back, 22 pass. Not tried: anything against a real Comate account (none here). Unknown until one runs: whether the server takes agentPrompt for a top-level custom agent with no tools of its own, whether conversation and task need more fields, whether thinkingEnabled / effort / contextWindow are accepted, the real model ids and the limit frames' shape. The README says so.
6 lines
298 B
JavaScript
6 lines
298 B
JavaScript
// The package's OpenCode 1.x plugins, as OpenCode 1.x and magpie's host
|
|
// load them: its plugin functions and nothing else (1.x refuses a
|
|
// package whose exports include anything but plugins). OpenCode 2.x
|
|
// loads opencode2.mjs, which runs these.
|
|
export { ComateAuthPlugin } from "./index.mjs"
|