@zktx.io/sui-mcp 0.7.0 → 0.8.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.
Files changed (69) hide show
  1. package/README.md +83 -42
  2. package/dist/core/activity/localDataService.js +8 -21
  3. package/dist/core/activity/localDataValidation.js +22 -46
  4. package/dist/core/activity/sqliteAccountStore.js +46 -0
  5. package/dist/core/activity/sqliteActivityStore.js +65 -147
  6. package/dist/core/activity/sqliteActivityStoreSchema.js +42 -26
  7. package/dist/core/activity/transactionActivityService.js +2 -2
  8. package/dist/core/preferences/preferencesStore.js +2 -2
  9. package/dist/core/preferences/sqlitePreferencesRepository.js +10 -0
  10. package/dist/core/session/cardResult.js +41 -0
  11. package/dist/core/session/cardSession.js +1 -1
  12. package/dist/core/session/cardSessionStore.js +51 -19
  13. package/dist/core/session/chainAccounts.js +120 -0
  14. package/dist/core/session/sessionStore.js +4 -8
  15. package/dist/core/session/settingsFileStore.js +3 -30
  16. package/dist/core/session/settingsOperation.js +27 -19
  17. package/dist/core/session/settingsWorkflow.js +161 -87
  18. package/dist/core/session/sqliteCardStore.js +34 -14
  19. package/dist/core/session/sqliteSessionStore.js +5 -5
  20. package/dist/core/session/sqliteSettingsWorkflowStore.js +135 -41
  21. package/dist/core/session/sqliteTransactionRequest.js +18 -0
  22. package/dist/core/session/sqliteWalletConnectionOperation.js +13 -0
  23. package/dist/core/session/sqliteWalletWorkflowStore.js +569 -333
  24. package/dist/core/session/status.js +2 -2
  25. package/dist/core/session/wait.js +6 -11
  26. package/dist/core/session/walletConnection.js +71 -46
  27. package/dist/core/session/walletConnectionOperations.js +24 -0
  28. package/dist/core/session/walletRuntime.js +7 -13
  29. package/dist/core/session/walletWorkflow.js +248 -99
  30. package/dist/core/session/workflowState.js +104 -38
  31. package/dist/core/session/workflowView.js +92 -101
  32. package/dist/mcp/activeAccountResponse.js +3 -0
  33. package/dist/mcp/responseGuidance.js +7 -9
  34. package/dist/mcp/serverInfo.js +11 -10
  35. package/dist/mcp/toolErrors.js +5 -3
  36. package/dist/mcp/toolNames.js +1 -0
  37. package/dist/mcp/tools/action/prepareSuiActionReview.js +9 -16
  38. package/dist/mcp/tools/read/readToolHelpers.js +9 -7
  39. package/dist/mcp/tools/session/executionResultTools.js +2 -2
  40. package/dist/mcp/tools/session/shared.js +2 -2
  41. package/dist/mcp/tools/session/statusTools.js +12 -10
  42. package/dist/mcp/tools/session/walletConnectionTools.js +26 -14
  43. package/dist/mcp/tools/settings/index.js +7 -4
  44. package/dist/mcp-app/account.html +7 -7
  45. package/dist/mcp-app/chart.html +3 -3
  46. package/dist/mcp-app/connect.html +13 -13
  47. package/dist/mcp-app/disconnect.html +3637 -0
  48. package/dist/mcp-app/disconnect.notices.txt +1480 -0
  49. package/dist/mcp-app/receipt.html +393 -393
  50. package/dist/mcp-app/review.html +459 -459
  51. package/dist/mcp-app/settings.html +7 -7
  52. package/dist/mcp-ui/contracts.js +3 -1
  53. package/dist/mcp-ui/tools.js +4 -4
  54. package/dist/runtime/application.js +1 -1
  55. package/dist/runtime/localSettingsService.js +7 -4
  56. package/dist/runtime/smokeMainnetRead.js +5 -4
  57. package/dist/runtime/walletConnectTransport.js +16 -16
  58. package/dist/runtime/walletSdkChildRuntime.js +29 -12
  59. package/dist/runtime/walletSdkIpc.js +5 -4
  60. package/dist/runtime/walletSdkProcess.js +24 -8
  61. package/docs/AGENT_BEHAVIOR.md +82 -54
  62. package/docs/LOCAL_DB_ARCHITECTURE.md +100 -70
  63. package/docs/MCP_SETUP.md +319 -339
  64. package/docs/MCP_TOOLS.md +292 -177
  65. package/docs/SDK_API.md +15 -6
  66. package/docs/TRANSACTION_ACTIVITY_LOG.md +4 -0
  67. package/docs/UTILITY_INDEX.md +9 -7
  68. package/docs/WALLET_CONNECTION.md +162 -167
  69. package/package.json +1 -1
package/docs/SDK_API.md CHANGED
@@ -59,7 +59,7 @@ single serialized `CallToolResult` carrier validated with the pinned SDK
59
59
  schema. Conflicting payloads or private metadata are rejected. Ordinary data
60
60
  does not supply input permission, and saved resource links remain read-only.
61
61
 
62
- `@modelcontextprotocol/ext-apps` is pinned to `2.0.3`, with the MCP client/core/server packages at `2.3.1` and Node transport at `2.1.1`. The server uses `registerAppTool`, `registerAppResource` and `getUiCapability`; the view uses `App` for host-mediated calls and teardown. Account, Receipt, Chart, Connect, Review and Settings are separate self-contained resources, so an account card does not load the PTB or chart renderer. Settings uses scoped app-only inputs for local actions and file transfer. The server keeps app-only permissions out of model content.
62
+ `@modelcontextprotocol/ext-apps` is pinned to `2.0.3`, with the MCP client/core/server packages at `2.3.1` and Node transport at `2.1.1`. The server uses `registerAppTool`, `registerAppResource` and `getUiCapability`; the view uses `App` for host-mediated calls and teardown. Account, Receipt, Chart, Connect, Disconnect, Review and Settings are separate self-contained resources, so an account card does not load the PTB or chart renderer. Settings uses scoped app-only inputs for local actions and file transfer. The server keeps app-only permissions out of model content.
63
63
 
64
64
  Settings completes a selected upload's verification and restore preparation on
65
65
  the backend. The card renders the stored `restoreCheck` result and collects one
@@ -71,6 +71,9 @@ needing a new check, a current confirmation and actual rejection. Definite
71
71
  file/mainnet rejection is independent of local-data confirmation revision and
72
72
  survives Back until explicit file selection changes. The View's current file-job
73
73
  progress describes communication only; it cannot grant restoration authority.
74
+ An operation change that ends use of an upload records invalidation with the
75
+ stored effect/result. Physical cleanup follows without repeating that effect.
76
+ A valid file retained by Back remains eligible for another explicit check.
74
77
 
75
78
  Download backup prepares one verified snapshot and calls `App.downloadFile`.
76
79
  Only that function's exact method-not-found result selects local publication of
@@ -210,7 +213,10 @@ The pinned SDK accepts `number | bigint` quote inputs. Its high-level quote quer
210
213
  The SDK child initializes pinned SignClient with its public `storage` injection,
211
214
  private session persistence, silent SDK logging and telemetry disabled. It uses
212
215
  `connect`, `session.getAll`, `session_update/session_delete/session_expire` events,
213
- and `request` on chain `sui:mainnet`, method `sui_signTransaction`.
216
+ and `request` on chain `sui:mainnet`, method `sui_signTransaction`. Connection
217
+ requests send the saved mainnet chain set as optional namespaces. The pinned SDK
218
+ already treats required namespaces as optional; the product directly supplies
219
+ the intended request shape. Ethereum/Solana requests contain no financial methods.
214
220
  Pinned `session_event` does not update approved namespaces itself: account/chain
215
221
  selection events explicitly invalidate stored review/submission authority even
216
222
  when the approved account set stays unchanged. Requests carry
@@ -238,10 +244,13 @@ not own restart. A new explicit Settings operation can supersede a startup
238
244
  still pending; known failure and its first timestamp remain immutable.
239
245
  Late callbacks cannot reopen old authority or submit another transaction.
240
246
 
241
- Snapshots and per-session versions distinguish present, absent and unusable
242
- sessions. Source inspection failure disables the service instead of becoming an
243
- empty session list. `accountsChanged` and `chainChanged` invalidate selection
244
- even if namespace values are unchanged. The final pre-submission session check
247
+ Snapshots separate session lifecycle revisions from per-chain grant revisions.
248
+ Presence/status changes affect all grants; an identified chain event affects only
249
+ that chain. Normalized account/method/event scope excludes list order and display
250
+ metadata. Within each SDK run, revisions are monotonic across change-and-revert. Source inspection failure disables the service instead of becoming an
251
+ empty session list. `accountsChanged` and `chainChanged` invalidate their chain
252
+ even if namespace values are unchanged; unknown event scope invalidates the
253
+ connection. The IPC proof and pre/post-signing checks carry the Sui grant revision. The final pre-submission session check
245
254
  runs after asynchronous digest/signature/network checks. Responses from another
246
255
  SDK run cannot satisfy that check or restore submission authority.
247
256
  Actual target-wallet acceptance of the serialization is an integration
@@ -10,6 +10,10 @@ Sui MCP stores two kinds of local activity evidence:
10
10
  - User-requested bounded Sui activity facts that were looked up through GraphQL and matched a known local wallet.
11
11
 
12
12
  It does not run a background indexer and does not claim complete wallet history.
