-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add User-Agent tracking for analytics #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3a62949
feat: add User-Agent tracking for analytics
richhankins ac790cd
chore: require auggie-sdk ^0.1.15 with clientUserAgent support
richhankins e619a8e
feat: capture MCP client info in User-Agent
richhankins 5f3b675
refactor: Update User-Agent format to match auggie CLI style
richhankins 7065f6d
refactor: Use augment.ctxc prefix for consistent User-Agent format
richhankins cf1b2e0
refactor: Simplify User-Agent format to product-based
richhankins 827b610
fix: make getVersion() resilient to missing package.json
richhankins bf4570b
refactor: use build-time version injection instead of runtime package…
richhankins 96560ad
fix: restore @augmentcode/auggie-sdk dependency (^0.1.15)
richhankins cf51f3b
fix: ensure version.ts is generated before all entry points
richhankins eed9a67
fix: simplify version loading with resilient fallback
richhankins e806b63
refactor: simplify version loading to match auggie-sdk-typescript
richhankins 6690009
fix: use SDK's oninitialized callback for proper protocol negotiation
richhankins 3c0dca8
fix: add @augmentcode/auggie-sdk dependency (^0.1.15)
richhankins 4ebef83
fix: regenerate package-lock.json with @augmentcode/auggie-sdk@0.1.15
richhankins f537701
fix: regenerate package-lock.json with all dependencies
richhankins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Tests for utility functions | ||
| */ | ||
|
|
||
| import { describe, it, expect } from "vitest"; | ||
| import { buildClientUserAgent } from "./utils.js"; | ||
|
|
||
| describe("buildClientUserAgent", () => { | ||
| it("should build basic user agent for cli-search", () => { | ||
| const ua = buildClientUserAgent("cli-search"); | ||
| expect(ua).toMatch(/^context-connectors\/\d+\.\d+\.\d+ via:cli-search$/); | ||
| }); | ||
|
|
||
| it("should build basic user agent for cli-index", () => { | ||
| const ua = buildClientUserAgent("cli-index"); | ||
| expect(ua).toMatch(/^context-connectors\/\d+\.\d+\.\d+ via:cli-index$/); | ||
| }); | ||
|
|
||
| it("should build basic user agent for mcp", () => { | ||
| const ua = buildClientUserAgent("mcp"); | ||
| expect(ua).toMatch(/^context-connectors\/\d+\.\d+\.\d+ via:mcp$/); | ||
| }); | ||
|
|
||
| it("should include MCP client info when provided", () => { | ||
| const ua = buildClientUserAgent("mcp", { name: "claude-desktop", version: "1.2.0" }); | ||
| expect(ua).toMatch(/^context-connectors\/\d+\.\d+\.\d+ via:mcp client:claude-desktop\/1\.2\.0$/); | ||
| }); | ||
|
|
||
| it("should handle all interface types", () => { | ||
| const interfaces = [ | ||
| "cli-search", | ||
| "sdk-search", | ||
| "cli-index", | ||
| "sdk-index", | ||
| "mcp", | ||
| "cli-agent", | ||
| "sdk-agent-provider", | ||
| ] as const; | ||
|
|
||
| for (const iface of interfaces) { | ||
| const ua = buildClientUserAgent(iface); | ||
| expect(ua).toContain(`via:${iface}`); | ||
| expect(ua).toContain("context-connectors/"); | ||
| } | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assertions only accept strict
x.y.z; ifpackage.jsonever uses pre-release/build metadata (e.g.0.1.3-beta.1) the tests will fail even thoughbuildClientUserAgent()is behaving correctly.🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.