@mysten-incubation/sui-agent-pass 0.1.11 → 0.1.12

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.
@@ -9,13 +9,11 @@ and the chain identifier for that network. The stdio server loads one of these w
9
9
  the agent names a `network` in `propose_authorization`, so an installed client needs no local
10
10
  publish; a private `deployment.json` under `~/.sui-agent-pass` or a `deployment` path overrides.
11
11
 
12
- `mainnet.json` is the mainnet test copy of the package (`0x4c9010b0…f403`, upgraded to
13
- `0x08d82880…f744`, version 2), published for dogfooding and for testing the publish and upgrade
14
- process with small sums; the real launch will be a fresh publish and a new file here. Add
15
- `siteUrl` to it once the hosted site has its address, so the plugin sends owners there.
16
- `testnet.json` is the current package (Sui Agent Pass), published to testnet on 2026-10-20 with
17
- the version gate and the per-coin deployment shape (`coins`, `pools`, NAVI `reserves`, the demo
18
- faucet). The shipped copy lists no pools and no reserves on purpose: the testnet markets are
12
+ `mainnet.json` is the mainnet test copy of the package (`0x4736026b…0a22`, published
13
+ 2026-10-28 from the code that will launch, caps with its publisher), for dogfooding with small
14
+ sums; the real launch will be a fresh publish and a new file here. Its `siteUrl` sends owners to
15
+ the hosted site. `testnet.json` is the same code, published to testnet on 2026-10-28
16
+ (`0x52017f8e…17b6`) with its stand-in markets and the demo faucet. The shipped copy lists no pools and no reserves on purpose: the testnet markets are
19
17
  stand-ins with 2 SUI of depth, so dogfooders get transfers and staking there and trade on
20
18
  mainnet. The stand-in pools stay on chain, and the previous revision of this file in git keeps
21
19
  their ids; the tests publish their own stand-ins. Any Move change means a new publish and a new
@@ -2,11 +2,9 @@
2
2
  "network": "mainnet",
3
3
  "grpcUrl": "https://fullnode.mainnet.sui.io:443",
4
4
  "chainIdentifier": "4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S",
5
- "packageId": "0x4c9010b0be6022e8a4bd91219d5174edc36d524b42d4790784035f424e01f403",
6
- "publishedAt": "0x08d82880b61c531ffbe9eb9eccf3c025d6182ec50f7f61e1f6095a6b81a1f744",
7
- "configId": "0xf7b33e20564b26c0685b8d86669345a0121ff6b290911a04f1ff37fcd1f5716d",
8
- "maxTermDays": 30,
9
- "siteUrl": "https://sui-agent-pass.vercel.app",
5
+ "packageId": "0x4736026bde8ef425b243013e6e25431a9b5c9c5ccf62ff87ceb0d4e67c700a22",
6
+ "publishedAt": "0x4736026bde8ef425b243013e6e25431a9b5c9c5ccf62ff87ceb0d4e67c700a22",
7
+ "configId": "0x7d472b14c833c4d8442ac3a176e25d47e946847f293af58934ff2e3fb3109f7c",
10
8
  "coins": [
11
9
  {
12
10
  "type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
@@ -33,6 +31,7 @@
33
31
  "coinB": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"
34
32
  }
35
33
  ],
34
+ "maxTermDays": 365,
36
35
  "protocols": {
37
36
  "deepbook": {
38
37
  "packageId": "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809",
@@ -64,5 +63,6 @@
64
63
  }
65
64
  }
66
65
  }
67
- }
66
+ },
67
+ "siteUrl": "https://sui-agent-pass.vercel.app"
68
68
  }
@@ -2,10 +2,9 @@
2
2
  "network": "testnet",
3
3
  "grpcUrl": "https://fullnode.testnet.sui.io:443",
4
4
  "chainIdentifier": "69WiPg3DAQiwdxfncX6wYQ2siKwAe6L9BZthQea3JNMD",
