Adopt live production state as git baseline

This commit is contained in:
root
2026-07-07 07:55:47 -05:00
commit 588cfe3f10
85 changed files with 30896 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
// Chat history search endpoint
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../../includes/auth.php';
header('Content-Type: application/json');
AuthMiddleware::requireAuth();
$q = trim($_GET['q'] ?? '');
if (strlen($q) < 2) {
echo json_encode(['results' => [], 'error' => 'Query too short']);
exit;
}
$rows = JarvisDB::query(
"SELECT role, content, created_at FROM conversations
WHERE content LIKE ? ORDER BY created_at DESC LIMIT 25",
['%' . $q . '%']
) ?? [];
echo json_encode(['results' => $rows, 'total' => count($rows)]);