Skip to content

fix(types): expose core SDK types for external developer integration - #181

Merged
murdore merged 1 commit into
releasefrom
fix/expose-required-types
Sep 21, 2025
Merged

murdore merged 1 commit into
releasefrom
fix/expose-required-types

Conversation

@murdore

@murdore murdore commented Sep 21, 2025 •

Copy link
Copy Markdown
Contributor
  • Add comprehensive type exports via @juspay/neurolink/types
  • Create src/lib/types/sdkTypes.ts with 110+ essential types
  • Update package.json exports to include ./types path
  • Enable external developers to import StreamResult, ToolExecutionEvent, NeuroLinkConfig, ConversationMemoryConfig and other core types
  • Maintain existing type names and avoid breaking changes
  • Support maximum TypeScript integration across NeuroLink ecosystem

Pull Request

Description

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧹 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔧 Build/CI configuration change

Related Issues

  • Fixes #
  • Related to #

Changes Made

AI Provider Impact

  • OpenAI
  • Anthropic
  • Google AI/Vertex
  • AWS Bedrock
  • Azure OpenAI
  • Hugging Face
  • Ollama
  • Mistral
  • All providers
  • No provider-specific changes

Component Impact

  • CLI
  • SDK
  • MCP Integration
  • Streaming
  • Tool Calling
  • Configuration
  • Documentation
  • Tests

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated
  • Manual testing performed
  • All existing tests pass

Test Environment

  • OS:
  • Node.js version:
  • Package manager:

Performance Impact

  • No performance impact
  • Performance improvement
  • Minor performance impact (acceptable)
  • Significant performance impact (needs discussion)

Breaking Changes

Screenshots/Demo

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Summary by CodeRabbit

  • New Features

    • Added a dedicated types export, allowing consumers to import SDK types without pulling the main runtime.
    • Expanded and centralized public type surface for providers and core SDK, offering a single entry point for type imports.
  • Refactor

    • Internal cleanup and formatting improvements with no behavior changes.
  • Documentation

    • Updated guidance to reflect the new centralized type imports and consolidated provider typings.
  • Tests

    • Minor test setup adjustment with no impact on functionality.

- Add comprehensive type exports via @juspay/neurolink/types
- Create src/lib/types/sdkTypes.ts with 110+ essential types
- Update package.json exports to include ./types path
- Enable external developers to import StreamResult, ToolExecutionEvent,
  NeuroLinkConfig, ConversationMemoryConfig and other core types
- Maintain existing type names and avoid breaking changes
- Support maximum TypeScript integration across NeuroLink ecosystem
@murdore
murdore requested a review from Copilot September 21, 2025 10:52
@coderabbitai

coderabbitai Bot commented Sep 21, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new public ./types export in package.json and introduces src/lib/types/sdkTypes.ts as a consolidated type re-export surface. Updates src/lib/types/index.ts to re-export from sdkTypes. Minor formatting change in HITL manager. Small test setup tweak (let→const). Adds a refactor plan doc for provider types centralization.

Changes

Cohort / File(s) Summary of Changes
Packaging: public types subpath
package.json
Adds exports["./types"] with types, import, and default pointing to ./dist/types/sdkTypes.* to expose SDK types as a separate entrypoint.
Types: central aggregation and re-exports
src/lib/types/index.ts, src/lib/types/sdkTypes.ts
Introduces sdkTypes.ts that re-exports public types from multiple modules; updates index.ts to export * from "./sdkTypes.js". No runtime logic added.
HITL formatting
src/lib/hitl/hitlManager.ts
Reflows line breaks around allowArgumentModification defaulting; no behavioral change.
Tests setup minor tweak
test/environment-setup.js
Changes let availableProviders to const while still mutating the array; no functional change.
Docs: providers types refactor plan
todos/refactor/03-providers-module.md
Documents planned centralization of provider-related types, new src/lib/providers/types.ts, and updates to provider imports/metadata types.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as App (Consumer)
  participant Pkg as package.json (exports)
  participant Types as src/lib/types/sdkTypes.ts

  App->>Pkg: import { SomeType } from "package/types"
  Note over Pkg: Resolve "./types" subpath
  Pkg-->>App: points to dist/types/sdkTypes.js/.d.ts
  App->>Types: Load aggregated type exports
  Types-->>App: Re-exported SDK/provider types
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A twitch of ears, a tap-tap type,
I bundled names both lean and ripe.
A fresh subpath, the types now sing,
One hop to find most everything.
With consts that stay and lines that flow—
The meadow’s tidy. Onward we go! 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/expose-required-types

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3d5bb4 and b4f5922.

📒 Files selected for processing (6)
  • package.json (1 hunks)
  • src/lib/hitl/hitlManager.ts (2 hunks)
  • src/lib/types/index.ts (1 hunks)
  • src/lib/types/sdkTypes.ts (1 hunks)
  • test/environment-setup.js (1 hunks)
  • todos/refactor/03-providers-module.md (4 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Single Commit Policy - COMPLIANT

Status: Policy requirements met • 1 commit • Valid format • Ready for merge

📊 View validation details

📝 Commit Details

  • Hash: b4f59226862cc54343587d1b88928611902673a9
  • Message: fix(types): expose core SDK types for external developer integration
  • Author: Sachin Sharma

✅ Validation Results

  • Single commit requirement met
  • No merge commits in branch
  • Semantic commit message format verified
  • Ready for squash merge to release branch

🤖 Automated validation by NeuroLink Single Commit Enforcement

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR exposes core SDK types for external developer integration by creating a comprehensive type export system. The changes enable developers to import essential NeuroLink types like StreamResult, ToolExecutionEvent, NeuroLinkConfig, and other core interfaces through a dedicated types entry point.

  • Creates a new sdkTypes.ts file with 110+ essential type exports organized by priority
  • Adds ./types export path to package.json for external type access
  • Updates type index to include the new SDK types module

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/types/sdkTypes.ts Creates comprehensive type export module with 110+ essential types organized by priority for external developers
src/lib/types/index.ts Adds export for the new SDK types module
package.json Adds ./types export path for external type access
src/lib/hitl/hitlManager.ts Refactors long lines for better readability
test/environment-setup.js Changes variable declaration from let to const
todos/refactor/03-providers-module.md Adds blank lines for better markdown formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants