@mysten-incubation/sui-agent-pass 0.1.4 → 0.1.5
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/README.md +2 -5
- package/dist/plugin.js +14 -5
- package/docs/PLAYBOOK.md +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -334,11 +334,8 @@ brand` and `npx playwright install chromium`.
|
|
|
334
334
|
- [Agent transaction guide](docs/AGENT.md): complete interface and agent-side examples.
|
|
335
335
|
- [Architecture and boundaries](docs/ARCHITECTURE.md).
|
|
336
336
|
- [Status: implemented and todo](docs/STATUS.md).
|
|
337
|
-
- [Verification record](docs/VERIFICATION.md)
|
|
338
|
-
|
|
339
|
-
[booth view](docs/evidence/explorer-booth.png).
|
|
340
|
-
- [Real Claude execution evidence](docs/evidence/claude.json): Claude Code with the plugin,
|
|
341
|
-
from prompt to signed pass to on-chain actions on a localnet.
|
|
337
|
+
- [Verification record](docs/VERIFICATION.md): dated runs with their digests. The test scripts
|
|
338
|
+
write their reports and screenshots to `.local/evidence/`, which stays out of git.
|
|
342
339
|
|
|
343
340
|
## Checks
|
|
344
341
|
|
package/dist/plugin.js
CHANGED
|
@@ -20,7 +20,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
20
20
|
import { Transaction } from '@mysten/sui/transactions';
|
|
21
21
|
import { fromBase64, normalizeSuiAddress } from '@mysten/sui/utils';
|
|
22
22
|
import { z } from 'zod';
|
|
23
|
-
import { clientFor, deepbookSizes, quoteSwap, readStatus, withMarketFacts } from './chain.js';
|
|
23
|
+
import { clientFor, deepbookSizes, quoteSwap, readAllHoldings, readStatus, withMarketFacts, } from './chain.js';
|
|
24
24
|
import { describePolicy, describeSetup, renderRows } from './describe.js';
|
|
25
25
|
import { address, coinBySymbol, coinInfo, DAY_MS, defaultGasDaily, DeploymentSchema, display, isStable, limitUnits, poolsFor, recipientName, sameCoin, SetupSchema, showCoin, units, VenueSchema, } from './domain.js';
|
|
26
26
|
import { passesByAgent } from './explorer.js';
|
|
@@ -411,10 +411,14 @@ export function createPluginMcp(registry) {
|
|
|
411
411
|
});
|
|
412
412
|
registerDocs(server);
|
|
413
413
|
server.registerTool('list_passes', {
|
|
414
|
-
description: 'List the pass sessions on this machine (id, name, network, whether the owner has authorized it on chain) and the networks a new pass can live on, each with
|
|
415
|
-
inputSchema: {
|
|
414
|
+
description: 'List the pass sessions on this machine (id, name, network, whether the owner has authorized it on chain) and the networks a new pass can live on, each with its listed coins and pools and how to name others. With owner, also every coin that address holds on each network, so rules can be sized from real balances before any pass exists.',
|
|
415
|
+
inputSchema: {
|
|
416
|
+
owner: address
|
|
417
|
+
.optional()
|
|
418
|
+
.describe("the owner's address, when they gave it; adds ownerCoins per network"),
|
|
419
|
+
},
|
|
416
420
|
annotations: { readOnlyHint: true },
|
|
417
|
-
}, async () => {
|
|
421
|
+
}, async ({ owner }) => {
|
|
418
422
|
const path = registry.deploymentPath();
|
|
419
423
|
// What the pool pays for ten units of its non-stable coin (coinA when neither or both are
|
|
420
424
|
// stablecoins), quoted like a rule's price; ten clears DeepBook's minimum order.
|
|
@@ -438,10 +442,15 @@ export function createPluginMcp(registry) {
|
|
|
438
442
|
}))),
|
|
439
443
|
lending: Object.keys(d.protocols.navi.reserves).map((c) => coinInfo(d, c).symbol),
|
|
440
444
|
...(d.pools.length || Object.keys(d.protocols.navi.reserves).length
|
|
441
|
-
? {
|
|
445
|
+
? {
|
|
446
|
+
otherCoins: 'These are the coins and pools this package lists, not all it can use. Any other coin the owner holds goes in a transfer or swap rule by its full type; a swap of it also needs, in pools, the id of a DeepBook or Cetus pool holding exactly that pair. The server reads the coin and the pool from chain. Lending stays with the listed coins.',
|
|
447
|
+
}
|
|
442
448
|
: {
|
|
443
449
|
note: 'Transfers and staking only: this network lists no pools and no NAVI reserves, so swap and lending rules are refused here.',
|
|
444
450
|
}),
|
|
451
|
+
...(owner
|
|
452
|
+
? { ownerCoins: await readAllHoldings(clientFor(d), d, owner).catch(() => null) }
|
|
453
|
+
: {}),
|
|
445
454
|
});
|
|
446
455
|
const own = (await exists(path)) ? [await markets(await registry.deployment())] : [];
|
|
447
456
|
const bundled = await Promise.all((await registry.bundledNetworks()).map(async (n) => markets(await registry.bundled(n))));
|
package/docs/PLAYBOOK.md
CHANGED
|
@@ -53,13 +53,15 @@ it; say so when the owner picks one.
|
|
|
53
53
|
pool), so list Cetus as well when trades will be small. A network may list no pools or no NAVI
|
|
54
54
|
reserves; `list_passes` says so, and swap or lending rules are refused there.
|
|
55
55
|
|
|
56
|
-
**Coins and pools.**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
**Coins and pools.** The coins and pools `list_passes` shows for a network are the ones this
|
|
57
|
+
package lists, not the only ones it can use. Name a listed coin by symbol. Name any other coin
|
|
58
|
+
the owner holds by its full type, and for a swap give the id of a DeepBook or Cetus pool holding
|
|
59
|
+
exactly that pair in `pools`. To find the type and the balance, ask the owner for their address
|
|
60
|
+
and call `list_passes` with `owner`: it adds every coin that address holds per network. For the
|
|
61
|
+
pool, ask the owner or look the pair up on the venue's own site. The server and the review page
|
|
62
|
+
read such a coin's symbol and decimals and such a pool's venue from chain, never from you, and
|
|
63
|
+
the page shows an unlisted coin with its type so the owner can tell a look-alike from the real
|
|
64
|
+
one. Lending is limited to the coins the network lists as NAVI reserves.
|
|
63
65
|
|
|
64
66
|
**Lifetime caps.** `caps` gives, per coin, the total the key may ever withdraw, for exactly the
|
|
65
67
|
coins the rules spend (staking spends SUI). A daily limit may not exceed its coin's cap. Size
|