@jaypie/mcp 0.8.47 → 0.8.50

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.
@@ -9,7 +9,7 @@ import { gt } from 'semver';
9
9
  /**
10
10
  * Docs Suite - Documentation services (skill, version, release_notes)
11
11
  */
12
- const BUILD_VERSION_STRING = "@jaypie/mcp@0.8.47#d4678bbc"
12
+ const BUILD_VERSION_STRING = "@jaypie/mcp@0.8.50#a1804d0f"
13
13
  ;
14
14
  const __filename$1 = fileURLToPath(import.meta.url);
15
15
  const __dirname$1 = path.dirname(__filename$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/mcp",
3
- "version": "0.8.47",
3
+ "version": "0.8.50",
4
4
  "description": "Jaypie MCP",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,28 @@
1
+ ---
2
+ version: 0.3.2
3
+ date: 2026-04-24
4
+ summary: Adds fab.corpus() for seeded corpus text generation
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - New `fab.corpus(words?, options?)` method on `Fabricator` for generating deterministic prose fixtures.
10
+ - Default 108 words; pass a number for any other size.
11
+ - Custom corpus support: pass `corpus` (raw text) or `words` (explicit weights). Custom and default English pools blend 50/50 by default; tune with `blend` or skip defaults with `replaceDefaults: true`.
12
+ - Custom token functions via `functions` option — each function receives the fabricator and emits one token per draw, with weight subtracted from the main word stream. Useful for UUIDs, dollar amounts, emails, and other non-word-shaped tokens. Shorthand `[fn, weight]` for one function, `[[fn1, w1], [fn2, w2]]` for many.
13
+ - Full passthrough of typo rate, phonotactic rate, sentence/punctuation density, and a `chars` escape hatch for char-length output.
14
+ - `CorpusOptions`, `CorpusTokenFunction`, and `CorpusFunctionEntry` types exported from `@jaypie/fabricator`.
15
+
16
+ ## Determinism contract
17
+
18
+ - Each call advances the fabricator's faker state, so successive calls with the same params return different output (`fab.corpus(100) !== fab.corpus(100)`).
19
+ - Replaying from a fresh `fabricator(seed)` reproduces the same sequence.
20
+ - Word count and options are folded into the per-call seed, so different params produce independent streams — `corpus(100)` and `corpus(101)` are not off-by-one variants of each other.
21
+
22
+ ## Why
23
+
24
+ Test fixtures and seeded benchmarks frequently want bulk prose with stable, reproducible content. `lorem` is too uniform; ad-hoc generators are non-deterministic. `corpus()` fills that gap with a single ergonomic call that respects the fabricator's seeding contract.
25
+
26
+ ## Implementation note
27
+
28
+ Generator internals (`babble`, `phonotactic`, English word/typo data, `Rng`) live in `src/corpus/` as a private vendored module. They are not exported — only the `corpus()` method and `CorpusOptions` type.
@@ -0,0 +1,12 @@
1
+ ---
2
+ version: 1.2.43
3
+ date: 2026-04-29
4
+ summary: Pull in @jaypie/llm 1.2.31 (native structured outputs across all providers)
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Bumped `@jaypie/llm` peer-dep range to `^1.2.31`, exposing:
10
+ - Anthropic, OpenAI, Gemini 3, and xAI all use native structured outputs by default (no more `structured_output` fake-tool emulation in the happy path).
11
+ - Per-provider runtime fallback that engages the legacy fake-tool path transparently when a model rejects native structured output, with a `log.warn` so silent degradations don't hide.
12
+ - Anthropic specifically: native field is `output_config.format` (the earlier `output_format` was deprecated by the API).
@@ -0,0 +1,29 @@
1
+ ---
2
+ version: 1.2.30
3
+ date: 2026-04-28
4
+ summary: Anthropic provider uses native structured outputs in place of the structured_output fake-tool emulation
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `AnthropicAdapter` (`operate()`/`stream()`):
10
+ - When `format` is set, the request body now includes `output_config: { format: { type: "json_schema", schema } }` instead of injecting a synthetic `structured_output` tool with `tool_choice: "any"`.
11
+ - JSON schemas are sanitized for Anthropic's grammar compiler: objects always get `additionalProperties: false`, unsupported numeric/string/array constraints (`minimum`, `maxLength`, `multipleOf`, …) are appended to `description` rather than sent to the API, unsupported string formats are stripped, and `minItems` is preserved only when 0 or 1.
12
+ - Responses to structured-output requests are parsed from the first `text` content block (guaranteed valid JSON by the Anthropic grammar). `stop_reason: "refusal"` and `stop_reason: "max_tokens"` are recognized and surface as text rather than triggering a parse error.
13
+ - Streaming structured outputs now arrive as `LlmStreamChunkType.Text` deltas (consumers concat to assemble JSON), instead of a single `ToolCall` chunk.
14
+ - `AnthropicProvider.send(message, { response })`: the system prompt is no longer stuffed with the JSON schema, and the regex JSON extraction is gone. The native `output_config.format` field handles the contract.
15
+ - A runtime fallback re-engages the legacy fake-tool emulation transparently when a model rejects `output_config` (cached per model in `runtimeNoStructuredOutputModels`). Citations-related 400s and `output_format`-deprecation 400s are explicitly excluded so they propagate instead of being masked by a retry.
16
+
17
+ ## Why
18
+
19
+ Anthropic launched native structured outputs publicly on 2025-11-14 (now GA on Claude 4.5+). The previous tool-emulation hack predates the feature. Native:
20
+ - Removes a fragile regex extraction in `provider.send`.
21
+ - Removes the synthetic `structured_output` tool from the operate loop.
22
+ - Returns guaranteed-valid JSON via grammar-constrained generation rather than relying on the model to comply with a system-prompt instruction.
23
+ - Keeps a fallback path for any model that does not (yet) support `output_config`.
24
+
25
+ ## Notes
26
+
27
+ - Streaming consumers that previously branched on a `tool_call` chunk to receive structured output will now see `text` chunks. Concatenate to assemble the final JSON, or use `operate()` for the parsed object.
28
+ - Schema constraints not supported by Anthropic's grammar (regex `pattern`, `minLength`, numeric ranges, recursion) are stripped at request time. The original constraints are still enforced client-side by the caller's Zod schema during result validation.
29
+ - Gemini and OpenRouter still use the fake-tool emulation pattern; native migration for those adapters is a separate task.
@@ -0,0 +1,33 @@
1
+ ---
2
+ version: 1.2.31
3
+ date: 2026-04-29
4
+ summary: OpenRouter and Gemini adapters drop the structured_output fake-tool hack in favor of native response_format / responseJsonSchema (with runtime fallback for unsupported models)
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - `OpenRouterAdapter` (`operate()`/`stream()`):
10
+ - When `format` is set, the request body now includes `response_format: { type: "json_schema", json_schema: { name, schema, strict: true } }` instead of injecting a synthetic `structured_output` tool.
11
+ - `formatTools` no longer injects the synthetic tool. The legacy fake tool is added in `buildRequest` only as a runtime fallback for models cached as not supporting native `response_format`.
12
+ - `formatOutputSchema` now forces `additionalProperties: false` on every object (required for `strict: true`).
13
+ - `executeRequest` annotates the response with a `__jaypieStructuredOutput` flag so `hasStructuredOutput` / `extractStructuredOutput` can detect intent statelessly. The native path parses `choices[0].message.content` as JSON; the fallback path keeps the existing tool-call extraction.
14
+ - 400/422 errors mentioning `response_format`/`json_schema`/`structured_output`/`require_parameters` cache the model in `runtimeNoStructuredOutputModels` and trigger a one-shot retry via the legacy fake-tool path. Unrelated 4xx propagate.
15
+ - `log.warn` at both fallback entry points (initial cached-model build and 4xx retry).
16
+ - `GeminiAdapter` (`operate()`/`stream()`):
17
+ - Format **and** tools combined now uses native `responseJsonSchema` + tools when the model id matches `^gemini-3` (Gemini 3 preview). Gemini 2.5 (including thinking) and earlier keep the `structured_output` fake-tool emulation with the system-prompt nudge.
18
+ - `formatTools` no longer injects the synthetic structured_output tool; the fake tool is added in `buildRequest` only when the runtime falls back.
19
+ - 400 errors mentioning `responseJsonSchema`/`responseSchema`/`responseMime`/`function_call`/`tools` cache the model in `runtimeNoStructuredOutputComboModels` and trigger a one-shot retry via the legacy fake-tool path.
20
+ - `log.warn` at both fallback entry points.
21
+
22
+ ## Why
23
+
24
+ OpenRouter exposes the OpenAI-style structured-outputs shape end-to-end, and Gemini 3 launched as a preview supporting tools + `responseJsonSchema` together. The `structured_output` fake-tool emulation predates both. Native:
25
+ - Returns guaranteed-valid JSON via grammar-constrained generation rather than relying on the model to comply with a system-prompt instruction.
26
+ - Removes the synthetic tool from the operate-loop tool list (cleaner traces, no risk of the model ignoring the nudge).
27
+ - Keeps a fallback path that re-engages the fake-tool emulation transparently when a model rejects the native field.
28
+
29
+ ## Notes
30
+
31
+ - Anthropic was migrated in 1.2.30; with this release, all four LLM providers (Anthropic, OpenAI, OpenRouter, Gemini) use native structured outputs by default. xAI inherits from `OpenAiAdapter` and was already native.
32
+ - Gemini 2.5 thinking models stay on the fake-tool path because the combo is unreliable on 2.5; this matches Google's documentation that the combo is a Gemini 3 preview feature.
33
+ - Streaming consumers that previously branched on a `tool_call` chunk to receive structured output from OpenRouter/Gemini will now see `text` chunks. Concatenate to assemble the final JSON, or use `operate()` for the parsed object.
@@ -0,0 +1,10 @@
1
+ ---
2
+ version: 0.8.48
3
+ date: 2026-04-24
4
+ summary: Update fabricator skill with corpus() coverage
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added a Corpus section to `skill("fabricator")` covering `fab.corpus()`: signatures, determinism contract (advance per call, replay across runs, params-folded-into-seed), custom corpus blending (`corpus`, `words`, `blend`, `replaceDefaults`), and custom token functions (`functions` shorthand and array forms).
10
+ - Documented the full `CorpusOptions` shape and `CorpusTokenFunction` type.
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 0.8.49
3
+ date: 2026-04-28
4
+ summary: Add release notes for @jaypie/llm 1.2.30 (Anthropic native structured outputs)
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added `release-notes/llm/1.2.30.md` covering the Anthropic provider's switch from the `structured_output` fake-tool emulation to Anthropic's native `output_format` structured outputs (with a runtime fallback to the legacy path for unsupported models).
@@ -0,0 +1,9 @@
1
+ ---
2
+ version: 0.8.50
3
+ date: 2026-04-29
4
+ summary: Add release notes for @jaypie/llm 1.2.31 (OpenRouter and Gemini native structured outputs)
5
+ ---
6
+
7
+ ## Changes
8
+
9
+ - Added `release-notes/llm/1.2.31.md` covering the OpenRouter and Gemini adapters' migration from the `structured_output` fake-tool emulation to native `response_format: json_schema` (OpenRouter) and `responseJsonSchema` + tools (Gemini 3), with a runtime fallback for unsupported models.
@@ -85,6 +85,82 @@ fab.generate.person();
85
85
  - **RARE (2.1%)**: firstName is a surname, lastName is hyphenated
86
86
  - **EPIC (0.307%)**: double middle names
87
87
 
88
+ ### Corpus
89
+
90
+ Generate deterministic prose for fixtures, snapshots, or seeded benchmarks.
91
+
92
+ ```typescript
93
+ const fab = fabricator("seed");
94
+
95
+ fab.corpus(); // 108 words of English-ish prose (default)
96
+ fab.corpus(1000); // 1000 words
97
+ fab.corpus({ wordsPerPeriod: 10 });
98
+ fab.corpus(500, { typoRate: 0.20 });
99
+ ```
100
+
101
+ #### Determinism contract
102
+
103
+ - Each call **advances** the fabricator's faker state, so successive calls with the same params return different output (`fab.corpus(100) !== fab.corpus(100)`).
104
+ - Replaying from a fresh `fabricator(seed)` reproduces the same sequence.
105
+ - Word count and options are folded into the per-call seed, so different params produce **independent** streams. `corpus(100)` and `corpus(101)` differ across the whole text — not by one word.
106
+
107
+ #### Custom corpus
108
+
109
+ Mix domain vocabulary into the output. By default the custom pool blends 50/50 with default English; typo (~6%) and phonotactic invention (~3%) rates stay at their defaults.
110
+
111
+ ```typescript
112
+ fab.corpus(500, { corpus: deployLogText }); // raw text → derived weights
113
+ fab.corpus(500, { words: [["deploy", 5], ["lambda", 2]] });
114
+
115
+ fab.corpus(500, { corpus: deployLogText, blend: 0.7 }); // tune the mix
116
+ fab.corpus(500, { corpus: deployLogText, replaceDefaults: true }); // pure custom
117
+ ```
118
+
119
+ #### Custom token functions
120
+
121
+ For non-word-shaped tokens (UUIDs, dollar amounts, IDs), pass `functions`. Each function receives the fabricator and emits one token per draw. Weight is the share of total content tokens taken from the main word stream.
122
+
123
+ ```typescript
124
+ // Shorthand for a single function
125
+ fab.corpus(500, {
126
+ functions: [({ fab }) => fab.string.uuid(), 0.03],
127
+ });
128
+
129
+ // Multiple functions
130
+ fab.corpus(500, {
131
+ functions: [
132
+ [({ fab }) => fab.string.uuid(), 0.03],
133
+ [({ fab }) => "$" + fab.finance.amount(), 0.04],
134
+ [({ fab }) => fab.internet.email(), 0.02],
135
+ ],
136
+ });
137
+ ```
138
+
139
+ #### Full options
140
+
141
+ ```typescript
142
+ interface CorpusOptions {
143
+ corpus?: string; // raw text → derive weights
144
+ words?: ReadonlyArray<readonly [string, number]>; // explicit weights
145
+ blend?: number; // share given to custom pool, default 0.5
146
+ replaceDefaults?: boolean; // skip default English entirely
147
+ typos?: ReadonlyArray<readonly [string, number]>; // override typo pool
148
+ phonotactic?: PhonotacticOptions; // tune invented words
149
+ typoRate?: number; // default 0.06
150
+ phonotacticRate?: number; // default 0.03
151
+ wordsPerPeriod?: number; // default 17
152
+ wordsPerComma?: number; // default 22
153
+ periodsPerBreak?: number; // default 5
154
+ sentences?: boolean; // default true
155
+ chars?: number; // generate by char length instead of word count
156
+ functions?: // custom token functions
157
+ | readonly [CorpusTokenFunction, number]
158
+ | ReadonlyArray<readonly [CorpusTokenFunction, number]>;
159
+ }
160
+
161
+ type CorpusTokenFunction = (params: { fab: Fabricator }) => string;
162
+ ```
163
+
88
164
  ## CHANCE Constants
89
165
 
90
166
  ```typescript