sil-openclaw 0.6.0 → 0.8.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/EXAMPLES.md +93 -0
  3. package/README.md +58 -120
  4. package/SECURITY.md +12 -9
  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 +27 -28
  12. package/dist/lib/sil-client.js +49 -66
  13. package/dist/lib/tool-result.js +1 -1
  14. package/dist/tools/catalog.js +113 -272
  15. package/dist/tools/identity.js +79 -88
  16. package/openclaw.plugin.json +12 -7
  17. package/package.json +4 -2
  18. package/schema/PROVENANCE.md +7 -4
  19. package/schema/shopping-brief-read-request.schema.json +2 -1
  20. package/schema/shopping-brief-read-response.schema.json +98 -50
  21. package/schema/shopping-brief-write-request.schema.json +322 -0
  22. package/schema/{shopping-brief-create-response.schema.json → shopping-brief-write-response.schema.json} +3 -3
  23. package/schema/shopping-content-request.schema.json +12 -31
  24. package/schema/shopping-content-response.schema.json +14 -95
  25. package/schema/shopping-domain-get-request.schema.json +24 -1
  26. package/schema/shopping-domain-get-response.schema.json +23 -421
  27. package/schema/shopping-domain-search-request.schema.json +3 -3
  28. package/schema/shopping-domain-search-response.schema.json +3 -56
  29. package/schema/shopping-offers-request.schema.json +14 -9
  30. package/schema/shopping-offers-response.schema.json +368 -91
  31. package/schema/shopping-product-get-request.schema.json +4 -3
  32. package/schema/shopping-product-get-response.schema.json +347 -46
  33. package/schema/shopping-search-request.schema.json +53 -40
  34. package/schema/shopping-search-response.schema.json +408 -116
  35. package/schema/shopping-seller-get-request.schema.json +13 -1
  36. package/schema/shopping-seller-get-response.schema.json +594 -225
  37. package/schema/shopping-user-forget-request.schema.json +43 -0
  38. package/schema/shopping-user-forget-response.schema.json +74 -0
  39. package/schema/shopping-user-read-request.schema.json +37 -0
  40. package/schema/shopping-user-read-response.schema.json +372 -0
  41. package/schema/shopping-user-remember-request.schema.json +341 -0
  42. package/schema/shopping-user-remember-response.schema.json +66 -0
  43. package/schema/sil-whoami-request.schema.json +8 -0
  44. package/schema/sil-whoami-response.schema.json +99 -0
  45. package/sil-shopping/SKILL.md +149 -208
  46. package/dist/gateway/search-results.js +0 -99
  47. package/dist/lib/search-results-log.js +0 -23
  48. package/dist/lib/search-results-store.js +0 -116
  49. package/schema/shopping-brief-create-request.schema.json +0 -98
  50. package/schema/shopping-brief-edit-request.schema.json +0 -125
  51. package/schema/shopping-brief-edit-response.schema.json +0 -24
  52. package/schema/shopping-profile-edit-request.schema.json +0 -97
  53. package/schema/shopping-profile-edit-response.schema.json +0 -17
@@ -5,6 +5,7 @@
5
5
  "type": "object",
6
6
  "required": [
7
7
  "status",
8
+ "ship_to",
8
9
  "offers"
9
10
  ],
10
11
  "properties": {
@@ -14,10 +15,33 @@
14
15
  "description": "Reads the answer. Every other status arrives as an error body carrying recovery."
15
16
  },
16
17
  "ship_to": {
17
- "type": "string",
18
- "minLength": 1,
19
- "maxLength": 64,
20
- "description": "Says which address every `seller_fit.ships` below is about; absent when the default address carries no label."
18
+ "type": "object",
19
+ "required": [
20
+ "country"
21
+ ],
22
+ "properties": {
23
+ "label": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "maxLength": 64,
27
+ "description": "Names the address."
28
+ },
29
+ "locality": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 128,
33
+ "description": "Says the town."
34
+ },
35
+ "country": {
36
+ "type": "string",
37
+ "pattern": "^[A-Z]{2}$",
38
+ "minLength": 2,
39
+ "maxLength": 2,
40
+ "description": "Says the country every `ships` is relative to."
41
+ }
42
+ },
43
+ "additionalProperties": false,
44
+ "description": "Says where delivery was priced to: every `ships` is relative to it."
21
45
  },
