-
Notifications
You must be signed in to change notification settings - Fork 1
draft: telemetry #87
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
base: main
Are you sure you want to change the base?
draft: telemetry #87
Conversation
note: this is a draft, will do some cleanup and change tests, looking for feedback on the code architecture |
Pull Request Test Coverage Report for Build 14592314930Details
💛 - Coveralls |
const config = { | ||
...mergedUserConfig, | ||
...machineMetadata, |
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.
is there an advantage of having machineMetadata inside the config?
|
||
// Start the server | ||
try { | ||
await main(); |
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.
purely personal preference but I don't see much benefit in this main function as it stands as leads to more back and forth referencing. One advantage of main though is the ability to export it for external use but I'm not sure this should be encouraged anyhow
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.
I think this was me tweaking with getting the client config, I think it's not necessary so let me try to revert
src/session.ts
Outdated
agentClientName?: string; | ||
agentClientVersion?: string; |
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.
agentClientName?: string; | |
agentClientVersion?: string; | |
agentRunner?: { | |
name: string; | |
version: string; | |
}; |
it can also be agentClient, it just becomes confusing with who's the client of the agent, the user or the software
agentClientName?: string; | ||
agentClientVersion?: string; | ||
|
||
constructor() { |
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.
we should probably pass the config into the constructor to make this dependency more explicit
serviceProvider?: NodeDriverServiceProvider; | ||
apiClient?: ApiClient; | ||
apiClient: ApiClient; |
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.
nice, I like that the apiClient is always defined now 🥳
agentClientName?: string; | ||
agentClientVersion?: string; |
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.
agentClientName?: string; | |
agentClientVersion?: string; | |
agentRunner?: { | |
name: string; | |
version: string; | |
} |
(can also be agentClient, that makes sense; I just find the agent's client to possibly be the user?)
|
||
ensureAuthenticated(): asserts this is { apiClient: ApiClient } { | ||
if (!this.apiClient) { | ||
if (!this.apiClient || !this.apiClient.hasCredentials()) { |
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.
if (!this.apiClient || !this.apiClient.hasCredentials()) { | |
if (!this.apiClient.hasCredentials()) { |
if (!config.apiClientId || !config.apiClientSecret) { | ||
throw new Error( | ||
"Not authenticated make sure to configure MCP server with MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET environment variables." | ||
); | ||
} | ||
|
||
// Initialize or reinitialize API client with credentials | ||
this.apiClient = new ApiClient({ |
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.
in what scenario would it end up reinitialized with credentials? does the global config object get updated in the middle of a session? we should probably keep anything that is dynamic in a session as part of session then
No description provided.