llm_meta_widget 0.13.1 → 0.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b72c0af2bf75bb5a7d1b83b0048aac15dc0485d86448ca4ea99403737c7a95ec
4
- data.tar.gz: 1c5dfb8782859c09727fde1f996a39055c0cbe8e75b6116258b9d547a4a7b7a4
3
+ metadata.gz: e67bd92aa30299ffd0f7d6e3a9291dc5c398800cf9276b04768101077e212880
4
+ data.tar.gz: 487c187c3d20631b38f72cc4b6b9241db285ae5a7e2e5e5ef50f814bcb8cee42
5
5
  SHA512:
6
- metadata.gz: cf20127dce92b482a6c6a88a42e3a31fc2b80e127274c9cbae5e7d6f75d3043c9334e38459a7feddf90f0c985984f1a3cdced6550091953952ab44a9282fcf25
7
- data.tar.gz: 5554707eda6744fdf8188c1c7d81765c27c068cb078a672d894825cb70f8f5c2c2e6ed4f3593f5a5432b7255bd7d0f01718c14804b1dcba9af661c0df7667a3c
6
+ metadata.gz: 39e08820f2551e2eccd15b71b7bba68e2342911cb7ec57de0b1f9ee8d26a720b8e36283f2c033a019fe206de3dc1d10b4337c5fedaee94a39c72ba9482c36bcc
7
+ data.tar.gz: e373ab9a30c2274817d7fae2da1bdea107d024c92f6204af3ae404debcbc22011b6de131bfaf6d25205d420f8f1b98ce8e9328220dcff81ae8142822dbec2a6e
data/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
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.14.0
7
+
8
+ ### Breaking: a transport declared in top-level `remotes` is no longer read
9
+
10
+ 0.13.0 moved the declaration into
11
+ `_meta["io.modelcontextprotocol/static-primitives"].transports` and kept reading
12
+ the old top-level `remotes` list, with a warning, so that a page and a widget
13
+ could be updated in either order. That transition is over.
14
+
15
+ **If your page card still declares its transport in `remotes`, move it to
16
+ `transports` before taking this release.** A card that still carries the old
17
+ spelling gets no handlers from the card: the widget falls back to
18
+ `window.aiActions`, `window.aiPrompts` and `window.aiResources`, which is
19
+ nothing at all for a page that does not define them. The widget reports the
20
+ situation in the browser console rather than leaving you to find it, but it
21
+ cannot dispatch.
22
+
23
+ Nothing else changed. If your card already declares `transports`, this release
24
+ behaves exactly like 0.13.1.
25
+
6
26
  ## 0.13.1
7
27
 
8
28
  ### Documentation: the README caught up with 0.12.x and 0.13.0
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.1"
64
+ gem "llm_meta_widget", "~> 0.14.0"
65
65
  ```
66
66
 
67
67
  ```bash
@@ -152,26 +152,25 @@ The widget is a custom element in a single self-contained ES module, so the
152
152
  whole integration is two lines of HTML:
153
153
 
154
154
  ```html
155
- <script type="module" src="https://cdn.jsdelivr.net/npm/@aibranch/llm-meta-widget@0.13"></script>
155
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@aibranch/llm-meta-widget@0.14"></script>
156
156
  <llm-meta-widget llm-url="https://your-meta-server.example"
157
157
  model="gpt-oss-120b"
158
158
  greeting="Hi — ask me anything about this page."></llm-meta-widget>
159
159
  ```
160
160
 
161
- **`@0.13` is a version range, and it stops at 0.13.x on purpose.** You receive
161
+ **`@0.14` is a version range, and it stops at 0.14.x on purpose.** You receive
162
162
  bug fixes without editing your page, and a release that breaks your page cannot
163
163
  arrive on its own.
164
164
 
165
- Moving to 0.14 is therefore a change you make yourself. Read
165
+ Moving to 0.15 is therefore a change you make yourself. Read
166
166
  [CHANGELOG.md](CHANGELOG.md) before you do, because this is where what your page
167
167
  must provide can change. For example, 0.10.0 changed how the widget finds a page
168
168
  card: by media type rather than by element id. A page that declared its card the
169
169
  new way while still loading `@0.9` lost every tool, prompt and resource it had
170
170
  declared. Nothing failed, anywhere. The CHANGELOG entry for 0.10.0 describes it.
171
171
 
172
- 0.13.0 moves where a page declares its transport. That one is safe to take
173
- first, because 0.13.x still reads the old spelling and warns; the page can move
174
- afterwards.
172
+ 0.13.0 moved where a page declares its transport, and 0.14.0 stopped reading
173
+ the old spelling. Move your card to `transports` before taking 0.14.x.
175
174
 
