superbrain-server
Advanced tools
| #!/usr/bin/env python3 | ||
| """Manually probe an already-running SuperBrain API instance. | ||
| This is intentionally a command-line diagnostic rather than a unit test: it | ||
| needs the local runtime token and a server listening on the requested address. | ||
| """ | ||
| import argparse | ||
| import json | ||
| from pathlib import Path | ||
| import requests | ||
| def main() -> int: | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("--base-url", default="http://localhost:5000") | ||
| args = parser.parse_args() | ||
| token_path = Path(__file__).resolve().parent.parent / "token.txt" | ||
| if not token_path.is_file(): | ||
| raise SystemExit(f"Token file not found: {token_path}") | ||
| response = requests.get( | ||
| f"{args.base_url.rstrip('/')}/recent?limit=10", | ||
| headers={"X-API-Key": token_path.read_text(encoding="utf-8").strip()}, | ||
| timeout=10, | ||
| ) | ||
| print(f"Status Code: {response.status_code}") | ||
| print(json.dumps(response.json(), indent=2)) | ||
| return 0 if response.ok else 1 | ||
| if __name__ == "__main__": | ||
| raise SystemExit(main()) |
+3
-4
| { | ||
| "name": "superbrain-server", | ||
| "version": "2.0.0", | ||
| "version": "2.0.2", | ||
| "description": "1-Line Auto-Installer and Server Execution wrapper for SuperBrain", | ||
| "main": "index.js", | ||
| "bin": { | ||
@@ -25,5 +24,5 @@ "superbrain-server": "bin/superbrain.js" | ||
| "publishConfig": { | ||
| "access": "public" | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org" | ||
| } | ||
| } | ||
@@ -297,3 +297,3 @@ #!/usr/bin/env python3 | ||
| def get_posts_since(self, updated_after: str, limit=1000): | ||
| def get_posts_since(self, updated_after: str, limit=1000, offset=0): | ||
| """Return posts updated after the given ISO timestamp (delta sync). | ||
@@ -308,4 +308,4 @@ Includes soft-deleted posts so the app knows to hide them.""" | ||
| "WHERE updated_at > ? " | ||
| "ORDER BY updated_at ASC LIMIT ?", | ||
| (updated_after, limit) | ||
| "ORDER BY updated_at ASC, shortcode ASC LIMIT ? OFFSET ?", | ||
| (updated_after, limit, offset) | ||
| ) | ||
@@ -312,0 +312,0 @@ return [self._row_to_dict(r) for r in cur.fetchall()] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
42
2.44%11370
0.68%518140
-0.94%