13
+ Activity reads accept an explicit Sui account or use the saved read address.
14
+ If that address is absent or cleared, the caller supplies an explicit account;
15
+ no wallet connection is required for that read. These filters neither restore
16
+ read context nor change a Review's fixed transaction target.
13
17
 
14
18
  ## Stored By Default
15
19
 
@@ -64,9 +64,9 @@ is supplied; the actual mainnet checks remain enabled.
64
64
  The command checks metadata, types, tests, builds, package contents and licenses,
65
65
  then launches the installed package through stdio MCP with a new data directory
66
66
  and an independent port. It reads the registered tools and resources, creates a
67
- Settings card only in that temporary database, and checks the six internal
67
+ Settings card only in that temporary database, and checks the internal
68
68
  HTML resources, app-only tools, scoped status and retired-route rejection. A scoped test card verifies
69
- that Connect rejects retired restart input and opening manage does not pair. The check
69
+ that Connect rejects unsupported restart input and a model call does not start pairing. The check
70
70
  verifies the isolated SDK retains exclusive storage ownership until shutdown. It waits
71
71
  for process termination before removing its installation. A termination failure preserves the temporary files for cleanup
72
72
  after the process stops. It does not pair, sign, submit, publish, or mutate the
@@ -123,7 +123,7 @@ npm run smoke:mainnet
123
123
 
124
124
  DeepBook orderbook and raw-quantity quote reads use an internal mainnet SDK simulation sender placeholder, not a user's wallet. The display-amount quote path is covered by automated tests, not by this smoke script. Without the complete optional swap input group, the script does not run account-bound transaction-material computation or digest binding. See Optional account-bound review smoke for that explicit path; read-only success is not evidence that it ran.
125
125
 
126
- Wallet and activity reads use an explicitly synthetic active-account context in a temporary SQLite database. The script never creates a wallet connection, a review URL or an HTTP wallet result. Wallet approval is checked separately. This smoke script does not record raw GraphQL payloads, transaction bytes, signatures, raw transaction details, or compact transaction aggregates.
126
+ Wallet and activity reads pass `SUI_MCP_SMOKE_ADDRESS` explicitly. All four live activity scan/summary calls require `accountSource: "explicit_filter"`. A temporary SQLite database stores known-account history for persistence and optional review computation, without creating a current wallet row or active read context. The script never creates a wallet connection, a review URL or an HTTP wallet result. Wallet approval is checked separately. This smoke script does not record raw GraphQL payloads, transaction bytes, signatures, raw transaction details, or compact transaction aggregates.
127
127
 
128
128
  ## Mainnet Read Smoke Notes
129
129
 
@@ -135,7 +135,7 @@ The smoke command calls:
135
135
  - DeepBook orderbook;
136
136
  - raw-quantity DeepBook quote;
137
137
  - `read_scan_sui_account_activity` for `SUI_MCP_SMOKE_ADDRESS` with limit 5;
138
- - `read_summarize_sui_activity_scan` through active account context with limit 5;
138
+ - `read_summarize_sui_activity_scan` with the explicit `SUI_MCP_SMOKE_ADDRESS` and limit 5;
139
139
  - `read_inspect_sui_transaction` when `SUI_MCP_SMOKE_INSPECT_DIGEST` is set;
140
140
  - sent-function activity tools when `SUI_MCP_SMOKE_FUNCTION_TARGET` is set to a full `package::module::function`.
141
141
 
@@ -151,7 +151,8 @@ If `SUI_MCP_SMOKE_INSPECT_RANDOM_LATEST=true` is set and no digest is provided,
151
151
 
152
152
  The default read path does not call display-amount quote or DeepBook account
153
153
  inventory. Account-bound review computation is separate within the same utility
154
- and runs only for the complete explicit swap input group. Use its recorded
154
+ and runs only for the complete explicit swap input group. That optional path
155
+ uses the known-account history already prepared in the temporary database; it does not create a live connection, card permission or signing authority. Use its recorded
155
156
  status and evidence stages rather than treating read-path success as material
156
157
  verification or wallet acceptance.
157
158
 
@@ -273,6 +274,7 @@ A partially configured group is an error. `SUI_MCP_SMOKE_SWAP_MAX_SLIPPAGE_BPS`
273
274
  existing explicit override. The script uses the same runtime review composition,
274
275
  material store and evidence validation as the product, and records whether
275
276
  transaction review data was emitted. This can involve mainnet simulation but
276
- never wallet pairing, signing or submission. The temporary active-account
277
- fixture is not proof of a wallet connection or ownership. Without the complete
277
+ never wallet pairing, signing or submission. The temporary database supplies
278
+ known-account history for that explicit address; it does not create a current
279
+ wallet connection, saved read context or proof of ownership. Without the complete
278
280
  optional group, the result records that review computation was not run.
@@ -1,173 +1,163 @@
1
1
  # Wallet Connection
2
2
 
