@evidinvest/aether-sdk 0.3.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 +61 -0
- package/dist/index.d.ts +154 -0
- package/dist/index.js +74 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @evidinvest/aether-sdk
|
|
2
|
+
|
|
3
|
+
Tiny typed HTTP client for the [Aether](https://aether.evidinvest.com) REST
|
|
4
|
+
API — SEC filings, earnings-call transcripts, and EU financial regulation,
|
|
5
|
+
every hit a ready-to-cite payload (exact source text + accession-numbered
|
|
6
|
+
citation + sec.gov URL).
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @evidinvest/aether-sdk # or npm i / yarn add
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Use
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { AetherClient } from "@evidinvest/aether-sdk";
|
|
18
|
+
|
|
19
|
+
const aether = new AetherClient({ apiKey: process.env.AETHER_API_KEY });
|
|
20
|
+
|
|
21
|
+
// SEC filings (10-K/10-Q/8-K, prospectuses) + SE/JP/KR registries
|
|
22
|
+
const filings = await aether.financialSearch({
|
|
23
|
+
query: "Apple revenue concentration risk",
|
|
24
|
+
limit: 5,
|
|
25
|
+
});
|
|
26
|
+
for (const c of filings.results) {
|
|
27
|
+
console.log(c.citation, "→", c.metadata?.source_url);
|
|
28
|
+
console.log(c.text.slice(0, 200));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Earnings calls — speaker-attributed, point-in-time
|
|
32
|
+
const calls = await aether.transcriptSearch({
|
|
33
|
+
query: "Blackwell demand",
|
|
34
|
+
ticker: "NVDA",
|
|
35
|
+
order: "earliest", // find the FIRST mention
|
|
36
|
+
limit: 5,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// EU regulation — MiFID II, MiCA, DORA, AML package (article-level)
|
|
40
|
+
const reg = await aether.regulationSearch({
|
|
41
|
+
query: "stablecoin issuer own funds requirements",
|
|
42
|
+
limit: 5,
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Get an API key at https://aether.evidinvest.com/developer/keys (anonymous
|
|
47
|
+
calls work but are rate-limited). Full request/response reference:
|
|
48
|
+
[`docs/search.md`](../../docs/search.md).
|
|
49
|
+
|
|
50
|
+
## Why this exists
|
|
51
|
+
|
|
52
|
+
`@evidinvest/aether-mcp` already wraps the same API for MCP clients
|
|
53
|
+
(ChatGPT, Claude, Cursor, Cline, …). This SDK is for everything else —
|
|
54
|
+
plain Node scripts, Fastify/Next.js routes, workers, edge functions.
|
|
55
|
+
|
|
56
|
+
It's intentionally minimal: one bearer-token-aware fetch wrapper, typed
|
|
57
|
+
request/response shapes, no SDK-side retry/cache. Bring your own.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
Apache-2.0 — see [LICENSE](../../LICENSE).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @evidinvest/aether-sdk
|
|
3
|
+
*
|
|
4
|
+
* Thin typed HTTP client for the Aether REST API. The MCP wrapper in
|
|
5
|
+
* `@evidinvest/aether-mcp` uses the same endpoints via stdio; use this
|
|
6
|
+
* package directly when you want to call Aether from a plain Node app, a
|
|
7
|
+
* worker, a Next.js route handler, etc.
|
|
8
|
+
*
|
|
9
|
+
* Endpoints (same tools the MCP server exposes):
|
|
10
|
+
* POST /v1/tools/financial_search — SEC filings (10-K/10-Q/8-K, S-1…) + non-US registries
|
|
11
|
+
* POST /v1/tools/transcript_search — earnings-call transcripts + press exhibits
|
|
12
|
+
* POST /v1/tools/regulation_search — EU financial regulation (MiFID II, MiCA, DORA, AML)
|
|
13
|
+
*
|
|
14
|
+
* Auth is a bearer token — either a long-lived API key from
|
|
15
|
+
* https://aether.evidinvest.com/developer/keys or an OAuth access token
|
|
16
|
+
* from the device-code / authorization-code flow. The SDK doesn't manage
|
|
17
|
+
* token lifecycle; pass a fresh token in. Anonymous calls work but hit a
|
|
18
|
+
* low rate limit.
|
|
19
|
+
*/
|
|
20
|
+
export interface AetherClientOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Bearer token. API key (`ak_…`) or OAuth access token. Required for
|
|
23
|
+
* authenticated quota; anonymous calls hit a low rate limit.
|
|
24
|
+
*/
|
|
25
|
+
apiKey?: string;
|
|
26
|
+
/** Override the API base. Defaults to https://api.aether.evidinvest.com. */
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
/** Override fetch (e.g. node-fetch in older Node, MSW in tests). */
|
|
29
|
+
fetch?: typeof fetch;
|
|
30
|
+
}
|
|
31
|
+
export interface FinancialSearchInput {
|
|
32
|
+
/** Natural-language search query. */
|
|
33
|
+
query: string;
|
|
34
|
+
/**
|
|
35
|
+
* public_equity = single-company filing search; supply_chain =
|
|
36
|
+
* cross-company supplier/customer relationship evidence; auto (default) =
|
|
37
|
+
* detect from the query.
|
|
38
|
+
*/
|
|
39
|
+
domain?: "public_equity" | "supply_chain" | "auto";
|
|
40
|
+
/** Max results (server caps at 50, default 10). */
|
|
41
|
+
limit?: number;
|
|
42
|
+
/** Optional metadata fields to project into each hit. */
|
|
43
|
+
fields?: string[];
|
|
44
|
+
/** Retrieval profile; default is the production winner. */
|
|
45
|
+
profile?: "bm25" | "hybrid" | "hybrid_rerank" | "hybrid_rerank_tickerprior";
|
|
46
|
+
/**
|
|
47
|
+
* "section" (default) returns the full SEC section the match belongs to;
|
|
48
|
+
* "chunk" returns only the matching ~500-token window; "both" returns both.
|
|
49
|
+
*/
|
|
50
|
+
return_format?: "section" | "chunk" | "both";
|
|
51
|
+
/**
|
|
52
|
+
* Scope to non-US issuer jurisdictions (ISO-3166 alpha-2): ["SE"] Sweden /
|
|
53
|
+
* Bolagsverket, ["JP"] Japan / EDINET, ["KR"] Korea / DART. Omit to cover
|
|
54
|
+
* US SEC filings (the default).
|
|
55
|
+
*/
|
|
56
|
+
jurisdiction?: string[];
|
|
57
|
+
}
|
|
58
|
+
/** One ready-to-cite evidence payload. */
|
|
59
|
+
export interface AetherChunk {
|
|
60
|
+
id: string;
|
|
61
|
+
/** Exact section/chunk text from the primary source. */
|
|
62
|
+
text: string;
|
|
63
|
+
/** e.g. "sec/10-K/0000320193-25-000079". */
|
|
64
|
+
source: string;
|
|
65
|
+
/** e.g. "AAPL 10-K 2025-10-31 (Item 1A)". */
|
|
66
|
+
citation?: string;
|
|
67
|
+
/** Filing/call date, ISO YYYY-MM-DD. */
|
|
68
|
+
as_of_date?: string;
|
|
69
|
+
/** 0–1 retrieval confidence. */
|
|
70
|
+
confidence?: number;
|
|
71
|
+
/**
|
|
72
|
+
* cik, ticker, company_name, form_type, section, accession_number,
|
|
73
|
+
* source_url (sec.gov link), period_of_report, … (varies by tool).
|
|
74
|
+
*/
|
|
75
|
+
metadata?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
export interface FinancialSearchOutput {
|
|
78
|
+
query: string;
|
|
79
|
+
domain: "public_equity" | "supply_chain" | "auto";
|
|
80
|
+
results: AetherChunk[];
|
|
81
|
+
total: number;
|
|
82
|
+
source: string;
|
|
83
|
+
latency_ms: number;
|
|
84
|
+
}
|
|
85
|
+
export interface TranscriptSearchInput {
|
|
86
|
+
query: string;
|
|
87
|
+
/** Uppercase symbol, e.g. "AAPL". */
|
|
88
|
+
ticker?: string;
|
|
89
|
+
/** e.g. 4 = last year of calls. */
|
|
90
|
+
lookback_quarters?: number;
|
|
91
|
+
/** "CEO" | "CFO" | "Analyst" | … */
|
|
92
|
+
speaker_role?: string;
|
|
93
|
+
limit?: number;
|
|
94
|
+
profile?: "bm25" | "hybrid";
|
|
95
|
+
/** Inclusive ISO date bounds on the call date (point-in-time retrieval). */
|
|
96
|
+
date_from?: string;
|
|
97
|
+
date_to?: string;
|
|
98
|
+
/** "earliest"/"latest" sort chronologically; "relevance" (default) by score. */
|
|
99
|
+
order?: "relevance" | "earliest" | "latest";
|
|
100
|
+
/** Provenance: "press_release" | "furnished_transcript" | "asr_call". */
|
|
101
|
+
source_type?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface TranscriptSearchOutput {
|
|
104
|
+
query: string;
|
|
105
|
+
results: AetherChunk[];
|
|
106
|
+
total: number;
|
|
107
|
+
source: string;
|
|
108
|
+
latency_ms: number;
|
|
109
|
+
}
|
|
110
|
+
export interface RegulationSearchInput {
|
|
111
|
+
query: string;
|
|
112
|
+
/** Filter to act(s) by CELEX number, e.g. "32024R1624". */
|
|
113
|
+
celex?: string | string[];
|
|
114
|
+
/** "regulation" | "directive" | "rts" | "its" | "decision". */
|
|
115
|
+
doc_type?: string;
|
|
116
|
+
/** Single article label (Formex labels can be "12a"). */
|
|
117
|
+
article?: string;
|
|
118
|
+
/** "paragraph" | "article_intro" | "recital" | "table" | "annex". */
|
|
119
|
+
chunk_type?: string;
|
|
120
|
+
/** AML topic tag(s): "cdd" | "edd" | "pep" | "str_reporting" | … */
|
|
121
|
+
aml_topics?: string | string[];
|
|
122
|
+
/** Prefer EUR-Lex consolidated text over the original OJ text. */
|
|
123
|
+
prefer_consolidated?: boolean;
|
|
124
|
+
limit?: number;
|
|
125
|
+
profile?: "bm25" | "hybrid";
|
|
126
|
+
}
|
|
127
|
+
export interface RegulationSearchOutput {
|
|
128
|
+
query: string;
|
|
129
|
+
results: AetherChunk[];
|
|
130
|
+
total: number;
|
|
131
|
+
source: string;
|
|
132
|
+
latency_ms: number;
|
|
133
|
+
}
|
|
134
|
+
export declare class AetherError extends Error {
|
|
135
|
+
readonly status: number;
|
|
136
|
+
readonly body: string;
|
|
137
|
+
constructor(status: number, body: string, message?: string);
|
|
138
|
+
}
|
|
139
|
+
export declare class AetherClient {
|
|
140
|
+
private readonly baseUrl;
|
|
141
|
+
private readonly apiKey;
|
|
142
|
+
private readonly fetchImpl;
|
|
143
|
+
constructor(opts?: AetherClientOptions);
|
|
144
|
+
/** Search SEC filings (+ SE/JP/KR registries). */
|
|
145
|
+
financialSearch(input: FinancialSearchInput): Promise<FinancialSearchOutput>;
|
|
146
|
+
/** Search earnings-call transcripts and press exhibits. */
|
|
147
|
+
transcriptSearch(input: TranscriptSearchInput): Promise<TranscriptSearchOutput>;
|
|
148
|
+
/** Search EU financial regulation (MiFID II, MiCA, DORA, AML package). */
|
|
149
|
+
regulationSearch(input: RegulationSearchInput): Promise<RegulationSearchOutput>;
|
|
150
|
+
/** @deprecated Alias of {@link financialSearch}; kept for 0.x callers. */
|
|
151
|
+
search(input: FinancialSearchInput): Promise<FinancialSearchOutput>;
|
|
152
|
+
private request;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @evidinvest/aether-sdk
|
|
3
|
+
*
|
|
4
|
+
* Thin typed HTTP client for the Aether REST API. The MCP wrapper in
|
|
5
|
+
* `@evidinvest/aether-mcp` uses the same endpoints via stdio; use this
|
|
6
|
+
* package directly when you want to call Aether from a plain Node app, a
|
|
7
|
+
* worker, a Next.js route handler, etc.
|
|
8
|
+
*
|
|
9
|
+
* Endpoints (same tools the MCP server exposes):
|
|
10
|
+
* POST /v1/tools/financial_search — SEC filings (10-K/10-Q/8-K, S-1…) + non-US registries
|
|
11
|
+
* POST /v1/tools/transcript_search — earnings-call transcripts + press exhibits
|
|
12
|
+
* POST /v1/tools/regulation_search — EU financial regulation (MiFID II, MiCA, DORA, AML)
|
|
13
|
+
*
|
|
14
|
+
* Auth is a bearer token — either a long-lived API key from
|
|
15
|
+
* https://aether.evidinvest.com/developer/keys or an OAuth access token
|
|
16
|
+
* from the device-code / authorization-code flow. The SDK doesn't manage
|
|
17
|
+
* token lifecycle; pass a fresh token in. Anonymous calls work but hit a
|
|
18
|
+
* low rate limit.
|
|
19
|
+
*/
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
export class AetherError extends Error {
|
|
22
|
+
status;
|
|
23
|
+
body;
|
|
24
|
+
constructor(status, body, message) {
|
|
25
|
+
super(message ?? `Aether API error ${status}: ${body.slice(0, 200)}`);
|
|
26
|
+
this.status = status;
|
|
27
|
+
this.body = body;
|
|
28
|
+
this.name = "AetherError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class AetherClient {
|
|
32
|
+
baseUrl;
|
|
33
|
+
apiKey;
|
|
34
|
+
fetchImpl;
|
|
35
|
+
constructor(opts = {}) {
|
|
36
|
+
this.baseUrl = (opts.baseUrl ?? "https://api.aether.evidinvest.com").replace(/\/+$/, "");
|
|
37
|
+
this.apiKey = opts.apiKey;
|
|
38
|
+
this.fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
39
|
+
if (!this.fetchImpl) {
|
|
40
|
+
throw new Error("Global fetch not found — pass `fetch` via AetherClientOptions or run on Node >= 20.");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Search SEC filings (+ SE/JP/KR registries). */
|
|
44
|
+
async financialSearch(input) {
|
|
45
|
+
return this.request("/v1/tools/financial_search", "POST", input);
|
|
46
|
+
}
|
|
47
|
+
/** Search earnings-call transcripts and press exhibits. */
|
|
48
|
+
async transcriptSearch(input) {
|
|
49
|
+
return this.request("/v1/tools/transcript_search", "POST", input);
|
|
50
|
+
}
|
|
51
|
+
/** Search EU financial regulation (MiFID II, MiCA, DORA, AML package). */
|
|
52
|
+
async regulationSearch(input) {
|
|
53
|
+
return this.request("/v1/tools/regulation_search", "POST", input);
|
|
54
|
+
}
|
|
55
|
+
/** @deprecated Alias of {@link financialSearch}; kept for 0.x callers. */
|
|
56
|
+
async search(input) {
|
|
57
|
+
return this.financialSearch(input);
|
|
58
|
+
}
|
|
59
|
+
async request(path, method, body) {
|
|
60
|
+
const headers = { "content-type": "application/json" };
|
|
61
|
+
if (this.apiKey)
|
|
62
|
+
headers.authorization = `Bearer ${this.apiKey}`;
|
|
63
|
+
const res = await this.fetchImpl(`${this.baseUrl}${path}`, {
|
|
64
|
+
method,
|
|
65
|
+
headers,
|
|
66
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
67
|
+
});
|
|
68
|
+
if (!res.ok) {
|
|
69
|
+
throw new AetherError(res.status, await res.text());
|
|
70
|
+
}
|
|
71
|
+
return (await res.json());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@evidinvest/aether-sdk",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Tiny TypeScript HTTP SDK for the Aether REST API — financial_search, marketplace, and account endpoints. Pairs with an API key or OAuth bearer token from https://aether.evidinvest.com.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"aether",
|
|
7
|
+
"sec-filings",
|
|
8
|
+
"earnings-transcripts",
|
|
9
|
+
"financial-search",
|
|
10
|
+
"sdk",
|
|
11
|
+
"client"
|
|
12
|
+
],
|
|
13
|
+
"author": "EvidInvest / EBD-Sweden",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"homepage": "https://github.com/EvidInvest/aether-developer/tree/main/clients/typescript",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/EvidInvest/aether-developer.git",
|
|
19
|
+
"directory": "clients/typescript"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/EvidInvest/aether-developer/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist/**/*.js",
|
|
35
|
+
"dist/**/*.d.ts",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.json",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
45
|
+
"prepublishOnly": "npm run build"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^22.0.0",
|
|
49
|
+
"typescript": "^5.6.0"
|
|
50
|
+
}
|
|
51
|
+
}
|