sayshape-mcp 0.4.0 → 0.6.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.
@@ -44,8 +44,10 @@ When none is on, there's no toolbar at all. Whoever installs the server chooses,
44
44
  | `--no-copy-text` | Hide Copy text, and leave Ctrl+C alone (shown by default) |
45
45
  | `--select-touch` | Let a long press on a touch screen select the word under the finger, with the phone's own handles and Copy menu. Off by default until it has been checked on real phones; `--no-select-touch` says off explicitly. Mouse and pen selection are unaffected |
46
46
  | `--no-select-text` | No invisible text layer: words can't be selected by dragging or found with Ctrl/Cmd+F, and nothing extra is added to the page (on by default) |
47
+ | `--no-chat-look` | Draw interfaces as before the chat look: the theme's background painted behind them, and the view's own fixed sizes. Without it, the chat app's own background shows through (when the app says whether it's light or dark; otherwise the theme's is painted as before), and the engine draws with its chat density (`context: "chat"`): figures about 26 px, card padding about 15 px, 36 px controls, list rows on one line where they fit, tighter gaps and a 12 px gutter. A spec's own `look density=` still wins |
47
48
  | `--scene` | **Experimental.** Turn on scenes: pictures and animations the model paints from shapes, with parts people can press and soft shadows, glow and shine for depth (off by default). Leave it out to turn them off again. |
48
49
  | `--behavior` | **Experimental.** Turn on behavior: things that change by themselves on a timer (a countdown, a simulation) and, together with `--scene`, shapes people drag (off by default). Rules only change the interface's own values; they still can't run code. Chat apps that can't draw views don't get it. |
50
+ | `--adaptive-guides` | Accepted and does nothing: this is the default. `show_interface`'s description carries a small map of SayShape in place of the quick start, with the report syntax, so a data report needs no docs call; `sayshape_docs` returns one guide for every capability and element named together (`topics: ["forms", "calculations"]`, `elements: ["slider"]`). The view and `--widget-dir` files draw reports and behavior; the CDN page for text-only clients is offered neither, and its `sayshape_docs` lists only what it can draw. See [adaptive guides](../docs/capabilities.md). |
49
51
  | `--layout-first` | Tell models to write the layout first and the data last: elements, then `state` lines with long lists at the very end (small values a control starts from, like a selected tab, may still go first). The view draws from the first element while the spec streams in, with placeholders for data that hasn't arrived, instead of waiting for a long list to be written. Changes only the guide text in `show_interface`'s description and `sayshape_docs`; off by default, and then the text is exactly what it was. See [the model guide](../docs/model.md#layout-first-while-streaming). |
50
52
  | `--logo https://cdn.example.com/logo.png` | An https image drawn small in the corner of every slide of a deck. Its host is allowed like `--image-hosts`, so the logo loads. See [Slide decks](#slide-decks). |
51
53
  | `--slides` | Does nothing. Slide decks need no flag; this is accepted so setups written for an earlier version still start. |
@@ -79,7 +81,7 @@ Then ask for something that moves or can be pressed: *"Draw a traffic light I ca
79
81
 
80
82
  ### Images
81
83
 
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:
84
+ 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
85
 
84
86
  ```json
85
87
  "sayshape": { "command": "node", "args": ["/full/path/to/sayshape/mcp/dist/server.js", "--image-hosts", "cdn.acme.com,images.unsplash.com"] }
@@ -109,7 +111,7 @@ What doesn't work there:
109
111
  - **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
112
  - **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
113
  - 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).)
114
+ - 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
115
  - 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
116
  - 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
117
 
@@ -150,7 +152,7 @@ What changes with it, for clients that get a file:
150
152
 
151
153
  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
154
 
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.
155
+ 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
156
 
155
157
  ## Show data from a database
156
158
 
@@ -273,7 +275,7 @@ To give Claude, ChatGPT and other chat apps a permanent HTTPS address, run the H
273
275
  Start it with an exact version, never `@latest`, so what runs is what you checked:
274
276
 
275
277
  ```bash
276
- npx -y sayshape-mcp@0.4.0 --http --host 0.0.0.0 --trust-proxy
278
+ npx -y sayshape-mcp@0.6.0 --http --host 0.0.0.0 --trust-proxy
277
279
  ```
278
280
 
279
281
  | | |