wolverine-ai 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/PLATFORM.md +442 -0
  2. package/README.md +475 -0
  3. package/SERVER_BEST_PRACTICES.md +62 -0
  4. package/TELEMETRY.md +108 -0
  5. package/bin/wolverine.js +95 -0
  6. package/examples/01-basic-typo.js +31 -0
  7. package/examples/02-multi-file/routes/users.js +15 -0
  8. package/examples/02-multi-file/server.js +25 -0
  9. package/examples/03-syntax-error.js +23 -0
  10. package/examples/04-secret-leak.js +14 -0
  11. package/examples/05-expired-key.js +27 -0
  12. package/examples/06-json-config/config.json +13 -0
  13. package/examples/06-json-config/server.js +28 -0
  14. package/examples/07-rate-limit-loop.js +11 -0
  15. package/examples/08-sandbox-escape.js +20 -0
  16. package/examples/buggy-server.js +39 -0
  17. package/examples/demos/01-basic-typo/index.js +20 -0
  18. package/examples/demos/01-basic-typo/routes/api.js +13 -0
  19. package/examples/demos/01-basic-typo/routes/health.js +4 -0
  20. package/examples/demos/02-multi-file/index.js +24 -0
  21. package/examples/demos/02-multi-file/routes/api.js +13 -0
  22. package/examples/demos/02-multi-file/routes/health.js +4 -0
  23. package/examples/demos/03-syntax-error/index.js +18 -0
  24. package/examples/demos/04-secret-leak/index.js +16 -0
  25. package/examples/demos/05-expired-key/index.js +21 -0
  26. package/examples/demos/06-json-config/config.json +9 -0
  27. package/examples/demos/06-json-config/index.js +20 -0
  28. package/examples/demos/07-null-crash/index.js +16 -0
  29. package/examples/run-demo.js +110 -0
  30. package/package.json +67 -0
  31. package/server/config/settings.json +62 -0
  32. package/server/index.js +33 -0
  33. package/server/routes/api.js +12 -0
  34. package/server/routes/health.js +16 -0
  35. package/server/routes/time.js +12 -0
  36. package/src/agent/agent-engine.js +727 -0
  37. package/src/agent/goal-loop.js +140 -0
  38. package/src/agent/research-agent.js +120 -0
  39. package/src/agent/sub-agents.js +176 -0
  40. package/src/backup/backup-manager.js +321 -0
  41. package/src/brain/brain.js +315 -0
  42. package/src/brain/embedder.js +131 -0
  43. package/src/brain/function-map.js +263 -0
  44. package/src/brain/vector-store.js +267 -0
  45. package/src/core/ai-client.js +387 -0
  46. package/src/core/cluster-manager.js +144 -0
  47. package/src/core/config.js +89 -0
  48. package/src/core/error-parser.js +87 -0
  49. package/src/core/health-monitor.js +129 -0
  50. package/src/core/models.js +132 -0
  51. package/src/core/patcher.js +55 -0
  52. package/src/core/runner.js +464 -0
  53. package/src/core/system-info.js +141 -0
  54. package/src/core/verifier.js +146 -0
  55. package/src/core/wolverine.js +290 -0
  56. package/src/dashboard/server.js +1332 -0
  57. package/src/index.js +94 -0
  58. package/src/logger/event-logger.js +237 -0
  59. package/src/logger/pricing.js +96 -0
  60. package/src/logger/repair-history.js +109 -0
  61. package/src/logger/token-tracker.js +277 -0
  62. package/src/mcp/mcp-client.js +224 -0
  63. package/src/mcp/mcp-registry.js +228 -0
  64. package/src/mcp/mcp-security.js +152 -0
  65. package/src/monitor/perf-monitor.js +300 -0
  66. package/src/monitor/process-monitor.js +231 -0
  67. package/src/monitor/route-prober.js +191 -0
  68. package/src/notifications/notifier.js +227 -0
  69. package/src/platform/heartbeat.js +93 -0
  70. package/src/platform/queue.js +53 -0
  71. package/src/platform/register.js +64 -0
  72. package/src/platform/telemetry.js +76 -0
  73. package/src/security/admin-auth.js +150 -0
  74. package/src/security/injection-detector.js +174 -0
  75. package/src/security/rate-limiter.js +152 -0
  76. package/src/security/sandbox.js +128 -0
  77. package/src/security/secret-redactor.js +217 -0
  78. package/src/skills/skill-registry.js +129 -0
  79. package/src/skills/sql.js +375 -0
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "wolverine-ai",
3
+ "version": "1.0.0",
4
+ "description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "wolverine": "./bin/wolverine.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/wolverine.js server/index.js",
11
+ "dev": "node bin/wolverine.js server/index.js",
12
+ "wolverine": "node bin/wolverine.js",
13
+ "server": "node server/index.js",
14
+ "demo": "node examples/run-demo.js",
15
+ "demo:list": "node examples/run-demo.js --list",
16
+ "test:pentest": "node tests/pentest-secrets.js"
17
+ },
18
+ "keywords": [
19
+ "self-healing",
20
+ "ai",
21
+ "nodejs",
22
+ "server",
23
+ "error-recovery",
24
+ "auto-repair",
25
+ "process-manager",
26
+ "openai",
27
+ "fastify",
28
+ "wolverine",
29
+ "devops",
30
+ "monitoring",
31
+ "analytics",
32
+ "dashboard",
33
+ "mcp",
34
+ "agent",
35
+ "claude-code"
36
+ ],
37
+ "author": "bobbyswhip",
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/bobbyswhip/Wolverine.git"
42
+ },
43
+ "homepage": "https://github.com/bobbyswhip/Wolverine#readme",
44
+ "bugs": {
45
+ "url": "https://github.com/bobbyswhip/Wolverine/issues"
46
+ },
47
+ "files": [
48
+ "bin/",
49
+ "src/",
50
+ "server/",
51
+ "examples/",
52
+ "PLATFORM.md",
53
+ "TELEMETRY.md",
54
+ "SERVER_BEST_PRACTICES.md",
55
+ "README.md"
56
+ ],
57
+ "dependencies": {
58
+ "chalk": "^4.1.2",
59
+ "diff": "^7.0.0",
60
+ "dotenv": "^16.4.7",
61
+ "fastify": "^5.8.4",
62
+ "openai": "^4.73.0"
63
+ },
64
+ "engines": {
65
+ "node": ">=18.0.0"
66
+ }
67
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "app": {
3
+ "name": "Wolverine Server",
4
+ "version": "1.0.0",
5
+ "env": "development"
6
+ },
7
+
8
+ "models": {
9
+ "reasoning": "gpt-5.4-mini",
10
+ "coding": "gpt-5.1-codex-mini",
11
+ "chat": "gpt-5-nano",
12
+ "tool": "gpt-5.4-mini",
13
+ "classifier": "gpt-4o-mini",
14
+ "audit": "gpt-4o-mini",
15
+ "compacting": "gpt-4o-mini",
16
+ "research": "o4-mini-deep-research",
17
+ "embedding": "text-embedding-3-small"
18
+ },
19
+
20
+ "server": {
21
+ "port": 6969,
22
+ "maxRetries": 3,
23
+ "maxMemoryMB": 512
24
+ },
25
+
26
+ "cluster": {
27
+ "mode": "auto",
28
+ "workers": 0
29
+ },
30
+
31
+ "telemetry": {
32
+ "enabled": true,
33
+ "heartbeatIntervalMs": 60000
34
+ },
35
+
36
+ "rateLimiting": {
37
+ "maxCallsPerWindow": 32,
38
+ "windowMs": 100000,
39
+ "minGapMs": 5000,
40
+ "maxTokensPerHour": 1000000
41
+ },
42
+
43
+ "healthCheck": {
44
+ "intervalMs": 15000,
45
+ "timeoutMs": 5000,
46
+ "failThreshold": 3,
47
+ "startDelayMs": 10000
48
+ },
49
+
50
+ "dashboard": {},
51
+
52
+ "cors": {
53
+ "enabled": true,
54
+ "origins": ["http://localhost:3000"]
55
+ },
56
+
57
+ "logging": {
58
+ "level": "info",
59
+ "requests": true,
60
+ "responseTime": true
61
+ }
62
+ }
@@ -0,0 +1,33 @@
1
+ const fastify = require("fastify")({ logger: false });
2
+ const PORT = process.env.PORT || 3000;
3
+
4
+ // Routes
5
+ fastify.register(require("./routes/health"), { prefix: "/health" });
6
+ fastify.register(require("./routes/api"), { prefix: "/api" });
7
+ fastify.register(require("./routes/time"), { prefix: "/time" });
8
+
9
+ // Root
10
+ fastify.get("/", async () => ({
11
+ name: "Wolverine Server",
12
+ version: "1.0.0",
13
+ status: "running",
14
+ uptime: process.uptime(),
15
+ }));
16
+
17
+ // 404
18
+ fastify.setNotFoundHandler((req, reply) => {
19
+ reply.code(404).send({ error: "Not found", path: req.url });
20
+ });
21
+
22
+ // Error handler
23
+ fastify.setErrorHandler((err, req, reply) => {
24
+ console.error(`[ERROR] ${err.message}`);
25
+ reply.code(500).send({ error: "Internal server error" });
26
+ });
27
+
28
+ fastify.listen({ port: PORT, host: "0.0.0.0" }, (err) => {
29
+ if (err) { console.error(err); process.exit(1); }
30
+ console.log(`Server running on http://localhost:${PORT}`);
31
+ console.log(`Health: http://localhost:${PORT}/health`);
32
+ console.log(`API: http://localhost:${PORT}/api`);
33
+ });
@@ -0,0 +1,12 @@
1
+ async function routes(fastify) {
2
+ fastify.get("/", async () => ({ message: "Hello from Wolverine API" }));
3
+
4
+ fastify.get("/users", async () => ({
5
+ users: [
6
+ { id: 1, name: "Alice", role: "admin" },
7
+ { id: 2, name: "Bob", role: "user" },
8
+ ],
9
+ }));
10
+ }
11
+
12
+ module.exports = routes;
@@ -0,0 +1,16 @@
1
+ async function routes(fastify) {
2
+ fastify.get("/", async () => {
3
+ const mem = process.memoryUsage();
4
+ return {
5
+ status: "ok",
6
+ uptime: process.uptime(),
7
+ timestamp: new Date().toISOString(),
8
+ memory: {
9
+ rss: Math.round(mem.rss / 1048576) + "MB",
10
+ heap: Math.round(mem.heapUsed / 1048576) + "MB",
11
+ },
12
+ };
13
+ });
14
+ }
15
+
16
+ module.exports = routes;
@@ -0,0 +1,12 @@
1
+ async function routes(fastify) {
2
+ fastify.get("/", async () => {
3
+ const now = new Date();
4
+ return {
5
+ time: now.toISOString(),
6
+ unix: now.getTime(),
7
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
8
+ };
9
+ });
10
+ }
11
+
12
+ module.exports = routes;