sil-openclaw 0.7.0 → 0.8.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/EXAMPLES.md +93 -0
  3. package/README.md +50 -113
  4. package/SECURITY.md +9 -6
  5. package/assets/banner-dark.svg +15 -0
  6. package/assets/banner.svg +15 -0
  7. package/dist/gateway/screen.js +174 -0
  8. package/dist/index.js +5 -9
  9. package/dist/lib/answers.js +59 -0
  10. package/dist/lib/screen-log.js +13 -0
  11. package/dist/lib/shopping-call.js +23 -28
  12. package/dist/lib/sil-client.js +19 -8
  13. package/dist/tools/catalog.js +69 -72
  14. package/dist/tools/identity.js +10 -6
  15. package/openclaw.plugin.json +2 -2
  16. package/package.json +4 -2
  17. package/schema/PROVENANCE.md +1 -1
  18. package/schema/shopping-brief-read-request.schema.json +2 -1
  19. package/schema/shopping-brief-read-response.schema.json +98 -50
  20. package/schema/shopping-brief-write-request.schema.json +202 -105
  21. package/schema/shopping-content-request.schema.json +12 -28
  22. package/schema/shopping-content-response.schema.json +49 -256
  23. package/schema/shopping-domain-get-request.schema.json +16 -11
  24. package/schema/shopping-domain-get-response.schema.json +24 -460
  25. package/schema/shopping-domain-search-request.schema.json +3 -3
  26. package/schema/shopping-domain-search-response.schema.json +3 -56
  27. package/schema/shopping-offers-request.schema.json +28 -174
  28. package/schema/shopping-offers-response.schema.json +369 -102
  29. package/schema/shopping-product-get-request.schema.json +3 -2
  30. package/schema/shopping-product-get-response.schema.json +332 -128
  31. package/schema/shopping-search-request.schema.json +41 -19
  32. package/schema/shopping-search-response.schema.json +405 -187
  33. package/schema/shopping-seller-get-request.schema.json +13 -1
  34. package/schema/shopping-seller-get-response.schema.json +488 -147
  35. package/schema/shopping-user-read-request.schema.json +2 -1
  36. package/schema/shopping-user-read-response.schema.json +2 -2
  37. package/schema/shopping-user-remember-request.schema.json +9 -8
  38. package/schema/sil-whoami-response.schema.json +37 -28
  39. package/sil-shopping/SKILL.md +132 -137
  40. package/dist/gateway/search-results.js +0 -99
  41. package/dist/lib/search-results-log.js +0 -23
  42. package/dist/lib/search-results-store.js +0 -116
package/CHANGELOG.md CHANGED
@@ -10,6 +10,42 @@ release (`clawhub package publish --changelog`). See [README](./README.md#releas
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.8.1] - 2026-10-30
14
+
15
+ ### Fixed
16
+
17
+ - **On ClawHub again.** ClawHub's scanner failed on 0.8.0 and left it unlisted. This is the same plugin
18
+ as 0.8.0.
19
+
20
+ ## [0.8.0] - 2026-10-30
21
+
22
+ ### Changed
23
+
24
+ - **The README says what SIL is.** The Shopping Interface Layer for personal AI agents: why an
25
+ interface beats a search box or a product feed, and what a turn looks like. `EXAMPLES.md` holds
26
+ the buyer conversations. The keyboard, bike and tent examples, the checkout link and the UCP
27
+ lines are gone; a banner under `assets/`; the npm and ClawHub description says the same.
28
+ - **The Ask-to-Offer Journey contract.** Money is `{ amount, currency }` in integer minor units
29
+ (€130 is 13000), a range `{ min?, max?, currency }`; spec rows are `spec`, not `key`, and
30
+ the search's `price` is the range. `shopping_domain_get` answers `name`, `reached` and
31
+ `decides`/`why` on deciding specs. `shopping_search` answers `asked` numbered,
32
+ `search_stats`, `holds`/`misses`/`unknown` as ask numbers in place of `fit`, up to five
33
+ `images` and `variants` with one `recommended`. `shopping_offers` and `shopping_seller_get`
34
+ take `page` and answer `next_page`. Descriptions and the skill are re-cut to the journey.
35
+ - **`sil.answer` and `sil.call` replace `sil.search_results`.** A paired screen reads back any
36
+ sil answer the agent got (15 minutes, the last 64), and runs a read, or a forget of the rows it names, as the buyer.
37
+ - **A variant quotes its `price_range`, and an offer carries its shop's terms.** A variant's
38
+ `starting_from` is gone: it answers `price_range`, its offers' one-off prices, cheapest to
39
+ dearest. An offer's `seller` carries its `name`, `delivery` to `ship_to`, `returns_days` and
40
+ its own `promotions`; `shopping_seller_get` is for warranty, policies, reviews and other
41
+ terms. The skill quotes a promotion only on its own shop's offer.
42
+
43
+ ### Removed
44
+
45
+ - **Nothing to wait for or re-read.** The search receipt's `finding`, and `shopping_offers`'
46
+ `pending` answer and `confirm` request field, are gone: sil answers every call from what it
47
+ holds. The skill no longer tells the agent to ask again or confirm before a hand-off.
48
+
13
49
  ## [0.7.0] - 2026-10-12
14
50
 
15
51
  ### Changed
