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
@@ -5,7 +5,7 @@
5
5
  "type": "object",
6
6
  "required": [
7
7
  "status",
8
- "variants"
8
+ "products"
9
9
  ],
10
10
  "properties": {
11
11
  "status": {
@@ -13,211 +13,415 @@
13
13
  "const": "ok",
14
14
  "description": "Reads the answer. Every other status arrives as an error body carrying recovery."
15
15
  },
16
- "variants": {
16
+ "products": {
17
17
  "type": "array",
18
18
  "items": {
19
19
  "type": "object",
20
20
  "required": [
21
21
  "id",
22
22
  "title",
23
+ "leaf",
23
24
  "images",
24
- "specs",
25
- "sources"
25
+ "values",
26
+ "reviews",
27
+ "variants"
26
28
  ],
27
29
  "properties": {
28
30
  "id": {
29
31
  "type": "string",
30
32
  "minLength": 1,
31
33
  "maxLength": 256,
32
- "description": "Matches the entry to the id asked for."
34
+ "description": "Names the product."
33
35
  },
34
36
  "title": {
35
37
  "type": "string",
36
- "description": "Tells the buyer what it is."
38
+ "description": "Names the product."
37
39
  },
38
40
  "brand": {
39
41
  "type": "string",
40
- "description": "Names the maker."
42
+ "description": "Names the brand it is sold under."
41
43
  },
42
- "description": {
44
+ "maker": {
45
+ "type": "string",
46
+ "description": "Names who makes it; `OEM` where the page names no one."
47
+ },
48
+ "leaf": {
43
49
  "type": "string",
44
- "maxLength": 1000,
45
- "description": "Quotes the page's own description, cut at a word where it is long."
50
+ "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
51
+ "maxLength": 255,
52
+ "description": "Reads what kind of thing it is."
46
53
  },
47
54
  "images": {
48
55
  "type": "array",
49
56
  "items": {
50
57
  "type": "string"
51
58
  },
52
- "maxItems": 5,
53
- "description": "Shows it."
59
+ "description": "Shows it: every picture sil holds, each variant’s own by position."
54
60
  },
55
- "specs": {
61
+ "values": {
56
62
  "type": "object",
57
63
  "patternProperties": {
58
64
  "^.*$": {
59
65
  "anyOf": [
60
66
  {
61
- "type": "number"
62
- },
63
- {
64
- "type": "boolean"
65
- },
66
- {
67
- "type": "string"
67
+ "anyOf": [
68
+ {
69
+ "anyOf": [
70
+ {
71
+ "type": "number"
72
+ },
73
+ {
74
+ "type": "boolean"
75
+ },
76
+ {
77
+ "type": "string"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "type": "object",
83
+ "required": [
84
+ "min",
85
+ "max"
86
+ ],
87
+ "properties": {
88
+ "min": {
89
+ "type": "number",
90
+ "description": "Reads the low end."
91
+ },
92
+ "max": {
93
+ "type": "number",
94
+ "description": "Reads the high end."
95
+ }
96
+ },
97
+ "additionalProperties": false,
98
+ "description": "A range, in the key’s unit."
99
+ },
100
+ {
101
+ "type": "object",
102
+ "patternProperties": {
103
+ "^.*$": {
104
+ "anyOf": [
105
+ {
106
+ "type": "number"
107
+ },
108
+ {
109
+ "type": "boolean"
110
+ },
111
+ {
112
+ "type": "string"
113
+ }
114
+ ]
115
+ }
116
+ },
117
+ "description": "One entry of a `records` key."
118
+ }
119
+ ]
68
120
  },
69
121
  {
70
122
  "type": "array",
71
123
  "items": {
72
- "type": "string"
124
+ "anyOf": [
125
+ {
126
+ "anyOf": [
127
+ {
128
+ "type": "number"
129
+ },
130
+ {
131
+ "type": "boolean"
132
+ },
133
+ {
134
+ "type": "string"
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ "type": "object",
140
+ "required": [
141
+ "min",
142
+ "max"
143
+ ],
144
+ "properties": {
145
+ "min": {
146
+ "type": "number",
147
+ "description": "Reads the low end."
148
+ },
149
+ "max": {
150
+ "type": "number",
151
+ "description": "Reads the high end."
152
+ }
153
+ },
154
+ "additionalProperties": false,
155
+ "description": "A range, in the key’s unit."
156
+ },
157
+ {
158
+ "type": "object",
159
+ "patternProperties": {
160
+ "^.*$": {
161
+ "anyOf": [
162
+ {
163
+ "type": "number"
164
+ },
165
+ {
166
+ "type": "boolean"
167
+ },
168
+ {
169
+ "type": "string"
170
+ }
171
+ ]
172
+ }
173
+ },
174
+ "description": "One entry of a `records` key."
175
+ }
176
+ ]
73
177
  }
74
178
  }
75
179
  ]
76
180
  }
77
181
  },
78
- "description": "Compares on every key sil holds."
182
+ "description": "Reads every value its variants share, once, keyed as the search takes them."
183
+ },
184
+ "description": {
185
+ "type": "string",
186
+ "description": "Reads the page’s own words about it."
187
+ },
188
+ "pros": {
189
+ "type": "string",
190
+ "description": "Reads what the page praises."
191
+ },
192
+ "cons": {
193
+ "type": "string",
194
+ "description": "Reads what the page warns of."
195
+ },
196
+ "persona": {
197
+ "type": "string",
198
+ "description": "Reads who the page says it is for."
79
199
  },
80
- "sources": {
200
+ "reviews": {
81
201
  "type": "array",
82
202
  "items": {
83
203
  "type": "object",
84
204
  "required": [
85
- "host",
86
- "read_at"
205
+ "source",
206
+ "url",
207
+ "score",
208
+ "of",
209
+ "count"
87
210
  ],
88
211
  "properties": {
89
- "host": {
212
+ "source": {
90
213
  "type": "string",
91
- "description": "Says which site sil read."
214
+ "description": "Names the site that gathered the reviews."
92
215
  },
93
- "read_at": {
216
+ "url": {
94
217
  "type": "string",
95
- "format": "date-time",
96
- "description": "Says when sil read it."
218
+ "description": "Hands the buyer the reviews."
219
+ },
220
+ "score": {
221
+ "type": "number",
222
+ "minimum": 0,
223
+ "description": "Quotes the score as that site gives it."
224
+ },
225
+ "of": {
226
+ "type": "number",
227
+ "exclusiveMinimum": 0,
228
+ "description": "Reads the scale’s top: 5, 10, 100."
229
+ },
230
+ "count": {
231
+ "type": "integer",
232
+ "minimum": 0,
233
+ "description": "Says how many reviews the score rests on."
97
234
  }
98
235
  },
99
236
  "additionalProperties": false
100
237
  },
101
- "description": "Says where and when sil read them."
238
+ "description": "Gives scores from sources the shops do not control; empty until sil reads one."
102
239
  },
103
- "reviews": {
104
- "type": "object",
105
- "required": [
106
- "count",
107
- "praised",
108
- "complained",
109
- "sources"
110
- ],
111
- "properties": {
112
- "count": {
113
- "type": "integer",
114
- "minimum": 1,
115
- "description": "Says how many reviews sil read."
116
- },
117
- "score": {
118
- "type": "object",
119
- "required": [
120
- "value",
121
- "of"
122
- ],
123
- "properties": {
124
- "value": {
125
- "type": "number",
126
- "minimum": 0,
127
- "description": "The average score."
128
- },
129
- "of": {
130
- "type": "number",
131
- "exclusiveMinimum": 0,
132
- "description": "The scale’s top: 5, 10, 100."
133
- }
134
- },
135
- "additionalProperties": false,
136
- "description": "Says the average score on its own scale, where the reviews give one."
137
- },
138
- "praised": {
139
- "type": "array",
140
- "items": {
240
+ "variants": {
241
+ "type": "array",
242
+ "items": {
243
+ "type": "object",
244
+ "required": [
245
+ "id",
246
+ "values",
247
+ "images"
248
+ ],
249
+ "properties": {
250
+ "id": {
141
251
  "type": "string",
142
252
  "minLength": 1,
143
253
  "maxLength": 256,
144
- "description": "One thing reviewers praise."
254
+ "description": "Passes it to `shopping_offers`."
145
255
  },
146
- "maxItems": 5,
147
- "description": "Says what reviewers praise, most often first."
148
- },
149
- "complained": {
150
- "type": "array",
151
- "items": {
152
- "type": "string",
153
- "minLength": 1,
154
- "maxLength": 256,
155
- "description": "One thing reviewers complain of."
256
+ "values": {
257
+ "type": "object",
258
+ "patternProperties": {
259
+ "^.*$": {
260
+ "anyOf": [
261
+ {
262
+ "anyOf": [
263
+ {
264
+ "anyOf": [
265
+ {
266
+ "type": "number"
267
+ },
268
+ {
269
+ "type": "boolean"
270
+ },
271
+ {
272
+ "type": "string"
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "type": "object",
278
+ "required": [
279
+ "min",
280
+ "max"
281
+ ],
282
+ "properties": {
283
+ "min": {
284
+ "type": "number",
285
+ "description": "Reads the low end."
286
+ },
287
+ "max": {
288
+ "type": "number",
289
+ "description": "Reads the high end."
290
+ }
291
+ },
292
+ "additionalProperties": false,
293
+ "description": "A range, in the key’s unit."
294
+ },
295
+ {
296
+ "type": "object",
297
+ "patternProperties": {
298
+ "^.*$": {
299
+ "anyOf": [
300
+ {
301
+ "type": "number"
302
+ },
303
+ {
304
+ "type": "boolean"
305
+ },
306
+ {
307
+ "type": "string"
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ "description": "One entry of a `records` key."
313
+ }
314
+ ]
315
+ },
316
+ {
317
+ "type": "array",
318
+ "items": {
319
+ "anyOf": [
320
+ {
321
+ "anyOf": [
322
+ {
323
+ "type": "number"
324
+ },
325
+ {
326
+ "type": "boolean"
327
+ },
328
+ {
329
+ "type": "string"
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "type": "object",
335
+ "required": [
336
+ "min",
337
+ "max"
338
+ ],
339
+ "properties": {
340
+ "min": {
341
+ "type": "number",
342
+ "description": "Reads the low end."
343
+ },
344
+ "max": {
345
+ "type": "number",
346
+ "description": "Reads the high end."
347
+ }
348
+ },
349
+ "additionalProperties": false,
350
+ "description": "A range, in the key’s unit."
351
+ },
352
+ {
353
+ "type": "object",
354
+ "patternProperties": {
355
+ "^.*$": {
356
+ "anyOf": [
357
+ {
358
+ "type": "number"
359
+ },
360
+ {
361
+ "type": "boolean"
362
+ },
363
+ {
364
+ "type": "string"
365
+ }
366
+ ]
367
+ }
368
+ },
369
+ "description": "One entry of a `records` key."
370
+ }
371
+ ]
372
+ }
373
+ }
374
+ ]
375
+ }
376
+ },
377
+ "description": "Reads what sets this variant apart from the product’s others; empty where it is the only one."
156
378
  },
157
- "maxItems": 5,
158
- "description": "Says what reviewers complain of, most often first."
159
- },
160
- "sources": {
161
- "type": "array",
162
- "items": {
379
+ "price_range": {
163
380
  "type": "object",
164
381
  "required": [
165
- "name",
166
- "url",
167
- "date"
382
+ "currency"
168
383
  ],
169
384
  "properties": {
170
- "name": {
171
- "type": "string",
172
- "description": "Names the site or reviewer."
385
+ "min": {
386
+ "type": "integer",
387
+ "minimum": 0,
388
+ "maximum": 9007199254740991,
389
+ "description": "The low end, in the minor unit."
173
390
  },
174
- "url": {
175
- "type": "string",
176
- "description": "Hands the buyer the reviews."
391
+ "max": {
392
+ "type": "integer",
393
+ "minimum": 0,
394
+ "maximum": 9007199254740991,
395
+ "description": "The high end, in the minor unit."
177
396
  },
178
- "date": {
397
+ "currency": {
179
398
  "type": "string",
180
- "format": "date",
181
- "description": "Dates the latest review read there."
399
+ "pattern": "^[A-Z]{3}$",
400
+ "minLength": 3,
401
+ "maxLength": 3,
402
+ "description": "Both ends in this currency; sil converts nothing."
182
403
  }
183
404
  },
184
- "additionalProperties": false
405
+ "additionalProperties": false,
406
+ "description": "Quotes its offers’ one-off prices, cheapest to dearest, in one currency; absent where none is buyable in it."
185
407
  },
186
- "minItems": 1,
187
- "maxItems": 5,
188
- "description": "Cites where, and how recent."
189
- }
408
+ "images": {
409
+ "type": "array",
410
+ "items": {
411
+ "type": "integer",
412
+ "minimum": 0
413
+ },
414
+ "description": "Shows its own pictures: positions in the product’s `images`, first its best."
415
+ }
416
+ },
417
+ "additionalProperties": false
190
418
  },
191
- "additionalProperties": false,
192
- "description": "Tells the buyer what other buyers said, from the reviews sil holds; absent until it holds any."
419
+ "description": "Lists every variant: pick the ones to buy, then read their offers."
193
420
  }
194
421
  },
195
422
  "additionalProperties": false
196
423
  },
197
424
  "description": "Reads the whole before recommending."
198
- },
199
- "not_held": {
200
- "type": "array",
201
- "items": {
202
- "type": "object",
203
- "required": [
204
- "id",
205
- "reason"
206
- ],
207
- "properties": {
208
- "id": {
209
- "type": "string",
210
- "description": "Echoes the id asked for."
211
- },
212
- "reason": {
213
- "type": "string",
214
- "description": "Says why sil has no dossier, and what to do instead."
215
- }
216
- },
217
- "additionalProperties": false
218
- },
219
- "minItems": 1,
220
- "description": "Names each id sil holds no product for; the agent says so and searches."
221
425
  }
222
426
  },
223
427
  "additionalProperties": false
@@ -4,31 +4,30 @@
4
4
  "title": "sil shopping_search — request",
5
5
  "type": "object",
6
6
  "required": [
7
- "domain",
8
- "n"
7
+ "domain"
9
8
  ],
10
9
  "properties": {
11
10
  "domain": {
12
11
  "type": "string",
13
12
  "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
14
13
  "maxLength": 255,
15
- "description": "Sends a leaf, or the kind above its leaves when the question is which kind; a shelf, domain or top answers `not_a_leaf`."
14
+ "description": "Sends the leaf, or the kind above its leaves when the question is which kind; a shelf, domain or top answers `not_a_leaf`."
16
15
  },
17
16
  "specs": {
18
17
  "type": "array",
19
18
  "items": {
20
19
  "type": "object",
21
20
  "required": [
22
- "key",
21
+ "spec",
23
22
  "op",
24
23
  "value"
25
24
  ],
26
25
  "properties": {
27
- "key": {
26
+ "spec": {
28
27
  "type": "string",
29
28
  "minLength": 1,
30
29
  "maxLength": 64,
31
- "description": "Names the key from the domain read; `price` is a key every domain has."
30
+ "description": "Sends a spec the domain read listed, unchanged: a part’s by its path (`boiler.boilerVolume`)."
32
31
  },
33
32
  "op": {
34
33
  "anyOf": [
@@ -57,34 +56,56 @@
57
56
  "const": "nin"
58
57
  }
59
58
  ],
60
- "description": "Sends the operator the domain read listed for this key."
59
+ "description": "Sends the operator the domain read listed for this spec."
61
60
  },
62
61
  "value": {
63
- "description": "Sends the desired value, typed by the key's type."
64
- },
65
- "currency": {
66
- "type": "string",
67
- "pattern": "^[A-Z]{3}$",
68
- "minLength": 3,
69
- "maxLength": 3,
70
- "description": "On money, the currency the bound is tested in: sil holds no exchange rate, so it is tested against offers in this currency only. Leave it out to mean the buyer's own currency, as `sil_whoami` answers it."
62
+ "description": "Sends the desired value, typed by the spec's type."
71
63
  }
72
64
  },
73
65
  "additionalProperties": false
74
66
  },
75
67
  "maxItems": 32,
76
- "description": "Sends every settled want as a spec with the operator it needs; on a kind, `leaf` in or nin its leaves. A key the place does not hold is recorded, never refused."
68
+ "description": "Sends every settled want: a spec from the domain read, one of its operators, a value in its unit or its set; on a kind, `leaf` in or nin its leaves."
69
+ },
70
+ "price": {
71
+ "type": "object",
72
+ "required": [
73
+ "currency"
74
+ ],
75
+ "properties": {
76
+ "min": {
77
+ "type": "integer",
78
+ "minimum": 0,
79
+ "maximum": 9007199254740991,
80
+ "description": "The low end, in the minor unit."
81
+ },
82
+ "max": {
83
+ "type": "integer",
84
+ "minimum": 0,
85
+ "maximum": 9007199254740991,
86
+ "description": "The high end, in the minor unit."
87
+ },
88
+ "currency": {
89
+ "type": "string",
90
+ "pattern": "^[A-Z]{3}$",
91
+ "minLength": 3,
92
+ "maxLength": 3,
93
+ "description": "Both ends in this currency; sil converts nothing."
94
+ }
95
+ },
96
+ "additionalProperties": false,
97
+ "description": "Keeps variants with an offer in this currency within one or both ends; sil converts nothing."
77
98
  },
78
99
  "query": {
79
100
  "type": "string",
80
101
  "minLength": 1,
81
102
  "maxLength": 512,
82
- "description": "Sends words only for what no spec holds, never a sentence."
103
+ "description": "Sends the words the buyer used for what no spec holds — a name, a model, \"travel\" — matched against the products’ titles and words."
83
104
  },
84
105
  "n": {
85
106
  "type": "integer",
86
107
  "minimum": 1,
87
- "description": "Asks for this many variants; at most 10, a larger ask is served at that."
108
+ "description": "Asks for this many products, at most 10; default 5."
88
109
  },
89
110
  "brief": {
90
111
  "type": "string",
@@ -93,5 +114,6 @@
93
114
  "description": "Ties the call to a brief in sil’s record; never required."
94
115
  }
95
116
  },
96
- "additionalProperties": false
117
+ "additionalProperties": false,
118
+ "description": "Money is in the minor unit: €130 is 13000."
97
119
  }