@pgnio/helios-mcp 0.2.1 → 0.2.2
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-XE6HRID3.mjs +2992 -0
- package/dist/cli.js +7 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +11 -4
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2835,7 +2835,7 @@ async function createHeliosAgentMcpServer(options) {
|
|
|
2835
2835
|
const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2836
2836
|
const server = new McpServer({
|
|
2837
2837
|
name: "helios",
|
|
2838
|
-
version: "0.2.
|
|
2838
|
+
version: "0.2.2"
|
|
2839
2839
|
});
|
|
2840
2840
|
const sessionStore = options.sessionStore ?? new FileAgentSessionStore(options.sessionPath ?? getDefaultHeliosAgentMcpSessionPath());
|
|
2841
2841
|
const client = new HeliosAgentAuthClient({
|
|
@@ -2928,6 +2928,11 @@ function toolAnnotations(name) {
|
|
|
2928
2928
|
if (CHANGES_SESSION.test(name)) return { readOnlyHint: false, destructiveHint: false, openWorldHint: false };
|
|
2929
2929
|
return { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
2930
2930
|
}
|
|
2931
|
+
var TEXT_IS_RESULT = /* @__PURE__ */ new Set(["helios_docs_get_document"]);
|
|
2932
|
+
function withDataText(name, content, structuredContent) {
|
|
2933
|
+
if (TEXT_IS_RESULT.has(name)) return content;
|
|
2934
|
+
return [...content, { type: "text", text: JSON.stringify(structuredContent) }];
|
|
2935
|
+
}
|
|
2931
2936
|
function registerTool(server, tool) {
|
|
2932
2937
|
server.registerTool(
|
|
2933
2938
|
tool.name,
|
|
@@ -2940,7 +2945,7 @@ function registerTool(server, tool) {
|
|
|
2940
2945
|
async (input) => {
|
|
2941
2946
|
const result = await tool.execute(tool.inputSchema.parse(input));
|
|
2942
2947
|
return {
|
|
2943
|
-
|
|
2948
|
+
content: withDataText(tool.name, result.content, result.structuredContent),
|
|
2944
2949
|
structuredContent: result.structuredContent
|
|
2945
2950
|
};
|
|
2946
2951
|
}
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1042,6 +1042,18 @@ declare function toolAnnotations(name: string): {
|
|
|
1042
1042
|
destructiveHint: boolean;
|
|
1043
1043
|
openWorldHint: boolean;
|
|
1044
1044
|
};
|
|
1045
|
+
/**
|
|
1046
|
+
* The tool's text plus its data as JSON. Many AI apps (Qwen Code, Cursor, older clients) only hand the model the text
|
|
1047
|
+
* content and drop structuredContent, so without this the agent sees the one-line summary and none of the data. The
|
|
1048
|
+
* MCP spec asks servers to send the JSON as text alongside structured results for exactly this reason.
|
|
1049
|
+
*/
|
|
1050
|
+
declare function withDataText(name: string, content: Array<{
|
|
1051
|
+
type: 'text';
|
|
1052
|
+
text: string;
|
|
1053
|
+
}>, structuredContent: object): Array<{
|
|
1054
|
+
type: 'text';
|
|
1055
|
+
text: string;
|
|
1056
|
+
}>;
|
|
1045
1057
|
|
|
1046
1058
|
interface HeliosMcpToolResult<TStructuredContent extends object> {
|
|
1047
1059
|
content: Array<{
|
|
@@ -2135,4 +2147,4 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2135
2147
|
}>;
|
|
2136
2148
|
}];
|
|
2137
2149
|
|
|
2138
|
-
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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1042,6 +1042,18 @@ declare function toolAnnotations(name: string): {
|
|
|
1042
1042
|
destructiveHint: boolean;
|
|
1043
1043
|
openWorldHint: boolean;
|
|
1044
1044
|
};
|
|
1045
|
+
/**
|
|
1046
|
+
* The tool's text plus its data as JSON. Many AI apps (Qwen Code, Cursor, older clients) only hand the model the text
|
|
1047
|
+
* content and drop structuredContent, so without this the agent sees the one-line summary and none of the data. The
|
|
1048
|
+
* MCP spec asks servers to send the JSON as text alongside structured results for exactly this reason.
|
|
1049
|
+
*/
|
|
1050
|
+
declare function withDataText(name: string, content: Array<{
|
|
1051
|
+
type: 'text';
|
|
1052
|
+
text: string;
|
|
1053
|
+
}>, structuredContent: object): Array<{
|
|
1054
|
+
type: 'text';
|
|
1055
|
+
text: string;
|
|
1056
|
+
}>;
|
|
1045
1057
|
|
|
1046
1058
|
interface HeliosMcpToolResult<TStructuredContent extends object> {
|
|
1047
1059
|
content: Array<{
|
|
@@ -2135,4 +2147,4 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2135
2147
|
}>;
|
|
2136
2148
|
}];
|
|
2137
2149
|
|
|
2138
|
-
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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,8 @@ __export(index_exports, {
|
|
|
55
55
|
getDefaultHeliosAgentMcpSessionPath: () => getDefaultHeliosAgentMcpSessionPath,
|
|
56
56
|
pendingAgentLoginSchema: () => pendingAgentLoginSchema,
|
|
57
57
|
retryAfterUnauthorizedRefresh: () => retryAfterUnauthorizedRefresh,
|
|
58
|
-
toolAnnotations: () => toolAnnotations
|
|
58
|
+
toolAnnotations: () => toolAnnotations,
|
|
59
|
+
withDataText: () => withDataText
|
|
59
60
|
});
|
|
60
61
|
module.exports = __toCommonJS(index_exports);
|
|
61
62
|
|
|
@@ -2903,7 +2904,7 @@ async function createHeliosAgentMcpServer(options) {
|
|
|
2903
2904
|
const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2904
2905
|
const server = new McpServer({
|
|
2905
2906
|
name: "helios",
|
|
2906
|
-
version: "0.2.
|
|
2907
|
+
version: "0.2.2"
|
|
2907
2908
|
});
|
|
2908
2909
|
const sessionStore = options.sessionStore ?? new FileAgentSessionStore(options.sessionPath ?? getDefaultHeliosAgentMcpSessionPath());
|
|
2909
2910
|
const client = new HeliosAgentAuthClient({
|
|
@@ -2996,6 +2997,11 @@ function toolAnnotations(name) {
|
|
|
2996
2997
|
if (CHANGES_SESSION.test(name)) return { readOnlyHint: false, destructiveHint: false, openWorldHint: false };
|
|
2997
2998
|
return { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
2998
2999
|
}
|
|
3000
|
+
var TEXT_IS_RESULT = /* @__PURE__ */ new Set(["helios_docs_get_document"]);
|
|
3001
|
+
function withDataText(name, content, structuredContent) {
|
|
3002
|
+
if (TEXT_IS_RESULT.has(name)) return content;
|
|
3003
|
+
return [...content, { type: "text", text: JSON.stringify(structuredContent) }];
|
|
3004
|
+
}
|
|
2999
3005
|
function registerTool(server, tool) {
|
|
3000
3006
|
server.registerTool(
|
|
3001
3007
|
tool.name,
|
|
@@ -3008,7 +3014,7 @@ function registerTool(server, tool) {
|
|
|
3008
3014
|
async (input) => {
|
|
3009
3015
|
const result = await tool.execute(tool.inputSchema.parse(input));
|
|
3010
3016
|
return {
|
|
3011
|
-
|
|
3017
|
+
content: withDataText(tool.name, result.content, result.structuredContent),
|
|
3012
3018
|
structuredContent: result.structuredContent
|
|
3013
3019
|
};
|
|
3014
3020
|
}
|
|
@@ -3039,5 +3045,6 @@ function registerTool(server, tool) {
|
|
|
3039
3045
|
getDefaultHeliosAgentMcpSessionPath,
|
|
3040
3046
|
pendingAgentLoginSchema,
|
|
3041
3047
|
retryAfterUnauthorizedRefresh,
|
|
3042
|
-
toolAnnotations
|
|
3048
|
+
toolAnnotations,
|
|
3049
|
+
withDataText
|
|
3043
3050
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -22,8 +22,9 @@ import {
|
|
|
22
22
|
getDefaultHeliosAgentMcpSessionPath,
|
|
23
23
|
pendingAgentLoginSchema,
|
|
24
24
|
retryAfterUnauthorizedRefresh,
|
|
25
|
-
toolAnnotations
|
|
26
|
-
|
|
25
|
+
toolAnnotations,
|
|
26
|
+
withDataText
|
|
27
|
+
} from "./chunk-XE6HRID3.mjs";
|
|
27
28
|
export {
|
|
28
29
|
FileAgentSessionStore,
|
|
29
30
|
HOSTED_RECONNECT_MESSAGE,
|
|
@@ -48,5 +49,6 @@ export {
|
|
|
48
49
|
getDefaultHeliosAgentMcpSessionPath,
|
|
49
50
|
pendingAgentLoginSchema,
|
|
50
51
|
retryAfterUnauthorizedRefresh,
|
|
51
|
-
toolAnnotations
|
|
52
|
+
toolAnnotations,
|
|
53
|
+
withDataText
|
|
52
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgnio/helios-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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",
|