5
- "packageId": "0xfea0b9f60c752e98e950c1994a3805ba28c5f559e3ea72da2ac3d68b90728b11",
6
- "publishedAt": "0xfea0b9f60c752e98e950c1994a3805ba28c5f559e3ea72da2ac3d68b90728b11",
7
- "configId": "0x3bb796cd3fe0d9b85b1db972478616e717fe5bdbd1ff864615a3995f4e1c1c60",
8
- "maxTermDays": 30,
5
+ "packageId": "0x52017f8e68e133c6dc84c8733a9f52de0d2a9fb5e2c63b8949b0f7c0c47917b6",
6
+ "publishedAt": "0x52017f8e68e133c6dc84c8733a9f52de0d2a9fb5e2c63b8949b0f7c0c47917b6",
7
+ "configId": "0xe58594af166a1280f9ab04d0e615ceb7209211bc9bee6780a4b00878b023a65b",
9
8
  "coins": [
10
9
  {
11
10
  "type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
@@ -13,35 +12,36 @@
13
12
  "decimals": 9
14
13
  },
15
14
  {
16
- "type": "0x7ffc375a2bebedcec3753cfe4687f3bb104074eb55b014f8185ccc8ee8bf47fa::usdc::USDC",
15
+ "type": "0xd85020ee4adfa8137605184ad876c96ca293577533a37bff43ac2778b97f2938::usdc::USDC",
17
16
  "symbol": "USDC",
18
17
  "decimals": 6
19
18
  }
20
19
  ],
21
20
  "pools": [],
21
+ "maxTermDays": 365,
22
22
  "demoFaucet": {
23
- "packageId": "0x7ffc375a2bebedcec3753cfe4687f3bb104074eb55b014f8185ccc8ee8bf47fa",
24
- "faucetId": "0x14d07fd3eff80c868c0bab116cbc2f65c8903c77fcb41721ad6db4ba0c6480cf",
25
- "coin": "0x7ffc375a2bebedcec3753cfe4687f3bb104074eb55b014f8185ccc8ee8bf47fa::usdc::USDC"
23
+ "packageId": "0xd85020ee4adfa8137605184ad876c96ca293577533a37bff43ac2778b97f2938",
24
+ "faucetId": "0x853a8e316634215fc297f07a3d23a98b4d40222a7819a07068737689d6c8fc00",
25
+ "coin": "0xd85020ee4adfa8137605184ad876c96ca293577533a37bff43ac2778b97f2938::usdc::USDC"
26
26
  },
