fodda-mcp 1.3.2 → 1.30.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/LICENSE +31 -0
- package/README.md +192 -20
- package/dist/a2aHandler.d.ts +20 -0
- package/dist/a2aHandler.d.ts.map +1 -0
- package/dist/a2aHandler.js +247 -0
- package/dist/a2aHandler.js.map +1 -0
- package/dist/agents/fodda-researcher/index.d.ts +35 -0
- package/dist/agents/fodda-researcher/index.d.ts.map +1 -0
- package/dist/agents/fodda-researcher/index.js +62 -0
- package/dist/agents/fodda-researcher/index.js.map +1 -0
- package/dist/agents/fodda-researcher/skills.d.ts +16 -0
- package/dist/agents/fodda-researcher/skills.d.ts.map +1 -0
- package/dist/agents/fodda-researcher/skills.js +163 -0
- package/dist/agents/fodda-researcher/skills.js.map +1 -0
- package/dist/brandTemplate.d.ts +14 -0
- package/dist/brandTemplate.d.ts.map +1 -0
- package/dist/brandTemplate.js +742 -0
- package/dist/brandTemplate.js.map +1 -0
- package/dist/catalogCache.d.ts +177 -0
- package/dist/catalogCache.d.ts.map +1 -0
- package/dist/catalogCache.js +708 -0
- package/dist/catalogCache.js.map +1 -0
- package/dist/editorialFill.d.ts +44 -0
- package/dist/editorialFill.d.ts.map +1 -0
- package/dist/editorialFill.js +377 -0
- package/dist/editorialFill.js.map +1 -0
- package/dist/enrichment.d.ts +74 -0
- package/dist/enrichment.d.ts.map +1 -0
- package/dist/enrichment.js +211 -0
- package/dist/enrichment.js.map +1 -0
- package/dist/errorHandling.d.ts +52 -0
- package/dist/errorHandling.d.ts.map +1 -0
- package/dist/errorHandling.js +327 -0
- package/dist/errorHandling.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +595 -410
- package/dist/index.js.map +1 -1
- package/dist/pricingCache.d.ts +99 -0
- package/dist/pricingCache.d.ts.map +1 -0
- package/dist/pricingCache.js +414 -0
- package/dist/pricingCache.js.map +1 -0
- package/dist/queryCache.d.ts +25 -0
- package/dist/queryCache.d.ts.map +1 -0
- package/dist/queryCache.js +194 -0
- package/dist/queryCache.js.map +1 -0
- package/dist/searchTemplate.d.ts +16 -0
- package/dist/searchTemplate.d.ts.map +1 -0
- package/dist/searchTemplate.js +318 -0
- package/dist/searchTemplate.js.map +1 -0
- package/dist/sessionTracker.d.ts +39 -0
- package/dist/sessionTracker.d.ts.map +1 -0
- package/dist/sessionTracker.js +187 -0
- package/dist/sessionTracker.js.map +1 -0
- package/dist/skillClient.d.ts +142 -0
- package/dist/skillClient.d.ts.map +1 -0
- package/dist/skillClient.js +256 -0
- package/dist/skillClient.js.map +1 -0
- package/dist/svgVisuals.d.ts +77 -0
- package/dist/svgVisuals.d.ts.map +1 -0
- package/dist/svgVisuals.js +323 -0
- package/dist/svgVisuals.js.map +1 -0
- package/dist/systemPrompt.d.ts +26 -0
- package/dist/systemPrompt.d.ts.map +1 -0
- package/dist/systemPrompt.js +546 -0
- package/dist/systemPrompt.js.map +1 -0
- package/dist/test-waverunner-response.d.ts +2 -0
- package/dist/test-waverunner-response.d.ts.map +1 -0
- package/dist/test-waverunner-response.js +20 -0
- package/dist/test-waverunner-response.js.map +1 -0
- package/dist/test_analyst.d.ts +2 -0
- package/dist/test_analyst.d.ts.map +1 -0
- package/dist/test_analyst.js +39 -0
- package/dist/test_analyst.js.map +1 -0
- package/dist/test_analyst_local.d.ts +2 -0
- package/dist/test_analyst_local.d.ts.map +1 -0
- package/dist/test_analyst_local.js +51 -0
- package/dist/test_analyst_local.js.map +1 -0
- package/dist/test_live_mcp.d.ts +2 -0
- package/dist/test_live_mcp.d.ts.map +1 -0
- package/dist/test_live_mcp.js +49 -0
- package/dist/test_live_mcp.js.map +1 -0
- package/dist/test_skills.d.ts +9 -0
- package/dist/test_skills.d.ts.map +1 -0
- package/dist/test_skills.js +267 -0
- package/dist/test_skills.js.map +1 -0
- package/dist/toolHandlers.d.ts +11 -0
- package/dist/toolHandlers.d.ts.map +1 -0
- package/dist/toolHandlers.js +2829 -0
- package/dist/toolHandlers.js.map +1 -0
- package/dist/tools.d.ts +80 -3
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +89 -186
- package/dist/tools.js.map +1 -1
- package/dist/trialTracker.d.ts +58 -0
- package/dist/trialTracker.d.ts.map +1 -0
- package/dist/trialTracker.js +179 -0
- package/dist/trialTracker.js.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/verify_hmac.js +1 -1
- package/dist/verify_hmac.js.map +1 -1
- package/dist/verify_tools_endpoint.js +5 -5
- package/dist/verify_tools_endpoint.js.map +1 -1
- package/dist/widgetShell.d.ts +15 -0
- package/dist/widgetShell.d.ts.map +1 -0
- package/dist/widgetShell.js +151 -0
- package/dist/widgetShell.js.map +1 -0
- package/package.json +10 -6
- package/server.json +12 -17
package/dist/tools.js
CHANGED
|
@@ -1,191 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tool Metadata — version constants for the Fodda MCP server.
|
|
3
|
+
*
|
|
4
|
+
* The actual tool registrations live in toolHandlers.ts.
|
|
5
|
+
* This file provides version strings used by index.ts and toolHandlers.ts.
|
|
6
|
+
*/
|
|
7
|
+
export const MCP_SERVER_VERSION = "1.30.0";
|
|
2
8
|
export const TOOL_VERSIONS = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
list_graphs: "1.4.0",
|
|
10
|
+
search_graph: "1.4.0",
|
|
11
|
+
get_neighbors: "1.2.0",
|
|
12
|
+
get_evidence: "1.1.0",
|
|
6
13
|
get_node: "1.0.0",
|
|
7
|
-
get_label_values: "1.
|
|
14
|
+
get_label_values: "1.2.0",
|
|
8
15
|
psfk_overview: "1.0.0",
|
|
16
|
+
discover_adjacent_trends: "1.0.0",
|
|
17
|
+
brand_tracker: "1.0.0",
|
|
18
|
+
get_census_retail_snapshot: "1.0.0",
|
|
19
|
+
get_census_demographics_snapshot: "1.1.0",
|
|
20
|
+
get_fred_economic_snapshot: "1.0.0",
|
|
21
|
+
get_wikipedia_pageviews: "1.0.0",
|
|
22
|
+
get_worldbank_global_snapshot: "1.1.0",
|
|
23
|
+
get_fda_ingredient_safety: "1.0.0",
|
|
24
|
+
get_fda_recalls: "1.0.0",
|
|
25
|
+
get_clinical_trials: "1.0.0",
|
|
26
|
+
get_bls_economic_snapshot: "1.0.0",
|
|
27
|
+
get_bea_spending_snapshot: "1.0.0",
|
|
28
|
+
get_cdc_health_data: "1.0.0",
|
|
29
|
+
get_pubmed_research_trends: "1.0.0",
|
|
30
|
+
get_openalex_research_trends: "1.0.0",
|
|
31
|
+
search_statistics: "1.0.0",
|
|
32
|
+
search_insights: "1.0.0",
|
|
33
|
+
get_wto_trade_snapshot: "1.0.0",
|
|
34
|
+
get_pew_survey_data: "1.0.0",
|
|
35
|
+
get_openfoodfacts_snapshot: "1.0.0",
|
|
36
|
+
get_ridb_recreation_snapshot: "1.0.0",
|
|
37
|
+
get_osm_commerce_snapshot: "1.0.0",
|
|
38
|
+
get_google_trends_snapshot: "1.0.0",
|
|
39
|
+
get_amazon_products_snapshot: "1.0.0",
|
|
40
|
+
get_oecd_economic_snapshot: "1.0.0",
|
|
41
|
+
get_cbs_nl_snapshot: "1.0.0",
|
|
42
|
+
get_ptdata_pt_snapshot: "1.0.0",
|
|
43
|
+
// v1.28.0 — European expansion
|
|
44
|
+
get_eurostat_eu_snapshot: "1.0.0",
|
|
45
|
+
get_ecb_euro_snapshot: "1.0.0",
|
|
46
|
+
get_boe_uk_snapshot: "1.0.0",
|
|
47
|
+
get_nordic_pxweb_snapshot: "1.0.0",
|
|
48
|
+
get_bundesbank_de_snapshot: "1.0.0",
|
|
49
|
+
get_ine_es_snapshot: "1.0.0",
|
|
50
|
+
get_insee_fr_snapshot: "1.0.0",
|
|
51
|
+
get_snb_ch_snapshot: "1.0.0",
|
|
52
|
+
get_bis_global_snapshot: "1.0.0",
|
|
53
|
+
// v1.28.0 — Americas expansion
|
|
54
|
+
get_bcb_br_snapshot: "1.0.0",
|
|
55
|
+
get_bcrp_pe_snapshot: "1.0.0",
|
|
56
|
+
get_arg_ar_snapshot: "1.0.0",
|
|
57
|
+
get_banxico_mx_snapshot: "1.0.0",
|
|
58
|
+
get_bch_hn_snapshot: "1.0.0",
|
|
59
|
+
get_boc_ca_snapshot: "1.0.0",
|
|
60
|
+
get_statcan_ca_snapshot: "1.0.0",
|
|
61
|
+
get_bcch_cl_snapshot: "1.0.0",
|
|
62
|
+
get_socrata_us_snapshot: "1.0.0",
|
|
63
|
+
// v1.28.0 — Asia-Pacific expansion
|
|
64
|
+
get_abs_au_snapshot: "1.0.0",
|
|
65
|
+
get_rba_au_snapshot: "1.0.0",
|
|
66
|
+
get_pdh_pacific_snapshot: "1.0.0",
|
|
67
|
+
get_bnm_my_snapshot: "1.0.0",
|
|
68
|
+
get_hkma_hk_snapshot: "1.0.0",
|
|
69
|
+
get_estat_jp_snapshot: "1.0.0",
|
|
70
|
+
get_bok_kr_snapshot: "1.0.0",
|
|
71
|
+
get_bot_th_snapshot: "1.0.0",
|
|
72
|
+
get_bps_id_snapshot: "1.0.0",
|
|
73
|
+
get_psa_ph_snapshot: "1.0.0",
|
|
74
|
+
get_sg_snapshot: "1.0.0",
|
|
75
|
+
get_cn_china_snapshot: "1.0.0",
|
|
76
|
+
get_india_in_snapshot: "1.0.0",
|
|
77
|
+
// v1.28.0 — Middle East & Africa expansion
|
|
78
|
+
get_qatar_qa_snapshot: "1.0.0",
|
|
79
|
+
get_bahrain_bh_snapshot: "1.0.0",
|
|
80
|
+
get_boi_il_snapshot: "1.0.0",
|
|
81
|
+
get_sarb_za_snapshot: "1.0.0",
|
|
82
|
+
// Utility tools
|
|
83
|
+
sign_up_free_account: "1.0.0",
|
|
84
|
+
send_feedback: "1.0.0",
|
|
85
|
+
get_my_account: "1.0.0",
|
|
86
|
+
update_user_profile: "1.0.0",
|
|
87
|
+
deep_research_topic: "1.0.0",
|
|
88
|
+
read_url: "1.0.0",
|
|
89
|
+
list_analysts: "1.0.0",
|
|
90
|
+
consult_analyst: "1.0.0",
|
|
91
|
+
toggle_graph_preference: "1.0.0",
|
|
92
|
+
manage_scheduled_reports: "2.0.0",
|
|
9
93
|
};
|
|
10
|
-
export const TOOLS = [
|
|
11
|
-
{
|
|
12
|
-
name: "search_graph",
|
|
13
|
-
description: "Perform hybrid (vector + keyword) search on a Fodda knowledge graph. Returns trends and articles matching the query. Uses a 3-tier fallback: vector search → keyword search → all trends. Always returns results.",
|
|
14
|
-
inputSchema: {
|
|
15
|
-
type: "object",
|
|
16
|
-
properties: {
|
|
17
|
-
graphId: { type: "string", description: "The graph ID. For PSFK verticals use: 'retail', 'beauty', or 'sports'. Other graphs: 'psfk' (all verticals), 'sic' (Strategic Independent Culture), 'waldo'." },
|
|
18
|
-
query: { type: "string", description: "The search query" },
|
|
19
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
20
|
-
limit: { type: "number", description: "Maximum number of results (default 25, max 50)" },
|
|
21
|
-
use_semantic: { type: "boolean", description: "Whether to use semantic search (default true)" },
|
|
22
|
-
},
|
|
23
|
-
required: ["graphId", "query", "userId"],
|
|
24
|
-
},
|
|
25
|
-
outputSchema: {
|
|
26
|
-
type: "object",
|
|
27
|
-
properties: {
|
|
28
|
-
results: {
|
|
29
|
-
type: "array",
|
|
30
|
-
description: "Array of matching nodes (trends, articles)",
|
|
31
|
-
},
|
|
32
|
-
total: { type: "number", description: "Total number of results found" },
|
|
33
|
-
search_method: { type: "string", description: "Search method used: 'vector', 'keyword', or 'fallback'" },
|
|
34
|
-
usage: {
|
|
35
|
-
type: "object",
|
|
36
|
-
description: "Billing/usage metadata",
|
|
37
|
-
properties: {
|
|
38
|
-
total_billable_units: { type: "number" },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
isDeterministic: false,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: "get_neighbors",
|
|
47
|
-
description: "Traverse the graph from seed nodes to find related concepts and relationships. Useful for depth-first discovery.",
|
|
48
|
-
inputSchema: {
|
|
49
|
-
type: "object",
|
|
50
|
-
properties: {
|
|
51
|
-
graphId: { type: "string", description: "The graph ID" },
|
|
52
|
-
seed_node_ids: { type: "array", items: { type: "string" }, description: "Array of node IDs to start traversal from" },
|
|
53
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
54
|
-
relationship_types: { type: "array", items: { type: "string" }, description: "Filter by relationship types" },
|
|
55
|
-
depth: { type: "number", description: "Traversal depth (default 1, max 2)" },
|
|
56
|
-
limit: { type: "number", description: "Maximum results (default 50)" },
|
|
57
|
-
},
|
|
58
|
-
required: ["graphId", "seed_node_ids", "userId"],
|
|
59
|
-
},
|
|
60
|
-
outputSchema: {
|
|
61
|
-
type: "object",
|
|
62
|
-
properties: {
|
|
63
|
-
nodes: {
|
|
64
|
-
type: "array",
|
|
65
|
-
description: "Array of neighboring nodes",
|
|
66
|
-
},
|
|
67
|
-
edges: {
|
|
68
|
-
type: "array",
|
|
69
|
-
description: "Array of relationships between nodes",
|
|
70
|
-
},
|
|
71
|
-
usage: {
|
|
72
|
-
type: "object",
|
|
73
|
-
properties: {
|
|
74
|
-
total_billable_units: { type: "number" },
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
isDeterministic: true,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "get_evidence",
|
|
83
|
-
description: "Get source signals, articles, and evidentiary depth for a specific node. Essential for provenance and fact-checking.",
|
|
84
|
-
inputSchema: {
|
|
85
|
-
type: "object",
|
|
86
|
-
properties: {
|
|
87
|
-
graphId: { type: "string", description: "The graph ID" },
|
|
88
|
-
for_node_id: { type: "string", description: "The ID of the node (Trend or Article)" },
|
|
89
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
90
|
-
top_k: { type: "number", description: "Number of evidence items to return (default 5)" },
|
|
91
|
-
},
|
|
92
|
-
required: ["graphId", "for_node_id", "userId"],
|
|
93
|
-
},
|
|
94
|
-
outputSchema: {
|
|
95
|
-
type: "object",
|
|
96
|
-
properties: {
|
|
97
|
-
evidence: {
|
|
98
|
-
type: "array",
|
|
99
|
-
description: "Array of evidence items with source URLs, titles, snippets, and relevance scores",
|
|
100
|
-
},
|
|
101
|
-
node_id: { type: "string", description: "The node this evidence supports" },
|
|
102
|
-
usage: {
|
|
103
|
-
type: "object",
|
|
104
|
-
properties: {
|
|
105
|
-
total_billable_units: { type: "number" },
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
isDeterministic: true,
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "get_node",
|
|
114
|
-
description: "Directly retrieve metadata and properties for a single node by its ID.",
|
|
115
|
-
inputSchema: {
|
|
116
|
-
type: "object",
|
|
117
|
-
properties: {
|
|
118
|
-
graphId: { type: "string", description: "The graph ID" },
|
|
119
|
-
nodeId: { type: "string", description: "The ID of the node" },
|
|
120
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
121
|
-
},
|
|
122
|
-
required: ["graphId", "nodeId", "userId"],
|
|
123
|
-
},
|
|
124
|
-
outputSchema: {
|
|
125
|
-
type: "object",
|
|
126
|
-
properties: {
|
|
127
|
-
id: { type: "string", description: "Node ID" },
|
|
128
|
-
display: { type: "string", description: "Display name of the node" },
|
|
129
|
-
labels: { type: "array", description: "Array of node labels/types" },
|
|
130
|
-
properties: { type: "object", description: "Key-value properties of the node" },
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
isDeterministic: true,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "get_label_values",
|
|
137
|
-
description: "Discover valid values for a specific node label (e.g., RetailerType, Technology). Use for discovery, UI filters, and category exploration.",
|
|
138
|
-
inputSchema: {
|
|
139
|
-
type: "object",
|
|
140
|
-
properties: {
|
|
141
|
-
graphId: { type: "string", description: "The graph ID" },
|
|
142
|
-
label: { type: "string", description: "The label to fetch values for" },
|
|
143
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
144
|
-
},
|
|
145
|
-
required: ["graphId", "label", "userId"],
|
|
146
|
-
},
|
|
147
|
-
outputSchema: {
|
|
148
|
-
type: "object",
|
|
149
|
-
properties: {
|
|
150
|
-
label: { type: "string", description: "The label queried" },
|
|
151
|
-
values: { type: "array", description: "Array of valid values for the label" },
|
|
152
|
-
count: { type: "number", description: "Number of values found" },
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
isDeterministic: true,
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "psfk_overview",
|
|
159
|
-
description: "Get a structured macro overview from the PSFK Graph. Returns up to 3 meta_patterns. Useful for top-level briefings before deeper exploration. At least one of 'industry' or 'sector' must be provided.",
|
|
160
|
-
inputSchema: {
|
|
161
|
-
type: "object",
|
|
162
|
-
properties: {
|
|
163
|
-
industry: { type: "string", description: "Filter by industry (e.g. 'Retail', 'Health')" },
|
|
164
|
-
sector: { type: "string", description: "Filter by sector" },
|
|
165
|
-
region: { type: "string", description: "Filter by region" },
|
|
166
|
-
timeframe: { type: "string", description: "Timeframe for the overview" },
|
|
167
|
-
userId: { type: "string", description: "Unique identifier for the user (Required)" },
|
|
168
|
-
},
|
|
169
|
-
required: ["userId"],
|
|
170
|
-
},
|
|
171
|
-
outputSchema: {
|
|
172
|
-
type: "object",
|
|
173
|
-
properties: {
|
|
174
|
-
meta_patterns: {
|
|
175
|
-
type: "array",
|
|
176
|
-
description: "Up to 3 macro-level pattern objects with trend summaries",
|
|
177
|
-
},
|
|
178
|
-
industry: { type: "string", description: "Industry filter applied" },
|
|
179
|
-
sector: { type: "string", description: "Sector filter applied" },
|
|
180
|
-
usage: {
|
|
181
|
-
type: "object",
|
|
182
|
-
properties: {
|
|
183
|
-
total_billable_units: { type: "number" },
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
isDeterministic: false,
|
|
189
|
-
},
|
|
190
|
-
];
|
|
191
94
|
//# sourceMappingURL=tools.js.map
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,WAAW,EAAE,OAAO;IACpB,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,OAAO;IACtB,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,OAAO;IACjB,gBAAgB,EAAE,OAAO;IACzB,aAAa,EAAE,OAAO;IACtB,wBAAwB,EAAE,OAAO;IACjC,aAAa,EAAE,OAAO;IACtB,0BAA0B,EAAE,OAAO;IACnC,gCAAgC,EAAE,OAAO;IACzC,0BAA0B,EAAE,OAAO;IACnC,uBAAuB,EAAE,OAAO;IAChC,6BAA6B,EAAE,OAAO;IACtC,yBAAyB,EAAE,OAAO;IAClC,eAAe,EAAE,OAAO;IACxB,mBAAmB,EAAE,OAAO;IAC5B,yBAAyB,EAAE,OAAO;IAClC,yBAAyB,EAAE,OAAO;IAClC,mBAAmB,EAAE,OAAO;IAC5B,0BAA0B,EAAE,OAAO;IACnC,4BAA4B,EAAE,OAAO;IACrC,iBAAiB,EAAE,OAAO;IAC1B,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE,OAAO;IAC/B,mBAAmB,EAAE,OAAO;IAC5B,0BAA0B,EAAE,OAAO;IACnC,4BAA4B,EAAE,OAAO;IACrC,yBAAyB,EAAE,OAAO;IAClC,0BAA0B,EAAE,OAAO;IACnC,4BAA4B,EAAE,OAAO;IACrC,0BAA0B,EAAE,OAAO;IACnC,mBAAmB,EA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AAa,EAAE,OAAO;IACtB,eAAe,EAAE,OAAO;IACxB,uBAAuB,EAAE,OAAO;IAChC,wBAAwB,EAAE,OAAO;CACpC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trial Tracker — Firestore-backed per-user trial token counter.
|
|
3
|
+
*
|
|
4
|
+
* Tracks how many API calls each trial user (identified by userId/email)
|
|
5
|
+
* has made across all sessions. Cloud Run instances are ephemeral, so
|
|
6
|
+
* in-memory counters reset on cold starts — Firestore provides persistence.
|
|
7
|
+
*
|
|
8
|
+
* Does NOT modify the existing trial → Base conversion flow.
|
|
9
|
+
* Only adds a per-user counting layer that triggers it earlier.
|
|
10
|
+
*
|
|
11
|
+
* Split credit model (2026-04-24):
|
|
12
|
+
* - 50 search tokens (standard graph queries)
|
|
13
|
+
* - 1 free Deep Dive (fast or comprehensive)
|
|
14
|
+
* - 2 free Expert Agent turns
|
|
15
|
+
* Each pool is tracked independently in the Firestore document.
|
|
16
|
+
*/
|
|
17
|
+
export type TrialInteractionType = 'search' | 'deep_dive' | 'expert_agent';
|
|
18
|
+
export interface TrialUsage {
|
|
19
|
+
count: number;
|
|
20
|
+
deepDiveUsed: number;
|
|
21
|
+
expertAgentUsed: number;
|
|
22
|
+
firstUse: Date;
|
|
23
|
+
lastUse: Date;
|
|
24
|
+
}
|
|
25
|
+
export interface TrialCheckResult {
|
|
26
|
+
allowed: boolean;
|
|
27
|
+
count: number;
|
|
28
|
+
remaining: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
shouldWarn: boolean;
|
|
31
|
+
/** Which credit pool was checked */
|
|
32
|
+
pool: TrialInteractionType;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the current trial usage for a user.
|
|
36
|
+
* If the user's firstUse is older than 30 days, resets all counters.
|
|
37
|
+
* Returns { count, deepDiveUsed, expertAgentUsed, firstUse, lastUse }.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getTrialUsage(userId: string): Promise<TrialUsage>;
|
|
40
|
+
/**
|
|
41
|
+
* Increment the trial usage counter for a user.
|
|
42
|
+
* Called after a successful API call.
|
|
43
|
+
* Uses a transaction to ensure firstUse is only set on doc creation.
|
|
44
|
+
*
|
|
45
|
+
* @param userId - The user identifier (email or fingerprint)
|
|
46
|
+
* @param cost - Number of tokens to deduct (default: 1 for search)
|
|
47
|
+
* @param interactionType - Which credit pool to deduct from
|
|
48
|
+
*/
|
|
49
|
+
export declare function incrementTrialUsage(userId: string, cost?: number, interactionType?: TrialInteractionType): Promise<number>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a trial user is allowed to make an API call.
|
|
52
|
+
* Checks the appropriate credit pool based on interactionType.
|
|
53
|
+
*
|
|
54
|
+
* @param userId - The user identifier
|
|
55
|
+
* @param interactionType - Which pool to check: 'search' (50 tokens), 'deep_dive' (1 free), 'expert_agent' (2 free)
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkTrialLimit(userId: string, interactionType?: TrialInteractionType): Promise<TrialCheckResult>;
|
|
58
|
+
//# sourceMappingURL=trialTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trialTracker.d.ts","sourceRoot":"","sources":["../src/trialTracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoBH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAC;AAoB3E,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,IAAI,EAAE,oBAAoB,CAAC;CAC9B;AAMD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA4BvE;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAU,EAChB,eAAe,GAAE,oBAA+B,GACjD,OAAO,CAAC,MAAM,CAAC,CA2CjB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACjC,MAAM,EAAE,MAAM,EACd,eAAe,GAAE,oBAA+B,GACjD,OAAO,CAAC,gBAAgB,CAAC,CAqC3B"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trial Tracker — Firestore-backed per-user trial token counter.
|
|
3
|
+
*
|
|
4
|
+
* Tracks how many API calls each trial user (identified by userId/email)
|
|
5
|
+
* has made across all sessions. Cloud Run instances are ephemeral, so
|
|
6
|
+
* in-memory counters reset on cold starts — Firestore provides persistence.
|
|
7
|
+
*
|
|
8
|
+
* Does NOT modify the existing trial → Base conversion flow.
|
|
9
|
+
* Only adds a per-user counting layer that triggers it earlier.
|
|
10
|
+
*
|
|
11
|
+
* Split credit model (2026-04-24):
|
|
12
|
+
* - 50 search tokens (standard graph queries)
|
|
13
|
+
* - 1 free Deep Dive (fast or comprehensive)
|
|
14
|
+
* - 2 free Expert Agent turns
|
|
15
|
+
* Each pool is tracked independently in the Firestore document.
|
|
16
|
+
*/
|
|
17
|
+
import { Firestore } from '@google-cloud/firestore';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Configuration
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
const PER_USER_TRIAL_LIMIT = 50;
|
|
22
|
+
const DEEP_DIVE_TRIAL_LIMIT = 1; // 1 free Deep Dive per trial user
|
|
23
|
+
const EXPERT_AGENT_TRIAL_LIMIT = 2; // 2 free Expert Agent turns per trial user
|
|
24
|
+
const WARNING_THRESHOLD = 10; // warn when remaining < 10
|
|
25
|
+
const RESET_PERIOD_MS = 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
26
|
+
const COLLECTION = 'trial-usage';
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Firestore client — uses Application Default Credentials on Cloud Run
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
let db = null;
|
|
31
|
+
function getDb() {
|
|
32
|
+
if (!db) {
|
|
33
|
+
const projectId = process.env.GOOGLE_CLOUD_PROJECT || process.env.GCP_PROJECT;
|
|
34
|
+
db = new Firestore(projectId ? { projectId } : {});
|
|
35
|
+
}
|
|
36
|
+
return db;
|
|
37
|
+
}
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Core functions
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
/**
|
|
42
|
+
* Get the current trial usage for a user.
|
|
43
|
+
* If the user's firstUse is older than 30 days, resets all counters.
|
|
44
|
+
* Returns { count, deepDiveUsed, expertAgentUsed, firstUse, lastUse }.
|
|
45
|
+
*/
|
|
46
|
+
export async function getTrialUsage(userId) {
|
|
47
|
+
try {
|
|
48
|
+
const docRef = getDb().collection(COLLECTION).doc(sanitizeDocId(userId));
|
|
49
|
+
const snap = await docRef.get();
|
|
50
|
+
if (!snap.exists) {
|
|
51
|
+
return { count: 0, deepDiveUsed: 0, expertAgentUsed: 0, firstUse: new Date(), lastUse: new Date() };
|
|
52
|
+
}
|
|
53
|
+
const data = snap.data();
|
|
54
|
+
const firstUse = data['firstUse']?.toDate?.() ?? new Date(data['firstUse']);
|
|
55
|
+
const lastUse = data['lastUse']?.toDate?.() ?? new Date(data['lastUse']);
|
|
56
|
+
const count = data['count'] ?? 0;
|
|
57
|
+
const deepDiveUsed = data['deepDiveUsed'] ?? 0;
|
|
58
|
+
const expertAgentUsed = data['expertAgentUsed'] ?? 0;
|
|
59
|
+
// Monthly reset: if firstUse is older than 30 days, reset all counters
|
|
60
|
+
if (Date.now() - firstUse.getTime() > RESET_PERIOD_MS) {
|
|
61
|
+
await docRef.set({ count: 0, deepDiveUsed: 0, expertAgentUsed: 0, firstUse: new Date(), lastUse: new Date() });
|
|
62
|
+
return { count: 0, deepDiveUsed: 0, expertAgentUsed: 0, firstUse: new Date(), lastUse: new Date() };
|
|
63
|
+
}
|
|
64
|
+
return { count, deepDiveUsed, expertAgentUsed, firstUse, lastUse };
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
// If Firestore is unavailable, fail open — let the shared pool handle it
|
|
68
|
+
console.error(`[trialTracker] Firestore read failed for ${userId}:`, err.message);
|
|
69
|
+
return { count: 0, deepDiveUsed: 0, expertAgentUsed: 0, firstUse: new Date(), lastUse: new Date() };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Increment the trial usage counter for a user.
|
|
74
|
+
* Called after a successful API call.
|
|
75
|
+
* Uses a transaction to ensure firstUse is only set on doc creation.
|
|
76
|
+
*
|
|
77
|
+
* @param userId - The user identifier (email or fingerprint)
|
|
78
|
+
* @param cost - Number of tokens to deduct (default: 1 for search)
|
|
79
|
+
* @param interactionType - Which credit pool to deduct from
|
|
80
|
+
*/
|
|
81
|
+
export async function incrementTrialUsage(userId, cost = 1, interactionType = 'search') {
|
|
82
|
+
try {
|
|
83
|
+
const docRef = getDb().collection(COLLECTION).doc(sanitizeDocId(userId));
|
|
84
|
+
const now = new Date();
|
|
85
|
+
const newCount = await getDb().runTransaction(async (tx) => {
|
|
86
|
+
const snap = await tx.get(docRef);
|
|
87
|
+
if (!snap.exists) {
|
|
88
|
+
// First ever API call for this user
|
|
89
|
+
const initial = { count: 0, deepDiveUsed: 0, expertAgentUsed: 0, firstUse: now, lastUse: now };
|
|
90
|
+
if (interactionType === 'deep_dive') {
|
|
91
|
+
initial.deepDiveUsed = 1;
|
|
92
|
+
}
|
|
93
|
+
else if (interactionType === 'expert_agent') {
|
|
94
|
+
initial.expertAgentUsed = 1;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
initial.count = cost;
|
|
98
|
+
}
|
|
99
|
+
tx.set(docRef, initial);
|
|
100
|
+
return interactionType === 'search' ? cost : 0;
|
|
101
|
+
}
|
|
102
|
+
const data = snap.data();
|
|
103
|
+
const updates = { lastUse: now };
|
|
104
|
+
if (interactionType === 'deep_dive') {
|
|
105
|
+
updates.deepDiveUsed = (data['deepDiveUsed'] ?? 0) + 1;
|
|
106
|
+
}
|
|
107
|
+
else if (interactionType === 'expert_agent') {
|
|
108
|
+
updates.expertAgentUsed = (data['expertAgentUsed'] ?? 0) + 1;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
updates.count = (data['count'] ?? 0) + cost;
|
|
112
|
+
}
|
|
113
|
+
tx.update(docRef, updates);
|
|
114
|
+
return updates.count ?? data['count'] ?? 0;
|
|
115
|
+
});
|
|
116
|
+
return newCount;
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
// If Firestore is unavailable, fail open
|
|
120
|
+
console.error(`[trialTracker] Firestore write failed for ${userId}:`, err.message);
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Check if a trial user is allowed to make an API call.
|
|
126
|
+
* Checks the appropriate credit pool based on interactionType.
|
|
127
|
+
*
|
|
128
|
+
* @param userId - The user identifier
|
|
129
|
+
* @param interactionType - Which pool to check: 'search' (50 tokens), 'deep_dive' (1 free), 'expert_agent' (2 free)
|
|
130
|
+
*/
|
|
131
|
+
export async function checkTrialLimit(userId, interactionType = 'search') {
|
|
132
|
+
const usage = await getTrialUsage(userId);
|
|
133
|
+
if (interactionType === 'deep_dive') {
|
|
134
|
+
const remaining = Math.max(0, DEEP_DIVE_TRIAL_LIMIT - usage.deepDiveUsed);
|
|
135
|
+
return {
|
|
136
|
+
allowed: usage.deepDiveUsed < DEEP_DIVE_TRIAL_LIMIT,
|
|
137
|
+
count: usage.deepDiveUsed,
|
|
138
|
+
remaining,
|
|
139
|
+
limit: DEEP_DIVE_TRIAL_LIMIT,
|
|
140
|
+
shouldWarn: false, // Only 1 credit — no point warning
|
|
141
|
+
pool: 'deep_dive',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
if (interactionType === 'expert_agent') {
|
|
145
|
+
const remaining = Math.max(0, EXPERT_AGENT_TRIAL_LIMIT - usage.expertAgentUsed);
|
|
146
|
+
return {
|
|
147
|
+
allowed: usage.expertAgentUsed < EXPERT_AGENT_TRIAL_LIMIT,
|
|
148
|
+
count: usage.expertAgentUsed,
|
|
149
|
+
remaining,
|
|
150
|
+
limit: EXPERT_AGENT_TRIAL_LIMIT,
|
|
151
|
+
shouldWarn: remaining === 1,
|
|
152
|
+
pool: 'expert_agent',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
// Default: search token pool
|
|
156
|
+
const remaining = Math.max(0, PER_USER_TRIAL_LIMIT - usage.count);
|
|
157
|
+
return {
|
|
158
|
+
allowed: usage.count < PER_USER_TRIAL_LIMIT,
|
|
159
|
+
count: usage.count,
|
|
160
|
+
remaining,
|
|
161
|
+
limit: PER_USER_TRIAL_LIMIT,
|
|
162
|
+
shouldWarn: remaining > 0 && remaining < WARNING_THRESHOLD,
|
|
163
|
+
pool: 'search',
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
// Helpers
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
/**
|
|
170
|
+
* Sanitize a userId for use as a Firestore document ID.
|
|
171
|
+
* Firestore doc IDs cannot contain '/' and should be reasonable length.
|
|
172
|
+
*/
|
|
173
|
+
function sanitizeDocId(userId) {
|
|
174
|
+
return userId
|
|
175
|
+
.replace(/[\/\.+\s]/g, '_') // Replace /, ., +, whitespace with _
|
|
176
|
+
.replace(/__+/g, '_') // Collapse multiple underscores
|
|
177
|
+
.substring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AoB;QAC3B,UAAU,EAAE,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,iBAAiB;QAC1D,IAAI,EAAE,QAAQ;KACjB,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;GAGG;AACH,SAAS,aAAa,CAAC,MAAc;IACjC,OAAO,MAAM;SACR,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAE,qCAAqC;SACjE,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAS,gCAAgC;SAC7D,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,MAAM,WAAW,YAAa,SAAQ,IAAI;IACxC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,O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AAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
package/dist/verify_hmac.js
CHANGED
|
@@ -22,7 +22,7 @@ async function runTest() {
|
|
|
22
22
|
// Hex 1: Public Endpoint (Should pass without signature)
|
|
23
23
|
console.log('\n--- Test 1: Public Endpoint (No Signature) ---');
|
|
24
24
|
try {
|
|
25
|
-
const res1 = await axios.get(`${baseURL}/
|
|
25
|
+
const res1 = await axios.get(`${baseURL}/health`);
|
|
26
26
|
console.log('✅ Passed: Public endpoint accessible (Status:', res1.status, ')');
|
|
27
27
|
}
|
|
28
28
|
catch (e) {
|
package/dist/verify_hmac.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify_hmac.js","sourceRoot":"","sources":["../src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C;IAEL,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;YAAS,CAAC;QACP,GAAG,CAAC,IAAI,EAAE,CAAC;IACf,CAAC;AACL,CAAC;AAED,OAAO,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { spawn } from 'child_process';
|
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { MCP_SERVER_VERSION } from './tools.js';
|
|
4
4
|
async function runTest() {
|
|
5
|
-
console.log('Starting Fodda MCP server verification for /
|
|
5
|
+
console.log('Starting Fodda MCP server verification for /health endpoint...');
|
|
6
6
|
const mcp = spawn('node', ['dist/index.js'], {
|
|
7
7
|
env: { ...process.env, PORT: '3000' }
|
|
8
8
|
});
|
|
@@ -11,16 +11,16 @@ async function runTest() {
|
|
|
11
11
|
// Allow server time to start
|
|
12
12
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
13
13
|
try {
|
|
14
|
-
const response = await axios.get('http://localhost:3000/
|
|
14
|
+
const response = await axios.get('http://localhost:3000/health');
|
|
15
15
|
console.log('✅ Response Code:', response.status);
|
|
16
|
-
console.log('✅
|
|
16
|
+
console.log('✅ Health Status:', response.data.status);
|
|
17
17
|
console.log('✅ Server Version:', response.data.version);
|
|
18
18
|
if (response.data.version !== MCP_SERVER_VERSION) {
|
|
19
19
|
console.error(`❌ Version Mismatch: Expected ${MCP_SERVER_VERSION}, got ${response.data.version}`);
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
|
-
if (response.data.
|
|
23
|
-
console.error('❌ Expected
|
|
22
|
+
if (response.data.status !== 'ok') {
|
|
23
|
+
console.error('❌ Expected status ok, got ' + response.data.status);
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
}
|