Add LICENSE, AGENTS.md, and richer package metadata#1
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 059e043594
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Free-tier endpoints work with no key. Paid endpoints take a key: | ||
|
|
||
| ```ts | ||
| const client = new UapiClient("https://uapis.cn", { apiKey: "sk_…" }); |
There was a problem hiding this comment.
Document the supported token constructor
When agents follow this auth example, the SDK silently ignores the key because UapiClientOptions only supports disableCache and the constructor only treats a string second argument as the bearer token (src/index.ts:1497-1501). Calls to paid endpoints therefore go out unauthenticated; the existing README uses new UapiClient(baseURL, 'YOUR_API_KEY'), so this example should use the string token form or add real apiKey support.
Useful? React with 👍 / 👎.
| Methods throw a typed `UapiApiError` on non-2xx responses. The error | ||
| carries `code`, `error`, and `requestId` fields. Surface `error` verbatim. | ||
|
|
||
| ## Rate limits | ||
|
|
||
| Headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, | ||
| `Retry-After` are exposed via `error.response.headers` (and on success | ||
| responses via the optional `withResponse` overload). Honor them. |
There was a problem hiding this comment.
Avoid referencing nonexistent error APIs
Code written from this guidance will not compile or will fail at runtime: the package exports UapiError classes with metadata on error.meta / client.lastResponseMeta, but there is no UapiApiError, no error.response field, and no withResponse overload anywhere in src. Please align this section with the actual exported error surface before agents rely on it.
Useful? React with 👍 / 👎.
Summary
Land explicit license terms, an agent-facing playbook, and discovery-friendly package metadata.
uapis.cnhomepage, search-friendly keywords / classifiers / tagsNo code changes; build/publish pipeline untouched.