@emseepea/create-tool-server 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@
14
14
  "lint": "oxlint src test eval"
15
15
  },
16
16
  "dependencies": {
17
- "@emseepea/server": "0.0.4",
17
+ "@emseepea/server": "0.1.0",
18
18
  "zod": "4.4.3"
19
19
  },
20
20
  "devDependencies": {
@@ -0,0 +1,47 @@
1
+ import { defineTool, type CapabilityModuleFactory } from "@emseepea/server";
2
+ import { z } from "zod";
3
+
4
+ const beanNames = ["Harbour Dawn", "Highland Bloom"] as const;
5
+ const beanDetailsSchema = z.object({
6
+ name: z.enum(beanNames),
7
+ origin: z.string(),
8
+ variety: z.string(),
9
+ process: z.string(),
10
+ roast: z.enum(["light", "medium", "dark"]),
11
+ tastingNotes: z.array(z.string()),
12
+ });
13
+ const beans: Record<(typeof beanNames)[number], z.input<typeof beanDetailsSchema>> = {
14
+ "Harbour Dawn": {
15
+ name: "Harbour Dawn",
16
+ origin: "Sample Coast",
17
+ variety: "Caturra",
18
+ process: "washed",
19
+ roast: "light",
20
+ tastingNotes: ["citrus", "honey"],
21
+ },
22
+ "Highland Bloom": {
23
+ name: "Highland Bloom",
24
+ origin: "Sample Highlands",
25
+ variety: "Bourbon",
26
+ process: "natural",
27
+ roast: "medium",
28
+ tastingNotes: ["berry", "cocoa"],
29
+ },
30
+ };
31
+
32
+ export default (() => defineTool({
33
+ name: "get-bean-details",
34
+ access: "public",
35
+ title: "Coffee Bean Details",
36
+ description: "Get origin, processing, roast, and tasting details for a sample coffee bean.",
37
+ inputSchema: z.object({ name: z.enum(beanNames) }),
38
+ outputSchema: beanDetailsSchema,
39
+ handler: ({ name }) => {
40
+ const data = beans[name];
41
+ return {
42
+ text: `${data.name} is a ${data.roast} ${data.process} ${data.variety} from ` +
43
+ `${data.origin}, with notes of ${data.tastingNotes.join(" and ")}.`,
44
+ data,
45
+ };
46
+ },
47
+ })) satisfies CapabilityModuleFactory;
@@ -1,58 +1,10 @@
1
- import { defineTool, createEmseepea, serveEmseepea } from "@emseepea/server";
2
- import { z } from "zod";
3
-
4
- const beanNames = ["Harbour Dawn", "Highland Bloom"] as const;
5
- const beanDetailsSchema = z.object({
6
- name: z.enum(beanNames),
7
- origin: z.string(),
8
- variety: z.string(),
9
- process: z.string(),
10
- roast: z.enum(["light", "medium", "dark"]),
11
- tastingNotes: z.array(z.string()),
12
- });
13
- const beans: Record<(typeof beanNames)[number], z.input<typeof beanDetailsSchema>> = {
14
- "Harbour Dawn": {
15
- name: "Harbour Dawn",
16
- origin: "Sample Coast",
17
- variety: "Caturra",
18
- process: "washed",
19
- roast: "light",
20
- tastingNotes: ["citrus", "honey"],
21
- },
22
- "Highland Bloom": {
23
- name: "Highland Bloom",
24
- origin: "Sample Highlands",
25
- variety: "Bourbon",
26
- process: "natural",
27
- roast: "medium",
28
- tastingNotes: ["berry", "cocoa"],
29
- },
30
- };
31
-
32
- const getBeanDetails = defineTool({
33
- name: "get-bean-details",
34
- access: "public",
35
- title: "Coffee Bean Details",
36
- description: "Get origin, processing, roast, and tasting details for a sample coffee bean.",
37
- inputSchema: z.object({
38
- name: z.enum(beanNames),
39
- }),
40
- outputSchema: beanDetailsSchema,
41
- handler: ({ name }) => {
42
- const data = beans[name];
43
- return {
44
- text: `${data.name} is a ${data.roast} ${data.process} ${data.variety} from ` +
45
- `${data.origin}, with notes of ${data.tastingNotes.join(" and ")}.`,
46
- data,
47
- };
48
- },
49
- });
1
+ import { createEmseepea, discoverCapabilities, serveEmseepea } from "@emseepea/server";
50
2
 
51
3
  const handler = createEmseepea({
52
4
  name: "emseepea-basic-no-ui",
53
5
  version: "0.0.0",
54
6
  instructions: "Use get-bean-details for information about a sample coffee bean.",
55
- tools: [getBeanDetails],
7
+ ...await discoverCapabilities(new URL("./capabilities/", import.meta.url)),
56
8
  });
57
9
 
58
10
  const running = await serveEmseepea(handler, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-tool-server",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Create an Em See Pea server with one public tool.",
5
5
  "license": "MIT",
6
6
  "repository": {