@vertesia/tools-sdk 1.3.0 → 1.4.0-dev.20260615.051508Z

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 (271) hide show
  1. package/lib/{types/ActivityCollection.d.ts → ActivityCollection.d.ts} +7 -7
  2. package/lib/ActivityCollection.d.ts.map +1 -0
  3. package/lib/{esm/ActivityCollection.js → ActivityCollection.js} +6 -6
  4. package/lib/ActivityCollection.js.map +1 -0
  5. package/lib/{types/ContentTypesCollection.d.ts → ContentTypesCollection.d.ts} +2 -2
  6. package/lib/ContentTypesCollection.d.ts.map +1 -0
  7. package/lib/{esm/ContentTypesCollection.js → ContentTypesCollection.js} +3 -3
  8. package/lib/ContentTypesCollection.js.map +1 -0
  9. package/lib/{types/InteractionCollection.d.ts → InteractionCollection.d.ts} +2 -2
  10. package/lib/InteractionCollection.d.ts.map +1 -0
  11. package/lib/{esm/InteractionCollection.js → InteractionCollection.js} +3 -3
  12. package/lib/InteractionCollection.js.map +1 -0
  13. package/lib/{types/RenderingTemplateCollection.d.ts → RenderingTemplateCollection.d.ts} +1 -1
  14. package/lib/RenderingTemplateCollection.d.ts.map +1 -0
  15. package/lib/{esm/RenderingTemplateCollection.js → RenderingTemplateCollection.js} +3 -3
  16. package/lib/RenderingTemplateCollection.js.map +1 -0
  17. package/lib/{types/SkillCollection.d.ts → SkillCollection.d.ts} +5 -5
  18. package/lib/SkillCollection.d.ts.map +1 -0
  19. package/lib/{esm/SkillCollection.js → SkillCollection.js} +68 -51
  20. package/lib/SkillCollection.js.map +1 -0
  21. package/lib/{types/ToolCollection.d.ts → ToolCollection.d.ts} +10 -10
  22. package/lib/ToolCollection.d.ts.map +1 -0
  23. package/lib/{esm/ToolCollection.js → ToolCollection.js} +21 -18
  24. package/lib/ToolCollection.js.map +1 -0
  25. package/lib/ToolRegistry.d.ts +22 -0
  26. package/lib/ToolRegistry.d.ts.map +1 -0
  27. package/lib/{esm/ToolRegistry.js → ToolRegistry.js} +6 -36
  28. package/lib/ToolRegistry.js.map +1 -0
  29. package/lib/{types/auth.d.ts → auth.d.ts} +5 -5
  30. package/lib/auth.d.ts.map +1 -0
  31. package/lib/{esm/auth.js → auth.js} +23 -17
  32. package/lib/auth.js.map +1 -0
  33. package/lib/build/validate.d.ts.map +1 -0
  34. package/lib/build/validate.js.map +1 -0
  35. package/lib/copy-assets.d.ts.map +1 -0
  36. package/lib/{esm/copy-assets.js → copy-assets.js} +4 -7
  37. package/lib/copy-assets.js.map +1 -0
  38. package/lib/index.d.ts +16 -0
  39. package/lib/index.d.ts.map +1 -0
  40. package/lib/index.js +15 -0
  41. package/lib/index.js.map +1 -0
  42. package/lib/server/activities.d.ts +4 -0
  43. package/lib/server/activities.d.ts.map +1 -0
  44. package/lib/{esm/server → server}/activities.js +12 -9
  45. package/lib/server/activities.js.map +1 -0
  46. package/lib/server/app-package.d.ts +12 -0
  47. package/lib/server/app-package.d.ts.map +1 -0
  48. package/lib/server/app-package.js +197 -0
  49. package/lib/server/app-package.js.map +1 -0
  50. package/lib/server/content-types.d.ts +4 -0
  51. package/lib/server/content-types.d.ts.map +1 -0
  52. package/lib/server/content-types.js +100 -0
  53. package/lib/server/content-types.js.map +1 -0
  54. package/lib/server/dashboards.d.ts +4 -0
  55. package/lib/server/dashboards.d.ts.map +1 -0
  56. package/lib/server/dashboards.js +25 -0
  57. package/lib/server/dashboards.js.map +1 -0
  58. package/lib/server/interactions.d.ts +4 -0
  59. package/lib/server/interactions.d.ts.map +1 -0
  60. package/lib/{esm/server → server}/interactions.js +16 -16
  61. package/lib/server/interactions.js.map +1 -0
  62. package/lib/server/mcp.d.ts +4 -0
  63. package/lib/server/mcp.d.ts.map +1 -0
  64. package/lib/{esm/server → server}/mcp.js +5 -4
  65. package/lib/server/mcp.js.map +1 -0
  66. package/lib/server/processes.d.ts +4 -0
  67. package/lib/server/processes.d.ts.map +1 -0
  68. package/lib/server/processes.js +26 -0
  69. package/lib/server/processes.js.map +1 -0
  70. package/lib/server/site.d.ts +4 -0
  71. package/lib/server/site.d.ts.map +1 -0
  72. package/lib/{esm/server → server}/site.js +4 -2
  73. package/lib/server/site.js.map +1 -0
  74. package/lib/server/skills.d.ts +4 -0
  75. package/lib/server/skills.d.ts.map +1 -0
  76. package/lib/{esm/server → server}/skills.js +14 -12
  77. package/lib/server/skills.js.map +1 -0
  78. package/lib/server/templates.d.ts +4 -0
  79. package/lib/server/templates.d.ts.map +1 -0
  80. package/lib/{esm/server → server}/templates.js +10 -10
  81. package/lib/server/templates.js.map +1 -0
  82. package/lib/server/tools.d.ts +4 -0
  83. package/lib/server/tools.d.ts.map +1 -0
  84. package/lib/{esm/server → server}/tools.js +7 -9
  85. package/lib/server/tools.js.map +1 -0
  86. package/lib/{types/server → server}/types.d.ts +21 -16
  87. package/lib/server/types.d.ts.map +1 -0
  88. package/lib/{cjs → server}/types.js.map +1 -1
  89. package/lib/server/widgets.d.ts +4 -0
  90. package/lib/server/widgets.d.ts.map +1 -0
  91. package/lib/server/widgets.js.map +1 -0
  92. package/lib/{types/server.d.ts → server.d.ts} +3 -3
  93. package/lib/server.d.ts.map +1 -0
  94. package/lib/{esm/server.js → server.js} +28 -22
  95. package/lib/server.js.map +1 -0
  96. package/lib/site/styles.d.ts.map +1 -0
  97. package/lib/{esm/site → site}/styles.js.map +1 -1
  98. package/lib/{types/site → site}/templates.d.ts +9 -9
  99. package/lib/site/templates.d.ts.map +1 -0
  100. package/lib/{esm/site → site}/templates.js +152 -98
  101. package/lib/site/templates.js.map +1 -0
  102. package/lib/{types/types.d.ts → types.d.ts} +29 -16
  103. package/lib/types.d.ts.map +1 -0
  104. package/lib/types.js.map +1 -0
  105. package/lib/utils.d.ts.map +1 -0
  106. package/lib/{esm/utils.js → utils.js} +11 -5
  107. package/lib/utils.js.map +1 -0
  108. package/package.json +20 -22
  109. package/src/ActivityCollection.test.ts +60 -59
  110. package/src/ActivityCollection.ts +27 -20
  111. package/src/ContentTypesCollection.ts +6 -9
  112. package/src/InteractionCollection.ts +6 -8
  113. package/src/RenderingTemplateCollection.ts +49 -51
  114. package/src/SkillCollection.ts +91 -72
  115. package/src/ToolCollection.ts +52 -43
  116. package/src/ToolRegistry.ts +20 -50
  117. package/src/auth.ts +35 -27
  118. package/src/copy-assets.ts +5 -12
  119. package/src/index.ts +15 -15
  120. package/src/server/activities.test.ts +70 -67
  121. package/src/server/activities.ts +17 -13
  122. package/src/server/app-package.test.ts +140 -0
  123. package/src/server/app-package.ts +115 -52
  124. package/src/server/content-types.test.ts +64 -0
  125. package/src/server/content-types.ts +53 -25
  126. package/src/server/dashboards.ts +31 -0
  127. package/src/server/interactions.ts +29 -28
  128. package/src/server/mcp.ts +16 -16
  129. package/src/server/processes.ts +35 -0
  130. package/src/server/site.ts +7 -15
  131. package/src/server/skills.ts +19 -18
  132. package/src/server/templates.ts +82 -80
  133. package/src/server/tools.ts +12 -16
  134. package/src/server/types.ts +29 -20
  135. package/src/server/widgets.ts +5 -9
  136. package/src/server.ts +55 -47
  137. package/src/site/styles.ts +1 -1
  138. package/src/site/templates.ts +259 -157
  139. package/src/types.ts +55 -31
  140. package/src/utils.ts +11 -6
  141. package/lib/cjs/ActivityCollection.js +0 -93
  142. package/lib/cjs/ActivityCollection.js.map +0 -1
  143. package/lib/cjs/ContentTypesCollection.js +0 -43
  144. package/lib/cjs/ContentTypesCollection.js.map +0 -1
  145. package/lib/cjs/InteractionCollection.js +0 -43
  146. package/lib/cjs/InteractionCollection.js.map +0 -1
  147. package/lib/cjs/RenderingTemplateCollection.js +0 -43
  148. package/lib/cjs/RenderingTemplateCollection.js.map +0 -1
  149. package/lib/cjs/SkillCollection.js +0 -384
  150. package/lib/cjs/SkillCollection.js.map +0 -1
  151. package/lib/cjs/ToolCollection.js +0 -221
  152. package/lib/cjs/ToolCollection.js.map +0 -1
  153. package/lib/cjs/ToolRegistry.js +0 -95
  154. package/lib/cjs/ToolRegistry.js.map +0 -1
  155. package/lib/cjs/auth.js +0 -131
  156. package/lib/cjs/auth.js.map +0 -1
  157. package/lib/cjs/build/validate.js +0 -7
  158. package/lib/cjs/build/validate.js.map +0 -1
  159. package/lib/cjs/copy-assets.js +0 -84
  160. package/lib/cjs/copy-assets.js.map +0 -1
  161. package/lib/cjs/index.js +0 -34
  162. package/lib/cjs/index.js.map +0 -1
  163. package/lib/cjs/package.json +0 -3
  164. package/lib/cjs/server/activities.js +0 -103
  165. package/lib/cjs/server/activities.js.map +0 -1
  166. package/lib/cjs/server/app-package.js +0 -154
  167. package/lib/cjs/server/app-package.js.map +0 -1
  168. package/lib/cjs/server/content-types.js +0 -73
  169. package/lib/cjs/server/content-types.js.map +0 -1
  170. package/lib/cjs/server/interactions.js +0 -101
  171. package/lib/cjs/server/interactions.js.map +0 -1
  172. package/lib/cjs/server/mcp.js +0 -45
  173. package/lib/cjs/server/mcp.js.map +0 -1
  174. package/lib/cjs/server/site.js +0 -48
  175. package/lib/cjs/server/site.js.map +0 -1
  176. package/lib/cjs/server/skills.js +0 -124
  177. package/lib/cjs/server/skills.js.map +0 -1
  178. package/lib/cjs/server/templates.js +0 -67
  179. package/lib/cjs/server/templates.js.map +0 -1
  180. package/lib/cjs/server/tools.js +0 -87
  181. package/lib/cjs/server/tools.js.map +0 -1
  182. package/lib/cjs/server/types.js +0 -3
  183. package/lib/cjs/server/types.js.map +0 -1
  184. package/lib/cjs/server/widgets.js +0 -27
  185. package/lib/cjs/server/widgets.js.map +0 -1
  186. package/lib/cjs/server.js +0 -142
  187. package/lib/cjs/server.js.map +0 -1
  188. package/lib/cjs/site/styles.js +0 -692
  189. package/lib/cjs/site/styles.js.map +0 -1
  190. package/lib/cjs/site/templates.js +0 -1320
  191. package/lib/cjs/site/templates.js.map +0 -1
  192. package/lib/cjs/types.js +0 -3
  193. package/lib/cjs/utils.js +0 -44
  194. package/lib/cjs/utils.js.map +0 -1
  195. package/lib/esm/ActivityCollection.js.map +0 -1
  196. package/lib/esm/ContentTypesCollection.js.map +0 -1
  197. package/lib/esm/InteractionCollection.js.map +0 -1
  198. package/lib/esm/RenderingTemplateCollection.js.map +0 -1
  199. package/lib/esm/SkillCollection.js.map +0 -1
  200. package/lib/esm/ToolCollection.js.map +0 -1
  201. package/lib/esm/ToolRegistry.js.map +0 -1
  202. package/lib/esm/auth.js.map +0 -1
  203. package/lib/esm/build/validate.js.map +0 -1
  204. package/lib/esm/copy-assets.js.map +0 -1
  205. package/lib/esm/index.js +0 -14
  206. package/lib/esm/index.js.map +0 -1
  207. package/lib/esm/server/activities.js.map +0 -1
  208. package/lib/esm/server/app-package.js +0 -151
  209. package/lib/esm/server/app-package.js.map +0 -1
  210. package/lib/esm/server/content-types.js +0 -70
  211. package/lib/esm/server/content-types.js.map +0 -1
  212. package/lib/esm/server/interactions.js.map +0 -1
  213. package/lib/esm/server/mcp.js.map +0 -1
  214. package/lib/esm/server/site.js.map +0 -1
  215. package/lib/esm/server/skills.js.map +0 -1
  216. package/lib/esm/server/templates.js.map +0 -1
  217. package/lib/esm/server/tools.js.map +0 -1
  218. package/lib/esm/server/types.js.map +0 -1
  219. package/lib/esm/server/widgets.js.map +0 -1
  220. package/lib/esm/server.js.map +0 -1
  221. package/lib/esm/site/templates.js.map +0 -1
  222. package/lib/esm/types.js.map +0 -1
  223. package/lib/esm/utils.js.map +0 -1
  224. package/lib/types/ActivityCollection.d.ts.map +0 -1
  225. package/lib/types/ContentTypesCollection.d.ts.map +0 -1
  226. package/lib/types/InteractionCollection.d.ts.map +0 -1
  227. package/lib/types/RenderingTemplateCollection.d.ts.map +0 -1
  228. package/lib/types/SkillCollection.d.ts.map +0 -1
  229. package/lib/types/ToolCollection.d.ts.map +0 -1
  230. package/lib/types/ToolRegistry.d.ts +0 -22
  231. package/lib/types/ToolRegistry.d.ts.map +0 -1
  232. package/lib/types/auth.d.ts.map +0 -1
  233. package/lib/types/build/validate.d.ts.map +0 -1
  234. package/lib/types/copy-assets.d.ts.map +0 -1
  235. package/lib/types/index.d.ts +0 -14
  236. package/lib/types/index.d.ts.map +0 -1
  237. package/lib/types/server/activities.d.ts +0 -4
  238. package/lib/types/server/activities.d.ts.map +0 -1
  239. package/lib/types/server/app-package.d.ts +0 -4
  240. package/lib/types/server/app-package.d.ts.map +0 -1
  241. package/lib/types/server/content-types.d.ts +0 -4
  242. package/lib/types/server/content-types.d.ts.map +0 -1
  243. package/lib/types/server/interactions.d.ts +0 -4
  244. package/lib/types/server/interactions.d.ts.map +0 -1
  245. package/lib/types/server/mcp.d.ts +0 -4
  246. package/lib/types/server/mcp.d.ts.map +0 -1
  247. package/lib/types/server/site.d.ts +0 -4
  248. package/lib/types/server/site.d.ts.map +0 -1
  249. package/lib/types/server/skills.d.ts +0 -4
  250. package/lib/types/server/skills.d.ts.map +0 -1
  251. package/lib/types/server/templates.d.ts +0 -4
  252. package/lib/types/server/templates.d.ts.map +0 -1
  253. package/lib/types/server/tools.d.ts +0 -4
  254. package/lib/types/server/tools.d.ts.map +0 -1
  255. package/lib/types/server/types.d.ts.map +0 -1
  256. package/lib/types/server/widgets.d.ts +0 -4
  257. package/lib/types/server/widgets.d.ts.map +0 -1
  258. package/lib/types/server.d.ts.map +0 -1
  259. package/lib/types/site/styles.d.ts.map +0 -1
  260. package/lib/types/site/templates.d.ts.map +0 -1
  261. package/lib/types/types.d.ts.map +0 -1
  262. package/lib/types/utils.d.ts.map +0 -1
  263. /package/lib/{types/build → build}/validate.d.ts +0 -0
  264. /package/lib/{esm/build → build}/validate.js +0 -0
  265. /package/lib/{types/copy-assets.d.ts → copy-assets.d.ts} +0 -0
  266. /package/lib/{esm/server → server}/types.js +0 -0
  267. /package/lib/{esm/server → server}/widgets.js +0 -0
  268. /package/lib/{types/site → site}/styles.d.ts +0 -0
  269. /package/lib/{esm/site → site}/styles.js +0 -0
  270. /package/lib/{esm/types.js → types.js} +0 -0
  271. /package/lib/{types/utils.d.ts → utils.d.ts} +0 -0
