mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
7df369f955
CR-loop confirmation-round #4 findings: - validator: `resolvesForMode` (renamed from `typesCoversMode`) now applies to EVERY condition, not just `types`. A partial object under `node`/`default` (active in both modes) no longer silently covers the mode it lacks — resolution falls through to the sibling, catching the untyped-JS #3324 shape there. This completes the per-mode model. - helper: `withTypesConditions` throws on a non-object `exports` (bare string / array) instead of iterating it into a corrupt map; `typedTarget` now warns loudly when a JS target has no adjacent declaration (was silent, contradicting the helper's own fail-loud contract); idempotency skips only the helper's own `{ types: <string>, ... }` output, so a hand-authored types-first PARTIAL object is normalized (its untyped sibling gets a `types`). UMD / `.d.mts` docs corrected; `ctx.pkg: unknown` documented as intentional (weak-type constraint). - tests: node/default partial fall-through regression; types-first-partial normalization; a helper->validator round-trip; a console.warn assertion for the missing-declaration path; split the untouched-target test into silent (non-JS) and warning (JS) cases. - react-native: dropped a pre-existing duplicate `@ag-ui/client` external. Call sites: resolvesForMode (internal, walk + recursion; grep-confirmed no `typesCoversMode` refs); withTypesConditions signature unchanged, and the new throw/warn never fire on tsdown's real input (object map, packageJsonPath present, dts:true). 36 tests pass; validator typechecks; validate:exports exits 0; native-loader builds of react-core + react-native unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>