llm_meta_widget 0.7.2 → 0.7.4

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: 59b4d4a0bbd1e56e7d120de12efc7b08a9d24f4727266d57b38ab9734ea590ad
4
- data.tar.gz: 12da0bd0ca5d9ba992bc6ece49f14d9b5351edc41ce54a31fc12bb1d0cfc6440
3
+ metadata.gz: 3c9ff9a76f254cfd3096189703db3546a3089661a02de5848c98130732933e87
4
+ data.tar.gz: 5091614c56ea8d2e31e26d32286114505c30cc26edd5b9f4b0e66b9a779f5805
5
5
  SHA512:
6
- metadata.gz: fa75e94a1423da2e5d696bb79f4dc65976cac6e3e3254e9ddd04da497845319628094ec0d1f4920447f8639b8ad8bc874589b9cfe3c2b1a2913c7458ecde2c93
7
- data.tar.gz: a23d46cf796b1e348683042341afa275fe677903fa0c8235172f929d54458ad24386a4d98e2f13079135025786959770624feeb245e422641bfa291722987078
6
+ metadata.gz: 94afd5f3ac2861a419b283e48c0fb49483ea0c128e1b3a68b0ab23b6da0b29d852274d7b4bba906826ee1f06196a5a5aa09f5209ef192b85341735962fed0e09
7
+ data.tar.gz: f0faabb00220362e70218e8685bb30bb0d201ea9d8963772e60cb95d5f4a7fac2e42691cf1b75e404b14ce34f4148204c46d30768a983ffa7db597b22ceb1de6
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Embeddable browser chat widget for the [llm_meta](https://github.com/pubannotation) ecosystem.
4
4
 
5
- Client-orchestrated: the widget fetches host-side action schemas + host-published `.well-known/mcp.json` manifests at boot, dispatches tool_calls locally (page-embedded actions) or directly to MCP endpoints (host-wide well-known), and consumes the meta-server's SSE `single_llm_calls` API. Ships one Rails helper + one view partial + a served orchestrator JS module.
5
+ Client-orchestrated: the widget fetches host-side action schemas + host-published `.well-known/mcp.json` manifests at boot, dispatches tool_calls locally (page-embedded actions) or directly to MCP endpoints (host-wide well-known), and consumes the meta-server's SSE `single_llm_calls` API. Ships as a custom element in one self-contained ES module — on npm for any host, and in a Rails gem whose helper serves the identical file.
6
6
 
7
7
  **No** Devise, DB migrations, ChatManager, or PromptNavigator. Adds only `rails >= 8.0` as a runtime dep — so hosts that haven't bumped to 8.1 can adopt it without a Rails upgrade.
8
8
 
@@ -32,7 +32,7 @@ step, no Node at runtime.
32
32
 
33
33
  ```ruby
34
34
  # Gemfile
35
- gem "llm_meta_widget", "~> 0.4"
35
+ gem "llm_meta_widget", "~> 0.7"
36
36
  ```
37
37
 
38
38
  ```
@@ -62,8 +62,8 @@ the role label turns into a spinning gear reading "Working…", and the reply
62
62
  streams in.
63
63
 
64
64
  If the panel opens but nothing comes back, it is almost always CORS. The hub
65
- must list your app's origin in its `config/initializers/cors.rb` for the
66
- `/api/*` resource, because the widget calls the hub **from the visitor's
65
+ must list your app's origin in its `CORS_ORIGINS` environment variable for
66
+ the `/api/*` resource, because the widget calls the hub **from the visitor's
67
67
  browser**, not from your server. Open the browser console: a blocked request
68
68
  says so explicitly.
69
69
 
@@ -248,7 +248,7 @@ By default the widget renders two pickers below the input textarea:
248
248
  - **Model dropdown** — populated from the hub's `GET /api/llms` (anon path returns Ollama-only, since the widget's LLM calls use `api_key_uuid: "ollama-local"`).
249
249
  - **Tool picker** — populated from the hub's `GET /api/mcp_servers` (anon path returns `public_to_anonymous: true` servers). Two-level UX: server bulk-toggle + individual tool checkboxes on expand.
250
250
 
251
- Both pickers require **CORS**: the meta-server must include the host's origin in its `config/initializers/cors.rb` allowlist (`/api/*` resource). Without CORS, the fetch is silently blocked and pickers stay empty.
251
+ Both pickers require **CORS**: the meta-server must allow the host's origin on its `/api/*` resource. That allowlist is an environment variable, not code — `CORS_ORIGINS`, a comma-separated list — so adding a host is a deployment change and a restart, with no commit and nothing about one deployment's hosts published in the repo. Without CORS the fetch is silently blocked and the pickers stay empty.
252
252
 
253
253
  To adjust picker behavior at the helper call site:
254
254
 
@@ -257,8 +257,8 @@ To adjust picker behavior at the helper call site:
257
257
  llm_url: "https://your-meta-server.example",
258
258
  tool_hub_url: "https://your-meta-server.example",
259
259
  model: "qwen3-6-35b-fast", # initial selection
260
- enable_model_picker: true, # false → hide picker, use fixed `model:`
261
- enable_tool_picker: true, # false → hide picker, no Class-1 tools
260
+ enable_model_picker: true, # false → omit picker, use fixed `model:`
261
+ enable_tool_picker: true, # false → omit picker, no Class-1 tools
262
262
  models: nil, # nil = all anon models; ["qwen3-6-35b-fast", …] = allowlist
263
263
  hub_tools: nil # nil = all anon-public MCPs; ["togomcp", …] = allowlist by server name
264
264
  ) %>
@@ -289,8 +289,8 @@ To lock the widget to the fixed `model:` prop and disable Class-1 tools entirely
289
289
  | `well_known_urls:` | `nil` | `nil` = auto-discover same-origin; explicit array = fetch those; `[]` = disable |
290
290
  | `greeting:` | `nil` | First thing a visitor sees when the panel opens, above the offered prompt templates. `nil` = a generic line |
291
291
  | `max_rounds:` | `3` | Cap on tool-call rounds per LLM turn. Page actions cost a round each since 0.4.0 — raise it for multi-step flows |
292
- | `enable_model_picker:` | `true` | Show model dropdown (Level-1) |
293
- | `enable_tool_picker:` | `true` | Show tool picker (Level-1) |
292
+ | `enable_model_picker:` | `true` | Show model dropdown (Level-1). `false` removes it from the DOM |
293
+ | `enable_tool_picker:` | `true` | Show tool picker (Level-1). `false` removes it from the DOM |
294
294
  | `models:` | `nil` | Model-name allowlist; `nil` = all anon-available |
295
295
  | `hub_tools:` | `nil` | MCP-server-name allowlist; `nil` = all anon-public |
296
296
 
@@ -404,6 +404,10 @@ it most, since they must already know your form to press it.
404
404
  three tool classes plus prompts and resources. Its
405
405
  `app/views/annotation/text_annotation.html.erb` and `app/controllers/mcp_controller.rb`
406
406
  are the fullest example available.
407
+ - **Shipping the element** — `docs/custom-element-distribution.md` is the design note
408
+ behind the custom-element move: the npm package and its CDN URL, why `main`,
409
+ `exports` and `sideEffects` are set the way they are, and why the gem and the npm
410
+ package must never drift in version.
407
411
  - **Issues and questions** — <https://github.com/jdkim/llm_meta_widget/issues>
408
412
 
409
413
  ## License
@@ -1,3 +1,3 @@
1
1
  module LlmMetaWidget
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.4"
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.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jdkim
@@ -25,8 +25,10 @@ dependencies:
25
25
  version: '8.0'
26
26
  description: 'Client-orchestrated chat widget: fetches host-side aiActions + .well-known/mcp.json
27
27
  manifests, dispatches tool_calls locally or directly to MCP endpoints, and consumes
28
- the llm_meta_server''s SSE-streamed single_llm_calls API. Ships one helper + one
29
- partial + a served orchestrator.js. No Devise, no DB migrations, no chat_manager.'
28
+ the llm_meta_server''s SSE-streamed single_llm_calls API. Ships as a custom element
29
+ in one self-contained ES module — served by this gem''s helper for Rails hosts,
30
+ and published to npm as @aibranch/llm-meta-widget for hosts that are not Rails.
31
+ No Devise, no DB migrations, no chat_manager.'
30
32
  email:
31
33
  - jdkim@dbcls.rois.ac.jp
32
34
  executables: []