@surph_ai/sdk 0.0.10 → 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.
Files changed (60) hide show
  1. package/deploy/index.js +50 -140
  2. package/deploy/tool-main.js +19 -0
  3. package/index.js +97 -34
  4. package/package.json +4 -5
  5. package/scaffold/index.js +24 -4
  6. package/scaffold/tool/package.json +6 -11
  7. package/scaffold/tool/tools/index.js +1 -1
  8. package/toolserver/chat.js +25 -4
  9. package/toolserver/routes/tool.js +18 -16
  10. package/utils/index.js +0 -1
  11. package/base/vinely-base/.nvmrc +0 -1
  12. package/base/vinely-base/README.md +0 -30
  13. package/base/vinely-base/app.js +0 -5
  14. package/base/vinely-base/declarations.d.ts +0 -1
  15. package/base/vinely-base/package.json +0 -103
  16. package/base/vinely-base/public/css/globals-2.css +0 -3699
  17. package/base/vinely-base/public/css/globals.css +0 -3695
  18. package/base/vinely-base/public/js/app.js +0 -1
  19. package/base/vinely-base/public/js/jquery.js +0 -2
  20. package/base/vinely-base/scratch.js +0 -21
  21. package/base/vinely-base/src/client/components/app-sidebar.tsx +0 -59
  22. package/base/vinely-base/src/client/components/assistant-ui/markdown-text.tsx +0 -153
  23. package/base/vinely-base/src/client/components/assistant-ui/thread-list.tsx +0 -67
  24. package/base/vinely-base/src/client/components/assistant-ui/thread.tsx +0 -666
  25. package/base/vinely-base/src/client/components/assistant-ui/tool-fallback.tsx +0 -44
  26. package/base/vinely-base/src/client/components/assistant-ui/tooltip-icon-button.tsx +0 -44
  27. package/base/vinely-base/src/client/components/ui/breadcrumb.tsx +0 -109
  28. package/base/vinely-base/src/client/components/ui/button.tsx +0 -59
  29. package/base/vinely-base/src/client/components/ui/input.tsx +0 -21
  30. package/base/vinely-base/src/client/components/ui/separator.tsx +0 -28
  31. package/base/vinely-base/src/client/components/ui/sheet.tsx +0 -139
  32. package/base/vinely-base/src/client/components/ui/sidebar.tsx +0 -726
  33. package/base/vinely-base/src/client/components/ui/skeleton.tsx +0 -14
  34. package/base/vinely-base/src/client/components/ui/tooltip.tsx +0 -61
  35. package/base/vinely-base/src/client/components/vines-sidebar.tsx +0 -182
  36. package/base/vinely-base/src/client/contexts/SessionContext.tsx +0 -28
  37. package/base/vinely-base/src/client/contexts/SessionReducer.tsx +0 -32
  38. package/base/vinely-base/src/client/hooks/use-mobile.ts +0 -19
  39. package/base/vinely-base/src/client/index.tsx +0 -154
  40. package/base/vinely-base/src/client/lib/API.ts +0 -155
  41. package/base/vinely-base/src/client/lib/RPC.ts +0 -49
  42. package/base/vinely-base/src/client/lib/utils.ts +0 -96
  43. package/base/vinely-base/src/server/index.ts +0 -63
  44. package/base/vinely-base/src/server/routes/api.ts +0 -38
  45. package/base/vinely-base/src/server/routes/chat.ts +0 -133
  46. package/base/vinely-base/src/server/routes/main.ts +0 -36
  47. package/base/vinely-base/src/server/routes/mcp.ts +0 -52
  48. package/base/vinely-base/src/server/routes/rpc.ts +0 -64
  49. package/base/vinely-base/src/server/routes/thread.ts +0 -44
  50. package/base/vinely-base/src/server/utils/APIMgr.ts +0 -156
  51. package/base/vinely-base/src/server/utils/Auth.ts +0 -235
  52. package/base/vinely-base/src/server/utils/fetchManifest.ts +0 -15
  53. package/base/vinely-base/src/server/utils/mcp-auth.ts +0 -251
  54. package/base/vinely-base/tsconfig.json +0 -16
  55. package/base/vinely-base/views/landing.html +0 -187
  56. package/base/vinely-base/views/partials/imports.dev.html +0 -3
  57. package/base/vinely-base/webpack.config.js +0 -112
  58. package/deploy/Dockerfile +0 -9
  59. package/utils/Realm.js +0 -60
  60. package/utils/http.js +0 -22
