@vertesia/tools-sdk 0.82.0 → 0.82.2

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 (80) hide show
  1. package/lib/cjs/InteractionCollection.js +164 -0
  2. package/lib/cjs/InteractionCollection.js.map +1 -0
  3. package/lib/cjs/SkillCollection.js +318 -0
  4. package/lib/cjs/SkillCollection.js.map +1 -0
  5. package/lib/cjs/ToolCollection.js +192 -0
  6. package/lib/cjs/ToolCollection.js.map +1 -0
  7. package/lib/cjs/ToolRegistry.js +44 -0
  8. package/lib/cjs/ToolRegistry.js.map +1 -0
  9. package/lib/cjs/auth.js +89 -0
  10. package/lib/cjs/auth.js.map +1 -0
  11. package/lib/cjs/build/validate.js +7 -0
  12. package/lib/cjs/build/validate.js.map +1 -0
  13. package/lib/cjs/copy-assets.js +84 -0
  14. package/lib/cjs/copy-assets.js.map +1 -0
  15. package/lib/cjs/index.js +30 -0
  16. package/lib/cjs/index.js.map +1 -0
  17. package/lib/cjs/package.json +3 -0
  18. package/lib/cjs/server.js +327 -0
  19. package/lib/cjs/server.js.map +1 -0
  20. package/lib/cjs/site/styles.js +621 -0
  21. package/lib/cjs/site/styles.js.map +1 -0
  22. package/lib/cjs/site/templates.js +932 -0
  23. package/lib/cjs/site/templates.js.map +1 -0
  24. package/lib/cjs/types.js +3 -0
  25. package/lib/cjs/types.js.map +1 -0
  26. package/lib/cjs/utils.js +7 -0
  27. package/lib/cjs/utils.js.map +1 -0
  28. package/lib/esm/InteractionCollection.js +125 -0
  29. package/lib/esm/InteractionCollection.js.map +1 -0
  30. package/lib/esm/SkillCollection.js +311 -0
  31. package/lib/esm/SkillCollection.js.map +1 -0
  32. package/lib/esm/ToolCollection.js +154 -0
  33. package/lib/esm/ToolCollection.js.map +1 -0
  34. package/lib/esm/ToolRegistry.js +39 -0
  35. package/lib/esm/ToolRegistry.js.map +1 -0
  36. package/lib/esm/auth.js +82 -0
  37. package/lib/esm/auth.js.map +1 -0
  38. package/lib/esm/build/validate.js +4 -0
  39. package/lib/esm/build/validate.js.map +1 -0
  40. package/lib/esm/copy-assets.js +81 -0
  41. package/lib/esm/copy-assets.js.map +1 -0
  42. package/lib/esm/index.js +10 -0
  43. package/lib/esm/index.js.map +1 -0
  44. package/lib/esm/server.js +323 -0
  45. package/lib/esm/server.js.map +1 -0
  46. package/lib/esm/site/styles.js +618 -0
  47. package/lib/esm/site/styles.js.map +1 -0
  48. package/lib/esm/site/templates.js +920 -0
  49. package/lib/esm/site/templates.js.map +1 -0
  50. package/lib/esm/types.js +2 -0
  51. package/lib/esm/types.js.map +1 -0
  52. package/lib/esm/utils.js +4 -0
  53. package/lib/esm/utils.js.map +1 -0
  54. package/lib/types/InteractionCollection.d.ts +48 -0
  55. package/lib/types/InteractionCollection.d.ts.map +1 -0
  56. package/lib/types/SkillCollection.d.ts +111 -0
  57. package/lib/types/SkillCollection.d.ts.map +1 -0
  58. package/lib/types/ToolCollection.d.ts +61 -0
  59. package/lib/types/ToolCollection.d.ts.map +1 -0
  60. package/lib/types/ToolRegistry.d.ts +15 -0
  61. package/lib/types/ToolRegistry.d.ts.map +1 -0
  62. package/lib/types/auth.d.ts +20 -0
  63. package/lib/types/auth.d.ts.map +1 -0
  64. package/lib/types/build/validate.d.ts +2 -0
  65. package/lib/types/build/validate.d.ts.map +1 -0
  66. package/lib/types/copy-assets.d.ts +14 -0
  67. package/lib/types/copy-assets.d.ts.map +1 -0
  68. package/lib/types/index.d.ts +10 -0
  69. package/lib/types/index.d.ts.map +1 -0
  70. package/lib/types/server.d.ts +72 -0
  71. package/lib/types/server.d.ts.map +1 -0
  72. package/lib/types/site/styles.d.ts +5 -0
  73. package/lib/types/site/styles.d.ts.map +1 -0
  74. package/lib/types/site/templates.d.ts +54 -0
  75. package/lib/types/site/templates.d.ts.map +1 -0
  76. package/lib/types/types.d.ts +262 -0
  77. package/lib/types/types.d.ts.map +1 -0
  78. package/lib/types/utils.d.ts +2 -0
  79. package/lib/types/utils.d.ts.map +1 -0
  80. package/package.json +4 -4
