@vertesia/create-plugin 0.62.0 → 0.63.0
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/lib/ToolTemplateInit.js
CHANGED
|
@@ -26,11 +26,11 @@ export class ToolTemplateInit extends TemplateInit {
|
|
|
26
26
|
}
|
|
27
27
|
getDevDependencies() {
|
|
28
28
|
return [
|
|
29
|
+
"@hono/vite-dev-server",
|
|
29
30
|
"@types/node",
|
|
30
31
|
"esbuild",
|
|
31
32
|
"typescript",
|
|
32
33
|
"vite",
|
|
33
|
-
"vite-plugin-node",
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
getRuntimeDependencies() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolTemplateInit.js","sourceRoot":"","sources":["../src/ToolTemplateInit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAG9D,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC9C,YAAY,OAAoB;QAC5B,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,OAAO;QACH,OAAO,EAEN,CAAA;IACL,CAAC;IAED,cAAc;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO;YACH,IAAI,EAAE,MAAM,CAAC,WAAW;YACxB,OAAO,EAAE,MAAM,CAAC,cAAc,IAAI,OAAO;YACzC,WAAW,EAAE,MAAM,CAAC,kBAAkB,IAAI,EAAE;YAC5C,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,sBAAsB;YAC7B,KAAK,EAAE;gBACH,KAAK;aACR;YACD,OAAO,EAAE;gBACL,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,KAAK;aACjB;SACJ,CAAC;IACN,CAAC;IAED,kBAAkB;QACd,OAAO;YACH,aAAa;YACb,SAAS;YACT,YAAY;YACZ,MAAM;
|
|
1
|
+
{"version":3,"file":"ToolTemplateInit.js","sourceRoot":"","sources":["../src/ToolTemplateInit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAG9D,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC9C,YAAY,OAAoB;QAC5B,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAED,OAAO;QACH,OAAO,EAEN,CAAA;IACL,CAAC;IAED,cAAc;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO;YACH,IAAI,EAAE,MAAM,CAAC,WAAW;YACxB,OAAO,EAAE,MAAM,CAAC,cAAc,IAAI,OAAO;YACzC,WAAW,EAAE,MAAM,CAAC,kBAAkB,IAAI,EAAE;YAC5C,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,sBAAsB;YAC7B,KAAK,EAAE;gBACH,KAAK;aACR;YACD,OAAO,EAAE;gBACL,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,KAAK;aACjB;SACJ,CAAC;IACN,CAAC;IAED,kBAAkB;QACd,OAAO;YACH,uBAAuB;YACvB,aAAa;YACb,SAAS;YACT,YAAY;YACZ,MAAM;SACT,CAAA;IACL,CAAC;IAED,sBAAsB;QAClB,OAAO;YACH,qBAAqB;YACrB,kBAAkB;YAClB,kBAAkB;YAClB,MAAM;SACT,CAAA;IACL,CAAC;CAEJ"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"type": "node",
|
|
6
|
+
"request": "launch",
|
|
7
|
+
"name": "Debug Tools Server",
|
|
8
|
+
"program": "${workspaceFolder}/node_modules/vite/bin/vite.js",
|
|
9
|
+
"args": [
|
|
10
|
+
"dev"
|
|
11
|
+
],
|
|
12
|
+
"autoAttachChildProcesses": true,
|
|
13
|
+
"smartStep": true,
|
|
14
|
+
"skipFiles": [
|
|
15
|
+
"<node_internals>/**",
|
|
16
|
+
"**/node_modules/**"
|
|
17
|
+
],
|
|
18
|
+
"sourceMaps": true,
|
|
19
|
+
"env": {
|
|
20
|
+
"NODE_ENV": "development"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -5,10 +5,14 @@ const app = new Hono();
|
|
|
5
5
|
|
|
6
6
|
app.post('/', async (c) => {
|
|
7
7
|
const data = await c.req.json();
|
|
8
|
-
const r = await registry.execute(
|
|
8
|
+
const r = await registry.execute(data)
|
|
9
9
|
return c.json({
|
|
10
10
|
response: r
|
|
11
11
|
})
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
app.get('/', (c) => {
|
|
15
|
+
return c.json(registry.getDefinitions())
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default app;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { Tool, ToolFunctionParams } from "@vertesia/agent-sdk";
|
|
2
|
+
|
|
3
|
+
interface WeatherToolParams {
|
|
4
|
+
location: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
export const WeatherTool = {
|
|
3
8
|
name: "weather",
|
|
4
9
|
description: "Get the current weather for a given location.",
|
|
5
|
-
|
|
10
|
+
input_schema: {
|
|
6
11
|
type: "object",
|
|
7
12
|
properties: {
|
|
8
13
|
location: {
|
|
@@ -12,9 +17,9 @@ export const WeatherTool = {
|
|
|
12
17
|
},
|
|
13
18
|
required: ["location"]
|
|
14
19
|
},
|
|
15
|
-
run: async (params: ToolFunctionParams) => {
|
|
16
|
-
const { location } = params;
|
|
20
|
+
run: async (params: ToolFunctionParams<WeatherToolParams>) => {
|
|
21
|
+
const { location } = params.input;
|
|
17
22
|
// Simulate fetching weather data
|
|
18
23
|
return `The current weather in ${location} is sunny with a temperature of 75°F.`;
|
|
19
24
|
}
|
|
20
|
-
} satisfies Tool
|
|
25
|
+
} satisfies Tool<WeatherToolParams>;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import devServer from '@hono/vite-dev-server';
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
plugins: [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
appPath: './src/server.ts',
|
|
9
|
-
exportName: 'app', // default is 'app', you can also export your app as "app" instead of calling listen()
|
|
10
|
-
tsCompiler: 'esbuild',
|
|
6
|
+
devServer({
|
|
7
|
+
entry: 'src/server.ts', // Adjust the path to your server entry file
|
|
11
8
|
}),
|
|
12
9
|
],
|
|
13
|
-
|
|
14
|
-
watch: {
|
|
15
|
-
usePolling: true,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
})
|
|
10
|
+
});
|