@metamask-previews/ai-controllers 1.0.0-preview-8bfa290fb → 2.0.0-preview-0a30e47
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/CHANGELOG.md +11 -1
- package/dist/{AiDigestController-method-action-types.d.mts → AiDigestController-method-action-types.d.ts} +2 -2
- package/dist/AiDigestController-method-action-types.d.ts.map +1 -0
- package/dist/{AiDigestController-method-action-types.mjs → AiDigestController-method-action-types.js} +1 -1
- package/dist/AiDigestController-method-action-types.js.map +1 -0
- package/dist/{AiDigestController.d.cts → AiDigestController.d.ts} +7 -7
- package/dist/AiDigestController.d.ts.map +1 -0
- package/dist/{AiDigestController.mjs → AiDigestController.js} +8 -21
- package/dist/AiDigestController.js.map +1 -0
- package/dist/{AiDigestService.d.cts → AiDigestService.d.ts} +2 -2
- package/dist/AiDigestService.d.ts.map +1 -0
- package/dist/{AiDigestService.mjs → AiDigestService.js} +8 -21
- package/dist/AiDigestService.js.map +1 -0
- package/dist/ai-digest-constants.d.ts +8 -0
- package/dist/ai-digest-constants.d.ts.map +1 -0
- package/dist/{ai-digest-constants.mjs → ai-digest-constants.js} +1 -1
- package/dist/ai-digest-constants.js.map +1 -0
- package/dist/{ai-digest-types.d.cts → ai-digest-types.d.ts} +1 -1
- package/dist/ai-digest-types.d.ts.map +1 -0
- package/dist/{ai-digest-types.mjs → ai-digest-types.js} +1 -1
- package/dist/ai-digest-types.js.map +1 -0
- package/dist/{index.d.cts → index.d.ts} +8 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -18
- package/dist/AiDigestController-method-action-types.cjs +0 -7
- package/dist/AiDigestController-method-action-types.cjs.map +0 -1
- package/dist/AiDigestController-method-action-types.d.cts +0 -49
- package/dist/AiDigestController-method-action-types.d.cts.map +0 -1
- package/dist/AiDigestController-method-action-types.d.mts.map +0 -1
- package/dist/AiDigestController-method-action-types.mjs.map +0 -1
- package/dist/AiDigestController.cjs +0 -85
- package/dist/AiDigestController.cjs.map +0 -1
- package/dist/AiDigestController.d.cts.map +0 -1
- package/dist/AiDigestController.d.mts +0 -51
- package/dist/AiDigestController.d.mts.map +0 -1
- package/dist/AiDigestController.mjs.map +0 -1
- package/dist/AiDigestService.cjs +0 -217
- package/dist/AiDigestService.cjs.map +0 -1
- package/dist/AiDigestService.d.cts.map +0 -1
- package/dist/AiDigestService.d.mts +0 -40
- package/dist/AiDigestService.d.mts.map +0 -1
- package/dist/AiDigestService.mjs.map +0 -1
- package/dist/ai-digest-constants.cjs +0 -11
- package/dist/ai-digest-constants.cjs.map +0 -1
- package/dist/ai-digest-constants.d.cts +0 -8
- package/dist/ai-digest-constants.d.cts.map +0 -1
- package/dist/ai-digest-constants.d.mts +0 -8
- package/dist/ai-digest-constants.d.mts.map +0 -1
- package/dist/ai-digest-constants.mjs.map +0 -1
- package/dist/ai-digest-types.cjs +0 -6
- package/dist/ai-digest-types.cjs.map +0 -1
- package/dist/ai-digest-types.d.cts.map +0 -1
- package/dist/ai-digest-types.d.mts +0 -195
- package/dist/ai-digest-types.d.mts.map +0 -1
- package/dist/ai-digest-types.mjs.map +0 -1
- package/dist/index.cjs +0 -12
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -8
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -4
- package/dist/index.mjs.map +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A news article referenced by a trend.
|
|
3
|
-
*/
|
|
4
|
-
export type Article = {
|
|
5
|
-
/** Article title */
|
|
6
|
-
title: string;
|
|
7
|
-
/** Full URL to the article */
|
|
8
|
-
url: string;
|
|
9
|
-
/** Source domain name (e.g. "coindesk.com") */
|
|
10
|
-
source: string;
|
|
11
|
-
/** ISO date string */
|
|
12
|
-
date: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A social media post referenced by a trend.
|
|
16
|
-
*/
|
|
17
|
-
export type Tweet = {
|
|
18
|
-
/** Summary of the tweet content */
|
|
19
|
-
contentSummary: string;
|
|
20
|
-
/** Full URL to the tweet */
|
|
21
|
-
url: string;
|
|
22
|
-
/** Author handle (e.g. "@saylordocs") */
|
|
23
|
-
author: string;
|
|
24
|
-
/** ISO date string */
|
|
25
|
-
date: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* A data source used to generate a report.
|
|
29
|
-
*/
|
|
30
|
-
export type Source = {
|
|
31
|
-
/** Source name (e.g. "CoinDesk") */
|
|
32
|
-
name: string;
|
|
33
|
-
/** Source URL */
|
|
34
|
-
url: string;
|
|
35
|
-
/** Source type */
|
|
36
|
-
type: 'news' | 'data' | 'social';
|
|
37
|
-
};
|
|
38
|
-
export type MarketInsightsArticle = Article;
|
|
39
|
-
export type MarketInsightsTweet = Tweet;
|
|
40
|
-
export type MarketInsightsSource = Source;
|
|
41
|
-
/**
|
|
42
|
-
* A key market trend identified in the insights report.
|
|
43
|
-
*/
|
|
44
|
-
export type MarketInsightsTrend = {
|
|
45
|
-
/** Trend title (e.g. "Institutions Buying the Dip") */
|
|
46
|
-
title: string;
|
|
47
|
-
/** Detailed description of the trend */
|
|
48
|
-
description: string;
|
|
49
|
-
/** Category of the trend */
|
|
50
|
-
category: 'geopolitical' | 'macro' | 'regulatory' | 'technical' | 'social' | 'other';
|
|
51
|
-
/** Impact direction */
|
|
52
|
-
impact: 'positive' | 'negative' | 'neutral';
|
|
53
|
-
/** Related news articles */
|
|
54
|
-
articles: Article[];
|
|
55
|
-
/** Related social media posts */
|
|
56
|
-
tweets: Tweet[];
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* AI-generated market insights report for a crypto asset.
|
|
60
|
-
* Returned by `GET /asset-summary?asset=<identifier>`.
|
|
61
|
-
*/
|
|
62
|
-
export type MarketInsightsReport = {
|
|
63
|
-
/** Unique identifier for this digest, sourced from the API response envelope. */
|
|
64
|
-
digestId: string;
|
|
65
|
-
/** API version */
|
|
66
|
-
version?: string;
|
|
67
|
-
/** Asset symbol (lowercase, e.g. "btc") */
|
|
68
|
-
asset: string;
|
|
69
|
-
/** ISO date string when the report was generated */
|
|
70
|
-
generatedAt: string;
|
|
71
|
-
/** Main headline */
|
|
72
|
-
headline: string;
|
|
73
|
-
/** Summary paragraph */
|
|
74
|
-
summary: string;
|
|
75
|
-
/** Key market trends */
|
|
76
|
-
trends: MarketInsightsTrend[];
|
|
77
|
-
/** Optional top-level social posts included by the API */
|
|
78
|
-
social?: Tweet[];
|
|
79
|
-
/** Data sources used to generate the report */
|
|
80
|
-
sources: Source[];
|
|
81
|
-
/** Provider metadata */
|
|
82
|
-
metadata?: AIResponseMetadata[];
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A crypto asset related to a market overview trend.
|
|
86
|
-
* Returned by the `/market-overview` API as a rich object.
|
|
87
|
-
*/
|
|
88
|
-
export type RelatedAsset = {
|
|
89
|
-
/**
|
|
90
|
-
* Human-readable asset name (e.g. "Bitcoin"). Optional — clients must fall
|
|
91
|
-
* back to `symbol` when absent.
|
|
92
|
-
*/
|
|
93
|
-
name?: string;
|
|
94
|
-
/** Ticker symbol (e.g. "BTC"). The only field guaranteed to be present. */
|
|
95
|
-
symbol: string;
|
|
96
|
-
/**
|
|
97
|
-
* CAIP-19 identifiers for this asset across chains. May be absent for
|
|
98
|
-
* purely synthetic / perps-only assets (e.g. ETHFI). The service
|
|
99
|
-
* normalises missing values to `[]`.
|
|
100
|
-
*/
|
|
101
|
-
caip19?: string[];
|
|
102
|
-
/**
|
|
103
|
-
* Canonical source asset identifier (e.g. "bitcoin"). Optional — may be
|
|
104
|
-
* absent when the API pipeline cannot enrich the asset record.
|
|
105
|
-
*/
|
|
106
|
-
sourceAssetId?: string;
|
|
107
|
-
/**
|
|
108
|
-
* Optional HyperLiquid market identifiers for this asset (e.g. `BTC`, `ETH`,
|
|
109
|
-
* `xyz:TSLA`). Covers both regular crypto tokens that trade on HyperLiquid
|
|
110
|
-
* and purely synthetic perps assets. Use this to resolve Perps icon URLs via
|
|
111
|
-
* `getAssetIconUrls` on clients when `caip19` is empty.
|
|
112
|
-
*/
|
|
113
|
-
hlPerpsMarket?: string[];
|
|
114
|
-
};
|
|
115
|
-
export type MarketOverviewTrend = {
|
|
116
|
-
title: string;
|
|
117
|
-
description: string;
|
|
118
|
-
category?: 'geopolitical' | 'macro' | 'regulatory' | 'technical' | 'social' | 'other';
|
|
119
|
-
impact?: 'positive' | 'negative' | 'neutral';
|
|
120
|
-
articles: Article[];
|
|
121
|
-
relatedAssets: RelatedAsset[];
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Provider metadata included in AI API responses.
|
|
125
|
-
*/
|
|
126
|
-
export type AIResponseMetadata = {
|
|
127
|
-
provider: string;
|
|
128
|
-
};
|
|
129
|
-
export type MarketOverview = {
|
|
130
|
-
version?: string;
|
|
131
|
-
generatedAt: string;
|
|
132
|
-
trends: MarketOverviewTrend[];
|
|
133
|
-
metadata?: AIResponseMetadata[];
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* A single market overview item. Shares the exact same schema as a
|
|
137
|
-
* {@link MarketOverviewTrend} — i.e. one entry of `MarketOverview.trends`.
|
|
138
|
-
*/
|
|
139
|
-
export type MarketOverviewItem = MarketOverviewTrend;
|
|
140
|
-
/**
|
|
141
|
-
* A market overview "front page": a single AI-selected item (mirroring the
|
|
142
|
-
* front page of a newspaper) plus its call-to-action copy, addressable by id.
|
|
143
|
-
*
|
|
144
|
-
* Returned by `GET /market-overview/front-page/:id` (and `.../latest`). Unlike
|
|
145
|
-
* `/market-overview`, which only ever returns the latest report, this lets
|
|
146
|
-
* clients fetch an older item that has since dropped out of the report.
|
|
147
|
-
*/
|
|
148
|
-
export type MarketOverviewFrontPage = {
|
|
149
|
-
/** Unique identifier of the front-page row (UUID). */
|
|
150
|
-
id: string;
|
|
151
|
-
/** The selected item — same schema as an individual market overview item. */
|
|
152
|
-
item: MarketOverviewItem;
|
|
153
|
-
/** Call-to-action title for the front-page item. */
|
|
154
|
-
ctaTitle: string;
|
|
155
|
-
/** Call-to-action description for the front-page item. */
|
|
156
|
-
ctaDescription: string;
|
|
157
|
-
/** ISO date string when the front-page row was created. */
|
|
158
|
-
createdAt: string;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* AiDigestController has no persisted cache. Digest freshness is owned by
|
|
162
|
-
* clients (e.g. React Query).
|
|
163
|
-
*/
|
|
164
|
-
export type AiDigestControllerState = Record<string, never>;
|
|
165
|
-
export type DigestService = {
|
|
166
|
-
/**
|
|
167
|
-
* Search for market insights by asset identifier.
|
|
168
|
-
*
|
|
169
|
-
* Accepts any identifier the API understands — CAIP-19 asset type
|
|
170
|
-
* (e.g. `eip155:1/slip44:60`), ticker symbol (e.g. `ETH`), asset name
|
|
171
|
-
* (e.g. `Bitcoin`), or HyperLiquid perps market id (e.g. `xyz:TSLA`).
|
|
172
|
-
*
|
|
173
|
-
* Calls `GET /asset-summary?asset=<assetIdentifier>`.
|
|
174
|
-
*
|
|
175
|
-
* @param assetIdentifier - The asset identifier.
|
|
176
|
-
* @returns The market insights report, or `null` if no insights exist (404).
|
|
177
|
-
*/
|
|
178
|
-
searchDigest(assetIdentifier: string): Promise<MarketInsightsReport | null>;
|
|
179
|
-
/**
|
|
180
|
-
* Fetch the market overview report.
|
|
181
|
-
* Calls `GET /market-overview`.
|
|
182
|
-
*
|
|
183
|
-
* @returns The market overview report, or `null` if none exists (404).
|
|
184
|
-
*/
|
|
185
|
-
fetchMarketOverview(): Promise<MarketOverview | null>;
|
|
186
|
-
/**
|
|
187
|
-
* Fetch a single market overview front page by id.
|
|
188
|
-
* Calls `GET /market-overview/front-page/:id`.
|
|
189
|
-
*
|
|
190
|
-
* @param id - The front-page identifier (UUID).
|
|
191
|
-
* @returns The market overview front page, or `null` if none exists (404).
|
|
192
|
-
*/
|
|
193
|
-
fetchFrontPageItem(id: string): Promise<MarketOverviewFrontPage | null>;
|
|
194
|
-
};
|
|
195
|
-
//# sourceMappingURL=ai-digest-types.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-digest-types.d.mts","sourceRoot":"","sources":["../src/ai-digest-types.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,mCAAmC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAC5C,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;AACxC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAM1C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,EACJ,cAAc,GACd,OAAO,GACP,YAAY,GACZ,WAAW,GACX,QAAQ,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AC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-digest-types.mjs","sourceRoot":"","sources":["../src/ai-digest-types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E","sourcesContent":["// ---------------------------------------------------------------------------\n// Shared sub-types\n// ---------------------------------------------------------------------------\n\n/**\n * A news article referenced by a trend.\n */\nexport type Article = {\n /** Article title */\n title: string;\n /** Full URL to the article */\n url: string;\n /** Source domain name (e.g. \"coindesk.com\") */\n source: string;\n /** ISO date string */\n date: string;\n};\n\n/**\n * A social media post referenced by a trend.\n */\nexport type Tweet = {\n /** Summary of the tweet content */\n contentSummary: string;\n /** Full URL to the tweet */\n url: string;\n /** Author handle (e.g. \"@saylordocs\") */\n author: string;\n /** ISO date string */\n date: string;\n};\n\n/**\n * A data source used to generate a report.\n */\nexport type Source = {\n /** Source name (e.g. \"CoinDesk\") */\n name: string;\n /** Source URL */\n url: string;\n /** Source type */\n type: 'news' | 'data' | 'social';\n};\n\nexport type MarketInsightsArticle = Article;\nexport type MarketInsightsTweet = Tweet;\nexport type MarketInsightsSource = Source;\n\n// ---------------------------------------------------------------------------\n// Market Insights types (asset-specific)\n// ---------------------------------------------------------------------------\n\n/**\n * A key market trend identified in the insights report.\n */\nexport type MarketInsightsTrend = {\n /** Trend title (e.g. \"Institutions Buying the Dip\") */\n title: string;\n /** Detailed description of the trend */\n description: string;\n /** Category of the trend */\n category:\n | 'geopolitical'\n | 'macro'\n | 'regulatory'\n | 'technical'\n | 'social'\n | 'other';\n /** Impact direction */\n impact: 'positive' | 'negative' | 'neutral';\n /** Related news articles */\n articles: Article[];\n /** Related social media posts */\n tweets: Tweet[];\n};\n\n/**\n * AI-generated market insights report for a crypto asset.\n * Returned by `GET /asset-summary?asset=<identifier>`.\n */\nexport type MarketInsightsReport = {\n /** Unique identifier for this digest, sourced from the API response envelope. */\n digestId: string;\n /** API version */\n version?: string;\n /** Asset symbol (lowercase, e.g. \"btc\") */\n asset: string;\n /** ISO date string when the report was generated */\n generatedAt: string;\n /** Main headline */\n headline: string;\n /** Summary paragraph */\n summary: string;\n /** Key market trends */\n trends: MarketInsightsTrend[];\n /** Optional top-level social posts included by the API */\n social?: Tweet[];\n /** Data sources used to generate the report */\n sources: Source[];\n /** Provider metadata */\n metadata?: AIResponseMetadata[];\n};\n\n// ---------------------------------------------------------------------------\n// Market Overview types (non-asset-specific)\n// ---------------------------------------------------------------------------\n\n/**\n * A crypto asset related to a market overview trend.\n * Returned by the `/market-overview` API as a rich object.\n */\nexport type RelatedAsset = {\n /**\n * Human-readable asset name (e.g. \"Bitcoin\"). Optional — clients must fall\n * back to `symbol` when absent.\n */\n name?: string;\n /** Ticker symbol (e.g. \"BTC\"). The only field guaranteed to be present. */\n symbol: string;\n /**\n * CAIP-19 identifiers for this asset across chains. May be absent for\n * purely synthetic / perps-only assets (e.g. ETHFI). The service\n * normalises missing values to `[]`.\n */\n caip19?: string[];\n /**\n * Canonical source asset identifier (e.g. \"bitcoin\"). Optional — may be\n * absent when the API pipeline cannot enrich the asset record.\n */\n sourceAssetId?: string;\n /**\n * Optional HyperLiquid market identifiers for this asset (e.g. `BTC`, `ETH`,\n * `xyz:TSLA`). Covers both regular crypto tokens that trade on HyperLiquid\n * and purely synthetic perps assets. Use this to resolve Perps icon URLs via\n * `getAssetIconUrls` on clients when `caip19` is empty.\n */\n hlPerpsMarket?: string[];\n};\n\nexport type MarketOverviewTrend = {\n title: string;\n description: string;\n category?:\n | 'geopolitical'\n | 'macro'\n | 'regulatory'\n | 'technical'\n | 'social'\n | 'other';\n impact?: 'positive' | 'negative' | 'neutral';\n articles: Article[];\n relatedAssets: RelatedAsset[];\n};\n\n/**\n * Provider metadata included in AI API responses.\n */\nexport type AIResponseMetadata = {\n provider: string;\n};\n\nexport type MarketOverview = {\n version?: string;\n generatedAt: string;\n trends: MarketOverviewTrend[];\n metadata?: AIResponseMetadata[];\n};\n\n/**\n * A single market overview item. Shares the exact same schema as a\n * {@link MarketOverviewTrend} — i.e. one entry of `MarketOverview.trends`.\n */\nexport type MarketOverviewItem = MarketOverviewTrend;\n\n/**\n * A market overview \"front page\": a single AI-selected item (mirroring the\n * front page of a newspaper) plus its call-to-action copy, addressable by id.\n *\n * Returned by `GET /market-overview/front-page/:id` (and `.../latest`). Unlike\n * `/market-overview`, which only ever returns the latest report, this lets\n * clients fetch an older item that has since dropped out of the report.\n */\nexport type MarketOverviewFrontPage = {\n /** Unique identifier of the front-page row (UUID). */\n id: string;\n /** The selected item — same schema as an individual market overview item. */\n item: MarketOverviewItem;\n /** Call-to-action title for the front-page item. */\n ctaTitle: string;\n /** Call-to-action description for the front-page item. */\n ctaDescription: string;\n /** ISO date string when the front-page row was created. */\n createdAt: string;\n};\n\n// ---------------------------------------------------------------------------\n// Controller state\n// ---------------------------------------------------------------------------\n\n/**\n * AiDigestController has no persisted cache. Digest freshness is owned by\n * clients (e.g. React Query).\n */\nexport type AiDigestControllerState = Record<string, never>;\n\n// ---------------------------------------------------------------------------\n// Service interface\n// ---------------------------------------------------------------------------\n\nexport type DigestService = {\n /**\n * Search for market insights by asset identifier.\n *\n * Accepts any identifier the API understands — CAIP-19 asset type\n * (e.g. `eip155:1/slip44:60`), ticker symbol (e.g. `ETH`), asset name\n * (e.g. `Bitcoin`), or HyperLiquid perps market id (e.g. `xyz:TSLA`).\n *\n * Calls `GET /asset-summary?asset=<assetIdentifier>`.\n *\n * @param assetIdentifier - The asset identifier.\n * @returns The market insights report, or `null` if no insights exist (404).\n */\n searchDigest(assetIdentifier: string): Promise<MarketInsightsReport | null>;\n\n /**\n * Fetch the market overview report.\n * Calls `GET /market-overview`.\n *\n * @returns The market overview report, or `null` if none exists (404).\n */\n fetchMarketOverview(): Promise<MarketOverview | null>;\n\n /**\n * Fetch a single market overview front page by id.\n * Calls `GET /market-overview/front-page/:id`.\n *\n * @param id - The front-page identifier (UUID).\n * @returns The market overview front page, or `null` if none exists (404).\n */\n fetchFrontPageItem(id: string): Promise<MarketOverviewFrontPage | null>;\n};\n"]}
|
package/dist/index.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AiDigestControllerErrorMessage = exports.aiDigestControllerName = exports.AiDigestService = exports.getDefaultAiDigestControllerState = exports.AiDigestController = void 0;
|
|
4
|
-
var AiDigestController_js_1 = require("./AiDigestController.cjs");
|
|
5
|
-
Object.defineProperty(exports, "AiDigestController", { enumerable: true, get: function () { return AiDigestController_js_1.AiDigestController; } });
|
|
6
|
-
Object.defineProperty(exports, "getDefaultAiDigestControllerState", { enumerable: true, get: function () { return AiDigestController_js_1.getDefaultAiDigestControllerState; } });
|
|
7
|
-
var AiDigestService_js_1 = require("./AiDigestService.cjs");
|
|
8
|
-
Object.defineProperty(exports, "AiDigestService", { enumerable: true, get: function () { return AiDigestService_js_1.AiDigestService; } });
|
|
9
|
-
var ai_digest_constants_js_1 = require("./ai-digest-constants.cjs");
|
|
10
|
-
Object.defineProperty(exports, "aiDigestControllerName", { enumerable: true, get: function () { return ai_digest_constants_js_1.controllerName; } });
|
|
11
|
-
Object.defineProperty(exports, "AiDigestControllerErrorMessage", { enumerable: true, get: function () { return ai_digest_constants_js_1.AiDigestControllerErrorMessage; } });
|
|
12
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAQA,kEAGiC;AAF/B,2HAAA,kBAAkB,OAAA;AAClB,0IAAA,iCAAiC,OAAA;AASnC,4DAAuD;AAA9C,qHAAA,eAAe,OAAA;AAqBxB,oEAGkC;AAFhC,gIAAA,cAAc,OAA0B;AACxC,wIAAA,8BAA8B,OAAA","sourcesContent":["export type {\n AiDigestControllerActions,\n AiDigestControllerEvents,\n AiDigestControllerGetStateAction,\n AiDigestControllerMessenger,\n AiDigestControllerOptions,\n AiDigestControllerStateChangeEvent,\n} from './AiDigestController.js';\nexport {\n AiDigestController,\n getDefaultAiDigestControllerState,\n} from './AiDigestController.js';\nexport type {\n AiDigestControllerFetchMarketInsightsAction,\n AiDigestControllerFetchMarketOverviewAction,\n AiDigestControllerFetchFrontPageItemAction,\n} from './AiDigestController-method-action-types.js';\n\nexport type { AiDigestServiceConfig } from './AiDigestService.js';\nexport { AiDigestService } from './AiDigestService.js';\n\nexport type {\n AiDigestControllerState,\n AIResponseMetadata,\n Article,\n DigestService,\n MarketInsightsArticle,\n MarketInsightsReport,\n MarketInsightsSource,\n MarketInsightsTrend,\n MarketInsightsTweet,\n MarketOverview,\n MarketOverviewFrontPage,\n MarketOverviewItem,\n MarketOverviewTrend,\n RelatedAsset,\n Source,\n Tweet,\n} from './ai-digest-types.js';\n\nexport {\n controllerName as aiDigestControllerName,\n AiDigestControllerErrorMessage,\n} from './ai-digest-constants.js';\n"]}
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,yBAAyB,EACzB,kCAAkC,GACnC,iCAAgC;AACjC,OAAO,EACL,kBAAkB,EAClB,iCAAiC,GAClC,iCAAgC;AACjC,YAAY,EACV,2CAA2C,EAC3C,2CAA2C,EAC3C,0CAA0C,GAC3C,qDAAoD;AAErD,YAAY,EAAE,qBAAqB,EAAE,8BAA6B;AAClE,OAAO,EAAE,eAAe,EAAE,8BAA6B;AAEvD,YAAY,EACV,uBAAuB,EACvB,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,KAAK,GACN,8BAA6B;AAE9B,OAAO,EACL,cAAc,IAAI,sBAAsB,EACxC,8BAA8B,GAC/B,kCAAiC"}
|
package/dist/index.d.mts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type { AiDigestControllerActions, AiDigestControllerEvents, AiDigestControllerGetStateAction, AiDigestControllerMessenger, AiDigestControllerOptions, AiDigestControllerStateChangeEvent, } from "./AiDigestController.mjs";
|
|
2
|
-
export { AiDigestController, getDefaultAiDigestControllerState, } from "./AiDigestController.mjs";
|
|
3
|
-
export type { AiDigestControllerFetchMarketInsightsAction, AiDigestControllerFetchMarketOverviewAction, AiDigestControllerFetchFrontPageItemAction, } from "./AiDigestController-method-action-types.mjs";
|
|
4
|
-
export type { AiDigestServiceConfig } from "./AiDigestService.mjs";
|
|
5
|
-
export { AiDigestService } from "./AiDigestService.mjs";
|
|
6
|
-
export type { AiDigestControllerState, AIResponseMetadata, Article, DigestService, MarketInsightsArticle, MarketInsightsReport, MarketInsightsSource, MarketInsightsTrend, MarketInsightsTweet, MarketOverview, MarketOverviewFrontPage, MarketOverviewItem, MarketOverviewTrend, RelatedAsset, Source, Tweet, } from "./ai-digest-types.mjs";
|
|
7
|
-
export { controllerName as aiDigestControllerName, AiDigestControllerErrorMessage, } from "./ai-digest-constants.mjs";
|
|
8
|
-
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,yBAAyB,EACzB,kCAAkC,GACnC,iCAAgC;AACjC,OAAO,EACL,kBAAkB,EAClB,iCAAiC,GAClC,iCAAgC;AACjC,YAAY,EACV,2CAA2C,EAC3C,2CAA2C,EAC3C,0CAA0C,GAC3C,qDAAoD;AAErD,YAAY,EAAE,qBAAqB,EAAE,8BAA6B;AAClE,OAAO,EAAE,eAAe,EAAE,8BAA6B;AAEvD,YAAY,EACV,uBAAuB,EACvB,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,KAAK,GACN,8BAA6B;AAE9B,OAAO,EACL,cAAc,IAAI,sBAAsB,EACxC,8BAA8B,GAC/B,kCAAiC"}
|
package/dist/index.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { AiDigestController, getDefaultAiDigestControllerState } from "./AiDigestController.mjs";
|
|
2
|
-
export { AiDigestService } from "./AiDigestService.mjs";
|
|
3
|
-
export { controllerName as aiDigestControllerName, AiDigestControllerErrorMessage } from "./ai-digest-constants.mjs";
|
|
4
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EAClC,iCAAgC;AAQjC,OAAO,EAAE,eAAe,EAAE,8BAA6B;AAqBvD,OAAO,EACL,cAAc,IAAI,sBAAsB,EACxC,8BAA8B,EAC/B,kCAAiC","sourcesContent":["export type {\n AiDigestControllerActions,\n AiDigestControllerEvents,\n AiDigestControllerGetStateAction,\n AiDigestControllerMessenger,\n AiDigestControllerOptions,\n AiDigestControllerStateChangeEvent,\n} from './AiDigestController.js';\nexport {\n AiDigestController,\n getDefaultAiDigestControllerState,\n} from './AiDigestController.js';\nexport type {\n AiDigestControllerFetchMarketInsightsAction,\n AiDigestControllerFetchMarketOverviewAction,\n AiDigestControllerFetchFrontPageItemAction,\n} from './AiDigestController-method-action-types.js';\n\nexport type { AiDigestServiceConfig } from './AiDigestService.js';\nexport { AiDigestService } from './AiDigestService.js';\n\nexport type {\n AiDigestControllerState,\n AIResponseMetadata,\n Article,\n DigestService,\n MarketInsightsArticle,\n MarketInsightsReport,\n MarketInsightsSource,\n MarketInsightsTrend,\n MarketInsightsTweet,\n MarketOverview,\n MarketOverviewFrontPage,\n MarketOverviewItem,\n MarketOverviewTrend,\n RelatedAsset,\n Source,\n Tweet,\n} from './ai-digest-types.js';\n\nexport {\n controllerName as aiDigestControllerName,\n AiDigestControllerErrorMessage,\n} from './ai-digest-constants.js';\n"]}
|