@@ -0,0 +1,262 @@
1
+ import type { ToolDefinition, ToolUse } from "@llumiverse/common";
2
+ import { VertesiaClient } from "@vertesia/client";
3
+ import { AuthTokenPayload, ToolResult, ToolResultContent } from "@vertesia/common";
4
+ export type ICollection<T = any> = CollectionProperties & Iterable<T>;
5
+ export interface CollectionProperties {
6
+ /**
7
+ * A kebab case collection name. Must only contains alphanumeric and dash characters,
8
+ * The name can be used to generate the path where the collection is exposed.
9
+ * Example: my-collection
10
+ */
11
+ name: string;
12
+ /**
13
+ * Optional title for UI display.
14
+ * If not provided the pascal case version of the name will be used
15
+ */
16
+ title?: string;
17
+ /**
18
+ * Optional icon for UI display
19
+ */
20
+ icon?: string;
21
+ /**
22
+ * A short description
23
+ */
24
+ description?: string;
25
+ }
26
+ export interface ToolExecutionContext {
27
+ /**
28
+ * The raw JWT token to the tool execution request
29
+ */
30
+ token: string;
31
+ /**
32
+ * The decoded JWT token
33
+ */
34
+ payload: AuthTokenPayload;
35
+ /**
36
+ * Vertesia client factory using the current auth token.
37
+ * @returns a vertesia client instance
38
+ */
39
+ getClient: () => Promise<VertesiaClient>;
40
+ }
41
+ export interface ToolExecutionResult extends ToolResultContent {
42
+ /**
43
+ * Medata can be used to return more info on the tool execution like stats or user messages.
44
+ */
45
+ meta?: Record<string, any>;
46
+ }
47
+ export interface ToolExecutionResponse extends ToolExecutionResult, ToolResult {
48
+ /**
49
+ * The tool use id of the tool use request. For traceability.
50
+ */
51
+ tool_use_id: string;
52
+ }
53
+ export interface ToolExecutionResponseError {
54
+ /**
55
+ * The tool use id of the tool use request. For traceability.
56
+ */
57
+ tool_use_id: string;
58
+ /**
59
+ * The http status code
60
+ */
61
+ status: number;
62
+ /**
63
+ * the error message
64
+ */
65
+ error: string;
66
+ /**
67
+ * Additional context information
68
+ */
69
+ data?: Record<string, any>;
70
+ }
71
+ export interface ToolExecutionPayload<ParamsT extends Record<string, any>> {
72
+ tool_use: ToolUse<ParamsT>;
73
+ /**
74
+ * Optional metadata related to the current execution request
75
+ */
76
+ metadata?: Record<string, any>;
77
+ }
78
+ export type ToolFn<ParamsT extends Record<string, any>> = (payload: ToolExecutionPayload<ParamsT>, context: ToolExecutionContext) => Promise<ToolExecutionResult>;
79
+ export interface Tool<ParamsT extends Record<string, any>> extends ToolDefinition {
80
+ run: ToolFn<ParamsT>;
81
+ }
82
+ /**
83
+ * The interface that should be return when requesting a collection endpoint using a GET
84
+ */
85
+ export interface ToolCollectionDefinition {
86
+ title: string;
87
+ description: string;
88
+ src: string;
89
+ tools: ToolDefinition[];
90
+ }
91
+ export type { ToolDefinition };
92
+ /**
93
+ * The details of a connection to a MCP server - including the server URL and an authentication token
94
+ */
95
+ export interface MCPConnectionDetails {
96
+ /**
97
+ * The mcp server name. It will be used to prefix tool names.
98
+ */
99
+ name: string;
100
+ /**
101
+ * The target mcp server URL
102
+ */
103
+ url: string;
104
+ /**
105
+ * The bearer authentication token to use when connecting to the mcp server.
106
+ * If an empty string no authentication will be done
107
+ */
108
+ token: string;
109
+ }
110
+ /**
111
+ * Content type for skill instructions
112
+ */
113
+ export type SkillContentType = 'md' | 'jst';
114
+ /**
115
+ * Context triggers for auto-injection of skills
116
+ */
117
+ export interface SkillContextTriggers {
118
+ /**
119
+ * Keywords in user input that should trigger this skill
120
+ */
121
+ keywords?: string[];
122
+ /**
123
+ * If these tools are being used, suggest this skill
124
+ */
125
+ tool_names?: string[];
126
+ /**
127
+ * Regex patterns to match against input data
128
+ */
129
+ data_patterns?: string[];
130
+ }
131
+ /**
132
+ * Execution configuration for skills that need code execution
133
+ */
134
+ export interface SkillExecution {
135
+ /**
136
+ * The programming language for execution
137
+ */
138
+ language: string;
139
+ /**
140
+ * Required packages to install
141
+ */
142
+ packages?: string[];
143
+ /**
144
+ * System-level packages to install (e.g., apt-get packages)
145
+ */
146
+ system_packages?: string[];
147
+ /**
148
+ * Code template to execute
149
+ */
150
+ template?: string;
151
+ }
152
+ /**
153
+ * Script file bundled with a skill
154
+ */
155
+ export interface SkillScript {
156
+ /**
157
+ * Filename (e.g., "analyze.py")
158
+ */
159
+ name: string;
160
+ /**
161
+ * Script content
162
+ */
163
+ content: string;
164
+ }
165
+ /**
166
+ * Skill definition - parsed from SKILL.md or SKILL.jst
167
+ */
168
+ export interface SkillDefinition {
169
+ /**
170
+ * Unique skill name (kebab-case)
171
+ */
172
+ name: string;
173
+ /**
174
+ * Display title
175
+ */
176
+ title?: string;
177
+ /**
178
+ * Short description for discovery
179
+ */
180
+ description: string;
181
+ /**
182
+ * The skill instructions (markdown or JST template)
183
+ */
184
+ instructions: string;
185
+ /**
186
+ * Content type: 'md' for static markdown, 'jst' for dynamic templates
187
+ */
188
+ content_type: SkillContentType;
189
+ /**
190
+ * JSON Schema for skill input parameters.
191
+ * Used when skill is exposed as a tool.
192
+ */
193
+ input_schema?: {
194
+ type: 'object';
195
+ properties?: Record<string, any>;
196
+ required?: string[];
197
+ };
198
+ /**
199
+ * Context triggers for auto-injection
200
+ */
201
+ context_triggers?: SkillContextTriggers;
202
+ /**
203
+ * Execution configuration for code-based skills
204
+ */
205
+ execution?: SkillExecution;
206
+ /**
207
+ * Related tools that work well with this skill
208
+ */
209
+ related_tools?: string[];
210
+ /**
211
+ * Scripts bundled with this skill (synced to sandbox when skill is used)
212
+ */
213
+ scripts?: SkillScript[];
214
+ }
215
+ /**
216
+ * Skill execution payload
217
+ */
218
+ export interface SkillExecutionPayload {
219
+ /**
220
+ * The skill name to execute
221
+ */
222
+ skill_name: string;
223
+ /**
224
+ * Data context for JST template rendering
225
+ */
226
+ data?: Record<string, any>;
227
+ /**
228
+ * Whether to execute the code template (if present)
229
+ */
230
+ execute?: boolean;
231
+ }
232
+ /**
233
+ * Skill execution result
234
+ */
235
+ export interface SkillExecutionResult {
236
+ /**
237
+ * The skill name
238
+ */
239
+ name: string;
240
+ /**
241
+ * Rendered instructions
242
+ */
243
+ instructions: string;
244
+ /**
245
+ * Execution output (if execute=true and skill has code template)
246
+ */
247
+ execution_result?: {
248
+ output: string;
249
+ files?: string[];
250
+ is_error: boolean;
251
+ };
252
+ }
253
+ /**
254
+ * Skill collection definition - returned by GET endpoint
255
+ */
256
+ export interface SkillCollectionDefinition {
257
+ name: string;
258
+ title: string;
259
+ description: string;
260
+ skills: SkillDefinition[];
261
+ }
262
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAAI,oBAAoB,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAErE,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB,EAAE,UAAU;IAC1E;;OAEG;IACH,WAAW,EAA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C,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;KACrB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export declare function kebabCaseToTitle(name: string): string;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/tools-sdk",
3
- "version": "0.82.0",
3
+ "version": "0.82.2",
4
4
  "description": "Tools SDK - utilities for building remote tools",
5
5
  "type": "module",
6
6
  "types": "./lib/types/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "jose": "^6.0.11",
34
- "@llumiverse/common": "0.25.0",
35
- "@vertesia/common": "0.82.0",
36
- "@vertesia/client": "0.82.0"
34
+ "@vertesia/client": "0.82.2",
35
+ "@vertesia/common": "0.82.2",
36
+ "@llumiverse/common": "0.25.1"
37
37
  },
38
38
  "repository": {
39
39
  "type": "git",