@emseepea/create-html-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,21 +1,38 @@
1
- import { toolSelectionTest } from "@emseepea/testing/semantic";
1
+ import test from "node:test";
2
+ import {
3
+ assertNoToolCalls,
4
+ assertResponseContains,
5
+ assertResponseMeaning,
6
+ assertToolCalls,
7
+ createConversation,
8
+ } from "@emseepea/testing/semantic";
2
9
 
3
- toolSelectionTest("Native UI preview is not mistaken for a completed effect", {
4
- server: new URL("../dist/server.js", import.meta.url),
5
- question:
6
- "Summarize the snap-pea planting-plan preview. Was a report sent or stored, and did this " +
7
- "operation change anything?",
8
- criticalFacts: [
9
- "Highland Snap",
10
- "Meadow Sweet",
11
- "preview-only",
12
- "false",
13
- /\b(?:no|not|nothing|neither|never|wasn't|weren't|didn't)\b[^.!?\n]{0,80}\b(?:sent|delivered)\b/i,
14
- /\b(?:no|not|nothing|neither|never|wasn't|weren't|didn't)\b[^.!?\n]{0,80}\b(?:stored|saved|persisted)\b/i
15
- ],
16
- criteria:
17
- "The answer identifies Highland Snap and Meadow Sweet as the two snap-pea " +
18
- "matches. It says the result is preview-only, effectPerformed is false, no report " +
19
- "was sent or stored, and no external action or data change occurred.",
20
- expectedTools: ["preview-planting-plan"],
10
+ test("does not mistake a native UI preview for a completed effect", async (t) => {
11
+ const chat = await createConversation(t, {
12
+ server: new URL("../dist/server.js", import.meta.url),
13
+ });
14
+
15
+ // The judged turn covers the UI tool's main semantic risk: preview is not an
16
+ // effect. A literal follow-up adds conversation coverage without another judge.
17
+ const response = await chat.send(
18
+ "Preview a plan titled Snap pea plan for snap peas, including growing tips. " +
19
+ "Summarize the matches and say whether anything was sent, stored, or changed.",
20
+ );
21
+
22
+ assertToolCalls(response, [{
23
+ name: "preview-planting-plan",
24
+ arguments: { title: "Snap pea plan", peaType: "snap", includeTips: true },
25
+ }]);
26
+ assertResponseContains(response, "Highland Snap");
27
+ await assertResponseMeaning(response, {
28
+ expected:
29
+ "The preview contains Highland Snap and Meadow Sweet. It is preview-only, " +
30
+ "performed no effect, sent and stored no report, and changed no external data.",
31
+ });
32
+
33
+ const followUp = await chat.send(
34
+ "How many snap varieties were in that preview? Reply with the numeral only.",
35
+ );
36
+ assertNoToolCalls(followUp);
37
+ assertResponseContains(followUp, "2");
21
38
  });
@@ -16,7 +16,7 @@
16
16
  "devDependencies": {
17
17
  "playwright": "1.62.1",
18
18
  "axe-core": "4.13.0",
19
- "@emseepea/testing": "0.2.2",
19
+ "@emseepea/testing": "0.3.0",
20
20
  "@types/node": "24.13.3",
21
21
  "typescript": "6.0.3",
22
22
  "oxlint": "1.80.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-html-ui-server",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Create an Em See Pea server with an accessible HTML form.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "@emseepea/example-ui-shared": "0.0.0",
24
24
  "playwright": "1.62.1",
25
25
  "axe-core": "4.13.0",
26
- "@emseepea/testing": "0.2.2",
26
+ "@emseepea/testing": "0.3.0",
27
27
  "@types/node": "24.13.3",
28
28
  "typescript": "6.0.3",
29
29
  "oxlint": "1.80.0"