jev-decision-mcp 0.1.1 → 0.1.2

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.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Batch independent questions over the same context in one call. Answers retain th
19
19
  Requires Node.js 22 or newer. The published package runs without cloning or building:
20
20
 
21
21
  ```sh
22
- npx -y jev-decision-mcp@0.1.1
22
+ npx -y jev-decision-mcp@0.1.2
23
23
  ```
24
24
 
25
25
  Set `TYPESAFE_API_KEY` in your MCP host's environment. For hosts that use
@@ -30,7 +30,7 @@ Set `TYPESAFE_API_KEY` in your MCP host's environment. For hosts that use
30
30
  "mcpServers": {
31
31
  "jev": {
32
32
  "command": "npx",
33
- "args": ["-y", "jev-decision-mcp@0.1.1"]
33
+ "args": ["-y", "jev-decision-mcp@0.1.2"]
34
34
  }
35
35
  }
36
36
  }
@@ -54,7 +54,7 @@ For the npm package, merge this into your Codex `config.toml`:
54
54
  ```toml
55
55
  [mcp_servers.jev]
56
56
  command = "npx"
57
- args = ["-y", "jev-decision-mcp@0.1.1"]
57
+ args = ["-y", "jev-decision-mcp@0.1.2"]
58
58
  env_vars = ["TYPESAFE_API_KEY"]
59
59
  tool_timeout_sec = 45
60
60
  ```
@@ -121,7 +121,7 @@ Call `jev_decide` with the JSON in [examples/decision.json](examples/decision.js
121
121
  }
122
122
  ```
123
123
 
124
- The response contains `model`, `answers`, and `usage`, both as MCP structured content and JSON text. Choice supports 1–255 named options. Instructions and descriptions may be strings, JSON objects, or arrays; choice descriptions may also be null. Noul accepts optional `criteria.true` and `criteria.false` descriptions.
124
+ The response contains `model`, `answers`, and `usage`, both as MCP structured content and JSON text. Jev may round probabilities to two decimal places, so their sum can differ slightly from 1. The server allows the corresponding rounding margin (up to 0.005 per option) and preserves the returned values without normalization. Choice supports 1–255 named options. Instructions and descriptions may be strings, JSON objects, or arrays; choice descriptions may also be null. Noul accepts optional `criteria.true` and `criteria.false` descriptions.
125
125
 
126
126
  Supply relevant facts, source text, and policies explicitly: Jev cannot see the caller's conversation or local files. Write complete judgments in `instructions`; IDs are only response keys. Include a no-match option when appropriate. Questions in one batch cannot see one another's answers. A noul near 0.5 is uncertainty about yes/no, not medium intensity. Confidence does not authorize actions or guarantee correctness; evaluate thresholds on representative data.
127
127
 
@@ -179,7 +179,7 @@ contains the compiled server, license, README, example input, and registry metad
179
179
  Local `.env` files, tests, and development dependencies are not bundled.
180
180
 
181
181
  Clients can launch the published npm package with
182
- `npx -y jev-decision-mcp@0.1.1`. For that installation method, provide
182
+ `npx -y jev-decision-mcp@0.1.2`. For that installation method, provide
183
183
  `TYPESAFE_API_KEY` in the MCP host's environment; the package does not read a `.env`
184
184
  from the caller's working directory. The clone-and-build setup above remains
185
185
  available independently of npm publication.
package/dist/schema.js CHANGED
@@ -56,9 +56,16 @@ export function validateResponse(raw, input) {
56
56
  : question.type === "score" ? question.criteria.map((_, index) => String(index)) : [];
57
57
  if (!sameKeys(answer.probabilities, levels))
58
58
  throw new Error("Probability labels do not match criteria");
59
- const sum = Object.values(answer.probabilities).reduce((a, b) => a + b, 0);
60
- if (Math.abs(sum - 1) > 0.001)
61
- throw new Error("Probabilities do not sum to one");
59
+ const values = Object.values(answer.probabilities);
60
+ const sum = values.reduce((a, b) => a + b, 0);
61
+ // Jev can return probabilities rounded to two decimals (observed totals
62
+ // include 0.99). Each rounded entry can contribute at most 0.005 error.
63
+ // Keep the tighter check for higher-precision responses, and never
64
+ // normalize the upstream values or accept a distribution with no mass.
65
+ const roundedToCents = values.every((p) => Math.abs(p * 100 - Math.round(p * 100)) < 1e-9);
66
+ const tolerance = roundedToCents ? values.length * 0.005 : 0.001;
67
+ if (sum <= 0 || Math.abs(sum - 1) > tolerance + 1e-12)
68
+ throw new Error("Probabilities do not sum to one within rounding tolerance");
62
69
  if (answer.type === "choice" && !levels.includes(answer.choice))
63
70
  throw new Error("Unknown choice");
64
71
  if (answer.type === "score" && (answer.score < 0 || answer.score > levels.length - 1 || !sameKeys(answer.legend, levels))) {
package/dist/server.js CHANGED
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { DecisionError } from "./decision.js";
3
3
  import { decisionInput, decisionOutput } from "./schema.js";
4
4
  export function createServer(decide) {
5
- const server = new McpServer({ name: "jev-decision-mcp", version: "0.1.1" });
5
+ const server = new McpServer({ name: "jev-decision-mcp", version: "0.1.2" });
6
6
  server.registerTool("jev_decide", {
7
7
  title: "Ask Jev for typed decisions",
8
8
  description: "Evaluate supplied context using TypeSafe Jev. Batch independent, narrow questions in one call: choice selects a provided label; score returns a position on 2–10 ordered levels (0-based); noul returns probability of yes, not intensity. Supply relevant evidence and full instructions; question IDs are not sent to the model. Include an other/none choice when appropriate. Questions cannot use each other's answers. Returns raw judgments, probabilities, confidence for choice/score, and token usage. Use caller-defined policies for uncertainty. This sends the supplied state and questions to TypeSafe and may incur API charges. It does not execute selected actions.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jev-decision-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A local MCP server for TypeSafe Jev typed decisions",
5
5
  "type": "module",
6
6
  "engines": {
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/amidabuddha/jev-decision-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.1",
9
+ "version": "0.1.2",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "jev-decision-mcp",
14
- "version": "0.1.1",
14
+ "version": "0.1.2",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },