Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Contributor
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
2832421 to
66f1b95
Compare
…build The headless build entry intentionally inlines @copilotkit/* packages via noExternal. tsdown detects their transitive deps (partial-json, phoenix, @standard-schema/spec) in the bundle and escalates the warning to an error when CI=true, failing the build. Setting inlineOnly: false acknowledges this is intentional. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@copilotkit/a2ui-renderer
@copilotkitnext/angular
copilotkit
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/web-inspector
commit: |
…, merge subscriptions - Keep abort signal listener active after headers arrive so mid-stream abort works correctly (previously disconnected too early, breaking agent cancellation) - Reject fullTextPromise in ReadableStream cancel() to prevent hanging .text()/.json() calls after stream cancellation - Add cleanupAbortListener() call in onAbort to prevent memory leaks - Extract fail() helper and createAbortError() to deduplicate 5 identical error-handling sequences across XHR event handlers - Add StreamingFetchResponse interface to replace `any`-typed response - Remove __DEV__ guard from insecure crypto polyfill warning so it appears in production logs - Merge two useEffect subscriptions (tool execution + error) into one Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…olyfills Add comprehensive test suite for @copilotkit/react-native covering: - streaming-fetch.ts (36 tests): feature detection, request lifecycle, streaming chunks, convenience methods, abort handling, error paths - CopilotKitProvider.tsx (18 tests): initialization, prop sync, context provision, tool execution tracking, error forwarding, shape validation - polyfills.ts (20 tests): conditional installation, preservation of existing globals, crypto warning, streaming-fetch integration Also adds test infrastructure (vitest.config.mjs, setup.ts, devDependencies) and fixes an unhandled rejection bug in streaming-fetch where fullTextPromise could reject without a listener. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AlemTuzlak
reviewed
Apr 14, 2026
AlemTuzlak
reviewed
Apr 14, 2026
AlemTuzlak
reviewed
Apr 14, 2026
AlemTuzlak
reviewed
Apr 14, 2026
…, clean up headless exports Move LicenseContext and useLicenseContext from CopilotKitProvider.tsx into context.ts so both web and RN providers share the same context singleton. Use import type for LicenseContextValue to avoid pulling @copilotkit/shared (and its Node-only jose dep) into the RN bundle at runtime. Also remove unused CopilotKitContext/useCopilotKit re-exports from headless.ts — the externalize-context tsdown plugin already handles these via relative imports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…enseContext Address PR feedback from @AlemTuzlak: - Split monolithic polyfills.ts into individual imports (streams, encoding, crypto, dom, location) so users control what gets polyfilled - Remove auto-polyfill from index.ts — users explicitly import what they need - Add sideEffects array to package.json for bundler correctness - Wire LicenseContext.Provider into the RN CopilotKitProvider - Add new polyfill entry points to tsdown config and package.json exports - Use globalThis consistently (no more declare const global conflicts) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…alias, simplify provider
- Use `const g = globalThis as Record<string, unknown>` in polyfill files
instead of repeating `(globalThis as any)` on every assignment line
- Add `export {}` to polyfill files without imports so TS treats them as
modules with isolated scope (prevents top-level variable collisions)
- Document the pattern rationale in types.d.ts for future reference
- Move shape validation from contextValue useMemo to one-time construction
- Consolidate onAbort handler with centralized fail() function
- Simplify onError event forwarding (pass event directly)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d, eliminate unsafe cast The headless build previously inlined @copilotkit/core via noExternal, creating a duplicate CopilotKitCoreReact class declaration in the .d.ts. Since the class has private members, TypeScript treated the two declarations as nominally distinct, forcing an `as unknown as CopilotKitContextValue` cast in the RN provider with runtime shape validation. @copilotkit/core has zero Node-only dependencies — the inlining was unnecessary. By keeping it external: - context.ts now value-exports CopilotKitCoreReact (was type-only import) - headless.ts re-exports from ./context (externalized to package path) - headless .d.ts references context's type → single declaration → no cast - RN provider uses plain typed code, no as-unknown-as, no shape validation - headless bundle is significantly smaller Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CopilotKitContextanduseCopilotKitinto standalonecontext.tsin react-core, enabling cross-platform reuse without web dependencies@copilotkit/react-nativepackage with lightweight provider, polyfills, and streaming fetchuseAgent,useFrontendTool,useHumanInTheLoop, etc.) are re-exported directly from react-core — no reimplementationMotivation
CopilotKit's React hooks are platform-agnostic, but the barrel import in
@copilotkit/react-corepulls in web-only dependencies (Radix UI, Lit, A2UI renderer, react-dom, CSS). This makes the package unusable in React Native without extensive Metro shimming.By extracting the React context into a standalone entry point (
@copilotkit/react-core/v2/context), the new@copilotkit/react-nativepackage can provide its own lightweight provider while reusing all existing hooks.What's in
@copilotkit/react-nativeCopilotKitProviderinstallStreamingFetch()response.body.getReader()support@copilotkit/react-native/polyfillsuseAgent,useFrontendTool, etc.Usage
Test plan
nx run react-core:buildpassesnx run @copilotkit/react-native:buildpassesnx run react-core:test— all 952 tests pass🤖 Generated with Claude Code