llm_meta_widget 0.13.0 → 0.13.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +57 -9
- data/lib/llm_meta_widget/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b72c0af2bf75bb5a7d1b83b0048aac15dc0485d86448ca4ea99403737c7a95ec
|
|
4
|
+
data.tar.gz: 1c5dfb8782859c09727fde1f996a39055c0cbe8e75b6116258b9d547a4a7b7a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf20127dce92b482a6c6a88a42e3a31fc2b80e127274c9cbae5e7d6f75d3043c9334e38459a7feddf90f0c985984f1a3cdced6550091953952ab44a9282fcf25
|
|
7
|
+
data.tar.gz: 5554707eda6744fdf8188c1c7d81765c27c068cb078a672d894825cb70f8f5c2c2e6ed4f3593f5a5432b7255bd7d0f01718c14804b1dcba9af661c0df7667a3c
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
This file starts at 0.8.0, the first release with a breaking change worth
|
|
4
4
|
calling out. Earlier releases are in the git history (`git log --oneline v0.7.6`).
|
|
5
5
|
|
|
6
|
+
## 0.13.1
|
|
7
|
+
|
|
8
|
+
### Documentation: the README caught up with 0.12.x and 0.13.0
|
|
9
|
+
|
|
10
|
+
Three examples and two explanations still told a page author to declare the
|
|
11
|
+
transport in a top-level `remotes` list. Following the README would have
|
|
12
|
+
produced a card this version warns about and a later version will stop reading.
|
|
13
|
+
They now use `transports` inside the extension data, and say that the list is
|
|
14
|
+
read in order and that the first supported type wins.
|
|
15
|
+
|
|
16
|
+
The README also said nothing about what the widget does when a turn does not fit
|
|
17
|
+
the model's context, although every part of that behaviour shipped in 0.12.x and
|
|
18
|
+
puts messages in the panel that a page's visitors will read. There is now a
|
|
19
|
+
section describing the three cases — one oversized tool result shortened, older
|
|
20
|
+
results given up, a reference resource refused for its size — with the wording
|
|
21
|
+
the reader actually sees.
|
|
22
|
+
|
|
23
|
+
No code changed in this release.
|
|
24
|
+
|
|
6
25
|
## 0.13.0
|
|
7
26
|
|
|
8
27
|
### Changed: a page card declares its transport in `transports`, not `remotes`
|
data/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Option 3 if it does not.
|
|
|
61
61
|
|
|
62
62
|
```ruby
|
|
63
63
|
# Gemfile
|
|
64
|
-
gem "llm_meta_widget", "~> 0.13.
|
|
64
|
+
gem "llm_meta_widget", "~> 0.13.1"
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
```bash
|
|
@@ -272,8 +272,8 @@ primitive type:
|
|
|
272
272
|
<script type="application/mcp-static-primitives+json">
|
|
273
273
|
{
|
|
274
274
|
"name": "org.example/your-page",
|
|
275
|
-
"remotes": [ { "type": "page-global", "global": "mcp" } ],
|
|
276
275
|
"_meta": { "io.modelcontextprotocol/static-primitives": {
|
|
276
|
+
"transports": [ { "type": "page-global", "global": "mcp" } ],
|
|
277
277
|
"tools": [
|
|
278
278
|
{ "name": "add_dictionaries",
|
|
279
279
|
"description": "Add the named dictionaries to the current selection.",
|
|
@@ -305,11 +305,18 @@ primitive type:
|
|
|
305
305
|
A tool's schema may be spelled `inputSchema`, as MCP spells it, or
|
|
306
306
|
`input_schema`. Both are accepted.
|
|
307
307
|
|
|
308
|
-
`
|
|
309
|
-
global is declared rather than assumed.
|
|
308
|
+
`transports` is how a consumer other than this widget finds your handlers, so
|
|
309
|
+
the global is declared rather than assumed. It is a list, and the consumer uses
|
|
310
|
+
the first entry whose `type` it supports; `page-global` is the only type this
|
|
311
|
+
widget supports today. Leave `transports` out and the widget reads
|
|
310
312
|
`window.aiActions`, `window.aiPrompts` and `window.aiResources` instead — see
|
|
311
313
|
"Say where your handlers live".
|
|
312
314
|
|
|
315
|
+
Widgets up to 0.12.2 read this declaration from a `remotes` list at the top
|
|
316
|
+
level of the card instead. Version 0.13.0 still reads that, and warns, so a page
|
|
317
|
+
and a widget can be updated in either order. Write `transports`; a page may
|
|
318
|
+
declare both while a deployment is still catching up, and `transports` decides.
|
|
319
|
+
|
|
313
320
|
A page may declare `prompts` in the same block. See [The page card](#the-page-card)
|
|
314
321
|
for prompts, for the size and volatility hints on a resource, and for what
|
|
315
322
|
happens when a document holds several blocks.
|
|
@@ -515,8 +522,8 @@ name the global that holds its handlers. Both are below.
|
|
|
515
522
|
<script type="application/mcp-static-primitives+json">
|
|
516
523
|
{
|
|
517
524
|
"name": "org.example/your-page",
|
|
518
|
-
"remotes": [ { "type": "page-global", "global": "mcp" } ],
|
|
519
525
|
"_meta": { "io.modelcontextprotocol/static-primitives": {
|
|
526
|
+
"transports": [ { "type": "page-global", "global": "mcp" } ],
|
|
520
527
|
"tools": [ { "name": "set_text", "description": "…", "inputSchema": { } } ],
|
|
521
528
|
"prompts": [ { "name": "annotate", "description": "Annotate this page" } ],
|
|
522
529
|
"resources": [ { "uri": "page:text", "name": "Text", "description": "the text to annotate",
|
|
@@ -526,8 +533,8 @@ name the global that holds its handlers. Both are below.
|
|
|
526
533
|
</script>
|
|
527
534
|
```
|
|
528
535
|
|
|
529
|
-
`name` identifies the card, as it does for a server. `
|
|
530
|
-
handlers live — see "Say where your handlers live" below. Only the `_meta`
|
|
536
|
+
`name` identifies the card, as it does for a server. `transports` says where
|
|
537
|
+
the handlers live — see "Say where your handlers live" below. Only the `_meta`
|
|
531
538
|
block is required by this widget; the rest is what makes the card readable by
|
|
532
539
|
anything else.
|
|
533
540
|
|
|
@@ -573,8 +580,8 @@ them:
|
|
|
573
580
|
```html
|
|
574
581
|
<script type="application/mcp-static-primitives+json">
|
|
575
582
|
{ "name": "org.example/your-page",
|
|
576
|
-
"
|
|
577
|
-
|
|
583
|
+
"_meta": { "io.modelcontextprotocol/static-primitives": {
|
|
584
|
+
"transports": [ { "type": "page-global", "global": "mcp" } ], "tools": [ ... ] } } }
|
|
578
585
|
</script>
|
|
579
586
|
<script>
|
|
580
587
|
window.mcp = {
|
|
@@ -722,6 +729,47 @@ as **optional**, and fill them from page state where you can. An argument the
|
|
|
722
729
|
visitor must type in makes the button useless to the visitor who needed it most:
|
|
723
730
|
to press it, they would already have to know your form.
|
|
724
731
|
|
|
732
|
+
## When a turn does not fit the model's context
|
|
733
|
+
|
|
734
|
+
A model holds a fixed number of tokens. A long conversation, a large reference
|
|
735
|
+
resource and a few big tool results can exceed it, and the provider then refuses
|
|
736
|
+
the whole turn. The widget tries to keep a turn inside the limit instead, and
|
|
737
|
+
tells the reader whenever it has to change something. You do not configure any
|
|
738
|
+
of this, but your page's visitors will see the messages, so it is worth knowing
|
|
739
|
+
what they mean.
|
|
740
|
+
|
|
741
|
+
The widget learns each model's context window from the server's model list. If
|
|
742
|
+
the server does not report one, none of the behaviour below applies and the turn
|
|
743
|
+
is sent as it is.
|
|
744
|
+
|
|
745
|
+
**One oversized tool result is shortened.** A single result may use at most 40%
|
|
746
|
+
of the window. A larger one is cut to that size, and the model is told in the
|
|
747
|
+
result itself how much was shown and that it can call the tool again with a
|
|
748
|
+
narrower query. The panel says, for example:
|
|
749
|
+
|
|
750
|
+
> Shortened an oversized togovar_search_variant result to fit the context:
|
|
751
|
+
> 121,000 tokens, where one result may use at most 51,000. Ask again with a
|
|
752
|
+
> narrower question for the complete result.
|
|
753
|
+
|
|
754
|
+
**Older tool results are given up when the whole turn is too long.** This is for
|
|
755
|
+
a conversation that has grown over many turns, not for one large result. The
|
|
756
|
+
oldest results go first, one at a time, until the turn fits. The questions, the
|
|
757
|
+
answers and the model's own summaries of what it read are never touched, and a
|
|
758
|
+
dropped result leaves a note in its place so the model knows to ask again.
|
|
759
|
+
|
|
760
|
+
**A reference resource that does not fit is not attached.** Each turn may carry
|
|
761
|
+
about 6% of the window as reference data — roughly 8 KB for a 32,000-token model
|
|
762
|
+
and 32 KB for a 128,000-token one. A resource larger than that is not fetched at
|
|
763
|
+
all, and the panel says so, naming the resource and both figures. The model is
|
|
764
|
+
not told, because it cannot fetch a resource itself; the reader can act, by
|
|
765
|
+
choosing a model with a larger window or asking you for a smaller resource.
|
|
766
|
+
|
|
767
|
+
If you publish a large document through MCP, consider offering it in sections
|
|
768
|
+
behind one tool that takes a section name, rather than as a single tool result.
|
|
769
|
+
The list of section names in the tool's own schema costs a few hundred tokens
|
|
770
|
+
and is visible to every client, while a document of tens of kilobytes crowds out
|
|
771
|
+
the conversation it is supposed to support.
|
|
772
|
+
|
|
725
773
|
## Further reading
|
|
726
774
|
|
|
727
775
|
- **The static-primitives extension** — `io.modelcontextprotocol/static-primitives`,
|