Skip to content

add Nim SDK#29

Open
jasagiri wants to merge 4 commits intoag-ui-protocol:mainfrom
jasagiri:main
Open

add Nim SDK#29
jasagiri wants to merge 4 commits intoag-ui-protocol:mainfrom
jasagiri:main

Conversation

@jasagiri
Copy link

add Nim SDK

@NathanTarbert
Copy link
Contributor

Hey @jasagiri, thanks for the contribution.
Someone from the team will review your PR soon.

@tylerslaton tylerslaton moved this to In review in Road Map Jul 10, 2025
@tylerslaton tylerslaton added the Roadmap This feature or functionality should be added to the roadmap. label Jul 11, 2025
@NathanTarbert
Copy link
Contributor

Hey @jasagiri, would you be up for maintaining this if it's merged?

@jasagiri
Copy link
Author

I've never collaborated with VSC before, so I'm still feeling my way around, but I can do it.

Copy link
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

Hi @jasagiri! This looks great. Left a small comment about the documentation. Outside of that, a few asks.

  1. Since this is older, can you look through the existing protocol spec and make sure this is fully compatible?
  2. Can you run the tests in CI? We'd happily accept a contribution for that.
  3. How would we go about packaging this for Nim's consumption?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please add documentation to the docs folder and get rid of this? We don't necessarily want to keep these files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please remove this? Also in the root would you mind adding a gitignore for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here, can we remove this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets make sure to remove all of these please!

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these AI generated files also go in. Can we remove them? CLAUDE.md is good to keep but let's remove the progress ones.

maxkorp pushed a commit that referenced this pull request Sep 16, 2025
@maxkorp maxkorp added the SDK label Oct 13, 2025
@jpr5 jpr5 self-assigned this Mar 4, 2026
@jpr5
Copy link
Contributor

jpr5 commented Mar 4, 2026

Hello @jasagiri, it's unclear to us where you stand on this incomplete work. Are you interested in taking it over the finish line? Especially with Agents now, maybe it's easier for you? Or is it superseded by something else?

Please let us know in the next 2 weeks, otherwise we will close this as stale.

Thanks for the time & effort this far! 🙏

@jasagiri jasagiri requested a review from a team as a code owner March 5, 2026 00:58
@vercel
Copy link

vercel bot commented Mar 5, 2026

Someone is attempting to deploy a commit to the CopilotKit Team on Vercel.

A member of the Team first needs to authorize it.

@jasagiri
Copy link
Author

jasagiri commented Mar 5, 2026

I sincerely apologize for the delay in responding to the feedback. I am aware that I sometimes have difficulties with communication, so I would greatly appreciate your patience and understanding as we work through this.

I have addressed the requested changes and synchronized the Nim SDK with the latest protocol specification:

  • SDK Relocation: Moved the Nim SDK to sdks/nim to align with the repository's standard project structure.
  • Cleanup: Removed all .DS_Store files and added a proper .gitignore for the Nim SDK.
  • Documentation: Moved the CHANGELOG.md to docs/sdk/nim/ and removed AI-generated temporary progress files.
  • CI Integration: Added a GitHub Actions workflow (unit-nim-sdk.yml) to automate testing for the Nim SDK.
  • Protocol Compatibility: Updated the SDK (types, events, and validation logic) to match the latest protocol version, including support for Thinking, Reasoning, and Activity events.
  • Verification: Verified that the entire Nim test suite passes successfully.

Thank you for your review and support.

@jpr5
Copy link
Contributor

jpr5 commented Mar 5, 2026

@jasagiri Thank you so much for coming back to this and for the continued effort — we really appreciate you taking the time to work on a Nim SDK for the project. 🙏

I took a close look at the current state of the PR and wanted to share some notes to help get this across the finish line. You've clearly put a lot of work in, and the core is solid — the event type enum covers all 34 protocol event types correctly, the test suite is substantive (not just stubs), and the overall architecture looks well thought out.

There are a few things that would need to be addressed before we can merge:

Build artifacts

It looks like sdks/build/tests/ contains compiled macOS binaries and .dSYM debug symbol directories (about 36 files). These appear to have been generated during local testing and accidentally included in the commit. Would you mind removing that entire sdks/build/ directory from the PR? The current sdks/nim/.gitignore wouldn't catch these since they live two levels above — it might be worth adding sdks/build/ to the root .gitignore as well.

AI-generated working files

