@surph_ai/sdk 0.0.1
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/auth/index.js +147 -0
- package/base/vinely-base/.nvmrc +1 -0
- package/base/vinely-base/README.md +30 -0
- package/base/vinely-base/app.js +5 -0
- package/base/vinely-base/declarations.d.ts +1 -0
- package/base/vinely-base/package.json +103 -0
- package/base/vinely-base/public/css/globals-2.css +3699 -0
- package/base/vinely-base/public/css/globals.css +3695 -0
- package/base/vinely-base/public/js/app.js +1 -0
- package/base/vinely-base/public/js/jquery.js +2 -0
- package/base/vinely-base/scratch.js +21 -0
- package/base/vinely-base/src/client/components/app-sidebar.tsx +59 -0
- package/base/vinely-base/src/client/components/assistant-ui/markdown-text.tsx +153 -0
- package/base/vinely-base/src/client/components/assistant-ui/thread-list.tsx +67 -0
- package/base/vinely-base/src/client/components/assistant-ui/thread.tsx +666 -0
- package/base/vinely-base/src/client/components/assistant-ui/tool-fallback.tsx +44 -0
- package/base/vinely-base/src/client/components/assistant-ui/tooltip-icon-button.tsx +44 -0
- package/base/vinely-base/src/client/components/ui/breadcrumb.tsx +109 -0
- package/base/vinely-base/src/client/components/ui/button.tsx +59 -0
- package/base/vinely-base/src/client/components/ui/input.tsx +21 -0
- package/base/vinely-base/src/client/components/ui/separator.tsx +28 -0
- package/base/vinely-base/src/client/components/ui/sheet.tsx +139 -0
- package/base/vinely-base/src/client/components/ui/sidebar.tsx +726 -0
- package/base/vinely-base/src/client/components/ui/skeleton.tsx +14 -0
- package/base/vinely-base/src/client/components/ui/tooltip.tsx +61 -0
- package/base/vinely-base/src/client/components/vines-sidebar.tsx +182 -0
- package/base/vinely-base/src/client/contexts/SessionContext.tsx +28 -0
- package/base/vinely-base/src/client/contexts/SessionReducer.tsx +32 -0
- package/base/vinely-base/src/client/hooks/use-mobile.ts +19 -0
- package/base/vinely-base/src/client/index.tsx +154 -0
- package/base/vinely-base/src/client/lib/API.ts +155 -0
- package/base/vinely-base/src/client/lib/RPC.ts +49 -0
- package/base/vinely-base/src/client/lib/utils.ts +96 -0
- package/base/vinely-base/src/server/index.ts +63 -0
- package/base/vinely-base/src/server/routes/api.ts +38 -0
- package/base/vinely-base/src/server/routes/chat.ts +133 -0
- package/base/vinely-base/src/server/routes/main.ts +36 -0
- package/base/vinely-base/src/server/routes/mcp.ts +52 -0
- package/base/vinely-base/src/server/routes/rpc.ts +64 -0
- package/base/vinely-base/src/server/routes/thread.ts +44 -0
- package/base/vinely-base/src/server/utils/APIMgr.ts +156 -0
- package/base/vinely-base/src/server/utils/Auth.ts +235 -0
- package/base/vinely-base/src/server/utils/fetchManifest.ts +15 -0
- package/base/vinely-base/src/server/utils/mcp-auth.ts +251 -0
- package/base/vinely-base/tsconfig.json +16 -0
- package/base/vinely-base/views/landing.html +187 -0
- package/base/vinely-base/views/partials/imports.dev.html +3 -0
- package/base/vinely-base/webpack.config.js +112 -0
- package/deploy/Dockerfile +9 -0
- package/deploy/index.js +244 -0
- package/index.js +266 -0
- package/package.json +28 -0
- package/scaffold/app/gulpfile.js +12 -0
- package/scaffold/app/package.json +24 -0
- package/scaffold/app/src/index.js +14 -0
- package/scaffold/index.js +171 -0
- package/scaffold/project/README.md +28 -0
- package/scaffold/project/app.js +20 -0
- package/scaffold/project/apps/README.md +1 -0
- package/scaffold/project/env.txt +4 -0
- package/scaffold/project/package-lock.json +2459 -0
- package/scaffold/project/package.json +21 -0
- package/scaffold/project/public/css/bootstrap.css +5926 -0
- package/scaffold/project/public/js/app.js +1 -0
- package/scaffold/project/public/js/jquery.js +2 -0
- package/scaffold/project/routes/index.js +8 -0
- package/scaffold/project/templates/index.mustache +20 -0
- package/utils/Realm.js +60 -0
- package/utils/http.js +22 -0
- package/utils/index.js +276 -0
package/auth/index.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
const prompt = require('prompt')
|
|
2
|
+
const colors = require('colors/safe')
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const os = require('os')
|
|
5
|
+
const fs = require('fs')
|
|
6
|
+
const utils = require('../utils')
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
showPrompt: () => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const schema = {
|
|
12
|
+
properties: {
|
|
13
|
+
email: {
|
|
14
|
+
description: colors.cyan('\nEmail'),
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
password: {
|
|
18
|
+
description: colors.cyan('Password'),
|
|
19
|
+
required: true,
|
|
20
|
+
hidden: true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
prompt.message = null
|
|
26
|
+
prompt.start()
|
|
27
|
+
|
|
28
|
+
// Get two properties from the user: username and email
|
|
29
|
+
prompt.get(schema, (err, result) => {
|
|
30
|
+
if (err) {
|
|
31
|
+
reject(err)
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
resolve(result)
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
isLoggedIn: () => {
|
|
41
|
+
const userProfilePath = path.join(os.homedir(), '.vinely_user')
|
|
42
|
+
if (!fs.existsSync(userProfilePath)) {
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return true
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
connectApp: () => {
|
|
50
|
+
// https://www.npmjs.com/package/prompt
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
const schema = {
|
|
53
|
+
properties: {
|
|
54
|
+
siteId: {
|
|
55
|
+
description: colors.cyan('\nEnter Site ID'),
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
apiKey: {
|
|
59
|
+
description: colors.cyan('Enter Site API Key'),
|
|
60
|
+
required: true
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
prompt.message = null
|
|
66
|
+
|
|
67
|
+
prompt.start()
|
|
68
|
+
prompt.get(schema, (err, result) => {
|
|
69
|
+
if (err){
|
|
70
|
+
reject(err)
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
resolve(result)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
currentUser: () => {
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
const userProfilePath = path.join(os.homedir(), '.vinely_user')
|
|
82
|
+
if (!fs.existsSync(userProfilePath)) {
|
|
83
|
+
// Not logged in
|
|
84
|
+
resolve(false);
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const data = utils.readFile(userProfilePath)
|
|
90
|
+
const currentUser = JSON.parse(data)
|
|
91
|
+
resolve(currentUser)
|
|
92
|
+
} catch (error) {
|
|
93
|
+
reject(error)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
isAuthorized: (app, currentUser) => {
|
|
99
|
+
if (!currentUser)
|
|
100
|
+
return false
|
|
101
|
+
|
|
102
|
+
if (app.profile.id === currentUser.id) // user is admin
|
|
103
|
+
return true
|
|
104
|
+
|
|
105
|
+
// check if currentUser is a collaborator:
|
|
106
|
+
var isCollaborator = false
|
|
107
|
+
for (var i=0; i<app.collaborators.length; i++){
|
|
108
|
+
var collaborator = app.collaborators[i]
|
|
109
|
+
if (collaborator.id == currentUser.id){
|
|
110
|
+
isCollaborator = true
|
|
111
|
+
break
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return isCollaborator
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
awsConfig: function(){
|
|
120
|
+
return new Promise(function(resolve, reject){
|
|
121
|
+
var awsConfigPath = path.join(os.homedir(), '.turbo_aws_config')
|
|
122
|
+
if (fs.existsSync(awsConfigPath) == false) {
|
|
123
|
+
reject(new Error('AWS Config not set. To set:\n$ turbo awsConfig'))
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
utils.readFile(awsConfigPath)
|
|
128
|
+
.then(function(data){
|
|
129
|
+
awsSettings = JSON.parse(data)
|
|
130
|
+
resolve(awsSettings)
|
|
131
|
+
return
|
|
132
|
+
})
|
|
133
|
+
.catch(function(err){
|
|
134
|
+
reject(err)
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
awsConfigSet: function(){
|
|
140
|
+
var awsConfigPath = path.join(os.homedir(), '.turbo_aws_config')
|
|
141
|
+
if (fs.existsSync(awsConfigPath) == false) {
|
|
142
|
+
return false
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return true
|
|
146
|
+
} */
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/jod
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# base-template
|
|
2
|
+
|
|
3
|
+
This project was built with Vertex Labs. To learn more, click here: https://www.vtxlabs.io
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
After cloning into repo, cd to project root directory and install dependencies:
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
$ npm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
To run dev server, install Nodemon library globally:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ sudo npm install nodemon -g
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then run devserver from project root directory:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
$ nodemon
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Open browser to:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
http://localhost:3000
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Profit!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '@turbo360/turbo-sdk';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "base-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node ./app",
|
|
8
|
+
"dev": "webpack --mode development && npm run server:build && nodemon",
|
|
9
|
+
"clean": "rimraf ./public/dist/prod && rimraf ./build",
|
|
10
|
+
"build": "npm run clean && npm run client:build && tsc",
|
|
11
|
+
"server:build": "tsc",
|
|
12
|
+
"client:dev": "webpack --mode development -w",
|
|
13
|
+
"client:build": "rimraf ./public/dist/prod && cross-env NODE_ENV=production webpack"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@ai-sdk/anthropic": "^2.0.12",
|
|
17
|
+
"@ai-sdk/openai": "^2.0.27",
|
|
18
|
+
"@ai-sdk/react": "^2.0.39",
|
|
19
|
+
"@assistant-ui/react": "^0.11.14",
|
|
20
|
+
"@assistant-ui/react-ai-sdk": "^1.1.0",
|
|
21
|
+
"@assistant-ui/react-markdown": "^0.11.0",
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.17.3",
|
|
23
|
+
"@radix-ui/react-dialog": "^1.1.14",
|
|
24
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
25
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
26
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
27
|
+
"@turbo360/turbo-sdk": "^0.0.19",
|
|
28
|
+
"@types/jest": "^29.5.2",
|
|
29
|
+
"@types/react": "^19.1.1",
|
|
30
|
+
"@types/react-dom": "^19.1.2",
|
|
31
|
+
"ai": "^5.0.39",
|
|
32
|
+
"axios": "^1.3.4",
|
|
33
|
+
"class-variance-authority": "^0.7.1",
|
|
34
|
+
"clsx": "^2.1.1",
|
|
35
|
+
"cookie": "^0.5.0",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"express": "^4.18.1",
|
|
38
|
+
"framer-motion": "^12.23.12",
|
|
39
|
+
"katex": "0.16.22",
|
|
40
|
+
"lucide-react": "^0.539.0",
|
|
41
|
+
"mustache": "^4.2.0",
|
|
42
|
+
"passport": "^0.7.0",
|
|
43
|
+
"passport-google-oauth20": "^2.0.0",
|
|
44
|
+
"react": "^19.1.0",
|
|
45
|
+
"react-dom": "^19.1.0",
|
|
46
|
+
"react-markdown": "^10.1.0",
|
|
47
|
+
"react-router-dom": "5.2.0",
|
|
48
|
+
"rehype-katex": "7.0.1",
|
|
49
|
+
"remark-gfm": "^4.0.1",
|
|
50
|
+
"remark-math": "6.0.0",
|
|
51
|
+
"serverless-http": "^3.2.0",
|
|
52
|
+
"tailwind-merge": "^3.3.1",
|
|
53
|
+
"zod": "^4.0.17"
|
|
54
|
+
},
|
|
55
|
+
"presets": [
|
|
56
|
+
"@babel/preset-env",
|
|
57
|
+
"@babel/preset-react"
|
|
58
|
+
],
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@babel/core": "^7.20.12",
|
|
61
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
62
|
+
"@babel/preset-env": "^7.20.2",
|
|
63
|
+
"@babel/preset-react": "^7.18.6",
|
|
64
|
+
"@eslint/eslintrc": "^3",
|
|
65
|
+
"@tailwindcss/postcss": "^4",
|
|
66
|
+
"@types/express": "^5.0.3",
|
|
67
|
+
"@types/node": "^24.2.1",
|
|
68
|
+
"@types/passport": "^1.0.17",
|
|
69
|
+
"@types/passport-google-oauth20": "^2.0.16",
|
|
70
|
+
"@types/react": "^19",
|
|
71
|
+
"@types/react-dom": "^19",
|
|
72
|
+
"@types/react-router-dom": "5.3.3",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
74
|
+
"@typescript-eslint/parser": "^5.50.0",
|
|
75
|
+
"babel-loader": "^9.1.2",
|
|
76
|
+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
|
77
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
78
|
+
"eslint": "^8.26.0",
|
|
79
|
+
"eslint-config-prettier": "^8.6.0",
|
|
80
|
+
"eslint-config-react-app": "^7.0.1",
|
|
81
|
+
"eslint-config-standard": "^17.0.0",
|
|
82
|
+
"eslint-plugin-flowtype": "^8.0.3",
|
|
83
|
+
"eslint-plugin-import": "^2.26.0",
|
|
84
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
85
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
86
|
+
"eslint-plugin-n": "^15.3.0",
|
|
87
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
88
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
89
|
+
"eslint-plugin-react": "^7.31.10",
|
|
90
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
91
|
+
"file-loader": "^6.2.0",
|
|
92
|
+
"html-webpack-plugin": "^5.5.3",
|
|
93
|
+
"lodash-webpack-plugin": "^0.11.6",
|
|
94
|
+
"nodemon": "^2.0.2",
|
|
95
|
+
"rimraf": "^6.0.1",
|
|
96
|
+
"source-map-loader": "^4.0.1",
|
|
97
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
98
|
+
"ts-loader": "^9.5.2",
|
|
99
|
+
"typescript": "^5.9.2",
|
|
100
|
+
"webpack": "^5.75.0",
|
|
101
|
+
"webpack-cli": "^5.0.1"
|
|
102
|
+
}
|
|
103
|
+
}
|