@@ -1,20 +1,26 @@
1
- import { Context } from "hono";
2
- import { ActivityCollection } from "../ActivityCollection.js";
3
- import { InteractionCollection } from "../InteractionCollection.js";
4
- import { SkillCollection } from "../SkillCollection.js";
5
- import { RenderingTemplateCollection } from "../RenderingTemplateCollection.js";
6
- import { ToolCollection } from "../ToolCollection.js";
7
- import { ToolExecutionPayload } from "../types.js";
8
- import { JSONSchema } from "@llumiverse/common";
9
- import { AppUIConfig, ProjectConfiguration } from "@vertesia/common";
10
- import { ContentTypesCollection } from "../ContentTypesCollection.js";
1
+ import type { JSONSchema } from '@llumiverse/common';
2
+ import type {
3
+ AppDashboardDefinition,
4
+ AppUIConfig,
5
+ InCodeProcessDefinition,
6
+ ProjectConfiguration,
7
+ } from '@vertesia/common';
8
+ import type { Context } from 'hono';
9
+ import type { ActivityCollection } from '../ActivityCollection.js';
10
+ import type { AuthSession } from '../auth.js';
11
+ import type { ContentTypesCollection } from '../ContentTypesCollection.js';
12
+ import type { InteractionCollection } from '../InteractionCollection.js';
13
+ import type { RenderingTemplateCollection } from '../RenderingTemplateCollection.js';
14
+ import type { SkillCollection } from '../SkillCollection.js';
15
+ import type { ToolCollection } from '../ToolCollection.js';
16
+ import type { MCPConnectionDetails, ToolExecutionPayload } from '../types.js';
11
17
 
