@emseepea/create-react-ui-server 0.0.6 → 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.
@@ -1,28 +1,39 @@
1
1
  import test from "node:test";
2
2
  import {
3
+ assertNoToolCalls,
3
4
  assertResponseContains,
4
5
  assertResponseMeaning,
5
6
  assertToolCalls,
6
7
  createConversation,
7
8
  } from "@emseepea/testing/semantic";
8
9
 
9
- test("does not mistake a React UI preview for a completed effect", async (t) => {
10
+ test("understands an all-varieties React UI preview", async (t) => {
10
11
  const chat = await createConversation(t, {
11
12
  server: new URL("../dist/server.js", import.meta.url),
12
13
  });
14
+
15
+ // This variant covers all-variety filtering and omitted tips. One exact
16
+ // follow-up checks memory while keeping the suite to one costly judge.
13
17
  const response = await chat.send(
14
- "Preview a plan titled Snap pea plan for snap peas, including growing tips. " +
18
+ "Preview a plan titled All pea plan for all pea types, without growing tips. " +
15
19
  "Summarize the matches and say whether anything was sent, stored, or changed.",
16
20
  );
17
21
 
18
22
  assertToolCalls(response, [{
19
23
  name: "preview-planting-plan",
20
- arguments: { title: "Snap pea plan", peaType: "snap", includeTips: true },
24
+ arguments: { title: "All pea plan", peaType: "all", includeTips: false },
21
25
  }]);
22
- assertResponseContains(response, "Highland Snap");
26
+ assertResponseContains(response, "Harbour Gem");
23
27
  await assertResponseMeaning(response, {
24
28
  expected:
25
- "The preview contains Highland Snap and Meadow Sweet. It is preview-only, " +
26
- "performed no effect, sent and stored no report, and changed no external data.",
29
+ "The preview contains Harbour Gem, Highland Snap, and Meadow Sweet without " +
30
+ "growing tips. It is preview-only, sent and stored no report, and changed no " +
31
+ "external data.",
27
32
  });
33
+
34
+ const followUp = await chat.send(
35
+ "How many varieties were in that preview? Reply with the numeral only.",
36
+ );
37
+ assertNoToolCalls(followUp);
38
+ assertResponseContains(followUp, "3");
28
39
  });
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "private": true,
31
31
  "dependencies": {
32
- "@emseepea/react": "0.0.6",
33
- "@emseepea/server": "0.3.0",
32
+ "@emseepea/react": "0.0.7",
33
+ "@emseepea/server": "0.3.1",
34
34
  "@emseepea/tailwind": "0.0.2",
35
35
  "react": "19.2.8",
36
36
  "react-dom": "19.2.8"
@@ -2,12 +2,12 @@ import { defineElicitationView, defineTool, type ElicitationView } from "@emseep
2
2
  import { z } from "zod";
3
3
 
4
4
  const peaTypeSchema = z.enum(["all", "shelling", "snap"]);
5
- const previewInputSchema = z.strictObject({
5
+ const inputSchema = z.strictObject({
6
6
  title: z.string().trim().min(1).max(80),
7
7
  peaType: peaTypeSchema,
8
8
  includeTips: z.boolean(),
9
9
  });
10
- const previewOutputSchema = z.strictObject({
10
+ const outputSchema = z.strictObject({
11
11
  status: z.literal("preview-only"),
12
12
  effectPerformed: z.literal(false),
13
13
  title: z.string(),
@@ -27,7 +27,7 @@ const varieties = [
27
27
  { name: "Meadow Sweet", growthHabit: "bush" as const, peaType: "snap" as const, tips: ["suits containers", "keep soil moist"] },
28
28
  ];
29
29
 
30
- export function previewPlantingPlan(input: z.output<typeof previewInputSchema>) {
30
+ export function previewPlantingPlan(input: z.output<typeof inputSchema>) {
31
31
  const matching = varieties.filter((variety) => input.peaType === "all" || variety.peaType === input.peaType);
32
32
  return {
33
33
  status: "preview-only" as const,
@@ -45,8 +45,8 @@ export function createPreviewPlantingPlanTool() {
45
45
  access: "public",
46
46
  title: "Preview a Pea Planting Plan",
47
47
  description: "Preview a sample pea planting plan without sending, storing, or changing anything.",
48
- inputSchema: previewInputSchema,
49
- outputSchema: previewOutputSchema,
48
+ inputSchema,
49
+ outputSchema,
50
50
  handler(input) {
51
51
  const data = previewPlantingPlan(input);
52
52
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-react-ui-server",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Create an Em See Pea server with an accessible React form.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,8 +18,8 @@
18
18
  "prepack": "npm run build:initializer"
19
19
  },
20
20
  "devDependencies": {
21
- "@emseepea/react": "0.0.6",
22
- "@emseepea/server": "0.3.0",
21
+ "@emseepea/react": "0.0.7",
22
+ "@emseepea/server": "0.3.1",
23
23
  "@emseepea/tailwind": "0.0.2",
24
24
  "react": "19.2.8",
25
25
  "react-dom": "19.2.8",