22
46
  "offers": {
23
47
  "type": "array",
@@ -25,43 +49,290 @@
25
49
  "type": "object",
26
50
  "required": [
27
51
  "variant_id",
28
- "seller_id",
29
- "seller_name",
52
+ "seller",
30
53
  "price",
31
- "currency",
32
- "availability",
33
- "observed_at",
34
54
  "url",
35
- "seller_fit"
55
+ "read_on"
36
56
  ],
37
57
  "properties": {
38
58
  "variant_id": {
39
59
  "type": "string",
40
60
  "minLength": 1,
41
61
  "maxLength": 256,
42
- "description": "Matches the offer to the pick."
43
- },
44
- "seller_id": {
45
- "type": "string",
46
- "minLength": 1,
47
- "maxLength": 256,
48
- "description": "Passes it to `shopping_seller_get`."
62
+ "description": "Matches the offer to the variant asked for."
49
63
  },
50
- "seller_name": {
51
- "type": "string",
52
- "description": "Names the shop to the buyer."
64
+ "seller": {
65
+ "type": "object",
66
+ "required": [
67
+ "id",
68
+ "name",
69
+ "host",
70
+ "country",
71
+ "ships",
72
+ "promotions"
73
+ ],
74
+ "properties": {
75
+ "id": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "maxLength": 256,
79
+ "description": "Passes it to `shopping_seller_get` for its warranty, policies, reviews and other terms."
80
+ },
81
+ "name": {
82
+ "type": "string",
83
+ "description": "Names the shop."
84
+ },
85
+ "host": {
86
+ "type": "string",
87
+ "description": "Names the shop by its site."
88
+ },
89
+ "country": {
90
+ "anyOf": [
91
+ {
92
+ "type": "string",
93
+ "pattern": "^[A-Z]{2}$",
94
+ "minLength": 2,
95
+ "maxLength": 2,
96
+ "description": "Where the shop is."
97
+ },
98
+ {
99
+ "type": "string",
100
+ "const": "unknown"
101
+ }
102
+ ],
103
+ "description": "Says where the shop is."
104
+ },
105
+ "ships": {
106
+ "anyOf": [
107
+ {
108
+ "type": "string",
109
+ "const": "serviceable"
110
+ },
111
+ {
112
+ "type": "string",
113
+ "const": "not_serviceable"
114
+ },
115
+ {
116
+ "type": "string",
117
+ "const": "unknown"
118
+ }
119
+ ],
120
+ "description": "Says whether it ships there; `unknown` keeps the seller and says sil has not read its policy."
121
+ },
122
+ "delivery": {
123
+ "type": "object",
124
+ "properties": {
125
+ "cost": {
126
+ "anyOf": [
127
+ {
128
+ "type": "object",
129
+ "required": [
130
+ "amount",
131
+ "currency"
132
+ ],
133
+ "properties": {
134
+ "amount": {
135
+ "type": "integer",
136
+ "minimum": 0,
137
+ "maximum": 9007199254740991,
138
+ "description": "The amount in the currency’s minor unit (cents): €130 is 13000."
139
+ },
140
+ "currency": {
141
+ "type": "string",
142
+ "pattern": "^[A-Z]{3}$",
143
+ "minLength": 3,
144
+ "maxLength": 3,
145
+ "description": "In this currency."
146
+ }
147
+ },
148
+ "additionalProperties": false
149
+ },
150
+ {
151
+ "type": "object",
152
+ "required": [
153
+ "currency"
154
+ ],
155
+ "properties": {
156
+ "min": {
157
+ "type": "integer",
158
+ "minimum": 0,
159
+ "maximum": 9007199254740991,
160
+ "description": "The low end, in the minor unit."
161
+ },
162
+ "max": {
163
+ "type": "integer",
164
+ "minimum": 0,
165
+ "maximum": 9007199254740991,
166
+ "description": "The high end, in the minor unit."
167
+ },
168
+ "currency": {
169
+ "type": "string",
170
+ "pattern": "^[A-Z]{3}$",
171
+ "minLength": 3,
172
+ "maxLength": 3,
173
+ "description": "Both ends in this currency; sil converts nothing."
174
+ }
175
+ },
176
+ "additionalProperties": false
177
+ }
178
+ ],
179
+ "description": "Quotes one fee, or the range from the cheapest route’s to the dearest’s."
180
+ },
181
+ "free_over": {
182
+ "type": "object",
183
+ "required": [
184
+ "amount",
185
+ "currency"
186
+ ],
187
+ "properties": {
188
+ "amount": {
189
+ "type": "integer",
190
+ "minimum": 0,
191
+ "maximum": 9007199254740991,
192
+ "description": "The amount in the currency’s minor unit (cents): €130 is 13000."
193
+ },
194
+ "currency": {
195
+ "type": "string",
196
+ "pattern": "^[A-Z]{3}$",
197
+ "minLength": 3,
198
+ "maxLength": 3,
199
+ "description": "In this currency."
200
+ }
201
+ },
202
+ "additionalProperties": false,
203
+ "description": "Quotes the basket that clears the charge."
204
+ },
205
+ "days": {
206
+ "type": "object",
207
+ "required": [
208
+ "min",
209
+ "max"
210
+ ],
211
+ "properties": {
212
+ "min": {
213
+ "type": "integer",
214
+ "description": "Tells the buyer the soonest it arrives."
215
+ },
216
+ "max": {
217
+ "type": "integer",
218
+ "description": "Tells the buyer the latest."
219
+ }
220
+ },
221
+ "additionalProperties": false,
222
+ "description": "Tells the buyer how long the route takes."
223
+ }
224
+ },
225
+ "additionalProperties": false,
226
+ "description": "Tells the buyer what delivery to their country costs and how long it takes."
227
+ },
228
+ "returns_days": {
229
+ "type": "integer",
230
+ "minimum": 0,
231
+ "description": "Says how many days the buyer has to return it."
232
+ },
233
+ "promotions": {
234
+ "type": "array",
235
+ "items": {
236
+ "type": "object",
237
+ "required": [
238
+ "what"
239
+ ],
240
+ "properties": {
241
+ "what": {
242
+ "type": "string",
243
+ "description": "Quotes the promotion as the shop prints it."
244
+ },
245
+ "discount": {
246
+ "type": "number",
247
+ "minimum": 0,
248
+ "maximum": 100,
249
+ "description": "Quotes its discount, in percent, where the shop states one."
250
+ },
251
+ "minimum_spend": {
252
+ "type": "object",
253
+ "required": [
254
+ "amount",
255
+ "currency"
256
+ ],
257
+ "properties": {
258
+ "amount": {
259
+ "type": "integer",
260
+ "minimum": 0,
261
+ "maximum": 9007199254740991,
262
+ "description": "The amount in the currency’s minor unit (cents): €130 is 13000."
263
+ },
264
+ "currency": {
265
+ "type": "string",
266
+ "pattern": "^[A-Z]{3}$",
267
+ "minLength": 3,
268
+ "maxLength": 3,
269
+ "description": "In this currency."
270
+ }
271
+ },
272
+ "additionalProperties": false,
273
+ "description": "Quotes the spend it needs."
274
+ },
275
+ "until": {
276
+ "type": "string",
277
+ "format": "date",
278
+ "description": "Says when it ends."
279
+ }
280
+ },
281
+ "additionalProperties": false
282
+ },
283
+ "description": "Quotes this shop’s own promotions, on its offers only: ask who qualifies; a reduced price only from `discount` and only on the buyer’s yes."
284
+ }
285
+ },
286
+ "additionalProperties": false,
287
+ "description": "The shop selling it."
53
288
  },
54
289
  "price": {
55
- "type": "string",
56
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
57
- "description": "Quotes the price as read, never converted."
290
+ "type": "object",
291
+ "required": [
292
+ "amount",
293
+ "currency"
294
+ ],
295
+ "properties": {
296
+ "amount": {
297
+ "type": "integer",
298
+ "minimum": 0,
299
+ "maximum": 9007199254740991,
300
+ "description": "The amount in the currency’s minor unit (cents): €130 is 13000."
301
+ },
302
+ "currency": {
303
+ "type": "string",
304
+ "pattern": "^[A-Z]{3}$",
305
+ "minLength": 3,
306
+ "maxLength": 3,
307
+ "description": "In this currency."
308
+ }
309
+ },
310
+ "additionalProperties": false,
311
+ "description": "Quotes what it costs, as the shop printed it."
58
312
  },
59
- "currency": {
60
- "type": "string",
61
- "pattern": "^[A-Z]{3}$",
62
- "minLength": 3,
63
- "maxLength": 3,
64
- "description": "Quotes the price in this currency."
313
+ "was": {
314
+ "type": "object",
315
+ "required": [
316
+ "amount",
317
+ "currency"
318
+ ],
319
+ "properties": {
320
+ "amount": {
321
+ "type": "integer",
322
+ "minimum": 0,
323
+ "maximum": 9007199254740991,
324
+ "description": "The amount in the currency’s minor unit (cents): €130 is 13000."
325
+ },
326
+ "currency": {
327
+ "type": "string",
328
+ "pattern": "^[A-Z]{3}$",
329
+ "minLength": 3,
330
+ "maxLength": 3,
331
+ "description": "In this currency."
332
+ }
333
+ },
334
+ "additionalProperties": false,
335
+ "description": "Quotes the price it was, struck through."
65
336
  },
66
337
  "availability": {
67
338
  "anyOf": [
@@ -77,6 +348,10 @@
77
348
  "type": "string",
78
349
  "const": "preorder"
79
350
  },
351
+ {
352
+ "type": "string",
353
+ "const": "by_enquiry"
354
+ },
80
355
  {
81
356
  "type": "string",
82
357
  "const": "out_of_stock"
@@ -92,80 +367,82 @@
92
367
  ],
93
368
  "description": "Tells the buyer whether it can be bought now."
94
369
  },
95
- "observed_at": {
96
- "type": "string",
97
- "format": "date-time",
98
- "description": "Dates the price to the buyer — this offer was read live, at this moment."
370
+ "condition": {
371
+ "anyOf": [
372
+ {
373
+ "type": "string",
374
+ "const": "new"
375
+ },
376
+ {
377
+ "type": "string",
378
+ "const": "used"
379
+ },
380
+ {
381
+ "type": "string",
382
+ "const": "refurbished"
383
+ },
384
+ {
385
+ "type": "string",
386
+ "const": "damaged"
387
+ }
388
+ ],
389
+ "description": "Says it is not sold new where the shop says so; absent, new or unstated."
99
390
  },
100
- "url": {
101
- "type": "string",
102
- "description": "Hands the buyer the listing."
391
+ "plan": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "string"
395
+ },
396
+ "minItems": 1,
397
+ "description": "Says the price is a subscription’s, and each cadence the shop offers."
103
398
  },
104
- "seller_fit": {
399
+ "pack": {
105
400
  "type": "object",
106
401
  "required": [
107
- "ships"
402
+ "count",
403
+ "with"
108
404
  ],
109
405
  "properties": {
110
- "ships": {
111
- "anyOf": [
112
- {
113
- "type": "string",
114
- "const": "serviceable"
115
- },
116
- {
117
- "type": "string",
118
- "const": "not_serviceable"
119
- },
120
- {
121
- "type": "string",
122
- "const": "unknown"
123
- }
124
- ],
125
- "description": "Says whether it ships there; `unknown` keeps the seller and says sil has not read its policy."
126
- }
127
- },
128
- "additionalProperties": {
129
- "anyOf": [
130
- {
131
- "type": "number"
132
- },
133
- {
134
- "type": "boolean"
135
- },
136
- {
406
+ "count": {
407
+ "type": "integer",
408
+ "minimum": 1,
409
+ "description": "Says how many of the variant it holds."
410
+ },
411
+ "with": {
412
+ "type": "array",
413
+ "items": {
137
414
  "type": "string"
138
415
  },
139
- {
140
- "type": "object",
141
- "required": [
142
- "amount",
143
- "currency"
144
- ],
145
- "properties": {
146
- "amount": {
147
- "type": "string",
148
- "pattern": "^[0-9]+(\\.[0-9]+)?$",
149
- "description": "Quotes the amount as the page states it."
150
- },
151
- "currency": {
152
- "type": "string",
153
- "pattern": "^[A-Z]{3}$",
154
- "minLength": 3,
155
- "maxLength": 3,
156
- "description": "Quotes the amount in this currency."
157
- }
158
- },
159
- "additionalProperties": false
160
- }
161
- ]
416
+ "description": "Names what else comes in it."
417
+ }
162
418
  },
163
- "description": "Compares each requested seller key with what it asked, on this seller's value; `ships` says whether it reaches the address."
419
+ "additionalProperties": false,
420
+ "description": "Says the price buys a pack or a bundle, not one of the variant."
421
+ },
422
+ "packaging": {
423
+ "type": "string",
424
+ "minLength": 1,
425
+ "description": "Names a special packaging the price buys it in, as the shop printed it."
426
+ },
427
+ "url": {
428
+ "type": "string",
429
+ "description": "Hands the buyer the listing."
430
+ },
431
+ "read_on": {
432
+ "type": "string",
433
+ "format": "date",
434
+ "description": "Dates the price: the day sil read it."
164
435
  }
165
436
  },
166
- "additionalProperties": false
437
+ "additionalProperties": false,
438
+ "description": "One shop’s offer of a variant."
167
439
  },
168
- "description": "Lists where the pick can be bought — one variant at one seller per entry."
440
+ "description": "Lists where each variant can be bought: shops shipping to `ship_to` first, cheapest first."
441
+ },
442
+ "next_page": {
443
+ "type": "integer",
444
+ "minimum": 2,
445
+ "description": "Sends it as `page` to read the offers on; absent on the last page."
169
446
  }
170
447
  },
171
448
  "additionalProperties": false
@@ -16,9 +16,10 @@
16
16
  "description": "An id sil minted, passed back verbatim."
17
17
  },
18
18
  "minItems": 1,
19
- "maxItems": 10,
20
- "description": "Sends the variant ids it wants the whole of; one sil cannot place is absent."
19
+ "maxItems": 3,
20
+ "description": "Sends the product or variant ids it wants the whole of; one sil does not hold is left out."
21
21
  }
22
22
  },
23
- "additionalProperties": false
23
+ "additionalProperties": false,
24
+ "description": "Money is in the minor unit: €130 is 13000."
24
25
  }