tool-server-template 0.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/.env.example +14 -0
  2. package/LICENSE +13 -0
  3. package/README.md +611 -0
  4. package/TESTING.md +480 -0
  5. package/api/index.js +31 -0
  6. package/lib/build-site.d.ts +2 -0
  7. package/lib/build-site.d.ts.map +1 -0
  8. package/lib/build-site.js +42 -0
  9. package/lib/build-site.js.map +1 -0
  10. package/lib/copy-assets.d.ts +8 -0
  11. package/lib/copy-assets.d.ts.map +1 -0
  12. package/lib/copy-assets.js +62 -0
  13. package/lib/copy-assets.js.map +1 -0
  14. package/lib/interactions/index.d.ts +2 -0
  15. package/lib/interactions/index.d.ts.map +1 -0
  16. package/lib/interactions/index.js +10 -0
  17. package/lib/interactions/index.js.map +1 -0
  18. package/lib/interactions/summarize/icon.svg.d.ts +3 -0
  19. package/lib/interactions/summarize/icon.svg.d.ts.map +1 -0
  20. package/lib/interactions/summarize/icon.svg.js +10 -0
  21. package/lib/interactions/summarize/icon.svg.js.map +1 -0
  22. package/lib/interactions/summarize/index.d.ts +3 -0
  23. package/lib/interactions/summarize/index.d.ts.map +1 -0
  24. package/lib/interactions/summarize/index.js +14 -0
  25. package/lib/interactions/summarize/index.js.map +1 -0
  26. package/lib/interactions/summarize/text_summarizer/index.d.ts +53 -0
  27. package/lib/interactions/summarize/text_summarizer/index.d.ts.map +1 -0
  28. package/lib/interactions/summarize/text_summarizer/index.js +56 -0
  29. package/lib/interactions/summarize/text_summarizer/index.js.map +1 -0
  30. package/lib/interactions/summarize/text_summarizer/prompt.jst +31 -0
  31. package/lib/interactions/summarize/text_summarizer/prompt.jst.js +4 -0
  32. package/lib/interactions/summarize/text_summarizer/prompt.jst.js.map +1 -0
  33. package/lib/server-node.d.ts +2 -0
  34. package/lib/server-node.d.ts.map +1 -0
  35. package/lib/server-node.js +14 -0
  36. package/lib/server-node.js.map +1 -0
  37. package/lib/server.d.ts +3 -0
  38. package/lib/server.d.ts.map +1 -0
  39. package/lib/server.js +17 -0
  40. package/lib/server.js.map +1 -0
  41. package/lib/skills/code-review/SKILL.md +59 -0
  42. package/lib/skills/index.d.ts +4 -0
  43. package/lib/skills/index.d.ts.map +1 -0
  44. package/lib/skills/index.js +14 -0
  45. package/lib/skills/index.js.map +1 -0
  46. package/lib/tools/calculator/calculator.d.ts +23 -0
  47. package/lib/tools/calculator/calculator.d.ts.map +1 -0
  48. package/lib/tools/calculator/calculator.js +42 -0
  49. package/lib/tools/calculator/calculator.js.map +1 -0
  50. package/lib/tools/calculator/icon.svg.d.ts +3 -0
  51. package/lib/tools/calculator/icon.svg.d.ts.map +1 -0
  52. package/lib/tools/calculator/icon.svg.js +10 -0
  53. package/lib/tools/calculator/icon.svg.js.map +1 -0
  54. package/lib/tools/calculator/index.d.ts +3 -0
  55. package/lib/tools/calculator/index.d.ts.map +1 -0
  56. package/lib/tools/calculator/index.js +14 -0
  57. package/lib/tools/calculator/index.js.map +1 -0
  58. package/lib/tools/calculator/manifest.d.ts +16 -0
  59. package/lib/tools/calculator/manifest.d.ts.map +1 -0
  60. package/lib/tools/calculator/manifest.js +17 -0
  61. package/lib/tools/calculator/manifest.js.map +1 -0
  62. package/lib/tools/index.d.ts +2 -0
  63. package/lib/tools/index.d.ts.map +1 -0
  64. package/lib/tools/index.js +8 -0
  65. package/lib/tools/index.js.map +1 -0
  66. package/package.json +51 -0
  67. package/public/.gitkeep +1 -0
  68. package/rollup.config.bundle.js +60 -0
  69. package/rollup.config.js +99 -0
  70. package/src/build-site.ts +77 -0
  71. package/src/copy-assets.ts +104 -0
  72. package/src/interactions/index.ts +7 -0
  73. package/src/interactions/summarize/icon.svg.ts +7 -0
  74. package/src/interactions/summarize/index.ts +11 -0
  75. package/src/interactions/summarize/text_summarizer/index.ts +53 -0
  76. package/src/interactions/summarize/text_summarizer/prompt.jst +31 -0
  77. package/src/raw-imports.d.ts +4 -0
  78. package/src/server-node.ts +24 -0
  79. package/src/server.ts +22 -0
  80. package/src/skills/code-review/SKILL.md +59 -0
  81. package/src/skills/index.ts +12 -0
  82. package/src/tools/calculator/calculator.ts +60 -0
  83. package/src/tools/calculator/icon.svg.ts +7 -0
  84. package/src/tools/calculator/index.ts +11 -0
  85. package/src/tools/calculator/manifest.ts +16 -0
  86. package/src/tools/index.ts +5 -0
  87. package/template.config.json +27 -0
  88. package/tsconfig.json +25 -0
  89. package/vercel.json +29 -0
