@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 +3 -2
- package/package.json +1 -1
- package/toolserver/routes/tool.js +8 -4
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(
|
|
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
|
@@ -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
|
|
78
|
-
const
|
|
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
|
|
98
|
-
const response = await handler({ args, context, user },
|
|
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
|
}
|