@surph_ai/sdk 0.0.12 → 0.0.13
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/deploy/index.js +50 -140
- package/deploy/tool-main.js +19 -0
- package/index.js +97 -34
- package/package.json +4 -5
- package/scaffold/index.js +11 -11
- package/scaffold/tool/package.json +5 -4
- package/scaffold/tool/tools/index.js +1 -1
- package/toolserver/routes/tool.js +18 -16
- package/utils/index.js +0 -1
- package/base/vinely-base/.nvmrc +0 -1
- package/base/vinely-base/README.md +0 -30
- package/base/vinely-base/app.js +0 -5
- package/base/vinely-base/declarations.d.ts +0 -1
- package/base/vinely-base/package.json +0 -103
- package/base/vinely-base/public/css/globals-2.css +0 -3699
- package/base/vinely-base/public/css/globals.css +0 -3695
- package/base/vinely-base/public/js/app.js +0 -1
- package/base/vinely-base/public/js/jquery.js +0 -2
- package/base/vinely-base/scratch.js +0 -21
- package/base/vinely-base/src/client/components/app-sidebar.tsx +0 -59
- package/base/vinely-base/src/client/components/assistant-ui/markdown-text.tsx +0 -153
- package/base/vinely-base/src/client/components/assistant-ui/thread-list.tsx +0 -67
- package/base/vinely-base/src/client/components/assistant-ui/thread.tsx +0 -666
- package/base/vinely-base/src/client/components/assistant-ui/tool-fallback.tsx +0 -44
- package/base/vinely-base/src/client/components/assistant-ui/tooltip-icon-button.tsx +0 -44
- package/base/vinely-base/src/client/components/ui/breadcrumb.tsx +0 -109
- package/base/vinely-base/src/client/components/ui/button.tsx +0 -59
- package/base/vinely-base/src/client/components/ui/input.tsx +0 -21
- package/base/vinely-base/src/client/components/ui/separator.tsx +0 -28
- package/base/vinely-base/src/client/components/ui/sheet.tsx +0 -139
- package/base/vinely-base/src/client/components/ui/sidebar.tsx +0 -726
- package/base/vinely-base/src/client/components/ui/skeleton.tsx +0 -14
- package/base/vinely-base/src/client/components/ui/tooltip.tsx +0 -61
- package/base/vinely-base/src/client/components/vines-sidebar.tsx +0 -182
- package/base/vinely-base/src/client/contexts/SessionContext.tsx +0 -28
- package/base/vinely-base/src/client/contexts/SessionReducer.tsx +0 -32
- package/base/vinely-base/src/client/hooks/use-mobile.ts +0 -19
- package/base/vinely-base/src/client/index.tsx +0 -154
- package/base/vinely-base/src/client/lib/API.ts +0 -155
- package/base/vinely-base/src/client/lib/RPC.ts +0 -49
- package/base/vinely-base/src/client/lib/utils.ts +0 -96
- package/base/vinely-base/src/server/index.ts +0 -63
- package/base/vinely-base/src/server/routes/api.ts +0 -38
- package/base/vinely-base/src/server/routes/chat.ts +0 -133
- package/base/vinely-base/src/server/routes/main.ts +0 -36
- package/base/vinely-base/src/server/routes/mcp.ts +0 -52
- package/base/vinely-base/src/server/routes/rpc.ts +0 -64
- package/base/vinely-base/src/server/routes/thread.ts +0 -44
- package/base/vinely-base/src/server/utils/APIMgr.ts +0 -156
- package/base/vinely-base/src/server/utils/Auth.ts +0 -235
- package/base/vinely-base/src/server/utils/fetchManifest.ts +0 -15
- package/base/vinely-base/src/server/utils/mcp-auth.ts +0 -251
- package/base/vinely-base/tsconfig.json +0 -16
- package/base/vinely-base/views/landing.html +0 -187
- package/base/vinely-base/views/partials/imports.dev.html +0 -3
- package/base/vinely-base/webpack.config.js +0 -112
- package/deploy/Dockerfile +0 -9
- package/utils/Realm.js +0 -60
- package/utils/http.js +0 -22
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import webpack from 'webpack'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
4
|
-
import TerserPlugin from 'terser-webpack-plugin'
|
|
5
|
-
import { fileURLToPath } from 'url'
|
|
6
|
-
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url) // get the resolved path to the file
|
|
8
|
-
const __dirname = path.dirname(__filename) // get the name of the directory
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
entry: {
|
|
12
|
-
app: `./src/client/index.tsx`
|
|
13
|
-
},
|
|
14
|
-
output: {
|
|
15
|
-
path: `${__dirname.replace('webpack', '')}/public/dist`,
|
|
16
|
-
filename: (process.env.NODE_ENV === 'production') ? 'prod/[name].[chunkhash].js' : 'dev/[name].js',
|
|
17
|
-
chunkFilename: (process.env.NODE_ENV === 'production') ? 'prod/[name].[chunkhash].js' : 'dev/[name].js',
|
|
18
|
-
sourceMapFilename: 'dev/[name].map',
|
|
19
|
-
publicPath: `{{{ CDN }}}/dist/`
|
|
20
|
-
},
|
|
21
|
-
devtool: 'inline-source-map',
|
|
22
|
-
module: {
|
|
23
|
-
rules: [
|
|
24
|
-
{
|
|
25
|
-
test: /\.jsx?$/,
|
|
26
|
-
exclude: /node_modules/,
|
|
27
|
-
loader: 'babel-loader'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
test: /\.json$/,
|
|
31
|
-
loader: 'json-loader',
|
|
32
|
-
type: 'javascript/auto'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
test: /\.tsx?$/,
|
|
36
|
-
exclude: /node_modules/,
|
|
37
|
-
// use: 'ts-loader',
|
|
38
|
-
use: [
|
|
39
|
-
{
|
|
40
|
-
loader: 'ts-loader',
|
|
41
|
-
options: {
|
|
42
|
-
transpileOnly: true
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
// TODO: inject loaded CSS URI into templates rather than inject like this
|
|
48
|
-
// {
|
|
49
|
-
// test: /^(?!.*katex.*).*\.(gif|svg|jpg|png|css)$/, // add whatever files you wanna use within this regEx
|
|
50
|
-
// use: ["file-loader"]
|
|
51
|
-
// },
|
|
52
|
-
{
|
|
53
|
-
test: /\.(gif|svg|jpg|png|css)$/, // add whatever files you wanna use within this regEx
|
|
54
|
-
use: ["file-loader"]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
test: /katex.*\.css$/,
|
|
58
|
-
loader: 'file-loader',
|
|
59
|
-
options: {
|
|
60
|
-
name: "[name].css",
|
|
61
|
-
outputPath: "css"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
performance: process.env.NODE_ENV === 'production' ? { hints: false } : {},
|
|
67
|
-
plugins: process.env.NODE_ENV === 'production'
|
|
68
|
-
? [
|
|
69
|
-
new HtmlWebpackPlugin({
|
|
70
|
-
template: `./public/dist/build.html`,
|
|
71
|
-
filename: `../../views/partials/imports.prod.html`,
|
|
72
|
-
inject: 'body'
|
|
73
|
-
}),
|
|
74
|
-
new webpack.DefinePlugin({
|
|
75
|
-
'process.env': {
|
|
76
|
-
NODE_ENV: JSON.stringify('production')
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
: [],
|
|
81
|
-
optimization: process.env.NODE_ENV === 'production'
|
|
82
|
-
? {
|
|
83
|
-
minimize: true,
|
|
84
|
-
minimizer: [new TerserPlugin()],
|
|
85
|
-
splitChunks: {
|
|
86
|
-
cacheGroups: {
|
|
87
|
-
vendor: {
|
|
88
|
-
test: /node_modules/,
|
|
89
|
-
chunks: 'initial',
|
|
90
|
-
name: 'commons',
|
|
91
|
-
enforce: true
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
: {
|
|
97
|
-
minimize: false,
|
|
98
|
-
splitChunks: {
|
|
99
|
-
cacheGroups: {
|
|
100
|
-
vendor: {
|
|
101
|
-
test: /node_modules/,
|
|
102
|
-
chunks: 'initial',
|
|
103
|
-
name: 'commons',
|
|
104
|
-
enforce: true
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
resolve: {
|
|
110
|
-
extensions: ['.js', '.jsx', '.tsx', '.ts'] // add .tsx and .ts as file extensions to be resolved
|
|
111
|
-
}
|
|
112
|
-
}
|
package/deploy/Dockerfile
DELETED
package/utils/Realm.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const axios = require('axios')
|
|
2
|
-
|
|
3
|
-
const CDN = (process.env.ENV === 'dev') ? '' : process.env.CDN
|
|
4
|
-
|
|
5
|
-
const queryParamsToString = (query) => {
|
|
6
|
-
const keys = Object.keys(query)
|
|
7
|
-
const lastIndex = keys.length - 1
|
|
8
|
-
let queryString = ''
|
|
9
|
-
keys.forEach((key, i) => {
|
|
10
|
-
queryString += `${key}=${query[key]}`
|
|
11
|
-
if (i !== lastIndex)
|
|
12
|
-
queryString += '&'
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
return queryString
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const webhooks = {
|
|
19
|
-
rest: 'https://us-east-1.aws.data.mongodb-api.com/app/portal-atlas-extzu/endpoint/rest'
|
|
20
|
-
// rest: 'https://us-east-1.aws.data.mongodb-api.com/app/application-0-zfvva/endpoint/rest',
|
|
21
|
-
// queries: process.env.WEBHOOK,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const restQuery = async (Resource, method = 'get', params = null) => {
|
|
25
|
-
const httpMethod = method.toLowerCase()
|
|
26
|
-
let url = webhooks.rest
|
|
27
|
-
|
|
28
|
-
if (httpMethod === 'get' || httpMethod === 'delete') {
|
|
29
|
-
if (params) {
|
|
30
|
-
const queryString = queryParamsToString(params)
|
|
31
|
-
url = `${url}?${queryString}`
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const request = {
|
|
36
|
-
url,
|
|
37
|
-
method: httpMethod,
|
|
38
|
-
headers: {
|
|
39
|
-
Accept: 'application/json',
|
|
40
|
-
Resource,
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (httpMethod === 'post' || httpMethod === 'put') {
|
|
45
|
-
request.data = params
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const payload = await axios(request)
|
|
49
|
-
if (payload.data.confirmation !== 'success') {
|
|
50
|
-
throw new Error(payload.data.message || 'Something went wrong.')
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const { data } = payload.data
|
|
54
|
-
return data
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
module.exports = {
|
|
58
|
-
webhooks,
|
|
59
|
-
restQuery,
|
|
60
|
-
}
|
package/utils/http.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const axios = require('axios')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
|
|
5
|
-
post: async (url, data) => {
|
|
6
|
-
const { data } = await axios({
|
|
7
|
-
url,
|
|
8
|
-
data,
|
|
9
|
-
method: 'post',
|
|
10
|
-
headers: {
|
|
11
|
-
'Content-Type': 'application/zip'
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
return data
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
get: async () => {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|