@t2000/cli 0.12.2 → 0.13.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.
package/README.md CHANGED
@@ -154,6 +154,14 @@ t2000 init
154
154
  | `t2000 sentinel attack <id> [prompt]` | Attack a sentinel with an adversarial prompt (costs SUI) |
155
155
  | `t2000 sentinel attack <id> [prompt] --fee 0.5` | Override attack fee (default: sentinel's min fee) |
156
156
 
157
+ ### Contacts
158
+
159
+ | Command | Description |
160
+ |---------|-------------|
161
+ | `t2000 contacts` | List saved contacts |
162
+ | `t2000 contacts add <name> <address>` | Save a named contact |
163
+ | `t2000 contacts remove <name>` | Remove a contact |
164
+
157
165
  ### Safeguards
158
166
 
159
167
  | Command | Description |
@@ -184,7 +192,7 @@ t2000 mcp uninstall
184
192
  t2000 mcp
185
193
  ```
186
194
 
187
- 16 tools, 3 prompts, safeguard enforced. See [MCP setup guide](../../docs/mcp-setup.md) for details.
195
+ 17 tools, 5 prompts, safeguard enforced. See [MCP setup guide](../../docs/mcp-setup.md) for details.
188
196
 
189
197
  ### HTTP API Server
190
198
 
@@ -20965,7 +20965,7 @@ var StdioServerTransport = class {
20965
20965
  import { readFile } from "fs/promises";
20966
20966
  import { resolve } from "path";
20967
20967
  import { homedir } from "os";
20968
- import { T2000, validateAddress, SafeguardError, T2000Error } from "@t2000/sdk";
20968
+ import { T2000, SafeguardError, T2000Error } from "@t2000/sdk";
20969
20969
  var SESSION_PATH = resolve(homedir(), ".t2000", ".session");
20970
20970
  async function resolvePin() {
20971
20971
  const envPin = process.env.T2000_PIN ?? process.env.T2000_PASSPHRASE;
@@ -21015,7 +21015,7 @@ function errorResult(err) {
21015
21015
  function registerReadTools(server, agent) {
21016
21016
  server.tool(
21017
21017
  "t2000_balance",
21018
- "Get agent's current balance \u2014 available (checking), savings, gas reserve, and total. All values in USD.",
21018
+ "Get agent's current balance \u2014 available (checking), savings, credit (debt), gas reserve, and net total. All values in USD.",
21019
21019
  {},
21020
21020
  async () => {
21021
21021
  try {
@@ -21104,6 +21104,19 @@ function registerReadTools(server, agent) {
21104
21104
  }
21105
21105
  }
21106
21106
  );
21107
+ server.tool(
21108
+ "t2000_contacts",
21109
+ "List saved contacts (name \u2192 address mappings). Use contact names with t2000_send instead of raw addresses.",
21110
+ {},
21111
+ async () => {
21112
+ try {
21113
+ const contacts = agent.contacts.list();
21114
+ return { content: [{ type: "text", text: JSON.stringify({ contacts }) }] };
21115
+ } catch (err) {
21116
+ return errorResult(err);
21117
+ }
21118
+ }
21119
+ );
21107
21120
  }
21108
21121
  var TxMutex = class {
21109
21122
  queue = Promise.resolve();
@@ -21126,18 +21139,16 @@ function registerWriteTools(server, agent) {
21126
21139
  const mutex = new TxMutex();
21127
21140
  server.tool(
21128
21141
  "t2000_send",
21129
- "Send USDC or stablecoins to a Sui address. Amount is in dollars. Subject to per-transaction and daily send limits. Set dryRun: true to preview without signing.",
21142
+ "Send USDC or stablecoins to a Sui address or contact name. Amount is in dollars. Subject to per-transaction and daily send limits. Set dryRun: true to preview without signing.",
21130
21143
  {
21131
- to: external_exports.string().describe("Recipient Sui address (0x...)"),
21144
+ to: external_exports.string().describe("Recipient Sui address (0x...) or contact name (e.g. 'Tom')"),
21132
21145
  amount: external_exports.number().describe("Amount in dollars to send"),
21133
21146
  asset: external_exports.string().optional().describe("Asset to send (default: USDC)"),
21134
21147
  dryRun: external_exports.boolean().optional().describe("Preview without signing (default: false)")
21135
21148
  },
21136
21149
  async ({ to, amount, asset, dryRun }) => {
21137
21150
  try {
21138
- if (!validateAddress(to)) {
21139
- return errorResult(new Error(`Invalid Sui address: ${to}`));
21140
- }
21151
+ const resolved = agent.contacts.resolve(to);
21141
21152
  if (dryRun) {
21142
21153
  agent.enforcer.check({ operation: "send", amount });
21143
21154
  const balance = await agent.balance();
@@ -21149,7 +21160,8 @@ function registerWriteTools(server, agent) {
21149
21160
  preview: true,
21150
21161
  canSend: balance.available >= amount,
21151
21162
  amount,
21152
- to,
21163
+ to: resolved.address,
21164
+ contactName: resolved.contactName,
21153
21165
  asset: asset ?? "USDC",
21154
21166
  currentBalance: balance.available,
21155
21167
  balanceAfter: balance.available - amount,
@@ -21585,7 +21597,7 @@ async function startMcpServer(opts) {
21585
21597
  );
21586
21598
  process.exit(1);
21587
21599
  }
21588
- const server = new McpServer({ name: "t2000", version: "0.12.0" });
21600
+ const server = new McpServer({ name: "t2000", version: "0.13.0" });
21589
21601
  registerReadTools(server, agent);
21590
21602
  registerWriteTools(server, agent);
21591
21603
  registerSafetyTools(server, agent);
@@ -21596,4 +21608,4 @@ async function startMcpServer(opts) {
21596
21608
  export {
21597
21609
  startMcpServer
21598
21610
  };
21599
- //# sourceMappingURL=dist-4S75H6SM.js.map
21611
+ //# sourceMappingURL=dist-QGTOSQO3.js.map