keyring-agent-core 0.2.38 → 0.2.40
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/index.d.ts +51 -1
- package/dist/index.js +43 -42
- package/dist/index.native.js +132 -131
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1574,6 +1574,8 @@ declare class Subagent {
|
|
|
1574
1574
|
constructor(params: SubagentParams);
|
|
1575
1575
|
/** Card shown to the router for selection. */
|
|
1576
1576
|
getCard(): SubagentCard;
|
|
1577
|
+
/** True when this subagent is allowed to invoke the named tool. */
|
|
1578
|
+
ownsTool(toolName: string): boolean;
|
|
1577
1579
|
/** Only the tools this subagent owns, resolved from the shared registry. */
|
|
1578
1580
|
private getTools;
|
|
1579
1581
|
run(task: SubagentTask, conversationHistory: ChatMessage[], userContext?: UserContext): Promise<SubagentResult>;
|
|
@@ -1775,6 +1777,33 @@ declare class AgentCore {
|
|
|
1775
1777
|
invokeTool(name: string, args: Record<string, unknown>, options?: {
|
|
1776
1778
|
userMessage?: string;
|
|
1777
1779
|
}): Promise<AgentResponse>;
|
|
1780
|
+
/**
|
|
1781
|
+
* Fast path: execute ONE known tool with structured args, then run the SAME
|
|
1782
|
+
* synthesise → finalise flow as {@link chat} — but skip the rewrite / KB /
|
|
1783
|
+
* router / subagent-ReAct stages entirely.
|
|
1784
|
+
*
|
|
1785
|
+
* Use this when the FE already knows EXACTLY which tool to call and has the
|
|
1786
|
+
* args (e.g. a token-info screen that always calls `get-token-info`). Versus
|
|
1787
|
+
* `chat()` it saves ~3-4 LLM calls (no rewrite, no router, no per-tool ReAct
|
|
1788
|
+
* reasoning) and removes the risk of the LLM mis-parsing args, while still
|
|
1789
|
+
* turning the raw tool DATA into a natural-language answer (+ suggestions,
|
|
1790
|
+
* uiActions, actionButtons) so the FE renders it exactly like a chat turn.
|
|
1791
|
+
*
|
|
1792
|
+
* Differs from {@link invokeTool}: invokeTool returns the tool's own `summary`
|
|
1793
|
+
* (+ UI) with NO LLM pass — right for action/UI tools (forms, redirects).
|
|
1794
|
+
* runTool LLM-synthesises the tool data into prose — right for DATA tools like
|
|
1795
|
+
* `get-token-info` whose result has no `summary` field.
|
|
1796
|
+
*
|
|
1797
|
+
* `options.userMessage` is the natural-language question recorded in history
|
|
1798
|
+
* and fed to the synthesiser (it drives the answer wording + language). Pass
|
|
1799
|
+
* the user's actual question when you have it.
|
|
1800
|
+
*/
|
|
1801
|
+
runTool(name: string, args: Record<string, unknown>, options?: {
|
|
1802
|
+
userMessage?: string;
|
|
1803
|
+
generateSuggestions?: boolean;
|
|
1804
|
+
language?: string;
|
|
1805
|
+
signal?: AbortSignal;
|
|
1806
|
+
}): Promise<AgentResponse>;
|
|
1778
1807
|
/**
|
|
1779
1808
|
* Register the host's inline x402 signer and turn on transparent x402. When
|
|
1780
1809
|
* set, ANY ApiClient call (every service/tool uses it) that returns 402 makes
|
|
@@ -1937,6 +1966,13 @@ declare class AgentCore {
|
|
|
1937
1966
|
* Synthesizer can consume. The `finalAnswer` here is a compact
|
|
1938
1967
|
* concatenation of each subagent's own answer, labelled by name.
|
|
1939
1968
|
*/
|
|
1969
|
+
/**
|
|
1970
|
+
* Synthesiser-input history: the working window with the trailing user message
|
|
1971
|
+
* dropped (the query is passed separately) and tool messages stripped (the
|
|
1972
|
+
* synthesiser declares no tools). Shared by the chat graph's synthesize node
|
|
1973
|
+
* and {@link runTool}.
|
|
1974
|
+
*/
|
|
1975
|
+
private synthesiserHistory;
|
|
1940
1976
|
private mergeTrace;
|
|
1941
1977
|
private finaliseAnswer;
|
|
1942
1978
|
private generateSuggestions;
|
|
@@ -3723,6 +3759,12 @@ declare class TokenInfoTool extends BaseTool {
|
|
|
3723
3759
|
private llm;
|
|
3724
3760
|
constructor(config?: TokenInfoToolConfig);
|
|
3725
3761
|
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
3762
|
+
_instructions: string;
|
|
3763
|
+
keyword: string;
|
|
3764
|
+
token: null;
|
|
3765
|
+
userHoldsToken: boolean;
|
|
3766
|
+
research: string | null;
|
|
3767
|
+
} | {
|
|
3726
3768
|
research: string | null;
|
|
3727
3769
|
searchResults?: TokenMetadata[] | undefined;
|
|
3728
3770
|
_instructions: string;
|
|
@@ -3733,6 +3775,14 @@ declare class TokenInfoTool extends BaseTool {
|
|
|
3733
3775
|
} | {
|
|
3734
3776
|
error: string;
|
|
3735
3777
|
}>;
|
|
3778
|
+
/**
|
|
3779
|
+
* Fallback for when the connected/requested chain isn't supported: skip the
|
|
3780
|
+
* chain-bound data sources (Pantograph search, Moralis metadata, wallet
|
|
3781
|
+
* holdings) and answer purely from Gemini's Google-Search-grounded research,
|
|
3782
|
+
* which is chain-agnostic. Returns the same `research` shape the synthesizer
|
|
3783
|
+
* already knows how to fold into a reply.
|
|
3784
|
+
*/
|
|
3785
|
+
private researchTokenChainAgnostic;
|
|
3736
3786
|
private searchToken;
|
|
3737
3787
|
private askGeminiWithSearch;
|
|
3738
3788
|
private findTokenInWallet;
|
|
@@ -7543,7 +7593,7 @@ declare function createX402SignatureProvider(opts: {
|
|
|
7543
7593
|
*/
|
|
7544
7594
|
|
|
7545
7595
|
interface PantographServiceConfig {
|
|
7546
|
-
/** Pantograph API base URL (default: https://
|
|
7596
|
+
/** Pantograph API base URL (default: https://wallet-api.pantograph.app) */
|
|
7547
7597
|
baseUrl?: string;
|
|
7548
7598
|
}
|
|
7549
7599
|
/** Maps hex chain ID → Pantograph chain name */
|