mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
e869088121
* ✨ feat(sdk): add @lobehub/sdk generated from the OpenAPI spec Resource-style TypeScript SDK (lobehub.agents.list()) generated from packages/openapi/openapi.yml via @hey-api/openapi-ts: instantiable LobeHub root class, 14 resource groups, inlined HTTP runtime (zero npm deps), and a byte-level drift check (bun scripts/generate-sdk.ts --check) that runs in local tests and the release workflow only — regular PR CI is not gated. Publishing is automated by release-sdk.yml on canary pushes touching packages/sdk/** (plus manual dispatch), versioned 1.0.<UTC timestamp>. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 🐛 fix(sdk): rename misleading messages.deleteAll to deleteMany DELETE /api/v1/messages requires a non-empty messageIds array — it deletes a selected batch, not all messages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 🔨 chore(sdk): make .mjs output deterministic and document SSE streaming fixedExtension: true pins tsdown output to .mjs/.d.mts regardless of package.json type, matching the exports the release workflow writes. README documents parseAs: 'stream' for responses.create with stream: true. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 🐛 fix(sdk): preserve per-call HeadersInit values on write methods The generated write methods spread options.headers into an object literal, which drops Headers instances and corrupts tuple arrays. generate-sdk.ts now rewrites the spread to the client's mergeHeaders (normalizing tuple arrays via new Headers) in both generate and --check modes, with a regression test covering both HeadersInit shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 🐛 fix(sdk): normalize HeadersInit at the root and keep form-data Content-Type deletion Follow-ups to the header-spread rewrite: (1) mergeHeaders itself now normalizes tuple-array HeadersInit (client defaults and read-method calls previously degraded to numeric keys); (2) write methods merge into a plain object instead of a Headers instance, so the 'Content-Type': null sentinel on form-data methods survives to the final client merge and can delete a client-default Content-Type. Regression tests cover both paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * 🐛 fix(sdk): satisfy repo-wide type-check for generator script and upload test Resolve the defineConfig thenable before spreading/passing to createClient, and drop fields not present in the files.create body schema from the form-data regression test. The package tsconfig only covers src/**, so these scripts/test typings were first caught by the repo-wide type-check in CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>