@vultisig/cli 0.24.1 → 0.26.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/CHANGELOG.md +52 -0
- package/dist/index.js +155 -134
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @vultisig/cli
|
|
2
2
|
|
|
3
|
+
## 0.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#507](https://github.com/vultisig/vultisig-sdk/pull/507) [`cb80440`](https://github.com/vultisig/vultisig-sdk/commit/cb804408b9607aacb143a7a941f0f9f1986f2379) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Add SwapKit as a configurable general swap provider for EVM and Solana source routes.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#506](https://github.com/vultisig/vultisig-sdk/pull/506) [`b1ce322`](https://github.com/vultisig/vultisig-sdk/commit/b1ce3226039d46055d11726cc0e971dd7a09a035) Thanks [@neavra](https://github.com/neavra)! - agent: send ecdsa/eddsa/chain_code in MessageContext so MCP receives vault info
|
|
12
|
+
|
|
13
|
+
The CLI's `MessageContext` was missing `ecdsa_public_key`, `eddsa_public_key`,
|
|
14
|
+
and `hex_chain_code` — fields vultiagent-app's `agentContext.ts` has always
|
|
15
|
+
sent. agent-backend reads these via `extractVaultInfoFromContext` to build
|
|
16
|
+
`req.VaultInfo`, which is then injected into MCP tool calls flagged with
|
|
17
|
+
`_meta.inject_vault_args: true`. Without them, every such tool errors with
|
|
18
|
+
"Vault not configured" at the MCP layer — currently observable for the
|
|
19
|
+
unified `show_receive_request` (vultisig/mcp#179, vultisig/agent-backend#554),
|
|
20
|
+
but the same gap will break any future `inject_vault_args` tool dispatched
|
|
21
|
+
through the CLI. `buildMessageContext` and `buildMinimalContext` now populate
|
|
22
|
+
the three fields from `vault.publicKeys.{ecdsa,eddsa}` + `vault.hexChainCode`.
|
|
23
|
+
|
|
24
|
+
Also picks up Ehsan's review nit on [#500](https://github.com/vultisig/vultisig-sdk/issues/500): removes the stray `/**` opener on
|
|
25
|
+
`client.ts:43` (the line above `isErrorPayloadObject`'s docblock).
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`cb80440`](https://github.com/vultisig/vultisig-sdk/commit/cb804408b9607aacb143a7a941f0f9f1986f2379)]:
|
|
28
|
+
- @vultisig/core-chain@2.2.0
|
|
29
|
+
- @vultisig/sdk@0.26.0
|
|
30
|
+
- @vultisig/client-shared@0.2.10
|
|
31
|
+
- @vultisig/rujira@21.0.0
|
|
32
|
+
|
|
33
|
+
## 0.25.0
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#500](https://github.com/vultisig/vultisig-sdk/pull/500) [`46bb0ff`](https://github.com/vultisig/vultisig-sdk/commit/46bb0ff399fef2b082c906a097e10ebb223682a8) Thanks [@neavra](https://github.com/neavra)! - agent: report honest tool success instead of a hardcoded `true`
|
|
38
|
+
|
|
39
|
+
The agent CLI reported every finished server-side tool as `success: true`
|
|
40
|
+
regardless of outcome. `session.ts` hardcoded the result and `client.ts`
|
|
41
|
+
discarded the `tool-output-available` payload, so a failed `execute_send` /
|
|
42
|
+
`execute_swap` (invalid address, insufficient balance, no swap route, signing
|
|
43
|
+
failure) surfaced as a success to programmatic consumers (the `--via-agent`
|
|
44
|
+
pipe, automation, UI status). The client now derives success from the tool's
|
|
45
|
+
output payload (`{"status":"error"}` / `{"error"}` / stringified), passed
|
|
46
|
+
through `onToolProgress`; `ok ?? true` keeps the prior optimistic default when
|
|
47
|
+
no output is present so older backends cannot regress legitimate successes.
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`c2fd086`](https://github.com/vultisig/vultisig-sdk/commit/c2fd08670ad67e9ec93443569f9b9b9aa5f9d685), [`7b384c8`](https://github.com/vultisig/vultisig-sdk/commit/7b384c89cb0fd82e76161feee78eccbc2c4401eb), [`585c177`](https://github.com/vultisig/vultisig-sdk/commit/585c177d4de4960a764f2528aa48aebc42450f7d), [`1667b79`](https://github.com/vultisig/vultisig-sdk/commit/1667b79fbc754e36032942fb5e749706dfc09bf3), [`46274d7`](https://github.com/vultisig/vultisig-sdk/commit/46274d70fe19fb2f44bc90d9ec0cd4ac1994ae69), [`0c9f6d5`](https://github.com/vultisig/vultisig-sdk/commit/0c9f6d5139d4a096645a575505c7550c2b26bd2a)]:
|
|
50
|
+
- @vultisig/sdk@0.25.0
|
|
51
|
+
- @vultisig/core-chain@2.1.0
|
|
52
|
+
- @vultisig/client-shared@0.2.9
|
|
53
|
+
- @vultisig/rujira@20.0.0
|
|
54
|
+
|
|
3
55
|
## 0.24.1
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -5,16 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
8
|
var __esm = (fn, res) => function __init() {
|
|
15
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
16
10
|
};
|
|
17
|
-
var __commonJS = (cb, mod) => function
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
18
12
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
13
|
};
|
|
20
14
|
var __export = (target, all) => {
|
|
@@ -4056,60 +4050,78 @@ async function executeSwapQuote(ctx2, options) {
|
|
|
4056
4050
|
info('\nTo execute this swap, use the "swap" command');
|
|
4057
4051
|
return quote;
|
|
4058
4052
|
}
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4053
|
+
function validateSwapAmount(amount) {
|
|
4054
|
+
if (amount === "max") return;
|
|
4055
|
+
if (isNaN(amount) || amount <= 0) throw new Error("Invalid amount");
|
|
4056
|
+
}
|
|
4057
|
+
function getSwapAmountString(amount) {
|
|
4058
|
+
return amount === "max" ? "max" : String(amount);
|
|
4059
|
+
}
|
|
4060
|
+
function toSwapRequest(options, amount, dryRun) {
|
|
4061
|
+
return {
|
|
4068
4062
|
fromChain: options.fromChain,
|
|
4069
4063
|
fromSymbol: options.fromToken || "",
|
|
4070
4064
|
toChain: options.toChain,
|
|
4071
4065
|
toSymbol: options.toToken || "",
|
|
4072
|
-
amount
|
|
4073
|
-
dryRun: true
|
|
4074
|
-
}
|
|
4066
|
+
amount,
|
|
4067
|
+
...dryRun && { dryRun: true }
|
|
4068
|
+
};
|
|
4069
|
+
}
|
|
4070
|
+
function toDryRunResult(options, quote, fromAmountRaw) {
|
|
4071
|
+
const result = {
|
|
4072
|
+
dryRun: true,
|
|
4073
|
+
fromChain: String(options.fromChain),
|
|
4074
|
+
fromToken: quote.fromCoin.ticker,
|
|
4075
|
+
toChain: String(options.toChain),
|
|
4076
|
+
toToken: quote.toCoin.ticker,
|
|
4077
|
+
inputAmount: fromAmountRaw,
|
|
4078
|
+
...options.amount === "max" && { isMax: true },
|
|
4079
|
+
estimatedOutput: formatBigintAmount(quote.estimatedOutput, quote.toCoin.decimals),
|
|
4080
|
+
provider: quote.provider
|
|
4081
|
+
};
|
|
4082
|
+
if (quote.estimatedOutputFiat != null) result.estimatedOutputFiat = parseFloat(quote.estimatedOutputFiat.toFixed(2));
|
|
4083
|
+
if (quote.requiresApproval) result.requiresApproval = true;
|
|
4084
|
+
if (quote.warnings?.length) result.warnings = [...quote.warnings];
|
|
4085
|
+
return result;
|
|
4086
|
+
}
|
|
4087
|
+
function displayDryRunResult(result) {
|
|
4088
|
+
info(`
|
|
4089
|
+
Dry-run preview:`);
|
|
4090
|
+
info(` From: ${result.inputAmount} ${result.fromToken} (${result.fromChain})`);
|
|
4091
|
+
info(` To: ${result.estimatedOutput} ${result.toToken} (${result.toChain})`);
|
|
4092
|
+
info(` Provider: ${result.provider}`);
|
|
4093
|
+
if (result.estimatedOutputFiat != null) info(` Est. value (USD): $${result.estimatedOutputFiat}`);
|
|
4094
|
+
if (result.requiresApproval) info(` Requires approval: yes`);
|
|
4095
|
+
if (result.warnings?.length) result.warnings.forEach((w) => warn(` Warning: ${w}`));
|
|
4096
|
+
}
|
|
4097
|
+
async function confirmSwapIfNeeded(options) {
|
|
4098
|
+
if (options.yes) return;
|
|
4099
|
+
if (isNonInteractive()) {
|
|
4100
|
+
throw new Error("Swap requires confirmation. Use --yes to skip, or --dry-run to preview.");
|
|
4101
|
+
}
|
|
4102
|
+
const confirmed = await confirmSwap();
|
|
4103
|
+
if (!confirmed) {
|
|
4104
|
+
warn("Swap cancelled");
|
|
4105
|
+
throw new Error("Swap cancelled by user");
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
async function executeSwap(ctx2, options) {
|
|
4109
|
+
const vault = await ctx2.ensureActiveVault();
|
|
4110
|
+
validateSwapAmount(options.amount);
|
|
4111
|
+
const amountStr = getSwapAmountString(options.amount);
|
|
4112
|
+
const quoteSpinner = createSpinner("Getting swap quote...");
|
|
4113
|
+
const dryResult = await vault.swap(toSwapRequest(options, amountStr, true));
|
|
4075
4114
|
if (!dryResult.dryRun) throw new Error("unreachable");
|
|
4076
4115
|
quoteSpinner.succeed("Quote received");
|
|
4077
4116
|
const quote = dryResult.quote;
|
|
4078
|
-
const fromAmountRaw =
|
|
4079
|
-
const fromAmountDisplay =
|
|
4117
|
+
const fromAmountRaw = options.amount === "max" ? formatBigintAmount(quote.maxSwapable, quote.fromCoin.decimals) : String(options.amount);
|
|
4118
|
+
const fromAmountDisplay = options.amount === "max" ? `${fromAmountRaw} (max)` : fromAmountRaw;
|
|
4080
4119
|
if (options.dryRun) {
|
|
4081
|
-
const
|
|
4082
|
-
const result = {
|
|
4083
|
-
dryRun: true,
|
|
4084
|
-
fromChain: String(options.fromChain),
|
|
4085
|
-
fromToken: quote.fromCoin.ticker,
|
|
4086
|
-
toChain: String(options.toChain),
|
|
4087
|
-
toToken: quote.toCoin.ticker,
|
|
4088
|
-
inputAmount: fromAmountRaw,
|
|
4089
|
-
...isMax && { isMax: true },
|
|
4090
|
-
estimatedOutput,
|
|
4091
|
-
provider: quote.provider
|
|
4092
|
-
};
|
|
4093
|
-
if (quote.estimatedOutputFiat != null) {
|
|
4094
|
-
result.estimatedOutputFiat = parseFloat(quote.estimatedOutputFiat.toFixed(2));
|
|
4095
|
-
}
|
|
4096
|
-
if (quote.requiresApproval) {
|
|
4097
|
-
result.requiresApproval = true;
|
|
4098
|
-
}
|
|
4099
|
-
if (quote.warnings && quote.warnings.length > 0) {
|
|
4100
|
-
result.warnings = [...quote.warnings];
|
|
4101
|
-
}
|
|
4120
|
+
const result = toDryRunResult(options, quote, fromAmountRaw);
|
|
4102
4121
|
if (isJsonOutput()) {
|
|
4103
4122
|
outputJson(result);
|
|
4104
4123
|
} else {
|
|
4105
|
-
|
|
4106
|
-
Dry-run preview:`);
|
|
4107
|
-
info(` From: ${result.inputAmount} ${result.fromToken} (${result.fromChain})`);
|
|
4108
|
-
info(` To: ${result.estimatedOutput} ${result.toToken} (${result.toChain})`);
|
|
4109
|
-
info(` Provider: ${result.provider}`);
|
|
4110
|
-
if (result.estimatedOutputFiat != null) info(` Est. value (USD): $${result.estimatedOutputFiat}`);
|
|
4111
|
-
if (result.requiresApproval) info(` Requires approval: yes`);
|
|
4112
|
-
if (result.warnings?.length) result.warnings.forEach((w) => warn(` Warning: ${w}`));
|
|
4124
|
+
displayDryRunResult(result);
|
|
4113
4125
|
}
|
|
4114
4126
|
return result;
|
|
4115
4127
|
}
|
|
@@ -4124,29 +4136,14 @@ Dry-run preview:`);
|
|
|
4124
4136
|
discountTier
|
|
4125
4137
|
});
|
|
4126
4138
|
}
|
|
4127
|
-
|
|
4128
|
-
if (isNonInteractive()) {
|
|
4129
|
-
throw new Error("Swap requires confirmation. Use --yes to skip, or --dry-run to preview.");
|
|
4130
|
-
}
|
|
4131
|
-
const confirmed = await confirmSwap();
|
|
4132
|
-
if (!confirmed) {
|
|
4133
|
-
warn("Swap cancelled");
|
|
4134
|
-
throw new Error("Swap cancelled by user");
|
|
4135
|
-
}
|
|
4136
|
-
}
|
|
4139
|
+
await confirmSwapIfNeeded(options);
|
|
4137
4140
|
await ensureVaultUnlocked(vault, options.password);
|
|
4138
4141
|
const signSpinner = createSpinner("Signing swap transaction...");
|
|
4139
4142
|
vault.on("signingProgress", ({ step }) => {
|
|
4140
4143
|
signSpinner.text = `${step.message} (${step.progress}%)`;
|
|
4141
4144
|
});
|
|
4142
4145
|
try {
|
|
4143
|
-
const result = await vault.swap(
|
|
4144
|
-
fromChain: options.fromChain,
|
|
4145
|
-
fromSymbol: options.fromToken || "",
|
|
4146
|
-
toChain: options.toChain,
|
|
4147
|
-
toSymbol: options.toToken || "",
|
|
4148
|
-
amount: amountStr
|
|
4149
|
-
});
|
|
4146
|
+
const result = await vault.swap(toSwapRequest(options, amountStr));
|
|
4150
4147
|
if (result.dryRun) throw new Error("unreachable");
|
|
4151
4148
|
const broadcast = result;
|
|
4152
4149
|
signSpinner.succeed(`Swap broadcast: ${broadcast.txHash}`);
|
|
@@ -4944,6 +4941,28 @@ function v1StatusFromType(type) {
|
|
|
4944
4941
|
return void 0;
|
|
4945
4942
|
}
|
|
4946
4943
|
}
|
|
4944
|
+
function isErrorPayloadObject(o) {
|
|
4945
|
+
return o.status === "error" || "error" in o;
|
|
4946
|
+
}
|
|
4947
|
+
function deriveToolDoneOk(status, output) {
|
|
4948
|
+
if (status !== "done" || output == null) return void 0;
|
|
4949
|
+
if (typeof output === "object") {
|
|
4950
|
+
return !isErrorPayloadObject(output);
|
|
4951
|
+
}
|
|
4952
|
+
if (typeof output === "string") {
|
|
4953
|
+
const s = output.trim();
|
|
4954
|
+
if (/^error\b/i.test(s)) return false;
|
|
4955
|
+
try {
|
|
4956
|
+
const parsed = JSON.parse(s);
|
|
4957
|
+
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
4958
|
+
return !isErrorPayloadObject(parsed);
|
|
4959
|
+
}
|
|
4960
|
+
} catch {
|
|
4961
|
+
}
|
|
4962
|
+
return !(/"status"\s*:\s*"error"/i.test(s) || /"error"\s*:/i.test(s));
|
|
4963
|
+
}
|
|
4964
|
+
return true;
|
|
4965
|
+
}
|
|
4947
4966
|
function sseErrorToMessage(value) {
|
|
4948
4967
|
if (value == null) return "";
|
|
4949
4968
|
if (typeof value === "string") return value;
|
|
@@ -4955,6 +4974,16 @@ function sseErrorToMessage(value) {
|
|
|
4955
4974
|
return String(value);
|
|
4956
4975
|
}
|
|
4957
4976
|
}
|
|
4977
|
+
function getV1Type(parsed) {
|
|
4978
|
+
return typeof parsed?.type === "string" && parsed.type.length > 0 ? parsed.type : null;
|
|
4979
|
+
}
|
|
4980
|
+
function getV1Data(parsed, v1Type) {
|
|
4981
|
+
return v1Type?.startsWith("data-") ? parsed.data : null;
|
|
4982
|
+
}
|
|
4983
|
+
function getToolInput(parsed) {
|
|
4984
|
+
const rawInput = parsed.input;
|
|
4985
|
+
return rawInput && typeof rawInput === "object" && !Array.isArray(rawInput) ? rawInput : {};
|
|
4986
|
+
}
|
|
4958
4987
|
var AgentClient = class {
|
|
4959
4988
|
baseUrl;
|
|
4960
4989
|
authToken = null;
|
|
@@ -5104,40 +5133,16 @@ var AgentClient = class {
|
|
|
5104
5133
|
handleSSEEvent(event, data, result, callbacks, toolNameByCallId) {
|
|
5105
5134
|
try {
|
|
5106
5135
|
const parsed = JSON.parse(data);
|
|
5107
|
-
const v1Type =
|
|
5136
|
+
const v1Type = getV1Type(parsed);
|
|
5108
5137
|
const routingEvent = v1Type ? this.mapV1EventType(v1Type) : event;
|
|
5109
|
-
const v1Data =
|
|
5138
|
+
const v1Data = getV1Data(parsed, v1Type);
|
|
5110
5139
|
switch (routingEvent) {
|
|
5111
5140
|
case "text_delta":
|
|
5112
|
-
|
|
5113
|
-
result.fullText += parsed.delta;
|
|
5114
|
-
callbacks.onTextDelta?.(parsed.delta);
|
|
5115
|
-
}
|
|
5141
|
+
this.handleTextDelta(parsed, result, callbacks);
|
|
5116
5142
|
break;
|
|
5117
|
-
case "tool_progress":
|
|
5118
|
-
|
|
5119
|
-
`);
|
|
5120
|
-
const v1Status = v1StatusFromType(v1Type);
|
|
5121
|
-
const status = parsed.status ?? v1Status;
|
|
5122
|
-
const callId = typeof parsed.toolCallId === "string" ? parsed.toolCallId : null;
|
|
5123
|
-
const rawInlineName = parsed.tool ?? parsed.toolName;
|
|
5124
|
-
const inlineName = typeof rawInlineName === "string" && rawInlineName.length > 0 ? rawInlineName : void 0;
|
|
5125
|
-
if (callId && inlineName) {
|
|
5126
|
-
toolNameByCallId.set(callId, inlineName);
|
|
5127
|
-
}
|
|
5128
|
-
const toolName = inlineName ?? (callId ? toolNameByCallId.get(callId) : void 0);
|
|
5129
|
-
const label = typeof parsed.label === "string" ? parsed.label : void 0;
|
|
5130
|
-
if (v1Type === "tool-input-available" && parsed.clientExecuted === true && callId && toolName && callbacks.onClientSideToolCall) {
|
|
5131
|
-
const rawInput = parsed.input;
|
|
5132
|
-
const input = rawInput && typeof rawInput === "object" && !Array.isArray(rawInput) ? rawInput : {};
|
|
5133
|
-
callbacks.onClientSideToolCall(callId, toolName, input);
|
|
5134
|
-
}
|
|
5135
|
-
if (status && toolName) {
|
|
5136
|
-
callbacks.onToolProgress?.(toolName, status, label);
|
|
5137
|
-
}
|
|
5138
|
-
if (status === "done" && callId) toolNameByCallId.delete(callId);
|
|
5143
|
+
case "tool_progress":
|
|
5144
|
+
this.handleToolProgress(parsed, data, callbacks, toolNameByCallId, v1Type);
|
|
5139
5145
|
break;
|
|
5140
|
-
}
|
|
5141
5146
|
case "title": {
|
|
5142
5147
|
const title = v1Data?.title ?? parsed.title;
|
|
5143
5148
|
if (typeof title === "string") callbacks.onTitle?.(title);
|
|
@@ -5165,10 +5170,7 @@ var AgentClient = class {
|
|
|
5165
5170
|
break;
|
|
5166
5171
|
}
|
|
5167
5172
|
case "error": {
|
|
5168
|
-
|
|
5169
|
-
const msg = sseErrorToMessage(errorText);
|
|
5170
|
-
const codeFromBackend = typeof parsed.code === "string" && isAgentErrorCode(parsed.code) ? parsed.code : inferAgentErrorCodeFromMessage(msg);
|
|
5171
|
-
callbacks.onError?.(msg, codeFromBackend);
|
|
5173
|
+
this.handleErrorEvent(parsed, callbacks);
|
|
5172
5174
|
break;
|
|
5173
5175
|
}
|
|
5174
5176
|
case "done":
|
|
@@ -5183,6 +5185,38 @@ var AgentClient = class {
|
|
|
5183
5185
|
}
|
|
5184
5186
|
}
|
|
5185
5187
|
}
|
|
5188
|
+
handleTextDelta(parsed, result, callbacks) {
|
|
5189
|
+
if (typeof parsed.delta !== "string") return;
|
|
5190
|
+
result.fullText += parsed.delta;
|
|
5191
|
+
callbacks.onTextDelta?.(parsed.delta);
|
|
5192
|
+
}
|
|
5193
|
+
handleToolProgress(parsed, data, callbacks, toolNameByCallId, v1Type) {
|
|
5194
|
+
if (this.verbose) process.stderr.write(`[SSE:tool_progress] raw: ${data.slice(0, 1e3)}
|
|
5195
|
+
`);
|
|
5196
|
+
const status = parsed.status ?? v1StatusFromType(v1Type);
|
|
5197
|
+
const callId = typeof parsed.toolCallId === "string" ? parsed.toolCallId : null;
|
|
5198
|
+
const rawInlineName = parsed.tool ?? parsed.toolName;
|
|
5199
|
+
const inlineName = typeof rawInlineName === "string" && rawInlineName.length > 0 ? rawInlineName : void 0;
|
|
5200
|
+
if (callId && inlineName) toolNameByCallId.set(callId, inlineName);
|
|
5201
|
+
const toolName = inlineName ?? (callId ? toolNameByCallId.get(callId) : void 0);
|
|
5202
|
+
const label = typeof parsed.label === "string" ? parsed.label : void 0;
|
|
5203
|
+
this.maybeEmitClientSideToolCall(parsed, callbacks, v1Type, callId, toolName);
|
|
5204
|
+
const ok = deriveToolDoneOk(status, parsed.output);
|
|
5205
|
+
if (status && toolName) callbacks.onToolProgress?.(toolName, status, label, ok);
|
|
5206
|
+
if (status === "done" && callId) toolNameByCallId.delete(callId);
|
|
5207
|
+
}
|
|
5208
|
+
maybeEmitClientSideToolCall(parsed, callbacks, v1Type, callId, toolName) {
|
|
5209
|
+
if (v1Type !== "tool-input-available" || parsed.clientExecuted !== true || !callId || !toolName || !callbacks.onClientSideToolCall) {
|
|
5210
|
+
return;
|
|
5211
|
+
}
|
|
5212
|
+
callbacks.onClientSideToolCall(callId, toolName, getToolInput(parsed));
|
|
5213
|
+
}
|
|
5214
|
+
handleErrorEvent(parsed, callbacks) {
|
|
5215
|
+
const errorText = typeof parsed.errorText === "string" ? parsed.errorText : parsed.error;
|
|
5216
|
+
const msg = sseErrorToMessage(errorText);
|
|
5217
|
+
const codeFromBackend = typeof parsed.code === "string" && isAgentErrorCode(parsed.code) ? parsed.code : inferAgentErrorCodeFromMessage(msg);
|
|
5218
|
+
callbacks.onError?.(msg, codeFromBackend);
|
|
5219
|
+
}
|
|
5186
5220
|
// Maps a V1 `type` field to the legacy event bucket used by handleSSEEvent's
|
|
5187
5221
|
// switch. Frame-level types (start, text-start, text-end, finish-step) and
|
|
5188
5222
|
// non-critical telemetry (data-tokens, data-usage, data-confirmation) route
|
|
@@ -5268,7 +5302,10 @@ async function buildMessageContext(vault) {
|
|
|
5268
5302
|
const context = {
|
|
5269
5303
|
vault_address: vault.publicKeys.ecdsa,
|
|
5270
5304
|
vault_name: vault.name,
|
|
5271
|
-
mldsa_public_key: vault.publicKeyMldsa
|
|
5305
|
+
mldsa_public_key: vault.publicKeyMldsa,
|
|
5306
|
+
ecdsa_public_key: vault.publicKeys.ecdsa,
|
|
5307
|
+
eddsa_public_key: vault.publicKeys.eddsa,
|
|
5308
|
+
hex_chain_code: vault.hexChainCode
|
|
5272
5309
|
};
|
|
5273
5310
|
applyChainPublicKeys(vault, context);
|
|
5274
5311
|
try {
|
|
@@ -5332,7 +5369,10 @@ async function buildMessageContext(vault) {
|
|
|
5332
5369
|
async function buildMinimalContext(vault) {
|
|
5333
5370
|
const context = {
|
|
5334
5371
|
vault_address: vault.publicKeys.ecdsa,
|
|
5335
|
-
vault_name: vault.name
|
|
5372
|
+
vault_name: vault.name,
|
|
5373
|
+
ecdsa_public_key: vault.publicKeys.ecdsa,
|
|
5374
|
+
eddsa_public_key: vault.publicKeys.eddsa,
|
|
5375
|
+
hex_chain_code: vault.hexChainCode
|
|
5336
5376
|
};
|
|
5337
5377
|
applyChainPublicKeys(vault, context);
|
|
5338
5378
|
try {
|
|
@@ -5479,17 +5519,8 @@ var Chain9 = {
|
|
|
5479
5519
|
...CosmosChain,
|
|
5480
5520
|
...OtherChain
|
|
5481
5521
|
};
|
|
5482
|
-
var UtxoBasedChain = [
|
|
5483
|
-
|
|
5484
|
-
OtherChain.Cardano
|
|
5485
|
-
];
|
|
5486
|
-
var defaultChains = [
|
|
5487
|
-
Chain9.Bitcoin,
|
|
5488
|
-
Chain9.Ethereum,
|
|
5489
|
-
Chain9.THORChain,
|
|
5490
|
-
Chain9.Solana,
|
|
5491
|
-
Chain9.BSC
|
|
5492
|
-
];
|
|
5522
|
+
var UtxoBasedChain = [...Object.values(UtxoChain), OtherChain.Cardano];
|
|
5523
|
+
var defaultChains = [Chain9.Bitcoin, Chain9.Ethereum, Chain9.THORChain, Chain9.Solana, Chain9.BSC];
|
|
5493
5524
|
|
|
5494
5525
|
// ../../packages/core/chain/dist/ChainKind.js
|
|
5495
5526
|
var chainKindRecord = {
|
|
@@ -5538,10 +5569,7 @@ function getChainKind(chain) {
|
|
|
5538
5569
|
|
|
5539
5570
|
// ../../packages/lib/utils/dist/record/recordMap.js
|
|
5540
5571
|
function recordMap(record, fn) {
|
|
5541
|
-
return Object.fromEntries(Object.entries(record).map(([key, value]) => [
|
|
5542
|
-
key,
|
|
5543
|
-
fn(value, key)
|
|
5544
|
-
]));
|
|
5572
|
+
return Object.fromEntries(Object.entries(record).map(([key, value]) => [key, fn(value, key)]));
|
|
5545
5573
|
}
|
|
5546
5574
|
|
|
5547
5575
|
// ../../packages/lib/utils/dist/record/makeRecord/index.js
|
|
@@ -5554,14 +5582,7 @@ var makeRecord = (keys, getValue) => {
|
|
|
5554
5582
|
};
|
|
5555
5583
|
|
|
5556
5584
|
// ../../packages/core/chain/dist/chains/cosmos/thor/kujira-merge/index.js
|
|
5557
|
-
var kujiraCoinsMigratedToThorChain = [
|
|
5558
|
-
"kuji",
|
|
5559
|
-
"rkuji",
|
|
5560
|
-
"fuzn",
|
|
5561
|
-
"nstk",
|
|
5562
|
-
"wink",
|
|
5563
|
-
"lvn"
|
|
5564
|
-
];
|
|
5585
|
+
var kujiraCoinsMigratedToThorChain = ["kuji", "rkuji", "fuzn", "nstk", "wink", "lvn"];
|
|
5565
5586
|
var kujiraCoinsMigratedToThorChainMetadata = {
|
|
5566
5587
|
kuji: {
|
|
5567
5588
|
ticker: "KUJI",
|
|
@@ -7951,11 +7972,12 @@ var AgentSession = class {
|
|
|
7951
7972
|
let dispatchChain = Promise.resolve();
|
|
7952
7973
|
const callbacks = {
|
|
7953
7974
|
onTextDelta: (delta) => ui.onTextDelta(delta),
|
|
7954
|
-
onToolProgress: (tool, status, label) => {
|
|
7975
|
+
onToolProgress: (tool, status, label, ok) => {
|
|
7955
7976
|
if (status === "running") {
|
|
7956
7977
|
ui.onToolCall(`mcp-${tool}`, tool);
|
|
7957
7978
|
} else {
|
|
7958
|
-
|
|
7979
|
+
const success2 = ok ?? true;
|
|
7980
|
+
ui.onToolResult(`mcp-${tool}`, tool, success2, { label }, success2 ? void 0 : `${tool} reported an error`);
|
|
7959
7981
|
}
|
|
7960
7982
|
},
|
|
7961
7983
|
onClientSideToolCall: (toolCallId, toolName, input) => {
|
|
@@ -8739,14 +8761,14 @@ function formatDate(iso) {
|
|
|
8739
8761
|
|
|
8740
8762
|
// src/lib/version.ts
|
|
8741
8763
|
import chalk10 from "chalk";
|
|
8742
|
-
import {
|
|
8764
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
8743
8765
|
import { homedir as homedir3 } from "os";
|
|
8744
8766
|
import { join as join3 } from "path";
|
|
8745
8767
|
var cachedVersion = null;
|
|
8746
8768
|
function getVersion() {
|
|
8747
8769
|
if (cachedVersion) return cachedVersion;
|
|
8748
8770
|
if (true) {
|
|
8749
|
-
cachedVersion = "0.
|
|
8771
|
+
cachedVersion = "0.26.0";
|
|
8750
8772
|
return cachedVersion;
|
|
8751
8773
|
}
|
|
8752
8774
|
try {
|
|
@@ -10421,13 +10443,10 @@ Error: ${error2.message}`));
|
|
|
10421
10443
|
}
|
|
10422
10444
|
};
|
|
10423
10445
|
|
|
10424
|
-
// src/lib/errors.ts
|
|
10425
|
-
import chalk14 from "chalk";
|
|
10426
|
-
|
|
10427
10446
|
// src/lib/completion.ts
|
|
10447
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync4 } from "fs";
|
|
10428
10448
|
import { homedir as homedir4 } from "os";
|
|
10429
10449
|
import { join as join4 } from "path";
|
|
10430
|
-
import { readFileSync as readFileSync4, existsSync as existsSync3 } from "fs";
|
|
10431
10450
|
var tabtab = null;
|
|
10432
10451
|
async function getTabtab() {
|
|
10433
10452
|
if (!tabtab) {
|
|
@@ -10494,7 +10513,6 @@ function getVaultNames() {
|
|
|
10494
10513
|
try {
|
|
10495
10514
|
const vaultDir = join4(homedir4(), ".vultisig", "vaults");
|
|
10496
10515
|
if (!existsSync3(vaultDir)) return [];
|
|
10497
|
-
const { readdirSync } = __require("fs");
|
|
10498
10516
|
const files = readdirSync(vaultDir);
|
|
10499
10517
|
const names = [];
|
|
10500
10518
|
for (const file of files) {
|
|
@@ -10738,6 +10756,9 @@ complete -c vsig -n "__fish_seen_subcommand_from import export" -a "(__fish_comp
|
|
|
10738
10756
|
`.trim();
|
|
10739
10757
|
}
|
|
10740
10758
|
|
|
10759
|
+
// src/lib/errors.ts
|
|
10760
|
+
import chalk14 from "chalk";
|
|
10761
|
+
|
|
10741
10762
|
// src/lib/user-agent.ts
|
|
10742
10763
|
function setupUserAgent() {
|
|
10743
10764
|
const userAgent = `vultisig-cli/${getVersion()}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vultisig/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "The self-custody MPC wallet CLI for AI coding agents (Claude Code, Cursor, OpenCode). Natural-language agent mode, 36+ chains, DKLS23 threshold signatures. Seedless.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"@cosmjs/stargate": "^0.38.1",
|
|
74
74
|
"@napi-rs/keyring": "^1.3.0",
|
|
75
75
|
"@noble/hashes": "^2.0.1",
|
|
76
|
-
"@vultisig/client-shared": "^0.2.
|
|
77
|
-
"@vultisig/core-chain": "^2.
|
|
78
|
-
"@vultisig/rujira": "^
|
|
79
|
-
"@vultisig/sdk": "^0.
|
|
76
|
+
"@vultisig/client-shared": "^0.2.10",
|
|
77
|
+
"@vultisig/core-chain": "^2.2.0",
|
|
78
|
+
"@vultisig/rujira": "^21.0.0",
|
|
79
|
+
"@vultisig/sdk": "^0.26.0",
|
|
80
80
|
"chalk": "^5.6.2",
|
|
81
81
|
"cli-table3": "^0.6.5",
|
|
82
82
|
"commander": "^14.0.3",
|
|
83
83
|
"dotenv": "^17.3.1",
|
|
84
|
-
"ora": "^9.
|
|
84
|
+
"ora": "^9.4.0",
|
|
85
85
|
"qrcode-terminal": "^0.12.0",
|
|
86
86
|
"tabtab": "^3.0.2",
|
|
87
87
|
"viem": "^2.48.4",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"esbuild": "^0.27.4",
|
|
96
96
|
"tsx": "^4.21.0",
|
|
97
97
|
"typescript": "^6.0.3",
|
|
98
|
-
"vitest": "^4.1.
|
|
98
|
+
"vitest": "^4.1.6"
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=20.0.0"
|