@jaypie/mcp 0.8.161 → 0.8.162
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/dist/assets.js +3 -3
- package/package.json +1 -1
- package/release-notes/jaypie/1.2.102.md +12 -0
- package/release-notes/llm/1.3.43.md +94 -0
- package/release-notes/mcp/0.8.162.md +15 -0
- package/release-notes/testkit/1.2.75.md +12 -0
- package/skills/llm.md +85 -0
package/dist/assets.js
CHANGED
|
@@ -55,11 +55,11 @@ function getMcpAssetPaths() {
|
|
|
55
55
|
*/
|
|
56
56
|
function getMcpBuildInfo() {
|
|
57
57
|
return {
|
|
58
|
-
commit: "
|
|
58
|
+
commit: "09240f3e"
|
|
59
59
|
,
|
|
60
|
-
version: "0.8.
|
|
60
|
+
version: "0.8.162"
|
|
61
61
|
,
|
|
62
|
-
versionString: "@jaypie/mcp@0.8.
|
|
62
|
+
versionString: "@jaypie/mcp@0.8.162#09240f3e"
|
|
63
63
|
,
|
|
64
64
|
};
|
|
65
65
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.2.102
|
|
3
|
+
date: 2026-09-18
|
|
4
|
+
summary: Pulls @jaypie/llm 1.3.43
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
- **`@jaypie/llm` 1.3.43**: `Llm.question` answers typed questions in
|
|
10
|
+
TypeSafe's Jev shape, served natively by the new `typesafe` provider or
|
|
11
|
+
emulated on any provider that returns structured JSON. A per-call `model` no
|
|
12
|
+
longer follows `operate()` onto a fallback provider.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.3.43
|
|
3
|
+
date: 2026-09-18
|
|
4
|
+
summary: "Llm.question answers typed questions in TypeSafe's Jev shape, natively or emulated on any provider"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
### New Features
|
|
10
|
+
|
|
11
|
+
- `Llm.question(state, { questions })` is a fourth entry point, in TypeSafe's
|
|
12
|
+
(Jev's) shape: `noul`, `choice`, and `score` questions asked of a state,
|
|
13
|
+
answered one apiece with probabilities. Static and instance forms mirror
|
|
14
|
+
`operate`, including `model` array sugar, `fallback`, `retry`, `signal`, and
|
|
15
|
+
`user`.
|
|
16
|
+
- New provider `typesafe` serves TypeSafe's System One models over
|
|
17
|
+
`POST /v1/systemone`, with match words `jev` and `typesafe` and
|
|
18
|
+
`TYPESAFE_API_KEY`. It implements `question` only: a System One model
|
|
19
|
+
generates no text, so `send` throws `NotImplementedError` and the provider
|
|
20
|
+
offers no `operate` or `stream`. The client is `fetch` against the two
|
|
21
|
+
documented routes; no SDK dependency is taken.
|
|
22
|
+
- `MODEL.JEV` is `jev-1.13.0`, the versioned id the API echoes on every
|
|
23
|
+
response. The `jev-latest` and `jev-preview` aliases still route to the
|
|
24
|
+
provider through the match words. `COST["jev-1.13.0"]` is $0.042 input and
|
|
25
|
+
$0 output, which TypeSafe bills for answers.
|
|
26
|
+
- Every other provider answers the same call through an emulator: one
|
|
27
|
+
structured `operate()` call at `temperature: 0` and `turns: 1`, asking for
|
|
28
|
+
the full distribution, from which choice (argmax), score
|
|
29
|
+
(probability-weighted level index), and confidence are derived. A chain can
|
|
30
|
+
mix the two, so a rate-limited or unreachable Jev falls through to a
|
|
31
|
+
traditional model without the caller's request or response shape changing.
|
|
32
|
+
- The response carries `emulated`. When it is `true`, `probabilities` are
|
|
33
|
+
model-reported (normalized in code) and `confidence` is Jaypie's normalized
|
|
34
|
+
peak probability, `(max(p) - 1/n) / (1 - 1/n)`, exported as
|
|
35
|
+
`peakConfidence` alongside `normalizeDistribution`. TypeSafe has not
|
|
36
|
+
published its own formula; normalized peak reproduces both documented
|
|
37
|
+
examples and a live Jev call within rounding, and is replaced by TypeSafe's
|
|
38
|
+
when it publishes.
|
|
39
|
+
- TypeSafe's question limits (1 to 255 choice options, 2 to 10 ordered score
|
|
40
|
+
levels, non-empty instructions, `noul` criteria restricted to `true` and
|
|
41
|
+
`false`) are validated at the entry point for **every** provider, so a
|
|
42
|
+
question that validates is answerable anywhere in a chain. A violation
|
|
43
|
+
throws `BadRequestError` naming the question id.
|
|
44
|
+
|
|
45
|
+
### Mistral: dated ids, OCR 4.1, and the CI shard restored
|
|
46
|
+
|
|
47
|
+
- `MODEL.MISTRAL.LARGE` and `MODEL.MISTRAL.SMALL` name the dated ids
|
|
48
|
+
`mistral-large-2512` and `mistral-small-2603` in place of the `-latest`
|
|
49
|
+
aliases they resolved to. Prices are unchanged ($0.5/$1.5 and $0.15/$0.6,
|
|
50
|
+
cached input at 10%), and `COST[MODEL.MISTRAL.LARGE]` now hits rather than
|
|
51
|
+
missing by design: the catalog no longer names an alias.
|
|
52
|
+
- `MODEL.MISTRAL.OCR` moves to `mistral-ocr-4-1`. It stays unpriced in `COST`
|
|
53
|
+
because it bills per page ($4 per 1000 pages, $0.4 cached), which
|
|
54
|
+
`LlmModelCost` cannot express. Verified live against `POST /v1/ocr`.
|
|
55
|
+
- Mistral is a CI capability-matrix shard again, and `mistral-large-2512`
|
|
56
|
+
rejoins the live matrix. Both were dropped while the account's tier answered
|
|
57
|
+
every capability with "This model is not available in your subscription
|
|
58
|
+
tier"; on the upgraded tier both cataloged models pass all seven cells
|
|
59
|
+
(verified 2026-09-19).
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- The Anthropic hot spec streamed with `max_tokens: 64`. The 5-family models
|
|
64
|
+
open a response with a thinking block, so the budget was spent before any
|
|
65
|
+
text delta arrived and `streams text deltas` failed for Fable 5.1, Opus 5,
|
|
66
|
+
and Sonnet 5. The budget now accommodates the thinking block and the test
|
|
67
|
+
stops reading at the first text delta.
|
|
68
|
+
- A per-call `model` no longer follows `operate()` onto a fallback provider.
|
|
69
|
+
`operate(input, { model: ["gpt-5.6-luna", "claude-haiku-4-5"] })` sent the
|
|
70
|
+
primary model id to the fallback, asking Anthropic for an OpenAI model. Each
|
|
71
|
+
fallback now runs the model its own chain entry names.
|
|
72
|
+
|
|
73
|
+
### Internal
|
|
74
|
+
|
|
75
|
+
- The primary-then-chain loop moves to `src/util/runWithFallback.ts` and
|
|
76
|
+
serves both `operate` and `question`. Exchange settlement stays in
|
|
77
|
+
`operate`; `question` emits no exchange in this release.
|
|
78
|
+
- `MODEL.JEV` is excluded from the live capability matrix: a System One model
|
|
79
|
+
implements neither `operate()` nor `send()`, so every cell would fail by
|
|
80
|
+
construction.
|
|
81
|
+
|
|
82
|
+
## Testing
|
|
83
|
+
|
|
84
|
+
- Live, 2026-09-18 (`npm run test:llm:question`): all three question types
|
|
85
|
+
against `jev-1.13.0` natively and against `claude-haiku-4-5` and
|
|
86
|
+
`gpt-5.6-luna` by emulation, plus a chain falling from an unknown Jev model
|
|
87
|
+
to emulation. 4 of 4 passed, with the three models agreeing on every answer
|
|
88
|
+
(choice `billing`; noul 0.97, 0.92, 0.98; score 1.86, 1.60, 1.83 on a 0 to 2
|
|
89
|
+
scale).
|
|
90
|
+
- New unit coverage for validation, the emulator (prompt, schema,
|
|
91
|
+
normalization, argmax, weighted score, confidence against TypeSafe's
|
|
92
|
+
documented examples), `Llm.question` fallback behavior, the TypeSafe client's
|
|
93
|
+
status-to-error mapping, and provider routing. A hot spec exercises both
|
|
94
|
+
live routes when `TYPESAFE_API_KEY` is set.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 0.8.162
|
|
3
|
+
date: 2026-09-18
|
|
4
|
+
summary: Document Llm.question and the TypeSafe provider in the llm skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
### Documentation
|
|
10
|
+
|
|
11
|
+
- `skills/llm.md` gains a "Questions (Jev Shape)" section: the three question
|
|
12
|
+
types and their answers, the response fields, what `emulated` means for
|
|
13
|
+
`confidence`, and how chains mix native and emulated providers.
|
|
14
|
+
- The providers table carries a `typesafe` row, and the environment block
|
|
15
|
+
carries `TYPESAFE_API_KEY`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.2.75
|
|
3
|
+
date: 2026-09-18
|
|
4
|
+
summary: Mock Llm.question and the TypeSafe provider
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
|
|
9
|
+
- `Llm.question` (static, instance, and on the inner provider) resolves a
|
|
10
|
+
mock question response with one `choice` answer and `emulated: false`.
|
|
11
|
+
- New mocks: `TypeSafeProvider`, `TypeSafeClient`, `LlmQuestionType`,
|
|
12
|
+
`normalizeDistribution`, and `peakConfidence`.
|
package/skills/llm.md
CHANGED
|
@@ -41,6 +41,7 @@ the alias rather than the id it currently resolves to. Read the id off
|
|
|
41
41
|
| xAI | "xai", "grok" | `MODEL.GROK` |
|
|
42
42
|
| Meta | "muse" (plus the exact name `meta` and a `meta:` prefix) | `MODEL.MUSE_SPARK` |
|
|
43
43
|
| Bedrock | "amazon.nova", "anthropic.claude", "meta.llama", "deepseek.", "google.gemma", "moonshotai.", "openai.gpt-oss", … | `MODEL.NOVA_PRO` |
|
|
44
|
+
| TypeSafe | "jev", "typesafe" | `MODEL.JEV` |
|
|
44
45
|
|
|
45
46
|
The provider name for Gemini models is `"google"` — `"gemini"` is accepted as a deprecated alias.
|
|
46
47
|
|
|
@@ -48,6 +49,8 @@ Mistral's family names mostly do not contain the substring "mistral" (`ministral
|
|
|
48
49
|
|
|
49
50
|
"meta" is deliberately not a Meta match word: `meta.llama-*` is a Bedrock id and `meta-llama/*` an OpenRouter route. Muse Spark ids resolve on "muse"; use the `meta:` prefix to force the Meta Model API for any other id.
|
|
50
51
|
|
|
52
|
+
TypeSafe serves System One models (Jev), which answer typed questions and generate no text. The provider implements `question()` only: `operate()`, `send()`, and `stream()` throw. See [Questions](#questions-jev-shape).
|
|
53
|
+
|
|
51
54
|
### Model Constants
|
|
52
55
|
|
|
53
56
|
- **`PROVIDER.<name>.DEFAULT`** — the single default model per provider (above), used when no `model` is given.
|
|
@@ -401,6 +404,87 @@ jsonSchemaToNaturalSchema({
|
|
|
401
404
|
|
|
402
405
|
`naturalSchemaToJsonSchema` is lossless — Natural Schema is a strict subset of JSON Schema. `jsonSchemaToNaturalSchema` is lossy: JSON Schema constraints, descriptions, defaults, unions, and optionality have no Natural Schema equivalent and are dropped. It never throws; every dropped keyword is logged at `log.debug` with the keyword name and JSON path.
|
|
403
406
|
|
|
407
|
+
## Questions (Jev Shape)
|
|
408
|
+
|
|
409
|
+
`Llm.question(state, { questions })` asks typed questions about a body of
|
|
410
|
+
text and returns one typed answer each, with probabilities. The request and
|
|
411
|
+
response shapes are TypeSafe's, so a question written once is answered the
|
|
412
|
+
same way by every provider: TypeSafe's System One models (Jev) answer
|
|
413
|
+
natively, and every other provider answers through an emulator that rigs up
|
|
414
|
+
one structured `operate()` call. Traditional models fit the question shape;
|
|
415
|
+
the question shape does not bend to fit them.
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
import { Llm, LLM } from "@jaypie/llm";
|
|
419
|
+
|
|
420
|
+
const { answers, emulated } = await Llm.question(ticket, {
|
|
421
|
+
model: [LLM.MODEL.JEV, LLM.MODEL.HAIKU], // native first, emulated if Jev is down
|
|
422
|
+
questions: {
|
|
423
|
+
department: {
|
|
424
|
+
type: "choice",
|
|
425
|
+
instructions: "Which team should handle this?",
|
|
426
|
+
criteria: {
|
|
427
|
+
billing: "Charges, invoices, refunds",
|
|
428
|
+
sales: null, // the option name speaks for itself
|
|
429
|
+
technical: "Bugs, outages",
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
is_urgent: { type: "noul", instructions: "Does this convey urgency?" },
|
|
433
|
+
frustration: {
|
|
434
|
+
type: "score",
|
|
435
|
+
instructions: "How frustrated is the customer?",
|
|
436
|
+
criteria: ["Calm", "Frustrated", "Very angry"], // 2 to 10, lowest first
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
answers.department; // { type: "choice", choice: "billing", confidence: 0.98, probabilities: {...} }
|
|
442
|
+
answers.is_urgent; // { type: "noul", noul: 0.94 }
|
|
443
|
+
answers.frustration; // { type: "score", score: 1.7, confidence: 0.56, legend: {...}, probabilities: {...} }
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Question Types
|
|
447
|
+
|
|
448
|
+
| Type | Criteria | Answer |
|
|
449
|
+
|------|----------|--------|
|
|
450
|
+
| `noul` | optional `{ true, false }` descriptions | `{ type, noul }` — probability 0 to 1, no confidence: the number is the degree of belief |
|
|
451
|
+
| `choice` | `Record<option, description \| null>`, 1 to 255 options | `{ type, choice, confidence, probabilities }` — `choice` is the argmax, `probabilities` keyed by option name |
|
|
452
|
+
| `score` | ordered `string[]`, 2 to 10 levels lowest first | `{ type, score, confidence, legend, probabilities }` — `score` is the probability-weighted level index, `legend` and `probabilities` keyed by level index as a string |
|
|
453
|
+
|
|
454
|
+
`instructions` and every criteria value accept a string, an object, or an
|
|
455
|
+
array. `state` accepts the same three and is text only: no files, no images,
|
|
456
|
+
no conversation. Question ids are the caller's and never reach the model.
|
|
457
|
+
TypeSafe's limits are enforced on every provider at the entry point, so a
|
|
458
|
+
question that validates works anywhere in a chain; a violation throws
|
|
459
|
+
`BadRequestError` naming the question id.
|
|
460
|
+
|
|
461
|
+
### Response
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
{
|
|
465
|
+
answers, // Record<question id, answer>
|
|
466
|
+
emulated, // false when a System One model answered natively
|
|
467
|
+
fallbackAttempts, // providers tried (1 = primary only)
|
|
468
|
+
fallbackUsed,
|
|
469
|
+
model, // the versioned id that served the request
|
|
470
|
+
provider,
|
|
471
|
+
responses, // raw provider payloads
|
|
472
|
+
usage, // LlmUsage, same shape operate() reports
|
|
473
|
+
}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
`emulated: true` marks an answer a traditional model produced. Its
|
|
477
|
+
`probabilities` are model-reported (normalized in code) and its `confidence`
|
|
478
|
+
is a Jaypie statistic over them — normalized peak probability,
|
|
479
|
+
`(max(p) - 1/n) / (1 - 1/n)`, exported as `peakConfidence` — not a calibrated
|
|
480
|
+
System One output. Threshold on it knowing that.
|
|
481
|
+
|
|
482
|
+
Chains work exactly as they do for `operate()`: `model` accepts a
|
|
483
|
+
preference-ordered array, `fallback` accepts explicit entries or `false`, and
|
|
484
|
+
an attempt with somewhere left to go skips the rate-limit wait. A provider
|
|
485
|
+
that can neither `question` nor `operate` counts as a failed attempt and the
|
|
486
|
+
chain moves on.
|
|
487
|
+
|
|
404
488
|
## Conversation History
|
|
405
489
|
|
|
406
490
|
Continue conversations across calls:
|
|
@@ -649,6 +733,7 @@ OPENAI_API_KEY # Required for OpenAI
|
|
|
649
733
|
OPENROUTER_API_KEY # Required for OpenRouter
|
|
650
734
|
XAI_API_KEY # Required for xAI (Grok)
|
|
651
735
|
META_API_KEY # Required for Meta (Muse Spark); MODEL_API_KEY is read as a fallback
|
|
736
|
+
TYPESAFE_API_KEY # Required for TypeSafe (Jev); emulated questions use the answering provider's key
|
|
652
737
|
```
|
|
653
738
|
|
|
654
739
|
Keys are resolved via `getEnvSecret()` which supports AWS Secrets Manager.
|