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"], "extends": ["../../biome.json"],
"files": { "files": {
"include": ["src/**/*"] "include": ["src/**/*"]
},
"overrides": [
{
"include": ["**/*.ts"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
} }
} }
}
}
]
}

View File

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

View File

@ -171,7 +171,6 @@ export async function cleanupOldWorkflowManagers(maxAge = 3600000): Promise<void
} }
for (const workflowId of toCleanup) { for (const workflowId of toCleanup) {
// biome-ignore lint/suspicious/noConsoleLog: Dallin had this here
console.log(`[WorkflowDataSourceManager] Cleaning up old workflow manager: ${workflowId}`); console.log(`[WorkflowDataSourceManager] Cleaning up old workflow manager: ${workflowId}`);
await cleanupWorkflowDataSources(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 { RuntimeContext } from '@mastra/core/runtime-context';
import type { AnalystRuntimeContext } from '../../workflows/analyst-workflow'; 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; success: boolean;
data?: T; data?: T;
error?: string; error?: string;
@ -22,7 +22,7 @@ export async function executeWithPermissionCheck<T>(
if (!userId) { if (!userId) {
return { return {
success: false, 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) { if (!permissionResult.isAuthorized) {
return { return {
success: false, success: false,
error: createPermissionErrorMessage(permissionResult.unauthorizedTables) error: createPermissionErrorMessage(permissionResult.unauthorizedTables),
}; };
} }
@ -41,12 +41,12 @@ export async function executeWithPermissionCheck<T>(
const result = await executeFn(); const result = await executeFn();
return { return {
success: true, success: true,
data: result data: result,
}; };
} catch (error) { } catch (error) {
return { return {
success: false, 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 () => { it('PROOF: onError callback receives tool errors and returns healing response', async () => {
// Create a mock agent that will capture the onError callback // Create a mock agent that will capture the onError callback
let capturedOnError: ((error: unknown) => unknown) | undefined; let capturedOnError: ((error: unknown) => unknown) | undefined;
let simulatedToolError: NoSuchToolError | undefined; let simulatedToolError: NoSuchToolError | undefined = undefined;
const mockAgent: MastraAgent = { const mockAgent: MastraAgent = {
name: 'test-agent', name: 'test-agent',

View File

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

View File

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