3
- WalletConnect provides approved Sui mainnet account context and a transport for
4
- individual wallet requests. It is not login, proof of address ownership, custody, or standing permission to transact. Frontend behavior is defined in
3
+ WalletConnect provides approved mainnet account context and a transport for
4
+ individual Sui wallet requests. It is not login, proof of address ownership, custody, or standing permission to transact. Frontend behavior is defined in
5
5
  [Frontend Policy](https://github.com/zktx-mcp/sui-mcp/blob/main/docs/FRONTEND_POLICY.md)
6
6
  in the source repository; tools are in [MCP Tools](MCP_TOOLS.md).
7
7
 
8
- ## Connection and read account
9
-
10
- `session_open_wallet_connection_card` takes an intent: `connect`, `disconnect` or `manage` (the default). A connect-intent card automatically starts one pairing after the View confirms current state with its UI permission, unless a connection or operation already exists. Manage opens connection controls without starting pairing; Connect wallet starts it only after the user clicks. Disconnect opens target-specific confirmation when one connection is available; the user chooses Confirm disconnect or returns with Back. No model-facing call can disconnect or request a signature. Public saved reads never start pairing. QR data stays in UI metadata bound to the exact card, connection and revision; reopening a waiting card preserves that pairing.
11
-
12
- Sui MCP uses one wallet connection at a time across all clients sharing a
13
- data directory. That connection can approve several Sui mainnet addresses; other
14
- chains are not supported. The same connection rule controls displayed actions,
15
- restoration, SDK observations and atomic SQLite admission. An unexpired connected wallet, pending approval or pending disconnection
16
- prevents another pairing, including requests from different cards. A competing
17
- card retains its own permission and reports the existing connection; it does not
18
- inherit another card's QR or waiting controls. A failed connection attempt needs
19
- an explicit retry even if the other connection later ends. If multiple valid connections are saved, none is selected for account use,
20
- review preparation or signing. The Connect card shows each exact target for
21
- user-confirmed disconnection. After recorded disconnections leave one valid
22
- connection and no pending connection operation, that connection becomes usable;
23
- with no recorded or SDK-present connection and no pending operation, a new pairing is allowed. Terminal history alone does not
24
- block it. A failed disconnect remains unconfirmed in the wallet app; its SDK
25
- session cannot revive the failed product record.
26
- The current SDK snapshot also gates pairing and account use. A known failed or
27
- disconnected record whose SDK session remains present is a disconnect target
28
- on a new card, not a usable wallet. `manageableConnectionIds` identifies those
29
- exact targets and ordinary connected targets, including expired records.
30
- An unmapped SDK session in a published available run sets
31
- `connectionReconciliationRequired: true` after pending registration/cleanup
32
- ends. An initializing or state_sync memory snapshot does not establish this
33
- diagnosis, and an absent flag does not prove session absence. Pairing, account use, preparation and signing
34
- remain blocked. Remove the retained connection in the wallet app, then confirm
35
- its absence through the current connection service. Settings/Troubleshooting
36
- can explicitly restart the service to inspect it again, but restarting never
37
- promotes an unrecorded or failed session into a usable connection. The card does
38
- not invent a connection ID or report physical SDK failure.
39
- The SDK's availability and a recorded terminal outcome alone do not prove absence.
40
-
41
- The backend validates accounts, Sui mainnet namespace, methods and expiry before
42
- recording a connection. A single wallet-approved account can become read context
43
- from an explicit connection; multiple approved accounts require an explicit
44
- selection. The active read account is stored in SQLite until changed or cleared.
45
- SDK restoration and status reads never undo a user clearing that context. The stored selection is separate from its eligibility as a default for current asset reads. Implicit asset reads require a usable current wallet connection for the selected address; disconnection, expiry, pending disconnection, multiple-connection conflict or unavailable wallet state removes that default. Tools with an `account` input may still read an explicit address; connected-account-only tools require connection/account selection or recovery of wallet availability. Explicit-address public reads and saved transaction/activity reads remain available. `session_get_interaction_status.assetReadAccount` supplies that default-account decision alongside `connections` and `walletAvailability`.
46
-
47
- | Connection state | Available behavior |
48
- | --- | --- |
49
- | Unsubmitted card | Automatic pairing for connect intent; manual Connect wallet for manage intent; address selection and target-specific disconnect when permitted |
50
- | Multiple valid saved connections | Resolve through target-specific disconnect; no new pairing, address use, review preparation or signature |
51
- | awaiting_approval | Same private QR and approval observation; Stop connecting |
52
- | connected | View approved accounts and expiry; a new card may select another operation |
53
- | rejected / failed / expired / stopped / disconnected | View the recorded outcome; new operations need a new card |
54
-
55
- `session_get_interaction_status` reports the last confirmed wallet-service observation and stored connections. SDK events and command checks apply review/request invalidation through the same database owner. An ordinary status read does not wait for a fresh SDK request, change the selected account or start a wallet operation. `walletObservation` identifies the local service run, observation order and check time; it is not proof of the wallet app's current screen or online status. See the [interaction API](MCP_TOOLS.md) for the response contract.
56
-
57
- An admitted disconnect is a pending card operation, distinct from the last
58
- confirmed connection state. The same connection cannot be selected for another
59
- operation while disconnection is pending. Cards and wait tools observe its
60
- stored completion or failure; a connected-session update is not completion of
61
- the disconnect. A restart does not replay an unfinished disconnect or restore
62
- that connection as usable. The wallet app may still retain the connection.
63
-
64
- If the SDK disconnect ends but its local completion write fails, current reads
65
- settle the operation once storage recovers. An available SDK with no such session
66
- confirms local disconnection; an unavailable SDK or retained session produces an
67
- unconfirmed failure and wallet-app guidance. Reading never repeats disconnect.
68
- Approval storage failure can also leave a connection in the wallet app. Local
69
- failure or expiry does not prove remote revocation; remove retained connections
70
- in the wallet app. No fixed cleanup period is promised, and an SDK session alone
71
- never restores product authority.
72
-
73
- Chat navigation and frame recreation are not transitions. Local stopping does
74
- not claim that a remote wallet dialog closed. A late approval cannot revive a
75
- stopped connection. An unavailable backend wallet service keeps ordinary reads
76
- available and makes connection cards unavailable with an explicit explanation.
77
-
78
- The product supplies its public WalletConnect project identifier without user
79
- configuration or an override. Shared Relay service limits can affect connection
80
- availability across installations. An initialization failure does not establish
81
- that the user omitted a setting or that a transaction failed. A failure to
82
- restore saved connections or subscribe to wallet changes disables wallet operations until the wallet service is recovered;
83
- it cannot leave signing available without account/chain change observation.
84
- Stored review, request and verified execution facts remain readable through
85
- session tools and cards as well as ordinary evidence tools. `walletAvailability`
86
- describes the backend wallet dependency; it is not connection approval or
87
- transaction authorization. An unavailable dependency does not erase a saved
88
- result or prove chain failure. Startup diagnostics contain safe failure stages,
89
- not the project ID, SDK error bodies or wallet credentials.
90
-
91
- The wallet SDK runs in a separate child process. The parent retains database
92
- authority, transaction verification, submission and chain-result observation.
93
- An unresponsive wallet service does not prevent ordinary reads or access to
94
- stored results. Normal startup is shown as initialization, not as a wallet
95
- rejection. No implicit asset account is offered until the current service run
96
- confirms a usable connection.
97
-
98
- Settings owns explicit connection-service restart. Open its Troubleshooting
99
- section, inspect the current run and affected requests, then confirm the
100
- restart. Connect manages connections/approved addresses and retains individual
101
- Disconnect controls for conflicting saved sessions; it does not own global
102
- service controls. A restart waits for old child exit, new run reservation and
103
- complete ready observation. Unsubmitted signing authority is revoked at
104
- admission; late signatures cannot submit. Already submitted transactions keep
105
- their original digest and observation. A new explicit Settings operation may
106
- supersede a still-pending startup without erasing a known failure.
107
-
108
- Restart completion does not confirm an interrupted disconnect or remove a
109
- remote session. Check retained connections in the wallet app. If Settings or
110
- the parent is unavailable, fully quit all apps using Sui MCP and reopen them;
111
- closing a peer/window can leave the owner running. Stored endpoints and installation changes require the shared parent backend to
112
- exit and restart. Client disable/refresh controls can supply this when all
113
- participating processes exit; otherwise fully quit and reopen the apps.
114
-
115
- A new owner records interrupted connection approval as stopped and unconfirmed
116
- disconnection as failed. It does not repeat either request or restore their
117
- wallet authority. Already submitted transactions remain readable by their digest.
118
- Historical service-recovery cards retain their recorded outcomes; they grant
119
- no new restart input. See [setup troubleshooting](MCP_SETUP.md#wallet-connection-boundary).
120
-
121
- An interrupted wallet operation reports `progress.status: "unavailable"` and a
122
- bounded wait returns `waitOutcome: "unavailable"` with the recorded facts. It does
123
- not pretend that the operation completed or the wait timed out. A completed
124
- request returns its saved result immediately. The backend can still verify the
125
- known digest of an already submitted transaction without WalletConnect. No
126
- financial request is replayed when reading or recovering results.
127
-
128
- A failed disconnect means disconnection was not confirmed. Inspect the connection
129
- in your wallet app and remove it there if it remains listed. Local service
130
- recovery does not verify remote removal. A card for an earlier successful
131
- connection may show that the connection is now unavailable; that is not proof
132
- that its original pairing failed.
133
-
134
- Initialization is described neutrally. A pending card command shows that its
135
- response has not arrived yet; a pending disconnection can show the app-restart
136
- procedure without declaring a timeout or failure. These notices do not diagnose a hung service,
137
- assert admission, or automatically send another command. The same-request check
138
- takes priority when a signing request's delivery is uncertain. Review messages
139
- preserve whether preparation was invalidated by wallet selection, a requested
140
- disconnect, multiple-connection conflict, or service loss. Historical messages
141
- retain their original cause.
8
+ ## One connection, fixed addresses
9
+
10
+ Settings → Wallet networks specifies the networks requested on the next connection.
11
+ The default is Sui. Supported address networks are Sui (`sui:mainnet`), Ethereum
12
+ (`eip155:1`) and Solana (`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`), all mainnet.
13
+ Only Sui supports asset reads, transaction review, signing and submission. Address
14
+ support on another chain is not bridge execution or other-chain signing.
15
+
16
+ There is one current product connection. It supplies at most one fixed address
17
+ per chain. Change the wallet, account, address or approved network scope by
18
+ disconnecting, waiting for confirmed removal and connecting again. Historical
19
+ connection records are retained for existing transaction references; they are
20
+ not simultaneous connections or account choices. Connect contains no chain or
21
+ account selectors and offers no additional-connection action.
22
+ Connect and Disconnect are separate one-purpose cards. `session_open_wallet_connection_card`
23
+ opens a connection request with no intent selector. Its initial authenticated UI
24
+ confirmation admits one pairing request. `session_open_wallet_disconnection_card`
25
+ opens a confirmation for the exact current session. Ordinary calls never apply
26
+ these effects. If there is no current session to disconnect, the gateway returns
27
+ `no_session_to_disconnect` without creating a card or wallet operation.
28
+ Disconnection does not revoke onchain permissions.
29
+
30
+ Every ended Connect or Disconnect card contains its recorded result, time,
31
+ wallet name when available, and network approval results. It contains no addresses,
32
+ QR code or further operation controls. The result does not claim that a past
33
+ approval is still a current connection. Read current fixed addresses through
34
+ `session_get_interaction_status`; saved history and transaction targets keep their
35
+ own exact addresses. Changing current state never rewrites an ended card.
36
+
37
+ The request uses saved networks as optional namespaces. Sui requests
38
+ `sui_signTransaction`, `accountsChanged` and `chainChanged`; Ethereum and Solana
39
+ request addresses with no financial methods. An empty saved network set disables
40
+ new requests. Changing Settings affects only future connections, not a request
41
+ already admitted or an approved connection. Saving a changed scope ends unsent
42
+ Connect cards that captured different networks; they never reopen when the setting
43
+ returns to its earlier value.
44
+
45
+ Only requested, valid returned accounts are used. Each requested chain records
46
+ one immutable result: a bound address, not approved, multiple accounts, or invalid
47
+ response. One valid distinct address binds automatically. Multiple distinct
48
+ addresses make only that chain unavailable; none is chosen silently. Other valid
49
+ returned chains remain usable. A later grant update cannot replace a fixed
50
+ address or fill a missing result. To obtain a different result, reconnect.
51
+ An omitted chain is not proof of permanent wallet non-support.
52
+
53
+ Each card admits at most one fixed operation and keeps one final result. SDK
54
+ settlement is a separate current fact; it does not reopen or rewrite that result.
55
+ Use the [Session Tools API](MCP_TOOLS.md#session-tools) for exact card/operation
56
+ reads and bounded waits. Opening a model-facing gateway grants no wallet effect;
57
+ the authenticated UI initiates the permitted operation. Frame recreation never
58
+ repeats pairing. QR credentials remain private UI metadata.
59
+
60
+ Cancel or Stop permanently ends that card's input and hides its QR. SDK cleanup
61
+ continues independently; late approval cannot create address or signing authority.
62
+ Cleanup completion never reopens the card or starts a new request. A new user
63
+ request needs a new card. A timeout, SDK exit or late response is not user
64
+ cancellation. Failed disconnection does not prove remote removal; a retained
65
+ session can still be explicitly disconnected from a new exact-target Disconnect card.
66
+ Recovery uses current session evidence separately from that recorded failure.
67
+ A settled attempt without approval or a recorded session reference has no
68
+ session when current-run ownership is confirmed, no connection work remains and
69
+ no unrecorded SDK session is retained. It does not require repeated status checks.
70
+ Pending approval or cleanup, a missing observation for a recorded session, and
71
+ unavailable service remain unconfirmed. Once absence is confirmed and pending
72
+ cleanup ends, the user can request a new Connect card. An ended card never regains
73
+ input. An existing Review tied to the ended
74
+ connection needs a new Review after reconnection; a declined connection alone
75
+ does not require a transaction Review.
76
+
77
+ Disconnect confirmation binds the exact connection, networks and affected
78
+ pending approvals. Changed impact requires fresh confirmation. Pending connection
79
+ or cleanup I/O blocks another Connect even if the stored result is stopped,
80
+ failed or expired. Only current-run absence confirmation plus settled I/O releases
81
+ that constraint. An idle or historical row alone cannot establish absence.
82
+
83
+ `session_get_interaction_status` exposes singular `connection`, `requestedChains`,
84
+ `canDisconnect` and the last `walletObservation`. `assetReadAccount` describes
85
+ whether the fixed Sui address is currently available for implicit asset reads.
86
+ `account_get_active_account` reports its saved read context, not live eligibility
87
+ or signing permission. Explicit-address reads remain public and do not select
88
+ an account. Settings can clear the saved read address without changing the wallet,
89
+ fixed addresses or transaction targets; this suppression survives restart of the
90
+ same connection. A fresh explicit connection can supply a new read address.
91
+
92
+ Current service availability, exact session presence, data generation, fixed
93
+ address and per-chain grant must all match for new financial input. Chain-local
94
+ changes invalidate that chain's old authority irreversibly; another chain's change
95
+ does not invalidate an unchanged Sui grant. A Review remains bound to its original
96
+ connection and account after reconnection. A new wallet needs a new Review.
97
+
98
+ An unrecorded SDK session is never adopted by address, order or recency. It blocks
99
+ new connection and financial input while saved facts remain readable. Remove
100
+ unwanted retained sessions in the wallet app and check status. An already admitted
101
+ transaction retains its own exact grant and submission checks. Restarting does not
102
+ approve an unrecorded session or prove its removal.
103
+
104
+ The backend owns the WalletConnect SDK in a child process with private session
105
+ storage. The parent owns SQLite admission, verification, submission and chain
106
+ observation. An initialization or observation failure disables affected wallet
107
+ operations, not saved result reads, and is never reported as wallet rejection or
108
+ chain failure. Startup diagnostics omit credentials and SDK error bodies.
109
+ The product supplies its public project identifier without user configuration;
110
+ shared Relay limits can affect availability.
111
+
112
+ Settings → Troubleshooting owns explicit connection-service restart. The user
113
+ confirms the run and affected requests. Restart waits for actual old-child exit,
114
+ new-run reservation and a ready observation. It revokes unsubmitted signing
115
+ authority; late signatures cannot submit. Submitted transactions keep the same
116
+ digest and result observation. A new Settings operation may supersede a pending
117
+ startup without erasing a known failure.
118
+
119
+ Recovery reconciles only the retained current topic. A missing snapshot entry is
120
+ checked through the existing SDK session check; it is not assumed absent. A normal
121
+ approved connection in the current data generation can regain usage after a new
122
+ ready run. A stopped, terminal or older-generation connection receives cleanup
123
+ ownership only. Its original result, fixed addresses and read-address suppression
124
+ remain unchanged. Confirmed absence releases stale occupancy, including records
125
+ from an earlier owner; it does not replay a connection or financial effect.
126
+ An unadmitted purpose card is not ended merely by an SDK run change; its original target and input deadline remain fixed. Ended cards are not reevaluated.
127
+
128
+ An approved SDK response is first retained privately for exact-session cleanup.
129
+ That retention alone creates no usable connection, address history or signing
130
+ authority. The connection and its fixed addresses become usable only after the
131
+ success result commits. If that publication fails, the session is cleaned up or
132
+ retained for explicit Disconnect; later reads do not retry the failed connection
133
+ as a success or repeat remote disconnection. A duplicate response for the same
134
+ already completed approval preserves that result and does not disconnect it.
135
+
136
+ A new owner stops interrupted connection approval and records unconfirmed
137
+ disconnection as failed. It expires old input and never replays financial work.
138
+ Pending SDK cleanup remains visible separately from immutable results. Bounded
139
+ waits report actual progress, including unavailable service, rather than implying
140
+ completion or remote cancellation. Known submitted digests remain readable without
141
+ WalletConnect. If Settings or the parent cannot be reached, stop all participating
142
+ MCP connections so the shared parent exits before reopening; a peer/window closing
143
+ alone may leave it alive. See [setup troubleshooting](MCP_SETUP.md#wallet-connection-boundary).
142
144
 
143
145
  ## Transaction approval
144
146
 
145
- A default address is qualified by the connection through which it was selected.
146
- If that connection ends and another connection approves the same address,
147
- choose Use address in the remaining connection's card before using it as the
148
- default or preparing a new review. The saved address remains readable history.
149
- A restored connection with the same ID retains its selection; a cleared or
150
- source-less selection is never inferred from matching addresses. New explicit
151
- connections that approve one address still select it automatically.
152
-
153
- The backend publishes the current usable connection and default-address
154
- eligibility. A recorded connection whose expiry has passed is not an additional
155
- usable wallet, even before the next SDK observation updates its record.
156
- Recorded targets remain available for appropriate disconnection; they do not
157
- block the sole usable connection's address selection or review choices.
158
-
159
- A single available wallet/account is displayed without a selection dropdown.
160
- A permitted live Review card automatically prepares and renews verified conditions for that target. Multiple valid wallet connections block preparation and signing; resolve the conflict in Connect. Several approved addresses inside the single wallet require address selection there. A failed computation offers Retry review rather than repeating automatically. The explicit approval button selects the displayed transaction revision; automatic preparation never requests a signature. Backend
161
- account, connection, revision and material checks remain authoritative.
162
-
163
- An existing review keeps its original account binding. Preparing or updating it
164
- requires that account to be the selected read account as well as an approved
165
- account on the chosen connection. If read context changes from A to B, select A
166
- again to update the same review, or request a new review for B. The card explains
167
- the current selection restriction separately from saved review messages, which
168
- can record a preparation failure or connection change. A refused incompatible
169
- selection starts no preparation and records no failed review. Read context alone does not revoke already verified A signing
170
- evidence or alter an admitted request.
147
+ The current fixed Sui address must have a usable exact connection for a new
148
+ Review. Clearing its saved read context does not change that transaction target.
149
+ SDK restoration can recover the same approved current-generation connection;
150
+ backup restore cannot activate an account or restore wallet authority.
151
+
152
+ A new Sui review uses the one current fixed account and connection, with no
153
+ public account/connection selector. An unavailable target is reported before
154
+ creating an empty review. The initial card already fixes the account and
155
+ connection before preparation. Its target remains visible through preparation
156
+ failure, read-address clearing and temporary unavailability. Disconnecting and reconnecting cannot move that review to the
157
+ replacement connection, even for the same address. Start a new Review instead.
158
+ The normal card shows its target without a selector and prepares or renews
159
+ evidence when permitted. Only Request wallet approval and approval in the wallet
160
+ authorize the transaction.
171
161
 
172
162
  Preparation execution and its stored outcome are separate. If execution has
173
163
  ended but both success and failure writes failed, the next current-state read
@@ -191,8 +181,11 @@ before admission, update the review; no signature request is sent. Once admitted
191
181
  the transaction remains fixed and the saved signing deadline applies. Reading
192
182
  or recovering an admitted attempt does not require a fresh quote or send it again.
193
183
 
194
- Wallet account/chain selection changes and connection conflicts invalidate affected unadmitted review
195
- data and pending submission permission in the same connection-change transaction.
184
+ Changes to the target Sui grant or connection lifecycle invalidate affected
185
+ unadmitted review material and pending submission permission atomically. Other
186
+ chain grants, display metadata and list order do not invalidate Sui authority.
187
+ Per-chain revisions remain monotonic even if a grant changes and later returns
188
+ to the earlier value. Unknown event scope invalidates the entire connection.
196
189
  If that write fails, wallet operations are disabled until service recovery; a late
197
190
  signature cannot continue under an unrecorded old permission.
198
191
  Before submission, an explicit user stop, an SDK connection change and a
@@ -202,7 +195,9 @@ After submission, connection updates and disconnect requests do not stop
202
195
  independent chain observation, including a lookup that has not started yet.
203
196
  Only the explicit transaction `stop_waiting` action stops that observation;
204
197
  later connection events neither resume it nor extend its deadline. An explicit
205
- result read can still inspect the same digest. No event resends the transaction.
198
+ result read through a new management card can still inspect the same digest.
199
+ An ended card cannot resume observation. A new exact-attempt result card can
200
+ perform one lookup; its final recorded result also stays fixed. No event resends the transaction.
206
201
  Callbacks already dispatched to submit or read a transaction may still record
207
202
  verified facts and settle their own pending flags while the same DB owner is
208
203
  valid. Wallet failure alone does not end an SDK promise. Server shutdown, owner
@@ -237,8 +232,8 @@ SDK sessions may be reconciled with existing connection records; abandoned
237
232
  pairings and financial requests are not replayed. An unknown outcome may later
238
233
  be resolved by reading the known transaction digest.
239
234
 
240
- Data replacement is refused while signature/submission callbacks or initial
241
- chain observation remain unsettled. Removing finished local records cannot
235
+ Data replacement is refused while admitted management operations, their SDK
236
+ cleanup, signature/submission callbacks or initial chain observation remain unsettled. Removing finished local records cannot
242
237
  cancel or reverse an on-chain transaction. Public export/import never restores
243
238
  card permissions, SDK secrets, private request authority or live pending work.
244
239
  Local data replacement does not revoke the wallet app's connection approval.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zktx.io/sui-mcp",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "mcpName": "io.github.zktx-mcp/sui-mcp",
5
5
  "description": "Sui MCP is a local-first toolkit for helping AI applications and users inspect Sui DeFi actions before execution.",
6
6
  "license": "MIT",