@emseepea/create-html-ui-server 0.0.9 → 0.0.10
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.
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { defineElicitationView, defineTool, type ElicitationView } from "@emseepea/server";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
const peaTypeSchema = z.enum(["all", "shelling", "snap"])
|
|
4
|
+
const peaTypeSchema = z.enum(["all", "shelling", "snap"])
|
|
5
|
+
.describe("Pea type to include, or all pea types.");
|
|
5
6
|
const inputSchema = z.strictObject({
|
|
6
|
-
title: z.string().trim().min(1).max(80),
|
|
7
|
+
title: z.string().trim().min(1).max(80).describe("Title for the planting-plan preview."),
|
|
7
8
|
peaType: peaTypeSchema,
|
|
8
|
-
includeTips: z.boolean(),
|
|
9
|
+
includeTips: z.boolean().describe("Whether to include sample growing tips."),
|
|
9
10
|
});
|
|
10
11
|
const outputSchema = z.strictObject({
|
|
11
|
-
status: z.literal("preview-only"),
|
|
12
|
-
effectPerformed: z.literal(false),
|
|
13
|
-
title: z.string(),
|
|
14
|
-
matchingCount: z.number().int().nonnegative(),
|
|
12
|
+
status: z.literal("preview-only").describe("Confirms that this result is only a preview."),
|
|
13
|
+
effectPerformed: z.literal(false).describe("Confirms that nothing was sent, stored, or changed."),
|
|
14
|
+
title: z.string().describe("Title of the planting-plan preview."),
|
|
15
|
+
matchingCount: z.number().int().nonnegative().describe("Number of sample varieties matching the selected pea type."),
|
|
15
16
|
varieties: z.array(z.strictObject({
|
|
16
|
-
name: z.string(),
|
|
17
|
-
growthHabit: z.enum(["bush", "climbing"]),
|
|
18
|
-
peaType: z.enum(["shelling", "snap"]),
|
|
19
|
-
tips: z.array(z.string()).optional(),
|
|
20
|
-
})),
|
|
21
|
-
notice: z.literal("No report was sent or stored."),
|
|
17
|
+
name: z.string().describe("Name of the sample pea variety."),
|
|
18
|
+
growthHabit: z.enum(["bush", "climbing"]).describe("Whether the variety grows as a bush or climbing vine."),
|
|
19
|
+
peaType: z.enum(["shelling", "snap"]).describe("Whether the variety is grown for shelled peas or edible pods."),
|
|
20
|
+
tips: z.array(z.string()).optional().describe("Sample growing tips when requested."),
|
|
21
|
+
})).describe("Sample pea varieties matching the selected pea type."),
|
|
22
|
+
notice: z.literal("No report was sent or stored.").describe("Reminder that the preview caused no external effect."),
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
const varieties = [
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { startMcpServer } from "@emseepea/testing";
|
|
5
|
+
|
|
6
|
+
test("describes every planting-plan tool property", async (t) => {
|
|
7
|
+
const running = await startMcpServer(t, new URL("../dist/server.js", import.meta.url));
|
|
8
|
+
const client = await running.connect();
|
|
9
|
+
const listed = await client.listTools();
|
|
10
|
+
assert.deepEqual(listed.tools.map(({ name }) => name), ["preview-planting-plan"]);
|
|
11
|
+
const input = listed.tools[0].inputSchema.properties;
|
|
12
|
+
const output = listed.tools[0].outputSchema.properties;
|
|
13
|
+
assert.equal(input.title.description, "Title for the planting-plan preview.");
|
|
14
|
+
assert.equal(input.peaType.description, "Pea type to include, or all pea types.");
|
|
15
|
+
assert.equal(input.includeTips.description, "Whether to include sample growing tips.");
|
|
16
|
+
assert.equal(output.status.description, "Confirms that this result is only a preview.");
|
|
17
|
+
assert.equal(output.effectPerformed.description, "Confirms that nothing was sent, stored, or changed.");
|
|
18
|
+
assert.equal(output.title.description, "Title of the planting-plan preview.");
|
|
19
|
+
assert.equal(output.matchingCount.description, "Number of sample varieties matching the selected pea type.");
|
|
20
|
+
assert.equal(output.varieties.description, "Sample pea varieties matching the selected pea type.");
|
|
21
|
+
assert.equal(output.varieties.items.properties.name.description, "Name of the sample pea variety.");
|
|
22
|
+
assert.equal(output.varieties.items.properties.growthHabit.description, "Whether the variety grows as a bush or climbing vine.");
|
|
23
|
+
assert.equal(output.varieties.items.properties.peaType.description, "Whether the variety is grown for shelled peas or edible pods.");
|
|
24
|
+
assert.equal(output.varieties.items.properties.tips.description, "Sample growing tips when requested.");
|
|
25
|
+
assert.equal(output.notice.description, "Reminder that the preview caused no external effect.");
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-html-ui-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Create an Em See Pea server with an accessible HTML form.",
|
|
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.
|
|
21
|
+
"@emseepea/server": "0.3.2",
|
|
22
22
|
"@emseepea/tailwind": "0.0.2",
|
|
23
23
|
"@emseepea/example-ui-shared": "0.0.0",
|
|
24
24
|
"playwright": "1.62.1",
|