@dubeyvishal/orbital-cli 1.0.9 → 1.1.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubeyvishal/orbital-cli",
3
- "version": "1.0.9",
3
+ "version": "1.1.9",
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",
@@ -40,12 +40,13 @@
40
40
  "zod": "^4.3.5"
41
41
  },
42
42
  "scripts": {
43
- "postinstall": "cd server && npx prisma generate",
43
+ "postinstall": "npx prisma generate --schema=./server/prisma/schema.prisma",
44
44
  "install-all": "npm install --prefix client && npm install --prefix server",
45
45
  "start-client": "npm start --prefix client",
46
46
  "start-server": "npm start --prefix server",
47
47
  "dev": "npm run start-server && npm run start-client"
48
48
  },
49
+
49
50
  "keywords": [
50
51
  "orbital",
51
52
  "cli",
@@ -1,37 +1,41 @@
1
1
  import "../config/env.js";
2
2
  import { betterAuth } from "better-auth";
3
3
  import { prismaAdapter } from "better-auth/adapters/prisma";
4
- import { deviceAuthorization } from "better-auth/plugins";
4
+ import { deviceAuthorization } from "better-auth/plugins";
5
5
  import prisma from "./db.js";
6
6
  import { FRONTEND_URL } from "../config/api.js";
7
7
 
8
+ const CLIENT_ORIGIN =
9
+ process.env.CLIENT_ORIGIN ||
10
+ process.env.FRONTEND_URL ||
11
+ FRONTEND_URL;
12
+
8
13
  export const auth = betterAuth({
9
- database: prismaAdapter(prisma, {
10
- provider: "postgresql",
14
+ database: prismaAdapter(prisma, {
15
+ provider: "postgresql",
16
+ }),
17
+
18
+ baseURL: CLIENT_ORIGIN,
19
+ basePath: "/api/auth",
20
+
21
+ trustedOrigins: [CLIENT_ORIGIN],
22
+
23
+
24
+ cors: {
25
+ origin: CLIENT_ORIGIN,
26
+ credentials: true,
27
+ },
28
+
29
+ plugins: [
30
+ deviceAuthorization({
31
+ verificationUri: "/device",
11
32
  }),
12
- // IMPORTANT: When the frontend proxies `/api/*` to the backend (Next.js rewrites),
13
- // auth cookies are set on the frontend origin. The OAuth callback must therefore
14
- // also land on the frontend origin to avoid `state_mismatch`.
15
- baseURL:
16
- process.env.FRONTEND_URL ||
17
- process.env.CLIENT_ORIGIN ||
18
- FRONTEND_URL,
19
- basePath:"/api/auth" ,
20
- trustedOrigins: [
21
- process.env.CLIENT_ORIGIN ||
22
- process.env.FRONTEND_URL ||
23
- FRONTEND_URL,
24
- FRONTEND_URL,
25
- ],
26
- plugins: [
27
- deviceAuthorization({
28
- verificationUri: "/device",
29
- }),
30
33
  ],
31
- socialProviders :{
32
- github : {
33
- clientId : process.env.GITHUB_CLIENT_ID ,
34
- clientSecret: process.env.GITHUB_CLIENT_SECRET
35
- }
36
- }
34
+
35
+ socialProviders: {
36
+ github: {
37
+ clientId: process.env.GITHUB_CLIENT_ID,
38
+ clientSecret: process.env.GITHUB_CLIENT_SECRET,
39
+ },
40
+ },
37
41
  });
@@ -100,7 +100,7 @@ export const ensureDbConnectionOrExit = async (options = {}) => {
100
100
  const ok = await ensureDbConnectionWithRetry(options);
101
101
  if (ok) return true;
102
102
 
103
- // eslint-disable-next-line no-console
103
+
104
104
  console.error(chalk.red("\nServer cannot start without database connectivity. Exiting."));
105
105
  process.exit(1);
106
106
  };