package/EXAMPLES.md ADDED
@@ -0,0 +1,93 @@
1
+ # What to ask SIL
2
+
3
+ Everything here is coffee: beans, grinders, espresso machines and the gear around them. That is what SIL carries today, in the US, the UK and Greece. Ask for anything else and your agent says so; nothing is made up to fill the gap.
4
+
5
+ Your agent's words will differ. The facts come from SIL: the products, the specs, the shops, the prices, the guides. A price is what SIL read on the shop's page, dated; the agent re-reads it before you buy.
6
+
7
+ ## Start
8
+
9
+ ```text
10
+ you register me on sil
11
+ agent Opens a browser sign-in. Done once.
12
+
13
+ you who am I on sil?
14
+ agent Ioanna, in Greece, prices in EUR, one address on file.
15
+ ```
16
+
17
+ ## It asks what decides the buy
18
+
19
+ ```text
20
+ you I'm getting into espresso. What grinder should I start with?
21
+
22
+ agent For espresso the grinder matters more than the machine. Three things
23
+ decide it: how fine it goes and in what small steps, because espresso
24
+ needs tiny adjustments; the burr set, which sets how even the grind
25
+ is; and whether you'll also brew filter, which needs a coarse setting
26
+ too. Two questions: hand or electric, and will it do both?
27
+ ```
28
+
29
+ ## It teaches from real guides
30
+
31
+ ```text
32
+ you is the grinder really more important than the machine?
33
+
34
+ agent From a guide SIL holds, Kev's 2026 burr grinder review: "the grinder
35
+ is more responsible for coffee quality than the espresso machine. If
36
+ you are focused on espresso quality you should spend just as much, if
37
+ not more, on the grinder." The guide, if you want the long read: <link>
38
+ ```
39
+
40
+ ## It says what it doesn't know
41
+
42
+ ```text
43
+ you a hand grinder for travel, under €300, espresso and pour-over
44
+
45
+ agent Three hand grinders under €300, against what you asked:
46
+ 1Zpresso K-Ultra espresso and pour-over · 20 µm steps · 0.7 kg meets all
47
+ 1Zpresso J-Ultra espresso only · 8 µm steps · 0.67 kg misses pour-over
48
+ 1Zpresso ZP6 pour-over only · 48 mm burrs misses espresso;
49
+ SIL holds no step size for it, so I can't compare that.
50
+ ```
51
+
52
+ ## The shops, side by side
53
+
54
+ ```text
55
+ you where can I buy the J-Ultra in Greece?
56
+
57
+ agent Shops SIL has read that deliver to you:
58
+ Barista och Espresso barista-espresso.gr €226.95, down from €238.95 (5% off) in stock
59
+ That's the one Greek shop SIL holds for it today. Price as read on
60
+ 30 Oct; I'll check again before you buy. Their page: <link>
61
+ ```
62
+
63
+ Where SIL holds several shops, they come cheapest first among those that reach you. Nobody pays to be first.
64
+
65
+ ## It remembers you, if you want it to
66
+
67
+ ```text
68
+ you remember that I brew pour-over at home and I never buy from marketplaces
69
+ agent Kept both. I'll search and sort with them from now on.
70
+
71
+ you forget the marketplace rule
72
+ agent Gone.
73
+ ```
74
+
75
+ Kept in your SIL account, never shared with other users, never used for training.
76
+
77
+ ## A buy that takes a few days
78
+
79
+ ```text
80
+ you keep this as a job: a first espresso setup, machine and grinder, under €800
81
+
82
+ agent Opened "First espresso setup, under €800". I'll keep what we decide in it.
83
+ Pick up any time with "where was I on the espresso setup?"
84
+ ```
85
+
86
+ ## Something SIL doesn't carry yet
87
+
88
+ ```text
89
+ you find me a road bike around €1500
90
+
91
+ agent SIL doesn't carry bikes yet, so I have nothing honest to show you there.
92
+ Coffee is what it holds today.
93
+ ```
package/README.md CHANGED
@@ -1,135 +1,72 @@
1
- ```
2
- ███████╗██╗██╗
3
- ██╔════╝██║██║
4
- ███████╗██║██║
5
- ╚════██║██║██║
6
- ███████║██║███████╗
7
- ╚══════╝╚═╝╚══════╝
8
-
9
- Shop like you code
10
- ```
11
-
12
- **The shopping layer your agent runs for you.**
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="./assets/banner-dark.svg">
3
+ <img alt="SIL. Shop like you code. The Shopping Interface Layer for personal AI agents. Open beta." src="./assets/banner.svg" width="880">
4
+ </picture>
13
5
 
