@emseepea/create-resources-and-prompts-server 0.0.5 → 0.0.7

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,25 +1,44 @@
1
- import assert from "node:assert/strict";
2
- import { semanticTest } from "@emseepea/testing/semantic";
1
+ import test from "node:test";
2
+ import {
3
+ assertNoToolCalls,
4
+ assertResponseContains,
5
+ assertResponseMeaning,
6
+ createConversation,
7
+ } from "@emseepea/testing/semantic";
3
8
 
4
- semanticTest("Sowing depth and plant spacing remain separate concepts", {
5
- server: new URL("../dist/server.js", import.meta.url),
6
- question:
7
- "If I sow pea seeds deeper, should I also space the plants farther apart? " +
8
- "Explain the distinction for a home gardener.",
9
- criticalFacts: [
10
- "sowing depth",
11
- "plant spacing"
12
- ],
13
- criteria:
14
- "The answer says sowing peas deeper does not mean spacing the plants farther " +
15
- "apart. It explains that sowing depth is how deep a seed goes while plant " +
16
- "spacing is the gap between plants, and it does not treat the measurements as " +
17
- "interchangeable.",
18
- requiredPaths: ["resources/read:guide://peas/getting-started","prompts/get:growing-guide"],
19
- async exercise(client) {
20
- const result1 = await client.readResource({"uri":"guide://peas/getting-started"});
21
- assert.ok(result1);
22
- const result2 = await client.getPrompt({"name":"growing-guide","arguments":{"topic":"sowing-depth"}});
23
- assert.ok(result2);
24
- },
9
+ test("keeps sowing depth and plant spacing separate", async (t) => {
10
+ const chat = await createConversation(t, {
11
+ server: new URL("../dist/server.js", import.meta.url),
12
+ });
13
+
14
+ // Fixed and templated resources plus a prompt are prepared in one turn. That
15
+ // broadens MCP coverage without adding another model conversation or judge.
16
+ await chat.prepare(async ({ readResource, getPrompt }) => {
17
+ await readResource({ uri: "guide://peas/getting-started" });
18
+ await readResource({ uri: "guide://peas/planting/container" });
19
+ await getPrompt({ name: "growing-guide", arguments: { topic: "sowing-depth" } });
20
+ });
21
+
22
+ const response = await chat.send(
23
+ "Which planting method is the selected method guide for? If I sow pea seeds " +
24
+ "deeper, should I also space the plants farther apart? Explain the distinction.",
25
+ );
26
+
27
+ assertNoToolCalls(response);
28
+ // The explanation may be paraphrased, so spend the test's only semantic
29
+ // judgment here instead of coupling the test to particular wording.
30
+ await assertResponseMeaning(response, {
31
+ expected:
32
+ "The selected method guide is for containers. Sowing peas deeper does not " +
33
+ "mean spacing plants farther apart. Sowing depth is how deep a seed goes, " +
34
+ "while plant spacing is the gap between plants.",
35
+ });
36
+
37
+ const followUp = await chat.send(
38
+ "What is the exact URI of the selected planting method guide?",
39
+ );
40
+ // The URI is a stable identifier, so exact matching proves conversational
41
+ // recall without paying for a second semantic judgment.
42
+ assertNoToolCalls(followUp);
43
+ assertResponseContains(followUp, "guide://peas/planting/container");
25
44
  });
@@ -14,7 +14,7 @@
14
14
  "lint": "oxlint src test eval"
15
15
  },
16
16
  "devDependencies": {
17
- "@emseepea/testing": "0.2.2",
17
+ "@emseepea/testing": "0.3.0",
18
18
  "@types/node": "24.13.3",
19
19
  "typescript": "6.0.3",
20
20
  "oxlint": "1.80.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-resources-and-prompts-server",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Create an Em See Pea server with resources and prompts.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "devDependencies": {
21
21
  "@emseepea/server": "0.3.0",
22
22
  "zod": "4.4.3",
23
- "@emseepea/testing": "0.2.2",
23
+ "@emseepea/testing": "0.3.0",
24
24
  "@types/node": "24.13.3",
25
25
  "typescript": "6.0.3",
26
26
  "oxlint": "1.80.0"