@vultisig/cli 2.8.2 → 2.9.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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # @vultisig/cli
2
2
 
3
+ ## 2.9.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`b61410e`](https://github.com/vultisig/vultisig-sdk/commit/b61410ef8b1d0b1baa7d249440176df23bfa471c)]:
8
+ - @vultisig/core-chain@2.18.0
9
+ - @vultisig/sdk@2.9.0
10
+ - @vultisig/rujira@42.0.0
11
+
12
+ ## 2.8.4
13
+
14
+ ### Patch Changes
15
+
16
+ - [#879](https://github.com/vultisig/vultisig-sdk/pull/879) [`f34ef93`](https://github.com/vultisig/vultisig-sdk/commit/f34ef932ba18c19accccc716098c3c16b83da625) Thanks [@neavra](https://github.com/neavra)! - Fix `agent ask` error reporting so a real first-turn backend/stream error is no
17
+ longer masked by the initialize-time `SESSION_NOT_FOUND` signal. The
18
+ stale-`--session` fallback signal is now kept separately and used only as a
19
+ lowest-priority fallback when the turn produced no error of its own, so a
20
+ genuine turn error wins while a clean turn after a stale-session fallback still
21
+ reports `SESSION_NOT_FOUND` (non-zero exit).
22
+
23
+ - [#875](https://github.com/vultisig/vultisig-sdk/pull/875) [`a1d711b`](https://github.com/vultisig/vultisig-sdk/commit/a1d711beaf1694883688cd8e430c8b38162975b6) Thanks [@neavra](https://github.com/neavra)! - agent: surface a loop-depth overrun as a typed `LOOP_DEPTH_EXCEEDED` error instead of a success-shaped `done`.
24
+
25
+ When the agent message loop exceeds `MAX_MESSAGE_LOOP_DEPTH` (16), `processMessageLoop` previously cleared the queued tool results and called `ui.onDone()` — the same callback used on a clean finish — so a headless caller (`agent ask --json` / `--via-agent` pipe) could not distinguish a depth-capped truncation from a completed turn. It now emits `AgentErrorCode.LOOP_DEPTH_EXCEEDED` via `ui.onError` first (ask exits non-zero with an error envelope; pipe gets a typed `error` frame), then `onDone()` as the turn terminator.
26
+
27
+ - Updated dependencies [[`26dd218`](https://github.com/vultisig/vultisig-sdk/commit/26dd218282b198fdea9c1118e7fe5bc800c071fb), [`69bb830`](https://github.com/vultisig/vultisig-sdk/commit/69bb8307de72883f0c7693871a6ca040b7a0756c)]:
28
+ - @vultisig/client-shared@0.2.17
29
+ - @vultisig/core-chain@2.17.10
30
+ - @vultisig/sdk@2.8.4
31
+
3
32
  ## 2.8.2
4
33
 
5
34
  ### Patch Changes
package/dist/index.js CHANGED
@@ -8074,6 +8074,7 @@ var AgentErrorCode = /* @__PURE__ */ ((AgentErrorCode3) => {
8074
8074
  AgentErrorCode3["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
8075
8075
  AgentErrorCode3["SIGNING_FAILED"] = "SIGNING_FAILED";
8076
8076
  AgentErrorCode3["SESSION_NOT_INITIALIZED"] = "SESSION_NOT_INITIALIZED";
8077
+ AgentErrorCode3["LOOP_DEPTH_EXCEEDED"] = "LOOP_DEPTH_EXCEEDED";
8077
8078
  AgentErrorCode3["SESSION_NOT_FOUND"] = "SESSION_NOT_FOUND";
8078
8079
  AgentErrorCode3["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
8079
8080
  return AgentErrorCode3;
@@ -8082,6 +8083,10 @@ var AGENT_ERROR_CODE_VALUES = new Set(Object.values(AgentErrorCode));
8082
8083
  function isAgentErrorCode(value) {
8083
8084
  return AGENT_ERROR_CODE_VALUES.has(value);
8084
8085
  }
8086
+ var TERMINAL_AGENT_ERROR_CODES = /* @__PURE__ */ new Set(["LOOP_DEPTH_EXCEEDED" /* LOOP_DEPTH_EXCEEDED */]);
8087
+ function isTerminalAgentErrorCode(code) {
8088
+ return TERMINAL_AGENT_ERROR_CODES.has(code);
8089
+ }
8085
8090
  function mapVaultError(err) {
8086
8091
  if (err.code === VaultErrorCode2.InvalidConfig && /failed to unlock vault/i.test(err.message)) {
8087
8092
  return "AUTH_FAILED" /* AUTH_FAILED */;
@@ -8186,10 +8191,21 @@ var AskInterface = class {
8186
8191
  transactions = [];
8187
8192
  cards = [];
8188
8193
  error;
8189
- // Whether ask() has run at least once. initialize() drives getCallbacks()
8190
- // BEFORE the first ask() a stale --session fallback fires
8191
- // onError(SESSION_NOT_FOUND) there. ask() must NOT clear that initialize-time
8192
- // error on its first turn, or the result envelope reports false success.
8194
+ // Initialize-time error, kept SEPARATE from the turn error so it stays the
8195
+ // LOWEST-priority signal. initialize() drives getCallbacks() BEFORE the first
8196
+ // ask() a stale --session fallback fires onError(SESSION_NOT_FOUND) there.
8197
+ // A real first-turn error must override it, so we never pre-set `this.error`
8198
+ // with the init signal; instead partialResult() falls back to `initError` only
8199
+ // when the turn produced no error of its own. Cleared after the first turn so
8200
+ // later turns don't carry the init signal.
8201
+ initError;
8202
+ // Tracks whether the currently-latched `error` is a terminal one (e.g. the
8203
+ // depth cap). A terminal error may overwrite a prior non-terminal one; once a
8204
+ // terminal error is recorded, later frames cannot replace it. See onError.
8205
+ errorIsTerminal = false;
8206
+ // Whether ask() has run at least once. Distinguishes init-time onError (sets
8207
+ // initError) from turn onError (sets error), and gates clearing initError so
8208
+ // the init signal only carries into the FIRST turn.
8193
8209
  hasAsked = false;
8194
8210
  constructor(session, verbose = false, autoApprove = false) {
8195
8211
  this.session = session;
@@ -8243,8 +8259,12 @@ var AskInterface = class {
8243
8259
  }
8244
8260
  },
8245
8261
  onError: (message, code) => {
8246
- if (!this.error) {
8262
+ const isTerminal = isTerminalAgentErrorCode(code);
8263
+ if (!this.hasAsked) {
8264
+ this.initError = { message, code };
8265
+ } else if (!this.error || isTerminal && !this.errorIsTerminal) {
8247
8266
  this.error = { message, code };
8267
+ this.errorIsTerminal = isTerminal;
8248
8268
  }
8249
8269
  process.stderr.write(`[error] ${message} [${code}]
8250
8270
  `);
@@ -8275,8 +8295,10 @@ var AskInterface = class {
8275
8295
  this.toolCalls = [];
8276
8296
  this.transactions = [];
8277
8297
  this.cards = [];
8298
+ this.error = void 0;
8278
8299
  if (this.hasAsked) {
8279
- this.error = void 0;
8300
+ this.initError = void 0;
8301
+ this.errorIsTerminal = false;
8280
8302
  }
8281
8303
  this.hasAsked = true;
8282
8304
  const callbacks = this.getCallbacks();
@@ -8298,7 +8320,9 @@ var AskInterface = class {
8298
8320
  toolCalls: this.toolCalls,
8299
8321
  transactions: this.transactions,
8300
8322
  cards: this.cards,
8301
- error: this.error
8323
+ // A real turn error wins; fall back to the init-time signal (e.g. stale
8324
+ // --session SESSION_NOT_FOUND) only when the turn produced no error.
8325
+ error: this.error ?? this.initError
8302
8326
  };
8303
8327
  }
8304
8328
  };
@@ -12297,6 +12321,10 @@ var AgentSession = class {
12297
12321
  `
12298
12322
  );
12299
12323
  this.pendingToolResults = [];
12324
+ ui.onError(
12325
+ `agent message loop exceeded ${MAX_MESSAGE_LOOP_DEPTH} turns; conversation truncated`,
12326
+ "LOOP_DEPTH_EXCEEDED" /* LOOP_DEPTH_EXCEEDED */
12327
+ );
12300
12328
  ui.onDone();
12301
12329
  return;
12302
12330
  }
@@ -13431,7 +13459,7 @@ var cachedVersion = null;
13431
13459
  function getVersion() {
13432
13460
  if (cachedVersion) return cachedVersion;
13433
13461
  if (true) {
13434
- cachedVersion = "2.8.2";
13462
+ cachedVersion = "2.9.0";
13435
13463
  return cachedVersion;
13436
13464
  }
13437
13465
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vultisig/cli",
3
- "version": "2.8.2",
3
+ "version": "2.9.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,10 +73,10 @@
73
73
  "@cosmjs/stargate": "^0.39.0",
74
74
  "@napi-rs/keyring": "^1.3.0",
75
75
  "@noble/hashes": "^2.2.0",
76
- "@vultisig/client-shared": "^0.2.16",
77
- "@vultisig/core-chain": "^2.17.8",
78
- "@vultisig/rujira": "^41.0.0",
79
- "@vultisig/sdk": "^2.8.2",
76
+ "@vultisig/client-shared": "^0.2.17",
77
+ "@vultisig/core-chain": "^2.18.0",
78
+ "@vultisig/rujira": "^42.0.0",
79
+ "@vultisig/sdk": "^2.9.0",
80
80
  "chalk": "^5.6.2",
81
81
  "cli-table3": "^0.6.5",
82
82
  "commander": "^15.0.0",