@@ -0,0 +1,3 @@
1
+ import { InteractionCollection } from "@vertesia/tools-sdk";
2
+ export declare const SummarizeInteractions: InteractionCollection;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/summarize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,eAAO,MAAM,qBAAqB,uBAMhC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { InteractionCollection } from '@vertesia/tools-sdk';
2
+ import textSummarizer from './text_summarizer/index.js';
3
+ import icon from './icon.svg.js';
4
+
5
+ const SummarizeInteractions = new InteractionCollection({
6
+ name: "summarize",
7
+ title: "Summarization Interactions",
8
+ description: "A collection of interactions for summarizing and condensing text",
9
+ icon,
10
+ interactions: [textSummarizer]
11
+ });
12
+
13
+ export { SummarizeInteractions };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/interactions/summarize/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIO,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,CAAC;AAC3D,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,4BAA4B;AACnC,IAAA,WAAW,EAAE,kEAAkE;IAC/E,IAAI;IACJ,YAAY,EAAE,CAAC,cAAc;AAChC,CAAA;;;;"}
@@ -0,0 +1,53 @@
1
+ import { PromptRole } from "@llumiverse/common";
2
+ import { TemplateType } from "@vertesia/common";
3
+ declare const _default: {
4
+ name: string;
5
+ title: string;
6
+ description: string;
7
+ result_schema: {
8
+ type: "object";
9
+ properties: {
10
+ summary: {
11
+ type: "string";
12
+ description: string;
13
+ };
14
+ word_count: {
15
+ type: "number";
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ prompts: {
22
+ role: PromptRole.user;
23
+ content: string;
24
+ content_type: TemplateType.jst;
25
+ schema: {
26
+ type: "object";
27
+ properties: {
28
+ text: {
29
+ type: "string";
30
+ description: string;
31
+ };
32
+ style: {
33
+ type: "string";
34
+ enum: string[];
35
+ description: string;
36
+ };
37
+ maxLength: {
38
+ type: "number";
39
+ description: string;
40
+ };
41
+ format: {
42
+ type: "string";
43
+ enum: string[];
44
+ description: string;
45
+ };
46
+ };
47
+ required: string[];
48
+ };
49
+ }[];
50
+ tags: string[];
51
+ };
52
+ export default _default;
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interactions/summarize/text_summarizer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAmB,YAAY,EAAE,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGjE,wBAgD4B"}
@@ -0,0 +1,56 @@
1
+ import { PromptRole } from '@llumiverse/common';
2
+ import { TemplateType } from '@vertesia/common';
3
+ import PROMPT_CONTENT from './prompt.jst.js';
4
+
5
+ var textSummarizer = {
6
+ name: "text_summarizer",
7
+ title: "Text Summarizer",
8
+ description: "Summarizes text according to specified parameters like style, length, and format.",
9
+ result_schema: {
10
+ type: "object",
11
+ properties: {
12
+ summary: {
13
+ type: "string",
14
+ description: "The generated summary"
15
+ },
16
+ word_count: {
17
+ type: "number",
18
+ description: "Number of words in the summary"
19
+ }
20
+ },
21
+ required: ["summary"]
22
+ },
23
+ prompts: [{
24
+ role: PromptRole.user,
25
+ content: PROMPT_CONTENT,
26
+ content_type: TemplateType.jst,
27
+ schema: {
28
+ type: "object",
29
+ properties: {
30
+ text: {
31
+ type: "string",
32
+ description: "The text to summarize"
33
+ },
34
+ style: {
35
+ type: "string",
36
+ enum: ["concise", "detailed", "bullet-points", "executive"],
37
+ description: "The summary style"
38
+ },
39
+ maxLength: {
40
+ type: "number",
41
+ description: "Maximum length in words (optional)"
42
+ },
43
+ format: {
44
+ type: "string",
45
+ enum: ["paragraph", "bullet-points", "structured"],
46
+ description: "Output format (optional)"
47
+ }
48
+ },
49
+ required: ["text"]
50
+ }
51
+ }],
52
+ tags: ["text", "summarization", "nlp", "content"]
53
+ };
54
+
55
+ export { textSummarizer as default };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/interactions/summarize/text_summarizer/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIA,qBAAe;AACX,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE,iBAAiB;AACxB,IAAA,WAAW,EAAE,mFAAmF;AAChG,IAAA,aAAa,EAAE;AACX,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,UAAU,EAAE;AACR,YAAA,OAAO,EAAE;AACL,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,WAAW,EAAE;AAChB,aAAA;AACD,YAAA,UAAU,EAAE;AACR,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,WAAW,EAAE;AAChB;AACJ,SAAA;QACD,QAAQ,EAAE,CAAC,SAAS;AACvB,KAAA;AACD,IAAA,OAAO,EAAE,CAAC;YACN,IAAI,EAAE,UAAU,CAAC,IAAI;AACrB,YAAA,OAAO,EAAE,cAAc;YACvB,YAAY,EAAE,YAAY,CAAC,GAAG;AAC9B,YAAA,MAAM,EAAE;AACJ,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,UAAU,EAAE;AACR,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EAAE;AAChB,qBAAA;AACD,oBAAA,KAAK,EAAE;AACH,wBAAA,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,CAAC;AAC3D,wBAAA,WAAW,EAAE;AAChB,qBAAA;AACD,oBAAA,SAAS,EAAE;AACP,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EAAE;AAChB,qBAAA;AACD,oBAAA,MAAM,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,YAAY,CAAC;AAClD,wBAAA,WAAW,EAAE;AAChB;AACJ,iBAAA;gBACD,QAAQ,EAAE,CAAC,MAAM;AACpB;SACJ,CAAC;IACF,IAAI,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS;CACzB;;;;"}
@@ -0,0 +1,31 @@
1
+ return `
2
+ # Text Summarization Request
3
+
4
+ Please summarize the following text according to the specifications below.
5
+
6
+ ## Text to Summarize
7
+ ${text}
8
+
9
+ ## Summarization Parameters
10
+ - **Style**: ${style || 'concise'}
11
+ - **Max Length**: ${maxLength ? maxLength + ' words' : 'flexible'}
12
+ ${format ? `- **Output Format**: ${format}` : ''}
13
+
14
+ ## Instructions
15
+
16
+ 1. Read and understand the full text
17
+ 2. Identify the main points and key information
18
+ 3. Create a summary that:
19
+ - Captures the essential meaning
20
+ - Maintains accuracy
21
+ - Uses clear, simple language
22
+ - Follows the ${style} style
23
+ ${maxLength ? `- Stays within ${maxLength} words` : ''}
24
+ ${format ? `- Is formatted as ${format}` : ''}
25
+
26
+ 4. If the text contains multiple topics, organize your summary accordingly
27
+
28
+ ## Output
29
+
30
+ Provide your summary below:
31
+ `;
@@ -0,0 +1,4 @@
1
+ var PROMPT_CONTENT = "return `\n# Text Summarization Request\n\nPlease summarize the following text according to the specifications below.\n\n## Text to Summarize\n${text}\n\n## Summarization Parameters\n- **Style**: ${style || 'concise'}\n- **Max Length**: ${maxLength ? maxLength + ' words' : 'flexible'}\n${format ? `- **Output Format**: ${format}` : ''}\n\n## Instructions\n\n1. Read and understand the full text\n2. Identify the main points and key information\n3. Create a summary that:\n - Captures the essential meaning\n - Maintains accuracy\n - Uses clear, simple language\n - Follows the ${style} style\n ${maxLength ? `- Stays within ${maxLength} words` : ''}\n ${format ? `- Is formatted as ${format}` : ''}\n\n4. If the text contains multiple topics, organize your summary accordingly\n\n## Output\n\nProvide your summary below:\n`;\n";
2
+
3
+ export { PROMPT_CONTENT as default };
4
+ //# sourceMappingURL=prompt.jst.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.jst.js","sources":["../../../../src/interactions/summarize/text_summarizer/prompt.jst?raw"],"sourcesContent":["export default \"return `\\n# Text Summarization Request\\n\\nPlease summarize the following text according to the specifications below.\\n\\n## Text to Summarize\\n${text}\\n\\n## Summarization Parameters\\n- **Style**: ${style || 'concise'}\\n- **Max Length**: ${maxLength ? maxLength + ' words' : 'flexible'}\\n${format ? `- **Output Format**: ${format}` : ''}\\n\\n## Instructions\\n\\n1. Read and understand the full text\\n2. Identify the main points and key information\\n3. Create a summary that:\\n - Captures the essential meaning\\n - Maintains accuracy\\n - Uses clear, simple language\\n - Follows the ${style} style\\n ${maxLength ? `- Stays within ${maxLength} words` : ''}\\n ${format ? `- Is formatted as ${format}` : ''}\\n\\n4. If the text contains multiple topics, organize your summary accordingly\\n\\n## Output\\n\\nProvide your summary below:\\n`;\\n\""],"names":[],"mappings":"AAAA,qBAAe;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=server-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-node.d.ts","sourceRoot":"","sources":["../src/server-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import { serve } from '@hono/node-server';
2
+ import server from './server.js';
3
+
4
+ const port = parseInt(process.env.PORT || '3000', 10);
5
+ console.log(`Starting Tool Server on port ${port}...`);
6
+ console.log(`API endpoint: http://localhost:${port}/api`);
7
+ console.log(`Web UI: http://localhost:${port}/`);
8
+ serve({
9
+ fetch: server.fetch,
10
+ port
11
+ }, (info) => {
12
+ console.log(`✓ Server is running at http://localhost:${info.port}`);
13
+ });
14
+ //# sourceMappingURL=server-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-node.js","sources":["../src/server-node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAYA,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC;AAErD,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,CAAA,GAAA,CAAK,CAAC;AACtD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,CAAA,IAAA,CAAM,CAAC;AACzD,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,CAAA,CAAA,CAAG,CAAC;AAEhD,KAAK,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB;CACH,EAAE,CAAC,IAAI,KAAI;IACR,OAAO,CAAC,GAAG,CAAC,CAAA,wCAAA,EAA2C,IAAI,CAAC,IAAI,CAAA,CAAE,CAAC;AACvE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const server: import("hono").Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
2
+ export default server;
3
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,MAAM,2FAQV,CAAC;AAEH,eAAe,MAAM,CAAC"}
package/lib/server.js ADDED
@@ -0,0 +1,17 @@
1
+ import { createToolServer } from '@vertesia/tools-sdk';
2
+ import { loadInteractions } from './interactions/index.js';
3
+ import { skills } from './skills/index.js';
4
+ import { tools } from './tools/index.js';
5
+
6
+ const CONFIG__SERVER_TITLE = "Tool Server Template";
7
+ const interactions = await loadInteractions();
8
+ const server = createToolServer({
9
+ title: CONFIG__SERVER_TITLE,
10
+ prefix: '/api',
11
+ tools,
12
+ interactions,
13
+ skills,
14
+ });
15
+
16
+ export { server as default };
17
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../src/server.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA,MAAM,oBAAoB,GAAG,sBAAsB;AAGnD,MAAM,YAAY,GAAG,MAAM,gBAAgB,EAAE;AAG7C,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAC5B,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,MAAM,EAAE,MAAM;IACd,KAAK;IACL,YAAY;IACZ,MAAM;AAGT,CAAA;;;;"}
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: code-review
3
+ title: Code Review Assistant
4
+ keywords: code, review, quality, best-practices, refactoring
5
+ ---
6
+
7
+ # Code Review Assistant
8
+
9
+ You are a code review assistant. Your role is to analyze code and provide constructive feedback focusing on:
10
+
11
+ ## Review Areas
12
+
13
+ 1. **Code Quality**
14
+ - Readability and maintainability
15
+ - Naming conventions
16
+ - Code organization and structure
17
+ - DRY (Don't Repeat Yourself) principle
18
+
19
+ 2. **Best Practices**
20
+ - Language-specific idioms and patterns
21
+ - Error handling
22
+ - Edge cases
23
+ - Security considerations
24
+
25
+ 3. **Performance**
26
+ - Algorithmic efficiency
27
+ - Resource usage
28
+ - Potential bottlenecks
29
+
30
+ 4. **Testing**
31
+ - Test coverage
32
+ - Test quality and clarity
33
+ - Missing test cases
34
+
35
+ ## Review Format
36
+
37
+ Structure your review as follows:
38
+
39
+ ### Strengths
40
+ List what the code does well.
41
+
42
+ ### Issues
43
+ For each issue found:
44
+ - **Severity**: Critical | Major | Minor
45
+ - **Location**: File and line number
46
+ - **Description**: What the issue is
47
+ - **Recommendation**: How to fix it
48
+ - **Example**: Show improved code if applicable
49
+
50
+ ### Summary
51
+ Provide an overall assessment and priority recommendations.
52
+
53
+ ## Guidelines
54
+
55
+ - Be constructive and respectful
56
+ - Explain the "why" behind suggestions
57
+ - Provide specific, actionable feedback
58
+ - Consider the context and requirements
59
+ - Balance perfection with pragmatism
@@ -0,0 +1,4 @@
1
+ import { SkillCollection } from "@vertesia/tools-sdk";
2
+ export declare const CodeReviewSkills: SkillCollection;
3
+ export declare const skills: SkillCollection[];
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA2B,MAAM,qBAAqB,CAAC;AAE/E,eAAO,MAAM,gBAAgB,iBAK3B,CAAC;AAEH,eAAO,MAAM,MAAM,mBAElB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { SkillCollection, loadSkillsFromDirectory } from '@vertesia/tools-sdk';
2
+
3
+ const CodeReviewSkills = new SkillCollection({
4
+ name: "code-review",
5
+ title: "Code Review Skills",
6
+ description: "Skills for reviewing and analyzing code quality",
7
+ skills: loadSkillsFromDirectory(new URL("./code-review", import.meta.url).pathname)
8
+ });
9
+ const skills = [
10
+ CodeReviewSkills
11
+ ];
12
+
13
+ export { CodeReviewSkills, skills };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/skills/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEO,MAAM,gBAAgB,GAAG,IAAI,eAAe,CAAC;AAChD,IAAA,IAAI,EAAE,aAAa;AACnB,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,WAAW,EAAE,iDAAiD;AAC9D,IAAA,MAAM,EAAE,uBAAuB,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ;AACrF,CAAA;AAEM,MAAM,MAAM,GAAG;IAClB;;;;;"}
@@ -0,0 +1,23 @@
1
+ import { ToolExecutionContext, ToolExecutionPayload } from "@vertesia/tools-sdk";
2
+ import { ToolResultContent } from "@vertesia/common";
3
+ interface CalculatorParams {
4
+ expression: string;
5
+ }
6
+ declare function calculate(payload: ToolExecutionPayload<CalculatorParams>, _context: ToolExecutionContext): Promise<ToolResultContent>;
7
+ export declare const CalculatorTool: {
8
+ run: typeof calculate;
9
+ name: string;
10
+ description: string;
11
+ input_schema: {
12
+ type: "object";
13
+ properties: {
14
+ expression: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ };
22
+ export {};
23
+ //# sourceMappingURL=calculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculator.d.ts","sourceRoot":"","sources":["../../../src/tools/calculator/calculator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,UAAU,gBAAgB;IACtB,UAAU,EAAE,MAAM,CAAC;CACtB;AA8BD,iBAAe,SAAS,CACpB,OAAO,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,EAC/C,QAAQ,EAAE,oBAAoB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAe5B;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAGO,CAAC"}
@@ -0,0 +1,42 @@
1
+ import manifest from './manifest.js';
2
+
3
+ function evaluateExpression(expr) {
4
+ expr = expr.replace(/\s+/g, '');
5
+ expr = expr.replace(/\^/g, '**');
6
+ if (!/^[0-9+\-*/.()^]+$/.test(expr)) {
7
+ throw new Error('Invalid expression. Only numbers and operators (+, -, *, /, ^) are allowed.');
8
+ }
9
+ try {
10
+ const result = new Function(`'use strict'; return (${expr})`)();
11
+ if (typeof result !== 'number' || !isFinite(result)) {
12
+ throw new Error('Result is not a valid number');
13
+ }
14
+ return result;
15
+ }
16
+ catch (error) {
17
+ throw new Error(`Failed to evaluate expression: ${error instanceof Error ? error.message : 'Unknown error'}`);
18
+ }
19
+ }
20
+ async function calculate(payload, _context) {
21
+ try {
22
+ const { expression } = payload.tool_use.tool_input;
23
+ const result = evaluateExpression(expression);
24
+ return {
25
+ is_error: false,
26
+ content: `Result: ${expression} = ${result}`
27
+ };
28
+ }
29
+ catch (error) {
30
+ return {
31
+ is_error: true,
32
+ content: `Calculation error: ${error instanceof Error ? error.message : 'Unknown error'}`
33
+ };
34
+ }
35
+ }
36
+ const CalculatorTool = {
37
+ ...manifest,
38
+ run: calculate
39
+ };
40
+
41
+ export { CalculatorTool };
42
+ //# sourceMappingURL=calculator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculator.js","sources":["../../../src/tools/calculator/calculator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAYA,SAAS,kBAAkB,CAAC,IAAY,EAAA;IAEpC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAG/B,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;IAGhC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACjC,QAAA,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC;IAClG;AAGA,IAAA,IAAI;QACA,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,yBAAyB,IAAI,CAAA,CAAA,CAAG,CAAC,EAAE;QAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACjD,YAAA,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC;QACnD;AACA,QAAA,OAAO,MAAM;IACjB;IAAE,OAAO,KAAK,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,eAAe,CAAA,CAAE,CAAC;IACjH;AACJ;AAEA,eAAe,SAAS,CACpB,OAA+C,EAC/C,QAA8B,EAAA;AAE9B,IAAA,IAAI;QACA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAW;AACnD,QAAA,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC;QAE7C,OAAO;AACH,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE,CAAA,QAAA,EAAW,UAAU,CAAA,GAAA,EAAM,MAAM,CAAA;SACjB;IACjC;IAAE,OAAO,KAAK,EAAE;QACZ,OAAO;AACH,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,OAAO,EAAE,CAAA,mBAAA,EAAsB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,eAAe,CAAA;SAC9D;IACjC;AACJ;AAEO,MAAM,cAAc,GAAG;AAC1B,IAAA,GAAG,QAAQ;AACX,IAAA,GAAG,EAAE;;;;;"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\"/>\n <line x1=\"8\" y1=\"6\" x2=\"16\" y2=\"6\"/>\n <line x1=\"8\" y1=\"10\" x2=\"16\" y2=\"10\"/>\n <line x1=\"8\" y1=\"14\" x2=\"16\" y2=\"14\"/>\n <line x1=\"8\" y1=\"18\" x2=\"16\" y2=\"18\"/>\n</svg>";
2
+ export default _default;
3
+ //# sourceMappingURL=icon.svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.svg.d.ts","sourceRoot":"","sources":["../../../src/tools/calculator/icon.svg.ts"],"names":[],"mappings":";AAAA,wBAMQ"}
@@ -0,0 +1,10 @@
1
+ var icon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
+ <rect x="4" y="2" width="16" height="20" rx="2"/>
3
+ <line x1="8" y1="6" x2="16" y2="6"/>
4
+ <line x1="8" y1="10" x2="16" y2="10"/>
5
+ <line x1="8" y1="14" x2="16" y2="14"/>
6
+ <line x1="8" y1="18" x2="16" y2="18"/>
7
+ </svg>`;
8
+
9
+ export { icon as default };
10
+ //# sourceMappingURL=icon.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.svg.js","sources":["../../../src/tools/calculator/icon.svg.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,WAAe,CAAA;;;;;;OAMR;;;;"}
@@ -0,0 +1,3 @@
1
+ import { ToolCollection } from "@vertesia/tools-sdk";
2
+ export declare const CalculatorTools: ToolCollection;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/calculator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,eAAO,MAAM,eAAe,gBAM1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { ToolCollection } from '@vertesia/tools-sdk';
2
+ import { CalculatorTool } from './calculator.js';
3
+ import icon from './icon.svg.js';
4
+
5
+ const CalculatorTools = new ToolCollection({
6
+ name: "calculator",
7
+ title: "Calculator Tools",
8
+ description: "A collection of tools for performing mathematical calculations",
9
+ icon,
10
+ tools: [CalculatorTool]
11
+ });
12
+
13
+ export { CalculatorTools };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/tools/calculator/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAC;AAC9C,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,KAAK,EAAE,kBAAkB;AACzB,IAAA,WAAW,EAAE,gEAAgE;IAC7E,IAAI;IACJ,KAAK,EAAE,CAAC,cAAc;AACzB,CAAA;;;;"}
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ name: string;
3
+ description: string;
4
+ input_schema: {
5
+ type: "object";
6
+ properties: {
7
+ expression: {
8
+ type: string;
9
+ description: string;
10
+ };
11
+ };
12
+ required: string[];
13
+ };
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/tools/calculator/manifest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,wBAa2B"}
@@ -0,0 +1,17 @@
1
+ var manifest = {
2
+ name: "calculator",
3
+ description: "Performs basic mathematical calculations. Supports addition (+), subtraction (-), multiplication (*), division (/), and exponentiation (^).",
4
+ input_schema: {
5
+ type: "object",
6
+ properties: {
7
+ expression: {
8
+ type: "string",
9
+ description: "A mathematical expression to evaluate (e.g., '2 + 2', '10 * 5 - 3', '2^8')"
10
+ }
11
+ },
12
+ required: ["expression"]
13
+ }
14
+ };
15
+
16
+ export { manifest as default };
17
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sources":["../../../src/tools/calculator/manifest.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA,eAAe;AACX,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,WAAW,EAAE,6IAA6I;AAC1J,IAAA,YAAY,EAAE;AACV,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,UAAU,EAAE;AACR,YAAA,UAAU,EAAE;AACR,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,WAAW,EAAE;AAChB;AACJ,SAAA;QACD,QAAQ,EAAE,CAAC,YAAY;AAC1B;CACqB;;;;"}
@@ -0,0 +1,2 @@
1
+ export declare const tools: import("@vertesia/tools-sdk").ToolCollection[];
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,gDAEjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { CalculatorTools } from './calculator/index.js';
2
+
3
+ const tools = [
4
+ CalculatorTools
5
+ ];
6
+
7
+ export { tools };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/tools/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEO,MAAM,KAAK,GAAG;IACjB;;;;;"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "tool-server-template",
3
+ "version": "0.80.0",
4
+ "description": "A template for building custom tool servers with tools, skills, and interactions",
5
+ "type": "module",
6
+ "main": "lib/server.js",
7
+ "keywords": [
8
+ "tool-server",
9
+ "hono",
10
+ "vercel",
11
+ "llm",
12
+ "ai",
13
+ "tools",
14
+ "skills",
15
+ "interactions",
16
+ "mcp"
17
+ ],
18
+ "author": "Vertesia",
19
+ "license": "Apache-2.0",
20
+ "devDependencies": {
21
+ "@rollup/plugin-commonjs": "^28.0.8",
22
+ "@rollup/plugin-json": "^6.1.0",
23
+ "@rollup/plugin-node-resolve": "^16.0.3",
24
+ "@rollup/plugin-typescript": "^12.1.2",
25
+ "@types/node": "^22.19.1",
26
+ "concurrently": "^9.1.2",
27
+ "rollup": "^4.52.5",
28
+ "rollup-plugin-terser": "^7.0.2",
29
+ "tslib": "^2.8.1",
30
+ "typescript": "^5.9.3"
31
+ },
32
+ "dependencies": {
33
+ "@hono/node-server": "^1.19.5",
34
+ "dotenv": "^17.2.3",
35
+ "hono": "^4.10.3",
36
+ "@llumiverse/common": "0.23.0",
37
+ "@vertesia/common": "0.80.0",
38
+ "@vertesia/client": "0.80.0",
39
+ "@vertesia/tools-sdk": "0.80.0"
40
+ },
41
+ "scripts": {
42
+ "dev": "npm run build && concurrently \"npm run build:watch\" \"npm run start:watch\"",
43
+ "build": "rollup -c && node ./lib/copy-assets.js src lib && node ./lib/build-site.js ./dist",
44
+ "build:watch": "rollup -c -w",
45
+ "start": "node ./lib/server-node.js",
46
+ "start:watch": "node --watch ./lib/server-node.js",
47
+ "start:debug": "node --inspect --watch ./lib/server-node.js",
48
+ "start:vercel": "vercel dev",
49
+ "test": "echo \"Error: no test specified\" && exit 1"
50
+ }
51
+ }
@@ -0,0 +1 @@
1
+ # Place static assets like logos, images, and other files here