@agentproto/corpus-cli 0.11.6 → 0.11.8

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.
@@ -0,0 +1,241 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-79/pickup.schema.json",
4
+ "title": "collect.pickup/v1",
5
+ "description": "A link between an item and a later item that republishes or cites it. verified is true exactly for link, content_id and declared; link and content_id need evidence and evidence.rawRef; declared needs an excerpt, an outbound link or an outlet.",
6
+ "type": "object",
7
+ "properties": {
8
+ "itemId": {
9
+ "type": "string",
10
+ "minLength": 1
11
+ },
12
+ "kind": {
13
+ "type": "string",
14
+ "enum": [
15
+ "media_pickup",
16
+ "crosspost",
17
+ "media_publication"
18
+ ]
19
+ },
20
+ "pickupItemId": {
21
+ "type": "string"
22
+ },
23
+ "pickupUrl": {
24
+ "type": "string"
25
+ },
26
+ "outlet": {
27
+ "type": "string"
28
+ },
29
+ "relation": {
30
+ "type": "string",
31
+ "enum": [
32
+ "republication",
33
+ "citation"
34
+ ]
35
+ },
36
+ "evidence": {
37
+ "type": "object",
38
+ "properties": {
39
+ "outboundLink": {
40
+ "type": "string"
41
+ },
42
+ "excerpt": {
43
+ "type": "string"
44
+ },
45
+ "similarity": {
46
+ "type": "number",
47
+ "minimum": 0,
48
+ "maximum": 1
49
+ },
50
+ "rawRef": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ },
55
+ "method": {
56
+ "type": "string",
57
+ "enum": [
58
+ "link",
59
+ "content_id",
60
+ "near_text",
61
+ "declared",
62
+ "legacy_flag"
63
+ ]
64
+ },
65
+ "verified": {
66
+ "type": "boolean"
67
+ },
68
+ "firstSeenAt": {
69
+ "type": "string",
70
+ "format": "date-time",
71
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
72
+ },
73
+ "measuredAt": {
74
+ "type": "string",
75
+ "format": "date-time",
76
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
77
+ },
78
+ "runId": {
79
+ "type": "string"
80
+ },
81
+ "taskId": {
82
+ "type": "string"
83
+ },
84
+ "recordKey": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ "required": [
89
+ "itemId",
90
+ "kind",
91
+ "relation",
92
+ "evidence",
93
+ "method",
94
+ "verified",
95
+ "firstSeenAt",
96
+ "measuredAt"
97
+ ],
98
+ "allOf": [
99
+ {
100
+ "if": {
101
+ "properties": {
102
+ "method": {
103
+ "enum": [
104
+ "link",
105
+ "content_id",
106
+ "declared"
107
+ ]
108
+ }
109
+ },
110
+ "required": [
111
+ "method"
112
+ ]
113
+ },
114
+ "then": {
115
+ "properties": {
116
+ "verified": {
117
+ "const": true
118
+ }
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "if": {
124
+ "properties": {
125
+ "method": {
126
+ "enum": [
127
+ "near_text",
128
+ "legacy_flag"
129
+ ]
130
+ }
131
+ },
132
+ "required": [
133
+ "method"
134
+ ]
135
+ },
136
+ "then": {
137
+ "properties": {
138
+ "verified": {
139
+ "const": false
140
+ }
141
+ }
142
+ }
143
+ },
144
+ {
145
+ "if": {
146
+ "properties": {
147
+ "method": {
148
+ "enum": [
149
+ "link",
150
+ "content_id"
151
+ ]
152
+ }
153
+ },
154
+ "required": [
155
+ "method"
156
+ ]
157
+ },
158
+ "then": {
159
+ "required": [
160
+ "evidence"
161
+ ],
162
+ "properties": {
163
+ "evidence": {
164
+ "required": [
165
+ "rawRef"
166
+ ],
167
+ "properties": {
168
+ "rawRef": {
169
+ "minLength": 1
170
+ }
171
+ },
172
+ "anyOf": [
173
+ {
174
+ "required": [
175
+ "outboundLink"
176
+ ]
177
+ },
178
+ {
179
+ "required": [
180
+ "excerpt"
181
+ ]
182
+ },
183
+ {
184
+ "required": [
185
+ "similarity"
186
+ ]
187
+ }
188
+ ]
189
+ }
190
+ }
191
+ }
192
+ },
193
+ {
194
+ "if": {
195
+ "properties": {
196
+ "method": {
197
+ "const": "declared"
198
+ }
199
+ },
200
+ "required": [
201
+ "method"
202
+ ]
203
+ },
204
+ "then": {
205
+ "anyOf": [
206
+ {
207
+ "required": [
208
+ "evidence"
209
+ ],
210
+ "properties": {
211
+ "evidence": {
212
+ "anyOf": [
213
+ {
214
+ "required": [
215
+ "outboundLink"
216
+ ]
217
+ },
218
+ {
219
+ "required": [
220
+ "excerpt"
221
+ ]
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ },
227
+ {
228
+ "required": [
229
+ "outlet"
230
+ ],
231
+ "properties": {
232
+ "outlet": {
233
+ "minLength": 1
234
+ }
235
+ }
236
+ }
237
+ ]
238
+ }
239
+ }
240
+ ]
241
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-79/plan.schema.json",
4
+ "title": "collect.plan/v1",
5
+ "description": "One root task of a run, as written in the plan.",
6
+ "type": "object",
7
+ "properties": {
8
+ "taskId": {
9
+ "type": "string",
10
+ "minLength": 1
11
+ },
12
+ "connector": {
13
+ "type": "string",
14
+ "minLength": 1
15
+ },
16
+ "order": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "integer",
20
+ "minimum": 0,
21
+ "maximum": 9007199254740991
22
+ }
23
+ },
24
+ "payload": {
25
+ "type": "object",
26
+ "propertyNames": {
27
+ "type": "string"
28
+ },
29
+ "additionalProperties": {}
30
+ }
31
+ },
32
+ "required": [
33
+ "taskId",
34
+ "connector",
35
+ "order",
36
+ "payload"
37
+ ]
38
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-79/raw-index.schema.json",
4
+ "title": "collect.raw-index/v1",
5
+ "description": "One line of the raw index: where a fetched body lives and how it was fetched.",
6
+ "type": "object",
7
+ "properties": {
8
+ "ref": {
9
+ "type": "string",
10
+ "minLength": 1
11
+ },
12
+ "connector": {
13
+ "type": "string",
14
+ "minLength": 1
15
+ },
16
+ "hash": {
17
+ "type": "string",
18
+ "minLength": 64,
19
+ "maxLength": 64
20
+ },
21
+ "ext": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "bytes": {
26
+ "type": "integer",
27
+ "minimum": 0,
28
+ "maximum": 9007199254740991
29
+ },
30
+ "url": {
31
+ "type": "string"
32
+ },
33
+ "fetchedAt": {
34
+ "type": "string",
35
+ "format": "date-time",
36
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
37
+ },
38
+ "httpStatus": {
39
+ "type": "integer",
40
+ "minimum": -9007199254740991,
41
+ "maximum": 9007199254740991
42
+ },
43
+ "transport": {
44
+ "type": "string"
45
+ },
46
+ "runId": {
47
+ "type": "string"
48
+ },
49
+ "taskId": {
50
+ "type": "string"
51
+ },
52
+ "failure": {
53
+ "type": "string",
54
+ "enum": [
55
+ "blocked",
56
+ "empty",
57
+ "network",
58
+ "http",
59
+ "challenge",
60
+ "parse",
61
+ "other"
62
+ ]
63
+ }
64
+ },
65
+ "required": [
66
+ "ref",
67
+ "connector",
68
+ "hash",
69
+ "ext",
70
+ "bytes",
71
+ "url",
72
+ "fetchedAt",
73
+ "transport"
74
+ ]
75
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-79/recipe.schema.json",
4
+ "title": "collect.recipe/v1",
5
+ "description": "A collection recipe: what to collect, from which sources, how to thin the candidates, and how hard to push. Semantic check not expressible here: each sampling band has min <= max.",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string"
10
+ },
11
+ "sources": {
12
+ "minItems": 1,
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "properties": {
17
+ "connector": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "instance": {
22
+ "type": "string"
23
+ },
24
+ "queries": {
25
+ "default": [],
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "properties": {
30
+ "text": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "subject": {
35
+ "type": "string",
36
+ "minLength": 1
37
+ }
38
+ },
39
+ "required": [
40
+ "text",
41
+ "subject"
42
+ ]
43
+ }
44
+ },
45
+ "options": {
46
+ "type": "object",
47
+ "propertyNames": {
48
+ "type": "string"
49
+ },
50
+ "additionalProperties": {}
51
+ }
52
+ },
53
+ "required": [
54
+ "connector"
55
+ ]
56
+ }
57
+ },
58
+ "window": {
59
+ "type": "object",
60
+ "properties": {
61
+ "from": {
62
+ "type": "string",
63
+ "format": "date-time",
64
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
65
+ },
66
+ "to": {
67
+ "type": "string",
68
+ "format": "date-time",
69
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
70
+ }
71
+ }
72
+ },
73
+ "sampling": {
74
+ "type": "object",
75
+ "properties": {
76
+ "bands": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "object",
80
+ "properties": {
81
+ "metric": {
82
+ "type": "string",
83
+ "enum": [
84
+ "views",
85
+ "likes",
86
+ "reposts",
87
+ "replies",
88
+ "bookmarks",
89
+ "points",
90
+ "comments",
91
+ "reactions",
92
+ "score",
93
+ "rating",
94
+ "helpfulVotes"
95
+ ]
96
+ },
97
+ "min": {
98
+ "type": "number"
99
+ },
100
+ "max": {
101
+ "type": "number"
102
+ },
103
+ "quota": {
104
+ "type": "integer",
105
+ "minimum": 0,
106
+ "maximum": 9007199254740991
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "keepMissingMetric": {
112
+ "type": "boolean"
113
+ },
114
+ "perDomainCap": {
115
+ "type": "integer",
116
+ "exclusiveMinimum": 0,
117
+ "maximum": 9007199254740991
118
+ },
119
+ "seed": {
120
+ "type": "integer",
121
+ "minimum": -9007199254740991,
122
+ "maximum": 9007199254740991
123
+ }
124
+ }
125
+ },
126
+ "caps": {
127
+ "type": "object",
128
+ "properties": {
129
+ "perConnector": {
130
+ "type": "integer",
131
+ "exclusiveMinimum": 0,
132
+ "maximum": 9007199254740991
133
+ },
134
+ "total": {
135
+ "type": "integer",
136
+ "exclusiveMinimum": 0,
137
+ "maximum": 9007199254740991
138
+ }
139
+ }
140
+ },
141
+ "workers": {
142
+ "default": 8,
143
+ "type": "integer",
144
+ "exclusiveMinimum": 0,
145
+ "maximum": 9007199254740991
146
+ },
147
+ "lookahead": {
148
+ "type": "integer",
149
+ "exclusiveMinimum": 0,
150
+ "maximum": 9007199254740991
151
+ },
152
+ "sinks": {
153
+ "type": "array",
154
+ "items": {
155
+ "type": "string"
156
+ }
157
+ }
158
+ },
159
+ "required": [
160
+ "sources"
161
+ ]
162
+ }