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
@@ -7,13 +7,8 @@
7
7
  "status",
8
8
  "path",
9
9
  "name",
10
- "labels",
11
- "specs",
12
- "seller_specs",
13
- "reach",
14
- "kinds",
15
- "parts",
16
- "made_for"
10
+ "reached",
11
+ "specs"
17
12
  ],
18
13
  "properties": {
19
14
  "status": {
@@ -28,44 +23,28 @@
28
23
  "name": {
29
24
  "type": "string",
30
25
  "maxLength": 64,
31
- "description": "Calls the thing this in English — there is one, and this is it."
26
+ "description": "Calls the place this."
32
27
  },
33
- "labels": {
34
- "type": "array",
35
- "items": {
36
- "type": "string",
37
- "maxLength": 64
38
- },
39
- "maxItems": 20,
40
- "description": "Reads every other word for the thing — the market's own English, folded to the form sil maps under. sil asks each index in them; the agent never sends them."
28
+ "reached": {
29
+ "type": "integer",
30
+ "minimum": 0,
31
+ "description": "Says how many of the first specs answer the buyer’s words; the rest follow by how many products hold them."
41
32
  },
42
33
  "specs": {
43
34
  "type": "array",
44
35
  "items": {
45
36
  "type": "object",
46
37
  "required": [
47
- "key",
48
- "display_name",
38
+ "spec",
49
39
  "type",
50
40
  "operators"
51
41
  ],
52
42
  "properties": {
53
- "key": {
43
+ "spec": {
54
44
  "type": "string",
55
45
  "minLength": 1,
56
46
  "maxLength": 64,
57
- "description": "Names the key in the Brief and sends it as a `shopping_search` spec key."
58
- },
59
- "display_name": {
60
- "type": "string",
61
- "minLength": 1,
62
- "maxLength": 128,
63
- "description": "Calls the key this when it writes it down or says it out loud."
64
- },
65
- "description": {
66
- "type": "string",
67
- "maxLength": 1024,
68
- "description": "Reads how this one key moves the fit — what it decides, what goes wrong at either end of it, and how a buyer's own fact becomes a value for it. Reason from it; ask from it; never recite it back."
47
+ "description": "Sends it unchanged as `shopping_search.specs[].spec`: a part’s by its path (`burrSet.burrMaterial`), the box by `with`."
69
48
  },
70
49
  "type": {
71
50
  "anyOf": [
@@ -80,10 +59,6 @@
80
59
  {
81
60
  "type": "string",
82
61
  "const": "enum"
83
- },
84
- {
85
- "type": "string",
86
- "const": "money"
87
62
  }
88
63
  ],
89
64
  "description": "Types the value the agent sends and reads for this key."
@@ -91,16 +66,16 @@
91
66
  "unit": {
92
67
  "type": "string",
93
68
  "minLength": 1,
94
- "description": "States the value in this unit, the one sil holds it in."
69
+ "description": "Sends the value in this unit."
95
70
  },
96
- "allowed_values": {
71
+ "values": {
97
72
  "type": "array",
98
73
  "items": {
99
74
  "type": "string",
100
75
  "minLength": 1
101
76
  },
102
77
  "minItems": 1,
103
- "description": "Maps the buyer's word into the closed set; an enum without one takes any name, a maker's for `brand`."
78
+ "description": "Maps the buyer's word into this set; where `gte`/`lte` are offered, they run least first."
104
79
  },
105
80
  "operators": {
106
81
  "type": "array",
@@ -133,400 +108,27 @@
133
108
  ]
134
109
  },
135
110
  "minItems": 1,
136
- "description": "Picks the comparison that fits: `eq`/`in` on a variant spec and on enums, `gte`/`lte` on numbers and money."
137
- },
138
- "step": {
139
- "type": "number",
140
- "exclusiveMinimum": 0,
141
- "description": "Asks on the grid the maker prints the axis in — 0.5 for a Mondopoint size. A figure off the grid is something sil has not read as a value."
142
- },
143
- "forms": {
144
- "type": "object",
145
- "patternProperties": {
146
- "^.*$": {
147
- "type": "string"
148
- }
149
- },
150
- "description": "Reads what pages print for a value, mapped to the value — `{\"27/27.5\": \"27.5\"}`. Never sent: the request takes the value, and this is how sil recognises it in the wild."
151
- },
152
- "labels": {
153
- "type": "array",
154
- "items": {
155
- "type": "string",
156
- "minLength": 1,
157
- "maxLength": 60
158
- },
159
- "minItems": 1,
160
- "maxItems": 20,
161
- "description": "Sends any of these as the key and reaches this one: the names sil maps here — the headings pages print it under and the keys other agents send for it, one mapping with no origin between them. Folded to the form the mapping stores, best-attested first, at most 20."
111
+ "description": "Sends one of these as the spec’s `op`."
162
112
  },
163
- "variant_spec": {
113
+ "decides": {
164
114
  "type": "boolean",
165
115
  "const": true,
166
- "description": "Settles these before searching when the buyer has not said them; expects their values under `variants[]`."
167
- },
168
- "product_spec": {
169
- "type": "boolean",
170
- "const": true,
171
- "description": "Writes it into the brief when the buyer names it; never treats two products that differ on it as one."
172
- },
173
- "several": {
174
- "type": "boolean",
175
- "const": true,
176
- "description": "Reads a list for it under `fit`: a product holds several of these at once. `eq`/`in` match a product holding any value asked; `neq`/`nin` one holding none of them."
177
- }
178
- },
179
- "additionalProperties": false
180
- },
181
- "description": "Builds predicates with keys the registry holds."
182
- },
183
- "seller_specs": {
184
- "type": "array",
185
- "items": {
186
- "type": "object",
187
- "required": [
188
- "key",
189
- "display_name",
190
- "type",
191
- "operators"
192
- ],
193
- "properties": {
194
- "key": {
195
- "type": "string",
196
- "minLength": 1,
197
- "maxLength": 64,
198
- "description": "Names the key in the Brief and sends it as a `shopping_search` spec key."
116
+ "description": "Decides this kind of buy: ask the buyer for it where sil holds no answer."
199
117
  },
200
- "display_name": {
118
+ "why": {
201
119
  "type": "string",
202
120
  "minLength": 1,
203
- "maxLength": 128,
204
- "description": "Calls the key this when it writes it down or says it out loud."
205
- },
206
- "description": {
207
- "type": "string",
208
- "maxLength": 1024,
209
- "description": "Reads how this one key moves the fit — what it decides, what goes wrong at either end of it, and how a buyer's own fact becomes a value for it. Reason from it; ask from it; never recite it back."
210
- },
211
- "type": {
212
- "anyOf": [
213
- {
214
- "type": "string",
215
- "const": "number"
216
- },
217
- {
218
- "type": "string",
219
- "const": "boolean"
220
- },
221
- {
222
- "type": "string",
223
- "const": "enum"
224
- },
225
- {
226
- "type": "string",
227
- "const": "money"
228
- }
229
- ],
230
- "description": "Types the value the agent sends and reads for this key."
231
- },
232
- "unit": {
233
- "type": "string",
234
- "minLength": 1,
235
- "description": "States the value in this unit, the one sil holds it in."
236
- },
237
- "allowed_values": {
238
- "type": "array",
239
- "items": {
240
- "type": "string",
241
- "minLength": 1
242
- },
243
- "minItems": 1,
244
- "description": "Maps the buyer's word into the closed set; an enum without one takes any name, a maker's for `brand`."
245
- },
246
- "operators": {
247
- "type": "array",
248
- "items": {
249
- "anyOf": [
250
- {
251
- "type": "string",
252
- "const": "eq"
253
- },
254
- {
255
- "type": "string",
256
- "const": "neq"
257
- },
258
- {
259
- "type": "string",
260
- "const": "gte"
261
- },
262
- {
263
- "type": "string",
264
- "const": "lte"
265
- },
266
- {
267
- "type": "string",
268
- "const": "in"
269
- },
270
- {
271
- "type": "string",
272
- "const": "nin"
273
- }
274
- ]
275
- },
276
- "minItems": 1,
277
- "description": "Picks the comparison that fits: `eq`/`in` on a variant spec and on enums, `gte`/`lte` on numbers and money."
278
- },
279
- "step": {
280
- "type": "number",
281
- "exclusiveMinimum": 0,
282
- "description": "Asks on the grid the maker prints the axis in — 0.5 for a Mondopoint size. A figure off the grid is something sil has not read as a value."
283
- },
284
- "forms": {
285
- "type": "object",
286
- "patternProperties": {
287
- "^.*$": {
288
- "type": "string"
289
- }
290
- },
291
- "description": "Reads what pages print for a value, mapped to the value — `{\"27/27.5\": \"27.5\"}`. Never sent: the request takes the value, and this is how sil recognises it in the wild."
292
- },
293
- "labels": {
294
- "type": "array",
295
- "items": {
296
- "type": "string",
297
- "minLength": 1,
298
- "maxLength": 60
299
- },
300
- "minItems": 1,
301
- "maxItems": 20,
302
- "description": "Sends any of these as the key and reaches this one: the names sil maps here — the headings pages print it under and the keys other agents send for it, one mapping with no origin between them. Folded to the form the mapping stores, best-attested first, at most 20."
121
+ "description": "Says what a deciding spec decides, in the graph’s words: teach and ask from it."
303
122
  }
304
123
  },
305
124
  "additionalProperties": false
306
125
  },
307
- "description": "Builds seller rows with keys the registry holds — the base every domain shares and this domain's own branch — and sends them to `shopping_offers`."
126
+ "description": "Lists the specs a search here takes: those `spec_keywords` and `query` reach first, then those most products hold a value for; a spec of the thing no product holds only where they reach it, a part’s never."
308
127
  },
309
- "reach": {
310
- "type": "array",
311
- "items": {
312
- "type": "object",
313
- "required": [
314
- "from",
315
- "via",
316
- "keys"
317
- ],
318
- "properties": {
319
- "from": {
320
- "type": "string",
321
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
322
- "maxLength": 255,
323
- "description": "Reads the node that declares these keys: this one, or a kind it is."
324
- },
325
- "via": {
326
- "anyOf": [
327
- {
328
- "type": "string",
329
- "const": "own"
330
- },
331
- {
332
- "type": "string",
333
- "const": "kind"
334
- },
335
- {
336
- "type": "string",
337
- "const": "part"
338
- }
339
- ],
340
- "description": "Reads how: the node's own list, a kind it is, or what one of its parts' links says."
341
- },
342
- "part": {
343
- "type": "string",
344
- "description": "Names the part, where `via` is one."
345
- },
346
- "keys": {
347
- "type": "array",
348
- "items": {
349
- "type": "string",
350
- "minLength": 1,
351
- "maxLength": 64
352
- },
353
- "description": "Reads the keys, in the order the node lists them."
354
- }
355
- },
356
- "additionalProperties": false
357
- },
358
- "description": "Reads where each key comes from: this node, a kind it is, or a link to a part."
359
- },
360
- "kinds": {
361
- "type": "array",
362
- "items": {
363
- "type": "object",
364
- "required": [
365
- "path",
366
- "name"
367
- ],
368
- "properties": {
369
- "path": {
370
- "type": "string",
371
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
372
- "maxLength": 255,
373
- "description": "Reads the kind on its own node."
374
- },
375
- "name": {
376
- "type": "string",
377
- "maxLength": 64,
378
- "description": "Calls the kind this."
379
- }
380
- },
381
- "additionalProperties": false
382
- },
383
- "description": "Reads every kind this thing is, nearest first; it takes each one's keys."
384
- },
385
- "parts": {
386
- "type": "array",
387
- "items": {
388
- "type": "object",
389
- "required": [
390
- "name",
391
- "how",
392
- "optional",
393
- "many",
394
- "keys"
395
- ],
396
- "properties": {
397
- "name": {
398
- "type": "string",
399
- "description": "Calls the part this."
400
- },
401
- "role": {
402
- "type": "string",
403
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
404
- "maxLength": 255,
405
- "description": "Reads the node any thing that fills this part is."
406
- },
407
- "elsewhere": {
408
- "type": "string",
409
- "description": "Reads the part in plain words, where no node draws it yet."
410
- },
411
- "how": {
412
- "type": "array",
413
- "items": {
414
- "anyOf": [
415
- {
416
- "type": "string",
417
- "const": "built in"
418
- },
419
- {
420
- "type": "string",
421
- "const": "in the box"
422
- },
423
- {
424
- "type": "string",
425
- "const": "sold separately"
426
- },
427
- {
428
- "type": "string",
429
- "const": "used with"
430
- }
431
- ]
432
- },
433
- "description": "Knows whether the part is built in, in the box, bought apart or used with it."
434
- },
435
- "optional": {
436
- "type": "boolean",
437
- "description": "Knows whether some of these things come without it."
438
- },
439
- "many": {
440
- "type": "boolean",
441
- "description": "Knows whether the thing has several of the part."
442
- },
443
- "keys": {
444
- "type": "array",
445
- "items": {
446
- "type": "string",
447
- "minLength": 1,
448
- "maxLength": 64
449
- },
450
- "description": "Reads the keys the link says about the part, here."
451
- }
452
- },
453
- "additionalProperties": false
454
- },
455
- "description": "Reads what the thing has, and the keys each part is bought on."
456
- },
457
- "made_for": {
458
- "type": "array",
459
- "items": {
460
- "anyOf": [
461
- {
462
- "type": "object",
463
- "required": [
464
- "path"
465
- ],
466
- "properties": {
467
- "path": {
468
- "type": "string",
469
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
470
- "maxLength": 255,
471
- "description": "Reads the node this part or consumable is made for."
472
- }
473
- },
474
- "additionalProperties": false
475
- },
476
- {
477
- "type": "object",
478
- "required": [
479
- "elsewhere"
480
- ],
481
- "properties": {
482
- "elsewhere": {
483
- "type": "string",
484
- "description": "Reads what it is made for in plain words, where no node draws it yet."
485
- }
486
- },
487
- "additionalProperties": false
488
- }
489
- ]
490
- },
491
- "description": "Reads what this part or consumable is made for, where it is one."
492
- },
493
- "leaves": {
494
- "type": "array",
495
- "items": {
496
- "type": "object",
497
- "required": [
498
- "path",
499
- "name"
500
- ],
501
- "properties": {
502
- "path": {
503
- "type": "string",
504
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
505
- "maxLength": 255,
506
- "description": "Sends the leaf to `shopping_domain_get` and `shopping_search`."
507
- },
508
- "name": {
509
- "type": "string",
510
- "maxLength": 64,
511
- "description": "Calls the leaf this."
512
- }
513
- },
514
- "additionalProperties": false
515
- },
516
- "description": "On a kind: every leaf under it, to pick the one the buyer means. A kind’s own specs are served too, but a search runs on a leaf."
517
- },
518
- "record": {
519
- "anyOf": [
520
- {
521
- "type": "string",
522
- "const": "full"
523
- },
524
- {
525
- "type": "string",
526
- "const": "specs"
527
- }
528
- ],
529
- "description": "On a leaf: how its products are bought. `specs` — on their measures alone; `full` — on their measures and their record: purpose, story, pros and cons, for and not for."
128
+ "next_page": {
129
+ "type": "integer",
130
+ "minimum": 2,
131
+ "description": "Sends it as `page` to read the specs on; absent on the last page."
530
132
  }
531
133
  },
532
134
  "additionalProperties": false
@@ -4,14 +4,14 @@
4
4
  "title": "sil shopping_domain_search — request",
5
5
  "type": "object",
6
6
  "required": [
7
- "q"
7
+ "query"
8
8
  ],
9
9
  "properties": {
10
- "q": {
10
+ "query": {
11
11
  "type": "string",
12
12
  "minLength": 1,
13
13
  "maxLength": 200,
14
- "description": "Sends what the thing is called, in English — translate the buyer first."
14
+ "description": "Sends what the thing is called, in English: \"coffee grinder\"."
15
15
  }
16
16
  },
17
17
  "additionalProperties": false
@@ -19,78 +19,25 @@
19
19
  "type": "object",
20
20
  "required": [
21
21
  "path",
22
- "name",
23
- "matched",
24
- "under"
22
+ "name"
25
23
  ],
26
24
  "properties": {
27
25
  "path": {
28
26
  "type": "string",
29
27
  "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
30
28
  "maxLength": 255,
31
- "description": "Passes the leaf to `shopping_domain_get` and `shopping_search` verbatim."
29
+ "description": "Sends it to `shopping_domain_get` and `shopping_search`; read outermost first, it names every place the leaf sits under."
32
30
  },
33
31
  "name": {
34
32
  "type": "string",
35
33
  "maxLength": 64,
36
34
  "description": "Calls the leaf this."
37
- },
38
- "matched": {
39
- "type": "string",
40
- "description": "Reads which of sil's words for it the ask matched."
41
- },
42
- "under": {
43
- "type": "array",
44
- "items": {
45
- "type": "object",
46
- "required": [
47
- "path",
48
- "name",
49
- "role"
50
- ],
51
- "properties": {
52
- "path": {
53
- "type": "string",
54
- "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
55
- "maxLength": 255,
56
- "description": "Names the place the leaf sits under."
57
- },
58
- "name": {
59
- "type": "string",
60
- "maxLength": 64,
61
- "description": "Calls the place this."
62
- },
63
- "role": {
64
- "anyOf": [
65
- {
66
- "type": "string",
67
- "const": "top"
68
- },
69
- {
70
- "type": "string",
71
- "const": "domain"
72
- },
73
- {
74
- "type": "string",
75
- "const": "shelf"
76
- },
77
- {
78
- "type": "string",
79
- "const": "kind"
80
- }
81
- ],
82
- "description": "Reads what the place is: a top, a domain, a shelf or a kind."
83
- }
84
- },
85
- "additionalProperties": false
86
- },
87
- "description": "Reads every place above the leaf, outermost first and its parent last, to judge whether this is the thing the buyer means."
88
35
  }
89
36
  },
90
37
  "additionalProperties": false
91
38
  },
92
39
  "maxItems": 3,
93
- "description": "Reads the most relevant leaves for these words and judges which, if any, is the buyer’s thing. Empty: sil holds no such leaf; say so, or rephrase with what the thing is called."
40
+ "description": "Reads the leaves these words reach, best first, and judges which is the buyer’s thing. Empty: sil holds no such leaf; say so."
94
41
  }
95
42
  },
96
43
  "additionalProperties": false
@@ -4,16 +4,9 @@
4
4
  "title": "sil shopping_offers — request",
5
5
  "type": "object",
6
6
  "required": [
7
- "brief",
8
7
  "ids"
9
8
  ],
10
9
  "properties": {
11
- "brief": {
12
- "type": "string",
13
- "minLength": 1,
14
- "maxLength": 256,
15
- "description": "Names the session's brief, so sil records this call against the want behind it. A brief that is not the buyer's answers `not_found`."
16
- },
17
10
  "ids": {
18
11
  "type": "array",
19
12
  "items": {
@@ -24,8 +17,20 @@
24
17
  },
25
18
  "minItems": 1,
26
19
  "maxItems": 10,
27
- "description": "Sends the picked variant ids and nothing else: sil reads the brief's seller specs and price, the buyer's address and currency, off the brief and the profile."
20
+ "description": "Sends the variant ids to buy, from the product read."
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."
28
32
  }
29
33
  },
30
- "additionalProperties": false
34
+ "additionalProperties": false,
35
+ "description": "Money is in the minor unit: €130 is 13000."
31
36
  }