27
27
  "protocols": {
28
28
  "deepbook": {
29
- "packageId": "0xfe5ce722543b1e3056aba9f44fd0ac69238c97baae9ac96d0bc1594dfe8ef7b1",
30
- "publishedAt": "0xfe5ce722543b1e3056aba9f44fd0ac69238c97baae9ac96d0bc1594dfe8ef7b1"
29
+ "packageId": "0xf6331717135b1e7edc75ba2cfb3b08a9ec8549884cfc18abc534e4a0bbada9e8",
30
+ "publishedAt": "0xf6331717135b1e7edc75ba2cfb3b08a9ec8549884cfc18abc534e4a0bbada9e8"
31
31
  },
32
32
  "cetus": {
33
- "packageId": "0x23200a7f55d23555844bca491e5422e495d1a9082f4fb39b868d95440655a8d9",
34
- "publishedAt": "0x23200a7f55d23555844bca491e5422e495d1a9082f4fb39b868d95440655a8d9",
35
- "configId": "0x9e4115923d7ba4405a9c918a1d517325a9491b7e2eb3f1e469debae3ceb690cd"
33
+ "packageId": "0xffa6ea563e395f3fd3d86e227a59bdd0ed98ad23c2940822bf9c30c70ce1f167",
34
+ "publishedAt": "0xffa6ea563e395f3fd3d86e227a59bdd0ed98ad23c2940822bf9c30c70ce1f167",
35
+ "configId": "0x2105734227e38828ba69289d4cce4edc1e45666a717c692a9575b6d467ee3bef"
36
36
  },
37
37
  "navi": {
38
- "packageId": "0xd75f91c29ae9b0597f82ff636940199e5004089d17991fafbabb9a180f51b5f7",
39
- "publishedAt": "0xd75f91c29ae9b0597f82ff636940199e5004089d17991fafbabb9a180f51b5f7",
40
- "oraclePackageId": "0x9d2c0e390e32e75b2c6be7a33d12319c912caae11874fcf6e1d79ae8b594e9a6",
41
- "storageId": "0xc8b3b4882625279ce505b94902a33e4cf0364bd1ee2f52563e66f9a42de7af26",
42
- "oracleId": "0xc962d8795540426c4dce1fea621d89f12f00766a6d4b0d00087fde6fefb2d343",
43
- "incentiveV2Id": "0x679e3525405bb43ba27b0839dcaae2469d59225856cd6c2e8318a094efe593c5",
44
- "incentiveV3Id": "0x9488d70edbfd67babcc72b8eb1f3fbf60dd47f080d830e2af27abcecdd6771c6",
38
+ "packageId": "0x5cacd4bed4e0502280b0fe94eb51e02244dea86b584e1f91d9ded493c72eebb5",
39
+ "publishedAt": "0x5cacd4bed4e0502280b0fe94eb51e02244dea86b584e1f91d9ded493c72eebb5",
40
+ "oraclePackageId": "0x4891910b7259bff2f220f017c7e7e4628f5c26efff47eeb75453cf997387a56b",
41
+ "storageId": "0x37d8af65a9ac8ae7c4e99304ae8347ef72dcd30759f509f8c4376e86107087bc",
42
+ "oracleId": "0x3730ff06112853476c9b8c6121206776c6ed912ecc61ce8ffe25b697250f0131",
43
+ "incentiveV2Id": "0xb776dbb5e7a27a766d8fb4087000d58831eec3061a30c95edc5c728ef1508407",
44
+ "incentiveV3Id": "0xbafebe7c1a71f024f304f626215f6706c40cff72c45163e09d62d97cadea4f9e",
45
45
  "reserves": {}
46
46
  }
47
47
  }
