| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(mastra): add @corsair-dev/mastra ToolProvider for Mastra (#1491) * feat(mastra): add @corsair-dev/mastra ToolProvider for Mastra * feat(mastra): move to adapters/ and address review - move packages/mastra -> adapters/mastra; wire adapters/* into the workspace, publish-changed, deploy/pr-checks, and turbo filters - resolveTenant: a decodable connectionId is authoritative over the tenant function (authorize and resolve can't diverge) - add getToolSchema for the editor tool-detail view - add revokeConnection + supportsRevoke (via corsair manage.disconnect) - peer @mastra/core >=1.64.0; form-field docstrings; README tool recipes - demo/mastra: minimal Mastra playground app * fix(mastra): harden tenant isolation and close review gaps - resolveTenant: the configured tenant is authoritative. A pinned string is never overridden by a connectionId, and when the caller is known a connectionId naming a different tenant is rejected (no cross-tenant access). A fresh connection under a function resolver throws instead of silently opening OAuth under a fallback tenant (Mastra passes no context to authorize). - Document connectionId as an unsigned, server-minted handle. - Require zod ^4.4.0 so z.unknown() rejects omitted required fields. - CI: build/test the full lane over adapters/* too, not just packages/*. - demo: pin the LLM gateway host; ignore SQLite sidecar files. * fix(mastra): optional @mastra/core peer, run checks in CI, document fresh-auth limit * docs(mastra): document ToolAction<any> constraint from @mastra/core base class * chore: regenerate lockfile to resolve missing ts-jest entry * fix(mastra): narrow corsair config field and invokeOperation types * fix(corsair): make AnyCorsairInstance accept real createCorsair() results AnyCorsairInstance instantiated the client generics with a fake shallow plugin shape, expanding the per-plugin mapped types to a structure no real instance matches — so every createCorsair() result was rejected (TS2322) and callers had to cast. Parameterize with an empty plugin set instead: that is the shape common to all instances, so any concrete client is a structural superset and assigns. Drops the widening casts the mastra checks needed. * fix(corsair): accept multi-tenant wrapper in AnyCorsairInstance The empty-plugin-set fix covered single-tenant and tenant-scoped clients but rejected the multi-tenant wrapper: the wrapper is matched by its plugin-tuple argument, and an empty tuple is not assignable from a real one. Give the wrapper member the open plugin array; the two structurally-matched clients keep the empty set. Verified all three instance shapes assign with no cast. * fix(mastra): require a root instance in config; drop narrating comments Narrow the provider config from AnyCorsairInstance to the manage-bearing root instances (single-tenant client or multi-tenant wrapper) via Extract, so a withTenant() scope — which has no manage — is a compile error, not a runtime throw. Drops the now-unneeded manage cast. Also strip narrating comments flagged in review across the adapter, core type, and demo. * build(mastra): keep check files out of the published dts The declaration build shipped stray *.check.d.ts.map into dist; scope it to src minus *.check.ts so the package publishes only its real modules. | 1 个月前 |