12
18
  /**
13
19
  * Extended context with parsed payload for tool/skill execution
14
20
  */
15
21
  export interface ToolContext extends Context {
16
22
  /** The parsed request payload */
17
- payload?: ToolExecutionPayload<any>;
23
+ payload?: ToolExecutionPayload;
18
24
  /** The tool_use.id from the payload */
19
25
  toolUseId?: string;
20
26
  /** The tool_use.tool_name from the payload */
@@ -27,11 +33,7 @@ export interface ToolContext extends Context {
27
33
  export interface MCPProviderConfig {
28
34
  name: string;
29
35
  description?: string;
30
- createMCPConnection: (session: any, config: Record<string, any>) => Promise<{
31
- name: string;
32
- url: string;
33
- token: string;
34
- }>;
36
+ createMCPConnection: (session: AuthSession, config: Record<string, unknown>) => Promise<MCPConnectionDetails>;
35
37
  }
36
38
 
37
39
  /**
@@ -62,6 +64,14 @@ export interface ToolServerConfig {
62
64
  * Content type collections to expose
63
65
  */
64
66
  types?: ContentTypesCollection[];
67
+ /**
68
+ * Process definitions to expose as app-contributed processes.
69
+ */
70
+ processes?: InCodeProcessDefinition[];
71
+ /**
72
+ * Dashboard definitions to expose as app-contributed dashboards.
73
+ */
74
+ dashboards?: AppDashboardDefinition[];
65
75
  /**
66
76
  * Skill collections to expose
67
77
  */
@@ -95,11 +105,10 @@ export interface ToolServerConfig {
95
105
  hideUILinks?: boolean;
96
106
 
97
107
  /**
98
- * If a filter is provided, it will be called with the project configuration when requesting tool definitions, and can be used to filter which tools are returned based on the project configuration.
108
+ * If a filter is provided, it will be called with the project configuration when requesting tool definitions, and can be used to filter which tools are returned based on the project configuration.
99
109
  * This allows for dynamic enabling/disabling of tools based on project settings.
100
- * @param projectConfig
101
- * @returns
110
+ * @param projectConfig
111
+ * @returns
102
112
  */
103
113
  toolFilter?: (projectConfig: ProjectConfiguration) => boolean;
104
114
  }
105
-
@@ -1,10 +1,8 @@
1
- import { AppWidgetInfo } from "@vertesia/common";
2
- import { Hono } from "hono";
3
- import { ToolServerConfig } from "./types.js";
4
-
1
+ import type { AppWidgetInfo } from '@vertesia/common';
2
+ import type { Hono } from 'hono';
3
+ import type { ToolServerConfig } from './types.js';
5
4
 
6
5
  export function createWidgetsRoute(app: Hono, basePath: string, config: ToolServerConfig) {
7
-
8
6
  const { skills = [] } = config;
9
7
 
10
8
  // GET /api/widgets - Returns all widgets from all skill collections
@@ -19,7 +17,7 @@ export function createWidgetsRoute(app: Hono, basePath: string, config: ToolServ
19
17
  collection: coll.name,
20
18
  skill: widget.skill,
21
19
  url: `${url.origin}/widgets/${widget.name}.js`,
22
- }
20
+ };
23
21
  }
24
22
  }
