@agentproto/collect 0.0.0 → 0.1.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/README.md +599 -2
- package/dist/chunk-FQLYZIVI.mjs +405 -0
- package/dist/chunk-FQLYZIVI.mjs.map +1 -0
- package/dist/chunk-SOLT3HJH.mjs +213 -0
- package/dist/chunk-SOLT3HJH.mjs.map +1 -0
- package/dist/chunk-SYTQ6RN6.mjs +98 -0
- package/dist/chunk-SYTQ6RN6.mjs.map +1 -0
- package/dist/connector-DUNy3vSU.d.ts +981 -0
- package/dist/connectors.d.ts +104 -0
- package/dist/connectors.mjs +1197 -0
- package/dist/connectors.mjs.map +1 -0
- package/dist/engine-BRXHKg5A.d.ts +384 -0
- package/dist/index.d.ts +88 -583
- package/dist/index.mjs +1463 -317
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.ts +526 -0
- package/dist/node.mjs +2322 -0
- package/dist/node.mjs.map +1 -0
- package/package.json +13 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,585 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
thread: "thread";
|
|
7
|
-
submission: "submission";
|
|
8
|
-
review: "review";
|
|
9
|
-
video: "video";
|
|
10
|
-
query: "query";
|
|
11
|
-
}>;
|
|
12
|
-
type ItemKind = z.infer<typeof ItemKind>;
|
|
13
|
-
declare const MissingReason: z.ZodEnum<{
|
|
14
|
-
not_exposed: "not_exposed";
|
|
15
|
-
hidden: "hidden";
|
|
16
|
-
blocked: "blocked";
|
|
17
|
-
}>;
|
|
18
|
-
type MissingReason = z.infer<typeof MissingReason>;
|
|
19
|
-
declare const MetricName: z.ZodEnum<{
|
|
20
|
-
views: "views";
|
|
21
|
-
likes: "likes";
|
|
22
|
-
reposts: "reposts";
|
|
23
|
-
replies: "replies";
|
|
24
|
-
bookmarks: "bookmarks";
|
|
25
|
-
points: "points";
|
|
26
|
-
comments: "comments";
|
|
27
|
-
reactions: "reactions";
|
|
28
|
-
score: "score";
|
|
29
|
-
rating: "rating";
|
|
30
|
-
helpfulVotes: "helpfulVotes";
|
|
31
|
-
}>;
|
|
32
|
-
type MetricName = z.infer<typeof MetricName>;
|
|
33
|
-
declare const Subject: z.ZodObject<{
|
|
34
|
-
label: z.ZodString;
|
|
35
|
-
provenance: z.ZodEnum<{
|
|
36
|
-
query: "query";
|
|
37
|
-
source_tag: "source_tag";
|
|
38
|
-
classifier: "classifier";
|
|
39
|
-
}>;
|
|
40
|
-
classifier: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
name: z.ZodString;
|
|
42
|
-
version: z.ZodString;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
}, z.core.$strip>;
|
|
45
|
-
type Subject = z.infer<typeof Subject>;
|
|
46
|
-
declare const ItemLinks: z.ZodObject<{
|
|
47
|
-
target: z.ZodOptional<z.ZodString>;
|
|
48
|
-
parent: z.ZodOptional<z.ZodString>;
|
|
49
|
-
root: z.ZodOptional<z.ZodString>;
|
|
50
|
-
quoted: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
type ItemLinks = z.infer<typeof ItemLinks>;
|
|
53
|
-
declare const ItemPart: z.ZodObject<{
|
|
54
|
-
id: z.ZodString;
|
|
55
|
-
text: z.ZodString;
|
|
56
|
-
authorRef: z.ZodOptional<z.ZodString>;
|
|
57
|
-
postedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODate, z.ZodISODateTime]>>;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
type ItemPart = z.infer<typeof ItemPart>;
|
|
60
|
-
declare const CollectItem: z.ZodObject<{
|
|
61
|
-
id: z.ZodString;
|
|
62
|
-
source: z.ZodString;
|
|
63
|
-
sourceInstance: z.ZodOptional<z.ZodString>;
|
|
64
|
-
kind: z.ZodEnum<{
|
|
65
|
-
article: "article";
|
|
66
|
-
post: "post";
|
|
67
|
-
thread: "thread";
|
|
68
|
-
submission: "submission";
|
|
69
|
-
review: "review";
|
|
70
|
-
video: "video";
|
|
71
|
-
query: "query";
|
|
72
|
-
}>;
|
|
73
|
-
url: z.ZodOptional<z.ZodString>;
|
|
74
|
-
canonicalUrl: z.ZodOptional<z.ZodString>;
|
|
75
|
-
contentId: z.ZodOptional<z.ZodString>;
|
|
76
|
-
contentGroupId: z.ZodOptional<z.ZodString>;
|
|
77
|
-
subjects: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
78
|
-
label: z.ZodString;
|
|
79
|
-
provenance: z.ZodEnum<{
|
|
80
|
-
query: "query";
|
|
81
|
-
source_tag: "source_tag";
|
|
82
|
-
classifier: "classifier";
|
|
83
|
-
}>;
|
|
84
|
-
classifier: z.ZodOptional<z.ZodObject<{
|
|
85
|
-
name: z.ZodString;
|
|
86
|
-
version: z.ZodString;
|
|
87
|
-
}, z.core.$strip>>;
|
|
88
|
-
}, z.core.$strip>>>;
|
|
89
|
-
title: z.ZodOptional<z.ZodString>;
|
|
90
|
-
text: z.ZodOptional<z.ZodString>;
|
|
91
|
-
textTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
-
language: z.ZodOptional<z.ZodString>;
|
|
93
|
-
wordCount: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
format: z.ZodOptional<z.ZodString>;
|
|
95
|
-
authorRef: z.ZodOptional<z.ZodString>;
|
|
96
|
-
submitterRef: z.ZodOptional<z.ZodString>;
|
|
97
|
-
publishedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODate, z.ZodISODateTime]>>;
|
|
98
|
-
postedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODate, z.ZodISODateTime]>>;
|
|
99
|
-
firstSeenAt: z.ZodISODateTime;
|
|
100
|
-
links: z.ZodOptional<z.ZodObject<{
|
|
101
|
-
target: z.ZodOptional<z.ZodString>;
|
|
102
|
-
parent: z.ZodOptional<z.ZodString>;
|
|
103
|
-
root: z.ZodOptional<z.ZodString>;
|
|
104
|
-
quoted: z.ZodOptional<z.ZodString>;
|
|
105
|
-
}, z.core.$strip>>;
|
|
106
|
-
outboundLinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
-
parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
108
|
-
id: z.ZodString;
|
|
109
|
-
text: z.ZodString;
|
|
110
|
-
authorRef: z.ZodOptional<z.ZodString>;
|
|
111
|
-
postedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODate, z.ZodISODateTime]>>;
|
|
112
|
-
}, z.core.$strip>>>;
|
|
113
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
-
hasMedia: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
-
query: z.ZodOptional<z.ZodString>;
|
|
116
|
-
runId: z.ZodOptional<z.ZodString>;
|
|
117
|
-
rawRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
-
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
|
-
type CollectItem = z.infer<typeof CollectItem>;
|
|
121
|
-
declare const ObservationBase: z.ZodObject<{
|
|
122
|
-
itemId: z.ZodString;
|
|
123
|
-
measuredAt: z.ZodISODateTime;
|
|
124
|
-
metrics: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
125
|
-
views: "views";
|
|
126
|
-
likes: "likes";
|
|
127
|
-
reposts: "reposts";
|
|
128
|
-
replies: "replies";
|
|
129
|
-
bookmarks: "bookmarks";
|
|
130
|
-
points: "points";
|
|
131
|
-
comments: "comments";
|
|
132
|
-
reactions: "reactions";
|
|
133
|
-
score: "score";
|
|
134
|
-
rating: "rating";
|
|
135
|
-
helpfulVotes: "helpfulVotes";
|
|
136
|
-
}> & z.core.$partial, z.ZodNumber>>;
|
|
137
|
-
partMetrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<{
|
|
138
|
-
views: "views";
|
|
139
|
-
likes: "likes";
|
|
140
|
-
reposts: "reposts";
|
|
141
|
-
replies: "replies";
|
|
142
|
-
bookmarks: "bookmarks";
|
|
143
|
-
points: "points";
|
|
144
|
-
comments: "comments";
|
|
145
|
-
reactions: "reactions";
|
|
146
|
-
score: "score";
|
|
147
|
-
rating: "rating";
|
|
148
|
-
helpfulVotes: "helpfulVotes";
|
|
149
|
-
}> & z.core.$partial, z.ZodNumber>>>;
|
|
150
|
-
rawValues: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
151
|
-
views: "views";
|
|
152
|
-
likes: "likes";
|
|
153
|
-
reposts: "reposts";
|
|
154
|
-
replies: "replies";
|
|
155
|
-
bookmarks: "bookmarks";
|
|
156
|
-
points: "points";
|
|
157
|
-
comments: "comments";
|
|
158
|
-
reactions: "reactions";
|
|
159
|
-
score: "score";
|
|
160
|
-
rating: "rating";
|
|
161
|
-
helpfulVotes: "helpfulVotes";
|
|
162
|
-
}> & z.core.$partial, z.ZodString>>;
|
|
163
|
-
missing: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
164
|
-
views: "views";
|
|
165
|
-
likes: "likes";
|
|
166
|
-
reposts: "reposts";
|
|
167
|
-
replies: "replies";
|
|
168
|
-
bookmarks: "bookmarks";
|
|
169
|
-
points: "points";
|
|
170
|
-
comments: "comments";
|
|
171
|
-
reactions: "reactions";
|
|
172
|
-
score: "score";
|
|
173
|
-
rating: "rating";
|
|
174
|
-
helpfulVotes: "helpfulVotes";
|
|
175
|
-
}> & z.core.$partial, z.ZodEnum<{
|
|
176
|
-
not_exposed: "not_exposed";
|
|
177
|
-
hidden: "hidden";
|
|
178
|
-
blocked: "blocked";
|
|
179
|
-
}>>>;
|
|
180
|
-
transport: z.ZodOptional<z.ZodString>;
|
|
181
|
-
runId: z.ZodOptional<z.ZodString>;
|
|
182
|
-
rawRef: z.ZodOptional<z.ZodString>;
|
|
183
|
-
}, z.core.$strip>;
|
|
184
|
-
/** Unrefined shape of `Observation`, for consumers that need `.extend()`, `.pick()` or `.partial()`. */
|
|
185
|
-
declare const Observation: z.ZodObject<{
|
|
186
|
-
itemId: z.ZodString;
|
|
187
|
-
measuredAt: z.ZodISODateTime;
|
|
188
|
-
metrics: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
189
|
-
views: "views";
|
|
190
|
-
likes: "likes";
|
|
191
|
-
reposts: "reposts";
|
|
192
|
-
replies: "replies";
|
|
193
|
-
bookmarks: "bookmarks";
|
|
194
|
-
points: "points";
|
|
195
|
-
comments: "comments";
|
|
196
|
-
reactions: "reactions";
|
|
197
|
-
score: "score";
|
|
198
|
-
rating: "rating";
|
|
199
|
-
helpfulVotes: "helpfulVotes";
|
|
200
|
-
}> & z.core.$partial, z.ZodNumber>>;
|
|
201
|
-
partMetrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<{
|
|
202
|
-
views: "views";
|
|
203
|
-
likes: "likes";
|
|
204
|
-
reposts: "reposts";
|
|
205
|
-
replies: "replies";
|
|
206
|
-
bookmarks: "bookmarks";
|
|
207
|
-
points: "points";
|
|
208
|
-
comments: "comments";
|
|
209
|
-
reactions: "reactions";
|
|
210
|
-
score: "score";
|
|
211
|
-
rating: "rating";
|
|
212
|
-
helpfulVotes: "helpfulVotes";
|
|
213
|
-
}> & z.core.$partial, z.ZodNumber>>>;
|
|
214
|
-
rawValues: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
215
|
-
views: "views";
|
|
216
|
-
likes: "likes";
|
|
217
|
-
reposts: "reposts";
|
|
218
|
-
replies: "replies";
|
|
219
|
-
bookmarks: "bookmarks";
|
|
220
|
-
points: "points";
|
|
221
|
-
comments: "comments";
|
|
222
|
-
reactions: "reactions";
|
|
223
|
-
score: "score";
|
|
224
|
-
rating: "rating";
|
|
225
|
-
helpfulVotes: "helpfulVotes";
|
|
226
|
-
}> & z.core.$partial, z.ZodString>>;
|
|
227
|
-
missing: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
228
|
-
views: "views";
|
|
229
|
-
likes: "likes";
|
|
230
|
-
reposts: "reposts";
|
|
231
|
-
replies: "replies";
|
|
232
|
-
bookmarks: "bookmarks";
|
|
233
|
-
points: "points";
|
|
234
|
-
comments: "comments";
|
|
235
|
-
reactions: "reactions";
|
|
236
|
-
score: "score";
|
|
237
|
-
rating: "rating";
|
|
238
|
-
helpfulVotes: "helpfulVotes";
|
|
239
|
-
}> & z.core.$partial, z.ZodEnum<{
|
|
240
|
-
not_exposed: "not_exposed";
|
|
241
|
-
hidden: "hidden";
|
|
242
|
-
blocked: "blocked";
|
|
243
|
-
}>>>;
|
|
244
|
-
transport: z.ZodOptional<z.ZodString>;
|
|
245
|
-
runId: z.ZodOptional<z.ZodString>;
|
|
246
|
-
rawRef: z.ZodOptional<z.ZodString>;
|
|
247
|
-
}, z.core.$strip>;
|
|
248
|
-
type Observation = z.infer<typeof Observation>;
|
|
249
|
-
declare const AudienceKind: z.ZodEnum<{
|
|
250
|
-
followers: "followers";
|
|
251
|
-
karma: "karma";
|
|
252
|
-
subscribers: "subscribers";
|
|
253
|
-
}>;
|
|
254
|
-
type AudienceKind = z.infer<typeof AudienceKind>;
|
|
255
|
-
declare const AudienceUnknownReason: z.ZodEnum<{
|
|
256
|
-
not_exposed: "not_exposed";
|
|
257
|
-
blocked: "blocked";
|
|
258
|
-
not_fetched: "not_fetched";
|
|
259
|
-
}>;
|
|
260
|
-
type AudienceUnknownReason = z.infer<typeof AudienceUnknownReason>;
|
|
261
|
-
/** One reading of an audience figure. Either `value` is known or `unknown` says why not. */
|
|
262
|
-
declare const AudienceReading: z.ZodObject<{
|
|
263
|
-
measuredAt: z.ZodISODateTime;
|
|
264
|
-
kind: z.ZodEnum<{
|
|
265
|
-
followers: "followers";
|
|
266
|
-
karma: "karma";
|
|
267
|
-
subscribers: "subscribers";
|
|
268
|
-
}>;
|
|
269
|
-
value: z.ZodOptional<z.ZodNumber>;
|
|
270
|
-
rawValue: z.ZodOptional<z.ZodString>;
|
|
271
|
-
unknown: z.ZodOptional<z.ZodEnum<{
|
|
272
|
-
not_exposed: "not_exposed";
|
|
273
|
-
blocked: "blocked";
|
|
274
|
-
not_fetched: "not_fetched";
|
|
275
|
-
}>>;
|
|
276
|
-
}, z.core.$strip>;
|
|
277
|
-
type AudienceReading = z.infer<typeof AudienceReading>;
|
|
278
|
-
declare const Actor: z.ZodObject<{
|
|
279
|
-
ref: z.ZodString;
|
|
280
|
-
displayName: z.ZodOptional<z.ZodString>;
|
|
281
|
-
handle: z.ZodOptional<z.ZodString>;
|
|
282
|
-
profileUrl: z.ZodOptional<z.ZodString>;
|
|
283
|
-
accountCreatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodISODate, z.ZodISODateTime]>>;
|
|
284
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
285
|
-
audience: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
286
|
-
measuredAt: z.ZodISODateTime;
|
|
287
|
-
kind: z.ZodEnum<{
|
|
288
|
-
followers: "followers";
|
|
289
|
-
karma: "karma";
|
|
290
|
-
subscribers: "subscribers";
|
|
291
|
-
}>;
|
|
292
|
-
value: z.ZodOptional<z.ZodNumber>;
|
|
293
|
-
rawValue: z.ZodOptional<z.ZodString>;
|
|
294
|
-
unknown: z.ZodOptional<z.ZodEnum<{
|
|
295
|
-
not_exposed: "not_exposed";
|
|
296
|
-
blocked: "blocked";
|
|
297
|
-
not_fetched: "not_fetched";
|
|
298
|
-
}>>;
|
|
299
|
-
}, z.core.$strip>>>;
|
|
300
|
-
}, z.core.$strip>;
|
|
301
|
-
type Actor = z.infer<typeof Actor>;
|
|
302
|
-
declare const PickupKind: z.ZodEnum<{
|
|
303
|
-
media_pickup: "media_pickup";
|
|
304
|
-
crosspost: "crosspost";
|
|
305
|
-
media_publication: "media_publication";
|
|
306
|
-
}>;
|
|
307
|
-
type PickupKind = z.infer<typeof PickupKind>;
|
|
308
|
-
declare const PickupMethod: z.ZodEnum<{
|
|
309
|
-
link: "link";
|
|
310
|
-
content_id: "content_id";
|
|
311
|
-
near_text: "near_text";
|
|
312
|
-
declared: "declared";
|
|
313
|
-
legacy_flag: "legacy_flag";
|
|
314
|
-
}>;
|
|
315
|
-
type PickupMethod = z.infer<typeof PickupMethod>;
|
|
316
|
-
/** Methods whose evidence is exact, so the pickup counts as verified. */
|
|
317
|
-
declare const VERIFIED_PICKUP_METHODS: readonly PickupMethod[];
|
|
318
|
-
declare const PickupBase: z.ZodObject<{
|
|
319
|
-
itemId: z.ZodString;
|
|
320
|
-
kind: z.ZodEnum<{
|
|
321
|
-
media_pickup: "media_pickup";
|
|
322
|
-
crosspost: "crosspost";
|
|
323
|
-
media_publication: "media_publication";
|
|
324
|
-
}>;
|
|
325
|
-
pickupItemId: z.ZodOptional<z.ZodString>;
|
|
326
|
-
pickupUrl: z.ZodOptional<z.ZodString>;
|
|
327
|
-
outlet: z.ZodOptional<z.ZodString>;
|
|
328
|
-
relation: z.ZodEnum<{
|
|
329
|
-
republication: "republication";
|
|
330
|
-
citation: "citation";
|
|
331
|
-
}>;
|
|
332
|
-
evidence: z.ZodObject<{
|
|
333
|
-
outboundLink: z.ZodOptional<z.ZodString>;
|
|
334
|
-
excerpt: z.ZodOptional<z.ZodString>;
|
|
335
|
-
similarity: z.ZodOptional<z.ZodNumber>;
|
|
336
|
-
rawRef: z.ZodOptional<z.ZodString>;
|
|
337
|
-
}, z.core.$strip>;
|
|
338
|
-
method: z.ZodEnum<{
|
|
339
|
-
link: "link";
|
|
340
|
-
content_id: "content_id";
|
|
341
|
-
near_text: "near_text";
|
|
342
|
-
declared: "declared";
|
|
343
|
-
legacy_flag: "legacy_flag";
|
|
344
|
-
}>;
|
|
345
|
-
verified: z.ZodBoolean;
|
|
346
|
-
firstSeenAt: z.ZodISODateTime;
|
|
347
|
-
measuredAt: z.ZodISODateTime;
|
|
348
|
-
runId: z.ZodOptional<z.ZodString>;
|
|
349
|
-
}, z.core.$strip>;
|
|
350
|
-
/** Unrefined shape of `Pickup`, for consumers that need `.extend()`, `.pick()` or `.partial()`. */
|
|
351
|
-
declare const Pickup: z.ZodObject<{
|
|
352
|
-
itemId: z.ZodString;
|
|
353
|
-
kind: z.ZodEnum<{
|
|
354
|
-
media_pickup: "media_pickup";
|
|
355
|
-
crosspost: "crosspost";
|
|
356
|
-
media_publication: "media_publication";
|
|
357
|
-
}>;
|
|
358
|
-
pickupItemId: z.ZodOptional<z.ZodString>;
|
|
359
|
-
pickupUrl: z.ZodOptional<z.ZodString>;
|
|
360
|
-
outlet: z.ZodOptional<z.ZodString>;
|
|
361
|
-
relation: z.ZodEnum<{
|
|
362
|
-
republication: "republication";
|
|
363
|
-
citation: "citation";
|
|
364
|
-
}>;
|
|
365
|
-
evidence: z.ZodObject<{
|
|
366
|
-
outboundLink: z.ZodOptional<z.ZodString>;
|
|
367
|
-
excerpt: z.ZodOptional<z.ZodString>;
|
|
368
|
-
similarity: z.ZodOptional<z.ZodNumber>;
|
|
369
|
-
rawRef: z.ZodOptional<z.ZodString>;
|
|
370
|
-
}, z.core.$strip>;
|
|
371
|
-
method: z.ZodEnum<{
|
|
372
|
-
link: "link";
|
|
373
|
-
content_id: "content_id";
|
|
374
|
-
near_text: "near_text";
|
|
375
|
-
declared: "declared";
|
|
376
|
-
legacy_flag: "legacy_flag";
|
|
377
|
-
}>;
|
|
378
|
-
verified: z.ZodBoolean;
|
|
379
|
-
firstSeenAt: z.ZodISODateTime;
|
|
380
|
-
measuredAt: z.ZodISODateTime;
|
|
381
|
-
runId: z.ZodOptional<z.ZodString>;
|
|
382
|
-
}, z.core.$strip>;
|
|
383
|
-
type Pickup = z.infer<typeof Pickup>;
|
|
384
|
-
declare const Recipe: z.ZodObject<{
|
|
385
|
-
name: z.ZodOptional<z.ZodString>;
|
|
386
|
-
sources: z.ZodArray<z.ZodObject<{
|
|
387
|
-
connector: z.ZodString;
|
|
388
|
-
instance: z.ZodOptional<z.ZodString>;
|
|
389
|
-
queries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
390
|
-
text: z.ZodString;
|
|
391
|
-
subject: z.ZodString;
|
|
392
|
-
}, z.core.$strip>>>;
|
|
393
|
-
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
394
|
-
}, z.core.$strip>>;
|
|
395
|
-
window: z.ZodOptional<z.ZodObject<{
|
|
396
|
-
from: z.ZodOptional<z.ZodISODateTime>;
|
|
397
|
-
to: z.ZodOptional<z.ZodISODateTime>;
|
|
398
|
-
}, z.core.$strip>>;
|
|
399
|
-
sampling: z.ZodOptional<z.ZodObject<{
|
|
400
|
-
bands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
401
|
-
metric: z.ZodEnum<{
|
|
402
|
-
views: "views";
|
|
403
|
-
likes: "likes";
|
|
404
|
-
reposts: "reposts";
|
|
405
|
-
replies: "replies";
|
|
406
|
-
bookmarks: "bookmarks";
|
|
407
|
-
points: "points";
|
|
408
|
-
comments: "comments";
|
|
409
|
-
reactions: "reactions";
|
|
410
|
-
score: "score";
|
|
411
|
-
rating: "rating";
|
|
412
|
-
helpfulVotes: "helpfulVotes";
|
|
413
|
-
}>;
|
|
414
|
-
min: z.ZodOptional<z.ZodNumber>;
|
|
415
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
416
|
-
}, z.core.$strip>>>;
|
|
417
|
-
perDomainCap: z.ZodOptional<z.ZodNumber>;
|
|
418
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
419
|
-
}, z.core.$strip>>;
|
|
420
|
-
caps: z.ZodOptional<z.ZodObject<{
|
|
421
|
-
perConnector: z.ZodOptional<z.ZodNumber>;
|
|
422
|
-
total: z.ZodOptional<z.ZodNumber>;
|
|
423
|
-
}, z.core.$strip>>;
|
|
424
|
-
workers: z.ZodDefault<z.ZodNumber>;
|
|
425
|
-
sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
426
|
-
}, z.core.$strip>;
|
|
427
|
-
type Recipe = z.infer<typeof Recipe>;
|
|
428
|
-
declare const FailureCause: z.ZodEnum<{
|
|
429
|
-
blocked: "blocked";
|
|
430
|
-
empty: "empty";
|
|
431
|
-
network: "network";
|
|
432
|
-
parse: "parse";
|
|
433
|
-
other: "other";
|
|
434
|
-
}>;
|
|
435
|
-
type FailureCause = z.infer<typeof FailureCause>;
|
|
436
|
-
/** Every `with*` field and `eligible` is a count of items; shares are computed by the reader. */
|
|
437
|
-
declare const CoverageCell: z.ZodObject<{
|
|
438
|
-
platform: z.ZodString;
|
|
439
|
-
format: z.ZodString;
|
|
440
|
-
language: z.ZodString;
|
|
441
|
-
subject: z.ZodString;
|
|
442
|
-
items: z.ZodNumber;
|
|
443
|
-
withAuthorAudience: z.ZodNumber;
|
|
444
|
-
withPrimaryMetric: z.ZodNumber;
|
|
445
|
-
withAge: z.ZodNumber;
|
|
446
|
-
withAuthorId: z.ZodNumber;
|
|
447
|
-
withUniqueContent: z.ZodNumber;
|
|
448
|
-
eligible: z.ZodNumber;
|
|
449
|
-
}, z.core.$strip>;
|
|
450
|
-
type CoverageCell = z.infer<typeof CoverageCell>;
|
|
451
|
-
declare const Coverage: z.ZodObject<{
|
|
452
|
-
cells: z.ZodArray<z.ZodObject<{
|
|
453
|
-
platform: z.ZodString;
|
|
454
|
-
format: z.ZodString;
|
|
455
|
-
language: z.ZodString;
|
|
456
|
-
subject: z.ZodString;
|
|
457
|
-
items: z.ZodNumber;
|
|
458
|
-
withAuthorAudience: z.ZodNumber;
|
|
459
|
-
withPrimaryMetric: z.ZodNumber;
|
|
460
|
-
withAge: z.ZodNumber;
|
|
461
|
-
withAuthorId: z.ZodNumber;
|
|
462
|
-
withUniqueContent: z.ZodNumber;
|
|
463
|
-
eligible: z.ZodNumber;
|
|
464
|
-
}, z.core.$strip>>;
|
|
465
|
-
}, z.core.$strip>;
|
|
466
|
-
type Coverage = z.infer<typeof Coverage>;
|
|
467
|
-
declare const ConnectorReport: z.ZodObject<{
|
|
468
|
-
connector: z.ZodString;
|
|
469
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
470
|
-
ok: "ok";
|
|
471
|
-
partial: "partial";
|
|
472
|
-
failed: "failed";
|
|
473
|
-
skipped: "skipped";
|
|
474
|
-
}>>;
|
|
475
|
-
skippedReason: z.ZodOptional<z.ZodString>;
|
|
476
|
-
tasks: z.ZodObject<{
|
|
477
|
-
planned: z.ZodNumber;
|
|
478
|
-
done: z.ZodNumber;
|
|
479
|
-
failed: z.ZodNumber;
|
|
480
|
-
skipped: z.ZodNumber;
|
|
481
|
-
}, z.core.$strip>;
|
|
482
|
-
newItems: z.ZodNumber;
|
|
483
|
-
observations: z.ZodNumber;
|
|
484
|
-
duplicates: z.ZodNumber;
|
|
485
|
-
failures: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
486
|
-
blocked: "blocked";
|
|
487
|
-
empty: "empty";
|
|
488
|
-
network: "network";
|
|
489
|
-
parse: "parse";
|
|
490
|
-
other: "other";
|
|
491
|
-
}> & z.core.$partial, z.ZodNumber>>;
|
|
492
|
-
escalations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
493
|
-
from: z.ZodString;
|
|
494
|
-
to: z.ZodString;
|
|
495
|
-
count: z.ZodNumber;
|
|
496
|
-
}, z.core.$strip>>>;
|
|
497
|
-
durationMs: z.ZodNumber;
|
|
498
|
-
coverage: z.ZodOptional<z.ZodObject<{
|
|
499
|
-
cells: z.ZodArray<z.ZodObject<{
|
|
500
|
-
platform: z.ZodString;
|
|
501
|
-
format: z.ZodString;
|
|
502
|
-
language: z.ZodString;
|
|
503
|
-
subject: z.ZodString;
|
|
504
|
-
items: z.ZodNumber;
|
|
505
|
-
withAuthorAudience: z.ZodNumber;
|
|
506
|
-
withPrimaryMetric: z.ZodNumber;
|
|
507
|
-
withAge: z.ZodNumber;
|
|
508
|
-
withAuthorId: z.ZodNumber;
|
|
509
|
-
withUniqueContent: z.ZodNumber;
|
|
510
|
-
eligible: z.ZodNumber;
|
|
511
|
-
}, z.core.$strip>>;
|
|
512
|
-
}, z.core.$strip>>;
|
|
513
|
-
}, z.core.$strip>;
|
|
514
|
-
type ConnectorReport = z.infer<typeof ConnectorReport>;
|
|
515
|
-
declare const RunReport: z.ZodObject<{
|
|
516
|
-
runId: z.ZodString;
|
|
517
|
-
startedAt: z.ZodISODateTime;
|
|
518
|
-
finishedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
519
|
-
connectors: z.ZodArray<z.ZodObject<{
|
|
520
|
-
connector: z.ZodString;
|
|
521
|
-
status: z.ZodDefault<z.ZodEnum<{
|
|
522
|
-
ok: "ok";
|
|
523
|
-
partial: "partial";
|
|
524
|
-
failed: "failed";
|
|
525
|
-
skipped: "skipped";
|
|
526
|
-
}>>;
|
|
527
|
-
skippedReason: z.ZodOptional<z.ZodString>;
|
|
528
|
-
tasks: z.ZodObject<{
|
|
529
|
-
planned: z.ZodNumber;
|
|
530
|
-
done: z.ZodNumber;
|
|
531
|
-
failed: z.ZodNumber;
|
|
532
|
-
skipped: z.ZodNumber;
|
|
533
|
-
}, z.core.$strip>;
|
|
534
|
-
newItems: z.ZodNumber;
|
|
535
|
-
observations: z.ZodNumber;
|
|
536
|
-
duplicates: z.ZodNumber;
|
|
537
|
-
failures: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
538
|
-
blocked: "blocked";
|
|
539
|
-
empty: "empty";
|
|
540
|
-
network: "network";
|
|
541
|
-
parse: "parse";
|
|
542
|
-
other: "other";
|
|
543
|
-
}> & z.core.$partial, z.ZodNumber>>;
|
|
544
|
-
escalations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
545
|
-
from: z.ZodString;
|
|
546
|
-
to: z.ZodString;
|
|
547
|
-
count: z.ZodNumber;
|
|
548
|
-
}, z.core.$strip>>>;
|
|
549
|
-
durationMs: z.ZodNumber;
|
|
550
|
-
coverage: z.ZodOptional<z.ZodObject<{
|
|
551
|
-
cells: z.ZodArray<z.ZodObject<{
|
|
552
|
-
platform: z.ZodString;
|
|
553
|
-
format: z.ZodString;
|
|
554
|
-
language: z.ZodString;
|
|
555
|
-
subject: z.ZodString;
|
|
556
|
-
items: z.ZodNumber;
|
|
557
|
-
withAuthorAudience: z.ZodNumber;
|
|
558
|
-
withPrimaryMetric: z.ZodNumber;
|
|
559
|
-
withAge: z.ZodNumber;
|
|
560
|
-
withAuthorId: z.ZodNumber;
|
|
561
|
-
withUniqueContent: z.ZodNumber;
|
|
562
|
-
eligible: z.ZodNumber;
|
|
563
|
-
}, z.core.$strip>>;
|
|
564
|
-
}, z.core.$strip>>;
|
|
565
|
-
}, z.core.$strip>>;
|
|
566
|
-
coverage: z.ZodOptional<z.ZodObject<{
|
|
567
|
-
cells: z.ZodArray<z.ZodObject<{
|
|
568
|
-
platform: z.ZodString;
|
|
569
|
-
format: z.ZodString;
|
|
570
|
-
language: z.ZodString;
|
|
571
|
-
subject: z.ZodString;
|
|
572
|
-
items: z.ZodNumber;
|
|
573
|
-
withAuthorAudience: z.ZodNumber;
|
|
574
|
-
withPrimaryMetric: z.ZodNumber;
|
|
575
|
-
withAge: z.ZodNumber;
|
|
576
|
-
withAuthorId: z.ZodNumber;
|
|
577
|
-
withUniqueContent: z.ZodNumber;
|
|
578
|
-
eligible: z.ZodNumber;
|
|
579
|
-
}, z.core.$strip>>;
|
|
580
|
-
}, z.core.$strip>>;
|
|
581
|
-
}, z.core.$strip>;
|
|
582
|
-
type RunReport = z.infer<typeof RunReport>;
|
|
1
|
+
import { b as SecretsPort, M as MetricName, R as Recipe, c as ConnectorRegistry, C as Connector, d as Coverage } from './connector-DUNy3vSU.js';
|
|
2
|
+
export { A as AccessDeclaration, e as Actor, f as ApiConnectorInfo, g as ApiTransportFactory, h as AudienceKind, i as AudienceReading, j as AudienceUnknownReason, B as BrowserPage, k as BrowserScrollOptions, l as BrowserTransport, m as BrowserWaitOptions, n as Capability, o as CollectItem, a as CollectTask, p as ConnectorDeclaration, q as ConnectorDeclarationInput, r as ConnectorDefinition, s as ConnectorReport, t as CounterDeclaration, u as CoverageCell, F as FailureCause, v as FetchContext, w as FetchResult, x as FetchTransport, y as FetchedRaw, H as HttpRequest, z as HttpResponse, D as HttpTransport, I as ItemKind, E as ItemLinks, G as ItemPart, J as MissingReason, K as MissingSecretError, O as Observation, L as ObservationBase, P as Pace, N as ParseInput, Q as ParseResult, T as ParsedItem, U as ParsedObservation, V as ParsedPickup, W as Pickup, X as PickupBase, Y as PickupKind, Z as PickupMethod, _ as RecipeSource, $ as RunReport, a0 as SampledReport, a1 as SessionCheck, S as Subject, a2 as TransportError, a3 as TransportErrorCause, a4 as TransportErrorOptions, a5 as TransportName, a6 as TransportNameSchema, a7 as TransportSet, a8 as VERIFIED_PICKUP_METHODS, a9 as createConnectorRegistry, aa as defineConnector, ab as getConnector, ac as listConnectors, ad as registerConnector } from './connector-DUNy3vSU.js';
|
|
3
|
+
import { C as CollectStore, S as SamplingRecord } from './engine-BRXHKg5A.js';
|
|
4
|
+
export { a as Clock, b as CollectRunError, c as Collector, d as CollectorOptions, E as EventRecord, P as PlanEntry, e as PutRawInput, f as PutRawResult, R as RawIndexEntry, g as Reader, h as RunEvent, i as RunOptions, j as RunRecord, k as StoreLock, l as StoreLockedError, m as StoreVersionError, T as TaskRecord, n as TaskStatus, o as actorRedoKey, p as assertSafeName, q as createCollector, r as dropRedone, s as itemSeenKeys, t as lastWins, u as makeReader, v as monthOf, w as observationRedoKey, x as parseRawRef, y as pickupRedoKey, z as rawRef, A as readAll, B as recipeHash, D as seenKey, F as sha256Bytes, G as sourceOf, H as stableStringify } from './engine-BRXHKg5A.js';
|
|
5
|
+
import 'zod';
|
|
583
6
|
|
|
584
7
|
/**
|
|
585
8
|
* Stable ids, URL canonicalisation and text fingerprints.
|
|
@@ -623,7 +46,89 @@ declare function normalizeText(text: string): string;
|
|
|
623
46
|
*/
|
|
624
47
|
declare function textFingerprint(text: string): Promise<string | undefined>;
|
|
625
48
|
|
|
49
|
+
/** In-memory store: same behaviour as the disk store, nothing persisted. */
|
|
50
|
+
declare function memoryStore(options?: {
|
|
51
|
+
now?: () => string;
|
|
52
|
+
}): CollectStore;
|
|
53
|
+
|
|
626
54
|
/** Version written to `collect.json` at a store root. Bump on any change to the stored shapes. */
|
|
627
55
|
declare const STORE_SCHEMA_VERSION = 1;
|
|
628
56
|
|
|
629
|
-
|
|
57
|
+
/** A `SecretsPort` that remembers every value it hands out, and can scrub them from text and JSON. */
|
|
58
|
+
interface SecretRecorder extends SecretsPort {
|
|
59
|
+
/** Text with every value seen so far (raw, percent-encoded, form-encoded, JSON-escaped) replaced by `[redacted]`. */
|
|
60
|
+
redact(text: string): string;
|
|
61
|
+
/** The same applied to every string inside a JSON-like value (keys included). Returns a copy. */
|
|
62
|
+
redactJson<T>(value: T): T;
|
|
63
|
+
}
|
|
64
|
+
declare function isSecretRecorder(port: SecretsPort | undefined): port is SecretRecorder;
|
|
65
|
+
/**
|
|
66
|
+
* Wrap a secrets port so every value it resolves during a run is added to a
|
|
67
|
+
* redaction set. Pass the recorder to the collector and to anything else that
|
|
68
|
+
* resolves secrets (an API transport), so they share one set.
|
|
69
|
+
*/
|
|
70
|
+
declare function recordSecrets(port: SecretsPort): SecretRecorder;
|
|
71
|
+
|
|
72
|
+
type SamplingConfig = NonNullable<Recipe["sampling"]>;
|
|
73
|
+
/** What the sampler needs to know about one candidate item. */
|
|
74
|
+
interface SamplingCandidate {
|
|
75
|
+
/** Stable item id. */
|
|
76
|
+
id: string;
|
|
77
|
+
kind?: string;
|
|
78
|
+
/** Metric values the parse returned for this item. */
|
|
79
|
+
metrics: Partial<Record<MetricName, number>>;
|
|
80
|
+
/** Canonical URL of the item. */
|
|
81
|
+
url?: string;
|
|
82
|
+
/** `links.target` of the item, when set. */
|
|
83
|
+
target?: string;
|
|
84
|
+
outboundLinks?: string[];
|
|
85
|
+
}
|
|
86
|
+
type SamplingDecision = Omit<SamplingRecord, "at" | "connector" | "taskId">;
|
|
87
|
+
/** Small seeded PRNG: the same seed always gives the same sequence in [0, 1). */
|
|
88
|
+
declare function mulberry32(seed: number): () => number;
|
|
89
|
+
/** Host of a URL, lower-cased, without a trailing DNS root dot and without a leading `www.`. No public-suffix list. */
|
|
90
|
+
declare function domainOf(url: string | undefined): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The host a candidate counts against: for a submission, the host of the
|
|
93
|
+
* article it points to (`links.target` when it is a URL, else the first
|
|
94
|
+
* outbound link); otherwise, or when neither is a URL, the host of its own URL.
|
|
95
|
+
*/
|
|
96
|
+
declare function candidateDomain(c: SamplingCandidate): string | undefined;
|
|
97
|
+
interface SamplingPlan {
|
|
98
|
+
/** New decisions to persist, one per distinct candidate, in decision order. */
|
|
99
|
+
lines: SamplingDecision[];
|
|
100
|
+
/** Ids (representatives and their repeats or URL aliases) whose records must not be written. */
|
|
101
|
+
dropped: Set<string>;
|
|
102
|
+
}
|
|
103
|
+
interface Sampler {
|
|
104
|
+
/**
|
|
105
|
+
* Decide a batch without changing any counter. Candidates already decided
|
|
106
|
+
* (in this run or in the journal) reuse their decision and produce no line.
|
|
107
|
+
* `known` holds the ids of candidates whose item already exists: they are not
|
|
108
|
+
* sampled and use no budget. Repeats of an id, and candidates sharing a URL,
|
|
109
|
+
* form one group that gets one decision, taken on the member with the highest
|
|
110
|
+
* metric value (ties: smaller URL, then smaller id).
|
|
111
|
+
*/
|
|
112
|
+
plan(batchKey: string, candidates: SamplingCandidate[], known?: ReadonlySet<string>): SamplingPlan;
|
|
113
|
+
/** Take a plan's lines into the counters. Call it once they are persisted. */
|
|
114
|
+
apply(lines: SamplingDecision[]): void;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Counters live in the sampler and are rebuilt from `prior` (the lines of
|
|
118
|
+
* `sampling.jsonl`), so a resumed run takes the same decisions.
|
|
119
|
+
*/
|
|
120
|
+
declare function createSampler(config: SamplingConfig, primary: MetricName | undefined, prior: SamplingDecision[]): Sampler;
|
|
121
|
+
|
|
122
|
+
/** The connectors whose declared primary counters decide `withPrimaryMetric`. */
|
|
123
|
+
type CoverageConnectors = ConnectorRegistry | readonly Connector[];
|
|
124
|
+
/**
|
|
125
|
+
* Coverage of what a store holds: platform (item source) x format x language x
|
|
126
|
+
* subject. `withPrimaryMetric` uses the primary counter each connector
|
|
127
|
+
* declares (matched on the item source); a source with no connector, or one
|
|
128
|
+
* that declares no primary counter, never counts. An item with several
|
|
129
|
+
* subjects counts in each subject's cell, one with none in the `none` cell. Missing format or language reads `unknown`.
|
|
130
|
+
* Streams the store; memory is proportional to the number of items.
|
|
131
|
+
*/
|
|
132
|
+
declare function computeCoverage(store: CollectStore, connectors?: CoverageConnectors): Promise<Coverage>;
|
|
133
|
+
|
|
134
|
+
export { CollectStore, Connector, ConnectorRegistry, Coverage, type CoverageConnectors, MetricName, Recipe, STORE_SCHEMA_VERSION, type Sampler, type SamplingCandidate, type SamplingConfig, type SamplingDecision, SamplingRecord, type SecretRecorder, SecretsPort, candidateDomain, canonicalUrl, computeCoverage, createSampler, domainOf, isSecretRecorder, itemId, itemIdFromUrl, memoryStore, mulberry32, normalizeText, recordSecrets, sha256Hex, textFingerprint };
|