@trazum/mcp 1.10.0 → 1.26.0

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
@@ -1,11 +1,12 @@
1
1
  # @trazum/mcp
2
2
 
3
3
  Trazum as an [MCP](https://modelcontextprotocol.io) server, so an agent can price
4
- and budget a prompt **before** it sends it.
4
+ and budget a prompt **before** it sends it — and read a usage log to see where the
5
+ money already went.
5
6
 
6
- Every other Trazum surface answers that question for a human after the fact — a CLI
7
- you run, a page you paste into, a check that fails a build. This answers it for the
8
- thing actually composing the prompt.
7
+ Every other Trazum surface answers those questions for a human after the fact — a
8
+ CLI you run, a page you paste into, a check that fails a build. This answers them
9
+ for the thing actually composing the prompts.
9
10
 
10
11
  ## It runs on your machine and costs nothing to host
11
12
 
@@ -28,6 +29,7 @@ because "MCP server" reads like infrastructure and this is not.
28
29
  | --- | --- |
29
30
  | `check_prompt` | Does this prompt fit `maxTokens`? And if not, would optimising it fit? |
30
31
  | `optimize_prompt` | The shorter text, the token counts either side, what the difference is worth per month, and any advisories. |
32
+ | `profile_usage` | Where the money went, from a usage log passed as text: the spend split, per label and per model, whether caching paid for itself, and the levers that would actually move the bill. `label`, `since`/`until` and `previous_log` drill down and compare; `what_if` prices the same calls on another model — arithmetic, not advice, and it says so. The one tool whose figures are exact — they are the provider's own billed counts. |
31
33
  | `list_models` | Prices, context windows and cacheable minimums, with the date the table was reviewed. |
32
34
 
33
35
  `check_prompt` is the one worth wiring up. It has **three** outcomes rather than
@@ -43,11 +45,12 @@ instructions. A boolean throws away the actionable half.
43
45
 
44
46
  ## What it cannot do, which is the design
45
47
 
46
- **No paths.** Every tool takes prompt text. A tool that accepted a filename would
47
- be a file-read primitive reachable by whatever the model decided to ask for. This
48
- package imports `@trazum/core`, the browser-safe entry point, and never
49
- `@trazum/core/node` — the capability is *absent* rather than unused, and a test
50
- enforces it.
48
+ **No paths.** Every tool takes text the prompt itself, the log itself. A tool
49
+ that accepted a filename would be a file-read primitive reachable by whatever the
50
+ model decided to ask for. This package imports `@trazum/core`, the browser-safe
51
+ entry point, and never `@trazum/core/node` — the capability is *absent* rather
52
+ than unused, and a test enforces it. The agent reads the file in its own sandbox,
53
+ where its own permissions apply, and hands over the content.
51
54
 
52
55
  **No network.** Nothing here calls a model. `--suggest` and `eval` exist in the CLI
53
56
  and are deliberately not exposed: they spend your money, and a tool an agent can
package/dist/tools.d.ts CHANGED
@@ -27,6 +27,13 @@ import type { ToolDefinition } from './rpc.js';
27
27
  * accident. Refusing early with a number beats an unbounded pass over it.
28
28
  */
29
29
  export declare const MAX_PROMPT_CHARS = 400000;
30
+ /**
31
+ * Larger than the prompt cap because a usage log is a different object: a month
32
+ * of calls at one JSON line each. Two million characters is a few MB of log —
33
+ * far beyond what an agent realistically holds in context, so the cap exists to
34
+ * refuse the accident, not to invite the maximum.
35
+ */
36
+ export declare const MAX_LOG_CHARS = 2000000;
30
37
  /** The whole surface. An exact list, asserted as one by the tests. */
31
38
  export declare const TOOLS: readonly ToolDefinition[];
32
39
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,CAAC;AA+MxC,sEAAsE;AACtE,eAAO,MAAM,KAAK,EAAE,SAAS,cAAc,EAA8B,CAAC"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,CAAC;AA+MxC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,UAAY,CAAC;AAytBvC,sEAAsE;AACtE,eAAO,MAAM,KAAK,EAAE,SAAS,cAAc,EAAuC,CAAC"}