@telemai/sdk 0.4.0 → 0.6.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 +26 -15
- package/dist/{chunk-SQ3ZZA72.js → chunk-TST6J3VA.js} +32 -8
- package/dist/index.cjs +284 -25
- package/dist/index.d.cts +322 -19
- package/dist/index.d.ts +322 -19
- package/dist/index.js +253 -18
- package/dist/vercel/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -64,6 +64,7 @@ type SearchOptions = {
|
|
|
64
64
|
autoRouting?: string;
|
|
65
65
|
maxRoutingProviders?: number;
|
|
66
66
|
topic?: string;
|
|
67
|
+
vertical?: string;
|
|
67
68
|
/** Only results published on or after this date or date-time: an ISO 8601 string
|
|
68
69
|
* (no time zone means UTC) or a `Date`. Results with no known date are kept.
|
|
69
70
|
* Per-call only, like the two below. */
|
|
@@ -94,7 +95,7 @@ type SearchOptions = {
|
|
|
94
95
|
};
|
|
95
96
|
/** The subset of search options that may also be set as a client default.
|
|
96
97
|
* `numResults`/`includeRaw`/`rerank`/`providerOverrides` are per-call intent only. */
|
|
97
|
-
type SearchDefaults = Pick<SearchOptions, "tier" | "fields" | "providersInclude" | "providersExclude" | "includeFullContent" | "autoRouting" | "maxRoutingProviders" | "topic">;
|
|
98
|
+
type SearchDefaults = Pick<SearchOptions, "tier" | "fields" | "providersInclude" | "providersExclude" | "includeFullContent" | "autoRouting" | "maxRoutingProviders" | "topic" | "vertical">;
|
|
98
99
|
type FetchOptions = {
|
|
99
100
|
/** Fetch provider chain, in order. Defaults to `TELEM_FETCH_PROVIDERS`. */
|
|
100
101
|
providers?: string[];
|
|
@@ -114,9 +115,12 @@ type FetchOptions = {
|
|
|
114
115
|
metadata?: Json;
|
|
115
116
|
};
|
|
116
117
|
type TelemOptions = SearchDefaults & {
|
|
118
|
+
defaultVertical?: string;
|
|
117
119
|
apiKey?: string;
|
|
118
120
|
baseUrl?: string;
|
|
119
121
|
timeoutMs?: number;
|
|
122
|
+
/** Retries after the first attempt: 2 by default. `monitors.create` retries for up
|
|
123
|
+
* to about 120 s instead, at most 60 times. A value you pass caps both. */
|
|
120
124
|
maxRetries?: number;
|
|
121
125
|
/** Injectable transport — embedded runtimes, edge workers, and tests. */
|
|
122
126
|
fetch?: typeof globalThis.fetch;
|
|
@@ -238,28 +242,81 @@ type SessionsResource = {
|
|
|
238
242
|
};
|
|
239
243
|
/** The search options a monitor can run on its schedule (`MonitorCreateOptions.search`). */
|
|
240
244
|
type MonitorSearchOptions = Pick<SearchOptions, "tier" | "numResults">;
|
|
241
|
-
/**
|
|
242
|
-
type
|
|
245
|
+
/** The options of `monitors.create` that a monitor takes with the agent or without. */
|
|
246
|
+
type MonitorCreateCommonOptions = {
|
|
243
247
|
/** `"1h"`, `"6h"`, `"12h"`, `"1d"` or `"7d"`. If you leave it out, the monitor runs once a day. */
|
|
244
248
|
frequency?: string;
|
|
245
249
|
/** Also run a web search for the query on the schedule, with these options. `{}`
|
|
246
|
-
* uses the defaults. Client search defaults do not apply. */
|
|
250
|
+
* uses the defaults. Client search defaults do not apply. It adds to what a poll returns. */
|
|
247
251
|
search?: MonitorSearchOptions;
|
|
248
|
-
/** Only results from these sites and their subdomains, such as `["sec.gov"]`,
|
|
249
|
-
*
|
|
252
|
+
/** Only results from these sites and their subdomains, such as `["sec.gov"]`, in what
|
|
253
|
+
* a poll returns. */
|
|
250
254
|
includeDomains?: string[];
|
|
251
|
-
/**
|
|
255
|
+
/** Query lineage keys, sent as given. They choose the session that records the polls of
|
|
256
|
+
* the monitor. */
|
|
252
257
|
metadata?: Json;
|
|
253
258
|
/** An `https` URL that receives the new results. */
|
|
254
259
|
webhookUrl?: string;
|
|
255
|
-
/**
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
/** Labels of your own, to list the monitor by with `list({ tag })`: at most 10. Telem
|
|
261
|
+
* strips and lower-cases each one, which must then be 1 to 32 of `a-z`, `0-9`, `-` and
|
|
262
|
+
* `_`, starting with a letter or digit, and drops repeats. Anything else is a 422. */
|
|
263
|
+
tags?: string[];
|
|
264
|
+
/** The `Idempotency-Key` header, 1 to 255 visible ASCII characters. By default each
|
|
265
|
+
* call makes a new one. Pass your own to retry a create across a restart. */
|
|
266
|
+
idempotencyKey?: string;
|
|
261
267
|
signal?: AbortSignal;
|
|
262
268
|
};
|
|
269
|
+
/** What a monitor of a list of companies collects: the `inputs` of `monitors.create`.
|
|
270
|
+
* Sent as given, with the router's own field names, and checked by the router. */
|
|
271
|
+
type MonitorInputs = {
|
|
272
|
+
/** The companies, 1 to 20: rows of `company_id`, `name` and `domain`. */
|
|
273
|
+
companies: Json[];
|
|
274
|
+
/** People to watch: rows of `person_id`, `name`, `company_id` and `company`. */
|
|
275
|
+
roster?: Json[];
|
|
276
|
+
/** What to collect: the preset `"biopharma-v0"`, or a schema object. */
|
|
277
|
+
schema?: string | Json;
|
|
278
|
+
/** Items to watch from the start: rows of `entity_id`, `kind` and `name`. */
|
|
279
|
+
entities?: Json[];
|
|
280
|
+
/** Kinds of event to collect: rows with a `label`. */
|
|
281
|
+
categories?: Json[];
|
|
282
|
+
/** `"propose"`: people found on company pages are proposed, for you to confirm.
|
|
283
|
+
* `"auto"`: they are watched at once. */
|
|
284
|
+
discover?: string;
|
|
285
|
+
/** How many days back the first read of each company looks. */
|
|
286
|
+
window_days?: number;
|
|
287
|
+
/** Look each company up before its first read, to find its other names and pages. */
|
|
288
|
+
seed?: boolean;
|
|
289
|
+
vertical?: string;
|
|
290
|
+
};
|
|
291
|
+
/** Options for `monitors.create`. A monitor has the agent unless `agent` is `false`,
|
|
292
|
+
* and a monitor with the agent must end: then `ttl` is required. */
|
|
293
|
+
type MonitorCreateOptions = MonitorCreateCommonOptions & ({
|
|
294
|
+
/** `false` creates a monitor without an agent, which you read with the deprecated
|
|
295
|
+
* `monitors.poll`. */
|
|
296
|
+
agent: false;
|
|
297
|
+
/** End the monitor after this long, such as `"7d"` or `"30d"` (at most `"30d"`).
|
|
298
|
+
* Without it, a monitor without an agent never ends. */
|
|
299
|
+
ttl?: string;
|
|
300
|
+
} | {
|
|
301
|
+
/** Start the monitor agent with the monitor, the default: it checks every result
|
|
302
|
+
* against the query and keeps the ones that match. Read what it keeps with
|
|
303
|
+
* `monitors.iterateChanges` or `monitors.changes`. */
|
|
304
|
+
agent?: true;
|
|
305
|
+
/** End the monitor after this long, such as `"7d"` or `"30d"` (at most `"30d"`, or
|
|
306
|
+
* `"365d"` with `inputs`). Required with the agent. */
|
|
307
|
+
ttl: string;
|
|
308
|
+
/** Watch a list of companies: the companies, and the schema that says what to
|
|
309
|
+
* collect about them. Such a monitor has the agent. Read what the first read of
|
|
310
|
+
* each company found with `monitors.onboarding`. */
|
|
311
|
+
inputs?: MonitorInputs;
|
|
312
|
+
/** The fields every result has: `"article"` (`headline`, `publication`,
|
|
313
|
+
* `published_at`, `summary`, `kind`), `"person"`, `"company"` or `"listing"`. The
|
|
314
|
+
* agent keeps them as they are and may add more. Leave it out and the agent picks
|
|
315
|
+
* the fields from the query. Refused with `inputs`. */
|
|
316
|
+
preset?: MonitorPreset;
|
|
317
|
+
});
|
|
318
|
+
/** The `preset` of `monitors.create`. */
|
|
319
|
+
type MonitorPreset = "article" | "person" | "company" | "listing";
|
|
263
320
|
/** Options for `monitors.update`. Send at least one field. */
|
|
264
321
|
type MonitorUpdateOptions = {
|
|
265
322
|
/** `"paused"` or `"active"`. */
|
|
@@ -267,9 +324,16 @@ type MonitorUpdateOptions = {
|
|
|
267
324
|
frequency?: string;
|
|
268
325
|
/** A new webhook URL, with a new `webhookSecret` in the response. `null` or `""` removes it. */
|
|
269
326
|
webhookUrl?: string | null;
|
|
327
|
+
/** A new end, this long from now, such as `"30d"` (at most `"30d"`). It renews a monitor
|
|
328
|
+
* before it ends; an ended monitor cannot be renewed. */
|
|
329
|
+
ttl?: string;
|
|
330
|
+
/** The monitor's new tags, in place of all its tags (the rule of `create`). `[]`
|
|
331
|
+
* removes them all; leave it out to keep them. */
|
|
332
|
+
tags?: string[];
|
|
270
333
|
signal?: AbortSignal;
|
|
271
334
|
};
|
|
272
|
-
/** Options for `monitors.poll`.
|
|
335
|
+
/** Options for `monitors.poll`.
|
|
336
|
+
* @deprecated `poll` is deprecated: read the agent with `monitors.iterateChanges`. */
|
|
273
337
|
type MonitorPollOptions = {
|
|
274
338
|
/** Record this poll in another session (default: the monitor's own). */
|
|
275
339
|
session?: string;
|
|
@@ -295,6 +359,11 @@ type Monitor = {
|
|
|
295
359
|
/** The monitor agent's state. `null`: the monitor has no agent. Absent when the router
|
|
296
360
|
* sends none, as a router from before the agent reads does. */
|
|
297
361
|
agentState?: AgentState | null;
|
|
362
|
+
/** Only in the answer to a create: why the monitor agent did not start, or not yet.
|
|
363
|
+
* `null` when it started, and in every other answer. */
|
|
364
|
+
agentNote: string | null;
|
|
365
|
+
/** Your labels for the monitor; empty when it has none. */
|
|
366
|
+
tags: string[];
|
|
298
367
|
raw: Json;
|
|
299
368
|
};
|
|
300
369
|
/** The latest compile of an agent's plan (`AgentState.compile`). */
|
|
@@ -307,7 +376,7 @@ type AgentCompileState = {
|
|
|
307
376
|
};
|
|
308
377
|
/** The state of a monitor's agent: `monitor.agentState`. */
|
|
309
378
|
type AgentState = {
|
|
310
|
-
/** The agent engine
|
|
379
|
+
/** The agent engine: `"v4"`, or `"engine"` for a monitor created with `inputs`. */
|
|
311
380
|
engine: string;
|
|
312
381
|
/** Such as `compiling`, `ready`, `paused` or `failed`. */
|
|
313
382
|
status: string;
|
|
@@ -394,6 +463,48 @@ type MonitorChangesOptions = {
|
|
|
394
463
|
limit?: number;
|
|
395
464
|
signal?: AbortSignal;
|
|
396
465
|
};
|
|
466
|
+
/** The monitors of `monitors.changesAcross`: your key's own live monitors that carry
|
|
467
|
+
* `tag`, or the monitors of `ids`, one of the two. */
|
|
468
|
+
type MonitorChangesAcrossScope = {
|
|
469
|
+
/** Your key's own live monitors that carry this tag. One with no agent is in `skipped`. */
|
|
470
|
+
tag: string;
|
|
471
|
+
ids?: never;
|
|
472
|
+
} | {
|
|
473
|
+
/** These monitors, at most 100: any monitor with an agent in your key's project, ended
|
|
474
|
+
* ones too. One that is not is a 404 for the whole read. */
|
|
475
|
+
ids: string[];
|
|
476
|
+
tag?: never;
|
|
477
|
+
};
|
|
478
|
+
/** Options for `monitors.changesAcross` and `monitors.iterateChangesAcross`. */
|
|
479
|
+
type MonitorChangesAcrossOptions = {
|
|
480
|
+
/** The `nextCursor` of the page before. If you leave it out, the read starts at the
|
|
481
|
+
* first change. Do not send it with `since`. */
|
|
482
|
+
cursor?: string;
|
|
483
|
+
/** Read from this time on, as in `changes`. A monitor that joins later starts at the
|
|
484
|
+
* same time. Do not send it with `cursor`. */
|
|
485
|
+
since?: string | Date;
|
|
486
|
+
/** Only these kinds of change, as in `changes`. */
|
|
487
|
+
kinds?: string[];
|
|
488
|
+
/** How many changes to return (server default 200, maximum 500). */
|
|
489
|
+
limit?: number;
|
|
490
|
+
signal?: AbortSignal;
|
|
491
|
+
};
|
|
492
|
+
/** One page of `monitors.changesAcross`. Ordered by `seq`, but a monitor that joins later
|
|
493
|
+
* or catches up can bring lower seqs on a later page: dedupe by `seq`. */
|
|
494
|
+
type MonitorsChangesPage = {
|
|
495
|
+
changes: ChangeRecord[];
|
|
496
|
+
/** Keep this and pass it as `cursor` to read on. It is opaque, and holds the place of
|
|
497
|
+
* every monitor of the read, the `pending` ones too. */
|
|
498
|
+
nextCursor: string;
|
|
499
|
+
/** `true` only for a full page: read on now with `nextCursor`. */
|
|
500
|
+
more: boolean;
|
|
501
|
+
/** The monitors read for this page. */
|
|
502
|
+
monitors: string[];
|
|
503
|
+
/** The monitors not read on this call. A later call with `nextCursor` reads them. */
|
|
504
|
+
pending: string[];
|
|
505
|
+
/** The monitors of the tag that have no agent. */
|
|
506
|
+
skipped: string[];
|
|
507
|
+
};
|
|
397
508
|
/** Options for `monitors.iterateChanges`. */
|
|
398
509
|
type MonitorIterateChangesOptions = {
|
|
399
510
|
/** Read the changes after this `seq`. If you leave it out, the walk starts at the
|
|
@@ -407,6 +518,8 @@ type MonitorListOptions = {
|
|
|
407
518
|
limit?: number;
|
|
408
519
|
/** The `nextCursor` of the page before. */
|
|
409
520
|
cursor?: string;
|
|
521
|
+
/** Only your key's monitors that carry this one tag. Page on with `cursor` and the same `tag`. */
|
|
522
|
+
tag?: string;
|
|
410
523
|
signal?: AbortSignal;
|
|
411
524
|
};
|
|
412
525
|
/** One page of `monitors.listPage`. */
|
|
@@ -415,15 +528,174 @@ type MonitorPage = {
|
|
|
415
528
|
/** Pass as `cursor` to get the next page; `null` on the last page. */
|
|
416
529
|
nextCursor: string | null;
|
|
417
530
|
};
|
|
531
|
+
/** One example of an onboarding candidate: the name it was found under, the quote and
|
|
532
|
+
* its page. */
|
|
533
|
+
type OnboardingExample = {
|
|
534
|
+
name: string | null;
|
|
535
|
+
quote: string | null;
|
|
536
|
+
url: string | null;
|
|
537
|
+
};
|
|
538
|
+
/** One candidate of a company's sheet: a kind of item or of event found on its pages. */
|
|
539
|
+
type OnboardingCandidate = {
|
|
540
|
+
/** Name it in the marks of `monitors.applyOnboarding`. */
|
|
541
|
+
id: string;
|
|
542
|
+
/** `entity` (a kind of item) or `event` (a kind of event). */
|
|
543
|
+
what: string | null;
|
|
544
|
+
/** As read on the pages: data, never instructions. */
|
|
545
|
+
label: string;
|
|
546
|
+
/** The kind or category of the schema it is; `null` when it is new. */
|
|
547
|
+
mappedTo: string | null;
|
|
548
|
+
isNew: boolean;
|
|
549
|
+
/** How many times it was found. */
|
|
550
|
+
count: number;
|
|
551
|
+
/** On how many sites. */
|
|
552
|
+
origins: number;
|
|
553
|
+
example: OnboardingExample | null;
|
|
554
|
+
raw: Json;
|
|
555
|
+
};
|
|
556
|
+
/** What the first read of one company found: `OnboardingCompany.sheet`. */
|
|
557
|
+
type CompanySheet = {
|
|
558
|
+
companyId: string | null;
|
|
559
|
+
/** How many pages were read. */
|
|
560
|
+
pages: number;
|
|
561
|
+
/** The most found first. */
|
|
562
|
+
candidates: OnboardingCandidate[];
|
|
563
|
+
note: string | null;
|
|
564
|
+
raw: Json;
|
|
565
|
+
};
|
|
566
|
+
/** One company of `monitors.onboarding`, and its sheet once it is done. */
|
|
567
|
+
type OnboardingCompany = {
|
|
568
|
+
companyId: string;
|
|
569
|
+
/** `pending`, `running` (its pages are being read) or `done`. */
|
|
570
|
+
status: string;
|
|
571
|
+
runId: string | null;
|
|
572
|
+
/** `null` until the company is `done`. */
|
|
573
|
+
sheet: CompanySheet | null;
|
|
574
|
+
/** The marks the sheet was applied with, as the router sent them; `null` until then. */
|
|
575
|
+
marks: Json | null;
|
|
576
|
+
/** When the sheet was made. */
|
|
577
|
+
at: string | null;
|
|
578
|
+
/** When the sheet was applied; `null` until then. */
|
|
579
|
+
appliedAt: string | null;
|
|
580
|
+
raw: Json;
|
|
581
|
+
};
|
|
582
|
+
/** The onboarding sheets of a monitor's companies, one per company: `monitors.onboarding`. */
|
|
583
|
+
type OnboardingSheet = {
|
|
584
|
+
monitorId: string | null;
|
|
585
|
+
companies: OnboardingCompany[];
|
|
586
|
+
raw: Json;
|
|
587
|
+
};
|
|
588
|
+
/** Your review of one company's sheet: `monitors.applyOnboarding`. Every field but
|
|
589
|
+
* `signal` is sent, with the router's own names. */
|
|
590
|
+
type OnboardingMarks = {
|
|
591
|
+
/** The company whose sheet this is. */
|
|
592
|
+
companyId: string;
|
|
593
|
+
/** The candidate ids to accept. */
|
|
594
|
+
accept?: string[];
|
|
595
|
+
/** New labels, by candidate id. */
|
|
596
|
+
rename?: Record<string, string>;
|
|
597
|
+
/** Candidates to merge into another, by candidate id. */
|
|
598
|
+
merge?: Record<string, string>;
|
|
599
|
+
/** The candidate ids to reject. */
|
|
600
|
+
reject?: string[];
|
|
601
|
+
signal?: AbortSignal;
|
|
602
|
+
};
|
|
603
|
+
/** A change Telem accepted: the job that makes it. The answer to
|
|
604
|
+
* `monitors.applyOnboarding`, `confirmExpansion` and `revertExpansion`. */
|
|
605
|
+
type ApplyResult = {
|
|
606
|
+
jobId: string;
|
|
607
|
+
raw: Json;
|
|
608
|
+
};
|
|
609
|
+
/** One thing a monitor proposed to add, or added: the records of `monitors.expansions`. */
|
|
610
|
+
type ExpansionRecord = {
|
|
611
|
+
/** Pass it to `confirmExpansion` or `revertExpansion`. */
|
|
612
|
+
id: string;
|
|
613
|
+
/** Such as `entity`, `person`, `category`, `source` or `watch`. */
|
|
614
|
+
kind: string;
|
|
615
|
+
/** What it adds: an item, a person, a category, a site or a page. */
|
|
616
|
+
target: string;
|
|
617
|
+
/** `proposed`, `active`, `demoted`, `retired` or `reverted`. */
|
|
618
|
+
status: string;
|
|
619
|
+
reason: Json;
|
|
620
|
+
delta: Json;
|
|
621
|
+
/** The counts behind the proposal. */
|
|
622
|
+
counts: Json;
|
|
623
|
+
/** One line that says what it is and why. */
|
|
624
|
+
note: string | null;
|
|
625
|
+
runId: string | null;
|
|
626
|
+
createdAt: string | null;
|
|
627
|
+
updatedAt: string | null;
|
|
628
|
+
raw: Json;
|
|
629
|
+
};
|
|
630
|
+
/** One page of `monitors.expansions`. */
|
|
631
|
+
type ExpansionsPage = {
|
|
632
|
+
/** The newest first. */
|
|
633
|
+
expansions: ExpansionRecord[];
|
|
634
|
+
nextCursor: string | null;
|
|
635
|
+
};
|
|
636
|
+
/** Options for `monitors.expansions`. */
|
|
637
|
+
type MonitorExpansionsOptions = {
|
|
638
|
+
/** Only the records with this status: `proposed`, `active`, `demoted`, `retired` or
|
|
639
|
+
* `reverted`. */
|
|
640
|
+
status?: string;
|
|
641
|
+
signal?: AbortSignal;
|
|
642
|
+
};
|
|
643
|
+
/** What `monitors.confirmExpansion` sends: for an added item, its `domain` or `handle`,
|
|
644
|
+
* if you know them. Every field but `signal` is sent. */
|
|
645
|
+
type ExpansionConfirmFields = {
|
|
646
|
+
domain?: string;
|
|
647
|
+
handle?: string;
|
|
648
|
+
signal?: AbortSignal;
|
|
649
|
+
};
|
|
650
|
+
/** Options for `monitors.feedback`. */
|
|
651
|
+
type MonitorFeedbackOptions = {
|
|
652
|
+
/** The fact's id, as a change names it. */
|
|
653
|
+
factId: string;
|
|
654
|
+
/** `confirmed` (it is right), `refuted` (it is wrong) or `restored` (a refuted fact
|
|
655
|
+
* counts again). */
|
|
656
|
+
verdict: string;
|
|
657
|
+
/** With `refuted`, on a monitor created with `inputs`: the event category the fact
|
|
658
|
+
* belongs to instead, such as `other_notable`. */
|
|
659
|
+
category?: string;
|
|
660
|
+
signal?: AbortSignal;
|
|
661
|
+
};
|
|
662
|
+
/** The labelled fact's status now: `monitors.feedback`. */
|
|
663
|
+
type FeedbackResult = {
|
|
664
|
+
/** `verified`, `refuted` or `extracted`. */
|
|
665
|
+
status: string;
|
|
666
|
+
/** The job that files the fact under `category`; `null` without one. */
|
|
667
|
+
jobId: string | null;
|
|
668
|
+
raw: Json;
|
|
669
|
+
};
|
|
670
|
+
/** Every kind and category a monitor collects: `monitors.dataMap`. The entries are the
|
|
671
|
+
* router's own objects, as it sent them. */
|
|
672
|
+
type DataMap = {
|
|
673
|
+
/** One per kind of item, such as `{ kind: "program", attributes: [...] }`. */
|
|
674
|
+
kinds: Json[];
|
|
675
|
+
/** The categories of events it collects. */
|
|
676
|
+
categories: Json[];
|
|
677
|
+
/** The categories it found in its own results and that wait for you to confirm them. */
|
|
678
|
+
inducedCategories: Json[];
|
|
679
|
+
/** How people are found: `discover`, and how many are `proposed` and `active`. */
|
|
680
|
+
people: Json;
|
|
681
|
+
note: string | null;
|
|
682
|
+
raw: Json;
|
|
683
|
+
};
|
|
418
684
|
/** The `telem.monitors` namespace. */
|
|
419
685
|
type MonitorsResource = {
|
|
420
|
-
|
|
686
|
+
/** Create a monitor. It has the agent unless `agent` is `false`, and with the agent
|
|
687
|
+
* `ttl` is required: a create without it throws a `TelemError` (`invalid_request`)
|
|
688
|
+
* before anything is sent. */
|
|
689
|
+
create(query: string, options: MonitorCreateOptions): Promise<Monitor>;
|
|
421
690
|
list(options?: MonitorListOptions): Promise<Monitor[]>;
|
|
422
691
|
listPage(options?: MonitorListOptions): Promise<MonitorPage>;
|
|
423
692
|
get(monitorId: string, options?: {
|
|
424
693
|
signal?: AbortSignal;
|
|
425
694
|
}): Promise<Monitor>;
|
|
426
695
|
update(monitorId: string, options: MonitorUpdateOptions): Promise<Monitor>;
|
|
696
|
+
/** Get the monitor's own results that are new since the last poll.
|
|
697
|
+
* @deprecated Read what the monitor agent finds with `iterateChanges` or `changes`.
|
|
698
|
+
* A poll still works, and warns once per process with `console.warn`. */
|
|
427
699
|
poll(monitorId: string, options?: MonitorPollOptions): Promise<SearchResponse>;
|
|
428
700
|
delete(monitorId: string, options?: {
|
|
429
701
|
signal?: AbortSignal;
|
|
@@ -436,6 +708,34 @@ type MonitorsResource = {
|
|
|
436
708
|
changes(monitorId: string, options?: MonitorChangesOptions): Promise<ChangesPage>;
|
|
437
709
|
/** Every change after `cursor`, page by page, until you are caught up. */
|
|
438
710
|
iterateChanges(monitorId: string, options?: MonitorIterateChangesOptions): AsyncGenerator<ChangeRecord, void, undefined>;
|
|
711
|
+
/** One page of the changes of up to 100 monitors, by `tag` or by `ids`. Keep `nextCursor`
|
|
712
|
+
* and pass it back as `cursor` with the same scope; read on now while `more` is true. */
|
|
713
|
+
changesAcross(scope: MonitorChangesAcrossScope, options?: MonitorChangesAcrossOptions): Promise<MonitorsChangesPage>;
|
|
714
|
+
/** The changes of up to 100 monitors, page by page while `more` is true, in one pass. It
|
|
715
|
+
* cannot hand back the cursor: to keep your place, page with `changesAcross`. */
|
|
716
|
+
iterateChangesAcross(scope: MonitorChangesAcrossScope, options?: MonitorChangesAcrossOptions): AsyncGenerator<ChangeRecord, void, undefined>;
|
|
717
|
+
/** Label one fact of the monitor. With `category`, a refuted fact of a monitor created
|
|
718
|
+
* with `inputs` is filed under that category. */
|
|
719
|
+
feedback(monitorId: string, options: MonitorFeedbackOptions): Promise<FeedbackResult>;
|
|
720
|
+
/** The onboarding sheet of each company of a monitor created with `inputs`. */
|
|
721
|
+
onboarding(monitorId: string, options?: {
|
|
722
|
+
signal?: AbortSignal;
|
|
723
|
+
}): Promise<OnboardingSheet>;
|
|
724
|
+
/** Apply your review of one company's onboarding sheet. A 409 (`onboarding_pending`,
|
|
725
|
+
* `compile_in_progress`) or a 429 changed nothing. */
|
|
726
|
+
applyOnboarding(monitorId: string, marks: OnboardingMarks): Promise<ApplyResult>;
|
|
727
|
+
/** What a monitor created with `inputs` proposes to add, or added, newest first. */
|
|
728
|
+
expansions(monitorId: string, options?: MonitorExpansionsOptions): Promise<ExpansionsPage>;
|
|
729
|
+
/** Use a proposed addition: an item becomes active, a category joins the schema. */
|
|
730
|
+
confirmExpansion(monitorId: string, expansionId: string, fields?: ExpansionConfirmFields): Promise<ApplyResult>;
|
|
731
|
+
/** Remove an addition: it is never proposed again, and the facts it brought are taken back. */
|
|
732
|
+
revertExpansion(monitorId: string, expansionId: string, options?: {
|
|
733
|
+
signal?: AbortSignal;
|
|
734
|
+
}): Promise<ApplyResult>;
|
|
735
|
+
/** Every kind and category the monitor collects, and how it finds people. */
|
|
736
|
+
dataMap(monitorId: string, options?: {
|
|
737
|
+
signal?: AbortSignal;
|
|
738
|
+
}): Promise<DataMap>;
|
|
439
739
|
};
|
|
440
740
|
|
|
441
741
|
/**
|
|
@@ -579,8 +879,11 @@ declare class Telem {
|
|
|
579
879
|
readonly maxRetries: number;
|
|
580
880
|
/** The session read surface: `list` and `results(id)`. */
|
|
581
881
|
readonly sessions: SessionsResource;
|
|
582
|
-
/** Monitors: `create`, `list`, `listPage`, `get`, `update
|
|
583
|
-
*
|
|
882
|
+
/** Monitors: `create`, `list`, `listPage`, `get`, `update` and `delete`, the agent reads
|
|
883
|
+
* `agent`, `changes` and `iterateChanges`, the read across monitors `changesAcross` and
|
|
884
|
+
* `iterateChangesAcross`, `feedback`, what a monitor created with
|
|
885
|
+
* `inputs` collects (`onboarding`, `applyOnboarding`, `expansions`, `confirmExpansion`,
|
|
886
|
+
* `revertExpansion`, `dataMap`), and the deprecated `poll`. */
|
|
584
887
|
readonly monitors: MonitorsResource;
|
|
585
888
|
/**
|
|
586
889
|
* @param options - An API key string, or an options object. Anything left unset
|
|
@@ -613,4 +916,4 @@ declare class Telem {
|
|
|
613
916
|
providers(): Promise<ProviderInfo[]>;
|
|
614
917
|
}
|
|
615
918
|
|
|
616
|
-
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 };
|
|
919
|
+
export { type AgentCompileState, type AgentDocument, type AgentState, type ApplyResult, type ChangeRecord, type ChangeSubject, type ChangesPage, 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 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 };
|