@sherwoodagent/cli 0.56.1 → 0.56.2

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/dist/index.js CHANGED
@@ -2933,10 +2933,49 @@ function registerIdentityCommands(program2) {
2933
2933
  } catch {
2934
2934
  console.log(` Saved ID: #${savedId} ${chalk4.red("(token not found)")}`);
2935
2935
  }
2936
+ console.log();
2937
+ } else if (balance > 0n) {
2938
+ console.log(` Saved ID: ${chalk4.yellow("none (but this wallet owns NFTs \u2014 listing below)")}`);
2939
+ console.log();
2940
+ const lookupSpinner = ora4("Resolving owned token IDs via Agent0 SDK...").start();
2941
+ try {
2942
+ const sdk = getAgent0SDK();
2943
+ const results = await sdk.searchAgents({
2944
+ walletAddress: account.address,
2945
+ chains: [getChain().id]
2946
+ });
2947
+ lookupSpinner.stop();
2948
+ if (results.length === 0) {
2949
+ console.log(chalk4.dim(" No agents resolved for this wallet on the active chain."));
2950
+ console.log(chalk4.dim(" If you minted on a different chain, try:"));
2951
+ console.log(chalk4.dim(" sherwood identity find --wallet " + account.address + " --all-chains"));
2952
+ } else {
2953
+ console.log(chalk4.bold(` Owned identities on this chain (${results.length}):`));
2954
+ for (const a of results) {
2955
+ const idStr = String(a.agentId);
2956
+ const tokenId = idStr.includes(":") ? idStr.split(":")[1] : idStr;
2957
+ console.log(` ${chalk4.bold(`#${tokenId}`)} ${a.name || chalk4.dim("(no name)")}`);
2958
+ }
2959
+ console.log();
2960
+ console.log(chalk4.green(" Bind one to this machine:"));
2961
+ if (results.length === 1) {
2962
+ const idStr = String(results[0].agentId);
2963
+ const tokenId = idStr.includes(":") ? idStr.split(":")[1] : idStr;
2964
+ console.log(chalk4.dim(` sherwood identity load --id ${tokenId}`));
2965
+ } else {
2966
+ console.log(chalk4.dim(" sherwood identity load --id <tokenId>"));
2967
+ }
2968
+ }
2969
+ } catch (err) {
2970
+ lookupSpinner.warn("Could not resolve owned token IDs via Agent0 SDK");
2971
+ console.log(chalk4.dim(` ${err.message}`));
2972
+ console.log(chalk4.dim(" Try: sherwood identity find --wallet " + account.address));
2973
+ }
2974
+ console.log();
2936
2975
  } else {
2937
2976
  console.log(` Saved ID: ${chalk4.dim("none \u2014 run 'sherwood identity mint --name <name>'")}`);
2977
+ console.log();
2938
2978
  }
2939
- console.log();
2940
2979
  } catch (err) {
2941
2980
  spinner.fail("Failed to check identity");
2942
2981
  console.error(chalk4.red(formatContractError(err)));