fix package

This commit is contained in:
LPF
2026-03-10 00:33:23 +08:00
parent e9a47ac02a
commit c18fdb690e
85 changed files with 381 additions and 316 deletions

View File

@@ -46,13 +46,13 @@ func (t *CameraTool) Execute(ctx context.Context, args map[string]interface{}) (
} else {
filename = fmt.Sprintf("snap_%d.jpg", time.Now().Unix())
}
// Ensure filename is safe and within workspace
filename = filepath.Clean(filename)
if filepath.IsAbs(filename) {
return "", fmt.Errorf("filename must be relative to workspace")
}
outputPath := filepath.Join(t.workspace, filename)
// Check if video device exists