package/dist/agent.js CHANGED
@@ -342,7 +342,7 @@ async function naviAmount(i, entry, coin, amount) {
342
342
  await refreshNaviPrices(tx, d);
343
343
  // NAVI's SUI pool stakes idle SUI and may unstake to pay out, hence the system state.
344
344
  tx.moveCall({
345
- target: `${d.publishedAt}::pass::${entry}_v2`,
345
+ target: `${d.publishedAt}::pass::${entry}`,
346
346
  typeArguments: [coin],
347
347
  arguments: [
348
348
  ...pass(tx, i),
package/dist/describe.js CHANGED
@@ -123,10 +123,9 @@ const OWNER_ONLY = new Set([
123
123
  'navi_open',
124
124
  'destroy',
125
125
  'issue',
126
- 'rotate_allowance',
127
126
  'add_policy',
128
127
  'remove_policy',
129
- 'set_agent',
128
+ 'set_term',
130
129
  'revoke_agent',
131
130
  ]);
132
131
  /**
package/dist/explorer.js CHANGED
@@ -1,6 +1,11 @@
1
1
  // Copyright (c) Mysten Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { normalizeSuiAddress } from '@mysten/sui/utils';
3
+ /**
4
+ * Reads for the hosted explorer: everything about a pass from the chain alone, with no local
5
+ * session state. Browser-safe: no Node imports.
6
+ */
7
+ import { bcs } from '@mysten/sui/bcs';
8
+ import { deriveObjectID, normalizeSuiAddress } from '@mysten/sui/utils';
4
9
  import { createdEventType, discoverAllowances, parseCreated, readControl, } from './chain.js';
5
10
  import { describeAttempt } from './describe.js';
6
11
  async function createdEvents(client, d, limit, before = null) {
@@ -23,55 +28,23 @@ async function createdEvents(client, d, limit, before = null) {
23
28
  return { summaries, hasNextPage: page.hasNextPage, endCursor: page.endCursor };
24
29
  }
25
30
  /**
26
- * The pass most recently created for an agent key, among the newest `Created` events: how the
27
- * process that proposed a pass learns that the owner signed, with nothing sent back to it.
31
+ * The ID a pass for an agent key has, whether or not the owner has created it: the contract
32
+ * derives it from the config and the key (`pass::pass_of`), so a key has at most one pass.
28
33
  */
29
- export async function findPassByAgent(client, d, agent) {
30
- const wanted = normalizeSuiAddress(agent);
31
- let cursor = null;
32
- for (let pages = 0; pages < 10; pages++) {
33
- const page = await client.listEvents({
34
- filter: { eventType: createdEventType(d) },
35
- order: 'descending',
36
- limit: 50,
37
- ...(cursor ? { before: cursor } : {}),
38
- });
39
- for (const e of page.events) {
40
- const created = parseCreated(e.bcs);
41
- if (created.agent === wanted)
42
- return { ...created, digest: e.transactionDigest };
43
- }
44
- if (!page.hasNextPage || !page.endCursor)
45
- return null;
46
- cursor = page.endCursor;
47
- }
48
- return null;
49
- }
34
+ export const passIdOf = (d, agent) => deriveObjectID(d.configId, `${d.packageId}::pass::AgentKey`, bcs.Address.serialize(normalizeSuiAddress(agent)).toBytes());
50
35
  /**
51
- * Every pass ever created for an agent key, newest first, among the package's `Created`
52
- * events. A key is meant to sign one authorization; more than one here means a proposal was
53
- * signed again.
36
+ * The pass of an agent key once the owner has created it, with its owner and the transaction
37
+ * that last changed it, which before the agent's first action is the authorization itself.
54
38
  */
55
- export async function passesByAgent(client, d, agent) {
56
- const wanted = normalizeSuiAddress(agent), found = [];
57
- let cursor = null;
58
- for (let pages = 0; pages < 10; pages++) {
59
- const page = await client.listEvents({
60
- filter: { eventType: createdEventType(d) },
61
- order: 'descending',
62
- limit: 50,
63
- ...(cursor ? { before: cursor } : {}),
64
- });
65
- for (const e of page.events) {
66
- const created = parseCreated(e.bcs);
67
- if (created.agent === wanted)
68
- found.push({ ...created, digest: e.transactionDigest });
69
- }
70
- if (!page.hasNextPage || !page.endCursor)
71
- break;
72
- cursor = page.endCursor;
73
- }
74
- return found;
39
+ export async function findPassByAgent(client, d, agent) {
40
+ const id = passIdOf(d, agent);
41
+ const found = await client
42
+ .getObject({ objectId: id, include: { previousTransaction: true } })
43
+ .catch(() => null);
44
+ if (!found?.object.previousTransaction)
45
+ return null;
46
+ const { owner } = await readControl(client, d, id);
47
+ return { id, owner, digest: found.object.previousTransaction };
75
48
  }
76
49
  /** The most recently created passes on this package. */
77
50
  export async function listPasses(client, d, limit = 50) {
package/dist/owner.js CHANGED
@@ -254,14 +254,8 @@ export function buildAmendment(d, current, next, owner) {
254
254
  const { active, control } = current, pass = tx.object(active.passId), session = control.agent;
255
255
  if (String(next.expiresMs) !== control.agentExpiresMs)
256
256
  tx.moveCall({
257
- target: `${d.publishedAt}::pass::set_agent`,
258
- arguments: [
259
- pass,
260
- tx.object(d.configId),
261
- tx.pure.address(session),
262
- tx.pure.u64(next.expiresMs),
263
- tx.object(CLOCK),
264
- ],
257
+ target: `${d.publishedAt}::pass::set_term`,
258
+ arguments: [pass, tx.object(d.configId), tx.pure.u64(next.expiresMs), tx.object(CLOCK)],
265
259
  });
266
260
  removePolicies(tx, d, pass, control.policies);
267
261
  installPolicies(tx, d, pass, next.policy, next.policy.lending.length > 0 && !control.naviPosition);
package/dist/plugin.js CHANGED
@@ -23,7 +23,7 @@ import { z } from 'zod';
23
23
  import { clientFor, deepbookSizes, findPools, quoteSwap, readAllHoldings, readHoldings, 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, MAX_TERM_DAYS, poolsFor, recipientName, requiredSui, sameCoin, SetupSchema, showCoin, SUI, uncovered, units, VenueSchema, } from './domain.js';
26
- import { passesByAgent } from './explorer.js';
26
+ import { passIdOf } from './explorer.js';
27
27
  import { passEnded, returnGasFloat } from './float.js';
28
28
  import { failure, INSTRUCTIONS, keyAlert, MAX_TOOL_INPUT_ELEMENTS, registerDocs, result, serverInfo, sessionInfo, SIGN_ANNOTATIONS, SIGN_DESCRIPTION, } from './mcp.js';
29
29
  import { authenticated, body, ownerPageUrl, startServer } from './server.js';
@@ -365,24 +365,12 @@ function summary(s) {
365
365
  directory: s.store.directory,
366
366
  };
367
367
  }
368
- /**
369
- * The summary plus what the chain says about the key: every pass created for it. A key is
370
- * meant to sign one authorization, so a second pass here is a proposal signed twice, live on
371
- * chain with its own allowances, which the session file knows nothing about.
372
- */
368
+ /** The summary plus what the chain says: whether the key's pass still exists, and a key alert. */
373
369
  async function summaryWithChain(s) {
374
370
  const base = summary(s), { state } = s.store, client = clientFor(state.deployment);
375
- const created = await passesByAgent(client, state.deployment, state.sessionAddress).catch(() => null);
376
- // A creation record outlives the pass; only an existing object is a live pass.
377
- const onChain = created
378
- ? await Promise.all(created.map(async (c) => ({
379
- id: c.id,
380
- live: await client.getObject({ objectId: c.id }).then(() => true, () => false),
381
- })))
382
- : null;
383
- const own = onChain?.find((c) => c.id === state.active?.passId);
384
- const closed = !!state.active && !!onChain && !own?.live;
385
- const extra = onChain?.filter((c) => c.live && c.id !== state.active?.passId) ?? [];
371
+ const passId = passIdOf(state.deployment, state.sessionAddress);
372
+ const live = await client.getObject({ objectId: passId }).then(() => true, () => false);
373
+ const closed = !!state.active && !live;
386
374
  return {
387
375
  ...base,
388
376
  ...(state.active && !closed
@@ -394,14 +382,6 @@ async function summaryWithChain(s) {
394
382
  note: 'The owner closed this pass; its key has nothing left to act on.',
395
383
  }
396
384
  : {}),
397
- passesOnChain: onChain,
398
- ...(extra.length
399
- ? {
400
- warning: `This key is the agent of ${extra.length + (own?.live ? 1 : 0)} live passes, not one: ${extra
401
- .map((c) => c.id)
402
- .join(', ')} were created by signing the same proposal again. Each is live with its own allowances and gas until the owner stops or closes it from its pass page (#/pass/<id>).`,
403
- }
404
- : {}),
405
385
  };
406
386
  }
407
387
  /** `forget_pass` for one session directory, from outside the MCP: the CLI and tests. */
package/docs/AGENT.md CHANGED
@@ -167,17 +167,20 @@ window; `0x3::validator_set` 10 below the 1 SUI minimum stake.
167
167
 
168
168
  ## The pass
169
169
 
170
- | Function | Type arguments | Explicit arguments |
171
- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
- | `pass::transfer` | `[coin]` | pass, config, allowance, withdrawal, recipient name, clock |
173
- | `pass::deepbook_base_to_quote` / `deepbook_quote_to_base` | `[base, quote]` | pass, config, allowance, withdrawal, a DeepBook pool from `deployment.pools` (`coinA` is base, `coinB` quote), min_out, clock |
174
- | `pass::cetus_a_to_b` / `cetus_b_to_a` | `[a, b]` | pass, config, allowance, withdrawal, `protocols.cetus.configId`, a Cetus pool from `deployment.pools`, min_out, clock |
175
- | `pass::navi_supply` | `[coin]` | pass, config, allowance, withdrawal, `navi.storageId`, `navi.reserves[coin].poolId`, `navi.reserves[coin].assetId`, `navi.incentiveV2Id`, `navi.incentiveV3Id`, clock |
176
- | `pass::navi_withdraw_v2` / `navi_borrow_v2` | `[coin]` | pass, config, `navi.oracleId`, storage, pool, asset, incentiveV2, incentiveV3, `0x5`, amount, clock |
177
- | `pass::navi_repay` | `[coin]` | pass, config, allowance, withdrawal, oracle, storage, pool, asset, incentiveV2, incentiveV3, clock |
178
- | `pass::stake` | | pass, config, SUI allowance, withdrawal, `0x5`, validator address, clock; returns the stake's ID |
179
- | `pass::unstake` | | pass, config, `0x5`, stake ID, clock |
180
- | `pass::add_policy`, `remove_policy`, `set_agent`, `rotate_allowance`, `revoke_agent`, `deposit_object`, `withdraw_object`, `navi_open`, `destroy` | | **owner sender only**; installs take `config` after the pass, exits do not |
170
+ | Function | Type arguments | Explicit arguments |
171
+ | ---------------------------------------------------------------------------------------------------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
+ | `pass::transfer` | `[coin]` | pass, config, allowance, withdrawal, recipient name, clock |
173
+ | `pass::deepbook_base_to_quote` / `deepbook_quote_to_base` | `[base, quote]` | pass, config, allowance, withdrawal, a DeepBook pool from `deployment.pools` (`coinA` is base, `coinB` quote), min_out, clock |
174
+ | `pass::cetus_a_to_b` / `cetus_b_to_a` | `[a, b]` | pass, config, allowance, withdrawal, `protocols.cetus.configId`, a Cetus pool from `deployment.pools`, min_out, clock |
175
+ | `pass::navi_supply` | `[coin]` | pass, config, allowance, withdrawal, `navi.storageId`, `navi.reserves[coin].poolId`, `navi.reserves[coin].assetId`, `navi.incentiveV2Id`, `navi.incentiveV3Id`, clock |
176
+ | `pass::navi_withdraw` / `navi_borrow` | `[coin]` | pass, config, `navi.oracleId`, storage, pool, asset, incentiveV2, incentiveV3, `0x5`, amount, clock |
177
+ | `pass::navi_repay` | `[coin]` | pass, config, allowance, withdrawal, oracle, storage, pool, asset, incentiveV2, incentiveV3, clock |
178
+ | `pass::stake` | | pass, config, SUI allowance, withdrawal, `0x5`, validator address, clock; returns the stake's ID |
179
+ | `pass::unstake` | | pass, config, `0x5`, stake ID, clock |
180
+ | `pass::add_policy`, `remove_policy`, `set_term`, `revoke_agent`, `deposit_object`, `withdraw_object`, `navi_open`, `destroy` | | **owner sender only**; installs take `config` after the pass, exits do not |
181
+
182
+ A pass's ID is derived from the `Config` and its agent key: `pass::pass_of(config, agent)` on
183
+ chain, `passIdOf(deployment, agent)` in the client. A key has one pass, ever.
181
184
 
182
185
  The agent's actions and the owner's calls on a live pass are `entry` functions: a transaction
183
186
  calls them directly, and other packages cannot. The calls that run while a new pass is still
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten-incubation/sui-agent-pass",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "description": "AI builds transactions. A session signer signs. Your pass enforces the rules.",
6
6
  "repository": {