@vertesia/tools-sdk 1.2.0 → 1.4.0-dev.20260615.042549Z
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/{types/ActivityCollection.d.ts → ActivityCollection.d.ts} +7 -7
- package/lib/ActivityCollection.d.ts.map +1 -0
- package/lib/{esm/ActivityCollection.js → ActivityCollection.js} +6 -6
- package/lib/ActivityCollection.js.map +1 -0
- package/lib/{types/ContentTypesCollection.d.ts → ContentTypesCollection.d.ts} +2 -2
- package/lib/ContentTypesCollection.d.ts.map +1 -0
- package/lib/{esm/ContentTypesCollection.js → ContentTypesCollection.js} +3 -3
- package/lib/ContentTypesCollection.js.map +1 -0
- package/lib/{types/InteractionCollection.d.ts → InteractionCollection.d.ts} +2 -2
- package/lib/InteractionCollection.d.ts.map +1 -0
- package/lib/{esm/InteractionCollection.js → InteractionCollection.js} +3 -3
- package/lib/InteractionCollection.js.map +1 -0
- package/lib/{types/RenderingTemplateCollection.d.ts → RenderingTemplateCollection.d.ts} +1 -1
- package/lib/RenderingTemplateCollection.d.ts.map +1 -0
- package/lib/{esm/RenderingTemplateCollection.js → RenderingTemplateCollection.js} +3 -3
- package/lib/RenderingTemplateCollection.js.map +1 -0
- package/lib/{types/SkillCollection.d.ts → SkillCollection.d.ts} +5 -5
- package/lib/SkillCollection.d.ts.map +1 -0
- package/lib/{esm/SkillCollection.js → SkillCollection.js} +68 -51
- package/lib/SkillCollection.js.map +1 -0
- package/lib/{types/ToolCollection.d.ts → ToolCollection.d.ts} +10 -10
- package/lib/ToolCollection.d.ts.map +1 -0
- package/lib/{esm/ToolCollection.js → ToolCollection.js} +21 -18
- package/lib/ToolCollection.js.map +1 -0
- package/lib/ToolRegistry.d.ts +22 -0
- package/lib/ToolRegistry.d.ts.map +1 -0
- package/lib/{esm/ToolRegistry.js → ToolRegistry.js} +6 -36
- package/lib/ToolRegistry.js.map +1 -0
- package/lib/{types/auth.d.ts → auth.d.ts} +5 -5
- package/lib/auth.d.ts.map +1 -0
- package/lib/{esm/auth.js → auth.js} +23 -17
- package/lib/auth.js.map +1 -0
- package/lib/build/validate.d.ts.map +1 -0
- package/lib/build/validate.js.map +1 -0
- package/lib/copy-assets.d.ts.map +1 -0
- package/lib/{esm/copy-assets.js → copy-assets.js} +4 -7
- package/lib/copy-assets.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/lib/server/activities.d.ts +4 -0
- package/lib/server/activities.d.ts.map +1 -0
- package/lib/{esm/server → server}/activities.js +12 -9
- package/lib/server/activities.js.map +1 -0
- package/lib/server/app-package.d.ts +12 -0
- package/lib/server/app-package.d.ts.map +1 -0
- package/lib/server/app-package.js +197 -0
- package/lib/server/app-package.js.map +1 -0
- package/lib/server/content-types.d.ts +4 -0
- package/lib/server/content-types.d.ts.map +1 -0
- package/lib/server/content-types.js +100 -0
- package/lib/server/content-types.js.map +1 -0
- package/lib/server/dashboards.d.ts +4 -0
- package/lib/server/dashboards.d.ts.map +1 -0
- package/lib/server/dashboards.js +25 -0
- package/lib/server/dashboards.js.map +1 -0
- package/lib/server/interactions.d.ts +4 -0
- package/lib/server/interactions.d.ts.map +1 -0
- package/lib/{esm/server → server}/interactions.js +16 -16
- package/lib/server/interactions.js.map +1 -0
- package/lib/server/mcp.d.ts +4 -0
- package/lib/server/mcp.d.ts.map +1 -0
- package/lib/{esm/server → server}/mcp.js +5 -4
- package/lib/server/mcp.js.map +1 -0
- package/lib/server/processes.d.ts +4 -0
- package/lib/server/processes.d.ts.map +1 -0
- package/lib/server/processes.js +26 -0
- package/lib/server/processes.js.map +1 -0
- package/lib/server/site.d.ts +4 -0
- package/lib/server/site.d.ts.map +1 -0
- package/lib/{esm/server → server}/site.js +4 -2
- package/lib/server/site.js.map +1 -0
- package/lib/server/skills.d.ts +4 -0
- package/lib/server/skills.d.ts.map +1 -0
- package/lib/{esm/server → server}/skills.js +14 -12
- package/lib/server/skills.js.map +1 -0
- package/lib/server/templates.d.ts +4 -0
- package/lib/server/templates.d.ts.map +1 -0
- package/lib/{esm/server → server}/templates.js +10 -10
- package/lib/server/templates.js.map +1 -0
- package/lib/server/tools.d.ts +4 -0
- package/lib/server/tools.d.ts.map +1 -0
- package/lib/{esm/server → server}/tools.js +7 -9
- package/lib/server/tools.js.map +1 -0
- package/lib/{types/server → server}/types.d.ts +21 -16
- package/lib/server/types.d.ts.map +1 -0
- package/lib/{cjs → server}/types.js.map +1 -1
- package/lib/server/widgets.d.ts +4 -0
- package/lib/server/widgets.d.ts.map +1 -0
- package/lib/server/widgets.js.map +1 -0
- package/lib/{types/server.d.ts → server.d.ts} +3 -3
- package/lib/server.d.ts.map +1 -0
- package/lib/{esm/server.js → server.js} +28 -22
- package/lib/server.js.map +1 -0
- package/lib/site/styles.d.ts.map +1 -0
- package/lib/{esm/site → site}/styles.js.map +1 -1
- package/lib/{types/site → site}/templates.d.ts +9 -9
- package/lib/site/templates.d.ts.map +1 -0
- package/lib/{esm/site → site}/templates.js +152 -98
- package/lib/site/templates.js.map +1 -0
- package/lib/{types/types.d.ts → types.d.ts} +29 -16
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/{esm/utils.js → utils.js} +11 -5
- package/lib/utils.js.map +1 -0
- package/package.json +21 -23
- package/src/ActivityCollection.test.ts +60 -59
- package/src/ActivityCollection.ts +27 -20
- package/src/ContentTypesCollection.ts +6 -9
- package/src/InteractionCollection.ts +6 -8
- package/src/RenderingTemplateCollection.ts +49 -51
- package/src/SkillCollection.ts +91 -72
- package/src/ToolCollection.ts +52 -43
- package/src/ToolRegistry.ts +20 -50
- package/src/auth.ts +35 -27
- package/src/copy-assets.ts +5 -12
- package/src/index.ts +15 -15
- package/src/server/activities.test.ts +70 -67
- package/src/server/activities.ts +17 -13
- package/src/server/app-package.test.ts +140 -0
- package/src/server/app-package.ts +115 -52
- package/src/server/content-types.test.ts +64 -0
- package/src/server/content-types.ts +53 -25
- package/src/server/dashboards.ts +31 -0
- package/src/server/interactions.ts +29 -28
- package/src/server/mcp.ts +16 -16
- package/src/server/processes.ts +35 -0
- package/src/server/site.ts +7 -15
- package/src/server/skills.ts +19 -18
- package/src/server/templates.ts +82 -80
- package/src/server/tools.ts +12 -16
- package/src/server/types.ts +29 -20
- package/src/server/widgets.ts +5 -9
- package/src/server.ts +55 -47
- package/src/site/styles.ts +1 -1
- package/src/site/templates.ts +259 -157
- package/src/types.ts +55 -31
- package/src/utils.ts +11 -6
- package/lib/cjs/ActivityCollection.js +0 -93
- package/lib/cjs/ActivityCollection.js.map +0 -1
- package/lib/cjs/ContentTypesCollection.js +0 -43
- package/lib/cjs/ContentTypesCollection.js.map +0 -1
- package/lib/cjs/InteractionCollection.js +0 -43
- package/lib/cjs/InteractionCollection.js.map +0 -1
- package/lib/cjs/RenderingTemplateCollection.js +0 -43
- package/lib/cjs/RenderingTemplateCollection.js.map +0 -1
- package/lib/cjs/SkillCollection.js +0 -384
- package/lib/cjs/SkillCollection.js.map +0 -1
- package/lib/cjs/ToolCollection.js +0 -221
- package/lib/cjs/ToolCollection.js.map +0 -1
- package/lib/cjs/ToolRegistry.js +0 -95
- package/lib/cjs/ToolRegistry.js.map +0 -1
- package/lib/cjs/auth.js +0 -131
- package/lib/cjs/auth.js.map +0 -1
- package/lib/cjs/build/validate.js +0 -7
- package/lib/cjs/build/validate.js.map +0 -1
- package/lib/cjs/copy-assets.js +0 -84
- package/lib/cjs/copy-assets.js.map +0 -1
- package/lib/cjs/index.js +0 -34
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/server/activities.js +0 -103
- package/lib/cjs/server/activities.js.map +0 -1
- package/lib/cjs/server/app-package.js +0 -154
- package/lib/cjs/server/app-package.js.map +0 -1
- package/lib/cjs/server/content-types.js +0 -73
- package/lib/cjs/server/content-types.js.map +0 -1
- package/lib/cjs/server/interactions.js +0 -101
- package/lib/cjs/server/interactions.js.map +0 -1
- package/lib/cjs/server/mcp.js +0 -45
- package/lib/cjs/server/mcp.js.map +0 -1
- package/lib/cjs/server/site.js +0 -48
- package/lib/cjs/server/site.js.map +0 -1
- package/lib/cjs/server/skills.js +0 -124
- package/lib/cjs/server/skills.js.map +0 -1
- package/lib/cjs/server/templates.js +0 -67
- package/lib/cjs/server/templates.js.map +0 -1
- package/lib/cjs/server/tools.js +0 -87
- package/lib/cjs/server/tools.js.map +0 -1
- package/lib/cjs/server/types.js +0 -3
- package/lib/cjs/server/types.js.map +0 -1
- package/lib/cjs/server/widgets.js +0 -27
- package/lib/cjs/server/widgets.js.map +0 -1
- package/lib/cjs/server.js +0 -142
- package/lib/cjs/server.js.map +0 -1
- package/lib/cjs/site/styles.js +0 -692
- package/lib/cjs/site/styles.js.map +0 -1
- package/lib/cjs/site/templates.js +0 -1320
- package/lib/cjs/site/templates.js.map +0 -1
- package/lib/cjs/types.js +0 -3
- package/lib/cjs/utils.js +0 -44
- package/lib/cjs/utils.js.map +0 -1
- package/lib/esm/ActivityCollection.js.map +0 -1
- package/lib/esm/ContentTypesCollection.js.map +0 -1
- package/lib/esm/InteractionCollection.js.map +0 -1
- package/lib/esm/RenderingTemplateCollection.js.map +0 -1
- package/lib/esm/SkillCollection.js.map +0 -1
- package/lib/esm/ToolCollection.js.map +0 -1
- package/lib/esm/ToolRegistry.js.map +0 -1
- package/lib/esm/auth.js.map +0 -1
- package/lib/esm/build/validate.js.map +0 -1
- package/lib/esm/copy-assets.js.map +0 -1
- package/lib/esm/index.js +0 -14
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/server/activities.js.map +0 -1
- package/lib/esm/server/app-package.js +0 -151
- package/lib/esm/server/app-package.js.map +0 -1
- package/lib/esm/server/content-types.js +0 -70
- package/lib/esm/server/content-types.js.map +0 -1
- package/lib/esm/server/interactions.js.map +0 -1
- package/lib/esm/server/mcp.js.map +0 -1
- package/lib/esm/server/site.js.map +0 -1
- package/lib/esm/server/skills.js.map +0 -1
- package/lib/esm/server/templates.js.map +0 -1
- package/lib/esm/server/tools.js.map +0 -1
- package/lib/esm/server/types.js.map +0 -1
- package/lib/esm/server/widgets.js.map +0 -1
- package/lib/esm/server.js.map +0 -1
- package/lib/esm/site/templates.js.map +0 -1
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/utils.js.map +0 -1
- package/lib/types/ActivityCollection.d.ts.map +0 -1
- package/lib/types/ContentTypesCollection.d.ts.map +0 -1
- package/lib/types/InteractionCollection.d.ts.map +0 -1
- package/lib/types/RenderingTemplateCollection.d.ts.map +0 -1
- package/lib/types/SkillCollection.d.ts.map +0 -1
- package/lib/types/ToolCollection.d.ts.map +0 -1
- package/lib/types/ToolRegistry.d.ts +0 -22
- package/lib/types/ToolRegistry.d.ts.map +0 -1
- package/lib/types/auth.d.ts.map +0 -1
- package/lib/types/build/validate.d.ts.map +0 -1
- package/lib/types/copy-assets.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -14
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/server/activities.d.ts +0 -4
- package/lib/types/server/activities.d.ts.map +0 -1
- package/lib/types/server/app-package.d.ts +0 -4
- package/lib/types/server/app-package.d.ts.map +0 -1
- package/lib/types/server/content-types.d.ts +0 -4
- package/lib/types/server/content-types.d.ts.map +0 -1
- package/lib/types/server/interactions.d.ts +0 -4
- package/lib/types/server/interactions.d.ts.map +0 -1
- package/lib/types/server/mcp.d.ts +0 -4
- package/lib/types/server/mcp.d.ts.map +0 -1
- package/lib/types/server/site.d.ts +0 -4
- package/lib/types/server/site.d.ts.map +0 -1
- package/lib/types/server/skills.d.ts +0 -4
- package/lib/types/server/skills.d.ts.map +0 -1
- package/lib/types/server/templates.d.ts +0 -4
- package/lib/types/server/templates.d.ts.map +0 -1
- package/lib/types/server/tools.d.ts +0 -4
- package/lib/types/server/tools.d.ts.map +0 -1
- package/lib/types/server/types.d.ts.map +0 -1
- package/lib/types/server/widgets.d.ts +0 -4
- package/lib/types/server/widgets.d.ts.map +0 -1
- package/lib/types/server.d.ts.map +0 -1
- package/lib/types/site/styles.d.ts.map +0 -1
- package/lib/types/site/templates.d.ts.map +0 -1
- package/lib/types/types.d.ts.map +0 -1
- package/lib/types/utils.d.ts.map +0 -1
- /package/lib/{types/build → build}/validate.d.ts +0 -0
- /package/lib/{esm/build → build}/validate.js +0 -0
- /package/lib/{types/copy-assets.d.ts → copy-assets.d.ts} +0 -0
- /package/lib/{esm/server → server}/types.js +0 -0
- /package/lib/{esm/server → server}/widgets.js +0 -0
- /package/lib/{types/site → site}/styles.d.ts +0 -0
- /package/lib/{esm/site → site}/styles.js +0 -0
- /package/lib/{esm/types.js → types.js} +0 -0
- /package/lib/{types/utils.d.ts → utils.d.ts} +0 -0
package/src/site/templates.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { RemoteActivityDefinition } from
|
|
2
|
-
import type { ActivityCollection } from
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type { ICollection,
|
|
10
|
-
import { join } from
|
|
11
|
-
import { baseStyles } from
|
|
1
|
+
import type { RemoteActivityDefinition } from '@vertesia/common';
|
|
2
|
+
import type { ActivityCollection } from '../ActivityCollection.js';
|
|
3
|
+
import type { ContentTypesCollection } from '../ContentTypesCollection.js';
|
|
4
|
+
import type { InteractionCollection } from '../InteractionCollection.js';
|
|
5
|
+
import type { RenderingTemplateCollection } from '../RenderingTemplateCollection.js';
|
|
6
|
+
import type { SkillCollection } from '../SkillCollection.js';
|
|
7
|
+
import type { ToolServerConfig } from '../server/types.js';
|
|
8
|
+
import type { ToolCollection } from '../ToolCollection.js';
|
|
9
|
+
import type { ICollection, RenderingTemplateDefinition, SkillDefinition, Tool } from '../types.js';
|
|
10
|
+
import { join } from '../utils.js';
|
|
11
|
+
import { baseStyles } from './styles.js';
|
|
12
12
|
|
|
13
13
|
type MCPProviderMeta = {
|
|
14
14
|
name: string;
|
|
@@ -18,17 +18,17 @@ type MCPProviderMeta = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Default icon SVG for collections without a custom icon
|
|
20
20
|
*/
|
|
21
|
-
const defaultIcon = /*html
|
|
21
|
+
const defaultIcon = /*html*/ `
|
|
22
22
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
23
23
|
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>
|
|
24
24
|
</svg>`;
|
|
25
25
|
|
|
26
|
-
const skillIcon = /*html
|
|
26
|
+
const skillIcon = /*html*/ `
|
|
27
27
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
28
28
|
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
|
29
29
|
</svg>`;
|
|
30
30
|
|
|
31
|
-
const templateIcon = /*html
|
|
31
|
+
const templateIcon = /*html*/ `
|
|
32
32
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
33
33
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
34
34
|
<polyline points="14 2 14 8 20 8"/>
|
|
@@ -37,7 +37,7 @@ const templateIcon = /*html*/`
|
|
|
37
37
|
<polyline points="10 9 9 9 8 9"/>
|
|
38
38
|
</svg>`;
|
|
39
39
|
|
|
40
|
-
const activityIcon = /*html
|
|
40
|
+
const activityIcon = /*html*/ `
|
|
41
41
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
42
42
|
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>
|
|
43
43
|
</svg>`;
|
|
@@ -45,7 +45,7 @@ const activityIcon = /*html*/`
|
|
|
45
45
|
/**
|
|
46
46
|
* Extended styles for detail pages
|
|
47
47
|
*/
|
|
48
|
-
const detailStyles = /*css
|
|
48
|
+
const detailStyles = /*css*/ `
|
|
49
49
|
${baseStyles}
|
|
50
50
|
|
|
51
51
|
.nav {
|
|
@@ -363,7 +363,7 @@ function highlightJson(obj: unknown): string {
|
|
|
363
363
|
/**
|
|
364
364
|
* Back navigation arrow
|
|
365
365
|
*/
|
|
366
|
-
const backArrow = /*html
|
|
366
|
+
const backArrow = /*html*/ `
|
|
367
367
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
368
368
|
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
|
369
369
|
</svg>`;
|
|
@@ -371,7 +371,7 @@ const backArrow = /*html*/`
|
|
|
371
371
|
/**
|
|
372
372
|
* Copy icon
|
|
373
373
|
*/
|
|
374
|
-
const copyIcon = /*html
|
|
374
|
+
const copyIcon = /*html*/ `
|
|
375
375
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
376
376
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
377
377
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
@@ -380,7 +380,7 @@ const copyIcon = /*html*/`
|
|
|
380
380
|
/**
|
|
381
381
|
* File icon
|
|
382
382
|
*/
|
|
383
|
-
const fileIcon = /*html
|
|
383
|
+
const fileIcon = /*html*/ `
|
|
384
384
|
<svg class="script-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
385
385
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
386
386
|
<polyline points="14 2 14 8 20 8"></polyline>
|
|
@@ -390,7 +390,7 @@ const fileIcon = /*html*/`
|
|
|
390
390
|
* Render a collection card for the index page
|
|
391
391
|
*/
|
|
392
392
|
export function collectionCard(collection: ICollection, pathPrefix: string, meta?: string): string {
|
|
393
|
-
return /*html
|
|
393
|
+
return /*html*/ `
|
|
394
394
|
<a class="card" href="/${pathPrefix}/${collection.name}" data-collection-type="${pathPrefix}" data-collection-name="${collection.name}">
|
|
395
395
|
<div class="card-icon">${collection.icon || defaultIcon}</div>
|
|
396
396
|
<div class="card-title">${collection.title || collection.name}</div>
|
|
@@ -403,13 +403,17 @@ export function collectionCard(collection: ICollection, pathPrefix: string, meta
|
|
|
403
403
|
* Render a tool card (simple version for lists)
|
|
404
404
|
*/
|
|
405
405
|
export function toolCard(tool: Tool<Record<string, unknown>>): string {
|
|
406
|
-
return /*html
|
|
406
|
+
return /*html*/ `
|
|
407
407
|
<div class="item-card">
|
|
408
408
|
<div class="item-name">${tool.name}</div>
|
|
409
409
|
<div class="item-desc">${tool.description || ''}</div>
|
|
410
|
-
${
|
|
410
|
+
${
|
|
411
|
+
tool.input_schema
|
|
412
|
+
? /*html*/ `
|
|
411
413
|
<div class="item-schema">${JSON.stringify(tool.input_schema, null, 2)}</div>
|
|
412
|
-
`
|
|
414
|
+
`
|
|
415
|
+
: ''
|
|
416
|
+
}
|
|
413
417
|
</div>`;
|
|
414
418
|
}
|
|
415
419
|
|
|
@@ -417,7 +421,7 @@ export function toolCard(tool: Tool<Record<string, unknown>>): string {
|
|
|
417
421
|
* Render an MCP provider card
|
|
418
422
|
*/
|
|
419
423
|
export function mcpProviderCard(provider: MCPProviderMeta): string {
|
|
420
|
-
return /*html
|
|
424
|
+
return /*html*/ `
|
|
421
425
|
<a class="card" href="/api/mcp/${provider.name}">
|
|
422
426
|
<div class="card-title">${provider.name}</div>
|
|
423
427
|
<div class="card-desc">${provider.description || ''}</div>
|
|
@@ -432,7 +436,7 @@ export function toolDetailCard(tool: Tool<Record<string, unknown>>, collectionNa
|
|
|
432
436
|
const properties = (schema as Record<string, unknown>)?.properties as Record<string, unknown> | undefined;
|
|
433
437
|
const required = (schema as Record<string, unknown>)?.required as string[] | undefined;
|
|
434
438
|
|
|
435
|
-
return /*html
|
|
439
|
+
return /*html*/ `
|
|
436
440
|
<div class="detail-card">
|
|
437
441
|
<div class="detail-header">
|
|
438
442
|
<div>
|
|
@@ -454,15 +458,20 @@ export function toolDetailCard(tool: Tool<Record<string, unknown>>, collectionNa
|
|
|
454
458
|
</div>
|
|
455
459
|
</div>
|
|
456
460
|
|
|
457
|
-
${
|
|
461
|
+
${
|
|
462
|
+
schema
|
|
463
|
+
? /*html*/ `
|
|
458
464
|
<div class="detail-section">
|
|
459
465
|
<h4 class="detail-section-title">Input Schema</h4>
|
|
460
|
-
${
|
|
466
|
+
${
|
|
467
|
+
properties
|
|
468
|
+
? /*html*/ `
|
|
461
469
|
<div class="info-grid" style="margin-bottom: 1rem;">
|
|
462
|
-
${Object.entries(properties)
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
470
|
+
${Object.entries(properties)
|
|
471
|
+
.map(([key, value]) => {
|
|
472
|
+
const prop = value as Record<string, unknown>;
|
|
473
|
+
const isRequired = required?.includes(key);
|
|
474
|
+
return /*html*/ `
|
|
466
475
|
<div class="info-item">
|
|
467
476
|
<div class="info-label">${key}${isRequired ? ' *' : ''}</div>
|
|
468
477
|
<div class="info-value">
|
|
@@ -470,19 +479,24 @@ export function toolDetailCard(tool: Tool<Record<string, unknown>>, collectionNa
|
|
|
470
479
|
${prop.description ? `<br><span style="color: #6b7280; font-size: 0.85rem;">${prop.description}</span>` : ''}
|
|
471
480
|
</div>
|
|
472
481
|
</div>`;
|
|
473
|
-
|
|
482
|
+
})
|
|
483
|
+
.join('')}
|
|
474
484
|
</div>
|
|
475
|
-
`
|
|
485
|
+
`
|
|
486
|
+
: ''
|
|
487
|
+
}
|
|
476
488
|
<details>
|
|
477
489
|
<summary style="cursor: pointer; color: #6b7280; font-size: 0.85rem;">View full schema</summary>
|
|
478
490
|
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(schema)}</div>
|
|
479
491
|
</details>
|
|
480
492
|
</div>
|
|
481
|
-
`
|
|
493
|
+
`
|
|
494
|
+
: /*html*/ `
|
|
482
495
|
<div class="detail-section">
|
|
483
496
|
<div class="empty-state">No input schema defined</div>
|
|
484
497
|
</div>
|
|
485
|
-
`
|
|
498
|
+
`
|
|
499
|
+
}
|
|
486
500
|
</div>
|
|
487
501
|
</div>`;
|
|
488
502
|
}
|
|
@@ -491,7 +505,7 @@ export function toolDetailCard(tool: Tool<Record<string, unknown>>, collectionNa
|
|
|
491
505
|
* Render a skill card (simple version for lists)
|
|
492
506
|
*/
|
|
493
507
|
export function skillCard(skill: SkillDefinition): string {
|
|
494
|
-
return /*html
|
|
508
|
+
return /*html*/ `
|
|
495
509
|
<div class="item-card skill">
|
|
496
510
|
<div class="item-name">${skill.name}</div>
|
|
497
511
|
<div class="item-desc">${skill.description || ''}</div>
|
|
@@ -507,16 +521,22 @@ function skillWidgetsTemplate(skillWidgets: string[] | undefined) {
|
|
|
507
521
|
if (!skillWidgets || skillWidgets.length === 0) {
|
|
508
522
|
return 'n/a';
|
|
509
523
|
}
|
|
510
|
-
return skillWidgets
|
|
524
|
+
return skillWidgets
|
|
525
|
+
.map(
|
|
526
|
+
(
|
|
527
|
+
w,
|
|
528
|
+
) => `<div style='display: flex; align-items: center; gap: 0.5rem; width:100%;justify-content: space-between;'><span>${w}</span>
|
|
511
529
|
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/widgets/${w}.js')" title="Copy endpoint URL">
|
|
512
530
|
${copyIcon}
|
|
513
531
|
</button>
|
|
514
|
-
</div
|
|
532
|
+
</div>`,
|
|
533
|
+
)
|
|
534
|
+
.join('');
|
|
515
535
|
}
|
|
516
536
|
|
|
517
537
|
function renderSkillUrl(skill: SkillDefinition, collectionName: string): string {
|
|
518
538
|
const skillPath = `/api/skills/${collectionName}/${skill.name}`;
|
|
519
|
-
return /*html
|
|
539
|
+
return /*html*/ `<div class="script-item" style='display: flex; align-items: center; gap: 0.5rem; width:100%;justify-content: space-between;'><span class="script-name">${skillPath}</span>
|
|
520
540
|
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '${skillPath}')" title="Copy endpoint URL">
|
|
521
541
|
${copyIcon}
|
|
522
542
|
</button>
|
|
@@ -530,9 +550,9 @@ export function skillDetailCard(skill: SkillDefinition, collection: SkillCollect
|
|
|
530
550
|
const hasKeywords = skill.context_triggers?.keywords?.length;
|
|
531
551
|
const hasPackages = skill.execution?.packages?.length;
|
|
532
552
|
const hasScripts = skill.scripts?.length;
|
|
533
|
-
const hasRelatedTools = skill.
|
|
553
|
+
const hasRelatedTools = skill.tools?.length;
|
|
534
554
|
|
|
535
|
-
return /*html
|
|
555
|
+
return /*html*/ `
|
|
536
556
|
<div class="detail-card">
|
|
537
557
|
<div class="detail-header">
|
|
538
558
|
<div>
|
|
@@ -543,7 +563,7 @@ export function skillDetailCard(skill: SkillDefinition, collection: SkillCollect
|
|
|
543
563
|
<div class="detail-badges">
|
|
544
564
|
<span class="badge skill-type-badge">Skill</span>
|
|
545
565
|
${skill.execution?.language ? `<span class="badge ${skill.execution.language}">${skill.execution.language}</span>` : ''}
|
|
546
|
-
${hasRelatedTools ? `<span class="badge" style="background: #8b5cf6; color: white;">Unlocks ${skill.
|
|
566
|
+
${hasRelatedTools ? `<span class="badge" style="background: #8b5cf6; color: white;">Unlocks ${skill.tools?.length} tool${skill.tools?.length !== 1 ? 's' : ''}</span>` : ''}
|
|
547
567
|
</div>
|
|
548
568
|
</div>
|
|
549
569
|
<div class="detail-body">
|
|
@@ -552,59 +572,83 @@ export function skillDetailCard(skill: SkillDefinition, collection: SkillCollect
|
|
|
552
572
|
<div class="info-label">Content Type</div>
|
|
553
573
|
<div class="info-value">${skill.content_type === 'jst' ? 'Dynamic (JST Template)' : 'Static (Markdown)'}</div>
|
|
554
574
|
</div>
|
|
555
|
-
${
|
|
575
|
+
${
|
|
576
|
+
skill.execution?.language
|
|
577
|
+
? /*html*/ `
|
|
556
578
|
<div class="info-item">
|
|
557
579
|
<div class="info-label">Language</div>
|
|
558
580
|
<div class="info-value"><code>${skill.execution.language}</code></div>
|
|
559
581
|
</div>
|
|
560
|
-
`
|
|
582
|
+
`
|
|
583
|
+
: ''
|
|
584
|
+
}
|
|
561
585
|
<div class="info-item">
|
|
562
586
|
<div class="info-label">Widgets</div>
|
|
563
587
|
<div class="info-value">${skillWidgetsTemplate(skill.widgets)}</div>
|
|
564
588
|
</div>
|
|
565
589
|
</div>
|
|
566
590
|
|
|
567
|
-
${
|
|
591
|
+
${
|
|
592
|
+
hasRelatedTools
|
|
593
|
+
? /*html*/ `
|
|
568
594
|
<div class="detail-section">
|
|
569
595
|
<h4 class="detail-section-title">Unlocks Tools</h4>
|
|
570
596
|
<p style="color: #6b7280; font-size: 0.85rem; margin: 0 0 0.75rem 0;">These tools become available when this skill is activated:</p>
|
|
571
597
|
<div class="package-list">
|
|
572
|
-
${skill.
|
|
598
|
+
${skill.tools?.map((tool) => `<span class="package-tag" style="background: #ede9fe; color: #6d28d9;">${tool}</span>`).join('')}
|
|
573
599
|
</div>
|
|
574
600
|
</div>
|
|
575
|
-
`
|
|
601
|
+
`
|
|
602
|
+
: ''
|
|
603
|
+
}
|
|
576
604
|
|
|
577
|
-
${
|
|
605
|
+
${
|
|
606
|
+
hasKeywords
|
|
607
|
+
? /*html*/ `
|
|
578
608
|
<div class="detail-section">
|
|
579
609
|
<h4 class="detail-section-title">Trigger Keywords</h4>
|
|
580
610
|
<div class="keyword-list">
|
|
581
|
-
${skill.context_triggers?.keywords?.map(kw => `<span class="keyword-tag">${kw}</span>`).join('')}
|
|
611
|
+
${skill.context_triggers?.keywords?.map((kw) => `<span class="keyword-tag">${kw}</span>`).join('')}
|
|
582
612
|
</div>
|
|
583
613
|
</div>
|
|
584
|
-
`
|
|
614
|
+
`
|
|
615
|
+
: ''
|
|
616
|
+
}
|
|
585
617
|
|
|
586
|
-
${
|
|
618
|
+
${
|
|
619
|
+
hasPackages
|
|
620
|
+
? /*html*/ `
|
|
587
621
|
<div class="detail-section">
|
|
588
622
|
<h4 class="detail-section-title">Required Packages</h4>
|
|
589
623
|
<div class="package-list">
|
|
590
|
-
${skill.execution?.packages?.map(pkg => `<span class="package-tag">${pkg}</span>`).join('')}
|
|
624
|
+
${skill.execution?.packages?.map((pkg) => `<span class="package-tag">${pkg}</span>`).join('')}
|
|
591
625
|
</div>
|
|
592
626
|
</div>
|
|
593
|
-
`
|
|
627
|
+
`
|
|
628
|
+
: ''
|
|
629
|
+
}
|
|
594
630
|
|
|
595
|
-
${
|
|
631
|
+
${
|
|
632
|
+
hasScripts
|
|
633
|
+
? /*html*/ `
|
|
596
634
|
<div class="detail-section">
|
|
597
635
|
<h4 class="detail-section-title">Bundled Scripts</h4>
|
|
598
636
|
<div class="script-list">
|
|
599
|
-
${skill.scripts
|
|
637
|
+
${skill.scripts
|
|
638
|
+
?.map(
|
|
639
|
+
(script) => /*html*/ `
|
|
600
640
|
<div class="script-item">
|
|
601
641
|
${fileIcon}
|
|
602
|
-
<span class="script-name">${join(
|
|
642
|
+
<span class="script-name">${join('/scripts', script)}</span>
|
|
603
643
|
</div>
|
|
604
|
-
|
|
644
|
+
`,
|
|
645
|
+
)
|
|
646
|
+
.join('')}
|
|
605
647
|
</div>
|
|
606
648
|
</div>
|
|
607
|
-
`
|
|
649
|
+
`
|
|
650
|
+
: ''
|
|
651
|
+
}
|
|
608
652
|
|
|
609
653
|
<div class="detail-section">
|
|
610
654
|
<h4 class="detail-section-title">Instructions Preview</h4>
|
|
@@ -619,7 +663,7 @@ export function skillDetailCard(skill: SkillDefinition, collection: SkillCollect
|
|
|
619
663
|
*/
|
|
620
664
|
function renderTemplateUrl(template: RenderingTemplateDefinition, collectionName: string): string {
|
|
621
665
|
const templatePath = `/api/templates/${collectionName}/${template.name}`;
|
|
622
|
-
return /*html
|
|
666
|
+
return /*html*/ `<div class="script-item" style='display: flex; align-items: center; gap: 0.5rem; width:100%;justify-content: space-between;'><span class="script-name">${templatePath}</span>
|
|
623
667
|
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '${templatePath}')" title="Copy endpoint URL">
|
|
624
668
|
${copyIcon}
|
|
625
669
|
</button>
|
|
@@ -631,11 +675,11 @@ function renderTemplateUrl(template: RenderingTemplateDefinition, collectionName
|
|
|
631
675
|
*/
|
|
632
676
|
function tagList(tags: string[] | undefined): string {
|
|
633
677
|
if (!tags || tags.length === 0) return '';
|
|
634
|
-
return /*html
|
|
678
|
+
return /*html*/ `
|
|
635
679
|
<div class="detail-section">
|
|
636
680
|
<h4 class="detail-section-title">Tags</h4>
|
|
637
681
|
<div class="keyword-list">
|
|
638
|
-
${tags.map(tag => `<span class="keyword-tag">${tag}</span>`).join('')}
|
|
682
|
+
${tags.map((tag) => `<span class="keyword-tag">${tag}</span>`).join('')}
|
|
639
683
|
</div>
|
|
640
684
|
</div>`;
|
|
641
685
|
}
|
|
@@ -645,16 +689,20 @@ function tagList(tags: string[] | undefined): string {
|
|
|
645
689
|
*/
|
|
646
690
|
function assetList(assets: string[]): string {
|
|
647
691
|
if (assets.length === 0) return '';
|
|
648
|
-
return /*html
|
|
692
|
+
return /*html*/ `
|
|
649
693
|
<div class="detail-section">
|
|
650
694
|
<h4 class="detail-section-title">Assets</h4>
|
|
651
695
|
<div class="script-list">
|
|
652
|
-
${assets
|
|
696
|
+
${assets
|
|
697
|
+
.map(
|
|
698
|
+
(asset) => /*html*/ `
|
|
653
699
|
<div class="script-item">
|
|
654
700
|
${fileIcon}
|
|
655
701
|
<span class="script-name">${asset}</span>
|
|
656
702
|
</div>
|
|
657
|
-
|
|
703
|
+
`,
|
|
704
|
+
)
|
|
705
|
+
.join('')}
|
|
658
706
|
</div>
|
|
659
707
|
</div>`;
|
|
660
708
|
}
|
|
@@ -663,7 +711,7 @@ function assetList(assets: string[]): string {
|
|
|
663
711
|
* Render an instructions preview section
|
|
664
712
|
*/
|
|
665
713
|
function instructionsPreview(instructions: string): string {
|
|
666
|
-
return /*html
|
|
714
|
+
return /*html*/ `
|
|
667
715
|
<div class="detail-section">
|
|
668
716
|
<h4 class="detail-section-title">Instructions Preview</h4>
|
|
669
717
|
<div class="instructions-preview">${escapeHtml(instructions.slice(0, 1000))}${instructions.length > 1000 ? '...' : ''}</div>
|
|
@@ -673,8 +721,11 @@ function instructionsPreview(instructions: string): string {
|
|
|
673
721
|
/**
|
|
674
722
|
* Render a detailed template card
|
|
675
723
|
*/
|
|
676
|
-
export function templateDetailCard(
|
|
677
|
-
|
|
724
|
+
export function templateDetailCard(
|
|
725
|
+
template: RenderingTemplateDefinition,
|
|
726
|
+
collection: RenderingTemplateCollection,
|
|
727
|
+
): string {
|
|
728
|
+
return /*html*/ `
|
|
678
729
|
<div class="detail-card">
|
|
679
730
|
<div class="detail-header">
|
|
680
731
|
<div>
|
|
@@ -710,7 +761,7 @@ export function templateDetailCard(template: RenderingTemplateDefinition, collec
|
|
|
710
761
|
*/
|
|
711
762
|
export function templateCollectionPage(collection: RenderingTemplateCollection): string {
|
|
712
763
|
const templatesArray = Array.from(collection);
|
|
713
|
-
return /*html
|
|
764
|
+
return /*html*/ `
|
|
714
765
|
<!DOCTYPE html>
|
|
715
766
|
<html lang="en">
|
|
716
767
|
<head>
|
|
@@ -740,10 +791,11 @@ export function templateCollectionPage(collection: RenderingTemplateCollection):
|
|
|
740
791
|
|
|
741
792
|
<h2>${templatesArray.length} Template${templatesArray.length !== 1 ? 's' : ''}</h2>
|
|
742
793
|
|
|
743
|
-
${
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
794
|
+
${
|
|
795
|
+
templatesArray.length > 0
|
|
796
|
+
? templatesArray.map((template) => templateDetailCard(template, collection)).join('')
|
|
797
|
+
: '<div class="empty-state">No templates in this collection</div>'
|
|
798
|
+
}
|
|
747
799
|
</body>
|
|
748
800
|
</html>`;
|
|
749
801
|
}
|
|
@@ -765,18 +817,18 @@ function escapeHtml(str: string): string {
|
|
|
765
817
|
*/
|
|
766
818
|
function getInitials(title: string): string {
|
|
767
819
|
const words = title.trim().split(/\s+/).filter(Boolean);
|
|
768
|
-
if (!words.length) return
|
|
820
|
+
if (!words.length) return 'TS';
|
|
769
821
|
const initials = words
|
|
770
822
|
.slice(0, 2)
|
|
771
823
|
.map((word) => word.charAt(0).toUpperCase())
|
|
772
|
-
.join(
|
|
773
|
-
return initials ||
|
|
824
|
+
.join('');
|
|
825
|
+
return initials || 'TS';
|
|
774
826
|
}
|
|
775
827
|
|
|
776
828
|
function renderUILinks() {
|
|
777
829
|
const copyIconSvg = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`;
|
|
778
830
|
|
|
779
|
-
return /*html
|
|
831
|
+
return /*html*/ `
|
|
780
832
|
<div style="margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(156, 163, 175, 0.2); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;">
|
|
781
833
|
<a target="_blank" href="/ui/" class="plugin-link-primary" style="display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: #3b82f6; color: white; text-decoration: none; border-radius: 6px; font-size: 0.875rem; font-weight: 500; transition: background 0.15s;">
|
|
782
834
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
@@ -820,12 +872,10 @@ function copyPluginUrl(btn) {
|
|
|
820
872
|
* Note: The fourth argument is backward compatible:
|
|
821
873
|
* - If a string is passed, it is treated as the title.
|
|
822
874
|
* - If an array is passed, it is treated as MCP providers and the fifth argument (if any) is the title.
|
|
823
|
-
* @deprecated Static templates were replaced by a React site. Do not use them anymore.
|
|
875
|
+
* @deprecated Static templates were replaced by a React site. Do not use them anymore.
|
|
824
876
|
* Will be removed.
|
|
825
877
|
*/
|
|
826
|
-
export function indexPage(
|
|
827
|
-
config: ToolServerConfig
|
|
828
|
-
): string {
|
|
878
|
+
export function indexPage(config: ToolServerConfig): string {
|
|
829
879
|
const {
|
|
830
880
|
title = 'Tools Server',
|
|
831
881
|
tools = [],
|
|
@@ -838,8 +888,7 @@ export function indexPage(
|
|
|
838
888
|
hideUILinks = false,
|
|
839
889
|
} = config;
|
|
840
890
|
|
|
841
|
-
|
|
842
|
-
return /*html*/`
|
|
891
|
+
return /*html*/ `
|
|
843
892
|
<!DOCTYPE html>
|
|
844
893
|
<html lang="en">
|
|
845
894
|
<head>
|
|
@@ -862,13 +911,13 @@ export function indexPage(
|
|
|
862
911
|
Discover the tools, activities, skills, interactions, and content types exposed by this server.
|
|
863
912
|
</p>
|
|
864
913
|
<div class="hero-summary">
|
|
865
|
-
${tools.length ? /*html
|
|
866
|
-
${activities.length ? /*html
|
|
867
|
-
${skills.length ? /*html
|
|
868
|
-
${interactions.length ? /*html
|
|
869
|
-
${types.length ? /*html
|
|
870
|
-
${templates.length ? /*html
|
|
871
|
-
${mcpProviders.length ? /*html
|
|
914
|
+
${tools.length ? /*html*/ `<span><dot></dot> ${tools.length} tool collection${tools.length !== 1 ? 's' : ''}</span>` : ''}
|
|
915
|
+
${activities.length ? /*html*/ `<span><dot></dot> ${activities.length} activity collection${activities.length !== 1 ? 's' : ''}</span>` : ''}
|
|
916
|
+
${skills.length ? /*html*/ `<span><dot></dot> ${skills.length} skill collection${skills.length !== 1 ? 's' : ''}</span>` : ''}
|
|
917
|
+
${interactions.length ? /*html*/ `<span><dot></dot> ${interactions.length} interaction collection${interactions.length !== 1 ? 's' : ''}</span>` : ''}
|
|
918
|
+
${types.length ? /*html*/ `<span><dot></dot> ${types.length} content type collection${types.length !== 1 ? 's' : ''}</span>` : ''}
|
|
919
|
+
${templates.length ? /*html*/ `<span><dot></dot> ${templates.length} template collection${templates.length !== 1 ? 's' : ''}</span>` : ''}
|
|
920
|
+
${mcpProviders.length ? /*html*/ `<span><dot></dot> ${mcpProviders.length} MCP provider${mcpProviders.length !== 1 ? 's' : ''}</span>` : ''}
|
|
872
921
|
</div>
|
|
873
922
|
${hideUILinks ? '' : renderUILinks()}
|
|
874
923
|
</div>
|
|
@@ -907,19 +956,25 @@ export function indexPage(
|
|
|
907
956
|
</p>
|
|
908
957
|
</div>
|
|
909
958
|
|
|
910
|
-
${
|
|
959
|
+
${
|
|
960
|
+
tools.length > 0
|
|
961
|
+
? /*html*/ `
|
|
911
962
|
<section data-section="tools">
|
|
912
963
|
<div class="section-header">
|
|
913
964
|
<h2>Tool Collections</h2>
|
|
914
965
|
<p class="section-subtitle">Remote tools available to agents via Vertesia.</p>
|
|
915
966
|
</div>
|
|
916
967
|
<div class="card-grid">
|
|
917
|
-
${tools.map(t => collectionCard(t, 'tools')).join('')}
|
|
968
|
+
${tools.map((t) => collectionCard(t, 'tools')).join('')}
|
|
918
969
|
</div>
|
|
919
970
|
</section>
|
|
920
|
-
`
|
|
971
|
+
`
|
|
972
|
+
: ''
|
|
973
|
+
}
|
|
921
974
|
|
|
922
|
-
${
|
|
975
|
+
${
|
|
976
|
+
activities.length > 0
|
|
977
|
+
? /*html*/ `
|
|
923
978
|
<section data-section="activities">
|
|
924
979
|
<hr>
|
|
925
980
|
<div class="section-header">
|
|
@@ -927,15 +982,21 @@ export function indexPage(
|
|
|
927
982
|
<p class="section-subtitle">Remote activities for DSL workflows, invoked via HTTP.</p>
|
|
928
983
|
</div>
|
|
929
984
|
<div class="card-grid">
|
|
930
|
-
${activities
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
985
|
+
${activities
|
|
986
|
+
.map((a: ActivityCollection) => {
|
|
987
|
+
const count = a.getActivityDefinitions().length;
|
|
988
|
+
return collectionCard(a, 'activities', `${count} activit${count !== 1 ? 'ies' : 'y'}`);
|
|
989
|
+
})
|
|
990
|
+
.join('')}
|
|
934
991
|
</div>
|
|
935
992
|
</section>
|
|
936
|
-
`
|
|
993
|
+
`
|
|
994
|
+
: ''
|
|
995
|
+
}
|
|
937
996
|
|
|
938
|
-
${
|
|
997
|
+
${
|
|
998
|
+
skills.length > 0
|
|
999
|
+
? /*html*/ `
|
|
939
1000
|
<section data-section="skills">
|
|
940
1001
|
<hr>
|
|
941
1002
|
<div class="section-header">
|
|
@@ -943,15 +1004,21 @@ export function indexPage(
|
|
|
943
1004
|
<p class="section-subtitle">Reusable instructions and scripts packaged as tools.</p>
|
|
944
1005
|
</div>
|
|
945
1006
|
<div class="card-grid">
|
|
946
|
-
${skills
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1007
|
+
${skills
|
|
1008
|
+
.map((s) => {
|
|
1009
|
+
const count = Array.from(s).length;
|
|
1010
|
+
return collectionCard(s, 'skills', `${count} skill${count !== 1 ? 's' : ''}`);
|
|
1011
|
+
})
|
|
1012
|
+
.join('')}
|
|
950
1013
|
</div>
|
|
951
1014
|
</section>
|
|
952
|
-
`
|
|
1015
|
+
`
|
|
1016
|
+
: ''
|
|
1017
|
+
}
|
|
953
1018
|
|
|
954
|
-
${
|
|
1019
|
+
${
|
|
1020
|
+
interactions.length > 0
|
|
1021
|
+
? /*html*/ `
|
|
955
1022
|
<section data-section="interactions">
|
|
956
1023
|
<hr>
|
|
957
1024
|
<div class="section-header">
|
|
@@ -959,12 +1026,16 @@ export function indexPage(
|
|
|
959
1026
|
<p class="section-subtitle">Conversation blueprints surfaced in the Vertesia UI.</p>
|
|
960
1027
|
</div>
|
|
961
1028
|
<div class="card-grid">
|
|
962
|
-
${interactions.map(i => collectionCard(i, 'interactions')).join('')}
|
|
1029
|
+
${interactions.map((i) => collectionCard(i, 'interactions')).join('')}
|
|
963
1030
|
</div>
|
|
964
1031
|
</section>
|
|
965
|
-
`
|
|
1032
|
+
`
|
|
1033
|
+
: ''
|
|
1034
|
+
}
|
|
966
1035
|
|
|
967
|
-
${
|
|
1036
|
+
${
|
|
1037
|
+
types.length > 0
|
|
1038
|
+
? /*html*/ `
|
|
968
1039
|
<section data-section="types">
|
|
969
1040
|
<hr>
|
|
970
1041
|
<div class="section-header">
|
|
@@ -972,15 +1043,21 @@ export function indexPage(
|
|
|
972
1043
|
<p class="section-subtitle">Schema definitions for structured content in the data store.</p>
|
|
973
1044
|
</div>
|
|
974
1045
|
<div class="card-grid">
|
|
975
|
-
${types
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1046
|
+
${types
|
|
1047
|
+
.map((t: ContentTypesCollection) => {
|
|
1048
|
+
const count = t.getContentTypes().length;
|
|
1049
|
+
return collectionCard(t, 'types', `${count} type${count !== 1 ? 's' : ''}`);
|
|
1050
|
+
})
|
|
1051
|
+
.join('')}
|
|
979
1052
|
</div>
|
|
980
1053
|
</section>
|
|
981
|
-
`
|
|
1054
|
+
`
|
|
1055
|
+
: ''
|
|
1056
|
+
}
|
|
982
1057
|
|
|
983
|
-
${
|
|
1058
|
+
${
|
|
1059
|
+
templates.length > 0
|
|
1060
|
+
? /*html*/ `
|
|
984
1061
|
<section data-section="templates">
|
|
985
1062
|
<hr>
|
|
986
1063
|
<div class="section-header">
|
|
@@ -988,15 +1065,21 @@ export function indexPage(
|
|
|
988
1065
|
<p class="section-subtitle">Document and presentation templates for content generation.</p>
|
|
989
1066
|
</div>
|
|
990
1067
|
<div class="card-grid">
|
|
991
|
-
${templates
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1068
|
+
${templates
|
|
1069
|
+
.map((t: RenderingTemplateCollection) => {
|
|
1070
|
+
const count = t.getTemplateDefinitions().length;
|
|
1071
|
+
return collectionCard(t, 'templates', `${count} template${count !== 1 ? 's' : ''}`);
|
|
1072
|
+
})
|
|
1073
|
+
.join('')}
|
|
995
1074
|
</div>
|
|
996
1075
|
</section>
|
|
997
|
-
`
|
|
1076
|
+
`
|
|
1077
|
+
: ''
|
|
1078
|
+
}
|
|
998
1079
|
|
|
999
|
-
${
|
|
1080
|
+
${
|
|
1081
|
+
mcpProviders.length > 0
|
|
1082
|
+
? /*html*/ `
|
|
1000
1083
|
<section data-section="mcp">
|
|
1001
1084
|
<hr>
|
|
1002
1085
|
<div class="section-header">
|
|
@@ -1004,10 +1087,12 @@ export function indexPage(
|
|
|
1004
1087
|
<p class="section-subtitle">Remote MCP servers available through this tools server.</p>
|
|
1005
1088
|
</div>
|
|
1006
1089
|
<div class="card-grid">
|
|
1007
|
-
${mcpProviders.map(p => mcpProviderCard(p)).join('')}
|
|
1090
|
+
${mcpProviders.map((p) => mcpProviderCard(p)).join('')}
|
|
1008
1091
|
</div>
|
|
1009
1092
|
</section>
|
|
1010
|
-
`
|
|
1093
|
+
`
|
|
1094
|
+
: ''
|
|
1095
|
+
}
|
|
1011
1096
|
</div>
|
|
1012
1097
|
<script>
|
|
1013
1098
|
(function () {
|
|
@@ -1079,7 +1164,7 @@ export function indexPage(
|
|
|
1079
1164
|
*/
|
|
1080
1165
|
export function toolCollectionPage(collection: ToolCollection): string {
|
|
1081
1166
|
const toolsArray = Array.from(collection);
|
|
1082
|
-
return /*html
|
|
1167
|
+
return /*html*/ `
|
|
1083
1168
|
<!DOCTYPE html>
|
|
1084
1169
|
<html lang="en">
|
|
1085
1170
|
<head>
|
|
@@ -1109,10 +1194,11 @@ export function toolCollectionPage(collection: ToolCollection): string {
|
|
|
1109
1194
|
|
|
1110
1195
|
<h2>${toolsArray.length} Tool${toolsArray.length !== 1 ? 's' : ''}</h2>
|
|
1111
1196
|
|
|
1112
|
-
${
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1197
|
+
${
|
|
1198
|
+
toolsArray.length > 0
|
|
1199
|
+
? toolsArray.map((tool) => toolDetailCard(tool, collection.name)).join('')
|
|
1200
|
+
: '<div class="empty-state">No tools in this collection</div>'
|
|
1201
|
+
}
|
|
1116
1202
|
</body>
|
|
1117
1203
|
</html>`;
|
|
1118
1204
|
}
|
|
@@ -1122,7 +1208,7 @@ export function toolCollectionPage(collection: ToolCollection): string {
|
|
|
1122
1208
|
*/
|
|
1123
1209
|
export function skillCollectionPage(collection: SkillCollection): string {
|
|
1124
1210
|
const skillsArray = Array.from(collection);
|
|
1125
|
-
return /*html
|
|
1211
|
+
return /*html*/ `
|
|
1126
1212
|
<!DOCTYPE html>
|
|
1127
1213
|
<html lang="en">
|
|
1128
1214
|
<head>
|
|
@@ -1152,10 +1238,11 @@ export function skillCollectionPage(collection: SkillCollection): string {
|
|
|
1152
1238
|
|
|
1153
1239
|
<h2>${skillsArray.length} Skill${skillsArray.length !== 1 ? 's' : ''}</h2>
|
|
1154
1240
|
|
|
1155
|
-
${
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1241
|
+
${
|
|
1242
|
+
skillsArray.length > 0
|
|
1243
|
+
? skillsArray.map((skill) => skillDetailCard(skill, collection)).join('')
|
|
1244
|
+
: '<div class="empty-state">No skills in this collection</div>'
|
|
1245
|
+
}
|
|
1159
1246
|
</body>
|
|
1160
1247
|
</html>`;
|
|
1161
1248
|
}
|
|
@@ -1164,7 +1251,7 @@ export function skillCollectionPage(collection: SkillCollection): string {
|
|
|
1164
1251
|
* Render a collection header with icon, title, description, and endpoint
|
|
1165
1252
|
*/
|
|
1166
1253
|
function collectionDetailHeader(collection: ICollection, pathPrefix: string): string {
|
|
1167
|
-
return /*html
|
|
1254
|
+
return /*html*/ `
|
|
1168
1255
|
<nav class="nav">
|
|
1169
1256
|
<a href="/">${backArrow} Back to all collections</a>
|
|
1170
1257
|
</nav>
|
|
@@ -1188,7 +1275,7 @@ function collectionDetailHeader(collection: ICollection, pathPrefix: string): st
|
|
|
1188
1275
|
* Render a simple item card with name, description, and tags
|
|
1189
1276
|
*/
|
|
1190
1277
|
function simpleItemCard(item: { name: string; description?: string; tags?: string[] }): string {
|
|
1191
|
-
return /*html
|
|
1278
|
+
return /*html*/ `
|
|
1192
1279
|
<div class="detail-card">
|
|
1193
1280
|
<div class="detail-header">
|
|
1194
1281
|
<div>
|
|
@@ -1196,7 +1283,7 @@ function simpleItemCard(item: { name: string; description?: string; tags?: strin
|
|
|
1196
1283
|
<p class="detail-desc">${item.description || 'No description'}</p>
|
|
1197
1284
|
</div>
|
|
1198
1285
|
<div class="detail-badges">
|
|
1199
|
-
${item.tags?.map(tag => `<span class="badge">${tag}</span>`).join('') || ''}
|
|
1286
|
+
${item.tags?.map((tag) => `<span class="badge">${tag}</span>`).join('') || ''}
|
|
1200
1287
|
</div>
|
|
1201
1288
|
</div>
|
|
1202
1289
|
</div>`;
|
|
@@ -1206,7 +1293,7 @@ function simpleItemCard(item: { name: string; description?: string; tags?: strin
|
|
|
1206
1293
|
* Render an interaction collection detail page
|
|
1207
1294
|
*/
|
|
1208
1295
|
export function interactionCollectionPage(collection: InteractionCollection): string {
|
|
1209
|
-
return /*html
|
|
1296
|
+
return /*html*/ `
|
|
1210
1297
|
<!DOCTYPE html>
|
|
1211
1298
|
<html lang="en">
|
|
1212
1299
|
<head>
|
|
@@ -1221,7 +1308,7 @@ export function interactionCollectionPage(collection: InteractionCollection): st
|
|
|
1221
1308
|
<h2>${collection.interactions.length} Interaction${collection.interactions.length !== 1 ? 's' : ''}</h2>
|
|
1222
1309
|
|
|
1223
1310
|
<div class="item-list">
|
|
1224
|
-
${collection.interactions.map(inter => simpleItemCard(inter)).join('')}
|
|
1311
|
+
${collection.interactions.map((inter) => simpleItemCard(inter)).join('')}
|
|
1225
1312
|
</div>
|
|
1226
1313
|
</body>
|
|
1227
1314
|
</html>`;
|
|
@@ -1232,7 +1319,7 @@ export function interactionCollectionPage(collection: InteractionCollection): st
|
|
|
1232
1319
|
*/
|
|
1233
1320
|
export function contentTypeCollectionPage(collection: ContentTypesCollection): string {
|
|
1234
1321
|
const typesArray = collection.getContentTypes();
|
|
1235
|
-
return /*html
|
|
1322
|
+
return /*html*/ `
|
|
1236
1323
|
<!DOCTYPE html>
|
|
1237
1324
|
<html lang="en">
|
|
1238
1325
|
<head>
|
|
@@ -1247,7 +1334,7 @@ export function contentTypeCollectionPage(collection: ContentTypesCollection): s
|
|
|
1247
1334
|
<h2>${typesArray.length} Content Type${typesArray.length !== 1 ? 's' : ''}</h2>
|
|
1248
1335
|
|
|
1249
1336
|
<div class="item-list">
|
|
1250
|
-
${typesArray.map(type => simpleItemCard(type)).join('')}
|
|
1337
|
+
${typesArray.map((type) => simpleItemCard(type)).join('')}
|
|
1251
1338
|
</div>
|
|
1252
1339
|
</body>
|
|
1253
1340
|
</html>`;
|
|
@@ -1261,7 +1348,7 @@ export function activityDetailCard(activity: RemoteActivityDefinition, collectio
|
|
|
1261
1348
|
const properties = schema?.properties as Record<string, unknown> | undefined;
|
|
1262
1349
|
const required = (schema as Record<string, unknown>)?.required as string[] | undefined;
|
|
1263
1350
|
|
|
1264
|
-
return /*html
|
|
1351
|
+
return /*html*/ `
|
|
1265
1352
|
<div class="detail-card">
|
|
1266
1353
|
<div class="detail-header">
|
|
1267
1354
|
<div>
|
|
@@ -1283,15 +1370,20 @@ export function activityDetailCard(activity: RemoteActivityDefinition, collectio
|
|
|
1283
1370
|
</div>
|
|
1284
1371
|
</div>
|
|
1285
1372
|
|
|
1286
|
-
${
|
|
1373
|
+
${
|
|
1374
|
+
schema
|
|
1375
|
+
? /*html*/ `
|
|
1287
1376
|
<div class="detail-section">
|
|
1288
1377
|
<h4 class="detail-section-title">Input Schema</h4>
|
|
1289
|
-
${
|
|
1378
|
+
${
|
|
1379
|
+
properties
|
|
1380
|
+
? /*html*/ `
|
|
1290
1381
|
<div class="info-grid" style="margin-bottom: 1rem;">
|
|
1291
|
-
${Object.entries(properties)
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1382
|
+
${Object.entries(properties)
|
|
1383
|
+
.map(([key, value]) => {
|
|
1384
|
+
const prop = value as Record<string, unknown>;
|
|
1385
|
+
const isRequired = required?.includes(key);
|
|
1386
|
+
return /*html*/ `
|
|
1295
1387
|
<div class="info-item">
|
|
1296
1388
|
<div class="info-label">${key}${isRequired ? ' *' : ''}</div>
|
|
1297
1389
|
<div class="info-value">
|
|
@@ -1299,21 +1391,28 @@ export function activityDetailCard(activity: RemoteActivityDefinition, collectio
|
|
|
1299
1391
|
${prop.description ? `<br><span style="color: #6b7280; font-size: 0.85rem;">${prop.description}</span>` : ''}
|
|
1300
1392
|
</div>
|
|
1301
1393
|
</div>`;
|
|
1302
|
-
|
|
1394
|
+
})
|
|
1395
|
+
.join('')}
|
|
1303
1396
|
</div>
|
|
1304
|
-
`
|
|
1397
|
+
`
|
|
1398
|
+
: ''
|
|
1399
|
+
}
|
|
1305
1400
|
<details>
|
|
1306
1401
|
<summary style="cursor: pointer; color: #6b7280; font-size: 0.85rem;">View full schema</summary>
|
|
1307
1402
|
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(schema)}</div>
|
|
1308
1403
|
</details>
|
|
1309
1404
|
</div>
|
|
1310
|
-
`
|
|
1405
|
+
`
|
|
1406
|
+
: /*html*/ `
|
|
1311
1407
|
<div class="detail-section">
|
|
1312
1408
|
<div class="empty-state">No input schema defined</div>
|
|
1313
1409
|
</div>
|
|
1314
|
-
`
|
|
1410
|
+
`
|
|
1411
|
+
}
|
|
1315
1412
|
|
|
1316
|
-
${
|
|
1413
|
+
${
|
|
1414
|
+
activity.output_schema
|
|
1415
|
+
? /*html*/ `
|
|
1317
1416
|
<div class="detail-section">
|
|
1318
1417
|
<h4 class="detail-section-title">Output Schema</h4>
|
|
1319
1418
|
<details>
|
|
@@ -1321,7 +1420,9 @@ export function activityDetailCard(activity: RemoteActivityDefinition, collectio
|
|
|
1321
1420
|
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(activity.output_schema)}</div>
|
|
1322
1421
|
</details>
|
|
1323
1422
|
</div>
|
|
1324
|
-
`
|
|
1423
|
+
`
|
|
1424
|
+
: ''
|
|
1425
|
+
}
|
|
1325
1426
|
</div>
|
|
1326
1427
|
</div>`;
|
|
1327
1428
|
}
|
|
@@ -1331,7 +1432,7 @@ export function activityDetailCard(activity: RemoteActivityDefinition, collectio
|
|
|
1331
1432
|
*/
|
|
1332
1433
|
export function activityCollectionPage(collection: ActivityCollection): string {
|
|
1333
1434
|
const activitiesArray = collection.getActivityDefinitions();
|
|
1334
|
-
return /*html
|
|
1435
|
+
return /*html*/ `
|
|
1335
1436
|
<!DOCTYPE html>
|
|
1336
1437
|
<html lang="en">
|
|
1337
1438
|
<head>
|
|
@@ -1361,10 +1462,11 @@ export function activityCollectionPage(collection: ActivityCollection): string {
|
|
|
1361
1462
|
|
|
1362
1463
|
<h2>${activitiesArray.length} Activit${activitiesArray.length !== 1 ? 'ies' : 'y'}</h2>
|
|
1363
1464
|
|
|
1364
|
-
${
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1465
|
+
${
|
|
1466
|
+
activitiesArray.length > 0
|
|
1467
|
+
? activitiesArray.map((activity) => activityDetailCard(activity, collection.name)).join('')
|
|
1468
|
+
: '<div class="empty-state">No activities in this collection</div>'
|
|
1469
|
+
}
|
|
1368
1470
|
</body>
|
|
1369
1471
|
</html>`;
|
|
1370
1472
|
}
|