@dubeyvishal/orbital-cli 1.6.10 → 1.6.11
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.
- package/package.json +1 -2
- package/server/src/cli/commands/auth/login.js +10 -6
- package/server/src/controllers/aiController.js +2 -2
- package/server/src/controllers/cliController.js +1 -1
- package/server/src/index.js +2 -5
- package/server/src/lib/db.js +15 -7
- package/server/src/service/aiService.js +5 -0
- package/server/src/services/aiService.js +0 -10
- package/server/src/services/chatService.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dubeyvishal/orbital-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.11",
|
|
4
4
|
"description": "A fullstack CLI-based AI platform with chat mode, multi-tool agents, and agentic AI workflows. Includes GitHub login with device authorization, secure authentication, and modular client–server architecture for building intelligent automation tools.",
|
|
5
5
|
"author": "Vishal Dubey",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"start-server": "npm start --prefix server",
|
|
42
42
|
"dev": "npm run start-server && npm run start-client"
|
|
43
43
|
},
|
|
44
|
-
|
|
45
44
|
"keywords": [
|
|
46
45
|
"orbital",
|
|
47
46
|
"cli",
|
|
@@ -78,13 +78,17 @@ const resolveClientId = async (cliClientId) => {
|
|
|
78
78
|
const resolved = (cliClientId || "").trim();
|
|
79
79
|
if (resolved.length > 0) return resolved;
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
try {
|
|
82
|
+
const response = await apiRequestSafe("/auth/github/client-id", {
|
|
83
|
+
method: "GET",
|
|
84
|
+
requireAuth: false,
|
|
85
|
+
});
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
const clientId = typeof response?.client_id === "string" ? response.client_id.trim() : "";
|
|
88
|
+
return clientId.length > 0 ? clientId : undefined;
|
|
89
|
+
} catch {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
88
92
|
};
|
|
89
93
|
|
|
90
94
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChatService } from "../
|
|
2
|
-
import { getAIService } from "../
|
|
1
|
+
import { ChatService } from "../service/chatService.js";
|
|
2
|
+
import { getAIService } from "../service/aiService.js";
|
|
3
3
|
import { enableTools, getEnabledTools, resetTools } from "../config/toolConfig.js";
|
|
4
4
|
import { generateApplicationPlan } from "../config/agentConfig.js";
|
|
5
5
|
|
package/server/src/index.js
CHANGED
|
@@ -14,9 +14,6 @@ const app = express();
|
|
|
14
14
|
const PORT = process.env.PORT || 8080;
|
|
15
15
|
const CLIENT_ORIGIN = FRONTEND_URL;
|
|
16
16
|
|
|
17
|
-
app.use(express.json());
|
|
18
|
-
|
|
19
|
-
// ── CORS: single source of truth for every route ──────────────────────
|
|
20
17
|
app.use(
|
|
21
18
|
cors({
|
|
22
19
|
origin: CLIENT_ORIGIN,
|
|
@@ -25,12 +22,10 @@ app.use(
|
|
|
25
22
|
})
|
|
26
23
|
);
|
|
27
24
|
|
|
28
|
-
// Wrap the better-auth handler so it can never override the origin with "*".
|
|
29
25
|
const authHandler = toNodeHandler(auth);
|
|
30
26
|
app.all("/api/auth/*splat", (req, res) => {
|
|
31
27
|
const _setHeader = res.setHeader.bind(res);
|
|
32
28
|
res.setHeader = function (name, value) {
|
|
33
|
-
// Force the correct origin for any CORS header better-auth sets.
|
|
34
29
|
if (name.toLowerCase() === "access-control-allow-origin") {
|
|
35
30
|
return _setHeader(name, CLIENT_ORIGIN);
|
|
36
31
|
}
|
|
@@ -39,6 +34,8 @@ app.all("/api/auth/*splat", (req, res) => {
|
|
|
39
34
|
authHandler(req, res);
|
|
40
35
|
});
|
|
41
36
|
|
|
37
|
+
app.use(express.json());
|
|
38
|
+
|
|
42
39
|
app.use("/auth", authRoutes);
|
|
43
40
|
|
|
44
41
|
app.get("/api/me" , async (req, res)=>{
|
package/server/src/lib/db.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import { execSync } from "child_process";
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from "module";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
let PrismaClient;
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch {
|
|
9
|
+
PrismaClient = require("@prisma/client").PrismaClient;
|
|
10
|
+
} catch {
|
|
11
|
+
try {
|
|
12
|
+
execSync("npx prisma generate", { stdio: "ignore" });
|
|
13
|
+
PrismaClient = require("@prisma/client").PrismaClient;
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.error("Failed to initialize Prisma Client:", err?.message || err);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
11
18
|
|
|
12
|
-
const
|
|
19
|
+
const globalForPrisma = globalThis;
|
|
20
|
+
const prisma = globalForPrisma.prisma ?? (PrismaClient ? new PrismaClient() : null);
|
|
13
21
|
|
|
14
|
-
if (process.env.NODE_ENV !== "production") {
|
|
22
|
+
if (process.env.NODE_ENV !== "production" && prisma) {
|
|
15
23
|
globalForPrisma.prisma = prisma;
|
|
16
24
|
}
|
|
17
25
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ChatService } from "../service/chatService.js";
|