sil-openclaw 0.5.2 → 0.7.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 (45) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +27 -26
  3. package/SECURITY.md +3 -4
  4. package/dist/index.js +1 -1
  5. package/dist/lib/shopping-call.js +7 -4
  6. package/dist/lib/sil-client.js +36 -66
  7. package/dist/lib/tool-result.js +1 -1
  8. package/dist/tools/catalog.js +83 -242
  9. package/dist/tools/identity.js +74 -87
  10. package/openclaw.plugin.json +12 -7
  11. package/package.json +1 -1
  12. package/schema/PROVENANCE.md +7 -4
  13. package/schema/shopping-brief-read-response.schema.json +1 -1
  14. package/schema/shopping-brief-write-request.schema.json +225 -0
  15. package/schema/{shopping-brief-create-response.schema.json → shopping-brief-write-response.schema.json} +3 -3
  16. package/schema/shopping-content-request.schema.json +89 -0
  17. package/schema/shopping-content-response.schema.json +298 -0
  18. package/schema/shopping-domain-get-request.schema.json +19 -1
  19. package/schema/shopping-domain-get-response.schema.json +330 -66
  20. package/schema/shopping-domain-search-request.schema.json +1 -1
  21. package/schema/shopping-domain-search-response.schema.json +40 -35
  22. package/schema/shopping-offers-request.schema.json +174 -23
  23. package/schema/shopping-offers-response.schema.json +20 -10
  24. package/schema/shopping-product-get-request.schema.json +2 -2
  25. package/schema/shopping-product-get-response.schema.json +119 -16
  26. package/schema/shopping-search-request.schema.json +16 -25
  27. package/schema/shopping-search-response.schema.json +101 -21
  28. package/schema/shopping-seller-get-response.schema.json +249 -221
  29. package/schema/shopping-user-forget-request.schema.json +43 -0
  30. package/schema/shopping-user-forget-response.schema.json +74 -0
  31. package/schema/shopping-user-read-request.schema.json +36 -0
  32. package/schema/shopping-user-read-response.schema.json +372 -0
  33. package/schema/shopping-user-remember-request.schema.json +340 -0
  34. package/schema/shopping-user-remember-response.schema.json +66 -0
  35. package/schema/sil-whoami-request.schema.json +8 -0
  36. package/schema/sil-whoami-response.schema.json +90 -0
  37. package/sil-shopping/SKILL.md +139 -180
  38. package/schema/shopping-brief-create-request.schema.json +0 -98
  39. package/schema/shopping-brief-edit-request.schema.json +0 -125
  40. package/schema/shopping-brief-edit-response.schema.json +0 -24
  41. package/schema/shopping-domain-create-request.schema.json +0 -160
  42. package/schema/shopping-domain-create-response.schema.json +0 -60
  43. package/schema/shopping-profile-edit-request.schema.json +0 -97
  44. package/schema/shopping-profile-edit-response.schema.json +0 -17
  45. package/sil-shopping/references/mint.md +0 -190
@@ -2,30 +2,181 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schemas.sil.com/shopping-offers-request.schema.json",
4
4
  "title": "sil shopping_offers — request",
