mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-20 23:13:07 +00:00
fix: Remove unused vars and improve type safety. Improve task recovery
This commit is contained in:
@@ -12,11 +12,18 @@ export interface PermissionCheckResult {
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/** Minimal shape of a Cursor tool call used for permission checking */
|
||||
interface CursorToolCall {
|
||||
shellToolCall?: { args?: { command: string } };
|
||||
readToolCall?: { args?: { path: string } };
|
||||
writeToolCall?: { args?: { path: string } };
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a tool call is allowed based on permissions
|
||||
*/
|
||||
export function checkToolCallPermission(
|
||||
toolCall: any,
|
||||
toolCall: CursorToolCall,
|
||||
permissions: CursorCliConfigFile | null
|
||||
): PermissionCheckResult {
|
||||
if (!permissions || !permissions.permissions) {
|
||||
@@ -152,7 +159,11 @@ function matchesRule(toolName: string, rule: string): boolean {
|
||||
/**
|
||||
* Log permission violations
|
||||
*/
|
||||
export function logPermissionViolation(toolCall: any, reason: string, sessionId?: string): void {
|
||||
export function logPermissionViolation(
|
||||
toolCall: CursorToolCall,
|
||||
reason: string,
|
||||
sessionId?: string
|
||||
): void {
|
||||
const sessionIdStr = sessionId ? ` [${sessionId}]` : '';
|
||||
|
||||
if (toolCall.shellToolCall?.args?.command) {
|
||||
|
||||
Reference in New Issue
Block a user