14
- *Introducing Spec Driven Shopping: the way Agents should be shopping.*
15
-
16
- [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/Context4GPTs/sil-openclaw/blob/main/LICENSE)
6
+ [![license](https://img.shields.io/badge/license-Apache--2.0-8a4b22)](https://github.com/Context4GPTs/sil-openclaw/blob/main/LICENSE)
17
7
  [![npm](https://img.shields.io/npm/v/sil-openclaw?logo=npm&logoColor=white&color=cb3837)](https://www.npmjs.com/package/sil-openclaw)
18
8
  [![ClawHub](https://img.shields.io/badge/ClawHub-sil-6f42c1)](https://clawhub.com)
19
- [![stars](https://img.shields.io/github/stars/Context4GPTs/sil-openclaw?color=f5b700)](https://github.com/Context4GPTs/sil-openclaw)
9
+ [![open beta](https://img.shields.io/badge/status-open%20beta-e09a68)](https://4gpts.com/en/sil)
20
10
  [![last commit](https://img.shields.io/github/last-commit/Context4GPTs/sil-openclaw?color=9333ea)](https://github.com/Context4GPTs/sil-openclaw/commits/main)
21
11
 
22
- **[Website](https://4gpts.com)** · **[Changelog](https://github.com/Context4GPTs/sil-openclaw/blob/main/CHANGELOG.md)** · **[Security](https://github.com/Context4GPTs/sil-openclaw/blob/main/SECURITY.md)** · **[Follow on X](https://x.com/4gpts)**
12
+ **[Website](https://4gpts.com)** · **[Examples](./EXAMPLES.md)** · **[Changelog](./CHANGELOG.md)** · **[Security](./SECURITY.md)** · **[Follow on X](https://x.com/4gpts)**
23
13
 
24
14
  ---
25
15
 
26
16
  ## Install
27
17
 
28
- `sil-openclaw` is the [OpenClaw](https://openclaw.ai) plugin for **sil**. One install and your agent can shop the sil catalog on your behalf.
29
-
30
18
  ```bash
31
- # ClawHub (recommended)
32
- openclaw plugins install clawhub:@4gpts/sil
33
-
34
- # npm
35
- openclaw plugins install sil-openclaw
36
-
37
- # Local checkout (dev / e2e)
38
- openclaw plugins install /path/to/sil-openclaw
19
+ openclaw plugins install clawhub:@4gpts/sil # ClawHub (recommended)
20
+ openclaw plugins install sil-openclaw # npm
21
+ openclaw plugins install /path/to/sil-openclaw # local checkout
39
22
  ```
40
23
 
41
- ### First run
42
-
43
- Two lines and you're shopping:
44
-
45
- ```text
46
- 1. Tell your agent: "register me on sil" (one browser sign-in, done)
47
- 2. Tell your agent: "find me a mechanical keyboard under $100"
48
- ```
49
-
50
- The agent loads the bundled skill on first commerce intent and takes it from there — searching, comparing, pulling up product detail, and handing back ready-to-buy links.
51
-
52
- ---
53
-
54
- ## What sil is
55
-
56
- **A commerce catalog built for agents, not browsers.** That's sil.
57
-
58
- sil is a [UCP](https://github.com/universal-commerce-protocol/ucp) (Universal Commerce Protocol) commerce service, and `sil-openclaw` wires it into your OpenClaw agent — so it can find products, compare prices and availability, pull up full detail, and surface a checkout link the moment you say *buy*. Powered by [4GPTs](https://4gpts.com).
59
-
60
- Today the plugin covers **identity, catalog, and a personal multi-domain shopper**. The rest of the UCP journey (cart, checkout, order, fulfillment) lands as those domains ship, and the same plugin grows with them.
24
+ > [!TIP]
25
+ > Then tell your agent **register me on sil** (one browser sign-in, done) and ask for something:
26
+ > *"I'm getting into espresso. What grinder should I start with?"*
27
+ > The bundled skill takes it from there. More to try in [EXAMPLES.md](./EXAMPLES.md).
61
28
 
62
29
  ---
63
30
 
64
- ## See it in action
31
+ ## Why an interface, not a search box
65
32
 
66
- **You, shopping through your agent — no store, no tabs:**
33
+ An agent that shops for you needs what a knowledgeable friend has: what decides the buy, the products as they are, the craft, the whole market, you, and the honesty to say "I don't know". A search engine gives it pages. A product feed gives it a shelf. SIL gives it the rest.
67
34
 
68
- ```text
69
- you find me a mechanical keyboard under $100, tactile switches
35
+ | Your agent needs | Search engine | Product feed | SIL |
36
+ |---|---|---|---|
37
+ | What decides the buy | — | — | the deciding specs of each kind of thing, with why |
38
+ | Product facts | pages to scrape, each shop's own words | the seller's fields | one record per product, same keys, one unit, read from the makers' and shops' own pages |
39
+ | The craft | ten links | — | guides with their author and source |
40
+ | The shops | whoever ranks, whoever paid | whoever joined | every shop SIL has read: price, delivery to you, returns, promotions, dated. Nobody pays to be first |
41
+ | You | an ad profile | — | your facts and rules, in your account, across agents, never pooled or trained on |
42
+ | What it doesn't know | filled in | silent | met · missed · unknown; "not carried" is an answer |
43
+ | A turn | fetch, parse, normalise, judge | read a shelf | a few typed, paged calls; seconds |
70
44
 
71
- agent searched the sil catalog — 3 strong matches:
72
-
73
- 1. Keychron V3 (Brown) $89 in stock
74
- 2. NuPhy Air75 V2 $99 in stock
75
- 3. Akko 3068B $72 low stock
76
-
77
- want detail on any of these, or a checkout link?
78
-
79
- you tell me about the keychron
80
-
81
- agent Keychron V3 — QMK/VIA, hot-swappable, Brown tactile.
82
- options: ABS / PBT keycaps · US / ISO layout
83
- featured: PBT keycaps, US layout — $89, ships in 2 days
84
- → checkout: sil.4gpts.com/c/kc-v3-pbt-us
85
-
86
- you perfect, send it
87
-
88
- agent done — here's your checkout link, ready to pay:
89
- sil.4gpts.com/c/kc-v3-pbt-us
90
- ```
91
-
92
- > **You said three things. The agent did the shopping** — searched, compared, fetched the detail, and handed you a ready-to-buy link. No browser, no forms, no fourteen open tabs.
45
+ That is **Spec Driven Shopping**: you say what you need, the agent holds every product to it and tells you what meets it, what misses, and where nobody knows.
93
46
 
94
47
  ---
95
48
 
96
- ## Turn your OpenClaw into your personal shopping expert
97
-
98
- So far your *general* agent did the shopping. Go one step further, with **nothing to set up**: install the plugin and the agent you already have shops **any** niche like a specialist, getting sharper about *you* every session.
49
+ ## What a turn looks like
99
50
 
100
- **Spec-Driven Shopping (SDS).** There is no setup step and no interview — just say what you want. The plugin finds the node in sil's **domain graph** for what you're buying and reads the **specs** it is bought along (fit, gearing, geometry, the trade-offs) — what every request there is decomposed into. It decomposes what you asked, **learns your facts and taste as it goes** (your measurements, your budget, a brand you won't touch) — captured once, never re-asked — and recommends with a "why" that cites *what you asked*, *a fact it remembered*, and *a niche mechanic you'd never have named*.
51
+ Whatever you ask to buy, your agent:
101
52
 
102
- **Every niche reads sil's own node, and keeps *you* across all of them:**
53
+ 1. **Knows you first.** Reads what SIL already keeps about you: country, currency, address, your facts and your rules. Nothing you've said is asked twice.
54
+ 2. **Places the ask.** Finds the kind of thing you're buying and how it is bought: which specs decide it, and why. It asks you only what decides.
55
+ 3. **Teaches while it asks.** Pulls the guide passage behind the trade-off, with its author and source, so you learn the thing as you buy it.
56
+ 4. **Gets all the facts, and what's missing.** Searches with every want as a spec. Every product comes back held to your asks, and a blank stays a blank:
103
57
 
104
- ```text
105
- you find me a road bike, ~€1500
106
-
107
- agent [shopping_domain_search "road bike" → shopping_domain_get]
108
- Road bikes are bought on fit from height AND inseam, endurance
109
- vs race geometry, and gearing. Two numbers I'll keep so I never
110
- re-ask: your height and inseam.
111
-
112
- you 178cm, 81cm inseam. Secondhand is fine
113
-
114
- agent searched sil — endurance, 54cm for your fit, ~€1500:
115
-
116
- 1. Alloy endurance bike, 54cm, 105 (used) €1420
117
- 2. Carbon endurance bike, 54cm, 105 (used) €1610
118
-
119
- Why #1: for your 178/81 fit a 54cm endurance frame sits where a
120
- first buyer wants it — and it honours your "free returns only"
121
- rule. Want detail or a link?
122
-
123
- you later — find me a backpacking tent for two, under €250
124
-
125
- agent [shopping_domain_search "backpacking tent" → shopping_domain_get]
126
- Tents are bought on season rating, packed weight and floor
127
- area… and your returns rule carries straight over.
128
- ```
58
+ ```diff
59
+ + 1Zpresso K-Ultra espresso and pour-over · 20 µm steps · 0.7 kg meets all
60
+ - 1Zpresso J-Ultra espresso only · 8 µm steps · 0.67 kg misses pour-over
61
+ # 1Zpresso ZP6 pour-over only · 48 mm burrs step size unknown
62
+ ```
129
63
 
130
- > **You teach it once; it stays sharp.** How a thing is bought comes from sil's domain graph, the same for every agent, and your own facts, taste and shopping jobs belong to your sil account rather than to one agent. Nothing to re-answer, and sharper every session.
64
+ 5. **Shows the whole market.** For the pick, every shop SIL has read: price in its currency, delivery to your address, returns, the shop's own promotions, and the day it was read. Re-read before you buy.
65
+ 6. **Says why.** At the shortlist, the pick and the offer: what you asked, what it remembered about you, and the mechanic of the thing you'd never have named.
66
+ 7. **Keeps what matters.** A measurement, a rule, a brand you won't buy, a buy that takes days: kept in your SIL account for next time, on your word. *"Forget that"* undoes it.
67
+ 8. **Hands you the shop's own page.** SIL has no checkout of its own. You buy where the shop sells.
131
68
 
132
- **What it keeps on your machine: nothing of yours.** The plugin stores your sil credentials and its own configuration under `$SIL_DATA_DIR` (owner-only `0600`) and nothing else — no notes about you, no shopping jobs, no measurements. A shopping call reads that credential, rewrites it when sil refreshes it, and deletes it when the session is past refreshing. What your agent learns about you lives in your sil account, is **never pooled across users**, and is never used for training or aggregation. If an earlier version left a `shopper/` folder under that directory, nothing reads it any more and you can delete it.
69
+ **Sil Studio**, the screen beside your agent that shows what it found, is in closed beta: ask for a place with *Join the SIL beta* on [4gpts.com](https://4gpts.com/en/sil).
133
70
 
134
71
  ---
135
72
 
@@ -161,13 +98,13 @@ for you; you just say what you want.
161
98
 
162
99
  | Tool | What it does |
163
100
  |---|---|
164
- | `shopping_domain_search` | Say what the thing is called, in your own words, and get back up to three leaves (buyable kinds of thing), best first: each with its name, which of sil's words matched, and `under` — the places above it. Empty when nothing fits, or when the best fit is an area sil does not carry yet. |
165
- | `shopping_content` | Grep sil's own documents on the line through a node — the node, its kinds, beneath it and above it — by words, never by meaning. Answers whole passages within a token budget, every-word matches first, each with the words it matched; filled passages carry none. |
166
- | `shopping_domain_get` | Read a leaf's specs, in pages when it is wide (`keys` reads chosen ones whole, `after` reads on): every key it is bought by with the operators, unit and allowed values each takes, plus its kinds, parts and how its products are bought (`record`). On a kind it also lists its `leaves`. A shelf or domain is refused as `not_a_leaf`; an area sil does not carry yet as `not_carried`. |
167
- | `shopping_search` | Search a leaf, or the kind above its leaves, on every want the buyer settled: each a spec with the operator it needs, words only for what no spec holds. No brief or earlier call is needed. Products come back in sil's order with `fit` (what sil verified, or `unknown`), and every search answers sil's receipt: shops and products weighed, how many fit, how many it could not tell, and what was set aside and why. |
168
- | `shopping_product_get` | Open the whole of what sil holds on up to three shortlisted variants (or one product's whole page): the description, the images, every key sil holds, and where each reading came from and when. |
169
- | `shopping_offers` | Who sells it, at what price and on what terms: send 1–10 picked variant ids or a product's `name` for a price check, optionally the `seller_specs` the buyer settled and a `brief` id. Each offer comes back with the seller, the price in its own currency, availability, the listing URL, when sil read it, and `seller_fit` — whether that seller ships to your default address (`serviceable`, `not_serviceable` or `unknown`) and its value for each seller spec asked. Shops in your currency and market come first. |
170
- | `shopping_seller_get` | One seller's whole terms, for 1–10 of them: `specs` (every seller key sil holds a value for), whether it ships to you, and the shipping routes and return terms sil has read. `unknown` keeps the seller; it just means sil has not read that policy. |
101
+ | `shopping_domain_search` | Say what the thing is called, in English, and get back up to three leaves (buyable kinds of thing), each its `path` and `name`. Empty when sil holds no such leaf. |
102
+ | `shopping_content` | The passages sil holds that bear on what you said, read on the line through a place — the place, its kinds, beneath it and above it — by words, within a token budget. Each is one shape: kind, title, author, text, url, date. |
103
+ | `shopping_domain_get` | How to search a leaf, or the kind above its leaves: send what you want and a word for each spec you are after, and get the place's `name` and one line per spec a search takes — `spec`, `type`, `unit`, `values`, `operators`, and on a spec that decides the buy `decides` with its `why` — the `reached` lines your words reach first, then the most held, a page at a time (`page` reads on). A shelf or domain is refused as `not_a_leaf`; an area sil does not carry yet as `not_carried`. |
104
+ | `shopping_search` | Search a leaf, or the kind above its leaves, on every want settled — specs, a `price` range, words only for what no spec holds. Answers the ask numbered (`asked`), how many products and shops were weighed and how many hold every ask (`search_stats`), and product cards in sil's order: title, brand, up to five pictures, `holds` · `misses` · `unknown` as ask numbers, the price range, how many shops sell it, and its variants with one `recommended`. Money is an integer in the currency's minor unit: €130 is 13000. |
105
+ | `shopping_product_get` | Up to three products whole: the values their variants share, once; the page's description, pros and cons; reviews; and each variant with what sets it apart, the range its offers are priced over and its pictures. Pick the variants to buy here. |
106
+ | `shopping_offers` | Every offer of 1–10 picked variants: the shop by name, whether it ships to you, its delivery there, its returns window and its own promotions; the price in its own currency, a struck price, availability, a plan or bundle where it is one, the listing URL and the day sil read it. Shops reaching you first, cheapest first; nothing marks a best. A long list ends with `next_page` (`page` reads on). |
107
+ | `shopping_seller_get` | The shops whole, for 1–10 of them: the delivery, returns and promotions the offers carry, and warranty, every other term sil holds, policy links and reviews; `page` reads on. |
171
108
 
172
109
  **The wire is a contract, not a convention.** Each shopping tool's input schema IS the
173
110
  artifact under [`schema/`](./schema), copied verbatim from sil-services, and each answer
@@ -179,7 +116,7 @@ is the API's own 200 body handed over untouched.
179
116
 
180
117
  The plugin ships one bundled skill — **`sil-shopping`** 🛒 — that your agent loads automatically the first time you express a shopping intent. You don't invoke it; it's the playbook that makes the tools work well together:
181
118
 
182
- - **Routes intent to the right tool.** *"find me a keyboard"* → `shopping_search`, *"what does it cost?"* → `shopping_offers`, *"will it reach me?"* → `shopping_seller_get`, *"what was I shopping for?"* → `shopping_brief_read`, *"who am I?"* → `sil_whoami`, *"sign me up"* → `sil_register`.
119
+ - **Routes intent to the right tool.** *"find me a keyboard"* → `shopping_search`, *"what does it cost?"* → `shopping_offers`, *"what's the warranty?"* → `shopping_seller_get`, *"what was I shopping for?"* → `shopping_brief_read`, *"who am I?"* → `sil_whoami`, *"sign me up"* → `sil_register`.
183
120
  - **Many niches, with no preparation.** A shopping intent runs the loop on whatever agent holds the plugin: it finds the place sil shelves what you're buying (`shopping_domain_search`), reads the specs it is bought along (`shopping_domain_get`), and decomposes every request along them — learning your facts and taste as it goes.
184
121
  - **Recovers the right way.** Every tool reports a status; the skill follows that tool's own recovery hint — re-register, fix the query, or retry — instead of guessing a fix that won't work.
185
122
  - **Keeps prices honest.** A price is dated only where sil dated it, so the skill re-reads an item's offers right before you buy and quotes the moment they were read.
package/SECURITY.md CHANGED
@@ -68,9 +68,12 @@ tools.
68
68
 
69
69
  ### Gateway method
70
70
 
71
- `sil.search_results` (scope `operator.read`, authorized by the host before the
72
- handler runs) lets a paired client read back a `shopping_search` page by the
73
- `callId` it saw. Pages live in an in-memory buffer: at most 32 of them, each
74
- dropped 15 minutes after its search, never written to disk. A page is served only
75
- to the sil account that produced it. An unknown, expired or foreign reference gets
76
- one identical not-found body. No network call, no agent run.
71
+ Two methods, scope `operator.read`, authorized by the host before the handler runs.
72
+ `sil.answer` lets a paired screen read back any sil answer the agent got, by the
73
+ `callId` it saw. Answers live in an in-memory buffer: at most 64, each dropped 15
74
+ minutes after its call, never written to disk, served only to the sil account that
75
+ produced it. `sil.call` runs one read — products, offers, shops, a domain, content,
76
+ what sil keeps — or a forget of the rows it names, never everything, as the
77
+ signed-in buyer, recorded by sil as the buyer's own (`studio/buyer`). An unknown,
78
+ expired or foreign reference, and a signed-out plugin, get one identical
79
+ not-found body.
@@ -0,0 +1,15 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="880" height="230" viewBox="0 0 880 230" role="img" aria-label="SIL. Shop like you code.">
2
+ <rect width="880" height="230" rx="10" fill="#1c1714"/>
3
+ <g font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', monospace" font-size="21" fill="#e09a68" xml:space="preserve">
4
+ <text x="44" y="60">███████╗██╗██╗</text>
5
+ <text x="44" y="84">██╔════╝██║██║</text>
6
+ <text x="44" y="108">███████╗██║██║</text>
7
+ <text x="44" y="132">╚════██║██║██║</text>
8
+ <text x="44" y="156">███████║██║███████╗</text>
9
+ <text x="44" y="180">╚══════╝╚═╝╚══════╝</text>
10
+ </g>
11
+ <text x="340" y="104" font-family="Georgia, 'Times New Roman', serif" font-style="italic" font-size="42" fill="#efe6de">Shop like you code.</text>
12
+ <text x="342" y="142" font-family="-apple-system, 'Segoe UI', Helvetica, Arial, sans-serif" font-size="19" fill="#ad9c90">The Shopping Interface Layer for personal AI agents</text>
13
+ <rect x="342" y="162" width="92" height="26" rx="4" fill="none" stroke="#e09a68"/>
14
+ <text x="388" y="180" text-anchor="middle" font-family="ui-monospace, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#e09a68">OPEN BETA</text>
15
+ </svg>
@@ -0,0 +1,15 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="880" height="230" viewBox="0 0 880 230" role="img" aria-label="SIL. Shop like you code.">
2
+ <rect width="880" height="230" rx="10" fill="#fbf8f5"/>
3
+ <g font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', monospace" font-size="21" fill="#8a4b22" xml:space="preserve">
4
+ <text x="44" y="60">███████╗██╗██╗</text>
5
+ <text x="44" y="84">██╔════╝██║██║</text>
6
+ <text x="44" y="108">███████╗██║██║</text>
7
+ <text x="44" y="132">╚════██║██║██║</text>
8
+ <text x="44" y="156">███████║██║███████╗</text>
9
+ <text x="44" y="180">╚══════╝╚═╝╚══════╝</text>
10
+ </g>
11
+ <text x="340" y="104" font-family="Georgia, 'Times New Roman', serif" font-style="italic" font-size="42" fill="#2a211c">Shop like you code.</text>
12
+ <text x="342" y="142" font-family="-apple-system, 'Segoe UI', Helvetica, Arial, sans-serif" font-size="19" fill="#76665c">The Shopping Interface Layer for personal AI agents</text>
13
+ <rect x="342" y="162" width="92" height="26" rx="4" fill="none" stroke="#8a4b22"/>
14
+ <text x="388" y="180" text-anchor="middle" font-family="ui-monospace, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#8a4b22">OPEN BETA</text>
15
+ </svg>
@@ -0,0 +1,174 @@
1
+ /**
2
+ * What the plugin answers a paired screen (contract §4): `sil.answer` reads back an answer
3
+ * the agent got; `sil.call` runs a read or a forget as the signed-in buyer. Not tools: they
4
+ * never reach the model. The host checks `operator.read` before either handler runs; the
5
+ * plugin checks the one thing it cannot — that the sil account signed in owns the answer.
6
+ */
7
+ import { randomUUID } from "node:crypto";
8
+ import { latestSession, readAnswer, signedInPrincipal } from "../lib/answers.js";
9
+ import { readHostVersion } from "../lib/host-wiring.js";
10
+ import { logScreen } from "../lib/screen-log.js";
11
+ import { callRoute } from "../lib/shopping-call.js";
12
+ import { readInstalledVersion } from "../lib/version-advisory.js";
13
+ import { SHOPPING_TOOLS } from "../tools/catalog.js";
14
+ export const ANSWER_METHOD = "sil.answer";
15
+ export const CALL_METHOD = "sil.call";
16
+ /** Unknown ≡ expired ≡ another account's ≡ signed out: one body, and never a method error,
17
+ * which a screen reads as a transport fault and retries forever. */
18
+ const NOT_FOUND = {
19
+ status: "not_found",
20
+ message: "Nothing to show for this: ask the agent again.",
21
+ };
22
+ const SCREEN_TOOLS = new Set([
23
+ "shopping_product_get",
24
+ "shopping_offers",
25
+ "shopping_seller_get",
26
+ "shopping_domain_get",
27
+ "shopping_content",
28
+ "shopping_user_read",
29
+ "shopping_user_forget",
30
+ ]);
31
+ /** sil reads three products an answer; a screen's Compare asks for up to ten. */
32
+ const PRODUCT_IDS_MAX = 10;
33
+ const PRODUCT_IDS_PER_READ = 3;
34
+ /** sil's record tells the buyer's taps from the agent's calls by this model. */
35
+ const SCREEN_MODEL = "studio/buyer";
36
+ /** sil-api's rules for `sil-tool-call-id` and `sil-session-id`. */
37
+ const REQUEST_ID = /^[\x21-\x7E]{1,256}$/;
38
+ const SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
39
+ /** Refusals whose recovery is signing in again: on a screen that is signed out. */
40
+ const SIGNED_OUT = new Set([
41
+ "not_registered",
42
+ "must_reregister",
43
+ "forbidden",
44
+ ]);
45
+ export function registerScreenMethods(api) {
46
+ const openclawVersion = readHostVersion(api);
47
+ const run = {
48
+ pluginVersion: readInstalledVersion(),
49
+ ...(openclawVersion !== null ? { openclawVersion } : {}),
50
+ };
51
+ api.registerGatewayMethod(ANSWER_METHOD, ({ params, respond }) => guarded(api, respond, () => answer(api, params, respond)), { scope: "operator.read" });
52
+ api.registerGatewayMethod(CALL_METHOD, ({ params, respond }) => guarded(api, respond, () => call(api, run, params, respond)), { scope: "operator.read" });
53
+ }
54
+ async function guarded(api, respond, handle) {
55
+ try {
56
+ await handle();
57
+ }
58
+ catch (err) {
59
+ logScreen(api, "error", "failed", {
60
+ error_type: err instanceof Error ? err.name : typeof err,
61
+ cause: err instanceof Error ? err.message : String(err),
62
+ stack: err instanceof Error ? (err.stack ?? "") : "",
63
+ });
64
+ respond(true, NOT_FOUND);
65
+ }
66
+ }
67
+ function answer(api, params, respond) {
68
+ const callId = params["callId"];
69
+ if (typeof callId !== "string" || callId.length === 0) {
70
+ invalid(api, respond, "sil.answer takes a non-empty string `callId`.");
71
+ return;
72
+ }
73
+ const principal = signedInPrincipal();
74
+ const read = principal === undefined ? { miss: "no_principal" } : readAnswer(callId, principal);
75
+ if ("miss" in read) {
76
+ logScreen(api, "info", "answer_miss", { callId, reason: read.miss });
77
+ respond(true, NOT_FOUND);
78
+ return;
79
+ }
80
+ logScreen(api, "info", "answer_hit", { callId });
81
+ respond(true, read.body);
82
+ }
83
+ async function call(api, run, params, respond) {
84
+ const parsed = parseCall(params);
85
+ if ("invalid" in parsed) {
86
+ invalid(api, respond, parsed.invalid);
87
+ return;
88
+ }
89
+ const { tool, reads, requestId } = parsed;
90
+ const principal = signedInPrincipal();
91
+ if (principal === undefined) {
92
+ logScreen(api, "info", "call_refused", { requestId, tool: tool.name, reason: "no_principal" });
93
+ respond(true, NOT_FOUND);
94
+ return;
95
+ }
96
+ // sil-api requires a conversation UUID: the one the screen shows, else the one the agent
97
+ // last answered in, else the screen's own.
98
+ const caller = {
99
+ ...run,
100
+ toolCallId: requestId,
101
+ model: SCREEN_MODEL,
102
+ sessionId: parsed.sessionId ?? latestSession(principal) ?? randomUUID(),
103
+ };
104
+ const answered = await readAll(api, tool, reads, caller);
105
+ if (answered.kind === "refused") {
106
+ const { status } = answered.body;
107
+ logScreen(api, "info", "call_refused", { requestId, tool: tool.name, reason: status });
108
+ respond(true, SIGNED_OUT.has(status) ? NOT_FOUND : answered.body);
109
+ return;
110
+ }
111
+ logScreen(api, "info", "call_answered", { requestId, tool: tool.name, reads: reads.length });
112
+ respond(true, answered.body);
113
+ }
114
+ function parseCall(params) {
115
+ const { tool: name, args, requestId, sessionId } = params;
116
+ const tool = SHOPPING_TOOLS.find((t) => t.name === name && SCREEN_TOOLS.has(t.name));
117
+ if (tool === undefined)
118
+ return { invalid: `sil.call runs only ${[...SCREEN_TOOLS].join(", ")}.` };
119
+ if (args === null || typeof args !== "object" || Array.isArray(args)) {
120
+ return { invalid: "sil.call takes `args`, the tool's arguments as an object." };
121
+ }
122
+ if (typeof requestId !== "string" || !REQUEST_ID.test(requestId)) {
123
+ return { invalid: "sil.call takes `requestId`, 1–256 printable characters, no spaces." };
124
+ }
125
+ if (sessionId !== undefined && (typeof sessionId !== "string" || !SESSION_ID.test(sessionId))) {
126
+ return { invalid: "sil.call takes `sessionId`, when sent, as a UUID." };
127
+ }
128
+ const body = args;
129
+ // A tap erases the rows it names; everything goes only on the buyer's word to the agent.
130
+ if (tool.name === "shopping_user_forget" && !namesRowsOnly(body)) {
131
+ return { invalid: "shopping_user_forget from a screen takes `ids` only." };
132
+ }
133
+ const reads = tool.name === "shopping_product_get" ? productReads(body) : [body];
134
+ if (reads === null) {
135
+ return { invalid: `shopping_product_get takes \`ids\`, 1–${PRODUCT_IDS_MAX} strings.` };
136
+ }
137
+ return { tool, reads, requestId, sessionId };
138
+ }
139
+ function namesRowsOnly(args) {
140
+ const ids = args["ids"];
141
+ return Object.keys(args).length === 1 && Array.isArray(ids) && ids.length > 0;
142
+ }
143
+ /** The reads at once — the refresh they may share is single-flight — the product reads'
144
+ * `products` joined in order, and the first refusal answering for all. */
145
+ async function readAll(api, tool, reads, caller) {
146
+ if (reads.length === 1)
147
+ return callRoute(api, tool, reads[0] ?? {}, caller);
148
+ const called = await Promise.all(reads.map((read) => callRoute(api, tool, read, caller)));
149
+ const refused = called.find((c) => c.kind === "refused");
150
+ if (refused !== undefined)
151
+ return refused;
152
+ const products = called.flatMap((c) => {
153
+ const page = c.body["products"];
154
+ return Array.isArray(page) ? page : [];
155
+ });
156
+ return { kind: "ok", body: { status: "ok", products } };
157
+ }
158
+ /** The ids cut into the threes sil reads, or null when they are not 1–10 strings. */
159
+ function productReads(args) {
160
+ const ids = args["ids"];
161
+ if (!Array.isArray(ids) || ids.length === 0 || ids.length > PRODUCT_IDS_MAX)
162
+ return null;
163
+ if (!ids.every((id) => typeof id === "string" && id.length > 0))
164
+ return null;
165
+ const reads = [];
166
+ for (let at = 0; at < ids.length; at += PRODUCT_IDS_PER_READ) {
167
+ reads.push({ ...args, ids: ids.slice(at, at + PRODUCT_IDS_PER_READ) });
168
+ }
169
+ return reads;
170
+ }
171
+ function invalid(api, respond, message) {
172
+ logScreen(api, "info", "invalid", { message });
173
+ respond(true, { status: "invalid_request", message });
174
+ }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * sil OpenClaw plugin — entry point.
3
3
  *
4
4
  * A UCP commerce plugin for sil. It registers its real tool groups — the account
5
- * tools (`sil_register`, `sil_whoami`, `sil_doctor`) and the ten `shopping_*`
5
+ * tools (`sil_register`, `sil_whoami`, `sil_doctor`) and the twelve `shopping_*`
6
6
  * catalog tools — so they load in an OpenClaw host.
7
7
  * There is no transport, no persistent service, and no background work at
8
8
  * register time — `register()` is strictly synchronous and opens nothing.
@@ -26,7 +26,7 @@
26
26
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
27
27
  import { applyPluginConfigOverrides, getWebUrl, getWebUrlSource, getApiUrl, getApiUrlSource, } from "./lib/config.js";
28
28
  import { ensureDataDir, getDataDir } from "./lib/credentials.js";
29
- import { registerSearchResultsMethod } from "./gateway/search-results.js";
29
+ import { registerScreenMethods } from "./gateway/screen.js";
30
30
  import { detectWiringDrift, readSilWiringFacts } from "./lib/host-wiring.js";
31
31
  import { registerCatalogTools } from "./tools/catalog.js";
32
32
  import { registerDoctorTools } from "./tools/doctor.js";
@@ -69,13 +69,9 @@ export default definePluginEntry({
69
69
  registerIdentityTools(api);
70
70
  registerCatalogTools(api);
71
71
  registerDoctorTools(api);
72
- // The pull surface a paired client resolves a search page from. Registering
73
- // a closure opens nothing — no socket, no timer — so the invariant above
74
- // holds; the store behind it is touched only inside the handler and inside
75
- // shopping_search's execute(). NOT a tool and NOT a `registerXTools` group: it
76
- // never reaches the model, and the manifest's `contracts` vocabulary has no
77
- // gateway-method key, so this call IS the declaration.
78
- registerSearchResultsMethod(api);
72
+ // Not tools, and not manifest-declarable: registration is the declaration. Registering
73
+ // a closure opens nothing, so the invariant above holds.
74
+ registerScreenMethods(api);
79
75
  // Host-wiring drift, at the ONE surface that survives it.
80
76
  //
81
77
  // `tools.alsoAllow` is GLOBAL, so the state where sil's tools are filtered