Skip to content

1.0.5 - #49

Merged
Starllordz merged 3 commits into
mainfrom
feat/headers
Jun 10, 2026
Merged

1.0.5#49
Starllordz merged 3 commits into
mainfrom
feat/headers

Conversation

@Starllordz

@Starllordz Starllordz commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Changed

  • Send X-Lara-Client: MCP and X-Lara-Client-Version: <package version> headers on all Lara SDK calls (translate, glossaries, memories, languages, imports, etc.) by setting them once on the SDK client after construction.
  • Report the real package version as the MCP server version instead of the hardcoded 0.0.15.
  • /server-info route now reads the version from the shared module.
  • Bump version to 1.0.5.

## Changed
- Set X-Lara-Client and X-Lara-Client-Version on the Lara client so the headers are sent on every SDK request
- Report the real package version (instead of hardcoded 0.0.15) as the MCP server version
- server-info route now reads the version from the shared module

## New
- Add src/version.ts as the single source for the package version

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 centralizes package version resolution and uses it to (1) report the MCP server version and (2) tag all Lara SDK calls with consistent X-Lara-Client* headers.

Changes:

  • Add a shared PACKAGE_VERSION constant (loaded once from package.json with fallback) and use it across the codebase.
  • Set X-Lara-Client: MCP and X-Lara-Client-Version: <version> on the Lara SDK client once during MCP server construction.
  • Update /server-info to return the shared version and bump the package to 1.0.5, adding unit tests for both behaviors.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/version.ts Introduces a shared PACKAGE_VERSION constant loaded from package.json.
src/rest/routes/server-info.ts Uses PACKAGE_VERSION instead of reading/parsing package.json in-route.
src/mcp/server.ts Sets Lara SDK extra headers once and reports MCP server version via PACKAGE_VERSION.
src/tests/version.test.ts Verifies PACKAGE_VERSION matches package.json.
src/tests/utils/mocks.ts Extends translator mock to include client.setExtraHeader.
src/tests/server/mcp.server.test.ts Tests that MCP server construction wires the Lara client headers correctly.
package.json Bumps package version to 1.0.5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/version.ts Outdated
Comment thread src/mcp/server.ts Outdated
## Changed
- Validate the parsed package.json version is a non-empty string, falling back to "unknown" on malformed input
- Guard the Lara client setExtraHeader call so an unexpected SDK shape logs a warning instead of crashing the server
@Starllordz
Starllordz merged commit aaf0f36 into main Jun 10, 2026
2 checks passed
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