5
- "type": "object",
6
- "required": [
7
- "brief",
8
- "ids"
9
- ],
10
- "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`."
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "required": [
9
+ "ids"
10
+ ],
11
+ "properties": {
12
+ "ids": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "maxLength": 256,
18
+ "description": "An id sil minted, passed back verbatim."
19
+ },
20
+ "minItems": 1,
21
+ "maxItems": 10,
22
+ "description": "Sends the picked variant ids."
23
+ },
24
+ "confirm": {
25
+ "type": "boolean",
26
+ "description": "Re-reads the listing of up to three ids now, for the link the buyer is sent to."
27
+ },
28
+ "seller_specs": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "required": [
33
+ "key",
34
+ "op",
35
+ "value"
36
+ ],
37
+ "properties": {
38
+ "key": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 64,
42
+ "description": "Names the key from the domain read; `price` is a key every domain has."
43
+ },
44
+ "op": {
45
+ "anyOf": [
46
+ {
47
+ "type": "string",
48
+ "const": "eq"
49
+ },
50
+ {
51
+ "type": "string",
52
+ "const": "neq"
53
+ },
54
+ {
55
+ "type": "string",
56
+ "const": "gte"
57
+ },
58
+ {
59
+ "type": "string",
60
+ "const": "lte"
61
+ },
62
+ {
63
+ "type": "string",
64
+ "const": "in"
65
+ },
66
+ {
67
+ "type": "string",
68
+ "const": "nin"
69
+ }
70
+ ],
71
+ "description": "Sends the operator the domain read listed for this key."
72
+ },
73
+ "value": {
74
+ "description": "Sends the desired value, typed by the key's type."
75
+ },
76
+ "currency": {
77
+ "type": "string",
78
+ "pattern": "^[A-Z]{3}$",
79
+ "minLength": 3,
80
+ "maxLength": 3,
81
+ "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."
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ "maxItems": 32,
87
+ "description": "Sends the seller terms the buyer settled; each offer answers them in `seller_fit`."
88
+ },
89
+ "brief": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "maxLength": 256,
93
+ "description": "Ties the call to a brief in sil’s record; never required."
94
+ }
95
+ },
96
+ "additionalProperties": false
16
97
  },
17
- "ids": {
18
- "type": "array",
19
- "items": {
20
- "type": "string",
21
- "minLength": 1,
22
- "maxLength": 256,
23
- "description": "An id sil minted, passed back verbatim."
98
+ {
99
+ "type": "object",
100
+ "required": [
101
+ "name"
102
+ ],
103
+ "properties": {
104
+ "name": {
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 128,
108
+ "description": "Sends a product’s name for a price check: maker, model, the size if named."
109
+ },
110
+ "seller_specs": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "required": [
115
+ "key",
116
+ "op",
117
+ "value"
118
+ ],
119
+ "properties": {
120
+ "key": {
121
+ "type": "string",
122
+ "minLength": 1,
123
+ "maxLength": 64,
124
+ "description": "Names the key from the domain read; `price` is a key every domain has."
125
+ },
126
+ "op": {
127
+ "anyOf": [
128
+ {
129
+ "type": "string",
130
+ "const": "eq"
131
+ },
132
+ {
133
+ "type": "string",
134
+ "const": "neq"
135
+ },
136
+ {
137
+ "type": "string",
138
+ "const": "gte"
139
+ },
140
+ {
141
+ "type": "string",
142
+ "const": "lte"
143
+ },
144
+ {
145
+ "type": "string",
146
+ "const": "in"
147
+ },
148
+ {
149
+ "type": "string",
150
+ "const": "nin"
151
+ }
152
+ ],
153
+ "description": "Sends the operator the domain read listed for this key."
154
+ },
155
+ "value": {
156
+ "description": "Sends the desired value, typed by the key's type."
157
+ },
158
+ "currency": {
159
+ "type": "string",
160
+ "pattern": "^[A-Z]{3}$",
161
+ "minLength": 3,
162
+ "maxLength": 3,
163
+ "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."
164
+ }
165
+ },
166
+ "additionalProperties": false
167
+ },
168
+ "maxItems": 32,
169
+ "description": "Sends the seller terms the buyer settled; each offer answers them in `seller_fit`."
170
+ },
171
+ "brief": {
172
+ "type": "string",
173
+ "minLength": 1,
174
+ "maxLength": 256,
175
+ "description": "Ties the call to a brief in sil’s record; never required."
176
+ }
24
177
  },
25
- "minItems": 1,
26
- "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."
178
+ "additionalProperties": false
28
179
  }
29
- },
30
- "additionalProperties": false
180
+ ],
181
+ "type": "object"
31
182
  }
@@ -13,18 +13,13 @@
13
13
  "const": "ok",
14
14
  "description": "Reads the answer. Every other status arrives as an error body carrying recovery."
15
15
  },
16
- "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."
21
- },
22
16
  "offers": {
23
17
  "type": "array",
24
18
  "items": {
25
19
  "type": "object",
26
20
  "required": [
27
21
  "variant_id",
22
+ "title",
28
23
  "seller_id",
29
24
  "seller_name",
30
25
  "price",
@@ -39,7 +34,11 @@
39
34
  "type": "string",
40
35
  "minLength": 1,
41
36
  "maxLength": 256,
42
- "description": "Matches the offer to the pick."
37
+ "description": "Matches the offer to the pick; passes it to the dossier."
38
+ },
39
+ "title": {
40
+ "type": "string",
41
+ "description": "Names what the listing sells."
43
42
  },
44
43
  "seller_id": {
45
44
  "type": "string",
@@ -49,7 +48,7 @@
49
48
  },
50
49
  "seller_name": {
51
50
  "type": "string",
52
- "description": "Names the shop to the buyer."
51
+ "description": "Names the shop."
53
52
  },
54
53
  "price": {
55
54
  "type": "string",
@@ -95,7 +94,7 @@
95
94
  "observed_at": {
96
95
  "type": "string",
97
96
  "format": "date-time",
98
- "description": "Dates the price to the buyer — this offer was read live, at this moment."
97
+ "description": "Dates the price: when sil last read it."
99
98
  },
100
99
  "url": {
101
100
  "type": "string",
@@ -165,7 +164,18 @@
165
164
  },
166
165
  "additionalProperties": false
167
166
  },
168
- "description": "Lists where the pick can be bought — one variant at one seller per entry."
167
+ "description": "Lists where it can be bought, best for the buyer first."
168
+ },
169
+ "pending": {
170
+ "type": "array",
171
+ "items": {
172
+ "type": "string",
173
+ "minLength": 1,
174
+ "maxLength": 256,
175
+ "description": "Names a variant whose offers sil is still finding."
176
+ },
177
+ "maxItems": 10,
178
+ "description": "Names the asked variants whose offers sil is still finding; ask again in a few seconds."
169
179
  }
170
180
  },
171
181
  "additionalProperties": false
@@ -16,8 +16,8 @@
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 variant ids it wants the whole of; one sil holds no product for is named in `not_held`."
21
21
  }
22
22
  },
23
23
  "additionalProperties": false
@@ -29,7 +29,7 @@
29
29
  "type": "string",
30
30
  "minLength": 1,
31
31
  "maxLength": 256,
32
- "description": "Matches the entry back to the id it asked for."
32
+ "description": "Matches the entry to the id asked for."
33
33
  },
34
34
  "title": {
35
35
  "type": "string",
@@ -37,18 +37,20 @@
37
37
  },
38
38
  "brand": {
39
39
  "type": "string",
40
- "description": "Names the maker to the buyer."
40
+ "description": "Names the maker."
41
41
  },
42
42
  "description": {
43
43
  "type": "string",
44
- "description": "Quotes the page's own product description."
44
+ "maxLength": 1000,
45
+ "description": "Quotes the page's own description, cut at a word where it is long."
45
46
  },
46
47
  "images": {
47
48
  "type": "array",
48
49
  "items": {
49
50
  "type": "string"
50
51
  },
51
- "description": "Shows it to the buyer."
52
+ "maxItems": 5,
53
+ "description": "Shows it."
52
54
  },
53
55
  "specs": {
54
56
  "type": "object",
@@ -63,11 +65,17 @@
63
65
  },
64
66
  {
65
67
  "type": "string"
68
+ },
69
+ {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ }
66
74
  }
67
75
  ]
68
76
  }
69
77
  },
70
- "description": "Compares the shortlist on every key sil holds — the product's values and this variant's own — not only the asked ones."
78
+ "description": "Compares on every key sil holds."
71
79
  },
72
80
  "sources": {
73
81
  "type": "array",
@@ -92,29 +100,124 @@
92
100
  },
93
101
  "description": "Says where and when sil read them."
94
102
  },
95
- "webpage_info": {
103
+ "reviews": {
96
104
  "type": "object",
97
105
  "required": [
98
- "url",
99
- "text"
106
+ "count",
107
+ "praised",
108
+ "complained",
109
+ "sources"
100
110
  ],
101
111
  "properties": {
102
- "url": {
103
- "type": "string",
104
- "description": "Links the page it read the words off."
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."
105
137
  },
106
- "text": {
107
- "type": "string",
108
- "description": "Reads the whole page in the shop's own words for what sil has not keyed yet — a provisional read, never a verified one."
138
+ "praised": {
139
+ "type": "array",
140
+ "items": {
141
+ "type": "string",
142
+ "minLength": 1,
143
+ "maxLength": 256,
144
+ "description": "One thing reviewers praise."
145
+ },
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."
156
+ },
157
+ "maxItems": 5,
158
+ "description": "Says what reviewers complain of, most often first."
159
+ },
160
+ "sources": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "object",
164
+ "required": [
165
+ "name",
166
+ "url",
167
+ "date"
168
+ ],
169
+ "properties": {
170
+ "name": {
171
+ "type": "string",
172
+ "description": "Names the site or reviewer."
173
+ },
174
+ "url": {
175
+ "type": "string",
176
+ "description": "Hands the buyer the reviews."
177
+ },
178
+ "date": {
179
+ "type": "string",
180
+ "format": "date",
181
+ "description": "Dates the latest review read there."
182
+ }
183
+ },
184
+ "additionalProperties": false
185
+ },
186
+ "minItems": 1,
187
+ "maxItems": 5,
188
+ "description": "Cites where, and how recent."
109
189
  }
110
190
  },
111
191
  "additionalProperties": false,
112
- "description": "Reads a page sil has not read yet, in the page's own words."
192
+ "description": "Tells the buyer what other buyers said, from the reviews sil holds; absent until it holds any."
193
+ }
194
+ },
195
+ "additionalProperties": false
196
+ },
197
+ "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."
113
215
  }
114
216
  },
115
217
  "additionalProperties": false
116
218
  },
117
- "description": "Reads the whole of what sil knows before recommending."
219
+ "minItems": 1,
220
+ "description": "Names each id sil holds no product for; the agent says so and searches."
118
221
  }
119
222
  },
120
223
  "additionalProperties": false
@@ -4,35 +4,15 @@
4
4
  "title": "sil shopping_search — request",
5
5
  "type": "object",
6
6
  "required": [
7
- "brief",
8
7
  "domain",
9
- "query",
10
8
  "n"
11
9
  ],
12
10
  "properties": {
13
- "brief": {
14
- "type": "string",
15
- "minLength": 1,
16
- "maxLength": 256,
17
- "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`."
18
- },
19
11
  "domain": {
20
12
  "type": "string",
21
13
  "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)*$",
22
14
  "maxLength": 255,
23
- "description": "Sends the path the domain read returned."
24
- },
25
- "query": {
26
- "type": "string",
27
- "minLength": 1,
28
- "maxLength": 512,
29
- "description": "Sends the shopping words: the thing as a shop lists it and the numbers that pick the product, never a sentence."
30
- },
31
- "n": {
32
- "type": "integer",
33
- "minimum": 1,
34
- "maximum": 10,
35
- "description": "Asks for this many variants — one size or one colour each, grouped under their products."
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`."
36
16
  },
37
17
  "specs": {
38
18
  "type": "array",
@@ -93,13 +73,24 @@
93
73
  "additionalProperties": false
94
74
  },
95
75
  "maxItems": 32,
96
- "description": "Sends the product specs this search asks, written by the agent from the brief's; a key the domain does not hold is recorded, never refused."
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."
77
+ },
78
+ "query": {
79
+ "type": "string",
80
+ "minLength": 1,
81
+ "maxLength": 512,
82
+ "description": "Sends words only for what no spec holds, never a sentence."
97
83
  },
98
- "ship_to": {
84
+ "n": {
85
+ "type": "integer",
86
+ "minimum": 1,
87
+ "description": "Asks for this many variants; at most 10, a larger ask is served at that."
88
+ },
89
+ "brief": {
99
90
  "type": "string",
100
91
  "minLength": 1,
101
- "maxLength": 64,
102
- "description": "Leave this out: sil then localizes the search to the buyer's default address. Send it only when the buyer named another address, as the exact `label` `sil_whoami` lists — never a word like \"default\", never a country. It excludes no seller anywhere else — where the seller is, is the seller spec `country`, on the brief, for the offers to read."
92
+ "maxLength": 256,
93
+ "description": "Ties the call to a brief in sil’s record; never required."
103
94
  }
104
95
  },
105
96
  "additionalProperties": false