@vertesia/tools-sdk 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260227.112605Z
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/cjs/ContentTypesCollection.js +43 -0
- package/lib/cjs/ContentTypesCollection.js.map +1 -0
- package/lib/cjs/InteractionCollection.js +43 -0
- package/lib/cjs/InteractionCollection.js.map +1 -0
- package/lib/cjs/RenderingTemplateCollection.js +43 -0
- package/lib/cjs/RenderingTemplateCollection.js.map +1 -0
- package/lib/cjs/SkillCollection.js +384 -0
- package/lib/cjs/SkillCollection.js.map +1 -0
- package/lib/cjs/ToolCollection.js +221 -0
- package/lib/cjs/ToolCollection.js.map +1 -0
- package/lib/cjs/ToolRegistry.js +95 -0
- package/lib/cjs/ToolRegistry.js.map +1 -0
- package/lib/cjs/auth.js +131 -0
- package/lib/cjs/auth.js.map +1 -0
- package/lib/cjs/build/validate.js +7 -0
- package/lib/cjs/build/validate.js.map +1 -0
- package/lib/cjs/copy-assets.js +84 -0
- package/lib/cjs/copy-assets.js.map +1 -0
- package/lib/cjs/index.js +33 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/server/app-package.js +141 -0
- package/lib/cjs/server/app-package.js.map +1 -0
- package/lib/cjs/server/content-types.js +73 -0
- package/lib/cjs/server/content-types.js.map +1 -0
- package/lib/cjs/server/interactions.js +89 -0
- package/lib/cjs/server/interactions.js.map +1 -0
- package/lib/cjs/server/mcp.js +45 -0
- package/lib/cjs/server/mcp.js.map +1 -0
- package/lib/cjs/server/site.js +42 -0
- package/lib/cjs/server/site.js.map +1 -0
- package/lib/cjs/server/skills.js +114 -0
- package/lib/cjs/server/skills.js.map +1 -0
- package/lib/cjs/server/templates.js +67 -0
- package/lib/cjs/server/templates.js.map +1 -0
- package/lib/cjs/server/tools.js +87 -0
- package/lib/cjs/server/tools.js.map +1 -0
- package/lib/cjs/server/types.js +3 -0
- package/lib/cjs/server/types.js.map +1 -0
- package/lib/cjs/server/widgets.js +27 -0
- package/lib/cjs/server/widgets.js.map +1 -0
- package/lib/cjs/server.js +139 -0
- package/lib/cjs/server.js.map +1 -0
- package/lib/cjs/site/styles.js +692 -0
- package/lib/cjs/site/styles.js.map +1 -0
- package/lib/cjs/site/templates.js +1185 -0
- package/lib/cjs/site/templates.js.map +1 -0
- package/lib/cjs/types.js +3 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/utils.js +44 -0
- package/lib/cjs/utils.js.map +1 -0
- package/lib/esm/ContentTypesCollection.js +39 -0
- package/lib/esm/ContentTypesCollection.js.map +1 -0
- package/lib/esm/InteractionCollection.js +39 -0
- package/lib/esm/InteractionCollection.js.map +1 -0
- package/lib/esm/RenderingTemplateCollection.js +39 -0
- package/lib/esm/RenderingTemplateCollection.js.map +1 -0
- package/lib/esm/SkillCollection.js +377 -0
- package/lib/esm/SkillCollection.js.map +1 -0
- package/lib/esm/ToolCollection.js +183 -0
- package/lib/esm/ToolCollection.js.map +1 -0
- package/lib/esm/ToolRegistry.js +90 -0
- package/lib/esm/ToolRegistry.js.map +1 -0
- package/lib/esm/auth.js +124 -0
- package/lib/esm/auth.js.map +1 -0
- package/lib/esm/build/validate.js +4 -0
- package/lib/esm/build/validate.js.map +1 -0
- package/lib/esm/copy-assets.js +81 -0
- package/lib/esm/copy-assets.js.map +1 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/server/app-package.js +138 -0
- package/lib/esm/server/app-package.js.map +1 -0
- package/lib/esm/server/content-types.js +70 -0
- package/lib/esm/server/content-types.js.map +1 -0
- package/lib/esm/server/interactions.js +86 -0
- package/lib/esm/server/interactions.js.map +1 -0
- package/lib/esm/server/mcp.js +42 -0
- package/lib/esm/server/mcp.js.map +1 -0
- package/lib/esm/server/site.js +39 -0
- package/lib/esm/server/site.js.map +1 -0
- package/lib/esm/server/skills.js +111 -0
- package/lib/esm/server/skills.js.map +1 -0
- package/lib/esm/server/templates.js +64 -0
- package/lib/esm/server/templates.js.map +1 -0
- package/lib/esm/server/tools.js +84 -0
- package/lib/esm/server/tools.js.map +1 -0
- package/lib/esm/server/types.js +2 -0
- package/lib/esm/server/types.js.map +1 -0
- package/lib/esm/server/widgets.js +24 -0
- package/lib/esm/server/widgets.js.map +1 -0
- package/lib/esm/server.js +135 -0
- package/lib/esm/server.js.map +1 -0
- package/lib/esm/site/styles.js +689 -0
- package/lib/esm/site/styles.js.map +1 -0
- package/lib/esm/site/templates.js +1170 -0
- package/lib/esm/site/templates.js.map +1 -0
- package/lib/esm/types.js +2 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils.js +38 -0
- package/lib/esm/utils.js.map +1 -0
- package/lib/types/ContentTypesCollection.d.ts +18 -0
- package/lib/types/ContentTypesCollection.d.ts.map +1 -0
- package/lib/types/InteractionCollection.d.ts +18 -0
- package/lib/types/InteractionCollection.d.ts.map +1 -0
- package/lib/types/RenderingTemplateCollection.d.ts +17 -0
- package/lib/types/RenderingTemplateCollection.d.ts.map +1 -0
- package/lib/types/SkillCollection.d.ts +119 -0
- package/lib/types/SkillCollection.d.ts.map +1 -0
- package/lib/types/ToolCollection.d.ts +67 -0
- package/lib/types/ToolCollection.d.ts.map +1 -0
- package/lib/types/ToolRegistry.d.ts +22 -0
- package/lib/types/ToolRegistry.d.ts.map +1 -0
- package/lib/types/auth.d.ts +32 -0
- package/lib/types/auth.d.ts.map +1 -0
- package/lib/types/build/validate.d.ts +2 -0
- package/lib/types/build/validate.d.ts.map +1 -0
- package/lib/types/copy-assets.d.ts +14 -0
- package/lib/types/copy-assets.d.ts.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/server/app-package.d.ts +4 -0
- package/lib/types/server/app-package.d.ts.map +1 -0
- package/lib/types/server/content-types.d.ts +4 -0
- package/lib/types/server/content-types.d.ts.map +1 -0
- package/lib/types/server/interactions.d.ts +4 -0
- package/lib/types/server/interactions.d.ts.map +1 -0
- package/lib/types/server/mcp.d.ts +4 -0
- package/lib/types/server/mcp.d.ts.map +1 -0
- package/lib/types/server/site.d.ts +4 -0
- package/lib/types/server/site.d.ts.map +1 -0
- package/lib/types/server/skills.d.ts +4 -0
- package/lib/types/server/skills.d.ts.map +1 -0
- package/lib/types/server/templates.d.ts +4 -0
- package/lib/types/server/templates.d.ts.map +1 -0
- package/lib/types/server/tools.d.ts +4 -0
- package/lib/types/server/tools.d.ts.map +1 -0
- package/lib/types/server/types.d.ts +93 -0
- package/lib/types/server/types.d.ts.map +1 -0
- package/lib/types/server/widgets.d.ts +4 -0
- package/lib/types/server/widgets.d.ts.map +1 -0
- package/lib/types/server.d.ts +27 -0
- package/lib/types/server.d.ts.map +1 -0
- package/lib/types/site/styles.d.ts +5 -0
- package/lib/types/site/styles.d.ts.map +1 -0
- package/lib/types/site/templates.d.ts +71 -0
- package/lib/types/site/templates.d.ts.map +1 -0
- package/lib/types/types.d.ts +294 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/utils.d.ts +10 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/ContentTypesCollection.ts +8 -8
- package/src/RenderingTemplateCollection.ts +51 -0
- package/src/SkillCollection.ts +11 -2
- package/src/ToolCollection.ts +9 -18
- package/src/ToolRegistry.ts +17 -56
- package/src/auth.ts +27 -0
- package/src/index.ts +1 -0
- package/src/server/app-package.ts +101 -43
- package/src/server/{conyent-types.ts → content-types.ts} +29 -11
- package/src/server/interactions.ts +11 -6
- package/src/server/site.ts +9 -0
- package/src/server/templates.ts +80 -0
- package/src/server/tools.ts +3 -22
- package/src/server/types.ts +14 -1
- package/src/server/widgets.ts +2 -6
- package/src/server.ts +5 -1
- package/src/site/templates.ts +179 -2
- package/src/types.ts +38 -1
- package/src/utils.ts +15 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
import { InteractionCollection } from "../InteractionCollection.js";
|
|
3
|
+
import { SkillCollection } from "../SkillCollection.js";
|
|
4
|
+
import { RenderingTemplateCollection } from "../RenderingTemplateCollection.js";
|
|
5
|
+
import { ToolCollection } from "../ToolCollection.js";
|
|
6
|
+
import { ToolExecutionPayload } from "../types.js";
|
|
7
|
+
import { JSONSchema } from "@llumiverse/common";
|
|
8
|
+
import { AppUIConfig, ProjectConfiguration } from "@vertesia/common";
|
|
9
|
+
import { ContentTypesCollection } from "../ContentTypesCollection.js";
|
|
10
|
+
/**
|
|
11
|
+
* Extended context with parsed payload for tool/skill execution
|
|
12
|
+
*/
|
|
13
|
+
export interface ToolContext extends Context {
|
|
14
|
+
/** The parsed request payload */
|
|
15
|
+
payload?: ToolExecutionPayload<any>;
|
|
16
|
+
/** The tool_use.id from the payload */
|
|
17
|
+
toolUseId?: string;
|
|
18
|
+
/** The tool_use.tool_name from the payload */
|
|
19
|
+
toolName?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* MCP Provider interface for server configuration
|
|
23
|
+
*/
|
|
24
|
+
export interface MCPProviderConfig {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
createMCPConnection: (session: any, config: Record<string, any>) => Promise<{
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
token: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Server configuration options
|
|
35
|
+
*/
|
|
36
|
+
export interface ToolServerConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Server title for HTML pages (default: 'Tools Server')
|
|
39
|
+
*/
|
|
40
|
+
title?: string;
|
|
41
|
+
/**
|
|
42
|
+
* API prefix (default: '/api')
|
|
43
|
+
*/
|
|
44
|
+
prefix?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Tool collections to expose
|
|
47
|
+
*/
|
|
48
|
+
tools?: ToolCollection[];
|
|
49
|
+
/**
|
|
50
|
+
* Interaction collections to expose
|
|
51
|
+
*/
|
|
52
|
+
interactions?: InteractionCollection[];
|
|
53
|
+
/**
|
|
54
|
+
* Content type collections to expose
|
|
55
|
+
*/
|
|
56
|
+
types?: ContentTypesCollection[];
|
|
57
|
+
/**
|
|
58
|
+
* Skill collections to expose
|
|
59
|
+
*/
|
|
60
|
+
skills?: SkillCollection[];
|
|
61
|
+
/**
|
|
62
|
+
* Template collections to expose
|
|
63
|
+
*/
|
|
64
|
+
templates?: RenderingTemplateCollection[];
|
|
65
|
+
/**
|
|
66
|
+
* MCP providers to expose
|
|
67
|
+
*/
|
|
68
|
+
mcpProviders?: MCPProviderConfig[];
|
|
69
|
+
/**
|
|
70
|
+
* A JSON schema defining settings for the application using this server
|
|
71
|
+
*/
|
|
72
|
+
settings?: JSONSchema;
|
|
73
|
+
/**
|
|
74
|
+
* The UI configuration for the application using this server
|
|
75
|
+
*/
|
|
76
|
+
uiConfig?: AppUIConfig;
|
|
77
|
+
/**
|
|
78
|
+
* Disable HTML pages (default: false)
|
|
79
|
+
*/
|
|
80
|
+
disableHtml?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Hide UI app links on the index page (default: false)
|
|
83
|
+
*/
|
|
84
|
+
hideUILinks?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
* This allows for dynamic enabling/disabling of tools based on project settings.
|
|
88
|
+
* @param projectConfig
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
toolFilter?: (projectConfig: ProjectConfiguration) => boolean;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,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AAE,sBAAsB,EAAE,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,oBAAoB,KAAK,OAAO,CAAC;CACjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../src/server/widgets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,QA4BvF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Context, Hono } from "hono";
|
|
2
|
+
import { ToolServerConfig } from "./server/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a Hono server for tools, interactions, and skills.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { createToolServer, ToolCollection, SkillCollection } from "@vertesia/tools-sdk";
|
|
9
|
+
*
|
|
10
|
+
* const server = createToolServer({
|
|
11
|
+
* tools: [myToolCollection],
|
|
12
|
+
* skills: [mySkillCollection],
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* export default server;
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function createToolServer(config: ToolServerConfig): Hono;
|
|
19
|
+
/**
|
|
20
|
+
* Simple development server with static fimesale handling
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Use tools server template
|
|
23
|
+
*/
|
|
24
|
+
export declare function createDevServer(config: ToolServerConfig & {
|
|
25
|
+
staticHandler?: (c: Context, next: () => Promise<void>) => Promise<Response | void>;
|
|
26
|
+
}): Hono;
|
|
27
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AASrC,OAAO,EAAe,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAmBlE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAuG/D;AAMD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG;IACvD,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACvF,GAAG,IAAI,CAQP"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CSS styles for the tools server HTML pages
|
|
3
|
+
*/
|
|
4
|
+
export declare const baseStyles = "\n:root {\n color-scheme: light dark;\n}\n\nbody {\n font-family: system-ui, -apple-system, sans-serif;\n margin: 0;\n padding: 2.5rem 1.75rem;\n background:\n radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.10), transparent 55%),\n radial-gradient(circle at 100% 0, rgba(129, 140, 248, 0.12), transparent 55%),\n #f9fafb;\n color: #0f172a;\n line-height: 1.5;\n}\n\n.page {\n max-width: 1120px;\n margin: 0 auto;\n}\n\n.hero {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 2.25rem;\n padding: 1.75rem 2rem;\n margin-bottom: 2.5rem;\n border-radius: 1.25rem;\n background: linear-gradient(135deg, #ffffff, #f3f4ff);\n border: 1px solid #e5e7eb;\n box-shadow:\n 0 18px 40px rgba(15, 23, 42, 0.08),\n 0 0 0 1px rgba(248, 250, 252, 0.8);\n}\n\n.hero-main {\n display: flex;\n gap: 1.5rem;\n align-items: center;\n}\n\n.hero-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 999px;\n background: radial-gradient(circle at 30% 0, #38bdf8, #6366f1);\n box-shadow:\n 0 0 0 1px rgba(15, 23, 42, 0.85),\n 0 12px 30px rgba(37, 99, 235, 0.6);\n}\n\n.hero-logo-initial {\n font-size: 1.1rem;\n font-weight: 650;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: #eff6ff;\n}\n\n.hero-logo img {\n display: block;\n max-width: 80%;\n max-height: 60%;\n}\n\n.logo-dark {\n display: none;\n}\n\n.hero-meta {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.hero-eyebrow {\n font-size: 0.75rem;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n color: #6b7280;\n}\n\n.hero-title {\n font-size: 1.9rem;\n font-weight: 650;\n letter-spacing: -0.03em;\n color: #0f172a;\n margin: 0;\n}\n\n.hero-tagline {\n font-size: 0.95rem;\n color: #4b5563;\n margin: 0.1rem 0 0 0;\n}\n\n.hero-summary {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin-top: 0.75rem;\n font-size: 0.8rem;\n color: #6b7280;\n}\n\n.hero-summary span {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n padding: 0.15rem 0.55rem;\n border-radius: 999px;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n}\n\n.hero-summary dot {\n width: 6px;\n height: 6px;\n border-radius: 999px;\n display: inline-block;\n background: #22c55e;\n}\n\n.search-bar {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n margin: 0 0 1.75rem 0;\n}\n\n.search-input {\n max-width: 360px;\n padding: 0.55rem 0.75rem;\n border-radius: 999px;\n border: 1px solid #e5e7eb;\n background: #ffffff;\n color: #111827;\n font-size: 0.9rem;\n font-family: inherit;\n box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);\n}\n\n.search-input::placeholder {\n color: #9ca3af;\n}\n\n.search-input:focus {\n outline: none;\n border-color: #60a5fa;\n box-shadow:\n 0 0 0 1px rgba(59, 130, 246, 0.4),\n 0 6px 18px rgba(37, 99, 235, 0.18);\n}\n\n.search-hint {\n font-size: 0.75rem;\n color: #9ca3af;\n}\n\n.search-empty {\n margin-top: 1rem;\n font-size: 0.85rem;\n color: #9ca3af;\n}\n\n.hero-panel {\n min-width: 220px;\n max-width: 260px;\n padding: 1.25rem 1.4rem;\n border-radius: 1rem;\n background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.10), transparent 70%),\n #eff6ff;\n border: 1px solid #bfdbfe;\n box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);\n font-size: 0.8rem;\n}\n\n.hero-panel-label {\n font-size: 0.7rem;\n letter-spacing: 0.13em;\n text-transform: uppercase;\n color: #1d4ed8;\n margin-bottom: 0.5rem;\n}\n\n.hero-panel-endpoint {\n display: inline-flex;\n align-items: center;\n padding: 0.3rem 0.6rem;\n border-radius: 0.5rem;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: 0.82rem;\n color: #111827;\n}\n\n.hero-panel-hint {\n margin-top: 0.6rem;\n color: #6b7280;\n line-height: 1.4;\n}\n\n.hero-panel-hint strong {\n color: #111827;\n}\n\nh1, h2 {\n margin: 0 0 1rem 0;\n color: #0f172a;\n}\n\nh1 { font-size: 1.875rem; }\nh2 {\n font-size: 1.4rem;\n margin-top: 2rem;\n letter-spacing: 0.03em;\n text-transform: uppercase;\n color: #6b7280;\n}\n\na {\n color: #2563eb;\n text-decoration: none;\n}\na:hover {\n text-decoration: underline;\n}\n\nhr {\n border: none;\n border-top: 1px solid #e5e7eb;\n margin: 2rem 0;\n}\n\n.card-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n gap: 1.5rem;\n}\n\n.card {\n background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.12), transparent 75%),\n #ffffff;\n padding: 1.25rem 1.35rem;\n border-radius: 14px;\n box-shadow:\n 0 14px 30px rgba(15, 23, 42, 0.06),\n 0 0 0 1px rgba(248, 250, 252, 0.9);\n border: 1px solid #e5e7eb;\n transition: transform 0.15s, box-shadow 0.15s;\n text-decoration: none;\n color: inherit;\n display: block;\n}\n\n.card:hover {\n transform: translateY(-3px);\n box-shadow:\n 0 18px 40px rgba(15, 23, 42, 0.10),\n 0 0 0 1px rgba(59, 130, 246, 0.6);\n}\n\n.card-icon {\n width: 48px;\n height: 48px;\n margin-bottom: 0.75rem;\n}\n\n.card-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.card-title {\n font-weight: 600;\n font-size: 1.1rem;\n margin-bottom: 0.25rem;\n color: #0f172a;\n}\n\n.card-desc {\n font-size: 0.925rem;\n color: #6b7280;\n}\n\n.card-meta {\n margin-top: 0.45rem;\n font-size: 0.75rem;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: #9ca3af;\n}\n\n.item-list {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.item-card {\n background: #ffffff;\n padding: 1rem 1.25rem;\n border-radius: 10px;\n border-left: 4px solid #6366f1;\n box-shadow:\n 0 10px 24px rgba(15, 23, 42, 0.06),\n 0 0 0 1px rgba(248, 250, 252, 0.9);\n}\n\n.item-card.skill {\n border-left-color: #10b981;\n}\n\n.item-card.interaction {\n border-left-color: #f59e0b;\n}\n\n.item-name {\n font-weight: 600;\n font-size: 1.05rem;\n}\n\n.item-desc {\n font-size: 0.9rem;\n color: #6b7280;\n margin-top: 0.25rem;\n}\n\n.item-meta {\n font-size: 0.8rem;\n color: #9ca3af;\n margin-top: 0.5rem;\n}\n\n.item-schema {\n margin-top: 0.75rem;\n font-size: 0.8rem;\n font-family: ui-monospace, monospace;\n background: #f3f4f6;\n padding: 0.75rem;\n border-radius: 6px;\n overflow-x: auto;\n white-space: pre-wrap;\n color: #374151;\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 1.5rem;\n}\n\n.header-icon {\n width: 64px;\n height: 64px;\n}\n\n.header-icon svg {\n width: 100%;\n height: 100%;\n}\n\n.section-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 1rem;\n margin-bottom: 0.75rem;\n}\n\n.section-subtitle {\n font-size: 0.8rem;\n color: #6b7280;\n}\n\n.endpoint-url {\n font-size: 0.85rem;\n color: #6b7280;\n margin-top: 0.25rem;\n}\n\n.endpoint-url code {\n background: #f3f4f6;\n padding: 0.125rem 0.375rem;\n border-radius: 4px;\n font-family: ui-monospace, monospace;\n}\n\n.endpoint-box {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n background: #f3f4f6;\n padding: 0.75rem 1rem;\n border-radius: 8px;\n margin-top: 0.5rem;\n}\n\n.endpoint-box code {\n flex: 1;\n font-family: ui-monospace, monospace;\n font-size: 0.875rem;\n color: #1f2937;\n}\n\n.copy-btn {\n background: #e5e7eb;\n border: none;\n padding: 0.5rem;\n border-radius: 6px;\n cursor: pointer;\n color: #6b7280;\n transition: all 0.15s;\n}\n\n.copy-btn:hover {\n background: #d1d5db;\n color: #374151;\n}\n\n.copy-btn svg {\n width: 16px;\n height: 16px;\n}\n\n.badge {\n display: inline-block;\n font-size: 0.75rem;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: #f9fafb;\n color: #374151;\n border: 1px solid #e5e7eb;\n margin-right: 0.25rem;\n}\n\n.badge.python { background: #fef3c7; color: #92400e; border-color: #facc15; }\n.badge.typescript { background: #dbeafe; color: #1e40af; border-color: #60a5fa; }\n.badge.javascript { background: #fef9c3; color: #854d0e; border-color: #facc15; }\n\n@media (max-width: 768px) {\n body {\n padding: 1.75rem 1.25rem;\n }\n\n .hero {\n flex-direction: column;\n padding: 1.5rem 1.35rem;\n }\n\n .hero-panel {\n max-width: 100%;\n width: 100%;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n body {\n background:\n radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 55%),\n radial-gradient(circle at 100% 0, rgba(129, 140, 248, 0.25), transparent 55%),\n #020617;\n color: #e5e7eb;\n }\n\n .hero {\n background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));\n border: 1px solid rgba(148, 163, 184, 0.45);\n box-shadow:\n 0 24px 60px rgba(15, 23, 42, 0.85),\n 0 0 0 1px rgba(15, 23, 42, 0.75);\n }\n\n .hero-eyebrow {\n color: #9ca3af;\n }\n\n .hero-title {\n color: #f9fafb;\n }\n\n .hero-tagline {\n color: #cbd5f5;\n }\n\n .hero-summary {\n color: #9ca3af;\n }\n\n .hero-summary span {\n background: rgba(15, 23, 42, 0.95);\n border-color: rgba(148, 163, 184, 0.45);\n }\n\n .hero-panel {\n background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.16), transparent 70%),\n rgba(15, 23, 42, 0.96);\n border: 1px solid rgba(59, 130, 246, 0.6);\n box-shadow: 0 20px 40px rgba(15, 23, 42, 0.85);\n }\n\n .hero-panel-label {\n color: #93c5fd;\n }\n\n .hero-panel-endpoint {\n background: rgba(15, 23, 42, 0.98);\n border-color: rgba(148, 163, 184, 0.6);\n color: #e5e7eb;\n }\n\n .hero-panel-hint {\n color: #9ca3af;\n }\n\n .hero-panel-hint strong {\n color: #e5e7eb;\n }\n\n .search-input {\n background: rgba(15, 23, 42, 0.96);\n border-color: rgba(55, 65, 81, 0.9);\n color: #e5e7eb;\n box-shadow:\n 0 6px 16px rgba(15, 23, 42, 0.9),\n 0 0 0 1px rgba(15, 23, 42, 0.9);\n }\n\n .search-input::placeholder {\n color: #6b7280;\n }\n\n .search-input:focus {\n border-color: #60a5fa;\n box-shadow:\n 0 0 0 1px rgba(59, 130, 246, 0.7),\n 0 10px 26px rgba(30, 64, 175, 0.7);\n }\n\n .search-hint,\n .search-empty {\n color: #9ca3af;\n }\n\n h1, h2 {\n color: #e5e7eb;\n }\n\n h2 {\n color: #9ca3af;\n }\n\n a {\n color: #60a5fa;\n }\n\n hr {\n border-top-color: rgba(148, 163, 184, 0.4);\n }\n\n .card {\n background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.12), transparent 75%),\n rgba(15, 23, 42, 0.9);\n box-shadow:\n 0 14px 30px rgba(15, 23, 42, 0.8),\n 0 0 0 1px rgba(15, 23, 42, 0.85);\n border-color: rgba(148, 163, 184, 0.5);\n }\n\n .card:hover {\n box-shadow:\n 0 18px 40px rgba(15, 23, 42, 0.9),\n 0 0 0 1px rgba(59, 130, 246, 0.8);\n }\n\n .card-title {\n color: #e5e7eb;\n }\n\n .card-desc {\n color: #9ca3af;\n }\n\n .card-meta {\n color: #6b7280;\n }\n\n .item-card {\n background: rgba(15, 23, 42, 0.9);\n box-shadow:\n 0 10px 24px rgba(15, 23, 42, 0.9),\n 0 0 0 1px rgba(15, 23, 42, 0.9);\n }\n\n .item-desc,\n .item-meta {\n color: #9ca3af;\n }\n\n .item-schema {\n background: rgba(15, 23, 42, 0.95);\n color: #e5e7eb;\n }\n\n .endpoint-url {\n color: #9ca3af;\n }\n\n .endpoint-url code {\n background: rgba(15, 23, 42, 0.95);\n }\n\n .endpoint-box {\n background: rgba(31, 41, 55, 0.95);\n }\n\n .endpoint-box code {\n color: #e5e7eb;\n }\n\n .copy-btn {\n background: rgba(55, 65, 81, 0.95);\n color: #e5e7eb;\n }\n\n .copy-btn:hover {\n background: rgba(75, 85, 99, 0.98);\n color: #f9fafb;\n }\n\n .badge {\n background: rgba(15, 23, 42, 0.96);\n color: #e5e7eb;\n border-color: rgba(148, 163, 184, 0.6);\n }\n\n .badge.python {\n background: rgba(252, 211, 77, 0.12);\n color: #facc15;\n border-color: rgba(250, 204, 21, 0.5);\n }\n\n .badge.typescript {\n background: rgba(59, 130, 246, 0.12);\n color: #93c5fd;\n border-color: rgba(59, 130, 246, 0.7);\n }\n\n .badge.javascript {\n background: rgba(251, 191, 36, 0.12);\n color: #fbbf24;\n border-color: rgba(251, 191, 36, 0.55);\n }\n\n .logo-light {\n display: none;\n }\n .logo-dark {\n display: block;\n }\n\n .plugin-link-primary:hover {\n background: #2563eb !important;\n }\n\n .plugin-link-secondary:hover {\n background: #059669 !important;\n }\n}\n\n.plugin-link-primary:hover {\n background: #2563eb;\n}\n\n.plugin-link-secondary:hover {\n background: #059669;\n}\n";
|
|
5
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/site/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,m9aA4qBtB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { InteractionCollection } from "../InteractionCollection.js";
|
|
2
|
+
import { ToolServerConfig } from "../server/types.js";
|
|
3
|
+
import type { SkillCollection } from "../SkillCollection.js";
|
|
4
|
+
import type { RenderingTemplateCollection } from "../RenderingTemplateCollection.js";
|
|
5
|
+
import type { ToolCollection } from "../ToolCollection.js";
|
|
6
|
+
import type { ContentTypesCollection } from "../ContentTypesCollection.js";
|
|
7
|
+
import type { ICollection, SkillDefinition, RenderingTemplateDefinition, Tool } from "../types.js";
|
|
8
|
+
type MCPProviderMeta = {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Render a collection card for the index page
|
|
14
|
+
*/
|
|
15
|
+
export declare function collectionCard(collection: ICollection, pathPrefix: string, meta?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Render a tool card (simple version for lists)
|
|
18
|
+
*/
|
|
19
|
+
export declare function toolCard(tool: Tool<Record<string, unknown>>): string;
|
|
20
|
+
/**
|
|
21
|
+
* Render an MCP provider card
|
|
22
|
+
*/
|
|
23
|
+
export declare function mcpProviderCard(provider: MCPProviderMeta): string;
|
|
24
|
+
/**
|
|
25
|
+
* Render a detailed tool card
|
|
26
|
+
*/
|
|
27
|
+
export declare function toolDetailCard(tool: Tool<Record<string, unknown>>, collectionName: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Render a skill card (simple version for lists)
|
|
30
|
+
*/
|
|
31
|
+
export declare function skillCard(skill: SkillDefinition): string;
|
|
32
|
+
/**
|
|
33
|
+
* Render a detailed skill card
|
|
34
|
+
*/
|
|
35
|
+
export declare function skillDetailCard(skill: SkillDefinition, collection: SkillCollection): string;
|
|
36
|
+
/**
|
|
37
|
+
* Render a detailed template card
|
|
38
|
+
*/
|
|
39
|
+
export declare function templateDetailCard(template: RenderingTemplateDefinition, collection: RenderingTemplateCollection): string;
|
|
40
|
+
/**
|
|
41
|
+
* Render a template collection detail page
|
|
42
|
+
*/
|
|
43
|
+
export declare function templateCollectionPage(collection: RenderingTemplateCollection): string;
|
|
44
|
+
/**
|
|
45
|
+
* Render the main index page
|
|
46
|
+
*
|
|
47
|
+
* Note: The fourth argument is backward compatible:
|
|
48
|
+
* - If a string is passed, it is treated as the title.
|
|
49
|
+
* - If an array is passed, it is treated as MCP providers and the fifth argument (if any) is the title.
|
|
50
|
+
* @deprecated Static templates were replaced by a React site. Do not use them anymore.
|
|
51
|
+
* Will be removed.
|
|
52
|
+
*/
|
|
53
|
+
export declare function indexPage(config: ToolServerConfig): string;
|
|
54
|
+
/**
|
|
55
|
+
* Render a tool collection detail page
|
|
56
|
+
*/
|
|
57
|
+
export declare function toolCollectionPage(collection: ToolCollection): string;
|
|
58
|
+
/**
|
|
59
|
+
* Render a skill collection detail page
|
|
60
|
+
*/
|
|
61
|
+
export declare function skillCollectionPage(collection: SkillCollection): string;
|
|
62
|
+
/**
|
|
63
|
+
* Render an interaction collection detail page
|
|
64
|
+
*/
|
|
65
|
+
export declare function interactionCollectionPage(collection: InteractionCollection): string;
|
|
66
|
+
/**
|
|
67
|
+
* Render a content type collection detail page
|
|
68
|
+
*/
|
|
69
|
+
export declare function contentTypeCollectionPage(collection: ContentTypesCollection): string;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/site/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,2BAA2B,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAInG,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAgXF;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAQjG;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CASpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAMjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CA0DlG;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAWxD;AAsBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,GAAG,MAAM,CAsF3F;AA0DD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,2BAA2B,EAAE,UAAU,EAAE,2BAA2B,GAAG,MAAM,CA8BzH;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,CAsCtF;AAoED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACrB,MAAM,EAAE,gBAAgB,GACzB,MAAM,CAqOR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAsCrE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAsCvE;AA4CD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAoBnF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAqBpF"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import type { ToolDefinition, ToolUse } from "@llumiverse/common";
|
|
2
|
+
import { VertesiaClient } from "@vertesia/client";
|
|
3
|
+
import { AgentToolDefinition, AuthTokenPayload, ProjectConfiguration, RenderingTemplateDefinition, ToolExecutionMetadata, ToolResult, ToolResultContent } from "@vertesia/common";
|
|
4
|
+
export type { ToolExecutionMetadata };
|
|
5
|
+
export type ICollection<T = any> = CollectionProperties & Iterable<T>;
|
|
6
|
+
export interface CollectionProperties {
|
|
7
|
+
/**
|
|
8
|
+
* A kebab case collection name. Must only contains alphanumeric and dash characters,
|
|
9
|
+
* The name can be used to generate the path where the collection is exposed.
|
|
10
|
+
* Example: my-collection
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional title for UI display.
|
|
15
|
+
* If not provided the pascal case version of the name will be used
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional icon for UI display
|
|
20
|
+
*/
|
|
21
|
+
icon?: string;
|
|
22
|
+
/**
|
|
23
|
+
* A short description
|
|
24
|
+
*/
|
|
25
|
+
description?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ToolExecutionContext {
|
|
28
|
+
/**
|
|
29
|
+
* The raw JWT token to the tool execution request
|
|
30
|
+
*/
|
|
31
|
+
token: string;
|
|
32
|
+
/**
|
|
33
|
+
* The decoded JWT token
|
|
34
|
+
*/
|
|
35
|
+
payload: AuthTokenPayload;
|
|
36
|
+
/**
|
|
37
|
+
* Vertesia client factory using the current auth token.
|
|
38
|
+
* @returns a vertesia client instance
|
|
39
|
+
*/
|
|
40
|
+
getClient: () => Promise<VertesiaClient>;
|
|
41
|
+
}
|
|
42
|
+
export interface ToolExecutionResult extends ToolResultContent {
|
|
43
|
+
/**
|
|
44
|
+
* Medata can be used to return more info on the tool execution like stats or user messages.
|
|
45
|
+
*/
|
|
46
|
+
meta?: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
export interface ToolExecutionResponse extends ToolExecutionResult, ToolResult {
|
|
49
|
+
/**
|
|
50
|
+
* The tool use id of the tool use request. For traceability.
|
|
51
|
+
*/
|
|
52
|
+
tool_use_id: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ToolExecutionResponseError {
|
|
55
|
+
/**
|
|
56
|
+
* The tool use id of the tool use request. For traceability.
|
|
57
|
+
*/
|
|
58
|
+
tool_use_id: string;
|
|
59
|
+
/**
|
|
60
|
+
* The http status code
|
|
61
|
+
*/
|
|
62
|
+
status: number;
|
|
63
|
+
/**
|
|
64
|
+
* the error message
|
|
65
|
+
*/
|
|
66
|
+
error: string;
|
|
67
|
+
/**
|
|
68
|
+
* Additional context information
|
|
69
|
+
*/
|
|
70
|
+
data?: Record<string, any>;
|
|
71
|
+
}
|
|
72
|
+
export interface ToolExecutionPayload<ParamsT extends Record<string, any>> {
|
|
73
|
+
tool_use: ToolUse<ParamsT>;
|
|
74
|
+
/**
|
|
75
|
+
* Optional metadata related to the current execution request
|
|
76
|
+
*/
|
|
77
|
+
metadata?: ToolExecutionMetadata;
|
|
78
|
+
}
|
|
79
|
+
export type ToolFn<ParamsT extends Record<string, any>> = (payload: ToolExecutionPayload<ParamsT>, context: ToolExecutionContext) => Promise<ToolExecutionResult>;
|
|
80
|
+
export interface ToolUseContext {
|
|
81
|
+
project_id?: string;
|
|
82
|
+
account_id?: string;
|
|
83
|
+
project_name?: string;
|
|
84
|
+
project_ns?: string;
|
|
85
|
+
configuration?: ProjectConfiguration;
|
|
86
|
+
vars?: Record<string, any>;
|
|
87
|
+
}
|
|
88
|
+
export interface Tool<ParamsT extends Record<string, any>> extends ToolDefinition {
|
|
89
|
+
run: ToolFn<ParamsT>;
|
|
90
|
+
/**
|
|
91
|
+
* Whether this tool is available by default.
|
|
92
|
+
* - true/undefined: Tool is always available to agents
|
|
93
|
+
* - false: Tool is only available when activated by a skill's related_tools
|
|
94
|
+
*/
|
|
95
|
+
default?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Optional filter to check if the tool is enabled for the given project configuration.
|
|
98
|
+
* This can be used to dynamically enable/disable tools based on project settings, environment variables, or any other logic.
|
|
99
|
+
* If no filter is provided, the tool will be enabled by default.
|
|
100
|
+
* @param payload
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
isEnabled?: (payload: ToolUseContext) => boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The interface that should be returned when requesting a collection endpoint using a GET
|
|
107
|
+
*/
|
|
108
|
+
export interface ToolCollectionDefinition {
|
|
109
|
+
title: string;
|
|
110
|
+
description: string;
|
|
111
|
+
src: string;
|
|
112
|
+
tools: AgentToolDefinition[];
|
|
113
|
+
}
|
|
114
|
+
export type { ToolDefinition };
|
|
115
|
+
/**
|
|
116
|
+
* The details of a connection to a MCP server - including the server URL and an authentication token
|
|
117
|
+
*/
|
|
118
|
+
export interface MCPConnectionDetails {
|
|
119
|
+
/**
|
|
120
|
+
* The mcp server name. It will be used to prefix tool names.
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
/**
|
|
124
|
+
* The target mcp server URL
|
|
125
|
+
*/
|
|
126
|
+
url: string;
|
|
127
|
+
/**
|
|
128
|
+
* The bearer authentication token to use when connecting to the mcp server.
|
|
129
|
+
* If an empty string no authentication will be done
|
|
130
|
+
*/
|
|
131
|
+
token: string;
|
|
132
|
+
/**
|
|
133
|
+
* Optional additional HTTP headers to include with requests to the MCP server.
|
|
134
|
+
* Merged with the Authorization header derived from the token.
|
|
135
|
+
*/
|
|
136
|
+
headers?: Record<string, string>;
|
|
137
|
+
}
|
|
138
|
+
export type { RenderingTemplateDefinition };
|
|
139
|
+
/**
|
|
140
|
+
* Content type for skill instructions
|
|
141
|
+
*/
|
|
142
|
+
export type SkillContentType = 'md' | 'jst';
|
|
143
|
+
/**
|
|
144
|
+
* Context triggers for auto-injection of skills
|
|
145
|
+
*/
|
|
146
|
+
export interface SkillContextTriggers {
|
|
147
|
+
/**
|
|
148
|
+
* Keywords in user input that should trigger this skill
|
|
149
|
+
*/
|
|
150
|
+
keywords?: string[];
|
|
151
|
+
/**
|
|
152
|
+
* If these tools are being used, suggest this skill
|
|
153
|
+
*/
|
|
154
|
+
tool_names?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* Regex patterns to match against input data
|
|
157
|
+
*/
|
|
158
|
+
data_patterns?: string[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Execution configuration for skills that need code execution
|
|
162
|
+
*/
|
|
163
|
+
export interface SkillExecution {
|
|
164
|
+
/**
|
|
165
|
+
* The programming language for execution
|
|
166
|
+
*/
|
|
167
|
+
language: string;
|
|
168
|
+
/**
|
|
169
|
+
* Required packages to install
|
|
170
|
+
*/
|
|
171
|
+
packages?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* System-level packages to install (e.g., apt-get packages)
|
|
174
|
+
*/
|
|
175
|
+
system_packages?: string[];
|
|
176
|
+
/**
|
|
177
|
+
* Code template to execute
|
|
178
|
+
*/
|
|
179
|
+
template?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Skill definition - parsed from SKILL.md or SKILL.jst
|
|
183
|
+
*/
|
|
184
|
+
export interface SkillDefinition {
|
|
185
|
+
/**
|
|
186
|
+
* Unique skill name (kebab-case)
|
|
187
|
+
*/
|
|
188
|
+
name: string;
|
|
189
|
+
/**
|
|
190
|
+
* Display title
|
|
191
|
+
*/
|
|
192
|
+
title?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Short description for discovery
|
|
195
|
+
*/
|
|
196
|
+
description: string;
|
|
197
|
+
/**
|
|
198
|
+
* The skill instructions (markdown or JST template)
|
|
199
|
+
*/
|
|
200
|
+
instructions: string;
|
|
201
|
+
/**
|
|
202
|
+
* Content type: 'md' for static markdown, 'jst' for dynamic templates
|
|
203
|
+
*/
|
|
204
|
+
content_type: SkillContentType;
|
|
205
|
+
/**
|
|
206
|
+
* JSON Schema for skill input parameters.
|
|
207
|
+
* Used when skill is exposed as a tool.
|
|
208
|
+
*/
|
|
209
|
+
input_schema?: {
|
|
210
|
+
type: 'object';
|
|
211
|
+
properties?: Record<string, any>;
|
|
212
|
+
required?: string[];
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Context triggers for auto-injection
|
|
216
|
+
*/
|
|
217
|
+
context_triggers?: SkillContextTriggers;
|
|
218
|
+
/**
|
|
219
|
+
* Execution configuration for code-based skills
|
|
220
|
+
*/
|
|
221
|
+
execution?: SkillExecution;
|
|
222
|
+
/**
|
|
223
|
+
* Related tools that work well with this skill
|
|
224
|
+
*/
|
|
225
|
+
related_tools?: string[];
|
|
226
|
+
/**
|
|
227
|
+
* Scripts bundled with this skill (synced to sandbox when skill is used)
|
|
228
|
+
*/
|
|
229
|
+
scripts?: string[];
|
|
230
|
+
/**
|
|
231
|
+
* The name of the widgets provided by this skill (if any)
|
|
232
|
+
* The name will be used to load the widget dynamically from the agent chat
|
|
233
|
+
* and must match the code block language returned by the LLM (e.g., ```my-widget)
|
|
234
|
+
* which will be rendered using the widget.
|
|
235
|
+
* The widget file must be located in the skill directory under the name {{widget-name}}.tsx.
|
|
236
|
+
*/
|
|
237
|
+
widgets?: string[];
|
|
238
|
+
/**
|
|
239
|
+
* Optional filter to check if the tool is enabled for the given project configuration.
|
|
240
|
+
* This can be used to dynamically enable/disable tools based on project settings, environment variables, or any other logic.
|
|
241
|
+
* If no filter is provided, the tool will be enabled by default.
|
|
242
|
+
* @param payload
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
isEnabled?: (payload: ToolUseContext) => boolean;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Skill execution payload
|
|
249
|
+
*/
|
|
250
|
+
export interface SkillExecutionPayload {
|
|
251
|
+
/**
|
|
252
|
+
* The skill name to execute
|
|
253
|
+
*/
|
|
254
|
+
skill_name: string;
|
|
255
|
+
/**
|
|
256
|
+
* Data context for JST template rendering
|
|
257
|
+
*/
|
|
258
|
+
data?: Record<string, any>;
|
|
259
|
+
/**
|
|
260
|
+
* Whether to execute the code template (if present)
|
|
261
|
+
*/
|
|
262
|
+
execute?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Skill execution result
|
|
266
|
+
*/
|
|
267
|
+
export interface SkillExecutionResult {
|
|
268
|
+
/**
|
|
269
|
+
* The skill name
|
|
270
|
+
*/
|
|
271
|
+
name: string;
|
|
272
|
+
/**
|
|
273
|
+
* Rendered instructions
|
|
274
|
+
*/
|
|
275
|
+
instructions: string;
|
|
276
|
+
/**
|
|
277
|
+
* Execution output (if execute=true and skill has code template)
|
|
278
|
+
*/
|
|
279
|
+
execution_result?: {
|
|
280
|
+
output: string;
|
|
281
|
+
files?: string[];
|
|
282
|
+
is_error: boolean;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Skill collection definition - returned by GET endpoint
|
|
287
|
+
*/
|
|
288
|
+
export interface SkillCollectionDefinition {
|
|
289
|
+
name: string;
|
|
290
|
+
title: string;
|
|
291
|
+
description: string;
|
|
292
|
+
skills: SkillDefinition[];
|
|
293
|
+
}
|
|
294
|
+
//# 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,mBAAmB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAElL,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,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,E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jC;;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,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a name to a URL-safe path segment.
|
|
3
|
+
* If the name contains spaces or underscores, convert to PascalCase.
|
|
4
|
+
* Otherwise return as-is. Any characters not in [a-zA-Z0-9$_\-@] are replaced with '-'.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toPathName(name: string): string;
|
|
7
|
+
export declare function kebabCaseToTitle(name: string): string;
|
|
8
|
+
export declare function makeScriptUrl(origin: string, script: string): string;
|
|
9
|
+
export declare function join(left: string, right: string): string;
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAE5C;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAE3D;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAc/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/tools-sdk",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.20260227.112605Z",
|
|
4
4
|
"description": "Tools SDK - utilities for building remote tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/types/index.d.ts",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"jose": "^6.0.11",
|
|
34
34
|
"zod": "^4.3.5",
|
|
35
|
-
"@
|
|
36
|
-
"@vertesia/
|
|
37
|
-
"@
|
|
35
|
+
"@vertesia/common": "1.0.0-dev.20260227.112605Z",
|
|
36
|
+
"@vertesia/client": "1.0.0-dev.20260227.112605Z",
|
|
37
|
+
"@llumiverse/common": "1.0.0-dev.20260224.234313Z"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InCodeTypeSpec } from "@vertesia/common";
|
|
2
2
|
import { CollectionProperties, ICollection } from "./types.js";
|
|
3
3
|
import { kebabCaseToTitle } from "./utils.js";
|
|
4
4
|
|
|
5
5
|
export interface ContentTypesCollectionProps extends CollectionProperties {
|
|
6
|
-
types:
|
|
6
|
+
types: InCodeTypeSpec[];
|
|
7
7
|
}
|
|
8
|
-
export class ContentTypesCollection implements ICollection<
|
|
9
|
-
types:
|
|
8
|
+
export class ContentTypesCollection implements ICollection<InCodeTypeSpec> {
|
|
9
|
+
types: InCodeTypeSpec[];
|
|
10
10
|
name: string;
|
|
11
11
|
title?: string;
|
|
12
12
|
icon?: string;
|
|
@@ -25,12 +25,12 @@ export class ContentTypesCollection implements ICollection<InCodeTypeDefinition>
|
|
|
25
25
|
return this.types;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
[Symbol.iterator](): Iterator<
|
|
28
|
+
[Symbol.iterator](): Iterator<InCodeTypeSpec> {
|
|
29
29
|
let index = 0;
|
|
30
30
|
const types = this.types;
|
|
31
31
|
|
|
32
32
|
return {
|
|
33
|
-
next(): IteratorResult<
|
|
33
|
+
next(): IteratorResult<InCodeTypeSpec> {
|
|
34
34
|
if (index < types.length) {
|
|
35
35
|
return { value: types[index++], done: false };
|
|
36
36
|
} else {
|
|
@@ -40,11 +40,11 @@ export class ContentTypesCollection implements ICollection<InCodeTypeDefinition>
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
map<U>(callback: (type:
|
|
43
|
+
map<U>(callback: (type: InCodeTypeSpec, index: number) => U): U[] {
|
|
44
44
|
return this.types.map(callback);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
getTypeByName(name: string):
|
|
47
|
+
getTypeByName(name: string): InCodeTypeSpec | undefined {
|
|
48
48
|
return this.types.find(type => type.name === name);
|
|
49
49
|
}
|
|
50
50
|
|