@emseepea/create-tool-server 0.0.7 → 0.0.8

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.
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "private": true,
26
26
  "dependencies": {
27
- "@emseepea/server": "0.3.0",
27
+ "@emseepea/server": "0.3.1",
28
28
  "zod": "4.4.3"
29
29
  }
30
30
  }
@@ -2,14 +2,15 @@ import { defineTool, type CapabilityModuleFactory } from "@emseepea/server";
2
2
  import { z } from "zod";
3
3
 
4
4
  const varietyNames = ["Harbour Gem", "Highland Snap"] as const;
5
- const peaVarietySchema = z.object({
5
+ const inputSchema = z.object({ name: z.enum(varietyNames) });
6
+ const outputSchema = z.object({
6
7
  name: z.enum(varietyNames),
7
8
  peaType: z.enum(["shelling", "snap"]),
8
9
  growthHabit: z.enum(["bush", "climbing"]),
9
10
  daysToMaturity: z.number().int().positive(),
10
11
  traits: z.array(z.string()),
11
12
  });
12
- const varieties: Record<(typeof varietyNames)[number], z.input<typeof peaVarietySchema>> = {
13
+ const varieties: Record<(typeof varietyNames)[number], z.input<typeof outputSchema>> = {
13
14
  "Harbour Gem": {
14
15
  name: "Harbour Gem",
15
16
  peaType: "shelling",
@@ -31,8 +32,8 @@ export default (() => defineTool({
31
32
  access: "public",
32
33
  title: "Pea Variety Details",
33
34
  description: "Get the type, growth habit, maturity time, and traits of a sample pea variety.",
34
- inputSchema: z.object({ name: z.enum(varietyNames) }),
35
- outputSchema: peaVarietySchema,
35
+ inputSchema,
36
+ outputSchema,
36
37
  handler: ({ name }) => {
37
38
  const data = varieties[name];
38
39
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-tool-server",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Create an Em See Pea server with one public tool.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "prepack": "npm run build:initializer"
19
19
  },
20
20
  "devDependencies": {
21
- "@emseepea/server": "0.3.0",
21
+ "@emseepea/server": "0.3.1",
22
22
  "zod": "4.4.3",
23
23
  "@emseepea/testing": "0.3.0",
24
24
  "@types/node": "24.13.3",