176
175
  A Rails app is protected from that mismatch, because the `Gemfile` will not
177
176
  resolve a widget version the page cannot use. A page that loads the widget from
@@ -312,10 +311,10 @@ widget supports today. Leave `transports` out and the widget reads
312
311
  `window.aiActions`, `window.aiPrompts` and `window.aiResources` instead — see
313
312
  "Say where your handlers live".
314
313
 
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.
314
+ Widgets from 0.11.1 to 0.12.2 read this declaration from a `remotes` list at the
315
+ top level of the card, and 0.13.x read either spelling. From 0.14.0 the old one
316
+ is not read at all: a card that still carries it gets no handlers, and the
317
+ widget reports that in the browser console. Write `transports`.
319
318
 
320
319
  A page may declare `prompts` in the same block. See [The page card](#the-page-card)
321
320
  for prompts, for the size and volatility hints on a resource, and for what
@@ -701,12 +701,8 @@ function declaredPageGlobal(card, warn = console.warn) {
701
701
  warn("[llm-meta-widget] page card declares transports " + JSON.stringify(declared.map((t) => t && t.type)) + ", none of which this widget supports; not dispatching to the page");
702
702
  return null;
703
703
  }
704
- for (const remote of card && card.remotes || []) {
705
- if (!remote || remote.type !== PAGE_GLOBAL_TRANSPORT) continue;
706
- if (typeof remote.global === "string" && remote.global.trim() !== "") {
707
- warn(`[llm-meta-widget] page card declares its transport in top-level "remotes", which is deprecated; move it to _meta["${STATIC_PRIMITIVES_META}"].transports`);
708
- return remote.global.trim();
709
- }
704
+ if ((card && card.remotes || []).some((r) => r && r.type === PAGE_GLOBAL_TRANSPORT)) {
705
+ warn(`[llm-meta-widget] page card declares its transport in top-level "remotes", which is no longer read. Move it to _meta["${STATIC_PRIMITIVES_META}"].transports`);
710
706
  }
711
707
  return null;
712
708
  }
@@ -1130,10 +1130,9 @@ export const PAGE_GLOBAL_TRANSPORT = "page-global"
1130
1130
  // `page-postmessage`, `page-jsonrpc` and `page-worker` are reserved, and a card
1131
1131
  // declaring only those gets no handlers rather than the wrong ones.
1132
1132
  //
1133
- // Top-level `remotes` is the pre-d44bd25a shape that 0.11.1 and 0.12.2 read. It
1134
- // is accepted for one release so a page and a widget can be updated in either
1135
- // order without the page going dark in between, and it warns so the author
1136
- // knows to move.
1133
+ // Top-level `remotes` is the pre-d44bd25a shape that 0.11.1 to 0.12.2 read and
1134
+ // 0.13.x accepted. It is no longer read, but a card still carrying it is
1135
+ // reported, because the alternative is a page that quietly stops working.
1137
1136
  export function declaredPageGlobal(card, warn = console.warn) {
1138
1137
  const declared = (card && card.transports) || []
1139
1138
  for (const transport of declared) {
@@ -1149,14 +1148,14 @@ export function declaredPageGlobal(card, warn = console.warn) {
1149
1148
  return null
1150
1149
  }
1151
1150
 
1152
- for (const remote of (card && card.remotes) || []) {
1153
- if (!remote || remote.type !== PAGE_GLOBAL_TRANSPORT) continue
1154
- if (typeof remote.global === "string" && remote.global.trim() !== "") {
1155
- warn('[llm-meta-widget] page card declares its transport in top-level ' +
1156
- '"remotes", which is deprecated; move it to ' +
1157
- `_meta["${STATIC_PRIMITIVES_META}"].transports`)
1158
- return remote.global.trim()
1159
- }
1151
+ // No longer read. Reporting it is still worth a few lines: without this a
1152
+ // card that declares its transport only in the old place gets no handlers,
1153
+ // falls through to the legacy globals, and a page that deliberately defines
1154
+ // none — as PubDictionaries does — simply stops working with nothing said.
1155
+ if (((card && card.remotes) || []).some((r) => r && r.type === PAGE_GLOBAL_TRANSPORT)) {
1156
+ warn('[llm-meta-widget] page card declares its transport in top-level ' +
1157
+ '"remotes", which is no longer read. Move it to ' +
1158
+ `_meta["${STATIC_PRIMITIVES_META}"].transports`)
1160
1159
  }
1161
1160
  return null
1162
1161
  }
@@ -1,3 +1,3 @@
1
1
  module LlmMetaWidget
2
- VERSION = "0.13.1"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm_meta_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdkim