@mysten-incubation/sui-agent-pass 0.1.16 → 0.1.17

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 CHANGED
@@ -202,8 +202,9 @@ account when lending is allowed, and sends SUI to the session's **address balanc
202
202
  service re-reads everything that landed on chain and compares it with what you reviewed before
203
203
  the signer serves the key.
204
204
 
205
- Register the agents that may use your passes once with `connect` (it asks which ones it finds on
206
- the machine). Then start Claude anywhere:
205
+ Register the agents that may use your passes once with `connect`. Its main menu lists detected
206
+ agents; **Other / manual setup** offers undetected clients and a generic MCP configuration.
207
+ You can also select a client directly with `--client <name>`. Then start Claude anywhere:
207
208
 
208
209
  ```sh
209
210
  claude
package/dist/cli.js CHANGED
@@ -14,30 +14,6 @@ import { cliInvocation, defaultRoot, forgetSession, openBrowser, servePlugin, se
14
14
  import { startServer } from './server.js';
15
15
  import { SessionStore } from './storage.js';
16
16
  const quote = (s) => `'${s.replaceAll("'", "'\\''")}'`;
17
- /**
18
- * Picks several things one at a time with arrows and enter, the way a single-choice menu
19
- * works, instead of a checkbox whose space key many people never find. Each pick leaves the
20
- * list; the last entry ends the picking. `atLeastOne` refuses to end with nothing picked.
21
- */
22
- async function pickMany(message, choices, done, atLeastOne) {
23
- const picked = [];
24
- let left = [...choices];
25
- while (left.length) {
26
- const pick = await select({
27
- message: picked.length ? `${message} (${picked.length} picked so far)` : message,
28
- choices: [...left, { name: done, value: null }],
29
- });
30
- if (pick === null) {
31
- if (picked.length || !atLeastOne)
32
- break;
33
- console.log('Pick at least one.');
34
- continue;
35
- }
36
- picked.push(pick);
37
- left = left.filter((c) => c.value !== pick);
38
- }
39
- return picked;
40
- }
41
17
  export async function serve(store, port = 0, open = true) {
42
18
  const server = await startServer(store, port);
43
19
  console.log(`\nOwner page: ${server.ownerUrl}\nSession address: ${store.state.sessionAddress}\nSession directory: ${store.directory}`);
@@ -256,14 +232,14 @@ async function installSkill(client) {
256
232
  await symlink(source, target, 'dir');
257
233
  console.log(`${temporary ? 'Copied' : 'Linked'} the agent-pass skill into ${target}.`);
258
234
  }
259
- /** The agents on this machine, as far as their usual files show; nothing is preselected. */
235
+ /** Detected agents first; other clients remain available through a separate manual menu. */
260
236
  async function chooseClients() {
261
237
  const home = homedir();
262
- const found = async (path) => access(path).then(() => ' (found)', () => '');
238
+ const found = async (path) => access(path).then(() => true, () => false);
263
239
  const onPath = (bin) => new Promise((done) => {
264
240
  const child = spawn('sh', ['-c', `command -v ${bin}`], { stdio: 'ignore' });
265
- child.once('error', () => done(''));
266
- child.once('exit', (code) => done(code === 0 ? ' (found)' : ''));
241
+ child.once('error', () => done(false));
242
+ child.once('exit', (code) => done(code === 0));
267
243
  });
268
244
  const desktopConfig = process.platform === 'darwin'
269
245
  ? join(home, 'Library/Application Support/Claude')
@@ -277,15 +253,43 @@ async function chooseClients() {
277
253
  found(join(home, '.hermes')),
278
254
  found(join(home, '.codex')),
279
255
  ]);
256
+ const choices = [
257
+ { name: 'Claude Code', value: 'claude-code', found: claude },
258
+ { name: 'Claude Desktop', value: 'claude-desktop', found: desktop },
259
+ { name: 'Cursor', value: 'cursor', found: cursor },
260
+ { name: 'Hermes', value: 'hermes', found: hermes },
261
+ { name: 'Codex', value: 'codex', found: codex },
262
+ { name: 'Generic MCP configuration', value: 'json', found: false },
263
+ ];
264
+ if (!choices.some((c) => c.found))
265
+ console.log('No supported agents detected. Choose Other / manual setup to configure one.');
280
266
  console.log('Pick one at a time with the arrow keys and enter; add more after.');
281
- const picked = await pickMany('Which agent may use your passes?', [
282
- { name: `Claude Code${claude}`, value: 'claude-code' },
283
- { name: `Claude Desktop${desktop}`, value: 'claude-desktop' },
284
- { name: `Cursor${cursor}`, value: 'cursor' },
285
- { name: `Hermes${hermes}`, value: 'hermes' },
286
- { name: `Codex${codex}`, value: 'codex' },
287
- { name: 'Something else (prints a generic MCP entry)', value: 'json' },
288
- ], "That's all", false);
267
+ const picked = [];
268
+ while (picked.length < choices.length) {
269
+ const remaining = choices.filter((c) => !picked.includes(c.value));
270
+ const manual = remaining.filter((c) => !c.found);
271
+ const pick = await select({
272
+ message: `Which agent may use your passes?${picked.length ? ` (${picked.length} picked so far)` : ''}`,
273
+ choices: [
274
+ ...remaining.filter((c) => c.found),
275
+ ...(manual.length ? [{ name: 'Other / manual setup', value: 'manual' }] : []),
276
+ { name: "That's all", value: null },
277
+ ],
278
+ });
279
+ if (pick === null)
280
+ break;
281
+ if (pick === 'manual') {
282
+ const client = await select({
283
+ message: 'Choose a client to configure manually',
284
+ choices: [...manual, { name: 'Back', value: null }],
285
+ });
286
+ if (client !== null)
287
+ picked.push(client);
288
+ }
289
+ else {
290
+ picked.push(pick);
291
+ }
292
+ }
289
293
  if (picked.length === 0) {
290
294
  const finish = await select({
291
295
  message: 'No agent picked. Finish without registering any?',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten-incubation/sui-agent-pass",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "description": "AI builds transactions. A session signer signs. Your pass enforces the rules.",
6
6
  "repository": {