@telemai/sdk 0.5.0 → 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.
- package/README.md +6 -0
- package/dist/{chunk-SQ3ZZA72.js → chunk-TST6J3VA.js} +32 -8
- package/dist/index.cjs +315 -22
- package/dist/index.d.cts +335 -7
- package/dist/index.d.ts +335 -7
- package/dist/index.js +284 -15
- package/dist/vercel/index.cjs +10 -4
- package/dist/vercel/index.d.cts +6 -1
- package/dist/vercel/index.d.ts +6 -1
- package/dist/vercel/index.js +11 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,10 @@ type SearchOptions = {
|
|
|
63
63
|
includeFullContent?: boolean;
|
|
64
64
|
autoRouting?: string;
|
|
65
65
|
maxRoutingProviders?: number;
|
|
66
|
+
/** `"images"`: an image search on brave only; each result adds `imageUrl`, `imageWidth`
|
|
67
|
+
* and `imageHeight`. */
|
|
66
68
|
topic?: string;
|
|
69
|
+
vertical?: string;
|
|
67
70
|
/** Only results published on or after this date or date-time: an ISO 8601 string
|
|
68
71
|
* (no time zone means UTC) or a `Date`. Results with no known date are kept.
|
|
69
72
|
* Per-call only, like the two below. */
|
|
@@ -94,7 +97,7 @@ type SearchOptions = {
|
|
|
94
97
|
};
|
|
95
98
|
/** The subset of search options that may also be set as a client default.
|
|
96
99
|
* `numResults`/`includeRaw`/`rerank`/`providerOverrides` are per-call intent only. */
|
|
97
|
-
type SearchDefaults = Pick<SearchOptions, "tier" | "fields" | "providersInclude" | "providersExclude" | "includeFullContent" | "autoRouting" | "maxRoutingProviders" | "topic">;
|
|
100
|
+
type SearchDefaults = Pick<SearchOptions, "tier" | "fields" | "providersInclude" | "providersExclude" | "includeFullContent" | "autoRouting" | "maxRoutingProviders" | "topic" | "vertical">;
|
|
98
101
|
type FetchOptions = {
|
|
99
102
|
/** Fetch provider chain, in order. Defaults to `TELEM_FETCH_PROVIDERS`. */
|
|
100
103
|
providers?: string[];
|
|
@@ -114,9 +117,12 @@ type FetchOptions = {
|
|
|
114
117
|
metadata?: Json;
|
|
115
118
|
};
|
|
116
119
|
type TelemOptions = SearchDefaults & {
|
|
120
|
+
defaultVertical?: string;
|
|
117
121
|
apiKey?: string;
|
|
118
122
|
baseUrl?: string;
|
|
119
123
|
timeoutMs?: number;
|
|
124
|
+
/** Retries after the first attempt: 2 by default. `monitors.create` retries for up
|
|
125
|
+
* to about 120 s instead, at most 60 times. A value you pass caps both. */
|
|
120
126
|
maxRetries?: number;
|
|
121
127
|
/** Injectable transport — embedded runtimes, edge workers, and tests. */
|
|
122
128
|
fetch?: typeof globalThis.fetch;
|
|
@@ -137,6 +143,10 @@ type SearchResult = {
|
|
|
137
143
|
source: Json | null;
|
|
138
144
|
enrichments: Json | null;
|
|
139
145
|
fetchMeta: Json | null;
|
|
146
|
+
/** Image searches (`topic: "images"`) only: the original image, its width and height. */
|
|
147
|
+
imageUrl: string | null;
|
|
148
|
+
imageWidth: number | null;
|
|
149
|
+
imageHeight: number | null;
|
|
140
150
|
provider: string;
|
|
141
151
|
raw: Json;
|
|
142
152
|
};
|
|
@@ -253,8 +263,37 @@ type MonitorCreateCommonOptions = {
|
|
|
253
263
|
metadata?: Json;
|
|
254
264
|
/** An `https` URL that receives the new results. */
|
|
255
265
|
webhookUrl?: string;
|
|
266
|
+
/** Labels of your own, to list the monitor by with `list({ tag })`: at most 10. Telem
|
|
267
|
+
* strips and lower-cases each one, which must then be 1 to 32 of `a-z`, `0-9`, `-` and
|
|
268
|
+
* `_`, starting with a letter or digit, and drops repeats. Anything else is a 422. */
|
|
269
|
+
tags?: string[];
|
|
270
|
+
/** The `Idempotency-Key` header, 1 to 255 visible ASCII characters. By default each
|
|
271
|
+
* call makes a new one. Pass your own to retry a create across a restart. */
|
|
272
|
+
idempotencyKey?: string;
|
|
256
273
|
signal?: AbortSignal;
|
|
257
274
|
};
|
|
275
|
+
/** What a monitor of a list of companies collects: the `inputs` of `monitors.create`.
|
|
276
|
+
* Sent as given, with the router's own field names, and checked by the router. */
|
|
277
|
+
type MonitorInputs = {
|
|
278
|
+
/** The companies, 1 to 20: rows of `company_id`, `name` and `domain`. */
|
|
279
|
+
companies: Json[];
|
|
280
|
+
/** People to watch: rows of `person_id`, `name`, `company_id` and `company`. */
|
|
281
|
+
roster?: Json[];
|
|
282
|
+
/** What to collect: the preset `"biopharma-v0"`, or a schema object. */
|
|
283
|
+
schema?: string | Json;
|
|
284
|
+
/** Items to watch from the start: rows of `entity_id`, `kind` and `name`. */
|
|
285
|
+
entities?: Json[];
|
|
286
|
+
/** Kinds of event to collect: rows with a `label`. */
|
|
287
|
+
categories?: Json[];
|
|
288
|
+
/** `"propose"`: people found on company pages are proposed, for you to confirm.
|
|
289
|
+
* `"auto"`: they are watched at once. */
|
|
290
|
+
discover?: string;
|
|
291
|
+
/** How many days back the first read of each company looks. */
|
|
292
|
+
window_days?: number;
|
|
293
|
+
/** Look each company up before its first read, to find its other names and pages. */
|
|
294
|
+
seed?: boolean;
|
|
295
|
+
vertical?: string;
|
|
296
|
+
};
|
|
258
297
|
/** Options for `monitors.create`. A monitor has the agent unless `agent` is `false`,
|
|
259
298
|
* and a monitor with the agent must end: then `ttl` is required. */
|
|
260
299
|
type MonitorCreateOptions = MonitorCreateCommonOptions & ({
|
|
@@ -269,10 +308,21 @@ type MonitorCreateOptions = MonitorCreateCommonOptions & ({
|
|
|
269
308
|
* against the query and keeps the ones that match. Read what it keeps with
|
|
270
309
|
* `monitors.iterateChanges` or `monitors.changes`. */
|
|
271
310
|
agent?: true;
|
|
272
|
-
/** End the monitor after this long, such as `"7d"` or `"30d"` (at most `"30d"
|
|
273
|
-
* Required with the agent. */
|
|
311
|
+
/** End the monitor after this long, such as `"7d"` or `"30d"` (at most `"30d"`, or
|
|
312
|
+
* `"365d"` with `inputs`). Required with the agent. */
|
|
274
313
|
ttl: string;
|
|
314
|
+
/** Watch a list of companies: the companies, and the schema that says what to
|
|
315
|
+
* collect about them. Such a monitor has the agent. Read what the first read of
|
|
316
|
+
* each company found with `monitors.onboarding`. */
|
|
317
|
+
inputs?: MonitorInputs;
|
|
318
|
+
/** The fields every result has: `"article"` (`headline`, `publication`,
|
|
319
|
+
* `published_at`, `summary`, `kind`), `"person"`, `"company"` or `"listing"`. The
|
|
320
|
+
* agent keeps them as they are and may add more. Leave it out and the agent picks
|
|
321
|
+
* the fields from the query. Refused with `inputs`. */
|
|
322
|
+
preset?: MonitorPreset;
|
|
275
323
|
});
|
|
324
|
+
/** The `preset` of `monitors.create`. */
|
|
325
|
+
type MonitorPreset = "article" | "person" | "company" | "listing";
|
|
276
326
|
/** Options for `monitors.update`. Send at least one field. */
|
|
277
327
|
type MonitorUpdateOptions = {
|
|
278
328
|
/** `"paused"` or `"active"`. */
|
|
@@ -283,6 +333,9 @@ type MonitorUpdateOptions = {
|
|
|
283
333
|
/** A new end, this long from now, such as `"30d"` (at most `"30d"`). It renews a monitor
|
|
284
334
|
* before it ends; an ended monitor cannot be renewed. */
|
|
285
335
|
ttl?: string;
|
|
336
|
+
/** The monitor's new tags, in place of all its tags (the rule of `create`). `[]`
|
|
337
|
+
* removes them all; leave it out to keep them. */
|
|
338
|
+
tags?: string[];
|
|
286
339
|
signal?: AbortSignal;
|
|
287
340
|
};
|
|
288
341
|
/** Options for `monitors.poll`.
|
|
@@ -315,6 +368,8 @@ type Monitor = {
|
|
|
315
368
|
/** Only in the answer to a create: why the monitor agent did not start, or not yet.
|
|
316
369
|
* `null` when it started, and in every other answer. */
|
|
317
370
|
agentNote: string | null;
|
|
371
|
+
/** Your labels for the monitor; empty when it has none. */
|
|
372
|
+
tags: string[];
|
|
318
373
|
raw: Json;
|
|
319
374
|
};
|
|
320
375
|
/** The latest compile of an agent's plan (`AgentState.compile`). */
|
|
@@ -327,7 +382,7 @@ type AgentCompileState = {
|
|
|
327
382
|
};
|
|
328
383
|
/** The state of a monitor's agent: `monitor.agentState`. */
|
|
329
384
|
type AgentState = {
|
|
330
|
-
/** The agent engine
|
|
385
|
+
/** The agent engine: `"v4"`, or `"engine"` for a monitor created with `inputs`. */
|
|
331
386
|
engine: string;
|
|
332
387
|
/** Such as `compiling`, `ready`, `paused` or `failed`. */
|
|
333
388
|
status: string;
|
|
@@ -414,6 +469,48 @@ type MonitorChangesOptions = {
|
|
|
414
469
|
limit?: number;
|
|
415
470
|
signal?: AbortSignal;
|
|
416
471
|
};
|
|
472
|
+
/** The monitors of `monitors.changesAcross`: your key's own live monitors that carry
|
|
473
|
+
* `tag`, or the monitors of `ids`, one of the two. */
|
|
474
|
+
type MonitorChangesAcrossScope = {
|
|
475
|
+
/** Your key's own live monitors that carry this tag. One with no agent is in `skipped`. */
|
|
476
|
+
tag: string;
|
|
477
|
+
ids?: never;
|
|
478
|
+
} | {
|
|
479
|
+
/** These monitors, at most 100: any monitor with an agent in your key's project, ended
|
|
480
|
+
* ones too. One that is not is a 404 for the whole read. */
|
|
481
|
+
ids: string[];
|
|
482
|
+
tag?: never;
|
|
483
|
+
};
|
|
484
|
+
/** Options for `monitors.changesAcross` and `monitors.iterateChangesAcross`. */
|
|
485
|
+
type MonitorChangesAcrossOptions = {
|
|
486
|
+
/** The `nextCursor` of the page before. If you leave it out, the read starts at the
|
|
487
|
+
* first change. Do not send it with `since`. */
|
|
488
|
+
cursor?: string;
|
|
489
|
+
/** Read from this time on, as in `changes`. A monitor that joins later starts at the
|
|
490
|
+
* same time. Do not send it with `cursor`. */
|
|
491
|
+
since?: string | Date;
|
|
492
|
+
/** Only these kinds of change, as in `changes`. */
|
|
493
|
+
kinds?: string[];
|
|
494
|
+
/** How many changes to return (server default 200, maximum 500). */
|
|
495
|
+
limit?: number;
|
|
496
|
+
signal?: AbortSignal;
|
|
497
|
+
};
|
|
498
|
+
/** One page of `monitors.changesAcross`. Ordered by `seq`, but a monitor that joins later
|
|
499
|
+
* or catches up can bring lower seqs on a later page: dedupe by `seq`. */
|
|
500
|
+
type MonitorsChangesPage = {
|
|
501
|
+
changes: ChangeRecord[];
|
|
502
|
+
/** Keep this and pass it as `cursor` to read on. It is opaque, and holds the place of
|
|
503
|
+
* every monitor of the read, the `pending` ones too. */
|
|
504
|
+
nextCursor: string;
|
|
505
|
+
/** `true` only for a full page: read on now with `nextCursor`. */
|
|
506
|
+
more: boolean;
|
|
507
|
+
/** The monitors read for this page. */
|
|
508
|
+
monitors: string[];
|
|
509
|
+
/** The monitors not read on this call. A later call with `nextCursor` reads them. */
|
|
510
|
+
pending: string[];
|
|
511
|
+
/** The monitors of the tag that have no agent. */
|
|
512
|
+
skipped: string[];
|
|
513
|
+
};
|
|
417
514
|
/** Options for `monitors.iterateChanges`. */
|
|
418
515
|
type MonitorIterateChangesOptions = {
|
|
419
516
|
/** Read the changes after this `seq`. If you leave it out, the walk starts at the
|
|
@@ -427,6 +524,8 @@ type MonitorListOptions = {
|
|
|
427
524
|
limit?: number;
|
|
428
525
|
/** The `nextCursor` of the page before. */
|
|
429
526
|
cursor?: string;
|
|
527
|
+
/** Only your key's monitors that carry this one tag. Page on with `cursor` and the same `tag`. */
|
|
528
|
+
tag?: string;
|
|
430
529
|
signal?: AbortSignal;
|
|
431
530
|
};
|
|
432
531
|
/** One page of `monitors.listPage`. */
|
|
@@ -435,6 +534,198 @@ type MonitorPage = {
|
|
|
435
534
|
/** Pass as `cursor` to get the next page; `null` on the last page. */
|
|
436
535
|
nextCursor: string | null;
|
|
437
536
|
};
|
|
537
|
+
/** One example of an onboarding candidate: the name it was found under, the quote and
|
|
538
|
+
* its page. */
|
|
539
|
+
type OnboardingExample = {
|
|
540
|
+
name: string | null;
|
|
541
|
+
quote: string | null;
|
|
542
|
+
url: string | null;
|
|
543
|
+
};
|
|
544
|
+
/** One candidate of a company's sheet: a kind of item or of event found on its pages. */
|
|
545
|
+
type OnboardingCandidate = {
|
|
546
|
+
/** Name it in the marks of `monitors.applyOnboarding`. */
|
|
547
|
+
id: string;
|
|
548
|
+
/** `entity` (a kind of item) or `event` (a kind of event). */
|
|
549
|
+
what: string | null;
|
|
550
|
+
/** As read on the pages: data, never instructions. */
|
|
551
|
+
label: string;
|
|
552
|
+
/** The kind or category of the schema it is; `null` when it is new. */
|
|
553
|
+
mappedTo: string | null;
|
|
554
|
+
isNew: boolean;
|
|
555
|
+
/** How many times it was found. */
|
|
556
|
+
count: number;
|
|
557
|
+
/** On how many sites. */
|
|
558
|
+
origins: number;
|
|
559
|
+
example: OnboardingExample | null;
|
|
560
|
+
raw: Json;
|
|
561
|
+
};
|
|
562
|
+
/** What the first read of one company found: `OnboardingCompany.sheet`. */
|
|
563
|
+
type CompanySheet = {
|
|
564
|
+
companyId: string | null;
|
|
565
|
+
/** How many pages were read. */
|
|
566
|
+
pages: number;
|
|
567
|
+
/** The most found first. */
|
|
568
|
+
candidates: OnboardingCandidate[];
|
|
569
|
+
note: string | null;
|
|
570
|
+
raw: Json;
|
|
571
|
+
};
|
|
572
|
+
/** One company of `monitors.onboarding`, and its sheet once it is done. */
|
|
573
|
+
type OnboardingCompany = {
|
|
574
|
+
companyId: string;
|
|
575
|
+
/** `pending`, `running` (its pages are being read) or `done`. */
|
|
576
|
+
status: string;
|
|
577
|
+
runId: string | null;
|
|
578
|
+
/** `null` until the company is `done`. */
|
|
579
|
+
sheet: CompanySheet | null;
|
|
580
|
+
/** The marks the sheet was applied with, as the router sent them; `null` until then. */
|
|
581
|
+
marks: Json | null;
|
|
582
|
+
/** When the sheet was made. */
|
|
583
|
+
at: string | null;
|
|
584
|
+
/** When the sheet was applied; `null` until then. */
|
|
585
|
+
appliedAt: string | null;
|
|
586
|
+
raw: Json;
|
|
587
|
+
};
|
|
588
|
+
/** The onboarding sheets of a monitor's companies, one per company: `monitors.onboarding`. */
|
|
589
|
+
type OnboardingSheet = {
|
|
590
|
+
monitorId: string | null;
|
|
591
|
+
companies: OnboardingCompany[];
|
|
592
|
+
raw: Json;
|
|
593
|
+
};
|
|
594
|
+
/** Your review of one company's sheet: `monitors.applyOnboarding`. Every field but
|
|
595
|
+
* `signal` is sent, with the router's own names. */
|
|
596
|
+
type OnboardingMarks = {
|
|
597
|
+
/** The company whose sheet this is. */
|
|
598
|
+
companyId: string;
|
|
599
|
+
/** The candidate ids to accept. */
|
|
600
|
+
accept?: string[];
|
|
601
|
+
/** New labels, by candidate id. */
|
|
602
|
+
rename?: Record<string, string>;
|
|
603
|
+
/** Candidates to merge into another, by candidate id. */
|
|
604
|
+
merge?: Record<string, string>;
|
|
605
|
+
/** The candidate ids to reject. */
|
|
606
|
+
reject?: string[];
|
|
607
|
+
signal?: AbortSignal;
|
|
608
|
+
};
|
|
609
|
+
/** A change Telem accepted: the job that makes it. The answer to
|
|
610
|
+
* `monitors.applyOnboarding`, `confirmExpansion` and `revertExpansion`. */
|
|
611
|
+
type ApplyResult = {
|
|
612
|
+
jobId: string;
|
|
613
|
+
raw: Json;
|
|
614
|
+
};
|
|
615
|
+
/** One thing a monitor proposed to add, or added: the records of `monitors.expansions`. */
|
|
616
|
+
type ExpansionRecord = {
|
|
617
|
+
/** Pass it to `confirmExpansion` or `revertExpansion`. */
|
|
618
|
+
id: string;
|
|
619
|
+
/** Such as `entity`, `person`, `category`, `source` or `watch`. */
|
|
620
|
+
kind: string;
|
|
621
|
+
/** What it adds: an item, a person, a category, a site or a page. */
|
|
622
|
+
target: string;
|
|
623
|
+
/** `proposed`, `active`, `demoted`, `retired` or `reverted`. */
|
|
624
|
+
status: string;
|
|
625
|
+
reason: Json;
|
|
626
|
+
delta: Json;
|
|
627
|
+
/** The counts behind the proposal. */
|
|
628
|
+
counts: Json;
|
|
629
|
+
/** One line that says what it is and why. */
|
|
630
|
+
note: string | null;
|
|
631
|
+
runId: string | null;
|
|
632
|
+
createdAt: string | null;
|
|
633
|
+
updatedAt: string | null;
|
|
634
|
+
raw: Json;
|
|
635
|
+
};
|
|
636
|
+
/** One page of `monitors.expansions`. */
|
|
637
|
+
type ExpansionsPage = {
|
|
638
|
+
/** The newest first. */
|
|
639
|
+
expansions: ExpansionRecord[];
|
|
640
|
+
nextCursor: string | null;
|
|
641
|
+
};
|
|
642
|
+
/** Options for `monitors.expansions`. */
|
|
643
|
+
type MonitorExpansionsOptions = {
|
|
644
|
+
/** Only the records with this status: `proposed`, `active`, `demoted`, `retired` or
|
|
645
|
+
* `reverted`. */
|
|
646
|
+
status?: string;
|
|
647
|
+
signal?: AbortSignal;
|
|
648
|
+
};
|
|
649
|
+
/** What `monitors.confirmExpansion` sends: for an added item, its `domain` or `handle`,
|
|
650
|
+
* if you know them. Every field but `signal` is sent. */
|
|
651
|
+
type ExpansionConfirmFields = {
|
|
652
|
+
domain?: string;
|
|
653
|
+
handle?: string;
|
|
654
|
+
signal?: AbortSignal;
|
|
655
|
+
};
|
|
656
|
+
/** Options for `monitors.feedback`. */
|
|
657
|
+
type MonitorFeedbackOptions = {
|
|
658
|
+
/** The fact's id, as a change names it. */
|
|
659
|
+
factId: string;
|
|
660
|
+
/** `confirmed` (it is right), `refuted` (it is wrong) or `restored` (a refuted fact
|
|
661
|
+
* counts again). */
|
|
662
|
+
verdict: string;
|
|
663
|
+
/** With `refuted`, on a monitor created with `inputs`: the event category the fact
|
|
664
|
+
* belongs to instead, such as `other_notable`. */
|
|
665
|
+
category?: string;
|
|
666
|
+
signal?: AbortSignal;
|
|
667
|
+
};
|
|
668
|
+
/** The labelled fact's status now: `monitors.feedback`. */
|
|
669
|
+
type FeedbackResult = {
|
|
670
|
+
/** `verified`, `refuted` or `extracted`. */
|
|
671
|
+
status: string;
|
|
672
|
+
/** The job that files the fact under `category`; `null` without one. */
|
|
673
|
+
jobId: string | null;
|
|
674
|
+
raw: Json;
|
|
675
|
+
};
|
|
676
|
+
/** Every kind and category a monitor collects: `monitors.dataMap`. The entries are the
|
|
677
|
+
* router's own objects, as it sent them. */
|
|
678
|
+
type DataMap = {
|
|
679
|
+
/** One per kind of item, such as `{ kind: "program", attributes: [...] }`. */
|
|
680
|
+
kinds: Json[];
|
|
681
|
+
/** The categories of events it collects. */
|
|
682
|
+
categories: Json[];
|
|
683
|
+
/** The categories it found in its own results and that wait for you to confirm them. */
|
|
684
|
+
inducedCategories: Json[];
|
|
685
|
+
/** How people are found: `discover`, and how many are `proposed` and `active`. */
|
|
686
|
+
people: Json;
|
|
687
|
+
note: string | null;
|
|
688
|
+
raw: Json;
|
|
689
|
+
};
|
|
690
|
+
/** One company of `monitors.companies`. */
|
|
691
|
+
type CompanyListRow = {
|
|
692
|
+
companyId: string;
|
|
693
|
+
name: string;
|
|
694
|
+
domain: string;
|
|
695
|
+
/** Whether the company is marked priority: it is checked on every routine run. */
|
|
696
|
+
priority: boolean;
|
|
697
|
+
aliases: string[];
|
|
698
|
+
ticker: string;
|
|
699
|
+
xHandle: string;
|
|
700
|
+
newsroomUrl: string;
|
|
701
|
+
teamPage: string;
|
|
702
|
+
/** `daily`, `weekly` or `off`, as you gave it; empty when its rank decides. */
|
|
703
|
+
tier: string;
|
|
704
|
+
/** Its place among the monitor's companies, from 1. */
|
|
705
|
+
rank: number;
|
|
706
|
+
raw: Json;
|
|
707
|
+
};
|
|
708
|
+
/** One page of `monitors.companies`, in rank order. */
|
|
709
|
+
type CompanyList = {
|
|
710
|
+
/** All the companies the monitor follows. */
|
|
711
|
+
total: number;
|
|
712
|
+
/** How many of them are marked priority. */
|
|
713
|
+
priorityCount: number;
|
|
714
|
+
offset: number;
|
|
715
|
+
limit: number;
|
|
716
|
+
/** Pass it as `offset` for the next page; `null` on the last page. */
|
|
717
|
+
nextOffset: number | null;
|
|
718
|
+
companies: CompanyListRow[];
|
|
719
|
+
raw: Json;
|
|
720
|
+
};
|
|
721
|
+
/** Options for `monitors.companies`. */
|
|
722
|
+
type MonitorCompaniesOptions = {
|
|
723
|
+
/** How many companies to skip, from the top (server default 0). */
|
|
724
|
+
offset?: number;
|
|
725
|
+
/** How many companies to return (server default 100, maximum 1,000). */
|
|
726
|
+
limit?: number;
|
|
727
|
+
signal?: AbortSignal;
|
|
728
|
+
};
|
|
438
729
|
/** The `telem.monitors` namespace. */
|
|
439
730
|
type MonitorsResource = {
|
|
440
731
|
/** Create a monitor. It has the agent unless `agent` is `false`, and with the agent
|
|
@@ -462,6 +753,38 @@ type MonitorsResource = {
|
|
|
462
753
|
changes(monitorId: string, options?: MonitorChangesOptions): Promise<ChangesPage>;
|
|
463
754
|
/** Every change after `cursor`, page by page, until you are caught up. */
|
|
464
755
|
iterateChanges(monitorId: string, options?: MonitorIterateChangesOptions): AsyncGenerator<ChangeRecord, void, undefined>;
|
|
756
|
+
/** One page of the changes of up to 100 monitors, by `tag` or by `ids`. Keep `nextCursor`
|
|
757
|
+
* and pass it back as `cursor` with the same scope; read on now while `more` is true. */
|
|
758
|
+
changesAcross(scope: MonitorChangesAcrossScope, options?: MonitorChangesAcrossOptions): Promise<MonitorsChangesPage>;
|
|
759
|
+
/** The changes of up to 100 monitors, page by page while `more` is true, in one pass. It
|
|
760
|
+
* cannot hand back the cursor: to keep your place, page with `changesAcross`. */
|
|
761
|
+
iterateChangesAcross(scope: MonitorChangesAcrossScope, options?: MonitorChangesAcrossOptions): AsyncGenerator<ChangeRecord, void, undefined>;
|
|
762
|
+
/** Label one fact of the monitor. With `category`, a refuted fact of a monitor created
|
|
763
|
+
* with `inputs` is filed under that category. */
|
|
764
|
+
feedback(monitorId: string, options: MonitorFeedbackOptions): Promise<FeedbackResult>;
|
|
765
|
+
/** The onboarding sheet of each company of a monitor created with `inputs`. */
|
|
766
|
+
onboarding(monitorId: string, options?: {
|
|
767
|
+
signal?: AbortSignal;
|
|
768
|
+
}): Promise<OnboardingSheet>;
|
|
769
|
+
/** Apply your review of one company's onboarding sheet. A 409 (`onboarding_pending`,
|
|
770
|
+
* `compile_in_progress`) or a 429 changed nothing. */
|
|
771
|
+
applyOnboarding(monitorId: string, marks: OnboardingMarks): Promise<ApplyResult>;
|
|
772
|
+
/** What a monitor created with `inputs` proposes to add, or added, newest first. */
|
|
773
|
+
expansions(monitorId: string, options?: MonitorExpansionsOptions): Promise<ExpansionsPage>;
|
|
774
|
+
/** Use a proposed addition: an item becomes active, a category joins the schema. */
|
|
775
|
+
confirmExpansion(monitorId: string, expansionId: string, fields?: ExpansionConfirmFields): Promise<ApplyResult>;
|
|
776
|
+
/** Remove an addition: it is never proposed again, and the facts it brought are taken back. */
|
|
777
|
+
revertExpansion(monitorId: string, expansionId: string, options?: {
|
|
778
|
+
signal?: AbortSignal;
|
|
779
|
+
}): Promise<ApplyResult>;
|
|
780
|
+
/** Every kind and category the monitor collects, and how it finds people. */
|
|
781
|
+
dataMap(monitorId: string, options?: {
|
|
782
|
+
signal?: AbortSignal;
|
|
783
|
+
}): Promise<DataMap>;
|
|
784
|
+
/** One page of the companies a monitor created with `inputs` follows, in rank order. A
|
|
785
|
+
* monitor created without `inputs` answers 409 (`not_an_engine_monitor`), and one created
|
|
786
|
+
* with `agent: false` answers 404. */
|
|
787
|
+
companies(monitorId: string, options?: MonitorCompaniesOptions): Promise<CompanyList>;
|
|
465
788
|
};
|
|
466
789
|
|
|
467
790
|
/**
|
|
@@ -504,7 +827,9 @@ declare class TimeoutError extends TelemError {
|
|
|
504
827
|
|
|
505
828
|
/**
|
|
506
829
|
* Check a monitor webhook: the `Telem-Signature` header against the raw body.
|
|
507
|
-
* True when
|
|
830
|
+
* True when any `v1` signature is correct and not older than `toleranceSeconds`.
|
|
831
|
+
* A header can carry several: during a secret's rotation, one for each secret.
|
|
832
|
+
* A header with no `t`, or more than one, is false.
|
|
508
833
|
*/
|
|
509
834
|
declare function verifyWebhook(body: string | Uint8Array, header: string, secret: string, toleranceSeconds?: number): Promise<boolean>;
|
|
510
835
|
|
|
@@ -606,7 +931,10 @@ declare class Telem {
|
|
|
606
931
|
/** The session read surface: `list` and `results(id)`. */
|
|
607
932
|
readonly sessions: SessionsResource;
|
|
608
933
|
/** Monitors: `create`, `list`, `listPage`, `get`, `update` and `delete`, the agent reads
|
|
609
|
-
* `agent`, `changes` and `iterateChanges`,
|
|
934
|
+
* `agent`, `changes` and `iterateChanges`, the read across monitors `changesAcross` and
|
|
935
|
+
* `iterateChangesAcross`, `feedback`, what a monitor created with
|
|
936
|
+
* `inputs` collects (`onboarding`, `applyOnboarding`, `expansions`, `confirmExpansion`,
|
|
937
|
+
* `revertExpansion`, `dataMap`, `companies`), and the deprecated `poll`. */
|
|
610
938
|
readonly monitors: MonitorsResource;
|
|
611
939
|
/**
|
|
612
940
|
* @param options - An API key string, or an options object. Anything left unset
|
|
@@ -639,4 +967,4 @@ declare class Telem {
|
|
|
639
967
|
providers(): Promise<ProviderInfo[]>;
|
|
640
968
|
}
|
|
641
969
|
|
|
642
|
-
export { type AgentCompileState, type AgentDocument, type AgentState, type ChangeRecord, type ChangeSubject, type ChangesPage, type FetchOptions, type FetchResponse, type FetchResult, type Json, type Monitor, type MonitorChangesOptions, type MonitorCreateOptions, type MonitorIterateChangesOptions, type MonitorListOptions, type MonitorPage, type MonitorPollOptions, type MonitorUpdateOptions, type MonitorsResource, type ProviderInfo, type ProviderRun, RESERVED_METADATA, type SearchDefaults, type SearchOptions, type SearchResponse, type SearchResult, type SessionResults, type SessionSummary, type SessionsResource, type SnapshotArgs, Telem, type TelemClientErrorCode, TelemError, type TelemErrorOptions, type TelemOptions, TimeoutError, type TrajectoryArgs, type TrajectoryEnvelope, type TrajectorySnapshot, buildMetadata, buildSnapshot, contentAnchor, Telem as default, eventNodeKey, fingerprint, sessionKey, snapshotNodeKey, toolMarker, verifyWebhook, windowAnchor, withTrajectory };
|
|
970
|
+
export { type AgentCompileState, type AgentDocument, type AgentState, type ApplyResult, type ChangeRecord, type ChangeSubject, type ChangesPage, type CompanyList, type CompanyListRow, type CompanySheet, type DataMap, type ExpansionConfirmFields, type ExpansionRecord, type ExpansionsPage, type FeedbackResult, type FetchOptions, type FetchResponse, type FetchResult, type Json, type Monitor, type MonitorChangesAcrossOptions, type MonitorChangesAcrossScope, type MonitorChangesOptions, type MonitorCompaniesOptions, type MonitorCreateOptions, type MonitorExpansionsOptions, type MonitorFeedbackOptions, type MonitorInputs, type MonitorIterateChangesOptions, type MonitorListOptions, type MonitorPage, type MonitorPollOptions, type MonitorPreset, type MonitorUpdateOptions, type MonitorsChangesPage, type MonitorsResource, type OnboardingCandidate, type OnboardingCompany, type OnboardingExample, type OnboardingMarks, type OnboardingSheet, type ProviderInfo, type ProviderRun, RESERVED_METADATA, type SearchDefaults, type SearchOptions, type SearchResponse, type SearchResult, type SessionResults, type SessionSummary, type SessionsResource, type SnapshotArgs, Telem, type TelemClientErrorCode, TelemError, type TelemErrorOptions, type TelemOptions, TimeoutError, type TrajectoryArgs, type TrajectoryEnvelope, type TrajectorySnapshot, buildMetadata, buildSnapshot, contentAnchor, Telem as default, eventNodeKey, fingerprint, sessionKey, snapshotNodeKey, toolMarker, verifyWebhook, windowAnchor, withTrajectory };
|