@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
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// const program = require('commander')
|
|
2
|
+
const shell = require('shelljs')
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const fs = require('fs')
|
|
5
|
+
const dotenv = require('dotenv')
|
|
6
|
+
const utils = require('../utils')
|
|
7
|
+
|
|
8
|
+
// var PLATFORM_VECTOR_URL = 'https://platform.turbo360-vector.com'
|
|
9
|
+
// var VERTEX_NPM_VERSION = "^0.30.25"
|
|
10
|
+
// var TURBO_NPM_VERSION = "^1.8.69"
|
|
11
|
+
|
|
12
|
+
const nextSteps = function(name){
|
|
13
|
+
console.log('\n- - - - - Next Steps - - - - - ')
|
|
14
|
+
console.log('1. $ cd ' + name)
|
|
15
|
+
console.log('2. $ npm install')
|
|
16
|
+
console.log('3. $ turbo devserver')
|
|
17
|
+
console.log('4. Open http://localhost:3000 in a browser')
|
|
18
|
+
console.log('- - - - - - - - - - - - - - - - -\n')
|
|
19
|
+
console.log('For full documentation, visit https://docs.turbo360.co\n')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
var importVectors = function(shell){
|
|
24
|
+
shell.mkdir('-p', 'vectors')
|
|
25
|
+
shell.mkdir('-p', 'vectors/js')
|
|
26
|
+
shell.mkdir('-p', 'vectors/py')
|
|
27
|
+
shell.cp('-R', path.join(__dirname, '../default/lambda/js/index.js'), 'vectors/js/index.js')
|
|
28
|
+
shell.cp('-R', path.join(__dirname, '../default/lambda/py/requirements.txt'), 'vectors/py/requirements.txt')
|
|
29
|
+
shell.cp('-R', path.join(__dirname, '../default/lambda/py/app.py'), 'vectors/py/app.py')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var currentConfig = function(format){
|
|
33
|
+
if (format == null)
|
|
34
|
+
format = 'vertex'
|
|
35
|
+
|
|
36
|
+
var filename = null
|
|
37
|
+
if (format == 'vertex')
|
|
38
|
+
filename = 'vertex-package.json'
|
|
39
|
+
|
|
40
|
+
return new Promise(function(resolve, reject){
|
|
41
|
+
utils.getRequest('https://cdn.turbo360-dev.com/dist/config/'+filename, null)
|
|
42
|
+
.then(function(response){
|
|
43
|
+
// console.log('CONFIG: ' + JSON.stringify(data))
|
|
44
|
+
if (response.confirmation != 'success'){
|
|
45
|
+
throw new Error('')
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
resolve(response.data)
|
|
50
|
+
})
|
|
51
|
+
.catch(function(err){
|
|
52
|
+
// don't reject this promise. if error, return static
|
|
53
|
+
// value from above.
|
|
54
|
+
resolve({
|
|
55
|
+
vertexVersion: VERTEX_NPM_VERSION,
|
|
56
|
+
turboVersion: TURBO_NPM_VERSION
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
module.exports = (name, type = 'app') => {
|
|
65
|
+
/*
|
|
66
|
+
https://stackoverflow.com/questions/8683895/how-do-i-determine-the-current-operating-system-with-node-js
|
|
67
|
+
Returns the operating system platform. Possible values are 'darwin', 'freebsd', 'linux',
|
|
68
|
+
'sunos' or 'win32'. Returns the value of process.platform.
|
|
69
|
+
'darwin' == mac
|
|
70
|
+
'win32' == windows
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
const { platform } = process
|
|
74
|
+
|
|
75
|
+
if (type === 'app') {
|
|
76
|
+
shell.mkdir('-p', name)
|
|
77
|
+
shell.cd(name)
|
|
78
|
+
|
|
79
|
+
shell.cp('-R', path.join(__dirname, 'app/package.json'), 'package.json')
|
|
80
|
+
|
|
81
|
+
// www:
|
|
82
|
+
shell.mkdir('-p', 'src')
|
|
83
|
+
shell.cp('-R', path.join(__dirname, `app/src/*`), 'src/')
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (type === 'project') {
|
|
87
|
+
console.log('create project: ' + name)
|
|
88
|
+
shell.mkdir('-p', name)
|
|
89
|
+
shell.cd(name)
|
|
90
|
+
|
|
91
|
+
shell.cp('-R', path.join(__dirname, 'project/app.js'), 'app.js')
|
|
92
|
+
shell.cp('-R', path.join(__dirname, 'project/package.json'), 'package.json')
|
|
93
|
+
|
|
94
|
+
// www:
|
|
95
|
+
// shell.mkdir('-p', 'www')
|
|
96
|
+
// shell.cp('-R', path.join(__dirname, `project/www/*`), 'www/')
|
|
97
|
+
|
|
98
|
+
shell.mkdir('-p', 'apps')
|
|
99
|
+
shell.cp('-R', path.join(__dirname, `project/apps/*`), 'apps/')
|
|
100
|
+
|
|
101
|
+
// routes:
|
|
102
|
+
shell.mkdir('-p', 'routes')
|
|
103
|
+
shell.cp('-R', path.join(__dirname, `project/routes/*`), 'routes/')
|
|
104
|
+
|
|
105
|
+
// views:
|
|
106
|
+
shell.mkdir('-p', 'templates')
|
|
107
|
+
shell.cp('-R', path.join(__dirname, `project/templates/*`), 'templates/')
|
|
108
|
+
shell.cd('templates')
|
|
109
|
+
|
|
110
|
+
shell.cd('..')
|
|
111
|
+
shell.mkdir('-p', 'public')
|
|
112
|
+
shell.cp('-R', path.join(__dirname, `project/public/*`), 'public/')
|
|
113
|
+
|
|
114
|
+
const pkgJsonStr = utils.readFile(path.join(__dirname, 'project/package.json'))
|
|
115
|
+
const pkgJson = JSON.parse(pkgJsonStr)
|
|
116
|
+
pkgJson.name = name
|
|
117
|
+
utils.write('package.json', JSON.stringify(pkgJson, null, 2) + '\n')
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
const scripts = {
|
|
121
|
+
start: 'node ./www/bin',
|
|
122
|
+
test: '',
|
|
123
|
+
build: '',
|
|
124
|
+
postinstall: 'saxa postinstall'
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const devDependencies = {
|
|
128
|
+
nodemon: '^2.0.1',
|
|
129
|
+
rimraf: '^2.6.2'
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const dependencies = {
|
|
133
|
+
'content-type': '^1.0.4',
|
|
134
|
+
'cookie-signature': '1.0.6',
|
|
135
|
+
'escape-html': '^1.0.3',
|
|
136
|
+
'express': '^4.17.1',
|
|
137
|
+
'finalhandler': '1.1.1',
|
|
138
|
+
'fresh': '0.5.2',
|
|
139
|
+
'merge-descriptors': '1.0.1',
|
|
140
|
+
'methods': '^1.1.2',
|
|
141
|
+
'on-finished': '^2.3.0',
|
|
142
|
+
'parseurl': '^1.3.2',
|
|
143
|
+
'path-to-regexp': '0.1.7',
|
|
144
|
+
'proxy-addr': '^2.0.3',
|
|
145
|
+
'qs': '6.11.1',
|
|
146
|
+
'range-parser': '^1.2.0',
|
|
147
|
+
'saxa': '0.0.26',
|
|
148
|
+
'safe-buffer': '5.1.1',
|
|
149
|
+
'send': '0.16.2',
|
|
150
|
+
'serve-static': '1.13.2',
|
|
151
|
+
'setprototypeof': '1.1.0',
|
|
152
|
+
'statuses': '^1.4.0',
|
|
153
|
+
'type-is': '^1.6.16',
|
|
154
|
+
'utils-merge': '1.0.1',
|
|
155
|
+
'vary': '^1.1.2'
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// package.json
|
|
159
|
+
const pkg = {
|
|
160
|
+
name,
|
|
161
|
+
version: '0.0.0',
|
|
162
|
+
private: true,
|
|
163
|
+
scripts,
|
|
164
|
+
dependencies,
|
|
165
|
+
devDependencies,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
utils.write('package.json', JSON.stringify(pkg, null, 2) + '\n')
|
|
169
|
+
*/
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# demo
|
|
2
|
+
|
|
3
|
+
This project was built with Saxa Labs. To learn more, click here: https://www.saxalabs.com
|
|
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 Turbo CLI globally:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ sudo npm install saxa-cli -g
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then run devserver from project root directory:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
$ turbo devserver
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
To build for production, run build:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
$ npm run build
|
|
28
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const express = require('express')
|
|
2
|
+
const turbo = require('@turbo360/turbo-sdk')
|
|
3
|
+
const { configureApp, appContext } = require('saxa')
|
|
4
|
+
|
|
5
|
+
const app = express()
|
|
6
|
+
|
|
7
|
+
configureApp(app, {
|
|
8
|
+
views: 'templates',
|
|
9
|
+
static: 'public',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
app.use(appContext())
|
|
13
|
+
|
|
14
|
+
// import routes
|
|
15
|
+
const index = require('./routes/index')
|
|
16
|
+
|
|
17
|
+
// set routes
|
|
18
|
+
app.use('/', index)
|
|
19
|
+
|
|
20
|
+
module.exports.entry = turbo.entry(() => app)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
README!
|