25
23
 
@@ -28,7 +26,5 @@ export function createWidgetsRoute(app: Hono, basePath: string, config: ToolServ
28
26
  description: 'All available widgets across all skill collections',
29
27
  widgets,
30
28
  });
31
-
32
29
  });
33
-
34
- }
30
+ }
package/src/server.ts CHANGED
@@ -1,19 +1,21 @@
1
- import { Context, Hono } from "hono";
2
- import { cors } from "hono/cors";
3
- import { HTTPException } from "hono/http-exception";
4
- import { z } from "zod";
5
- import { createActivitiesRoute } from "./server/activities.js";
6
- import { createInteractionsRoute } from "./server/interactions.js";
7
- import { createMcpRoute } from "./server/mcp.js";
8
- import { createSiteRoute } from "./server/site.js";
9
- import { createSkillsRoute } from "./server/skills.js";
10
- import { createToolsRoute } from "./server/tools.js";
11
- import { ToolContext, ToolServerConfig } from "./server/types.js";
12
- import { ToolExecutionPayload } from "./types.js";
13
- import { createTemplatesRoute } from "./server/templates.js";
14
- import { createWidgetsRoute } from "./server/widgets.js";
15
- import { createPackageRoute } from "./server/app-package.js";
16
- import { createContentTypesRoute } from "./server/content-types.js";
1
+ import { type Context, Hono } from 'hono';
2
+ import { cors } from 'hono/cors';
3
+ import { HTTPException } from 'hono/http-exception';
4
+ import { z } from 'zod';
5
+ import { createActivitiesRoute } from './server/activities.js';
6
+ import { createPackageRoute } from './server/app-package.js';
7
+ import { createContentTypesRoute } from './server/content-types.js';
8
+ import { createDashboardsRoute } from './server/dashboards.js';
9
+ import { createInteractionsRoute } from './server/interactions.js';
10
+ import { createMcpRoute } from './server/mcp.js';
11
+ import { createProcessesRoute } from './server/processes.js';
12
+ import { createSiteRoute } from './server/site.js';
13
+ import { createSkillsRoute } from './server/skills.js';
14
+ import { createTemplatesRoute } from './server/templates.js';
15
+ import { createToolsRoute } from './server/tools.js';
16
+ import type { ToolContext, ToolServerConfig } from './server/types.js';
17
+ import { createWidgetsRoute } from './server/widgets.js';
18
+ import type { ToolExecutionPayload } from './types.js';
17
19
 
