sayshape-mcp 0.4.0 → 0.5.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.
package/README.md CHANGED
@@ -17,7 +17,7 @@ you: "Compare the three phone plans I pasted"
17
17
  | | |
18
18
  |---|---|
19
19
  | `show_interface` | Takes a spec (and an optional title), checks it with SayShape's own parser and returns any skipped lines with line numbers, along with the docs for the elements on those lines. The chat app shows the result in the view. Its description carries a short quick start (about 450 tokens): the syntax, every element's name, every expression function and how to write for a chat. |
20
- | `sayshape_docs` | Props and an example for just the elements the model names (a `table` brings its `table-column`), and topics on request: expressions, actions, lists, rules, examples, chat, database. |
20
+ | `sayshape_docs` | Props and an example for just the elements the model names (a `table` brings its `table-column`), and topics on request: expressions, actions, lists, rules, examples, look, motion, pictures, chat, database. `look` (the look line), `motion` (`enter=` and `stagger=`) and `pictures` (content over an image, `shape=`, `zoom=`) come from the same generators as the guide's optional sections; the quick start only names them, so they cost nothing until a model asks. |
21
21
  | `ui://sayshape/interface.html` | The view: the SayShape engine, the Instrument Sans font and a small bridge script, all in one HTML file. It loads nothing from anywhere else. |
22
22
 
23
23
  In chat apps that stream tool input, the interface builds line by line while the model is still writing it. When the person presses a button with `on=emit:name`, the view sends a message into the conversation naming the action, its value and the interface's current values. The model can then reply or show an updated interface. That's the only way anything leaves an interface: specs can't run code, open links or make requests.
@@ -79,7 +79,7 @@ Then ask for something that moves or can be pressed: *"Draw a traffic light I ca
79
79
 
80
80
  ### Images
81
81
 
82
- The view has no website of its own, so an `image` only loads from a host on its list. By default that is `COMMON_IMAGE_HOSTS`, the sites models know image addresses on (Wikimedia, Unsplash, Picsum, flag, poster and cover sites and the like; the list and the rule for what may be on it are in `src/images.ts`). `--image-hosts` replaces it with only your hosts, usually your company's image CDN, and `--no-image-hosts` allows none, so no images show:
82
+ The view has no website of its own, so an `image` only loads from a host on its list. By default that is `COMMON_IMAGE_HOSTS`, the sites models know image addresses on (Wikimedia, Unsplash, Picsum, flag, poster and cover sites and the like; the list and the rule for what may be on it are in `src/images.ts`). `--image-hosts` replaces it with only your hosts, usually your company's image CDN, and `--no-image-hosts` allows none, so no images show. Chat apps repeat the hosts throughout the view's content policy and won't open a view whose policy passes 8 KiB, so the hosts may come to 1,200 characters in all, counting `https://` on each (`MAX_IMAGE_HOSTS_CHARS`, about 35 typical hosts):
83
83
 
84
84
  ```json
85
85
  "sayshape": { "command": "node", "args": ["/full/path/to/sayshape/mcp/dist/server.js", "--image-hosts", "cdn.acme.com,images.unsplash.com"] }
@@ -109,7 +109,7 @@ What doesn't work there:
109
109
  - **It needs internet access** to load the engine from the CDN; without it, or before the pinned version is on the CDN, the page names the engine version that didn't load.
110
110
  - **Interfaces that load datasets** (`--data`, `--mcp-result`) can't be shown: the page has no way to fetch rows, and the rows never go through the conversation. The model is told so and answers in text.
111
111
  - It uses SayShape's default look in light and dark; `--theme`, `--theme-picker` and the chat app's own colors and fonts apply only to the view. Brand colors (`--colors`, `--accent` and the `colors` argument) are the one thing from them the page does use.
112
- - The engine version is pinned and moves at releases, so the page can be one release behind the server: an element added in the newest release may not draw there yet. ([Why](https://github.com/premmannava/sayshape/blob/main/docs/releasing.md#the-engine-version-the-text-only-page-loads).)
112
+ - The engine version is pinned and moves at releases, so the page can be one release behind the server: an element added in the newest release may not draw there yet. Its pinned engine has no look line, entrance motion or content over images, so these clients aren't offered the `look`, `motion` and `pictures` topics (a widget file, which carries this server's engine, is). ([Why](https://github.com/premmannava/sayshape/blob/main/docs/releasing.md#the-engine-version-the-text-only-page-loads).)
113
113
  - For chat apps whose sandbox blocks the CDN but can show a widget from a file, see [`--widget-dir`](#chat-apps-that-show-widgets-from-files).
114
114
  - In `--http` mode the server makes a new server for every request and never sees what the client announced, so it always answers as for a client that draws views.
115
115
 
@@ -150,7 +150,7 @@ What changes with it, for clients that get a file:
150
150
 
151
151
  A model never reads the whole language guide (about 7,500 tokens). It gets a quick start in `show_interface`'s description (about 450) and asks `sayshape_docs` for only the elements it's about to use: about 140 tokens for a button, 700 for a chart and a table, 1,200 for a six-element dashboard. If it guesses an element wrong, the result of `show_interface` brings that element's docs, so a wrong guess costs one retry, not the whole guide. Retries are the expensive part, because each call resends the whole conversation, so the server avoids the needless ones: it quietly fixes Markdown fences and typographic quotes (the view tidies the same way), tells the model when a problem was only an ignored prop and needs no new call, and answers an unknown function like `argmax` with the one to use instead (`first(sort(rows, 'revenue', 'desc'))`). With a database, the rows go from the database to the interface, so the model's tokens don't grow with the data either.
152
152
 
153
- Each call makes a new interface in the chat, so the server and view keep the chat tidy when a model calls more than it should, which smaller models often do. An interface with problems the model was asked to fix folds into a one-line "Fixing this interface" note, with a button to show it anyway in case no correction comes. The same interface sent again within ten minutes, without changes, is answered with "already showing" and folds into "Same interface as above". Repeats are tracked per conversation over stdio; the stateless HTTP mode doesn't track them.
153
+ Each call makes a new interface in the chat, so the server and view keep the chat tidy when a model calls more than it should, which smaller models often do. An interface with problems the model was asked to fix is hidden, and the view collapses to nothing. The same interface sent again within ten minutes, without changes, is answered with "already showing" and is hidden the same way. Repeats are tracked per conversation over stdio; the stateless HTTP mode doesn't track them.
154
154
 
155
155
  ## Show data from a database
156
156
 
@@ -273,7 +273,7 @@ To give Claude, ChatGPT and other chat apps a permanent HTTPS address, run the H
273
273
  Start it with an exact version, never `@latest`, so what runs is what you checked:
274
274
 
275
275
  ```bash
276
- npx -y sayshape-mcp@0.4.0 --http --host 0.0.0.0 --trust-proxy
276
+ npx -y sayshape-mcp@0.5.0 --http --host 0.0.0.0 --trust-proxy
277
277
  ```
278
278
 
279
279
  | | |