@pgnio/helios-mcp 0.2.2 → 0.2.4
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/dist/chunk-52XY4KRG.mjs +3038 -0
- package/dist/chunk-UYCUR7QV.mjs +2994 -0
- package/dist/cli.js +49 -7
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +59 -9
- package/dist/index.mjs +11 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -220,7 +220,9 @@ var marketSnapshotResolvedScopeSchema = import_zod.z.enum(["selected", "all", "e
|
|
|
220
220
|
var marketSnapshotValueSchema = import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()]);
|
|
221
221
|
var marketSnapshotInputSchema = import_zod.z.object({
|
|
222
222
|
scope: marketSnapshotScopeSchema.optional(),
|
|
223
|
-
symbols: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional()
|
|
223
|
+
symbols: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
|
|
224
|
+
fields: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional().describe("Table columns to return; sym and base always come back. Ids: rank, lp, bv, qv, ts, r1m, r3m, r5m, r15m, r30m, r1h, r2h, r4h, r6h, r8h, r12h, r24h, r3d, r7d, hmi, hmiv, reg, ob, de, hfi, ar, ms, vcc, vcp, obosd, obosp, vwap, vwz, poc, pocd, vap, macdh, macds, macdd, srs, srr, sr, az, hfiw, trv, tri, trh, hs."),
|
|
225
|
+
sort: import_zod.z.enum(["rank"]).optional().describe('"rank" orders rows by market cap rank, unranked last.')
|
|
224
226
|
});
|
|
225
227
|
var marketSnapshotChunkInputSchema = marketSnapshotInputSchema.extend({
|
|
226
228
|
offset: import_zod.z.number().int().nonnegative().optional(),
|
|
@@ -1423,6 +1425,46 @@ function asPending(login) {
|
|
|
1423
1425
|
}
|
|
1424
1426
|
|
|
1425
1427
|
// src/market-service.ts
|
|
1428
|
+
var DEFAULT_SNAPSHOT_TOP = 50;
|
|
1429
|
+
var DEFAULT_SNAPSHOT_FIELDS = [
|
|
1430
|
+
// Price, size and returns.
|
|
1431
|
+
"rank",
|
|
1432
|
+
"lp",
|
|
1433
|
+
"qv",
|
|
1434
|
+
"r15m",
|
|
1435
|
+
"r1h",
|
|
1436
|
+
"r4h",
|
|
1437
|
+
"r24h",
|
|
1438
|
+
"r7d",
|
|
1439
|
+
// Regime and momentum turn: the one edge that held out of sample is buying a sharp turn up in a BREAKDOWN/CRASH coin.
|
|
1440
|
+
"reg",
|
|
1441
|
+
"hmi",
|
|
1442
|
+
"hmiv",
|
|
1443
|
+
"hs",
|
|
1444
|
+
// Stretch and location: fades beat chases in the wallet research.
|
|
1445
|
+
"ob",
|
|
1446
|
+
"obosp",
|
|
1447
|
+
"de",
|
|
1448
|
+
"ms",
|
|
1449
|
+
"srs",
|
|
1450
|
+
"srr",
|
|
1451
|
+
"vwz",
|
|
1452
|
+
"tri"
|
|
1453
|
+
];
|
|
1454
|
+
function withSnapshotDefaults(input) {
|
|
1455
|
+
return {
|
|
1456
|
+
...input,
|
|
1457
|
+
fields: input.fields ?? [...DEFAULT_SNAPSHOT_FIELDS],
|
|
1458
|
+
sort: input.sort ?? "rank"
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1461
|
+
function topOfSnapshot(snapshot, input, top = DEFAULT_SNAPSHOT_TOP) {
|
|
1462
|
+
if (input.symbols?.length || snapshot.table.rows.length <= top) return snapshot;
|
|
1463
|
+
const baseIndex = snapshot.table.fieldIds.indexOf("base");
|
|
1464
|
+
const rows = snapshot.table.rows.slice(0, top);
|
|
1465
|
+
const returnedSymbols = baseIndex === -1 ? snapshot.returnedSymbols.slice(0, top) : rows.map((row) => String(row[baseIndex]));
|
|
1466
|
+
return { ...snapshot, symbolCount: rows.length, returnedSymbols, table: { ...snapshot.table, rows } };
|
|
1467
|
+
}
|
|
1426
1468
|
var HeliosAgentMcpMarketService = class {
|
|
1427
1469
|
constructor(options) {
|
|
1428
1470
|
__publicField(this, "authService");
|
|
@@ -1445,7 +1487,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1445
1487
|
}
|
|
1446
1488
|
const session = await this.authService.requireSession();
|
|
1447
1489
|
try {
|
|
1448
|
-
const snapshot = await this.dataBridgeClient.getMarketSnapshot(session.accessToken, input);
|
|
1490
|
+
const snapshot = topOfSnapshot(await this.dataBridgeClient.getMarketSnapshot(session.accessToken, withSnapshotDefaults(input)), input);
|
|
1449
1491
|
return {
|
|
1450
1492
|
status: "connected",
|
|
1451
1493
|
connected: true,
|
|
@@ -1457,7 +1499,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1457
1499
|
error,
|
|
1458
1500
|
loginOptions,
|
|
1459
1501
|
retry: async (accessToken) => {
|
|
1460
|
-
const snapshot = await this.dataBridgeClient.getMarketSnapshot(accessToken, input);
|
|
1502
|
+
const snapshot = topOfSnapshot(await this.dataBridgeClient.getMarketSnapshot(accessToken, withSnapshotDefaults(input)), input);
|
|
1461
1503
|
return {
|
|
1462
1504
|
status: "connected",
|
|
1463
1505
|
connected: true,
|
|
@@ -1486,7 +1528,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1486
1528
|
}
|
|
1487
1529
|
const session = await this.authService.requireSession();
|
|
1488
1530
|
try {
|
|
1489
|
-
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(session.accessToken, input);
|
|
1531
|
+
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(session.accessToken, withSnapshotDefaults(input));
|
|
1490
1532
|
return {
|
|
1491
1533
|
status: "connected",
|
|
1492
1534
|
connected: true,
|
|
@@ -1498,7 +1540,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1498
1540
|
error,
|
|
1499
1541
|
loginOptions,
|
|
1500
1542
|
retry: async (accessToken) => {
|
|
1501
|
-
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(accessToken, input);
|
|
1543
|
+
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(accessToken, withSnapshotDefaults(input));
|
|
1502
1544
|
return {
|
|
1503
1545
|
status: "connected",
|
|
1504
1546
|
connected: true,
|
|
@@ -2567,7 +2609,7 @@ function createHeliosMarketToolDefinitions(service) {
|
|
|
2567
2609
|
{
|
|
2568
2610
|
name: "helios_market_get_snapshot",
|
|
2569
2611
|
title: "Get Helios Market Snapshot",
|
|
2570
|
-
description: "Returns a compact market snapshot for the selected, all, or explicitly requested symbols.",
|
|
2612
|
+
description: "Returns a compact market snapshot for the selected, all, or explicitly requested symbols. By default: the top 50 coins by market cap with the main columns; name symbols to get other coins, pass fields for other columns.",
|
|
2571
2613
|
inputSchema: marketSnapshotInputSchema,
|
|
2572
2614
|
async execute(input) {
|
|
2573
2615
|
const result = marketSnapshotToolOutputSchema.parse(await service.getSnapshot(input));
|
|
@@ -2835,7 +2877,7 @@ async function createHeliosAgentMcpServer(options) {
|
|
|
2835
2877
|
const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2836
2878
|
const server = new McpServer({
|
|
2837
2879
|
name: "helios",
|
|
2838
|
-
version: "0.2.
|
|
2880
|
+
version: "0.2.4"
|
|
2839
2881
|
});
|
|
2840
2882
|
const sessionStore = options.sessionStore ?? new FileAgentSessionStore(options.sessionPath ?? getDefaultHeliosAgentMcpSessionPath());
|
|
2841
2883
|
const client = new HeliosAgentAuthClient({
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -206,6 +206,10 @@ declare const marketSnapshotInputSchema: z.ZodObject<{
|
|
|
206
206
|
all: "all";
|
|
207
207
|
}>>;
|
|
208
208
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
209
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
210
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
211
|
+
rank: "rank";
|
|
212
|
+
}>>;
|
|
209
213
|
}, z.core.$strip>;
|
|
210
214
|
declare const marketSnapshotChunkInputSchema: z.ZodObject<{
|
|
211
215
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
@@ -213,6 +217,10 @@ declare const marketSnapshotChunkInputSchema: z.ZodObject<{
|
|
|
213
217
|
all: "all";
|
|
214
218
|
}>>;
|
|
215
219
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
rank: "rank";
|
|
223
|
+
}>>;
|
|
216
224
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
217
225
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
218
226
|
}, z.core.$strip>;
|
|
@@ -945,6 +953,17 @@ type MarketSymbolDetailResult = {
|
|
|
945
953
|
connected: false;
|
|
946
954
|
message: string;
|
|
947
955
|
} & StartLoginResult);
|
|
956
|
+
/** Coins in a default snapshot: the top ones by market cap. Asking for symbols by name returns exactly those. */
|
|
957
|
+
declare const DEFAULT_SNAPSHOT_TOP = 50;
|
|
958
|
+
/**
|
|
959
|
+
* Columns an agent gets when it doesn't pass `fields`: price, volume, the main returns and the core Helios indicators.
|
|
960
|
+
* The full table (~50 columns) is too much context for most models; `fields` still reaches every column.
|
|
961
|
+
*/
|
|
962
|
+
declare const DEFAULT_SNAPSHOT_FIELDS: readonly string[];
|
|
963
|
+
/** Fills in the default columns and market cap order unless the agent chose its own. */
|
|
964
|
+
declare function withSnapshotDefaults<T extends MarketSnapshotInput>(input: T): T;
|
|
965
|
+
/** A ranked snapshot cut to its top coins, unless the agent named its symbols. */
|
|
966
|
+
declare function topOfSnapshot(snapshot: MarketSnapshot, input: MarketSnapshotInput, top?: number): MarketSnapshot;
|
|
948
967
|
declare class HeliosAgentMcpMarketService {
|
|
949
968
|
private readonly authService;
|
|
950
969
|
private readonly dataBridgeClient;
|
|
@@ -1457,10 +1476,16 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1457
1476
|
all: "all";
|
|
1458
1477
|
}>>;
|
|
1459
1478
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1479
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1480
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
1481
|
+
rank: "rank";
|
|
1482
|
+
}>>;
|
|
1460
1483
|
}, z.core.$strip>;
|
|
1461
1484
|
execute(input: {
|
|
1462
1485
|
scope?: "selected" | "all" | undefined;
|
|
1463
1486
|
symbols?: string[] | undefined;
|
|
1487
|
+
fields?: string[] | undefined;
|
|
1488
|
+
sort?: "rank" | undefined;
|
|
1464
1489
|
}): Promise<{
|
|
1465
1490
|
content: {
|
|
1466
1491
|
type: "text";
|
|
@@ -1497,12 +1522,18 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1497
1522
|
all: "all";
|
|
1498
1523
|
}>>;
|
|
1499
1524
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1525
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1526
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
1527
|
+
rank: "rank";
|
|
1528
|
+
}>>;
|
|
1500
1529
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
1501
1530
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1502
1531
|
}, z.core.$strip>;
|
|
1503
1532
|
execute(input: {
|
|
1504
1533
|
scope?: "selected" | "all" | undefined;
|
|
1505
1534
|
symbols?: string[] | undefined;
|
|
1535
|
+
fields?: string[] | undefined;
|
|
1536
|
+
sort?: "rank" | undefined;
|
|
1506
1537
|
offset?: number | undefined;
|
|
1507
1538
|
limit?: number | undefined;
|
|
1508
1539
|
}): Promise<{
|
|
@@ -2147,4 +2178,4 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2147
2178
|
}>;
|
|
2148
2179
|
}];
|
|
2149
2180
|
|
|
2150
|
-
export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CreateHeliosAgentMcpServerOptions, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, type GetHeliosAgentMcpDocumentInput, HOSTED_RECONNECT_MESSAGE, HeliosAgentMcpAccountService, type HeliosAgentMcpAccountServiceOptions, HeliosAgentMcpAuthService, type HeliosAgentMcpAuthServiceOptions, type HeliosAgentMcpDocsIndex, type HeliosAgentMcpDocsIndexEntry, HeliosAgentMcpDocsService, type HeliosAgentMcpDocsServiceOptions, type HeliosAgentMcpDocument, HeliosAgentMcpLedgerService, type HeliosAgentMcpLedgerServiceOptions, HeliosAgentMcpMarketService, type HeliosAgentMcpMarketServiceOptions, HeliosAgentMcpProviderService, type HeliosAgentMcpProviderServiceOptions, HeliosAgentMcpTradingService, type HeliosAgentMcpTradingServiceOptions, type HeliosMcpToolDefinition, type HeliosMcpToolResult, type LedgerFillsResult, type LedgerSummaryResult, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, pendingAgentLoginSchema, retryAfterUnauthorizedRefresh, toolAnnotations, withDataText };
|
|
2181
|
+
export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CreateHeliosAgentMcpServerOptions, DEFAULT_SNAPSHOT_FIELDS, DEFAULT_SNAPSHOT_TOP, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, type GetHeliosAgentMcpDocumentInput, HOSTED_RECONNECT_MESSAGE, HeliosAgentMcpAccountService, type HeliosAgentMcpAccountServiceOptions, HeliosAgentMcpAuthService, type HeliosAgentMcpAuthServiceOptions, type HeliosAgentMcpDocsIndex, type HeliosAgentMcpDocsIndexEntry, HeliosAgentMcpDocsService, type HeliosAgentMcpDocsServiceOptions, type HeliosAgentMcpDocument, HeliosAgentMcpLedgerService, type HeliosAgentMcpLedgerServiceOptions, HeliosAgentMcpMarketService, type HeliosAgentMcpMarketServiceOptions, HeliosAgentMcpProviderService, type HeliosAgentMcpProviderServiceOptions, HeliosAgentMcpTradingService, type HeliosAgentMcpTradingServiceOptions, type HeliosMcpToolDefinition, type HeliosMcpToolResult, type LedgerFillsResult, type LedgerSummaryResult, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, pendingAgentLoginSchema, retryAfterUnauthorizedRefresh, toolAnnotations, topOfSnapshot, withDataText, withSnapshotDefaults };
|
package/dist/index.d.ts
CHANGED
|
@@ -206,6 +206,10 @@ declare const marketSnapshotInputSchema: z.ZodObject<{
|
|
|
206
206
|
all: "all";
|
|
207
207
|
}>>;
|
|
208
208
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
209
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
210
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
211
|
+
rank: "rank";
|
|
212
|
+
}>>;
|
|
209
213
|
}, z.core.$strip>;
|
|
210
214
|
declare const marketSnapshotChunkInputSchema: z.ZodObject<{
|
|
211
215
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
@@ -213,6 +217,10 @@ declare const marketSnapshotChunkInputSchema: z.ZodObject<{
|
|
|
213
217
|
all: "all";
|
|
214
218
|
}>>;
|
|
215
219
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
220
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
rank: "rank";
|
|
223
|
+
}>>;
|
|
216
224
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
217
225
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
218
226
|
}, z.core.$strip>;
|
|
@@ -945,6 +953,17 @@ type MarketSymbolDetailResult = {
|
|
|
945
953
|
connected: false;
|
|
946
954
|
message: string;
|
|
947
955
|
} & StartLoginResult);
|
|
956
|
+
/** Coins in a default snapshot: the top ones by market cap. Asking for symbols by name returns exactly those. */
|
|
957
|
+
declare const DEFAULT_SNAPSHOT_TOP = 50;
|
|
958
|
+
/**
|
|
959
|
+
* Columns an agent gets when it doesn't pass `fields`: price, volume, the main returns and the core Helios indicators.
|
|
960
|
+
* The full table (~50 columns) is too much context for most models; `fields` still reaches every column.
|
|
961
|
+
*/
|
|
962
|
+
declare const DEFAULT_SNAPSHOT_FIELDS: readonly string[];
|
|
963
|
+
/** Fills in the default columns and market cap order unless the agent chose its own. */
|
|
964
|
+
declare function withSnapshotDefaults<T extends MarketSnapshotInput>(input: T): T;
|
|
965
|
+
/** A ranked snapshot cut to its top coins, unless the agent named its symbols. */
|
|
966
|
+
declare function topOfSnapshot(snapshot: MarketSnapshot, input: MarketSnapshotInput, top?: number): MarketSnapshot;
|
|
948
967
|
declare class HeliosAgentMcpMarketService {
|
|
949
968
|
private readonly authService;
|
|
950
969
|
private readonly dataBridgeClient;
|
|
@@ -1457,10 +1476,16 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1457
1476
|
all: "all";
|
|
1458
1477
|
}>>;
|
|
1459
1478
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1479
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1480
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
1481
|
+
rank: "rank";
|
|
1482
|
+
}>>;
|
|
1460
1483
|
}, z.core.$strip>;
|
|
1461
1484
|
execute(input: {
|
|
1462
1485
|
scope?: "selected" | "all" | undefined;
|
|
1463
1486
|
symbols?: string[] | undefined;
|
|
1487
|
+
fields?: string[] | undefined;
|
|
1488
|
+
sort?: "rank" | undefined;
|
|
1464
1489
|
}): Promise<{
|
|
1465
1490
|
content: {
|
|
1466
1491
|
type: "text";
|
|
@@ -1497,12 +1522,18 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1497
1522
|
all: "all";
|
|
1498
1523
|
}>>;
|
|
1499
1524
|
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1525
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1526
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
1527
|
+
rank: "rank";
|
|
1528
|
+
}>>;
|
|
1500
1529
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
1501
1530
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1502
1531
|
}, z.core.$strip>;
|
|
1503
1532
|
execute(input: {
|
|
1504
1533
|
scope?: "selected" | "all" | undefined;
|
|
1505
1534
|
symbols?: string[] | undefined;
|
|
1535
|
+
fields?: string[] | undefined;
|
|
1536
|
+
sort?: "rank" | undefined;
|
|
1506
1537
|
offset?: number | undefined;
|
|
1507
1538
|
limit?: number | undefined;
|
|
1508
1539
|
}): Promise<{
|
|
@@ -2147,4 +2178,4 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2147
2178
|
}>;
|
|
2148
2179
|
}];
|
|
2149
2180
|
|
|
2150
|
-
export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CreateHeliosAgentMcpServerOptions, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, type GetHeliosAgentMcpDocumentInput, HOSTED_RECONNECT_MESSAGE, HeliosAgentMcpAccountService, type HeliosAgentMcpAccountServiceOptions, HeliosAgentMcpAuthService, type HeliosAgentMcpAuthServiceOptions, type HeliosAgentMcpDocsIndex, type HeliosAgentMcpDocsIndexEntry, HeliosAgentMcpDocsService, type HeliosAgentMcpDocsServiceOptions, type HeliosAgentMcpDocument, HeliosAgentMcpLedgerService, type HeliosAgentMcpLedgerServiceOptions, HeliosAgentMcpMarketService, type HeliosAgentMcpMarketServiceOptions, HeliosAgentMcpProviderService, type HeliosAgentMcpProviderServiceOptions, HeliosAgentMcpTradingService, type HeliosAgentMcpTradingServiceOptions, type HeliosMcpToolDefinition, type HeliosMcpToolResult, type LedgerFillsResult, type LedgerSummaryResult, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, pendingAgentLoginSchema, retryAfterUnauthorizedRefresh, toolAnnotations, withDataText };
|
|
2181
|
+
export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CreateHeliosAgentMcpServerOptions, DEFAULT_SNAPSHOT_FIELDS, DEFAULT_SNAPSHOT_TOP, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, type GetHeliosAgentMcpDocumentInput, HOSTED_RECONNECT_MESSAGE, HeliosAgentMcpAccountService, type HeliosAgentMcpAccountServiceOptions, HeliosAgentMcpAuthService, type HeliosAgentMcpAuthServiceOptions, type HeliosAgentMcpDocsIndex, type HeliosAgentMcpDocsIndexEntry, HeliosAgentMcpDocsService, type HeliosAgentMcpDocsServiceOptions, type HeliosAgentMcpDocument, HeliosAgentMcpLedgerService, type HeliosAgentMcpLedgerServiceOptions, HeliosAgentMcpMarketService, type HeliosAgentMcpMarketServiceOptions, HeliosAgentMcpProviderService, type HeliosAgentMcpProviderServiceOptions, HeliosAgentMcpTradingService, type HeliosAgentMcpTradingServiceOptions, type HeliosMcpToolDefinition, type HeliosMcpToolResult, type LedgerFillsResult, type LedgerSummaryResult, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, pendingAgentLoginSchema, retryAfterUnauthorizedRefresh, toolAnnotations, topOfSnapshot, withDataText, withSnapshotDefaults };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
var index_exports = {};
|
|
34
34
|
__export(index_exports, {
|
|
35
|
+
DEFAULT_SNAPSHOT_FIELDS: () => DEFAULT_SNAPSHOT_FIELDS,
|
|
36
|
+
DEFAULT_SNAPSHOT_TOP: () => DEFAULT_SNAPSHOT_TOP,
|
|
35
37
|
FileAgentSessionStore: () => FileAgentSessionStore,
|
|
36
38
|
HOSTED_RECONNECT_MESSAGE: () => HOSTED_RECONNECT_MESSAGE,
|
|
37
39
|
HeliosAgentMcpAccountService: () => HeliosAgentMcpAccountService,
|
|
@@ -56,7 +58,9 @@ __export(index_exports, {
|
|
|
56
58
|
pendingAgentLoginSchema: () => pendingAgentLoginSchema,
|
|
57
59
|
retryAfterUnauthorizedRefresh: () => retryAfterUnauthorizedRefresh,
|
|
58
60
|
toolAnnotations: () => toolAnnotations,
|
|
59
|
-
|
|
61
|
+
topOfSnapshot: () => topOfSnapshot,
|
|
62
|
+
withDataText: () => withDataText,
|
|
63
|
+
withSnapshotDefaults: () => withSnapshotDefaults
|
|
60
64
|
});
|
|
61
65
|
module.exports = __toCommonJS(index_exports);
|
|
62
66
|
|
|
@@ -255,7 +259,9 @@ var marketSnapshotResolvedScopeSchema = import_zod.z.enum(["selected", "all", "e
|
|
|
255
259
|
var marketSnapshotValueSchema = import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()]);
|
|
256
260
|
var marketSnapshotInputSchema = import_zod.z.object({
|
|
257
261
|
scope: marketSnapshotScopeSchema.optional(),
|
|
258
|
-
symbols: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional()
|
|
262
|
+
symbols: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
|
|
263
|
+
fields: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional().describe("Table columns to return; sym and base always come back. Ids: rank, lp, bv, qv, ts, r1m, r3m, r5m, r15m, r30m, r1h, r2h, r4h, r6h, r8h, r12h, r24h, r3d, r7d, hmi, hmiv, reg, ob, de, hfi, ar, ms, vcc, vcp, obosd, obosp, vwap, vwz, poc, pocd, vap, macdh, macds, macdd, srs, srr, sr, az, hfiw, trv, tri, trh, hs."),
|
|
264
|
+
sort: import_zod.z.enum(["rank"]).optional().describe('"rank" orders rows by market cap rank, unranked last.')
|
|
259
265
|
});
|
|
260
266
|
var marketSnapshotChunkInputSchema = marketSnapshotInputSchema.extend({
|
|
261
267
|
offset: import_zod.z.number().int().nonnegative().optional(),
|
|
@@ -1458,6 +1464,46 @@ function asPending(login) {
|
|
|
1458
1464
|
}
|
|
1459
1465
|
|
|
1460
1466
|
// src/market-service.ts
|
|
1467
|
+
var DEFAULT_SNAPSHOT_TOP = 50;
|
|
1468
|
+
var DEFAULT_SNAPSHOT_FIELDS = [
|
|
1469
|
+
// Price, size and returns.
|
|
1470
|
+
"rank",
|
|
1471
|
+
"lp",
|
|
1472
|
+
"qv",
|
|
1473
|
+
"r15m",
|
|
1474
|
+
"r1h",
|
|
1475
|
+
"r4h",
|
|
1476
|
+
"r24h",
|
|
1477
|
+
"r7d",
|
|
1478
|
+
// Regime and momentum turn: the one edge that held out of sample is buying a sharp turn up in a BREAKDOWN/CRASH coin.
|
|
1479
|
+
"reg",
|
|
1480
|
+
"hmi",
|
|
1481
|
+
"hmiv",
|
|
1482
|
+
"hs",
|
|
1483
|
+
// Stretch and location: fades beat chases in the wallet research.
|
|
1484
|
+
"ob",
|
|
1485
|
+
"obosp",
|
|
1486
|
+
"de",
|
|
1487
|
+
"ms",
|
|
1488
|
+
"srs",
|
|
1489
|
+
"srr",
|
|
1490
|
+
"vwz",
|
|
1491
|
+
"tri"
|
|
1492
|
+
];
|
|
1493
|
+
function withSnapshotDefaults(input) {
|
|
1494
|
+
return {
|
|
1495
|
+
...input,
|
|
1496
|
+
fields: input.fields ?? [...DEFAULT_SNAPSHOT_FIELDS],
|
|
1497
|
+
sort: input.sort ?? "rank"
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
function topOfSnapshot(snapshot, input, top = DEFAULT_SNAPSHOT_TOP) {
|
|
1501
|
+
if (input.symbols?.length || snapshot.table.rows.length <= top) return snapshot;
|
|
1502
|
+
const baseIndex = snapshot.table.fieldIds.indexOf("base");
|
|
1503
|
+
const rows = snapshot.table.rows.slice(0, top);
|
|
1504
|
+
const returnedSymbols = baseIndex === -1 ? snapshot.returnedSymbols.slice(0, top) : rows.map((row) => String(row[baseIndex]));
|
|
1505
|
+
return { ...snapshot, symbolCount: rows.length, returnedSymbols, table: { ...snapshot.table, rows } };
|
|
1506
|
+
}
|
|
1461
1507
|
var HeliosAgentMcpMarketService = class {
|
|
1462
1508
|
constructor(options) {
|
|
1463
1509
|
__publicField(this, "authService");
|
|
@@ -1480,7 +1526,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1480
1526
|
}
|
|
1481
1527
|
const session = await this.authService.requireSession();
|
|
1482
1528
|
try {
|
|
1483
|
-
const snapshot = await this.dataBridgeClient.getMarketSnapshot(session.accessToken, input);
|
|
1529
|
+
const snapshot = topOfSnapshot(await this.dataBridgeClient.getMarketSnapshot(session.accessToken, withSnapshotDefaults(input)), input);
|
|
1484
1530
|
return {
|
|
1485
1531
|
status: "connected",
|
|
1486
1532
|
connected: true,
|
|
@@ -1492,7 +1538,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1492
1538
|
error,
|
|
1493
1539
|
loginOptions,
|
|
1494
1540
|
retry: async (accessToken) => {
|
|
1495
|
-
const snapshot = await this.dataBridgeClient.getMarketSnapshot(accessToken, input);
|
|
1541
|
+
const snapshot = topOfSnapshot(await this.dataBridgeClient.getMarketSnapshot(accessToken, withSnapshotDefaults(input)), input);
|
|
1496
1542
|
return {
|
|
1497
1543
|
status: "connected",
|
|
1498
1544
|
connected: true,
|
|
@@ -1521,7 +1567,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1521
1567
|
}
|
|
1522
1568
|
const session = await this.authService.requireSession();
|
|
1523
1569
|
try {
|
|
1524
|
-
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(session.accessToken, input);
|
|
1570
|
+
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(session.accessToken, withSnapshotDefaults(input));
|
|
1525
1571
|
return {
|
|
1526
1572
|
status: "connected",
|
|
1527
1573
|
connected: true,
|
|
@@ -1533,7 +1579,7 @@ var HeliosAgentMcpMarketService = class {
|
|
|
1533
1579
|
error,
|
|
1534
1580
|
loginOptions,
|
|
1535
1581
|
retry: async (accessToken) => {
|
|
1536
|
-
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(accessToken, input);
|
|
1582
|
+
const snapshotChunk = await this.dataBridgeClient.getMarketSnapshotChunk(accessToken, withSnapshotDefaults(input));
|
|
1537
1583
|
return {
|
|
1538
1584
|
status: "connected",
|
|
1539
1585
|
connected: true,
|
|
@@ -2636,7 +2682,7 @@ function createHeliosMarketToolDefinitions(service) {
|
|
|
2636
2682
|
{
|
|
2637
2683
|
name: "helios_market_get_snapshot",
|
|
2638
2684
|
title: "Get Helios Market Snapshot",
|
|
2639
|
-
description: "Returns a compact market snapshot for the selected, all, or explicitly requested symbols.",
|
|
2685
|
+
description: "Returns a compact market snapshot for the selected, all, or explicitly requested symbols. By default: the top 50 coins by market cap with the main columns; name symbols to get other coins, pass fields for other columns.",
|
|
2640
2686
|
inputSchema: marketSnapshotInputSchema,
|
|
2641
2687
|
async execute(input) {
|
|
2642
2688
|
const result = marketSnapshotToolOutputSchema.parse(await service.getSnapshot(input));
|
|
@@ -2904,7 +2950,7 @@ async function createHeliosAgentMcpServer(options) {
|
|
|
2904
2950
|
const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2905
2951
|
const server = new McpServer({
|
|
2906
2952
|
name: "helios",
|
|
2907
|
-
version: "0.2.
|
|
2953
|
+
version: "0.2.4"
|
|
2908
2954
|
});
|
|
2909
2955
|
const sessionStore = options.sessionStore ?? new FileAgentSessionStore(options.sessionPath ?? getDefaultHeliosAgentMcpSessionPath());
|
|
2910
2956
|
const client = new HeliosAgentAuthClient({
|
|
@@ -3022,6 +3068,8 @@ function registerTool(server, tool) {
|
|
|
3022
3068
|
}
|
|
3023
3069
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3024
3070
|
0 && (module.exports = {
|
|
3071
|
+
DEFAULT_SNAPSHOT_FIELDS,
|
|
3072
|
+
DEFAULT_SNAPSHOT_TOP,
|
|
3025
3073
|
FileAgentSessionStore,
|
|
3026
3074
|
HOSTED_RECONNECT_MESSAGE,
|
|
3027
3075
|
HeliosAgentMcpAccountService,
|
|
@@ -3046,5 +3094,7 @@ function registerTool(server, tool) {
|
|
|
3046
3094
|
pendingAgentLoginSchema,
|
|
3047
3095
|
retryAfterUnauthorizedRefresh,
|
|
3048
3096
|
toolAnnotations,
|
|
3049
|
-
|
|
3097
|
+
topOfSnapshot,
|
|
3098
|
+
withDataText,
|
|
3099
|
+
withSnapshotDefaults
|
|
3050
3100
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_SNAPSHOT_FIELDS,
|
|
3
|
+
DEFAULT_SNAPSHOT_TOP,
|
|
2
4
|
FileAgentSessionStore,
|
|
3
5
|
HOSTED_RECONNECT_MESSAGE,
|
|
4
6
|
HeliosAgentMcpAccountService,
|
|
@@ -23,9 +25,13 @@ import {
|
|
|
23
25
|
pendingAgentLoginSchema,
|
|
24
26
|
retryAfterUnauthorizedRefresh,
|
|
25
27
|
toolAnnotations,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
topOfSnapshot,
|
|
29
|
+
withDataText,
|
|
30
|
+
withSnapshotDefaults
|
|
31
|
+
} from "./chunk-52XY4KRG.mjs";
|
|
28
32
|
export {
|
|
33
|
+
DEFAULT_SNAPSHOT_FIELDS,
|
|
34
|
+
DEFAULT_SNAPSHOT_TOP,
|
|
29
35
|
FileAgentSessionStore,
|
|
30
36
|
HOSTED_RECONNECT_MESSAGE,
|
|
31
37
|
HeliosAgentMcpAccountService,
|
|
@@ -50,5 +56,7 @@ export {
|
|
|
50
56
|
pendingAgentLoginSchema,
|
|
51
57
|
retryAfterUnauthorizedRefresh,
|
|
52
58
|
toolAnnotations,
|
|
53
|
-
|
|
59
|
+
topOfSnapshot,
|
|
60
|
+
withDataText,
|
|
61
|
+
withSnapshotDefaults
|
|
54
62
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgnio/helios-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Helios MCP server: connect an AI agent to your Helios account to read markets and your portfolio and to trade on Hyperliquid. Most apps can use the hosted URL https://helios.pgn.io/mcp instead.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://helios.pgn.io/?connect=ai",
|