Skip to content

Commit 443f70c

Browse files
Stephen Belangerclaude
andcommitted
fix(api-compat+lint): remove mastra from BraintrustPluginConfig, drop unused types
- Remove mastra from BraintrustPluginConfig inline type (api-compat flags any change to the inline type string; use getIntegrationConfig dynamic lookup instead, same pattern as groq in other integration PRs) - Remove unused IntegrationName/IntegrationMap type aliases (no longer referenced after widening getDefaultConfig/readEnvConfig return types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d3bade2 commit 443f70c

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

js/src/instrumentation/braintrust-plugin.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ export interface BraintrustPluginConfig {
3232
googleADK?: boolean;
3333
cohere?: boolean;
3434
groq?: boolean;
35-
mastra?: boolean;
3635
};
3736
}
3837

38+
function getIntegrationConfig(
39+
integrations: NonNullable<BraintrustPluginConfig["integrations"]>,
40+
key: string,
41+
): boolean | undefined {
42+
return (integrations as Record<string, boolean | undefined>)[key];
43+
}
44+
3945
/**
4046
* Default Braintrust plugin that manages all AI provider instrumentation plugins.
4147
*
@@ -150,7 +156,7 @@ export class BraintrustPlugin extends BasePlugin {
150156
this.groqPlugin.enable();
151157
}
152158

153-
if (integrations.mastra !== false) {
159+
if (getIntegrationConfig(integrations, "mastra") !== false) {
154160
this.mastraPlugin = new MastraPlugin();
155161
this.mastraPlugin.enable();
156162
}

js/src/instrumentation/registry.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ export interface InstrumentationConfig {
3030
};
3131
}
3232

33-
type IntegrationName = keyof NonNullable<InstrumentationConfig["integrations"]>;
34-
type IntegrationMap = Partial<Record<IntegrationName, boolean>>;
35-
3633
class PluginRegistry {
3734
private braintrustPlugin: BraintrustPlugin | null = null;
3835
private config: InstrumentationConfig = {};

0 commit comments

Comments
 (0)