update some biome rules

This commit is contained in:
Nate Kelley 2025-07-07 09:46:24 -06:00
parent 1bf8418ab8
commit cf1b9b60ae
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
7 changed files with 31 additions and 19 deletions

View File

@ -3,5 +3,17 @@
"extends": ["../../biome.json"],
"files": {
"include": ["src/**/*"]
}
},
"overrides": [
{
"include": ["**/*.ts"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
}
}
}
}
]
}

View File

@ -19,7 +19,7 @@
"typecheck": "tsc --noEmit",
"dev": "tsc --watch",
"dev:mastra": "mastra dev --dir src",
"lintx": "biome check",
"lint": "biome check",
"test": "vitest run",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage",

View File

@ -171,7 +171,6 @@ export async function cleanupOldWorkflowManagers(maxAge = 3600000): Promise<void
}
for (const workflowId of toCleanup) {
// biome-ignore lint/suspicious/noConsoleLog: Dallin had this here
console.log(`[WorkflowDataSourceManager] Cleaning up old workflow manager: ${workflowId}`);
await cleanupWorkflowDataSources(workflowId);
}

View File

@ -1,8 +1,8 @@
import { validateSqlPermissions, createPermissionErrorMessage } from './permission-validator';
import type { RuntimeContext } from '@mastra/core/runtime-context';
import type { AnalystRuntimeContext } from '../../workflows/analyst-workflow';
import { createPermissionErrorMessage, validateSqlPermissions } from './permission-validator';
export interface ExecuteWithPermissionResult<T = any> {
export interface ExecuteWithPermissionResult<T = unknown> {
success: boolean;
data?: T;
error?: string;
@ -22,7 +22,7 @@ export async function executeWithPermissionCheck<T>(
if (!userId) {
return {
success: false,
error: 'User authentication required for SQL execution'
error: 'User authentication required for SQL execution',
};
}
@ -32,7 +32,7 @@ export async function executeWithPermissionCheck<T>(
if (!permissionResult.isAuthorized) {
return {
success: false,
error: createPermissionErrorMessage(permissionResult.unauthorizedTables)
error: createPermissionErrorMessage(permissionResult.unauthorizedTables),
};
}
@ -41,12 +41,12 @@ export async function executeWithPermissionCheck<T>(
const result = await executeFn();
return {
success: true,
data: result
data: result,
};
} catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : 'SQL execution failed'
error: error instanceof Error ? error.message : 'SQL execution failed',
};
}
}

View File

@ -11,7 +11,7 @@ describe('Healing Mechanism Unit Test - Definitive Proof', () => {
it('PROOF: onError callback receives tool errors and returns healing response', async () => {
// Create a mock agent that will capture the onError callback
let capturedOnError: ((error: unknown) => unknown) | undefined;
let simulatedToolError: NoSuchToolError | undefined;
let simulatedToolError: NoSuchToolError | undefined = undefined;
const mockAgent: MastraAgent = {
name: 'test-agent',

View File

@ -157,14 +157,16 @@ describe('Healing During Streaming - Real Scenario Simulation', () => {
// Log the full execution flow
console.log('\n🎬 STREAMING EXECUTION FLOW:');
streamEvents.forEach((event) => console.log(` ${event}`));
for (const event of streamEvents) {
console.log(` ${event}`);
}
console.log('\n📊 EXECUTION SUMMARY:');
console.log(` - Healing attempts: ${executionLog.healingAttempts}`);
console.log(` - Chunks processed: ${executionLog.chunksProcessed}`);
console.log(` - Tool calls seen: ${executionLog.toolCallsSeen.join(', ')}`);
console.log(` - Error healed: YES`);
console.log(` - Stream completed: YES`);
console.log(' - Error healed: YES');
console.log(' - Stream completed: YES');
console.log('\n✅ STREAMING HEALING SIMULATION SUCCESSFUL!');
});

View File

@ -210,7 +210,6 @@ export async function updateChat(
),
};
await db
.update(chats)
.set(updateData)