@@ -12,10 +12,15 @@ const handler = async (args, tool) => {
12
12
  } catch (error) {
13
13
  errorMsg = error instanceof Error ? error.message : String(error)
14
14
  } finally {
15
- return {
16
- success: errorMsg === null ? true : false,
17
- payload
18
- }
15
+ const resp = { success: errorMsg === null ? true : false }
16
+
17
+ if (payload)
18
+ resp.payload = payload
19
+
20
+ if (errorMsg !== null)
21
+ resp.error = errorMsg
22
+
23
+ return resp
19
24
  }
20
25
  }
21
26
 
@@ -34,12 +39,12 @@ router.get('/', async (req, res, next) => {
34
39
 
35
40
  router.get('/:tool', async (req, res, next) => {
36
41
  try {
37
- const tool = tools[req.params.tool]
38
- if (!tool) {
39
- throw new Error(`Tool ${req.params.tool} not found.`)
40
- }
42
+ // const tool = tools[req.params.tool]
43
+ // if (!tool) {
44
+ // throw new Error(`Tool ${req.params.tool} not found.`)
45
+ // }
41
46
 
42
- const response = await handler(req.query, tool)
47
+ const response = await handler(req.query, tools)
43
48
  res.json({ response })
44
49
  } catch (error) {
45
50
  res.json({
@@ -53,19 +58,16 @@ router.get('/:tool', async (req, res, next) => {
53
58
 
54
59
  router.post('/custom', async (req, res, next) => {
55
60
  // console.log('TOOL CALL: ' + JSON.stringify(req.body))
56
- // {"name":"youtube-transcript","args":{"video":"m7kw0AhrMvQ"},"tool":{"name":"youtube-transcript","slug":"y2script","type":"custom","description":"Fetch the plain-text transcript (spoken words) of a YouTube video. Use this whenever the user asks about, quotes from, summarizes, or wants to search inside the content of a YouTube video — including questions like \"what does this video say about X\", \"summarize this video\", \"pull the transcript\", or when the user pastes a YouTube URL and expects you to know its contents. Do NOT use this for general video metadata (title, channel, view count) or for non-YouTube videos.","parameters":{"type":"object","properties":{"video":{"type":"string","description":"The YouTube video to transcribe. Accepts either a full URL (e.g. \"https://www.youtube.com/watch?v=EwusdkKUlwI\", \"https://youtu.be/EwusdkKUlwI\") or the bare 11-character video id (e.g. \"EwusdkKUlwI\"). Extract this from the user's message when they paste a link."}},"required":["video"]}},"user":{"id":"6a3d402f0817076e079e7398","username":"dkwon"}}
57
-
58
61
  try {
59
62
  const { name, args, tool, user = null } = req.body;
60
- console.log('TOOL CALL: ' + name)
63
+ // console.log('TOOL CALL: ' + name)
61
64
  // console.log('TOOL ARGS: ' + JSON.stringify(args))
62
65
 
63
- const _tool = tools[tool.slug]
64
- if (!_tool) {
65
- throw new Error(`Tool ${tool.name} not found.`)
66
+ if (process.env.SURPH_TOOL !== tool.slug) {
67
+ throw new Error(`Invalid tool ${tool.slug}. Check .env file.`)
66
68
  }
67
69
 
68
- const response = await handler(args, _tool)
70
+ const response = await handler(args, tools)
69
71
  // console.log('TOOL RESP: ' + JSON.stringify(response))
70
72
  res.json({ response })
71
73
  } catch (error) {
package/utils/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const fs = require('fs')
2
2
  const colors = require('colors/safe')
3
- // const superagent = require('superagent')
4
3
  const dotenv = require('dotenv')
5
4
  const MODE_0666 = parseInt('0666', 8)
6
5
 
@@ -1 +0,0 @@
1
- lts/jod
@@ -1,30 +0,0 @@
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!
@@ -1,5 +0,0 @@
1
- import turbo from '@turbo360/turbo-sdk'
2
- import server from './build/server/index.js'
3
-
4
- const entry = turbo.entry(() => server)
5
- export { entry }
@@ -1 +0,0 @@
1
- declare module '@turbo360/turbo-sdk';
@@ -1,103 +0,0 @@
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
- }