Harden audio transcription arg hydration and add rewrite audit event
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
ToolErrorEvent,
|
||||
ToolDeniedEvent,
|
||||
ToolApprovalEvent,
|
||||
ToolArgsRewrittenEvent,
|
||||
SkillsInstallerExecutionBlockedEvent,
|
||||
SkillsInstallerCommandResultEvent,
|
||||
SkillsScanEvent,
|
||||
@@ -104,6 +105,11 @@ export class AuditLogger {
|
||||
this.write({ level: 'debug', event_type: 'tool.approval', event: event as unknown as Record<string, unknown> });
|
||||
}
|
||||
|
||||
toolArgsRewritten(event: ToolArgsRewrittenEvent): void {
|
||||
if (!this.shouldLog('tools', 'debug')) {return;}
|
||||
this.write({ level: 'debug', event_type: 'tool.args_rewritten', event: event as unknown as Record<string, unknown> });
|
||||
}
|
||||
|
||||
skillsInstallerExecutionBlocked(event: SkillsInstallerExecutionBlockedEvent): void {
|
||||
if (!this.shouldLog('tools', 'warn')) {return;}
|
||||
this.write({
|
||||
|
||||
+12
-1
@@ -2,7 +2,7 @@ export type AuditLevel = 'debug' | 'info' | 'warn' | 'error';
|
||||
|
||||
export type AuditEventType =
|
||||
// Tool execution
|
||||
| 'tool.start' | 'tool.success' | 'tool.error' | 'tool.denied' | 'tool.approval'
|
||||
| 'tool.start' | 'tool.success' | 'tool.error' | 'tool.denied' | 'tool.approval' | 'tool.args_rewritten'
|
||||
// Security
|
||||
| 'security.elevation.enabled' | 'security.elevation.disabled' | 'security.elevation.expired'
|
||||
// Skills scan
|
||||
@@ -110,6 +110,17 @@ export interface ToolApprovalEvent {
|
||||
session_id?: string;
|
||||
}
|
||||
|
||||
export interface ToolArgsRewrittenEvent {
|
||||
tool_name: string;
|
||||
session_id?: string;
|
||||
source: 'latest_turn' | 'persisted' | 'history';
|
||||
reason: 'latest_audio_preferred' | 'voice_turn_fallback' | 'invalid_model_args' | 'missing_model_args';
|
||||
original_has_data: boolean;
|
||||
original_has_url: boolean;
|
||||
original_mime_type?: string;
|
||||
final_mime_type?: string;
|
||||
}
|
||||
|
||||
export interface SkillsInstallerExecutionBlockedEvent {
|
||||
skill_name: string;
|
||||
phase: 'install' | 'execute';
|
||||
|
||||
Reference in New Issue
Block a user