@dubeyvishal/orbital-cli 1.0.9 → 1.2.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.2.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",
@@ -11,7 +11,6 @@
11
11
  },
12
12
  "files": [
13
13
  "server/src",
14
- "server/prisma",
15
14
  "README.md"
16
15
  ],
17
16
  "publishConfig": {
@@ -23,9 +22,7 @@
23
22
  "dependencies": {
24
23
  "@ai-sdk/google": "^3.0.6",
25
24
  "@clack/prompts": "^0.11.0",
26
- "@prisma/client": "^5.22.0",
27
25
  "ai": "^6.0.29",
28
- "better-auth": "^1.4.10",
29
26
  "boxen": "^8.0.1",
30
27
  "chalk": "^5.6.2",
31
28
  "commander": "^14.0.2",
@@ -35,17 +32,16 @@
35
32
  "marked": "^15.0.12",
36
33
  "marked-terminal": "^7.3.0",
37
34
  "open": "^11.0.0",
38
- "prisma": "^5.22.0",
39
35
  "yocto-spinner": "^1.0.0",
40
36
  "zod": "^4.3.5"
41
37
  },
42
38
  "scripts": {
43
- "postinstall": "cd server && npx prisma generate",
44
39
  "install-all": "npm install --prefix client && npm install --prefix server",
45
40
  "start-client": "npm start --prefix client",
46
41
  "start-server": "npm start --prefix server",
47
42
  "dev": "npm run start-server && npm run start-client"
48
43
  },
44
+
49
45
  "keywords": [
50
46
  "orbital",
51
47
  "cli",
@@ -9,7 +9,7 @@ import yoctoSpinner from "yocto-spinner";
9
9
  import * as z from "zod";
10
10
  import { createAuthClient } from "better-auth/client";
11
11
  import { deviceAuthorizationClient } from "better-auth/client/plugins";
12
- import { logger } from "better-auth";
12
+
13
13
  import { fileURLToPath } from "url";
14
14
  import { getStoredToken, isTokenExpired, storeToken ,TOKEN_FILE } from "../../../lib/token.js";
15
15
  import { API_BASE } from "../../../config/api.js";
@@ -233,7 +233,7 @@ const pollForToken = async (
233
233
  return;
234
234
  default:
235
235
  spinner.stop();
236
- logger.error(`Error: ${error.error_description}`);
236
+ console.error(`Error: ${error.error_description}`);
237
237
  reject(
238
238
  new Error(error.error_description || "Unknown device error"),
239
239
  );
@@ -242,7 +242,7 @@ const pollForToken = async (
242
242
  }
243
243
  } catch (err) {
244
244
  spinner.stop();
245
- logger.error(`Error: ${err?.message || err}`);
245
+ console.error(`Error: ${err?.message || err}`);
246
246
  return;
247
247
  }
248
248
 
@@ -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
  };
@@ -1,7 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "Test" (
3
- "id" TEXT NOT NULL,
4
- "name" TEXT NOT NULL,
5
-
6
- CONSTRAINT "Test_pkey" PRIMARY KEY ("id")
7
- );
@@ -1,78 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "user" (
3
- "id" TEXT NOT NULL,
4
- "name" TEXT NOT NULL,
5
- "email" TEXT NOT NULL,
6
- "emailVerified" BOOLEAN NOT NULL DEFAULT false,
7
- "image" TEXT,
8
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
- "updatedAt" TIMESTAMP(3) NOT NULL,
10
-
11
- CONSTRAINT "user_pkey" PRIMARY KEY ("id")
12
- );
13
-
14
- -- CreateTable
15
- CREATE TABLE "session" (
16
- "id" TEXT NOT NULL,
17
- "expiresAt" TIMESTAMP(3) NOT NULL,
18
- "token" TEXT NOT NULL,
19
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
- "updatedAt" TIMESTAMP(3) NOT NULL,
21
- "ipAddress" TEXT,
22
- "userAgent" TEXT,
23
- "userId" TEXT NOT NULL,
24
-
25
- CONSTRAINT "session_pkey" PRIMARY KEY ("id")
26
- );
27
-
28
- -- CreateTable
29
- CREATE TABLE "account" (
30
- "id" TEXT NOT NULL,
31
- "accountId" TEXT NOT NULL,
32
- "providerId" TEXT NOT NULL,
33
- "userId" TEXT NOT NULL,
34
- "accessToken" TEXT,
35
- "refreshToken" TEXT,
36
- "idToken" TEXT,
37
- "accessTokenExpiresAt" TIMESTAMP(3),
38
- "refreshTokenExpiresAt" TIMESTAMP(3),
39
- "scope" TEXT,
40
- "password" TEXT,
41
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
42
- "updatedAt" TIMESTAMP(3) NOT NULL,
43
-
44
- CONSTRAINT "account_pkey" PRIMARY KEY ("id")
45
- );
46
-
47
- -- CreateTable
48
- CREATE TABLE "verification" (
49
- "id" TEXT NOT NULL,
50
- "identifier" TEXT NOT NULL,
51
- "value" TEXT NOT NULL,
52
- "expiresAt" TIMESTAMP(3) NOT NULL,
53
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
54
- "updatedAt" TIMESTAMP(3) NOT NULL,
55
-
56
- CONSTRAINT "verification_pkey" PRIMARY KEY ("id")
57
- );
58
-
59
- -- CreateIndex
60
- CREATE UNIQUE INDEX "user_email_key" ON "user"("email");
61
-
62
- -- CreateIndex
63
- CREATE INDEX "session_userId_idx" ON "session"("userId");
64
-
65
- -- CreateIndex
66
- CREATE UNIQUE INDEX "session_token_key" ON "session"("token");
67
-
68
- -- CreateIndex
69
- CREATE INDEX "account_userId_idx" ON "account"("userId");
70
-
71
- -- CreateIndex
72
- CREATE INDEX "verification_identifier_idx" ON "verification"("identifier");
73
-
74
- -- AddForeignKey
75
- ALTER TABLE "session" ADD CONSTRAINT "session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;
76
-
77
- -- AddForeignKey
78
- ALTER TABLE "account" ADD CONSTRAINT "account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,50 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "deviceCode" (
3
- "id" TEXT NOT NULL,
4
- "deviceCode" TEXT NOT NULL,
5
- "userCode" TEXT NOT NULL,
6
- "userId" TEXT,
7
- "expiresAt" TIMESTAMP(3) NOT NULL,
8
- "status" TEXT NOT NULL,
9
- "lastPolledAt" TIMESTAMP(3),
10
- "pollingInterval" INTEGER,
11
- "clientId" TEXT,
12
- "scope" TEXT,
13
-
14
- CONSTRAINT "deviceCode_pkey" PRIMARY KEY ("id")
15
- );
16
-
17
- -- CreateTable
18
- CREATE TABLE "conversation" (
19
- "id" TEXT NOT NULL,
20
- "userId" TEXT NOT NULL,
21
- "title" TEXT NOT NULL,
22
- "mode" TEXT NOT NULL DEFAULT 'chat',
23
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
24
- "updatedAt" TIMESTAMP(3) NOT NULL,
25
-
26
- CONSTRAINT "conversation_pkey" PRIMARY KEY ("id")
27
- );
28
-
29
- -- CreateTable
30
- CREATE TABLE "message" (
31
- "id" TEXT NOT NULL,
32
- "conversationId" TEXT NOT NULL,
33
- "role" TEXT NOT NULL,
34
- "content" TEXT NOT NULL,
35
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
36
-
37
- CONSTRAINT "message_pkey" PRIMARY KEY ("id")
38
- );
39
-
40
- -- CreateIndex
41
- CREATE INDEX "conversation_userId_idx" ON "conversation"("userId");
42
-
43
- -- CreateIndex
44
- CREATE INDEX "message_conversationId_idx" ON "message"("conversationId");
45
-
46
- -- AddForeignKey
47
- ALTER TABLE "conversation" ADD CONSTRAINT "conversation_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;
48
-
49
- -- AddForeignKey
50
- ALTER TABLE "message" ADD CONSTRAINT "message_conversationId_fkey" FOREIGN KEY ("conversationId") REFERENCES "conversation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,3 +0,0 @@
1
- # Please do not edit this file manually
2
- # It should be added in your version-control system (i.e. Git)
3
- provider = "postgresql"
@@ -1,117 +0,0 @@
1
- generator client {
2
- provider = "prisma-client-js"
3
- }
4
-
5
- datasource db {
6
- provider = "postgresql"
7
- url = env("DATABASE_URL")
8
- directUrl = env("DIRECT_DATABASE_URL")
9
- }
10
-
11
- model Test {
12
- id String @id @default(cuid())
13
- name String
14
- }
15
-
16
- model User {
17
- id String @id @default(cuid())
18
- name String
19
- email String @unique
20
- emailVerified Boolean @default(false)
21
- image String?
22
- createdAt DateTime @default(now())
23
- updatedAt DateTime @updatedAt
24
- accounts Account[]
25
- conversations Conversation[]
26
- sessions Session[]
27
-
28
- @@map("user")
29
- }
30
-
31
- model Session {
32
- id String @id @default(cuid())
33
- expiresAt DateTime
34
- token String @unique
35
- createdAt DateTime @default(now())
36
- updatedAt DateTime @updatedAt
37
- ipAddress String?
38
- userAgent String?
39
- userId String
40
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
41
-
42
- @@index([userId])
43
- @@map("session")
44
- }
45
-
46
- model Account {
47
- id String @id @default(cuid())
48
- accountId String
49
- providerId String
50
- userId String
51
- accessToken String?
52
- refreshToken String?
53
- idToken String?
54
- accessTokenExpiresAt DateTime?
55
- refreshTokenExpiresAt DateTime?
56
- scope String?
57
- password String?
58
- createdAt DateTime @default(now())
59
- updatedAt DateTime @updatedAt
60
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
61
-
62
- @@index([userId])
63
- @@map("account")
64
- }
65
-
66
- model Verification {
67
- id String @id @default(cuid())
68
- identifier String
69
- value String
70
- expiresAt DateTime
71
- createdAt DateTime @default(now())
72
- updatedAt DateTime @updatedAt
73
-
74
- @@index([identifier])
75
- @@map("verification")
76
- }
77
-
78
- model DeviceCode {
79
- id String @id @default(cuid())
80
- deviceCode String
81
- userCode String
82
- userId String?
83
- expiresAt DateTime
84
- status String
85
- lastPolledAt DateTime?
86
- pollingInterval Int?
87
- clientId String?
88
- scope String?
89
-
90
- @@map("deviceCode")
91
- }
92
-
93
- model Conversation {
94
- id String @id @default(cuid())
95
- userId String
96
- title String
97
- mode String @default("chat")
98
- createdAt DateTime @default(now())
99
- updatedAt DateTime @updatedAt
100
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
101
- messages Message[]
102
-
103
- @@index([userId])
104
- @@map("conversation")
105
- }
106
-
107
- model Message {
108
- id String @id @default(cuid())
109
- conversationId String
110
- role String
111
- content String
112
- createdAt DateTime @default(now())
113
- conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
114
-
115
- @@index([conversationId])
116
- @@map("message")
117
- }