vibeoscore 1.0.2 → 1.0.8

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 (45) hide show
  1. package/client.js +1 -0
  2. package/client.ts +2 -0
  3. package/lib/logger.js +27 -0
  4. package/mcp-server.js +5 -4
  5. package/mcp-server.ts +4 -3
  6. package/package.json +4 -10
  7. package/dashboard/dist/assets/index-BnPt1Fii.js +0 -1
  8. package/dashboard/dist/assets/index-CfH00tOL.css +0 -1
  9. package/dashboard/dist/index.html +0 -3
  10. package/lib/blackbox-rf.js +0 -1099
  11. package/lib/blackbox.js +0 -137
  12. package/lib/compression.js +0 -119
  13. package/lib/db.js +0 -106
  14. package/lib/db.ts +0 -113
  15. package/lib/delegation.js +0 -137
  16. package/lib/meta-controller.js +0 -418
  17. package/lib/meta-controller.mjs +0 -499
  18. package/lib/patterns.js +0 -150
  19. package/lib/resolution-tracker.js +0 -486
  20. package/lib/stress.js +0 -84
  21. package/lib/tdd.js +0 -218
  22. package/lib/tier-routing.js +0 -48
  23. package/middleware/auth.js +0 -75
  24. package/middleware/auth.ts +0 -87
  25. package/middleware/usage-logging.js +0 -29
  26. package/middleware/usage-logging.ts +0 -41
  27. package/nginx-vibetheog-api.conf +0 -64
  28. package/routes/admin.js +0 -93
  29. package/routes/admin.ts +0 -107
  30. package/routes/blackbox.js +0 -463
  31. package/routes/compression.js +0 -12
  32. package/routes/delegation.js +0 -30
  33. package/routes/patterns.js +0 -53
  34. package/routes/pricing.js +0 -62
  35. package/routes/stress.js +0 -30
  36. package/routes/tdd.js +0 -68
  37. package/routes/tier-routing.js +0 -31
  38. package/scripts/dashboard-server.mjs +0 -246
  39. package/scripts/deploy-zero-downtime.sh +0 -77
  40. package/scripts/deploy.sh +0 -68
  41. package/scripts/release.mjs +0 -30
  42. package/scripts/seed-master-token.js +0 -29
  43. package/scripts/start-all.mjs +0 -34
  44. package/server.js +0 -88
  45. package/vibeos-api.service +0 -19
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from "node:child_process"
3
- import { join, dirname } from "node:path"
4
- import { fileURLToPath } from "node:url"
5
-
6
- const __dirname = dirname(fileURLToPath(import.meta.url))
7
- const ROOT = dirname(__dirname)
8
-
9
- const server = spawn(process.execPath, [join(ROOT, "server.js")], {
10
- cwd: ROOT,
11
- env: { ...process.env, PORT: process.env.VIBEOS_API_PORT || process.env.PORT || "3000" },
12
- stdio: "inherit",
13
- })
14
-
15
- const dashboard = spawn(process.execPath, [join(ROOT, "scripts", "dashboard-server.mjs")], {
16
- cwd: ROOT,
17
- env: {
18
- ...process.env,
19
- PORT: process.env.VIBEOS_DASHBOARD_PORT || "3333",
20
- VIBEOS_BACKEND_HEALTH_URL: process.env.VIBEOS_BACKEND_HEALTH_URL || "http://127.0.0.1:3000/health",
21
- },
22
- stdio: "inherit",
23
- })
24
-
25
- function shutdown(code = 0) {
26
- try { server.kill("SIGTERM") } catch {}
27
- try { dashboard.kill("SIGTERM") } catch {}
28
- process.exit(code)
29
- }
30
-
31
- server.on("exit", (code) => shutdown(code ?? 0))
32
- dashboard.on("exit", (code) => shutdown(code ?? 0))
33
- process.on("SIGINT", () => shutdown(0))
34
- process.on("SIGTERM", () => shutdown(0))
package/server.js DELETED
@@ -1,88 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- // SPDX-FileCopyrightText: 2026 vibeOS <https://github.com/DrunkkToys/vibeOS>
3
- import Fastify from "fastify";
4
- import { initDb } from "./lib/db.js";
5
- import { authMiddleware } from "./middleware/auth.js";
6
- import { usageLoggingMiddleware } from "./middleware/usage-logging.js";
7
- import { delegationRoutes } from "./routes/delegation.js";
8
- import { tierRoutes } from "./routes/tier-routing.js";
9
- import { stressRoutes } from "./routes/stress.js";
10
- import { blackboxRoutes } from "./routes/blackbox.js";
11
- import { tddRoutes } from "./routes/tdd.js";
12
- import { patternRoutes } from "./routes/patterns.js";
13
- import { pricingRoutes } from "./routes/pricing.js";
14
- import { compressionRoutes } from "./routes/compression.js";
15
- import { adminRoutes } from "./routes/admin.js";
16
- const PORT = Number(process.env.PORT) || 3000;
17
- const HOST = process.env.HOST || "0.0.0.0";
18
- if (!process.env.VIBEOS_API_MASTER_KEY) {
19
- console.error("FATAL: VIBEOS_API_MASTER_KEY environment variable is required");
20
- process.exit(1);
21
- }
22
- const fastify = Fastify({
23
- logger: { level: process.env.NODE_ENV === "production" ? "info" : "debug" },
24
- bodyLimit: 10 * 1024 * 1024,
25
- });
26
- fastify.register(async (instance) => {
27
- authMiddleware(instance);
28
- usageLoggingMiddleware(instance);
29
- await delegationRoutes(instance);
30
- await tierRoutes(instance);
31
- await stressRoutes(instance);
32
- await blackboxRoutes(instance);
33
- await tddRoutes(instance);
34
- await patternRoutes(instance);
35
- await pricingRoutes(instance);
36
- await compressionRoutes(instance);
37
- await adminRoutes(instance);
38
- instance.get("/api/v1/health", async () => {
39
- return { status: "ok", timestamp: new Date().toISOString(), version: "1.0.0" };
40
- });
41
- });
42
- fastify.get("/health", async () => {
43
- return { status: "ok", timestamp: new Date().toISOString(), version: "1.0.0" };
44
- });
45
- fastify.get("/favicon.ico", async (request, reply) => {
46
- reply.code(204).send();
47
- });
48
- fastify.setNotFoundHandler((request, reply) => {
49
- reply.code(404).send({ error: "not found", code: "NOT_FOUND", path: request.url });
50
- });
51
- fastify.setErrorHandler((error, request, reply) => {
52
- fastify.log.error(error);
53
- const statusCode = error.statusCode || error.status || 500;
54
- const message = statusCode >= 500 ? "Internal server error" : error.message;
55
- reply.code(statusCode).send({
56
- error: message,
57
- code: statusCode >= 500 ? "INTERNAL_ERROR" : "REQUEST_ERROR",
58
- ...(error.validation && { validation: error.validation }),
59
- });
60
- });
61
- async function start() {
62
- initDb();
63
- console.log("[vibeOS-api] Database initialized");
64
- const cors = (await import("@fastify/cors")).default;
65
- await fastify.register(cors, {
66
- origin: [
67
- "http://localhost:3000",
68
- "http://localhost:3333",
69
- "https://vibetheog.com",
70
- ...(process.env.CORS_ORIGINS ? process.env.CORS_ORIGINS.split(",").map(s => s.trim()) : [])
71
- ],
72
- methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
73
- credentials: true,
74
- maxAge: 86400,
75
- });
76
- try {
77
- await fastify.listen({ port: PORT, host: HOST });
78
- console.log("[vibeOS-api] Server running on http://" + HOST + ":" + PORT);
79
- console.log("[vibeOS-api] Health check: http://" + HOST + ":" + PORT + "/health");
80
- console.log("[vibeOS-api] Admin endpoints require VIBEOS_API_MASTER_KEY");
81
- }
82
- catch (err) {
83
- fastify.log.error(err);
84
- process.exit(1);
85
- }
86
- }
87
- start();
88
- export { fastify };
@@ -1,19 +0,0 @@
1
- [Unit]
2
- Description=vibeOS API Server
3
- After=network.target nginx.service
4
-
5
- [Service]
6
- Type=simple
7
- User=www-data
8
- Group=www-data
9
- WorkingDirectory=/var/www/vibeos-api
10
- Environment=NODE_ENV=production
11
- EnvironmentFile=/var/www/vibeos-api/.env
12
- ExecStart=/usr/bin/node server.js
13
- Restart=on-failure
14
- RestartSec=5
15
- StandardOutput=journal
16
- StandardError=journal
17
-
18
- [Install]
19
- WantedBy=multi-user.target