18
20
  // Schema for tool execution payload
19
21
  const ToolExecutionPayloadSchema = z.object({
@@ -25,8 +27,6 @@ const ToolExecutionPayloadSchema = z.object({
25
27
  metadata: z.record(z.string(), z.any()).optional(),
26
28
  });
27
29
 
28
-
29
-
30
30
  /**
31
31
  * Create a Hono server for tools, interactions, and skills.
32
32
  *
@@ -50,6 +50,7 @@ export function createToolServer(config: ToolServerConfig): Hono {
50
50
  skills = [],
51
51
  templates = [],
52
52
  activities = [],
53
+ dashboards = [],
53
54
  mcpProviders = [],
54
55
  disableHtml = false,
55
56
  } = config;
@@ -68,7 +69,7 @@ export function createToolServer(config: ToolServerConfig): Hono {
68
69
  const body = JSON.parse(text);
69
70
  const result = ToolExecutionPayloadSchema.safeParse(body);
70
71
  if (result.success) {
71
- ctx.payload = result.data as ToolExecutionPayload<any>;
72
+ ctx.payload = result.data as ToolExecutionPayload;
72
73
  ctx.toolUseId = result.data.tool_use.id;
73
74
  ctx.toolName = result.data.tool_use.tool_name;
74
75
  }
@@ -90,23 +91,24 @@ export function createToolServer(config: ToolServerConfig): Hono {
90
91
  app.get(prefix, (c) => {
91
92
  // Skills are exposed as tools, so include them in the tools list
92
93
  const allToolEndpoints = [
93
- ...tools.map(col => `${prefix}/tools/${col.name}`),
94
- ...skills.map(col => `${prefix}/skills/${col.name}`),
94
+ ...tools.map((col) => `${prefix}/tools/${col.name}`),
95
+ ...skills.map((col) => `${prefix}/skills/${col.name}`),
95
96
  ];
96
97
  return c.json({
97
98
  message: 'Vertesia Tools API',
98
99
  version: '1.0.0',
99
100
  endpoints: {
100
101
  tools: allToolEndpoints,
101
- interactions: interactions.map(col => `${prefix}/interactions/${col.name}`),
102
- templates: templates.map(col => `${prefix}/templates/${col.name}`),
103
- activities: activities.map(col => `${prefix}/activities/${col.name}`),
104
- mcp: mcpProviders.map(p => `${prefix}/mcp/${p.name}`),
105
- }
102
+ interactions: interactions.map((col) => `${prefix}/interactions/${col.name}`),
103
+ templates: templates.map((col) => `${prefix}/templates/${col.name}`),
104
+ processes: `${prefix}/processes`,
105
+ dashboards: dashboards.length > 0 ? `${prefix}/dashboards` : undefined,
106
+ activities: activities.map((col) => `${prefix}/activities/${col.name}`),
107
+ mcp: mcpProviders.map((p) => `${prefix}/mcp/${p.name}`),
108
+ },
106
109
  });
107
110
  });
108
111
 
109
-
110
112
  createPackageRoute(app, `${prefix}/package`, config);
111
113
  createToolsRoute(app, `${prefix}/tools`, config);
112
114
  createSkillsRoute(app, `${prefix}/skills`, config);
@@ -115,9 +117,10 @@ export function createToolServer(config: ToolServerConfig): Hono {
115
117
  createInteractionsRoute(app, `${prefix}/interactions`, config);
116
118
  createTemplatesRoute(app, `${prefix}/templates`, config);
117
119
  createContentTypesRoute(app, `${prefix}/types`, config);
120
+ createProcessesRoute(app, `${prefix}/processes`, config);
121
+ createDashboardsRoute(app, `${prefix}/dashboards`, config);
118
122
  createMcpRoute(app, `${prefix}/mcp`, config);
119
123
 
120
-
121
124
  // Global error handler - returns ToolExecutionResponseError format
122
125
  app.onError((err, c) => {
123
126
  const ctx = c as unknown as ToolContext;
@@ -128,40 +131,46 @@ export function createToolServer(config: ToolServerConfig): Hono {
128
131
  console.error('Uncaught Error:', err);
129
132
  }
130
133
 
131
- return c.json({
132
- tool_use_id: ctx.toolUseId || 'unknown',
134
+ return c.json(
135
+ {
136
+ tool_use_id: ctx.toolUseId || 'unknown',
137
+ status,
138
+ error: errorMessage,
139
+ data: ctx.toolName ? { tool_name: ctx.toolName } : undefined,
140
+ },
133
141
  status,
134
- error: errorMessage,
135
- data: ctx.toolName ? { tool_name: ctx.toolName } : undefined,
136
- }, status);
142
+ );
137
143
  });
138
144
 
139
145
  // Not found handler - returns ToolExecutionResponseError format
140
146
  app.notFound((c) => {
141
147
  const ctx = c as unknown as ToolContext;
142
- return c.json({
143
- tool_use_id: ctx.toolUseId || 'unknown',
144
- status: 404,
145
- error: `Not found: ${c.req.method} ${c.req.path}`,
146
- data: ctx.toolName ? { tool_name: ctx.toolName } : undefined,
147
- }, 404);
148
+ return c.json(
149
+ {
150
+ tool_use_id: ctx.toolUseId || 'unknown',
151
+ status: 404,
152
+ error: `Not found: ${c.req.method} ${c.req.path}`,
153
+ data: ctx.toolName ? { tool_name: ctx.toolName } : undefined,
154
+ },
155
+ 404,
156
+ );
148
157
  });
149
158
 
150
159
  return app;
151
160
  }
152
161
 
153
-
154
-
155
162
  // ================== Server Utilities ==================
156
163
 
157
164
  /**
158
165
  * Simple development server with static fimesale handling
159
- *
160
- * @deprecated Use tools server template
166
+ *
167
+ * @deprecated Use tools server template
161
168
  */
162
- export function createDevServer(config: ToolServerConfig & {
163
- staticHandler?: (c: Context, next: () => Promise<void>) => Promise<Response | void>;
164
- }): Hono {
169
+ export function createDevServer(
170
+ config: ToolServerConfig & {
171
+ staticHandler?: (c: Context, next: () => Promise<void>) => Promise<Response | undefined>;
172
+ },
173
+ ): Hono {
165
174
  const app = createToolServer(config);
166
175
 
167
176
  if (config.staticHandler) {
@@ -170,4 +179,3 @@ export function createDevServer(config: ToolServerConfig & {
170
179
 
171
180
  return app;
172
181
  }
173
-
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared CSS styles for the tools server HTML pages
3
3
  */
4
- export const baseStyles = /*css*/`
4
+ export const baseStyles = /*css*/ `
5
5
  :root {
6
6
  color-scheme: light dark;
7
7
  }