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,8 +5,9 @@
5
5
  "type": "object",
6
6
  "required": [
7
7
  "status",
8
- "products",
9
- "receipt"
8
+ "asked",
9
+ "search_stats",
10
+ "products"
10
11
  ],
11
12
  "properties": {
12
13
  "status": {
@@ -14,6 +15,171 @@
14
15
  "const": "ok",
15
16
  "description": "Reads the answer. Every other status arrives as an error body carrying recovery."
16
17
  },
18
+ "asked": {
19
+ "type": "array",
20
+ "items": {
21
+ "anyOf": [
22
+ {
23
+ "type": "object",
24
+ "required": [
25
+ "n",
26
+ "spec",
27
+ "op",
28
+ "value"
29
+ ],
30
+ "properties": {
31
+ "n": {
32
+ "type": "integer",
33
+ "minimum": 1,
34
+ "description": "An ask by its number in `asked`."
35
+ },
36
+ "spec": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "maxLength": 64,
40
+ "description": "Names the spec asked."
41
+ },
42
+ "op": {
43
+ "anyOf": [
44
+ {
45
+ "type": "string",
46
+ "const": "eq"
47
+ },
48
+ {
49
+ "type": "string",
50
+ "const": "neq"
51
+ },
52
+ {
53
+ "type": "string",
54
+ "const": "gte"
55
+ },
56
+ {
57
+ "type": "string",
58
+ "const": "lte"
59
+ },
60
+ {
61
+ "type": "string",
62
+ "const": "in"
63
+ },
64
+ {
65
+ "type": "string",
66
+ "const": "nin"
67
+ }
68
+ ],
69
+ "description": "Reads the operator asked."
70
+ },
71
+ "value": {
72
+ "description": "Reads the value asked, as sent."
73
+ },
74
+ "unit": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "description": "Reads the value in this unit."
78
+ }
79
+ },
80
+ "additionalProperties": false
81
+ },
82
+ {
83
+ "type": "object",
84
+ "required": [
85
+ "n",
86
+ "price"
87
+ ],
88
+ "properties": {
89
+ "n": {
90
+ "type": "integer",
91
+ "minimum": 1,
92
+ "description": "An ask by its number in `asked`."
93
+ },
94
+ "price": {
95
+ "type": "object",
96
+ "required": [
97
+ "currency"
98
+ ],
99
+ "properties": {
100
+ "min": {
101
+ "type": "integer",
102
+ "minimum": 0,
103
+ "maximum": 9007199254740991,
104
+ "description": "The low end, in the minor unit."
105
+ },
106
+ "max": {
107
+ "type": "integer",
108
+ "minimum": 0,
109
+ "maximum": 9007199254740991,
110
+ "description": "The high end, in the minor unit."
111
+ },
112
+ "currency": {
113
+ "type": "string",
114
+ "pattern": "^[A-Z]{3}$",
115
+ "minLength": 3,
116
+ "maxLength": 3,
117
+ "description": "Both ends in this currency; sil converts nothing."
118
+ }
119
+ },
120
+ "additionalProperties": false,
121
+ "description": "Reads the price filter, as sent."
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ }
126
+ ]
127
+ },
128
+ "description": "Echoes the ask, numbered from 1: each spec with its unit, then the price."
129
+ },
130
+ "search_stats": {
131
+ "type": "object",
132
+ "required": [
133
+ "sellers",
134
+ "products"
135
+ ],
136
+ "properties": {
137
+ "sellers": {
138
+ "type": "object",
139
+ "required": [
140
+ "searched",
141
+ "with_fit"
142
+ ],
143
+ "properties": {
144
+ "searched": {
145
+ "type": "integer",
146
+ "minimum": 0,
147
+ "description": "Shops behind the products searched."
148
+ },
149
+ "with_fit": {
150
+ "type": "integer",
151
+ "minimum": 0,
152
+ "description": "Shops behind a product holding every ask."
153
+ }
154
+ },
155
+ "additionalProperties": false,
156
+ "description": "Counts the shops."
157
+ },
158
+ "products": {
159
+ "type": "object",
160
+ "required": [
161
+ "searched",
162
+ "with_all_specs"
163
+ ],
164
+ "properties": {
165
+ "searched": {
166
+ "type": "integer",
167
+ "minimum": 0,
168
+ "description": "Products weighed under the place."
169
+ },
170
+ "with_all_specs": {
171
+ "type": "integer",
172
+ "minimum": 0,
173
+ "description": "Products holding a value for every spec asked."
174
+ }
175
+ },
176
+ "additionalProperties": false,
177
+ "description": "Counts the products."
178
+ }
179
+ },
180
+ "additionalProperties": false,
181
+ "description": "Explains the shortlist: how much was searched, and how much answers the whole ask."
182
+ },
17
183
  "products": {
18
184
  "type": "array",
19
185
  "items": {
@@ -21,8 +187,11 @@
21
187
  "required": [
22
188
  "id",
23
189
  "title",
24
- "fit",
25
- "price",
190
+ "images",
191
+ "holds",
192
+ "misses",
193
+ "unknown",
194
+ "store_stock",
26
195
  "variants"
27
196
  ],
28
197
  "properties": {
@@ -30,19 +199,15 @@
30
199
  "type": "string",
31
200
  "minLength": 1,
32
201
  "maxLength": 256,
33
- "description": "Names the product."
202
+ "description": "Passes it to `shopping_product_get`."
34
203
  },
35
204
  "title": {
36
205
  "type": "string",
37
- "description": "Draws the card with it."
206
+ "description": "Names the product."
38
207
  },
39
208
  "brand": {
40
209
  "type": "string",
41
- "description": "Names the maker."
42
- },
43
- "image": {
44
- "type": "string",
45
- "description": "Shows it."
210
+ "description": "Names the brand it is sold under."
46
211
  },
47
212
  "leaf": {
48
213
  "type": "string",
@@ -50,62 +215,74 @@
50
215
  "maxLength": 255,
51
216
  "description": "On a search over a kind: which leaf it is."
52
217
  },
53
- "fit": {
54
- "type": "object",
55
- "patternProperties": {
56
- "^.*$": {
57
- "anyOf": [
58
- {
59
- "type": "number"
60
- },
61
- {
62
- "type": "boolean"
63
- },
64
- {
65
- "type": "string"
66
- },
67
- {
68
- "type": "array",
69
- "items": {
70
- "type": "string"
71
- }
72
- }
73
- ]
74
- }
218
+ "images": {
219
+ "type": "array",
220
+ "items": {
221
+ "type": "string"
75
222
  },
76
- "description": "Answers each asked key with the value sil holds, or `\"unknown\"`: what to say as unverified."
223
+ "maxItems": 5,
224
+ "description": "Shows it: the recommended variant’s pictures first, then the product’s; the product read has every one."
77
225
  },
78
- "price": {
226
+ "holds": {
79
227
  "type": "array",
80
228
  "items": {
81
- "type": "object",
82
- "required": [
83
- "from",
84
- "to",
85
- "currency"
86
- ],
87
- "properties": {
88
- "from": {
89
- "type": "string",
90
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
91
- "description": "Quotes the low end of what the product costs in this currency."
92
- },
93
- "to": {
94
- "type": "string",
95
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
96
- "description": "Quotes the high end."
97
- },
98
- "currency": {
99
- "type": "string",
100
- "pattern": "^[A-Z]{3}$",
101
- "minLength": 3,
102
- "maxLength": 3,
103
- "description": "Reads which currency the range is in; sil converts nothing."
104
- }
229
+ "type": "integer",
230
+ "minimum": 1,
231
+ "description": "An ask by its number in `asked`."
232
+ },
233
+ "description": "Names the asks one of its variants holds."
234
+ },
235
+ "misses": {
236
+ "type": "array",
237
+ "items": {
238
+ "type": "integer",
239
+ "minimum": 1,
240
+ "description": "An ask by its number in `asked`."
241
+ },
242
+ "description": "Names the asks it holds a value for that fails on every variant."
243
+ },
244
+ "unknown": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "integer",
248
+ "minimum": 1,
249
+ "description": "An ask by its number in `asked`."
250
+ },
251
+ "description": "Names the asks sil could not test on it: say them as unverified."
252
+ },
253
+ "price_range": {
254
+ "type": "object",
255
+ "required": [
256
+ "currency"
257
+ ],
258
+ "properties": {
259
+ "min": {
260
+ "type": "integer",
261
+ "minimum": 0,
262
+ "maximum": 9007199254740991,
263
+ "description": "The low end, in the minor unit."
105
264
  },
106
- "additionalProperties": false
265
+ "max": {
266
+ "type": "integer",
267
+ "minimum": 0,
268
+ "maximum": 9007199254740991,
269
+ "description": "The high end, in the minor unit."
270
+ },
271
+ "currency": {
272
+ "type": "string",
273
+ "pattern": "^[A-Z]{3}$",
274
+ "minLength": 3,
275
+ "maxLength": 3,
276
+ "description": "Both ends in this currency; sil converts nothing."
277
+ }
107
278
  },
108
- "description": "Quotes the range over the variants returned."
279
+ "additionalProperties": false,
280
+ "description": "Quotes its variants’ one-off prices, cheapest to dearest, in one currency."
281
+ },
282
+ "store_stock": {
283
+ "type": "integer",
284
+ "minimum": 0,
285
+ "description": "Says how many shops sell the product, any variant."
109
286
  },
110
287
  "variants": {
111
288
  "type": "array",
@@ -113,149 +290,190 @@
113
290
  "type": "object",
114
291
  "required": [
115
292
  "id",
116
- "price"
293
+ "values",
294
+ "images"
117
295
  ],
118
296
  "properties": {
119
297
  "id": {
120
298
  "type": "string",
121
299
  "minLength": 1,
122
300
  "maxLength": 256,
123
- "description": "Passes it to `shopping_product_get` and `shopping_offers`."
301
+ "description": "Passes it to `shopping_offers`."
302
+ },
303
+ "values": {
304
+ "type": "object",
305
+ "patternProperties": {
306
+ "^.*$": {
307
+ "anyOf": [
308
+ {
309
+ "anyOf": [
310
+ {
311
+ "anyOf": [
312
+ {
313
+ "type": "number"
314
+ },
315
+ {
316
+ "type": "boolean"
317
+ },
318
+ {
319
+ "type": "string"
320
+ }
321
+ ]
322
+ },
323
+ {
324
+ "type": "object",
325
+ "required": [
326
+ "min",
327
+ "max"
328
+ ],
329
+ "properties": {
330
+ "min": {
331
+ "type": "number",
332
+ "description": "Reads the low end."
333
+ },
334
+ "max": {
335
+ "type": "number",
336
+ "description": "Reads the high end."
337
+ }
338
+ },
339
+ "additionalProperties": false,
340
+ "description": "A range, in the key’s unit."
341
+ },
342
+ {
343
+ "type": "object",
344
+ "patternProperties": {
345
+ "^.*$": {
346
+ "anyOf": [
347
+ {
348
+ "type": "number"
349
+ },
350
+ {
351
+ "type": "boolean"
352
+ },
353
+ {
354
+ "type": "string"
355
+ }
356
+ ]
357
+ }
358
+ },
359
+ "description": "One entry of a `records` key."
360
+ }
361
+ ]
362
+ },
363
+ {
364
+ "type": "array",
365
+ "items": {
366
+ "anyOf": [
367
+ {
368
+ "anyOf": [
369
+ {
370
+ "type": "number"
371
+ },
372
+ {
373
+ "type": "boolean"
374
+ },
375
+ {
376
+ "type": "string"
377
+ }
378
+ ]
379
+ },
380
+ {
381
+ "type": "object",
382
+ "required": [
383
+ "min",
384
+ "max"
385
+ ],
386
+ "properties": {
387
+ "min": {
388
+ "type": "number",
389
+ "description": "Reads the low end."
390
+ },
391
+ "max": {
392
+ "type": "number",
393
+ "description": "Reads the high end."
394
+ }
395
+ },
396
+ "additionalProperties": false,
397
+ "description": "A range, in the key’s unit."
398
+ },
399
+ {
400
+ "type": "object",
401
+ "patternProperties": {
402
+ "^.*$": {
403
+ "anyOf": [
404
+ {
405
+ "type": "number"
406
+ },
407
+ {
408
+ "type": "boolean"
409
+ },
410
+ {
411
+ "type": "string"
412
+ }
413
+ ]
414
+ }
415
+ },
416
+ "description": "One entry of a `records` key."
417
+ }
418
+ ]
419
+ }
420
+ }
421
+ ]
422
+ }
423
+ },
424
+ "description": "Reads what sets this variant apart from the product’s others; empty where it is the only one."
425
+ },
426
+ "price_range": {
427
+ "type": "object",
428
+ "required": [
429
+ "currency"
430
+ ],
431
+ "properties": {
432
+ "min": {
433
+ "type": "integer",
434
+ "minimum": 0,
435
+ "maximum": 9007199254740991,
436
+ "description": "The low end, in the minor unit."
437
+ },
438
+ "max": {
439
+ "type": "integer",
440
+ "minimum": 0,
441
+ "maximum": 9007199254740991,
442
+ "description": "The high end, in the minor unit."
443
+ },
444
+ "currency": {
445
+ "type": "string",
446
+ "pattern": "^[A-Z]{3}$",
447
+ "minLength": 3,
448
+ "maxLength": 3,
449
+ "description": "Both ends in this currency; sil converts nothing."
450
+ }
451
+ },
452
+ "additionalProperties": false,
453
+ "description": "Quotes its offers’ one-off prices, cheapest to dearest, in one currency; absent where none is buyable in it."
124
454
  },
125
- "price": {
455
+ "images": {
126
456
  "type": "array",
127
457
  "items": {
128
- "type": "object",
129
- "required": [
130
- "from",
131
- "to",
132
- "currency"
133
- ],
134
- "properties": {
135
- "from": {
136
- "type": "string",
137
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
138
- "description": "Quotes the low end of what the product costs in this currency."
139
- },
140
- "to": {
141
- "type": "string",
142
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
143
- "description": "Quotes the high end."
144
- },
145
- "currency": {
146
- "type": "string",
147
- "pattern": "^[A-Z]{3}$",
148
- "minLength": 3,
149
- "maxLength": 3,
150
- "description": "Reads which currency the range is in; sil converts nothing."
151
- }
152
- },
153
- "additionalProperties": false
458
+ "type": "integer",
459
+ "minimum": 0
154
460
  },
155
- "description": "Quotes what THIS option costs, over its own offers; a currency other than the ask's is a bound sil could not test."
461
+ "description": "Shows its own pictures: positions in the product’s `images`, first its best."
462
+ },
463
+ "recommended": {
464
+ "type": "boolean",
465
+ "const": true,
466
+ "description": "Is the one to show and start from: most asks held, then most it holds a value for, then the cheapest."
156
467
  }
157
468
  },
158
- "additionalProperties": {
159
- "anyOf": [
160
- {
161
- "type": "number"
162
- },
163
- {
164
- "type": "string"
165
- },
166
- {
167
- "type": "boolean"
168
- }
169
- ]
170
- },
171
- "description": "A variant that answers the ask, and every option value that identifies it. One carrying none is a listing sil has not read sizes from."
469
+ "additionalProperties": false
172
470
  },
173
- "description": "Passes an `id` to the dossier and offers."
471
+ "description": "Lists the variants the ask leaves standing, one of them recommended."
174
472
  }
175
473
  },
176
474
  "additionalProperties": false
177
475
  },
178
- "description": "Shows the shortlist in this order."
179
- },
180
- "receipt": {
181
- "type": "object",
182
- "required": [
183
- "shops",
184
- "products",
185
- "fit",
186
- "could_not_tell",
187
- "offered",
188
- "finding",
189
- "set_aside"
190
- ],
191
- "properties": {
192
- "shops": {
193
- "type": "integer",
194
- "minimum": 0,
195
- "description": "Says how many shops sil looked across."
196
- },
197
- "products": {
198
- "type": "integer",
199
- "minimum": 0,
200
- "description": "Says how many products sil weighed: all it holds in the place asked; `fit`, `could_not_tell` and every `set_aside` line add up to it."
201
- },
202
- "fit": {
203
- "type": "integer",
204
- "minimum": 0,
205
- "description": "Says how many meet every asked spec on values sil read."
206
- },
207
- "could_not_tell": {
208
- "type": "integer",
209
- "minimum": 0,
210
- "description": "Says how many sil could not tell: nothing failed, a value was unread. Never a failure."
211
- },
212
- "offered": {
213
- "type": "integer",
214
- "minimum": 0,
215
- "description": "Says how many of the fit sil holds an offer for in the buyer’s country."
216
- },
217
- "finding": {
218
- "type": "integer",
219
- "minimum": 0,
220
- "description": "Says how many products sil has started finding offers for in the buyer’s country; the next offers call reads them."
221
- },
222
- "set_aside": {
223
- "type": "array",
224
- "items": {
225
- "type": "object",
226
- "required": [
227
- "count",
228
- "key"
229
- ],
230
- "properties": {
231
- "count": {
232
- "type": "integer",
233
- "minimum": 0,
234
- "description": "Says how many were set aside on this key, each product once, on its first failing spec."
235
- },
236
- "key": {
237
- "type": "string",
238
- "minLength": 1,
239
- "maxLength": 64,
240
- "description": "Names the asked spec they failed."
241
- },
242
- "values": {
243
- "type": "array",
244
- "items": {
245
- "type": "string"
246
- },
247
- "maxItems": 3,
248
- "description": "On a choice: the values they held, most common first."
249
- }
250
- },
251
- "additionalProperties": false
252
- },
253
- "maxItems": 32,
254
- "description": "Says why the rest were set aside, in the buyer’s words."
255
- }
256
- },
257
- "additionalProperties": false,
258
- "description": "Shows the buyer what sil checked, in a shop assistant’s words; relayed, never recounted."
476
+ "description": "Shows the products closest to the ask: those holding most asks first."
259
477
  }
260
478
  },
261
479
  "additionalProperties": false
@@ -18,7 +18,19 @@
18
18
  "minItems": 1,
19
19
  "maxItems": 10,
20
20
  "description": "Sends the seller ids the offers named."
21
+ },
22
+ "ship_to": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 128,
26
+ "description": "Names one of the buyer’s addresses from `sil_whoami`, by label or town; the default when absent."
27
+ },
28
+ "page": {
29
+ "type": "integer",
30
+ "minimum": 2,
31
+ "description": "Reads on: the `next_page` the last answer gave."
21
32
  }
22
33
  },
23
- "additionalProperties": false
34
+ "additionalProperties": false,
35
+ "description": "Money is in the minor unit: €130 is 13000."
24
36
  }