@telemai/sdk 0.6.0 → 0.8.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 +37 -6
- package/dist/{chunk-TST6J3VA.js → chunk-274HRD4N.js} +34 -6
- package/dist/index.cjs +348 -92
- package/dist/index.d.cts +105 -4
- package/dist/index.d.ts +105 -4
- package/dist/index.js +323 -83
- 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.cts
CHANGED
|
@@ -63,6 +63,8 @@ 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;
|
|
67
69
|
vertical?: string;
|
|
68
70
|
/** Only results published on or after this date or date-time: an ISO 8601 string
|
|
@@ -141,6 +143,10 @@ type SearchResult = {
|
|
|
141
143
|
source: Json | null;
|
|
142
144
|
enrichments: Json | null;
|
|
143
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;
|
|
144
150
|
provider: string;
|
|
145
151
|
raw: Json;
|
|
146
152
|
};
|
|
@@ -317,6 +323,30 @@ type MonitorCreateOptions = MonitorCreateCommonOptions & ({
|
|
|
317
323
|
});
|
|
318
324
|
/** The `preset` of `monitors.create`. */
|
|
319
325
|
type MonitorPreset = "article" | "person" | "company" | "listing";
|
|
326
|
+
/** One monitor of `monitors.createMany`: its `query` and the options of `create`.
|
|
327
|
+
* `idempotencyKey` is this monitor's own key; the call takes the `signal`. */
|
|
328
|
+
type MonitorCreateManyItem = {
|
|
329
|
+
query: string;
|
|
330
|
+
} & WithoutSignal<MonitorCreateOptions>;
|
|
331
|
+
/** `Omit` for each member of a union, so the `agent`/`ttl` pairing holds. */
|
|
332
|
+
type WithoutSignal<T> = T extends unknown ? Omit<T, "signal"> : never;
|
|
333
|
+
/** One monitor's answer in `monitors.createMany`. */
|
|
334
|
+
type MonitorBatchResult = {
|
|
335
|
+
/** The monitor's position in the array you passed. */
|
|
336
|
+
index: number;
|
|
337
|
+
/** `201`: made. `200` with `replayed`: made before, under the same key. Any other
|
|
338
|
+
* status is this monitor's own error. */
|
|
339
|
+
status: number;
|
|
340
|
+
monitor: Monitor | null;
|
|
341
|
+
replayed: boolean;
|
|
342
|
+
/** `{ code, message }`, and `param` when a field is at fault. */
|
|
343
|
+
error: Json | null;
|
|
344
|
+
/** With a `429`: the seconds to wait before you send this monitor again. */
|
|
345
|
+
retryAfter: number | null;
|
|
346
|
+
/** The key this monitor was sent with: send it again with the same key. */
|
|
347
|
+
idempotencyKey: string;
|
|
348
|
+
raw: Json;
|
|
349
|
+
};
|
|
320
350
|
/** Options for `monitors.update`. Send at least one field. */
|
|
321
351
|
type MonitorUpdateOptions = {
|
|
322
352
|
/** `"paused"` or `"active"`. */
|
|
@@ -681,12 +711,63 @@ type DataMap = {
|
|
|
681
711
|
note: string | null;
|
|
682
712
|
raw: Json;
|
|
683
713
|
};
|
|
714
|
+
/** One company of `monitors.companies`. */
|
|
715
|
+
type CompanyListRow = {
|
|
716
|
+
companyId: string;
|
|
717
|
+
name: string;
|
|
718
|
+
domain: string;
|
|
719
|
+
/** Whether the company is marked priority: it is checked on every routine run. */
|
|
720
|
+
priority: boolean;
|
|
721
|
+
aliases: string[];
|
|
722
|
+
ticker: string;
|
|
723
|
+
xHandle: string;
|
|
724
|
+
newsroomUrl: string;
|
|
725
|
+
teamPage: string;
|
|
726
|
+
/** `daily`, `weekly` or `off`, as you gave it; empty when its rank decides. */
|
|
727
|
+
tier: string;
|
|
728
|
+
/** Its place among the monitor's companies, from 1. */
|
|
729
|
+
rank: number;
|
|
730
|
+
raw: Json;
|
|
731
|
+
};
|
|
732
|
+
/** One page of `monitors.companies`, in rank order. */
|
|
733
|
+
type CompanyList = {
|
|
734
|
+
/** All the companies the monitor follows. */
|
|
735
|
+
total: number;
|
|
736
|
+
/** How many of them are marked priority. */
|
|
737
|
+
priorityCount: number;
|
|
738
|
+
offset: number;
|
|
739
|
+
limit: number;
|
|
740
|
+
/** Pass it as `offset` for the next page; `null` on the last page. */
|
|
741
|
+
nextOffset: number | null;
|
|
742
|
+
companies: CompanyListRow[];
|
|
743
|
+
raw: Json;
|
|
744
|
+
};
|
|
745
|
+
/** Options for `monitors.companies`. */
|
|
746
|
+
type MonitorCompaniesOptions = {
|
|
747
|
+
/** How many companies to skip, from the top (server default 0). */
|
|
748
|
+
offset?: number;
|
|
749
|
+
/** How many companies to return (server default 100, maximum 1,000). */
|
|
750
|
+
limit?: number;
|
|
751
|
+
signal?: AbortSignal;
|
|
752
|
+
};
|
|
684
753
|
/** The `telem.monitors` namespace. */
|
|
685
754
|
type MonitorsResource = {
|
|
686
755
|
/** Create a monitor. It has the agent unless `agent` is `false`, and with the agent
|
|
687
756
|
* `ttl` is required: a create without it throws a `TelemError` (`invalid_request`)
|
|
688
757
|
* before anything is sent. */
|
|
689
758
|
create(query: string, options: MonitorCreateOptions): Promise<Monitor>;
|
|
759
|
+
/** Create many monitors, ten per call, one call after another. One result per monitor,
|
|
760
|
+
* in the order given; a monitor that fails does not stop the others. Each call retries
|
|
761
|
+
* as `create` does, and after a 502 or 504 too, then only the monitors answered with a 429 (or a 409
|
|
762
|
+
* `idempotency_in_progress`) are sent again, with their keys, for up to about 120 s per
|
|
763
|
+
* call. A bad monitor, an unknown option, a monitor that is not JSON or a key given
|
|
764
|
+
* twice throws a `TelemError` (`invalid_request`) naming the index, before anything is
|
|
765
|
+
* sent. Once a call was sent, any failure (a call refused whole, an abort as `aborted`)
|
|
766
|
+
* throws with `results` (each monitor's last answer so far) and `idempotencyKeys` (every
|
|
767
|
+
* monitor's key) on the error, and its message says the monitors may exist. */
|
|
768
|
+
createMany(items: MonitorCreateManyItem[], options?: {
|
|
769
|
+
signal?: AbortSignal;
|
|
770
|
+
}): Promise<MonitorBatchResult[]>;
|
|
690
771
|
list(options?: MonitorListOptions): Promise<Monitor[]>;
|
|
691
772
|
listPage(options?: MonitorListOptions): Promise<MonitorPage>;
|
|
692
773
|
get(monitorId: string, options?: {
|
|
@@ -736,6 +817,10 @@ type MonitorsResource = {
|
|
|
736
817
|
dataMap(monitorId: string, options?: {
|
|
737
818
|
signal?: AbortSignal;
|
|
738
819
|
}): Promise<DataMap>;
|
|
820
|
+
/** One page of the companies a monitor created with `inputs` follows, in rank order. A
|
|
821
|
+
* monitor created without `inputs` answers 409 (`not_an_engine_monitor`), and one created
|
|
822
|
+
* with `agent: false` answers 404. */
|
|
823
|
+
companies(monitorId: string, options?: MonitorCompaniesOptions): Promise<CompanyList>;
|
|
739
824
|
};
|
|
740
825
|
|
|
741
826
|
/**
|
|
@@ -754,7 +839,12 @@ type TelemClientErrorCode =
|
|
|
754
839
|
/** The request never produced a response (DNS, refused, reset, TLS). */
|
|
755
840
|
| "connection_error"
|
|
756
841
|
/** The request was still outstanding when the timeout fired. */
|
|
757
|
-
| "timeout"
|
|
842
|
+
| "timeout"
|
|
843
|
+
/** A 2xx body carried a value the client cannot use safely, such as a change-stream
|
|
844
|
+
* position (`seq`, `watermark`, `next_cursor`) that is not a whole number. */
|
|
845
|
+
| "invalid_response"
|
|
846
|
+
/** `monitors.createMany` was aborted after it sent a call: `cause` is the reason. */
|
|
847
|
+
| "aborted";
|
|
758
848
|
type TelemErrorOptions = {
|
|
759
849
|
/** HTTP status that produced this error; absent for transport failures. */
|
|
760
850
|
status?: number;
|
|
@@ -764,11 +854,20 @@ type TelemErrorOptions = {
|
|
|
764
854
|
/** Parsed response body (or raw text when it would not parse). */
|
|
765
855
|
details?: unknown;
|
|
766
856
|
cause?: unknown;
|
|
857
|
+
/** The response's `Retry-After`, in seconds, when it sent one as a number. */
|
|
858
|
+
retryAfter?: number;
|
|
767
859
|
};
|
|
768
860
|
declare class TelemError extends Error {
|
|
769
861
|
status?: number;
|
|
770
862
|
code?: TelemClientErrorCode | (string & {});
|
|
771
863
|
details?: unknown;
|
|
864
|
+
/** The response's `Retry-After`, in seconds, when it sent one as a number. */
|
|
865
|
+
retryAfter?: number;
|
|
866
|
+
/** From `monitors.createMany`: each monitor's last answer before it failed, in order.
|
|
867
|
+
* Not enumerable, so serialising the error does not write a `webhookSecret`. */
|
|
868
|
+
results?: MonitorBatchResult[];
|
|
869
|
+
/** From `monitors.createMany`: every monitor's key, in order. Not enumerable. */
|
|
870
|
+
idempotencyKeys?: string[];
|
|
772
871
|
constructor(message: string, options?: TelemErrorOptions);
|
|
773
872
|
}
|
|
774
873
|
/** The request never produced a response in time. Always `code: "timeout"`. */
|
|
@@ -778,7 +877,9 @@ declare class TimeoutError extends TelemError {
|
|
|
778
877
|
|
|
779
878
|
/**
|
|
780
879
|
* Check a monitor webhook: the `Telem-Signature` header against the raw body.
|
|
781
|
-
* True when
|
|
880
|
+
* True when any `v1` signature is correct and not older than `toleranceSeconds`.
|
|
881
|
+
* A header can carry several: during a secret's rotation, one for each secret.
|
|
882
|
+
* A header with no `t`, or more than one, is false.
|
|
782
883
|
*/
|
|
783
884
|
declare function verifyWebhook(body: string | Uint8Array, header: string, secret: string, toleranceSeconds?: number): Promise<boolean>;
|
|
784
885
|
|
|
@@ -883,7 +984,7 @@ declare class Telem {
|
|
|
883
984
|
* `agent`, `changes` and `iterateChanges`, the read across monitors `changesAcross` and
|
|
884
985
|
* `iterateChangesAcross`, `feedback`, what a monitor created with
|
|
885
986
|
* `inputs` collects (`onboarding`, `applyOnboarding`, `expansions`, `confirmExpansion`,
|
|
886
|
-
* `revertExpansion`, `dataMap`), and the deprecated `poll`. */
|
|
987
|
+
* `revertExpansion`, `dataMap`, `companies`), and the deprecated `poll`. */
|
|
887
988
|
readonly monitors: MonitorsResource;
|
|
888
989
|
/**
|
|
889
990
|
* @param options - An API key string, or an options object. Anything left unset
|
|
@@ -916,4 +1017,4 @@ declare class Telem {
|
|
|
916
1017
|
providers(): Promise<ProviderInfo[]>;
|
|
917
1018
|
}
|
|
918
1019
|
|
|
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 };
|
|
1020
|
+
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 MonitorBatchResult, type MonitorChangesAcrossOptions, type MonitorChangesAcrossScope, type MonitorChangesOptions, type MonitorCompaniesOptions, type MonitorCreateManyItem, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ 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;
|
|
67
69
|
vertical?: string;
|
|
68
70
|
/** Only results published on or after this date or date-time: an ISO 8601 string
|
|
@@ -141,6 +143,10 @@ type SearchResult = {
|
|
|
141
143
|
source: Json | null;
|
|
142
144
|
enrichments: Json | null;
|
|
143
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;
|
|
144
150
|
provider: string;
|
|
145
151
|
raw: Json;
|
|
146
152
|
};
|
|
@@ -317,6 +323,30 @@ type MonitorCreateOptions = MonitorCreateCommonOptions & ({
|
|
|
317
323
|
});
|
|
318
324
|
/** The `preset` of `monitors.create`. */
|
|
319
325
|
type MonitorPreset = "article" | "person" | "company" | "listing";
|
|
326
|
+
/** One monitor of `monitors.createMany`: its `query` and the options of `create`.
|
|
327
|
+
* `idempotencyKey` is this monitor's own key; the call takes the `signal`. */
|
|
328
|
+
type MonitorCreateManyItem = {
|
|
329
|
+
query: string;
|
|
330
|
+
} & WithoutSignal<MonitorCreateOptions>;
|
|
331
|
+
/** `Omit` for each member of a union, so the `agent`/`ttl` pairing holds. */
|
|
332
|
+
type WithoutSignal<T> = T extends unknown ? Omit<T, "signal"> : never;
|
|
333
|
+
/** One monitor's answer in `monitors.createMany`. */
|
|
334
|
+
type MonitorBatchResult = {
|
|
335
|
+
/** The monitor's position in the array you passed. */
|
|
336
|
+
index: number;
|
|
337
|
+
/** `201`: made. `200` with `replayed`: made before, under the same key. Any other
|
|
338
|
+
* status is this monitor's own error. */
|
|
339
|
+
status: number;
|
|
340
|
+
monitor: Monitor | null;
|
|
341
|
+
replayed: boolean;
|
|
342
|
+
/** `{ code, message }`, and `param` when a field is at fault. */
|
|
343
|
+
error: Json | null;
|
|
344
|
+
/** With a `429`: the seconds to wait before you send this monitor again. */
|
|
345
|
+
retryAfter: number | null;
|
|
346
|
+
/** The key this monitor was sent with: send it again with the same key. */
|
|
347
|
+
idempotencyKey: string;
|
|
348
|
+
raw: Json;
|
|
349
|
+
};
|
|
320
350
|
/** Options for `monitors.update`. Send at least one field. */
|
|
321
351
|
type MonitorUpdateOptions = {
|
|
322
352
|
/** `"paused"` or `"active"`. */
|
|
@@ -681,12 +711,63 @@ type DataMap = {
|
|
|
681
711
|
note: string | null;
|
|
682
712
|
raw: Json;
|
|
683
713
|
};
|
|
714
|
+
/** One company of `monitors.companies`. */
|
|
715
|
+
type CompanyListRow = {
|
|
716
|
+
companyId: string;
|
|
717
|
+
name: string;
|
|
718
|
+
domain: string;
|
|
719
|
+
/** Whether the company is marked priority: it is checked on every routine run. */
|
|
720
|
+
priority: boolean;
|
|
721
|
+
aliases: string[];
|
|
722
|
+
ticker: string;
|
|
723
|
+
xHandle: string;
|
|
724
|
+
newsroomUrl: string;
|
|
725
|
+
teamPage: string;
|
|
726
|
+
/** `daily`, `weekly` or `off`, as you gave it; empty when its rank decides. */
|
|
727
|
+
tier: string;
|
|
728
|
+
/** Its place among the monitor's companies, from 1. */
|
|
729
|
+
rank: number;
|
|
730
|
+
raw: Json;
|
|
731
|
+
};
|
|
732
|
+
/** One page of `monitors.companies`, in rank order. */
|
|
733
|
+
type CompanyList = {
|
|
734
|
+
/** All the companies the monitor follows. */
|
|
735
|
+
total: number;
|
|
736
|
+
/** How many of them are marked priority. */
|
|
737
|
+
priorityCount: number;
|
|
738
|
+
offset: number;
|
|
739
|
+
limit: number;
|
|
740
|
+
/** Pass it as `offset` for the next page; `null` on the last page. */
|
|
741
|
+
nextOffset: number | null;
|
|
742
|
+
companies: CompanyListRow[];
|
|
743
|
+
raw: Json;
|
|
744
|
+
};
|
|
745
|
+
/** Options for `monitors.companies`. */
|
|
746
|
+
type MonitorCompaniesOptions = {
|
|
747
|
+
/** How many companies to skip, from the top (server default 0). */
|
|
748
|
+
offset?: number;
|
|
749
|
+
/** How many companies to return (server default 100, maximum 1,000). */
|
|
750
|
+
limit?: number;
|
|
751
|
+
signal?: AbortSignal;
|
|
752
|
+
};
|
|
684
753
|
/** The `telem.monitors` namespace. */
|
|
685
754
|
type MonitorsResource = {
|
|
686
755
|
/** Create a monitor. It has the agent unless `agent` is `false`, and with the agent
|
|
687
756
|
* `ttl` is required: a create without it throws a `TelemError` (`invalid_request`)
|
|
688
757
|
* before anything is sent. */
|
|
689
758
|
create(query: string, options: MonitorCreateOptions): Promise<Monitor>;
|
|
759
|
+
/** Create many monitors, ten per call, one call after another. One result per monitor,
|
|
760
|
+
* in the order given; a monitor that fails does not stop the others. Each call retries
|
|
761
|
+
* as `create` does, and after a 502 or 504 too, then only the monitors answered with a 429 (or a 409
|
|
762
|
+
* `idempotency_in_progress`) are sent again, with their keys, for up to about 120 s per
|
|
763
|
+
* call. A bad monitor, an unknown option, a monitor that is not JSON or a key given
|
|
764
|
+
* twice throws a `TelemError` (`invalid_request`) naming the index, before anything is
|
|
765
|
+
* sent. Once a call was sent, any failure (a call refused whole, an abort as `aborted`)
|
|
766
|
+
* throws with `results` (each monitor's last answer so far) and `idempotencyKeys` (every
|
|
767
|
+
* monitor's key) on the error, and its message says the monitors may exist. */
|
|
768
|
+
createMany(items: MonitorCreateManyItem[], options?: {
|
|
769
|
+
signal?: AbortSignal;
|
|
770
|
+
}): Promise<MonitorBatchResult[]>;
|
|
690
771
|
list(options?: MonitorListOptions): Promise<Monitor[]>;
|
|
691
772
|
listPage(options?: MonitorListOptions): Promise<MonitorPage>;
|
|
692
773
|
get(monitorId: string, options?: {
|
|
@@ -736,6 +817,10 @@ type MonitorsResource = {
|
|
|
736
817
|
dataMap(monitorId: string, options?: {
|
|
737
818
|
signal?: AbortSignal;
|
|
738
819
|
}): Promise<DataMap>;
|
|
820
|
+
/** One page of the companies a monitor created with `inputs` follows, in rank order. A
|
|
821
|
+
* monitor created without `inputs` answers 409 (`not_an_engine_monitor`), and one created
|
|
822
|
+
* with `agent: false` answers 404. */
|
|
823
|
+
companies(monitorId: string, options?: MonitorCompaniesOptions): Promise<CompanyList>;
|
|
739
824
|
};
|
|
740
825
|
|
|
741
826
|
/**
|
|
@@ -754,7 +839,12 @@ type TelemClientErrorCode =
|
|
|
754
839
|
/** The request never produced a response (DNS, refused, reset, TLS). */
|
|
755
840
|
| "connection_error"
|
|
756
841
|
/** The request was still outstanding when the timeout fired. */
|
|
757
|
-
| "timeout"
|
|
842
|
+
| "timeout"
|
|
843
|
+
/** A 2xx body carried a value the client cannot use safely, such as a change-stream
|
|
844
|
+
* position (`seq`, `watermark`, `next_cursor`) that is not a whole number. */
|
|
845
|
+
| "invalid_response"
|
|
846
|
+
/** `monitors.createMany` was aborted after it sent a call: `cause` is the reason. */
|
|
847
|
+
| "aborted";
|
|
758
848
|
type TelemErrorOptions = {
|
|
759
849
|
/** HTTP status that produced this error; absent for transport failures. */
|
|
760
850
|
status?: number;
|
|
@@ -764,11 +854,20 @@ type TelemErrorOptions = {
|
|
|
764
854
|
/** Parsed response body (or raw text when it would not parse). */
|
|
765
855
|
details?: unknown;
|
|
766
856
|
cause?: unknown;
|
|
857
|
+
/** The response's `Retry-After`, in seconds, when it sent one as a number. */
|
|
858
|
+
retryAfter?: number;
|
|
767
859
|
};
|
|
768
860
|
declare class TelemError extends Error {
|
|
769
861
|
status?: number;
|
|
770
862
|
code?: TelemClientErrorCode | (string & {});
|
|
771
863
|
details?: unknown;
|
|
864
|
+
/** The response's `Retry-After`, in seconds, when it sent one as a number. */
|
|
865
|
+
retryAfter?: number;
|
|
866
|
+
/** From `monitors.createMany`: each monitor's last answer before it failed, in order.
|
|
867
|
+
* Not enumerable, so serialising the error does not write a `webhookSecret`. */
|
|
868
|
+
results?: MonitorBatchResult[];
|
|
869
|
+
/** From `monitors.createMany`: every monitor's key, in order. Not enumerable. */
|
|
870
|
+
idempotencyKeys?: string[];
|
|
772
871
|
constructor(message: string, options?: TelemErrorOptions);
|
|
773
872
|
}
|
|
774
873
|
/** The request never produced a response in time. Always `code: "timeout"`. */
|
|
@@ -778,7 +877,9 @@ declare class TimeoutError extends TelemError {
|
|
|
778
877
|
|
|
779
878
|
/**
|
|
780
879
|
* Check a monitor webhook: the `Telem-Signature` header against the raw body.
|
|
781
|
-
* True when
|
|
880
|
+
* True when any `v1` signature is correct and not older than `toleranceSeconds`.
|
|
881
|
+
* A header can carry several: during a secret's rotation, one for each secret.
|
|
882
|
+
* A header with no `t`, or more than one, is false.
|
|
782
883
|
*/
|
|
783
884
|
declare function verifyWebhook(body: string | Uint8Array, header: string, secret: string, toleranceSeconds?: number): Promise<boolean>;
|
|
784
885
|
|
|
@@ -883,7 +984,7 @@ declare class Telem {
|
|
|
883
984
|
* `agent`, `changes` and `iterateChanges`, the read across monitors `changesAcross` and
|
|
884
985
|
* `iterateChangesAcross`, `feedback`, what a monitor created with
|
|
885
986
|
* `inputs` collects (`onboarding`, `applyOnboarding`, `expansions`, `confirmExpansion`,
|
|
886
|
-
* `revertExpansion`, `dataMap`), and the deprecated `poll`. */
|
|
987
|
+
* `revertExpansion`, `dataMap`, `companies`), and the deprecated `poll`. */
|
|
887
988
|
readonly monitors: MonitorsResource;
|
|
888
989
|
/**
|
|
889
990
|
* @param options - An API key string, or an options object. Anything left unset
|
|
@@ -916,4 +1017,4 @@ declare class Telem {
|
|
|
916
1017
|
providers(): Promise<ProviderInfo[]>;
|
|
917
1018
|
}
|
|
918
1019
|
|
|
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 };
|
|
1020
|
+
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 MonitorBatchResult, type MonitorChangesAcrossOptions, type MonitorChangesAcrossScope, type MonitorChangesOptions, type MonitorCompaniesOptions, type MonitorCreateManyItem, 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 };
|