@vertesia/tools-sdk 1.3.0 → 1.4.0-dev.20260615.051508Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +20 -22
- 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
|
@@ -1,1320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.collectionCard = collectionCard;
|
|
4
|
-
exports.toolCard = toolCard;
|
|
5
|
-
exports.mcpProviderCard = mcpProviderCard;
|
|
6
|
-
exports.toolDetailCard = toolDetailCard;
|
|
7
|
-
exports.skillCard = skillCard;
|
|
8
|
-
exports.skillDetailCard = skillDetailCard;
|
|
9
|
-
exports.templateDetailCard = templateDetailCard;
|
|
10
|
-
exports.templateCollectionPage = templateCollectionPage;
|
|
11
|
-
exports.indexPage = indexPage;
|
|
12
|
-
exports.toolCollectionPage = toolCollectionPage;
|
|
13
|
-
exports.skillCollectionPage = skillCollectionPage;
|
|
14
|
-
exports.interactionCollectionPage = interactionCollectionPage;
|
|
15
|
-
exports.contentTypeCollectionPage = contentTypeCollectionPage;
|
|
16
|
-
exports.activityDetailCard = activityDetailCard;
|
|
17
|
-
exports.activityCollectionPage = activityCollectionPage;
|
|
18
|
-
const utils_js_1 = require("../utils.js");
|
|
19
|
-
const styles_js_1 = require("./styles.js");
|
|
20
|
-
/**
|
|
21
|
-
* Default icon SVG for collections without a custom icon
|
|
22
|
-
*/
|
|
23
|
-
const defaultIcon = /*html*/ `
|
|
24
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
25
|
-
<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"/>
|
|
26
|
-
</svg>`;
|
|
27
|
-
const skillIcon = /*html*/ `
|
|
28
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
29
|
-
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
|
30
|
-
</svg>`;
|
|
31
|
-
const templateIcon = /*html*/ `
|
|
32
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
33
|
-
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
34
|
-
<polyline points="14 2 14 8 20 8"/>
|
|
35
|
-
<line x1="16" y1="13" x2="8" y2="13"/>
|
|
36
|
-
<line x1="16" y1="17" x2="8" y2="17"/>
|
|
37
|
-
<polyline points="10 9 9 9 8 9"/>
|
|
38
|
-
</svg>`;
|
|
39
|
-
const activityIcon = /*html*/ `
|
|
40
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
41
|
-
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>
|
|
42
|
-
</svg>`;
|
|
43
|
-
/**
|
|
44
|
-
* Extended styles for detail pages
|
|
45
|
-
*/
|
|
46
|
-
const detailStyles = /*css*/ `
|
|
47
|
-
${styles_js_1.baseStyles}
|
|
48
|
-
|
|
49
|
-
.nav {
|
|
50
|
-
margin-bottom: 1.5rem;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.nav a {
|
|
54
|
-
color: #6b7280;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
gap: 0.5rem;
|
|
59
|
-
font-size: 0.875rem;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.nav a:hover {
|
|
63
|
-
color: #2563eb;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.nav svg {
|
|
67
|
-
width: 16px;
|
|
68
|
-
height: 16px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.detail-card {
|
|
72
|
-
background: white;
|
|
73
|
-
border-radius: 12px;
|
|
74
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
75
|
-
margin-bottom: 1.5rem;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.detail-header {
|
|
80
|
-
padding: 1.5rem;
|
|
81
|
-
border-bottom: 1px solid #e5e7eb;
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
align-items: flex-start;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.detail-title {
|
|
88
|
-
font-size: 1.25rem;
|
|
89
|
-
font-weight: 600;
|
|
90
|
-
color: #111827;
|
|
91
|
-
margin: 0 0 0.25rem 0;
|
|
92
|
-
font-family: ui-monospace, monospace;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.detail-desc {
|
|
96
|
-
color: #6b7280;
|
|
97
|
-
font-size: 0.95rem;
|
|
98
|
-
margin: 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.detail-badges {
|
|
102
|
-
display: flex;
|
|
103
|
-
gap: 0.5rem;
|
|
104
|
-
flex-wrap: wrap;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.detail-body {
|
|
108
|
-
padding: 1.5rem;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.detail-section {
|
|
112
|
-
margin-bottom: 1.5rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.detail-section:last-child {
|
|
116
|
-
margin-bottom: 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.detail-section-title {
|
|
120
|
-
font-size: 0.75rem;
|
|
121
|
-
font-weight: 600;
|
|
122
|
-
text-transform: uppercase;
|
|
123
|
-
letter-spacing: 0.05em;
|
|
124
|
-
color: #9ca3af;
|
|
125
|
-
margin: 0 0 0.75rem 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.schema-block {
|
|
129
|
-
background: #1f2937;
|
|
130
|
-
color: #e5e7eb;
|
|
131
|
-
padding: 1rem;
|
|
132
|
-
border-radius: 8px;
|
|
133
|
-
font-family: ui-monospace, monospace;
|
|
134
|
-
font-size: 0.8rem;
|
|
135
|
-
overflow-x: auto;
|
|
136
|
-
white-space: pre;
|
|
137
|
-
line-height: 1.5;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.schema-block .key { color: #93c5fd; }
|
|
141
|
-
.schema-block .string { color: #86efac; }
|
|
142
|
-
.schema-block .number { color: #fcd34d; }
|
|
143
|
-
.schema-block .boolean { color: #f9a8d4; }
|
|
144
|
-
.schema-block .null { color: #9ca3af; }
|
|
145
|
-
|
|
146
|
-
.info-grid {
|
|
147
|
-
display: grid;
|
|
148
|
-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
149
|
-
gap: 1rem;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.info-item {
|
|
153
|
-
background: #f9fafb;
|
|
154
|
-
padding: 1rem;
|
|
155
|
-
border-radius: 8px;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.info-label {
|
|
159
|
-
font-size: 0.75rem;
|
|
160
|
-
font-weight: 600;
|
|
161
|
-
text-transform: uppercase;
|
|
162
|
-
letter-spacing: 0.05em;
|
|
163
|
-
color: #9ca3af;
|
|
164
|
-
margin-bottom: 0.25rem;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.info-value {
|
|
168
|
-
font-size: 0.95rem;
|
|
169
|
-
color: #111827;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.info-value code {
|
|
173
|
-
background: #e5e7eb;
|
|
174
|
-
padding: 0.125rem 0.375rem;
|
|
175
|
-
border-radius: 4px;
|
|
176
|
-
font-family: ui-monospace, monospace;
|
|
177
|
-
font-size: 0.85rem;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.package-list {
|
|
181
|
-
display: flex;
|
|
182
|
-
flex-wrap: wrap;
|
|
183
|
-
gap: 0.5rem;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.package-tag {
|
|
187
|
-
background: #dbeafe;
|
|
188
|
-
color: #1e40af;
|
|
189
|
-
padding: 0.25rem 0.75rem;
|
|
190
|
-
border-radius: 9999px;
|
|
191
|
-
font-size: 0.8rem;
|
|
192
|
-
font-family: ui-monospace, monospace;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.script-list {
|
|
196
|
-
display: flex;
|
|
197
|
-
flex-direction: column;
|
|
198
|
-
gap: 0.5rem;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.script-item {
|
|
202
|
-
display: flex;
|
|
203
|
-
align-items: center;
|
|
204
|
-
gap: 0.75rem;
|
|
205
|
-
padding: 0.75rem 1rem;
|
|
206
|
-
background: #f9fafb;
|
|
207
|
-
border-radius: 8px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.script-icon {
|
|
211
|
-
width: 20px;
|
|
212
|
-
height: 20px;
|
|
213
|
-
color: #6b7280;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.script-name {
|
|
217
|
-
font-family: ui-monospace, monospace;
|
|
218
|
-
font-size: 0.9rem;
|
|
219
|
-
color: #111827;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.keyword-list {
|
|
223
|
-
display: flex;
|
|
224
|
-
flex-wrap: wrap;
|
|
225
|
-
gap: 0.5rem;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.keyword-tag {
|
|
229
|
-
background: #fef3c7;
|
|
230
|
-
color: #92400e;
|
|
231
|
-
padding: 0.25rem 0.75rem;
|
|
232
|
-
border-radius: 9999px;
|
|
233
|
-
font-size: 0.8rem;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.instructions-preview {
|
|
237
|
-
background: #f9fafb;
|
|
238
|
-
border: 1px solid #e5e7eb;
|
|
239
|
-
border-radius: 8px;
|
|
240
|
-
padding: 1rem;
|
|
241
|
-
max-height: 300px;
|
|
242
|
-
overflow-y: auto;
|
|
243
|
-
font-size: 0.875rem;
|
|
244
|
-
line-height: 1.6;
|
|
245
|
-
color: #374151;
|
|
246
|
-
white-space: pre-wrap;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.empty-state {
|
|
250
|
-
text-align: center;
|
|
251
|
-
padding: 3rem;
|
|
252
|
-
color: #9ca3af;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.tool-type-badge {
|
|
256
|
-
background: #6366f1;
|
|
257
|
-
color: white;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.skill-type-badge {
|
|
261
|
-
background: #10b981;
|
|
262
|
-
color: white;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.template-type-badge {
|
|
266
|
-
background: #f59e0b;
|
|
267
|
-
color: white;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.template-type-badge.document {
|
|
271
|
-
background: #f59e0b;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.template-type-badge.presentation {
|
|
275
|
-
background: #8b5cf6;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
@media (prefers-color-scheme: dark) {
|
|
279
|
-
.nav a {
|
|
280
|
-
color: #9ca3af;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.nav a:hover {
|
|
284
|
-
color: #60a5fa;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.detail-card {
|
|
288
|
-
background: rgba(15, 23, 42, 0.96);
|
|
289
|
-
box-shadow:
|
|
290
|
-
0 18px 40px rgba(15, 23, 42, 0.9),
|
|
291
|
-
0 0 0 1px rgba(15, 23, 42, 0.9);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.detail-header {
|
|
295
|
-
border-bottom-color: rgba(55, 65, 81, 0.9);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.detail-title {
|
|
299
|
-
color: #e5e7eb;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.detail-desc {
|
|
303
|
-
color: #9ca3af;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.detail-section-title {
|
|
307
|
-
color: #9ca3af;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.info-item {
|
|
311
|
-
background: rgba(15, 23, 42, 0.9);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.info-value {
|
|
315
|
-
color: #e5e7eb;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.info-value code {
|
|
319
|
-
background: rgba(31, 41, 55, 0.9);
|
|
320
|
-
color: #e5e7eb;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.script-item {
|
|
324
|
-
background: rgba(15, 23, 42, 0.9);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.script-name {
|
|
328
|
-
color: #e5e7eb;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.keyword-tag {
|
|
332
|
-
background: rgba(250, 204, 21, 0.12);
|
|
333
|
-
color: #facc15;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.instructions-preview {
|
|
337
|
-
background: rgba(15, 23, 42, 0.9);
|
|
338
|
-
border-color: rgba(55, 65, 81, 0.9);
|
|
339
|
-
color: #e5e7eb;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.empty-state {
|
|
343
|
-
color: #9ca3af;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
`;
|
|
347
|
-
/**
|
|
348
|
-
* Syntax highlight JSON
|
|
349
|
-
*/
|
|
350
|
-
function highlightJson(obj) {
|
|
351
|
-
const json = JSON.stringify(obj, null, 2);
|
|
352
|
-
return json
|
|
353
|
-
.replace(/"([^"]+)":/g, '<span class="key">"$1"</span>:')
|
|
354
|
-
.replace(/: "([^"]*)"([,\n])/g, ': <span class="string">"$1"</span>$2')
|
|
355
|
-
.replace(/: (\d+)([,\n])/g, ': <span class="number">$1</span>$2')
|
|
356
|
-
.replace(/: (true|false)([,\n])/g, ': <span class="boolean">$1</span>$2')
|
|
357
|
-
.replace(/: (null)([,\n])/g, ': <span class="null">$1</span>$2');
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Back navigation arrow
|
|
361
|
-
*/
|
|
362
|
-
const backArrow = /*html*/ `
|
|
363
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
364
|
-
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
|
365
|
-
</svg>`;
|
|
366
|
-
/**
|
|
367
|
-
* Copy icon
|
|
368
|
-
*/
|
|
369
|
-
const copyIcon = /*html*/ `
|
|
370
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
371
|
-
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
|
372
|
-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
|
373
|
-
</svg>`;
|
|
374
|
-
/**
|
|
375
|
-
* File icon
|
|
376
|
-
*/
|
|
377
|
-
const fileIcon = /*html*/ `
|
|
378
|
-
<svg class="script-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
379
|
-
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
380
|
-
<polyline points="14 2 14 8 20 8"></polyline>
|
|
381
|
-
</svg>`;
|
|
382
|
-
/**
|
|
383
|
-
* Render a collection card for the index page
|
|
384
|
-
*/
|
|
385
|
-
function collectionCard(collection, pathPrefix, meta) {
|
|
386
|
-
return /*html*/ `
|
|
387
|
-
<a class="card" href="/${pathPrefix}/${collection.name}" data-collection-type="${pathPrefix}" data-collection-name="${collection.name}">
|
|
388
|
-
<div class="card-icon">${collection.icon || defaultIcon}</div>
|
|
389
|
-
<div class="card-title">${collection.title || collection.name}</div>
|
|
390
|
-
<div class="card-desc">${collection.description || ''}</div>
|
|
391
|
-
${meta ? `<div class="card-meta">${meta}</div>` : ''}
|
|
392
|
-
</a>`;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Render a tool card (simple version for lists)
|
|
396
|
-
*/
|
|
397
|
-
function toolCard(tool) {
|
|
398
|
-
return /*html*/ `
|
|
399
|
-
<div class="item-card">
|
|
400
|
-
<div class="item-name">${tool.name}</div>
|
|
401
|
-
<div class="item-desc">${tool.description || ''}</div>
|
|
402
|
-
${tool.input_schema ? /*html*/ `
|
|
403
|
-
<div class="item-schema">${JSON.stringify(tool.input_schema, null, 2)}</div>
|
|
404
|
-
` : ''}
|
|
405
|
-
</div>`;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Render an MCP provider card
|
|
409
|
-
*/
|
|
410
|
-
function mcpProviderCard(provider) {
|
|
411
|
-
return /*html*/ `
|
|
412
|
-
<a class="card" href="/api/mcp/${provider.name}">
|
|
413
|
-
<div class="card-title">${provider.name}</div>
|
|
414
|
-
<div class="card-desc">${provider.description || ''}</div>
|
|
415
|
-
</a>`;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Render a detailed tool card
|
|
419
|
-
*/
|
|
420
|
-
function toolDetailCard(tool, collectionName) {
|
|
421
|
-
const schema = tool.input_schema;
|
|
422
|
-
const properties = schema?.properties;
|
|
423
|
-
const required = schema?.required;
|
|
424
|
-
return /*html*/ `
|
|
425
|
-
<div class="detail-card">
|
|
426
|
-
<div class="detail-header">
|
|
427
|
-
<div>
|
|
428
|
-
<h3 class="detail-title">${tool.name}</h3>
|
|
429
|
-
<p class="detail-desc">${tool.description || 'No description'}</p>
|
|
430
|
-
</div>
|
|
431
|
-
<div class="detail-badges">
|
|
432
|
-
<span class="badge tool-type-badge">Tool</span>
|
|
433
|
-
</div>
|
|
434
|
-
</div>
|
|
435
|
-
<div class="detail-body">
|
|
436
|
-
<div class="detail-section">
|
|
437
|
-
<h4 class="detail-section-title">Endpoint</h4>
|
|
438
|
-
<div class="endpoint-box">
|
|
439
|
-
<code>POST /api/tools/${collectionName}</code>
|
|
440
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText('/api/tools/${collectionName}')" title="Copy">
|
|
441
|
-
${copyIcon}
|
|
442
|
-
</button>
|
|
443
|
-
</div>
|
|
444
|
-
</div>
|
|
445
|
-
|
|
446
|
-
${schema ? /*html*/ `
|
|
447
|
-
<div class="detail-section">
|
|
448
|
-
<h4 class="detail-section-title">Input Schema</h4>
|
|
449
|
-
${properties ? /*html*/ `
|
|
450
|
-
<div class="info-grid" style="margin-bottom: 1rem;">
|
|
451
|
-
${Object.entries(properties).map(([key, value]) => {
|
|
452
|
-
const prop = value;
|
|
453
|
-
const isRequired = required?.includes(key);
|
|
454
|
-
return /*html*/ `
|
|
455
|
-
<div class="info-item">
|
|
456
|
-
<div class="info-label">${key}${isRequired ? ' *' : ''}</div>
|
|
457
|
-
<div class="info-value">
|
|
458
|
-
<code>${prop.type || 'any'}</code>
|
|
459
|
-
${prop.description ? `<br><span style="color: #6b7280; font-size: 0.85rem;">${prop.description}</span>` : ''}
|
|
460
|
-
</div>
|
|
461
|
-
</div>`;
|
|
462
|
-
}).join('')}
|
|
463
|
-
</div>
|
|
464
|
-
` : ''}
|
|
465
|
-
<details>
|
|
466
|
-
<summary style="cursor: pointer; color: #6b7280; font-size: 0.85rem;">View full schema</summary>
|
|
467
|
-
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(schema)}</div>
|
|
468
|
-
</details>
|
|
469
|
-
</div>
|
|
470
|
-
` : /*html*/ `
|
|
471
|
-
<div class="detail-section">
|
|
472
|
-
<div class="empty-state">No input schema defined</div>
|
|
473
|
-
</div>
|
|
474
|
-
`}
|
|
475
|
-
</div>
|
|
476
|
-
</div>`;
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Render a skill card (simple version for lists)
|
|
480
|
-
*/
|
|
481
|
-
function skillCard(skill) {
|
|
482
|
-
return /*html*/ `
|
|
483
|
-
<div class="item-card skill">
|
|
484
|
-
<div class="item-name">${skill.name}</div>
|
|
485
|
-
<div class="item-desc">${skill.description || ''}</div>
|
|
486
|
-
<div class="item-meta">
|
|
487
|
-
<span class="badge ${skill.execution?.language || ''}">${skill.content_type === 'jst' ? 'Dynamic' : 'Static'}</span>
|
|
488
|
-
${skill.execution?.language ? `<span class="badge ${skill.execution.language}">${skill.execution.language}</span>` : ''}
|
|
489
|
-
${skill.scripts?.length ? `<span class="badge">${skill.scripts.length} script${skill.scripts.length > 1 ? 's' : ''}</span>` : ''}
|
|
490
|
-
</div>
|
|
491
|
-
</div>`;
|
|
492
|
-
}
|
|
493
|
-
function skillWidgetsTemplate(skillWidgets) {
|
|
494
|
-
if (!skillWidgets || skillWidgets.length === 0) {
|
|
495
|
-
return 'n/a';
|
|
496
|
-
}
|
|
497
|
-
return skillWidgets.map(w => `<div style='display: flex; align-items: center; gap: 0.5rem; width:100%;justify-content: space-between;'><span>${w}</span>
|
|
498
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/widgets/${w}.js')" title="Copy endpoint URL">
|
|
499
|
-
${copyIcon}
|
|
500
|
-
</button>
|
|
501
|
-
</div>`).join('');
|
|
502
|
-
}
|
|
503
|
-
function renderSkillUrl(skill, collectionName) {
|
|
504
|
-
const skillPath = `/api/skills/${collectionName}/${skill.name}`;
|
|
505
|
-
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>
|
|
506
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '${skillPath}')" title="Copy endpoint URL">
|
|
507
|
-
${copyIcon}
|
|
508
|
-
</button>
|
|
509
|
-
</div>`;
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Render a detailed skill card
|
|
513
|
-
*/
|
|
514
|
-
function skillDetailCard(skill, collection) {
|
|
515
|
-
const hasKeywords = skill.context_triggers?.keywords?.length;
|
|
516
|
-
const hasPackages = skill.execution?.packages?.length;
|
|
517
|
-
const hasScripts = skill.scripts?.length;
|
|
518
|
-
const hasRelatedTools = skill.related_tools?.length;
|
|
519
|
-
return /*html*/ `
|
|
520
|
-
<div class="detail-card">
|
|
521
|
-
<div class="detail-header">
|
|
522
|
-
<div>
|
|
523
|
-
<h3 class="detail-title">${skill.name}</h3>
|
|
524
|
-
<p class="detail-desc">${skill.description || 'No description'}</p>
|
|
525
|
-
${renderSkillUrl(skill, collection.name)}
|
|
526
|
-
</div>
|
|
527
|
-
<div class="detail-badges">
|
|
528
|
-
<span class="badge skill-type-badge">Skill</span>
|
|
529
|
-
${skill.execution?.language ? `<span class="badge ${skill.execution.language}">${skill.execution.language}</span>` : ''}
|
|
530
|
-
${hasRelatedTools ? `<span class="badge" style="background: #8b5cf6; color: white;">Unlocks ${skill.related_tools?.length} tool${skill.related_tools?.length !== 1 ? 's' : ''}</span>` : ''}
|
|
531
|
-
</div>
|
|
532
|
-
</div>
|
|
533
|
-
<div class="detail-body">
|
|
534
|
-
<div class="info-grid">
|
|
535
|
-
<div class="info-item">
|
|
536
|
-
<div class="info-label">Content Type</div>
|
|
537
|
-
<div class="info-value">${skill.content_type === 'jst' ? 'Dynamic (JST Template)' : 'Static (Markdown)'}</div>
|
|
538
|
-
</div>
|
|
539
|
-
${skill.execution?.language ? /*html*/ `
|
|
540
|
-
<div class="info-item">
|
|
541
|
-
<div class="info-label">Language</div>
|
|
542
|
-
<div class="info-value"><code>${skill.execution.language}</code></div>
|
|
543
|
-
</div>
|
|
544
|
-
` : ''}
|
|
545
|
-
<div class="info-item">
|
|
546
|
-
<div class="info-label">Widgets</div>
|
|
547
|
-
<div class="info-value">${skillWidgetsTemplate(skill.widgets)}</div>
|
|
548
|
-
</div>
|
|
549
|
-
</div>
|
|
550
|
-
|
|
551
|
-
${hasRelatedTools ? /*html*/ `
|
|
552
|
-
<div class="detail-section">
|
|
553
|
-
<h4 class="detail-section-title">Unlocks Tools</h4>
|
|
554
|
-
<p style="color: #6b7280; font-size: 0.85rem; margin: 0 0 0.75rem 0;">These tools become available when this skill is activated:</p>
|
|
555
|
-
<div class="package-list">
|
|
556
|
-
${skill.related_tools?.map(tool => `<span class="package-tag" style="background: #ede9fe; color: #6d28d9;">${tool}</span>`).join('')}
|
|
557
|
-
</div>
|
|
558
|
-
</div>
|
|
559
|
-
` : ''}
|
|
560
|
-
|
|
561
|
-
${hasKeywords ? /*html*/ `
|
|
562
|
-
<div class="detail-section">
|
|
563
|
-
<h4 class="detail-section-title">Trigger Keywords</h4>
|
|
564
|
-
<div class="keyword-list">
|
|
565
|
-
${skill.context_triggers?.keywords?.map(kw => `<span class="keyword-tag">${kw}</span>`).join('')}
|
|
566
|
-
</div>
|
|
567
|
-
</div>
|
|
568
|
-
` : ''}
|
|
569
|
-
|
|
570
|
-
${hasPackages ? /*html*/ `
|
|
571
|
-
<div class="detail-section">
|
|
572
|
-
<h4 class="detail-section-title">Required Packages</h4>
|
|
573
|
-
<div class="package-list">
|
|
574
|
-
${skill.execution?.packages?.map(pkg => `<span class="package-tag">${pkg}</span>`).join('')}
|
|
575
|
-
</div>
|
|
576
|
-
</div>
|
|
577
|
-
` : ''}
|
|
578
|
-
|
|
579
|
-
${hasScripts ? /*html*/ `
|
|
580
|
-
<div class="detail-section">
|
|
581
|
-
<h4 class="detail-section-title">Bundled Scripts</h4>
|
|
582
|
-
<div class="script-list">
|
|
583
|
-
${skill.scripts?.map(script => /*html*/ `
|
|
584
|
-
<div class="script-item">
|
|
585
|
-
${fileIcon}
|
|
586
|
-
<span class="script-name">${(0, utils_js_1.join)("/scripts", script)}</span>
|
|
587
|
-
</div>
|
|
588
|
-
`).join('')}
|
|
589
|
-
</div>
|
|
590
|
-
</div>
|
|
591
|
-
` : ''}
|
|
592
|
-
|
|
593
|
-
<div class="detail-section">
|
|
594
|
-
<h4 class="detail-section-title">Instructions Preview</h4>
|
|
595
|
-
<div class="instructions-preview">${escapeHtml(skill.instructions.slice(0, 1000))}${skill.instructions.length > 1000 ? '...' : ''}</div>
|
|
596
|
-
</div>
|
|
597
|
-
</div>
|
|
598
|
-
</div>`;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Render a template endpoint URL with copy button
|
|
602
|
-
*/
|
|
603
|
-
function renderTemplateUrl(template, collectionName) {
|
|
604
|
-
const templatePath = `/api/templates/${collectionName}/${template.name}`;
|
|
605
|
-
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>
|
|
606
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '${templatePath}')" title="Copy endpoint URL">
|
|
607
|
-
${copyIcon}
|
|
608
|
-
</button>
|
|
609
|
-
</div>`;
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Render a tag list
|
|
613
|
-
*/
|
|
614
|
-
function tagList(tags) {
|
|
615
|
-
if (!tags || tags.length === 0)
|
|
616
|
-
return '';
|
|
617
|
-
return /*html*/ `
|
|
618
|
-
<div class="detail-section">
|
|
619
|
-
<h4 class="detail-section-title">Tags</h4>
|
|
620
|
-
<div class="keyword-list">
|
|
621
|
-
${tags.map(tag => `<span class="keyword-tag">${tag}</span>`).join('')}
|
|
622
|
-
</div>
|
|
623
|
-
</div>`;
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Render an asset file list
|
|
627
|
-
*/
|
|
628
|
-
function assetList(assets) {
|
|
629
|
-
if (assets.length === 0)
|
|
630
|
-
return '';
|
|
631
|
-
return /*html*/ `
|
|
632
|
-
<div class="detail-section">
|
|
633
|
-
<h4 class="detail-section-title">Assets</h4>
|
|
634
|
-
<div class="script-list">
|
|
635
|
-
${assets.map(asset => /*html*/ `
|
|
636
|
-
<div class="script-item">
|
|
637
|
-
${fileIcon}
|
|
638
|
-
<span class="script-name">${asset}</span>
|
|
639
|
-
</div>
|
|
640
|
-
`).join('')}
|
|
641
|
-
</div>
|
|
642
|
-
</div>`;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Render an instructions preview section
|
|
646
|
-
*/
|
|
647
|
-
function instructionsPreview(instructions) {
|
|
648
|
-
return /*html*/ `
|
|
649
|
-
<div class="detail-section">
|
|
650
|
-
<h4 class="detail-section-title">Instructions Preview</h4>
|
|
651
|
-
<div class="instructions-preview">${escapeHtml(instructions.slice(0, 1000))}${instructions.length > 1000 ? '...' : ''}</div>
|
|
652
|
-
</div>`;
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Render a detailed template card
|
|
656
|
-
*/
|
|
657
|
-
function templateDetailCard(template, collection) {
|
|
658
|
-
return /*html*/ `
|
|
659
|
-
<div class="detail-card">
|
|
660
|
-
<div class="detail-header">
|
|
661
|
-
<div>
|
|
662
|
-
<h3 class="detail-title">${template.title || template.name}</h3>
|
|
663
|
-
<p class="detail-desc">${template.description || 'No description'}</p>
|
|
664
|
-
${renderTemplateUrl(template, collection.name)}
|
|
665
|
-
</div>
|
|
666
|
-
<div class="detail-badges">
|
|
667
|
-
<span class="badge template-type-badge ${template.type}">${template.type}</span>
|
|
668
|
-
</div>
|
|
669
|
-
</div>
|
|
670
|
-
<div class="detail-body">
|
|
671
|
-
<div class="info-grid">
|
|
672
|
-
<div class="info-item">
|
|
673
|
-
<div class="info-label">Type</div>
|
|
674
|
-
<div class="info-value"><code>${template.type}</code></div>
|
|
675
|
-
</div>
|
|
676
|
-
<div class="info-item">
|
|
677
|
-
<div class="info-label">Assets</div>
|
|
678
|
-
<div class="info-value">${template.assets.length} file${template.assets.length !== 1 ? 's' : ''}</div>
|
|
679
|
-
</div>
|
|
680
|
-
</div>
|
|
681
|
-
|
|
682
|
-
${tagList(template.tags)}
|
|
683
|
-
${assetList(template.assets)}
|
|
684
|
-
${instructionsPreview(template.instructions)}
|
|
685
|
-
</div>
|
|
686
|
-
</div>`;
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Render a template collection detail page
|
|
690
|
-
*/
|
|
691
|
-
function templateCollectionPage(collection) {
|
|
692
|
-
const templatesArray = Array.from(collection);
|
|
693
|
-
return /*html*/ `
|
|
694
|
-
<!DOCTYPE html>
|
|
695
|
-
<html lang="en">
|
|
696
|
-
<head>
|
|
697
|
-
<meta charset="UTF-8">
|
|
698
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
699
|
-
<title>${collection.title || collection.name} - Templates</title>
|
|
700
|
-
<style>${detailStyles}</style>
|
|
701
|
-
</head>
|
|
702
|
-
<body>
|
|
703
|
-
<nav class="nav">
|
|
704
|
-
<a href="/">${backArrow} Back to all collections</a>
|
|
705
|
-
</nav>
|
|
706
|
-
|
|
707
|
-
<div class="header">
|
|
708
|
-
<div class="header-icon">${collection.icon || templateIcon}</div>
|
|
709
|
-
<div>
|
|
710
|
-
<h1>${collection.title || collection.name}</h1>
|
|
711
|
-
<p style="color: #6b7280; margin: 0.25rem 0 0 0;">${collection.description || ''}</p>
|
|
712
|
-
<div class="endpoint-box">
|
|
713
|
-
<code>/api/templates/${collection.name}</code>
|
|
714
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/api/templates/${collection.name}')" title="Copy endpoint URL">
|
|
715
|
-
${copyIcon}
|
|
716
|
-
</button>
|
|
717
|
-
</div>
|
|
718
|
-
</div>
|
|
719
|
-
</div>
|
|
720
|
-
|
|
721
|
-
<h2>${templatesArray.length} Template${templatesArray.length !== 1 ? 's' : ''}</h2>
|
|
722
|
-
|
|
723
|
-
${templatesArray.length > 0 ?
|
|
724
|
-
templatesArray.map(template => templateDetailCard(template, collection)).join('') :
|
|
725
|
-
'<div class="empty-state">No templates in this collection</div>'}
|
|
726
|
-
</body>
|
|
727
|
-
</html>`;
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Escape HTML for safe rendering
|
|
731
|
-
*/
|
|
732
|
-
function escapeHtml(str) {
|
|
733
|
-
return str
|
|
734
|
-
.replace(/&/g, '&')
|
|
735
|
-
.replace(/</g, '<')
|
|
736
|
-
.replace(/>/g, '>')
|
|
737
|
-
.replace(/"/g, '"')
|
|
738
|
-
.replace(/'/g, ''');
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Derive simple initials from a title for use in the hero avatar.
|
|
742
|
-
*/
|
|
743
|
-
function getInitials(title) {
|
|
744
|
-
const words = title.trim().split(/\s+/).filter(Boolean);
|
|
745
|
-
if (!words.length)
|
|
746
|
-
return "TS";
|
|
747
|
-
const initials = words
|
|
748
|
-
.slice(0, 2)
|
|
749
|
-
.map((word) => word.charAt(0).toUpperCase())
|
|
750
|
-
.join("");
|
|
751
|
-
return initials || "TS";
|
|
752
|
-
}
|
|
753
|
-
function renderUILinks() {
|
|
754
|
-
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>`;
|
|
755
|
-
return /*html*/ `
|
|
756
|
-
<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;">
|
|
757
|
-
<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;">
|
|
758
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
759
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
760
|
-
<line x1="9" y1="3" x2="9" y2="21"></line>
|
|
761
|
-
</svg>
|
|
762
|
-
UI Plugin Dev
|
|
763
|
-
</a>
|
|
764
|
-
<div style="display: inline-flex; align-items: center; gap: 0.5rem;">
|
|
765
|
-
<a href="/lib/plugin.js" class="plugin-link-secondary" style="display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: #10b981; color: white; text-decoration: none; border-radius: 6px; font-size: 0.875rem; font-weight: 500; transition: background 0.15s;">
|
|
766
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
767
|
-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
768
|
-
<polyline points="7 10 12 15 17 10"></polyline>
|
|
769
|
-
<line x1="12" y1="15" x2="12" y2="3"></line>
|
|
770
|
-
</svg>
|
|
771
|
-
Plugin Bundle
|
|
772
|
-
</a>
|
|
773
|
-
<button id="copy-plugin-btn" class="copy-btn" onclick="copyPluginUrl(this)" title="Copy plugin URL" style="background: #e5e7eb; border: none; padding: 0.5rem; border-radius: 6px; cursor: pointer; color: #6b7280; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;">
|
|
774
|
-
${copyIconSvg}
|
|
775
|
-
</button>
|
|
776
|
-
</div>
|
|
777
|
-
</div>
|
|
778
|
-
<script>
|
|
779
|
-
function copyPluginUrl(btn) {
|
|
780
|
-
navigator.clipboard.writeText(window.location.origin + '/lib/plugin.js');
|
|
781
|
-
const originalHtml = btn.innerHTML;
|
|
782
|
-
btn.innerHTML = '✓';
|
|
783
|
-
btn.style.color = '#10b981';
|
|
784
|
-
setTimeout(function() {
|
|
785
|
-
btn.innerHTML = originalHtml;
|
|
786
|
-
btn.style.color = '#6b7280';
|
|
787
|
-
}, 1500);
|
|
788
|
-
}
|
|
789
|
-
</script>
|
|
790
|
-
`;
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Render the main index page
|
|
794
|
-
*
|
|
795
|
-
* Note: The fourth argument is backward compatible:
|
|
796
|
-
* - If a string is passed, it is treated as the title.
|
|
797
|
-
* - If an array is passed, it is treated as MCP providers and the fifth argument (if any) is the title.
|
|
798
|
-
* @deprecated Static templates were replaced by a React site. Do not use them anymore.
|
|
799
|
-
* Will be removed.
|
|
800
|
-
*/
|
|
801
|
-
function indexPage(config) {
|
|
802
|
-
const { title = 'Tools Server', tools = [], activities = [], interactions = [], skills = [], templates = [], types = [], mcpProviders = [], hideUILinks = false, } = config;
|
|
803
|
-
return /*html*/ `
|
|
804
|
-
<!DOCTYPE html>
|
|
805
|
-
<html lang="en">
|
|
806
|
-
<head>
|
|
807
|
-
<meta charset="UTF-8">
|
|
808
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
809
|
-
<title>${title}</title>
|
|
810
|
-
<style>${styles_js_1.baseStyles}</style>
|
|
811
|
-
</head>
|
|
812
|
-
<body>
|
|
813
|
-
<div class="page">
|
|
814
|
-
<header class="hero">
|
|
815
|
-
<div class="hero-main">
|
|
816
|
-
<div class="hero-logo">
|
|
817
|
-
<span class="hero-logo-initial">${escapeHtml(getInitials(title))}</span>
|
|
818
|
-
</div>
|
|
819
|
-
<div class="hero-meta">
|
|
820
|
-
<p class="hero-eyebrow">Tools Server</p>
|
|
821
|
-
<h1 class="hero-title">${title}</h1>
|
|
822
|
-
<p class="hero-tagline">
|
|
823
|
-
Discover the tools, activities, skills, interactions, and content types exposed by this server.
|
|
824
|
-
</p>
|
|
825
|
-
<div class="hero-summary">
|
|
826
|
-
${tools.length ? /*html*/ `<span><dot></dot> ${tools.length} tool collection${tools.length !== 1 ? 's' : ''}</span>` : ''}
|
|
827
|
-
${activities.length ? /*html*/ `<span><dot></dot> ${activities.length} activity collection${activities.length !== 1 ? 's' : ''}</span>` : ''}
|
|
828
|
-
${skills.length ? /*html*/ `<span><dot></dot> ${skills.length} skill collection${skills.length !== 1 ? 's' : ''}</span>` : ''}
|
|
829
|
-
${interactions.length ? /*html*/ `<span><dot></dot> ${interactions.length} interaction collection${interactions.length !== 1 ? 's' : ''}</span>` : ''}
|
|
830
|
-
${types.length ? /*html*/ `<span><dot></dot> ${types.length} content type collection${types.length !== 1 ? 's' : ''}</span>` : ''}
|
|
831
|
-
${templates.length ? /*html*/ `<span><dot></dot> ${templates.length} template collection${templates.length !== 1 ? 's' : ''}</span>` : ''}
|
|
832
|
-
${mcpProviders.length ? /*html*/ `<span><dot></dot> ${mcpProviders.length} MCP provider${mcpProviders.length !== 1 ? 's' : ''}</span>` : ''}
|
|
833
|
-
</div>
|
|
834
|
-
${hideUILinks ? '' : renderUILinks()}
|
|
835
|
-
</div>
|
|
836
|
-
</div>
|
|
837
|
-
<aside class="hero-panel">
|
|
838
|
-
<div class="hero-panel-label">Base endpoint</div>
|
|
839
|
-
<div class="hero-panel-endpoint"><code>/api</code></div>
|
|
840
|
-
<div class="hero-panel-label" style="margin-top: 1rem;">Package endpoint</div>
|
|
841
|
-
<div class="endpoint-box" style="margin-top: 0.5rem;">
|
|
842
|
-
<code id="package-endpoint-url">/api/package</code>
|
|
843
|
-
<button class="copy-btn" onclick="copyPackageUrl(this)" title="Copy package endpoint URL">
|
|
844
|
-
${copyIcon}
|
|
845
|
-
</button>
|
|
846
|
-
</div>
|
|
847
|
-
<p class="hero-panel-hint">
|
|
848
|
-
Use <strong>POST /api/tools/<collection></strong> or
|
|
849
|
-
<strong>POST /api/skills/<collection></strong> to call these from your apps or agents.
|
|
850
|
-
</p>
|
|
851
|
-
</aside>
|
|
852
|
-
</header>
|
|
853
|
-
|
|
854
|
-
<div class="search-bar">
|
|
855
|
-
<input
|
|
856
|
-
type="search"
|
|
857
|
-
id="collection-search"
|
|
858
|
-
class="search-input"
|
|
859
|
-
placeholder="Search tools, activities, skills, interactions, types, templates..."
|
|
860
|
-
aria-label="Search collections"
|
|
861
|
-
autocomplete="off"
|
|
862
|
-
/>
|
|
863
|
-
<p class="search-hint">
|
|
864
|
-
Filter collections by name or description. Search runs locally in your browser.
|
|
865
|
-
</p>
|
|
866
|
-
<p id="search-empty" class="search-empty" style="display: none;">
|
|
867
|
-
No collections match this search.
|
|
868
|
-
</p>
|
|
869
|
-
</div>
|
|
870
|
-
|
|
871
|
-
${tools.length > 0 ? /*html*/ `
|
|
872
|
-
<section data-section="tools">
|
|
873
|
-
<div class="section-header">
|
|
874
|
-
<h2>Tool Collections</h2>
|
|
875
|
-
<p class="section-subtitle">Remote tools available to agents via Vertesia.</p>
|
|
876
|
-
</div>
|
|
877
|
-
<div class="card-grid">
|
|
878
|
-
${tools.map(t => collectionCard(t, 'tools')).join('')}
|
|
879
|
-
</div>
|
|
880
|
-
</section>
|
|
881
|
-
` : ''}
|
|
882
|
-
|
|
883
|
-
${activities.length > 0 ? /*html*/ `
|
|
884
|
-
<section data-section="activities">
|
|
885
|
-
<hr>
|
|
886
|
-
<div class="section-header">
|
|
887
|
-
<h2>Activity Collections</h2>
|
|
888
|
-
<p class="section-subtitle">Remote activities for DSL workflows, invoked via HTTP.</p>
|
|
889
|
-
</div>
|
|
890
|
-
<div class="card-grid">
|
|
891
|
-
${activities.map((a) => {
|
|
892
|
-
const count = a.getActivityDefinitions().length;
|
|
893
|
-
return collectionCard(a, 'activities', `${count} activit${count !== 1 ? 'ies' : 'y'}`);
|
|
894
|
-
}).join('')}
|
|
895
|
-
</div>
|
|
896
|
-
</section>
|
|
897
|
-
` : ''}
|
|
898
|
-
|
|
899
|
-
${skills.length > 0 ? /*html*/ `
|
|
900
|
-
<section data-section="skills">
|
|
901
|
-
<hr>
|
|
902
|
-
<div class="section-header">
|
|
903
|
-
<h2>Skill Collections</h2>
|
|
904
|
-
<p class="section-subtitle">Reusable instructions and scripts packaged as tools.</p>
|
|
905
|
-
</div>
|
|
906
|
-
<div class="card-grid">
|
|
907
|
-
${skills.map(s => {
|
|
908
|
-
const count = Array.from(s).length;
|
|
909
|
-
return collectionCard(s, 'skills', `${count} skill${count !== 1 ? 's' : ''}`);
|
|
910
|
-
}).join('')}
|
|
911
|
-
</div>
|
|
912
|
-
</section>
|
|
913
|
-
` : ''}
|
|
914
|
-
|
|
915
|
-
${interactions.length > 0 ? /*html*/ `
|
|
916
|
-
<section data-section="interactions">
|
|
917
|
-
<hr>
|
|
918
|
-
<div class="section-header">
|
|
919
|
-
<h2>Interaction Collections</h2>
|
|
920
|
-
<p class="section-subtitle">Conversation blueprints surfaced in the Vertesia UI.</p>
|
|
921
|
-
</div>
|
|
922
|
-
<div class="card-grid">
|
|
923
|
-
${interactions.map(i => collectionCard(i, 'interactions')).join('')}
|
|
924
|
-
</div>
|
|
925
|
-
</section>
|
|
926
|
-
` : ''}
|
|
927
|
-
|
|
928
|
-
${types.length > 0 ? /*html*/ `
|
|
929
|
-
<section data-section="types">
|
|
930
|
-
<hr>
|
|
931
|
-
<div class="section-header">
|
|
932
|
-
<h2>Content Type Collections</h2>
|
|
933
|
-
<p class="section-subtitle">Schema definitions for structured content in the data store.</p>
|
|
934
|
-
</div>
|
|
935
|
-
<div class="card-grid">
|
|
936
|
-
${types.map((t) => {
|
|
937
|
-
const count = t.getContentTypes().length;
|
|
938
|
-
return collectionCard(t, 'types', `${count} type${count !== 1 ? 's' : ''}`);
|
|
939
|
-
}).join('')}
|
|
940
|
-
</div>
|
|
941
|
-
</section>
|
|
942
|
-
` : ''}
|
|
943
|
-
|
|
944
|
-
${templates.length > 0 ? /*html*/ `
|
|
945
|
-
<section data-section="templates">
|
|
946
|
-
<hr>
|
|
947
|
-
<div class="section-header">
|
|
948
|
-
<h2>Rendering Template Collections</h2>
|
|
949
|
-
<p class="section-subtitle">Document and presentation templates for content generation.</p>
|
|
950
|
-
</div>
|
|
951
|
-
<div class="card-grid">
|
|
952
|
-
${templates.map((t) => {
|
|
953
|
-
const count = t.getTemplateDefinitions().length;
|
|
954
|
-
return collectionCard(t, 'templates', `${count} template${count !== 1 ? 's' : ''}`);
|
|
955
|
-
}).join('')}
|
|
956
|
-
</div>
|
|
957
|
-
</section>
|
|
958
|
-
` : ''}
|
|
959
|
-
|
|
960
|
-
${mcpProviders.length > 0 ? /*html*/ `
|
|
961
|
-
<section data-section="mcp">
|
|
962
|
-
<hr>
|
|
963
|
-
<div class="section-header">
|
|
964
|
-
<h2>MCP Providers</h2>
|
|
965
|
-
<p class="section-subtitle">Remote MCP servers available through this tools server.</p>
|
|
966
|
-
</div>
|
|
967
|
-
<div class="card-grid">
|
|
968
|
-
${mcpProviders.map(p => mcpProviderCard(p)).join('')}
|
|
969
|
-
</div>
|
|
970
|
-
</section>
|
|
971
|
-
` : ''}
|
|
972
|
-
</div>
|
|
973
|
-
<script>
|
|
974
|
-
(function () {
|
|
975
|
-
var input = document.getElementById('collection-search');
|
|
976
|
-
if (!input) return;
|
|
977
|
-
|
|
978
|
-
var cards = Array.prototype.slice.call(document.querySelectorAll('.card'));
|
|
979
|
-
if (!cards.length) return;
|
|
980
|
-
|
|
981
|
-
var sections = Array.prototype.slice.call(document.querySelectorAll('[data-section]'));
|
|
982
|
-
var emptyState = document.getElementById('search-empty');
|
|
983
|
-
|
|
984
|
-
function normalize(value) {
|
|
985
|
-
return (value || '').toString().toLowerCase();
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
function update(query) {
|
|
989
|
-
var q = normalize(query).trim();
|
|
990
|
-
var anyVisible = false;
|
|
991
|
-
|
|
992
|
-
cards.forEach(function (card) {
|
|
993
|
-
var text = normalize(card.textContent);
|
|
994
|
-
var match = !q || text.indexOf(q) !== -1;
|
|
995
|
-
card.style.display = match ? '' : 'none';
|
|
996
|
-
if (match) anyVisible = true;
|
|
997
|
-
});
|
|
998
|
-
|
|
999
|
-
sections.forEach(function (section) {
|
|
1000
|
-
var visibleCards = section.querySelectorAll('.card');
|
|
1001
|
-
var hasVisible = false;
|
|
1002
|
-
for (var i = 0; i < visibleCards.length; i++) {
|
|
1003
|
-
var style = window.getComputedStyle(visibleCards[i]);
|
|
1004
|
-
if (style.display !== 'none') {
|
|
1005
|
-
hasVisible = true;
|
|
1006
|
-
break;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
section.style.display = hasVisible ? '' : 'none';
|
|
1010
|
-
});
|
|
1011
|
-
|
|
1012
|
-
if (emptyState) {
|
|
1013
|
-
emptyState.style.display = q && !anyVisible ? '' : 'none';
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
input.addEventListener('input', function () {
|
|
1018
|
-
update(input.value);
|
|
1019
|
-
});
|
|
1020
|
-
}());
|
|
1021
|
-
|
|
1022
|
-
function copyPackageUrl(btn) {
|
|
1023
|
-
var url = window.location.origin + '/api/package';
|
|
1024
|
-
navigator.clipboard.writeText(url);
|
|
1025
|
-
var originalHtml = btn.innerHTML;
|
|
1026
|
-
btn.innerHTML = '✓';
|
|
1027
|
-
btn.style.color = '#10b981';
|
|
1028
|
-
setTimeout(function() {
|
|
1029
|
-
btn.innerHTML = originalHtml;
|
|
1030
|
-
btn.style.color = '#6b7280';
|
|
1031
|
-
}, 1500);
|
|
1032
|
-
}
|
|
1033
|
-
</script>
|
|
1034
|
-
</body>
|
|
1035
|
-
</html>`;
|
|
1036
|
-
}
|
|
1037
|
-
/**
|
|
1038
|
-
* Render a tool collection detail page
|
|
1039
|
-
*/
|
|
1040
|
-
function toolCollectionPage(collection) {
|
|
1041
|
-
const toolsArray = Array.from(collection);
|
|
1042
|
-
return /*html*/ `
|
|
1043
|
-
<!DOCTYPE html>
|
|
1044
|
-
<html lang="en">
|
|
1045
|
-
<head>
|
|
1046
|
-
<meta charset="UTF-8">
|
|
1047
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1048
|
-
<title>${collection.title || collection.name} - Tools</title>
|
|
1049
|
-
<style>${detailStyles}</style>
|
|
1050
|
-
</head>
|
|
1051
|
-
<body>
|
|
1052
|
-
<nav class="nav">
|
|
1053
|
-
<a href="/">${backArrow} Back to all collections</a>
|
|
1054
|
-
</nav>
|
|
1055
|
-
|
|
1056
|
-
<div class="header">
|
|
1057
|
-
<div class="header-icon">${collection.icon || defaultIcon}</div>
|
|
1058
|
-
<div>
|
|
1059
|
-
<h1>${collection.title || collection.name}</h1>
|
|
1060
|
-
<p style="color: #6b7280; margin: 0.25rem 0 0 0;">${collection.description || ''}</p>
|
|
1061
|
-
<div class="endpoint-box">
|
|
1062
|
-
<code>/api/tools/${collection.name}</code>
|
|
1063
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/api/tools/${collection.name}')" title="Copy endpoint URL">
|
|
1064
|
-
${copyIcon}
|
|
1065
|
-
</button>
|
|
1066
|
-
</div>
|
|
1067
|
-
</div>
|
|
1068
|
-
</div>
|
|
1069
|
-
|
|
1070
|
-
<h2>${toolsArray.length} Tool${toolsArray.length !== 1 ? 's' : ''}</h2>
|
|
1071
|
-
|
|
1072
|
-
${toolsArray.length > 0 ?
|
|
1073
|
-
toolsArray.map(tool => toolDetailCard(tool, collection.name)).join('') :
|
|
1074
|
-
'<div class="empty-state">No tools in this collection</div>'}
|
|
1075
|
-
</body>
|
|
1076
|
-
</html>`;
|
|
1077
|
-
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Render a skill collection detail page
|
|
1080
|
-
*/
|
|
1081
|
-
function skillCollectionPage(collection) {
|
|
1082
|
-
const skillsArray = Array.from(collection);
|
|
1083
|
-
return /*html*/ `
|
|
1084
|
-
<!DOCTYPE html>
|
|
1085
|
-
<html lang="en">
|
|
1086
|
-
<head>
|
|
1087
|
-
<meta charset="UTF-8">
|
|
1088
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1089
|
-
<title>${collection.title || collection.name} - Skills</title>
|
|
1090
|
-
<style>${detailStyles}</style>
|
|
1091
|
-
</head>
|
|
1092
|
-
<body>
|
|
1093
|
-
<nav class="nav">
|
|
1094
|
-
<a href="/">${backArrow} Back to all collections</a>
|
|
1095
|
-
</nav>
|
|
1096
|
-
|
|
1097
|
-
<div class="header">
|
|
1098
|
-
<div class="header-icon">${collection.icon || skillIcon}</div>
|
|
1099
|
-
<div>
|
|
1100
|
-
<h1>${collection.title || collection.name}</h1>
|
|
1101
|
-
<p style="color: #6b7280; margin: 0.25rem 0 0 0;">${collection.description || ''}</p>
|
|
1102
|
-
<div class="endpoint-box">
|
|
1103
|
-
<code>/api/skills/${collection.name}</code>
|
|
1104
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/api/skills/${collection.name}')" title="Copy endpoint URL">
|
|
1105
|
-
${copyIcon}
|
|
1106
|
-
</button>
|
|
1107
|
-
</div>
|
|
1108
|
-
</div>
|
|
1109
|
-
</div>
|
|
1110
|
-
|
|
1111
|
-
<h2>${skillsArray.length} Skill${skillsArray.length !== 1 ? 's' : ''}</h2>
|
|
1112
|
-
|
|
1113
|
-
${skillsArray.length > 0 ?
|
|
1114
|
-
skillsArray.map(skill => skillDetailCard(skill, collection)).join('') :
|
|
1115
|
-
'<div class="empty-state">No skills in this collection</div>'}
|
|
1116
|
-
</body>
|
|
1117
|
-
</html>`;
|
|
1118
|
-
}
|
|
1119
|
-
/**
|
|
1120
|
-
* Render a collection header with icon, title, description, and endpoint
|
|
1121
|
-
*/
|
|
1122
|
-
function collectionDetailHeader(collection, pathPrefix) {
|
|
1123
|
-
return /*html*/ `
|
|
1124
|
-
<nav class="nav">
|
|
1125
|
-
<a href="/">${backArrow} Back to all collections</a>
|
|
1126
|
-
</nav>
|
|
1127
|
-
|
|
1128
|
-
<div class="header">
|
|
1129
|
-
<div class="header-icon">${collection.icon || defaultIcon}</div>
|
|
1130
|
-
<div>
|
|
1131
|
-
<h1>${collection.title || collection.name}</h1>
|
|
1132
|
-
<p style="color: #6b7280; margin: 0.25rem 0 0 0;">${collection.description || ''}</p>
|
|
1133
|
-
<div class="endpoint-box">
|
|
1134
|
-
<code>/api/${pathPrefix}/${collection.name}</code>
|
|
1135
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/api/${pathPrefix}/${collection.name}')" title="Copy endpoint URL">
|
|
1136
|
-
${copyIcon}
|
|
1137
|
-
</button>
|
|
1138
|
-
</div>
|
|
1139
|
-
</div>
|
|
1140
|
-
</div>`;
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* Render a simple item card with name, description, and tags
|
|
1144
|
-
*/
|
|
1145
|
-
function simpleItemCard(item) {
|
|
1146
|
-
return /*html*/ `
|
|
1147
|
-
<div class="detail-card">
|
|
1148
|
-
<div class="detail-header">
|
|
1149
|
-
<div>
|
|
1150
|
-
<h3 class="detail-title">${item.name}</h3>
|
|
1151
|
-
<p class="detail-desc">${item.description || 'No description'}</p>
|
|
1152
|
-
</div>
|
|
1153
|
-
<div class="detail-badges">
|
|
1154
|
-
${item.tags?.map(tag => `<span class="badge">${tag}</span>`).join('') || ''}
|
|
1155
|
-
</div>
|
|
1156
|
-
</div>
|
|
1157
|
-
</div>`;
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* Render an interaction collection detail page
|
|
1161
|
-
*/
|
|
1162
|
-
function interactionCollectionPage(collection) {
|
|
1163
|
-
return /*html*/ `
|
|
1164
|
-
<!DOCTYPE html>
|
|
1165
|
-
<html lang="en">
|
|
1166
|
-
<head>
|
|
1167
|
-
<meta charset="UTF-8">
|
|
1168
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1169
|
-
<title>${collection.title || collection.name} - Interactions</title>
|
|
1170
|
-
<style>${detailStyles}</style>
|
|
1171
|
-
</head>
|
|
1172
|
-
<body>
|
|
1173
|
-
${collectionDetailHeader(collection, 'interactions')}
|
|
1174
|
-
|
|
1175
|
-
<h2>${collection.interactions.length} Interaction${collection.interactions.length !== 1 ? 's' : ''}</h2>
|
|
1176
|
-
|
|
1177
|
-
<div class="item-list">
|
|
1178
|
-
${collection.interactions.map(inter => simpleItemCard(inter)).join('')}
|
|
1179
|
-
</div>
|
|
1180
|
-
</body>
|
|
1181
|
-
</html>`;
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Render a content type collection detail page
|
|
1185
|
-
*/
|
|
1186
|
-
function contentTypeCollectionPage(collection) {
|
|
1187
|
-
const typesArray = collection.getContentTypes();
|
|
1188
|
-
return /*html*/ `
|
|
1189
|
-
<!DOCTYPE html>
|
|
1190
|
-
<html lang="en">
|
|
1191
|
-
<head>
|
|
1192
|
-
<meta charset="UTF-8">
|
|
1193
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1194
|
-
<title>${collection.title || collection.name} - Content Types</title>
|
|
1195
|
-
<style>${detailStyles}</style>
|
|
1196
|
-
</head>
|
|
1197
|
-
<body>
|
|
1198
|
-
${collectionDetailHeader(collection, 'types')}
|
|
1199
|
-
|
|
1200
|
-
<h2>${typesArray.length} Content Type${typesArray.length !== 1 ? 's' : ''}</h2>
|
|
1201
|
-
|
|
1202
|
-
<div class="item-list">
|
|
1203
|
-
${typesArray.map(type => simpleItemCard(type)).join('')}
|
|
1204
|
-
</div>
|
|
1205
|
-
</body>
|
|
1206
|
-
</html>`;
|
|
1207
|
-
}
|
|
1208
|
-
/**
|
|
1209
|
-
* Render a detailed activity card
|
|
1210
|
-
*/
|
|
1211
|
-
function activityDetailCard(activity, collectionName) {
|
|
1212
|
-
const schema = activity.input_schema;
|
|
1213
|
-
const properties = schema?.properties;
|
|
1214
|
-
const required = schema?.required;
|
|
1215
|
-
return /*html*/ `
|
|
1216
|
-
<div class="detail-card">
|
|
1217
|
-
<div class="detail-header">
|
|
1218
|
-
<div>
|
|
1219
|
-
<h3 class="detail-title">${activity.name}</h3>
|
|
1220
|
-
<p class="detail-desc">${activity.description || 'No description'}</p>
|
|
1221
|
-
</div>
|
|
1222
|
-
<div class="detail-badges">
|
|
1223
|
-
<span class="badge" style="background: #ec4899; color: white;">Activity</span>
|
|
1224
|
-
</div>
|
|
1225
|
-
</div>
|
|
1226
|
-
<div class="detail-body">
|
|
1227
|
-
<div class="detail-section">
|
|
1228
|
-
<h4 class="detail-section-title">Endpoint</h4>
|
|
1229
|
-
<div class="endpoint-box">
|
|
1230
|
-
<code>POST ${activity.url || `/api/activities/${collectionName}`}</code>
|
|
1231
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText('${activity.url || `/api/activities/${collectionName}`}')" title="Copy">
|
|
1232
|
-
${copyIcon}
|
|
1233
|
-
</button>
|
|
1234
|
-
</div>
|
|
1235
|
-
</div>
|
|
1236
|
-
|
|
1237
|
-
${schema ? /*html*/ `
|
|
1238
|
-
<div class="detail-section">
|
|
1239
|
-
<h4 class="detail-section-title">Input Schema</h4>
|
|
1240
|
-
${properties ? /*html*/ `
|
|
1241
|
-
<div class="info-grid" style="margin-bottom: 1rem;">
|
|
1242
|
-
${Object.entries(properties).map(([key, value]) => {
|
|
1243
|
-
const prop = value;
|
|
1244
|
-
const isRequired = required?.includes(key);
|
|
1245
|
-
return /*html*/ `
|
|
1246
|
-
<div class="info-item">
|
|
1247
|
-
<div class="info-label">${key}${isRequired ? ' *' : ''}</div>
|
|
1248
|
-
<div class="info-value">
|
|
1249
|
-
<code>${prop.type || 'any'}</code>
|
|
1250
|
-
${prop.description ? `<br><span style="color: #6b7280; font-size: 0.85rem;">${prop.description}</span>` : ''}
|
|
1251
|
-
</div>
|
|
1252
|
-
</div>`;
|
|
1253
|
-
}).join('')}
|
|
1254
|
-
</div>
|
|
1255
|
-
` : ''}
|
|
1256
|
-
<details>
|
|
1257
|
-
<summary style="cursor: pointer; color: #6b7280; font-size: 0.85rem;">View full schema</summary>
|
|
1258
|
-
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(schema)}</div>
|
|
1259
|
-
</details>
|
|
1260
|
-
</div>
|
|
1261
|
-
` : /*html*/ `
|
|
1262
|
-
<div class="detail-section">
|
|
1263
|
-
<div class="empty-state">No input schema defined</div>
|
|
1264
|
-
</div>
|
|
1265
|
-
`}
|
|
1266
|
-
|
|
1267
|
-
${activity.output_schema ? /*html*/ `
|
|
1268
|
-
<div class="detail-section">
|
|
1269
|
-
<h4 class="detail-section-title">Output Schema</h4>
|
|
1270
|
-
<details>
|
|
1271
|
-
<summary style="cursor: pointer; color: #6b7280; font-size: 0.85rem;">View output schema</summary>
|
|
1272
|
-
<div class="schema-block" style="margin-top: 0.75rem;">${highlightJson(activity.output_schema)}</div>
|
|
1273
|
-
</details>
|
|
1274
|
-
</div>
|
|
1275
|
-
` : ''}
|
|
1276
|
-
</div>
|
|
1277
|
-
</div>`;
|
|
1278
|
-
}
|
|
1279
|
-
/**
|
|
1280
|
-
* Render an activity collection detail page
|
|
1281
|
-
*/
|
|
1282
|
-
function activityCollectionPage(collection) {
|
|
1283
|
-
const activitiesArray = collection.getActivityDefinitions();
|
|
1284
|
-
return /*html*/ `
|
|
1285
|
-
<!DOCTYPE html>
|
|
1286
|
-
<html lang="en">
|
|
1287
|
-
<head>
|
|
1288
|
-
<meta charset="UTF-8">
|
|
1289
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1290
|
-
<title>${collection.title || collection.name} - Activities</title>
|
|
1291
|
-
<style>${detailStyles}</style>
|
|
1292
|
-
</head>
|
|
1293
|
-
<body>
|
|
1294
|
-
<nav class="nav">
|
|
1295
|
-
<a href="/">${backArrow} Back to all collections</a>
|
|
1296
|
-
</nav>
|
|
1297
|
-
|
|
1298
|
-
<div class="header">
|
|
1299
|
-
<div class="header-icon">${collection.icon || activityIcon}</div>
|
|
1300
|
-
<div>
|
|
1301
|
-
<h1>${collection.title || collection.name}</h1>
|
|
1302
|
-
<p style="color: #6b7280; margin: 0.25rem 0 0 0;">${collection.description || ''}</p>
|
|
1303
|
-
<div class="endpoint-box">
|
|
1304
|
-
<code>/api/activities/${collection.name}</code>
|
|
1305
|
-
<button class="copy-btn" onclick="navigator.clipboard.writeText(window.location.origin + '/api/activities/${collection.name}')" title="Copy endpoint URL">
|
|
1306
|
-
${copyIcon}
|
|
1307
|
-
</button>
|
|
1308
|
-
</div>
|
|
1309
|
-
</div>
|
|
1310
|
-
</div>
|
|
1311
|
-
|
|
1312
|
-
<h2>${activitiesArray.length} Activit${activitiesArray.length !== 1 ? 'ies' : 'y'}</h2>
|
|
1313
|
-
|
|
1314
|
-
${activitiesArray.length > 0 ?
|
|
1315
|
-
activitiesArray.map(activity => activityDetailCard(activity, collection.name)).join('') :
|
|
1316
|
-
'<div class="empty-state">No activities in this collection</div>'}
|
|
1317
|
-
</body>
|
|
1318
|
-
</html>`;
|
|
1319
|
-
}
|
|
1320
|
-
//# sourceMappingURL=templates.js.map
|