@surph_ai/sdk 0.0.27 → 0.0.28

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/cli.js CHANGED
@@ -212,9 +212,10 @@ program.command('manifest')
212
212
  })
213
213
 
214
214
  const { response } = await resp.json()
215
- const updated = { ...manifest, ...response }
215
+ // const updated = { ...manifest, ...response }
216
+ manifest[slug] = response
216
217
 
217
- utils.write('manifest.json', JSON.stringify({[slug]: updated}, null, 2) + '\n')
218
+ utils.write('manifest.json', JSON.stringify(manifest, null, 2) + '\n')
218
219
  console.log(colors.white('\n\nManifest updated. Check manifest.json for changes.\n'))
219
220
  } catch (error) {
220
221
  utils.printError(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surph_ai/sdk",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "./types.d.ts",
@@ -74,8 +74,12 @@ router.get('/test', async (req, res, next) => {
74
74
  throw new Error('No arguments provided.')
75
75
  }
76
76
 
77
- const tools = await loadTool()
78
- const response = await handler(req.query, tools)
77
+ const context = req.query._context || null
78
+ const user = req.query._user || null
79
+ const params = { args: req.query, context, user }
80
+
81
+ const toolRunner = await loadTool()
82
+ const response = await handler(params, toolRunner)
79
83
  res.json({ response })
80
84
  } catch (error) {
81
85
  res.json({
@@ -94,8 +98,8 @@ router.post('/custom', async (req, res, next) => {
94
98
  throw new Error(`Invalid tool ${tool.slug}. Check .env file.`)
95
99
  }
96
100
 
97
- const tools = await loadTool()
98
- const response = await handler({ args, context, user }, tools)
101
+ const toolRunner = await loadTool()
102
+ const response = await handler({ args, context, user }, toolRunner)
99
103
  if (response.error) {
100
104
  throw new Error(response.error);
101
105
  }