mirror of https://github.com/buster-so/buster.git
update some biome rules
This commit is contained in:
parent
1bf8418ab8
commit
cf1b9b60ae
|
@ -3,5 +3,17 @@
|
|||
"extends": ["../../biome.json"],
|
||||
"files": {
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"include": ["**/*.ts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"suspicious": {
|
||||
"noConsoleLog": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -18,35 +18,35 @@ export async function executeWithPermissionCheck<T>(
|
|||
executeFn: () => Promise<T>
|
||||
): Promise<ExecuteWithPermissionResult<T>> {
|
||||
const userId = runtimeContext.get('userId');
|
||||
|
||||
|
||||
if (!userId) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'User authentication required for SQL execution'
|
||||
error: 'User authentication required for SQL execution',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Validate permissions
|
||||
const permissionResult = await validateSqlPermissions(sql, userId);
|
||||
|
||||
|
||||
if (!permissionResult.isAuthorized) {
|
||||
return {
|
||||
success: false,
|
||||
error: createPermissionErrorMessage(permissionResult.unauthorizedTables)
|
||||
error: createPermissionErrorMessage(permissionResult.unauthorizedTables),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Execute if authorized
|
||||
try {
|
||||
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',
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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!');
|
||||
});
|
||||
|
|
|
@ -210,7 +210,6 @@ export async function updateChat(
|
|||
),
|
||||
};
|
||||
|
||||
|
||||
await db
|
||||
.update(chats)
|
||||
.set(updateData)
|
||||
|
|
Loading…
Reference in New Issue