A few files that look like internal working notes are still present in the tree:

  • sdks/nim/TODO.md
  • sdks/nim/docs/PROGRESS.md
  • sdks/nim/docs/PR.md
  • sdks/nim/CLAUDE.md

I believe these were part of Tyler's earlier feedback as well. No worries if they slipped through — easy to miss when there are a lot of files. docs/proto_implementation.md could potentially stay if it's rewritten as user-facing documentation, but in its current form it reads more like internal notes, so it might be best to remove it too.

Protocol completeness

The event types themselves are all accounted for, which is great. I did notice a few gaps in the event struct fields and message types when comparing against the current Python SDK:

Missing optional fields:

  • RunStartedEventparent_run_id, input
  • RunFinishedEventresult
  • RunAgentInputparent_run_id, forwarded_props
  • ToolCall and several message types — encrypted_value

Missing message types:

  • ActivityMessage and ReasoningMessage are not yet in types.nim (the Python SDK's Message union includes 7 types; the Nim SDK currently has 5)

Since these are all optional fields, the SDK would still function for basic use cases without them — but it would be wonderful to have them included for full protocol coverage. If adding them all at once is too much, it might be worth adding the fields with a TODO comment so future contributors know what's left.

CI workflow

The workflow looks good structurally! Two small suggestions:

  • The current Nim version is set to 1.6.0, which is from 2021. Would it be possible to update to a more recent version (2.x)? This would help ensure long-term compatibility.
  • For security best practices, it's generally recommended to pin GitHub Actions to a full commit SHA rather than a tag like @v1.

Test suite

The tests themselves are well-written and cover real behavior. I did notice that PROGRESS.md mentions a few test suites that may still need attention (proto, observable, legacy). It would be reassuring to confirm that nimble test passes cleanly in the CI workflow before merge.


Again, thank you for your dedication to this contribution — a Nim SDK would be a fantastic addition to the ecosystem. Please don't hesitate to reach out if any of the above is unclear or if there's anything we can help with. We're happy to work through any of these items together.

@jpr5
Copy link
Contributor

jpr5 commented Mar 5, 2026

One more small note on the build artifacts — since those binaries (~15 MB) are already in the commit history, simply deleting them in a new commit would still leave them in the git objects. To keep the repo history clean, it would be best to do an interactive rebase or squash so that the sdks/build/ files never appear in any commit.

If you're not sure how to approach that, here's one way:

# From your branch, interactive rebase against main
git rebase -i main

# In the editor, mark the commits for 'edit' or squash them together,
# then remove the sdks/build/ directory before re-committing:
git rm -r sdks/build/
git commit --amend
git rebase --continue

Alternatively, squashing everything into a single clean commit works great too — whatever feels most comfortable for you. Happy to help walk through it if needed!

jpr5 pushed a commit that referenced this pull request Mar 5, 2026
PR #29 (Nim SDK) accidentally committed ~15 MB of compiled binaries
and .dSYM debug symbols. This adds three layers of defense:

- .gitignore: block common binary extensions and build directories
- CI workflow: check all PRs for binary files, build dirs, and files >500KB
- lefthook pre-push: catch binary artifacts before push (opt-in)
@jpr5 jpr5 mentioned this pull request Mar 5, 2026
3 tasks
- Remove accidentally committed build artifacts and internal docs
- Update .gitignore to prevent future build artifact commits
- Upgrade Nim version to 2.2.8 via mise
- Enhance protocol completeness in types and events
- Pin CI workflow actions and update to Nim 2.2.8
- Fix protocol parity (missing optional fields and message types)
@jasagiri
Copy link
Author

jasagiri commented Mar 5, 2026

Thank you for the review. I have addressed all the feedback and updated the Nim SDK to version 2.2.8.

Changes:

  • Cleanup: Removed sdks/build/ binaries and internal/AI working files (TODO.md, CLAUDE.md, etc.).
  • Git Hygiene: Updated the root .gitignore to exclude sdks/build/ and cleared existing binaries from the history.
  • Nim Upgrade: Upgraded to Nim 2.2.8 via mise and updated the CI workflow accordingly.
  • Protocol Completeness: Enhanced types and events to achieve full parity with the latest protocol spec (added missing optional fields like parent_run_id, and new message types Activity and Reasoning).
  • Documentation: Updated docs/sdk/nim/CHANGELOG.md with these changes.

Verified that all tests pass successfully in the Nim 2.2.8 environment. Thank you for your patience!

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

Labels

Roadmap This feature or functionality should be added to the roadmap. SDK

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants