wiki-plugin-similarity 0.9.0 → 0.11.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.
- package/api/openapi.json +646 -0
- package/client/similarity.js +32 -31
- package/client/similarity.js.map +3 -3
- package/package.json +10 -3
- package/pages/about-similarity-plugin +54 -4
- package/server/farm-lib.js +5 -2
- package/server/farm-search.js +41 -1
- package/server/galaxy-vectors.js +74 -0
- package/server/search-report.js +0 -0
- package/server/server.js +116 -11
- package/server/site-report.js +184 -0
package/api/openapi.json
ADDED
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Similarity",
|
|
5
|
+
"version": "0.10.0",
|
|
6
|
+
"description": "Semantic and federated search across a wiki farm — the READER half of the pair, with wiki-plugin-semindex as the writer. These routes are served by this plugin’s own server and described here rather than mounted by the farm. Most of them could not be mounted: they gate on the caller, count requests per address, pass bytes through from disk, or answer with status codes that carry meaning — and a farm handler is a plain function that never sees the request."
|
|
7
|
+
},
|
|
8
|
+
"paths": {
|
|
9
|
+
"/system/indexed-domains.json": {
|
|
10
|
+
"get": {
|
|
11
|
+
"x-fedwiki-served-by": "plugin",
|
|
12
|
+
"x-fedwiki-read-only": true,
|
|
13
|
+
"operationId": "indexedDomains",
|
|
14
|
+
"summary": "Which sites have vectors",
|
|
15
|
+
"description": "Every site on this farm carrying a semantic index, with how many pages are in it. Reads the index files off disk; no embedding, so it is cheap.",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"name": "pattern",
|
|
19
|
+
"in": "query",
|
|
20
|
+
"required": false,
|
|
21
|
+
"description": "Comma-separated globs, or the words PUBLIC, LOCAL and PRIVATE.",
|
|
22
|
+
"schema": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"default": "*"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "limit",
|
|
29
|
+
"in": "query",
|
|
30
|
+
"required": false,
|
|
31
|
+
"description": "Stop after this many.",
|
|
32
|
+
"schema": {
|
|
33
|
+
"type": "integer"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"responses": {
|
|
38
|
+
"200": {
|
|
39
|
+
"description": "Indexed sites, largest index first.",
|
|
40
|
+
"content": {
|
|
41
|
+
"application/json": {
|
|
42
|
+
"schema": {
|
|
43
|
+
"$ref": "#/components/schemas/IndexedDomain"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"/system/semantic-vectors.json": {
|
|
52
|
+
"get": {
|
|
53
|
+
"x-fedwiki-served-by": "plugin",
|
|
54
|
+
"x-fedwiki-read-only": true,
|
|
55
|
+
"operationId": "semanticVectors",
|
|
56
|
+
"summary": "One site's page vectors",
|
|
57
|
+
"description": "The whole vector file for a site, passed through from disk rather than re-serialised — which is why the farm could not mount this even if it wanted to: a handler returns a value, not bytes.",
|
|
58
|
+
"parameters": [
|
|
59
|
+
{
|
|
60
|
+
"name": "domain",
|
|
61
|
+
"in": "query",
|
|
62
|
+
"required": false,
|
|
63
|
+
"description": "Which site. Defaults to the one you asked.",
|
|
64
|
+
"schema": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"responses": {
|
|
70
|
+
"200": {
|
|
71
|
+
"description": "The vector file, verbatim."
|
|
72
|
+
},
|
|
73
|
+
"404": {
|
|
74
|
+
"description": "That site has no index."
|
|
75
|
+
},
|
|
76
|
+
"500": {
|
|
77
|
+
"description": "The index file could not be read."
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"/system/embed.json": {
|
|
83
|
+
"get": {
|
|
84
|
+
"x-fedwiki-served-by": "plugin",
|
|
85
|
+
"x-fedwiki-read-only": true,
|
|
86
|
+
"operationId": "embed",
|
|
87
|
+
"summary": "Turn one text into a vector",
|
|
88
|
+
"description": "Embeds a string with this farm's model. Distinct from semindex's embed route, which is the writer's and is rate-limited; this one is the reader's.",
|
|
89
|
+
"parameters": [
|
|
90
|
+
{
|
|
91
|
+
"name": "text",
|
|
92
|
+
"in": "query",
|
|
93
|
+
"required": true,
|
|
94
|
+
"description": "The text to embed.",
|
|
95
|
+
"schema": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"x-fedwiki-example": "federated wiki"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"responses": {
|
|
102
|
+
"200": {
|
|
103
|
+
"description": "The vector.",
|
|
104
|
+
"content": {
|
|
105
|
+
"application/json": {
|
|
106
|
+
"schema": {
|
|
107
|
+
"$ref": "#/components/schemas/Vector"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"400": {
|
|
113
|
+
"description": "No text was given."
|
|
114
|
+
},
|
|
115
|
+
"502": {
|
|
116
|
+
"description": "The embedder failed."
|
|
117
|
+
},
|
|
118
|
+
"503": {
|
|
119
|
+
"description": "The embedder is down — a distinct code, because it means try later rather than try differently."
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"/system/similarity-health.json": {
|
|
125
|
+
"get": {
|
|
126
|
+
"x-fedwiki-served-by": "plugin",
|
|
127
|
+
"x-fedwiki-read-only": true,
|
|
128
|
+
"operationId": "health",
|
|
129
|
+
"summary": "Which model, and is it up",
|
|
130
|
+
"description": "The model, its dimensions, and the state of the embedder supervisor — or, where the farm delegates embedding elsewhere, the address it delegates to.",
|
|
131
|
+
"responses": {
|
|
132
|
+
"200": {
|
|
133
|
+
"description": "Model and embedder state.",
|
|
134
|
+
"content": {
|
|
135
|
+
"application/json": {
|
|
136
|
+
"schema": {
|
|
137
|
+
"$ref": "#/components/schemas/Health"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"/system/search-report.json": {
|
|
146
|
+
"post": {
|
|
147
|
+
"x-fedwiki-served-by": "plugin",
|
|
148
|
+
"x-fedwiki-read-only": true,
|
|
149
|
+
"operationId": "searchReport",
|
|
150
|
+
"summary": "Semantic search, as a page",
|
|
151
|
+
"description": "Searches the farm semantically and answers with a wiki page rather than a result list. Optionally continues into peer farms. Takes a JSON body, which the farm cannot express as a mounted operation today — it reads query parameters only.",
|
|
152
|
+
"requestBody": {
|
|
153
|
+
"required": true,
|
|
154
|
+
"content": {
|
|
155
|
+
"application/json": {
|
|
156
|
+
"schema": {
|
|
157
|
+
"$ref": "#/components/schemas/ReportRequest"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"responses": {
|
|
163
|
+
"200": {
|
|
164
|
+
"description": "A wiki page of results."
|
|
165
|
+
},
|
|
166
|
+
"400": {
|
|
167
|
+
"description": "No query was given."
|
|
168
|
+
},
|
|
169
|
+
"500": {
|
|
170
|
+
"description": "The search failed."
|
|
171
|
+
},
|
|
172
|
+
"503": {
|
|
173
|
+
"description": "The embedder is down."
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"/system/site-report.json": {
|
|
179
|
+
"post": {
|
|
180
|
+
"x-fedwiki-served-by": "plugin",
|
|
181
|
+
"x-fedwiki-read-only": true,
|
|
182
|
+
"operationId": "siteReport",
|
|
183
|
+
"summary": "Which site should this page go on?",
|
|
184
|
+
"description": "Aggregates the semantic page scan per domain and ranks the farm's sites for a topic: 0.7 × mean of the top 5 page similarities + 0.3 × site-centroid similarity. Forked pages count for every site that carries them. Send a title plus first paragraphs — the embedder truncates around 512 tokens. Takes a JSON body.",
|
|
185
|
+
"requestBody": {
|
|
186
|
+
"required": true,
|
|
187
|
+
"content": {
|
|
188
|
+
"application/json": {
|
|
189
|
+
"schema": {
|
|
190
|
+
"$ref": "#/components/schemas/SiteReportRequest"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"responses": {
|
|
196
|
+
"200": {
|
|
197
|
+
"description": "A wiki page of ranked sites, or flat JSON when format is 'flat'."
|
|
198
|
+
},
|
|
199
|
+
"400": {
|
|
200
|
+
"description": "No query was given."
|
|
201
|
+
},
|
|
202
|
+
"500": {
|
|
203
|
+
"description": "The search failed."
|
|
204
|
+
},
|
|
205
|
+
"503": {
|
|
206
|
+
"description": "The embedder is down."
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"/system/farm-search.json": {
|
|
212
|
+
"get": {
|
|
213
|
+
"x-fedwiki-served-by": "plugin",
|
|
214
|
+
"x-fedwiki-read-only": true,
|
|
215
|
+
"operationId": "farmSearch",
|
|
216
|
+
"summary": "Search this farm",
|
|
217
|
+
"description": "Semantic search across the sites of this farm, answered as a page. Explicit hostnames that are not on disk are searched over HTTP through the galaxy cache instead.",
|
|
218
|
+
"parameters": [
|
|
219
|
+
{
|
|
220
|
+
"name": "q",
|
|
221
|
+
"in": "query",
|
|
222
|
+
"required": true,
|
|
223
|
+
"description": "What to search for.",
|
|
224
|
+
"schema": {
|
|
225
|
+
"type": "string"
|
|
226
|
+
},
|
|
227
|
+
"x-fedwiki-example": "ghost pages"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "pattern",
|
|
231
|
+
"in": "query",
|
|
232
|
+
"required": false,
|
|
233
|
+
"description": "Which sites — globs, or PUBLIC, LOCAL, PRIVATE.",
|
|
234
|
+
"schema": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"default": "*"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "limit",
|
|
241
|
+
"in": "query",
|
|
242
|
+
"required": false,
|
|
243
|
+
"description": "How many results.",
|
|
244
|
+
"schema": {
|
|
245
|
+
"type": "integer",
|
|
246
|
+
"default": 10
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "farms",
|
|
251
|
+
"in": "query",
|
|
252
|
+
"required": false,
|
|
253
|
+
"description": "Comma-separated peer farms to continue the search into.",
|
|
254
|
+
"schema": {
|
|
255
|
+
"type": "string"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"responses": {
|
|
260
|
+
"200": {
|
|
261
|
+
"description": "A wiki page of results."
|
|
262
|
+
},
|
|
263
|
+
"400": {
|
|
264
|
+
"description": "No q was given."
|
|
265
|
+
},
|
|
266
|
+
"500": {
|
|
267
|
+
"description": "The search failed."
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"/system/galaxy-search.json": {
|
|
273
|
+
"get": {
|
|
274
|
+
"x-fedwiki-served-by": "plugin",
|
|
275
|
+
"x-fedwiki-read-only": true,
|
|
276
|
+
"operationId": "galaxySearch",
|
|
277
|
+
"summary": "Search named sites elsewhere",
|
|
278
|
+
"description": "Searches sites this farm does not hold, over HTTP, through the galaxy cache. Unlike farm-search the sites must be named — there is no glob over somebody else’s farm.",
|
|
279
|
+
"parameters": [
|
|
280
|
+
{
|
|
281
|
+
"name": "q",
|
|
282
|
+
"in": "query",
|
|
283
|
+
"required": true,
|
|
284
|
+
"description": "What to search for.",
|
|
285
|
+
"schema": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"x-fedwiki-example": "ghost pages"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "sites",
|
|
292
|
+
"in": "query",
|
|
293
|
+
"required": true,
|
|
294
|
+
"description": "Comma-separated hostnames to search.",
|
|
295
|
+
"schema": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "limit",
|
|
301
|
+
"in": "query",
|
|
302
|
+
"required": false,
|
|
303
|
+
"description": "How many results.",
|
|
304
|
+
"schema": {
|
|
305
|
+
"type": "integer",
|
|
306
|
+
"default": 10
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "format",
|
|
311
|
+
"in": "query",
|
|
312
|
+
"required": false,
|
|
313
|
+
"description": "Ask for the raw outcome instead of a page.",
|
|
314
|
+
"schema": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"enum": [
|
|
317
|
+
"flat"
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"responses": {
|
|
323
|
+
"200": {
|
|
324
|
+
"description": "A wiki page of results, or the flat outcome."
|
|
325
|
+
},
|
|
326
|
+
"400": {
|
|
327
|
+
"description": "q or sites was missing."
|
|
328
|
+
},
|
|
329
|
+
"500": {
|
|
330
|
+
"description": "The search failed."
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"/system/peer-hello.json": {
|
|
336
|
+
"get": {
|
|
337
|
+
"x-fedwiki-served-by": "plugin",
|
|
338
|
+
"x-fedwiki-read-only": true,
|
|
339
|
+
"operationId": "peerHello",
|
|
340
|
+
"summary": "Does this farm federate",
|
|
341
|
+
"description": "A capability probe another farm reads before asking anything of this one. Static, cached for an hour, and costs no embedding. A 404 or HTML here means the plugin is absent — which is the answer it is really there to give. It advertises no grants: what this farm will actually answer is decided per site, and only when asked.",
|
|
342
|
+
"responses": {
|
|
343
|
+
"200": {
|
|
344
|
+
"description": "What this farm is and whether it federates.",
|
|
345
|
+
"content": {
|
|
346
|
+
"application/json": {
|
|
347
|
+
"schema": {
|
|
348
|
+
"$ref": "#/components/schemas/PeerHello"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"/system/peer-search.json": {
|
|
357
|
+
"post": {
|
|
358
|
+
"x-fedwiki-served-by": "plugin",
|
|
359
|
+
"x-fedwiki-read-only": true,
|
|
360
|
+
"operationId": "peerSearch",
|
|
361
|
+
"summary": "Search on behalf of another farm",
|
|
362
|
+
"description": "Federated search from a peer. Two keys must turn: the farm admin’s ceiling, and each site’s own grants page. The scope for a caller is exactly the union of sites that granted it — one site’s grant never opens the farm. Login-to-view sites are excluded unconditionally. Guarded by hop limit, request-id dedup, and rate limits keyed on the caller’s address, none of which a farm-mounted handler could apply, because it never sees the request.",
|
|
363
|
+
"requestBody": {
|
|
364
|
+
"required": true,
|
|
365
|
+
"content": {
|
|
366
|
+
"application/json": {
|
|
367
|
+
"schema": {
|
|
368
|
+
"$ref": "#/components/schemas/PeerEnvelope"
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"responses": {
|
|
374
|
+
"200": {
|
|
375
|
+
"description": "Results from the sites that granted this caller."
|
|
376
|
+
},
|
|
377
|
+
"400": {
|
|
378
|
+
"description": "No query was given."
|
|
379
|
+
},
|
|
380
|
+
"403": {
|
|
381
|
+
"description": "No site on this farm grants federated search to that origin."
|
|
382
|
+
},
|
|
383
|
+
"429": {
|
|
384
|
+
"description": "Too many requests from this caller, or from everyone at once."
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
"/system/build-index.json": {
|
|
390
|
+
"get": {
|
|
391
|
+
"x-fedwiki-served-by": "plugin",
|
|
392
|
+
"x-fedwiki-writes": true,
|
|
393
|
+
"operationId": "buildIndex",
|
|
394
|
+
"summary": "Ask for an index build",
|
|
395
|
+
"description": "Delegates: to a remote indexer if one is configured, otherwise to semindex in this process, otherwise it says plainly that there is none. Owner or admin only in the local case.",
|
|
396
|
+
"parameters": [
|
|
397
|
+
{
|
|
398
|
+
"name": "domains",
|
|
399
|
+
"in": "query",
|
|
400
|
+
"required": false,
|
|
401
|
+
"description": "Comma-separated globs naming which sites to index.",
|
|
402
|
+
"schema": {
|
|
403
|
+
"type": "string",
|
|
404
|
+
"default": "*"
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "force",
|
|
409
|
+
"in": "query",
|
|
410
|
+
"required": false,
|
|
411
|
+
"description": "Rebuild even where the index looks current.",
|
|
412
|
+
"schema": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"enum": [
|
|
415
|
+
"0",
|
|
416
|
+
"1"
|
|
417
|
+
],
|
|
418
|
+
"default": "0"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
"responses": {
|
|
423
|
+
"200": {
|
|
424
|
+
"description": "What was queued."
|
|
425
|
+
},
|
|
426
|
+
"403": {
|
|
427
|
+
"description": "Not the owner or an admin."
|
|
428
|
+
},
|
|
429
|
+
"409": {
|
|
430
|
+
"description": "The local indexer is not running as a writer."
|
|
431
|
+
},
|
|
432
|
+
"501": {
|
|
433
|
+
"description": "No indexer at all — install semindex, point at a remote one, or let indexes arrive by sync."
|
|
434
|
+
},
|
|
435
|
+
"502": {
|
|
436
|
+
"description": "The remote indexer could not be reached."
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"components": {
|
|
443
|
+
"schemas": {
|
|
444
|
+
"IndexedDomain": {
|
|
445
|
+
"type": "object",
|
|
446
|
+
"properties": {
|
|
447
|
+
"domain": {
|
|
448
|
+
"type": "string"
|
|
449
|
+
},
|
|
450
|
+
"page_count": {
|
|
451
|
+
"type": [
|
|
452
|
+
"integer",
|
|
453
|
+
"null"
|
|
454
|
+
],
|
|
455
|
+
"description": "Null when the index exists but could not be counted."
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"Vector": {
|
|
460
|
+
"type": "object",
|
|
461
|
+
"properties": {
|
|
462
|
+
"vector": {
|
|
463
|
+
"type": "array",
|
|
464
|
+
"items": {
|
|
465
|
+
"type": "number"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"Health": {
|
|
471
|
+
"type": "object",
|
|
472
|
+
"properties": {
|
|
473
|
+
"plugin": {
|
|
474
|
+
"type": "string"
|
|
475
|
+
},
|
|
476
|
+
"version": {
|
|
477
|
+
"type": "string"
|
|
478
|
+
},
|
|
479
|
+
"model": {
|
|
480
|
+
"type": "string"
|
|
481
|
+
},
|
|
482
|
+
"dim": {
|
|
483
|
+
"type": "integer"
|
|
484
|
+
},
|
|
485
|
+
"quantized": {
|
|
486
|
+
"type": "boolean"
|
|
487
|
+
},
|
|
488
|
+
"embedder": {
|
|
489
|
+
"type": "object",
|
|
490
|
+
"description": "The supervisor’s state, or {via, url} where embedding is delegated elsewhere."
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"PeerHello": {
|
|
495
|
+
"type": "object",
|
|
496
|
+
"properties": {
|
|
497
|
+
"plugin": {
|
|
498
|
+
"type": "string"
|
|
499
|
+
},
|
|
500
|
+
"version": {
|
|
501
|
+
"type": "string"
|
|
502
|
+
},
|
|
503
|
+
"model": {
|
|
504
|
+
"type": "string"
|
|
505
|
+
},
|
|
506
|
+
"dim": {
|
|
507
|
+
"type": "integer"
|
|
508
|
+
},
|
|
509
|
+
"site": {
|
|
510
|
+
"type": "string"
|
|
511
|
+
},
|
|
512
|
+
"federation": {
|
|
513
|
+
"type": "object",
|
|
514
|
+
"properties": {
|
|
515
|
+
"enabled": {
|
|
516
|
+
"type": "boolean"
|
|
517
|
+
},
|
|
518
|
+
"kinds": {
|
|
519
|
+
"type": "array",
|
|
520
|
+
"items": {
|
|
521
|
+
"type": "string"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"hopsAccepted": {
|
|
525
|
+
"type": "integer"
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"ReportRequest": {
|
|
532
|
+
"type": "object",
|
|
533
|
+
"required": [
|
|
534
|
+
"query"
|
|
535
|
+
],
|
|
536
|
+
"properties": {
|
|
537
|
+
"query": {
|
|
538
|
+
"type": "string"
|
|
539
|
+
},
|
|
540
|
+
"domains": {
|
|
541
|
+
"type": "array",
|
|
542
|
+
"items": {
|
|
543
|
+
"type": "string"
|
|
544
|
+
},
|
|
545
|
+
"default": [
|
|
546
|
+
"*"
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
"limit": {
|
|
550
|
+
"type": "integer",
|
|
551
|
+
"default": 10
|
|
552
|
+
},
|
|
553
|
+
"threshold": {
|
|
554
|
+
"type": [
|
|
555
|
+
"number",
|
|
556
|
+
"null"
|
|
557
|
+
],
|
|
558
|
+
"description": "Minimum similarity to keep."
|
|
559
|
+
},
|
|
560
|
+
"live": {
|
|
561
|
+
"type": "boolean",
|
|
562
|
+
"description": "Embed the query now rather than reusing a cached vector."
|
|
563
|
+
},
|
|
564
|
+
"farms": {
|
|
565
|
+
"type": "array",
|
|
566
|
+
"items": {
|
|
567
|
+
"type": "string"
|
|
568
|
+
},
|
|
569
|
+
"description": "Peer farms to continue into. At most eight are asked."
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
"PeerEnvelope": {
|
|
574
|
+
"type": "object",
|
|
575
|
+
"required": [
|
|
576
|
+
"query",
|
|
577
|
+
"origin"
|
|
578
|
+
],
|
|
579
|
+
"properties": {
|
|
580
|
+
"query": {
|
|
581
|
+
"type": "string"
|
|
582
|
+
},
|
|
583
|
+
"origin": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"description": "The farm asking. Grants are keyed on this."
|
|
586
|
+
},
|
|
587
|
+
"kind": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"enum": [
|
|
590
|
+
"report",
|
|
591
|
+
"keyword"
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"limit": {
|
|
595
|
+
"type": "integer",
|
|
596
|
+
"default": 10
|
|
597
|
+
},
|
|
598
|
+
"hops": {
|
|
599
|
+
"type": "integer",
|
|
600
|
+
"description": "How far this request has already travelled. This farm accepts zero."
|
|
601
|
+
},
|
|
602
|
+
"requestId": {
|
|
603
|
+
"type": "string",
|
|
604
|
+
"description": "Used to drop a request that arrives twice."
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
"SiteReportRequest": {
|
|
609
|
+
"type": "object",
|
|
610
|
+
"required": [
|
|
611
|
+
"query"
|
|
612
|
+
],
|
|
613
|
+
"properties": {
|
|
614
|
+
"query": {
|
|
615
|
+
"type": "string"
|
|
616
|
+
},
|
|
617
|
+
"domains": {
|
|
618
|
+
"type": "array",
|
|
619
|
+
"items": {
|
|
620
|
+
"type": "string"
|
|
621
|
+
},
|
|
622
|
+
"default": [
|
|
623
|
+
"*"
|
|
624
|
+
]
|
|
625
|
+
},
|
|
626
|
+
"limit": {
|
|
627
|
+
"type": "integer",
|
|
628
|
+
"default": 10,
|
|
629
|
+
"description": "Sites returned."
|
|
630
|
+
},
|
|
631
|
+
"format": {
|
|
632
|
+
"type": [
|
|
633
|
+
"string",
|
|
634
|
+
"null"
|
|
635
|
+
],
|
|
636
|
+
"enum": [
|
|
637
|
+
"flat",
|
|
638
|
+
null
|
|
639
|
+
],
|
|
640
|
+
"description": "'flat' answers plain JSON with per-site scores and evidence; default answers a wiki page."
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|