@coinfello/agent-cli 0.1.23 → 0.2.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
@@ -79,7 +79,15 @@ Stores a parent delegation JSON object in config.
79
79
  node dist/index.js set_delegation '{"delegate":"0x...","delegator":"0x...","authority":"0x0","caveats":[],"salt":"0x0","signature":"0x..."}'
80
80
  ```
81
81
 
82
- ### 5. send_prompt
82
+ ### 5. new_chat
83
+
84
+ Clears the saved conversation chat ID from local config, forcing the next `send_prompt` call to start a fresh chat.
85
+
86
+ ```bash
87
+ node dist/index.js new_chat
88
+ ```
89
+
90
+ ### 6. send_prompt
83
91
 
84
92
  Sends a natural language prompt to CoinFello. If the server requires a delegation to execute the action, the CLI creates and signs a subdelegation automatically based on the server's requested scope and chain. Requires `create_account` and `sign_in` to have been run first.
85
93
 
@@ -101,7 +109,7 @@ Transaction submitted successfully.
101
109
  Transaction ID: <txn_hash_>
102
110
  ```
103
111
 
104
- ### 6. signer-daemon
112
+ ### 7. signer-daemon
105
113
 
106
114
  Manages the Secure Enclave signing daemon. Without the daemon, each signing operation (account creation, sign-in, delegation signing) triggers a separate Touch ID / password prompt. Starting the daemon authenticates once and caches the authorization for subsequent operations.
107
115
 
package/dist/index.js CHANGED
@@ -3280,6 +3280,18 @@ program.command("set_delegation").description("Store a signed delegation (JSON)
3280
3280
  process.exit(1);
3281
3281
  }
3282
3282
  });
3283
+ program.command("new_chat").description("Clear the saved chat ID from local config and start a fresh conversation").action(async () => {
3284
+ try {
3285
+ const config = await loadConfig();
3286
+ delete config.chat_id;
3287
+ await saveConfig(config);
3288
+ console.log("Saved chat ID cleared successfully.");
3289
+ console.log(`Config saved to: ${CONFIG_PATH}`);
3290
+ } catch (err) {
3291
+ console.error(`Failed to clear chat ID: ${err.message}`);
3292
+ process.exit(1);
3293
+ }
3294
+ });
3283
3295
  program.command("send_prompt").description("Send a prompt to CoinFello, creating a delegation if requested by the server").argument("<prompt>", "The prompt to send").action(async (prompt) => {
3284
3296
  try {
3285
3297
  const config = await loadConfig();
@@ -3296,8 +3308,13 @@ program.command("send_prompt").description("Send a prompt to CoinFello, creating
3296
3308
  }
3297
3309
  console.log("Sending prompt...");
3298
3310
  const initialResponse = await sendConversation({
3299
- prompt
3311
+ prompt,
3312
+ chatId: config.chat_id
3300
3313
  });
3314
+ if (initialResponse.chatId && initialResponse.chatId !== config.chat_id) {
3315
+ config.chat_id = initialResponse.chatId;
3316
+ await saveConfig(config);
3317
+ }
3301
3318
  if (!initialResponse.clientToolCalls?.length && !initialResponse.txn_id) {
3302
3319
  console.log(initialResponse.responseText ?? "");
3303
3320
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinfello/agent-cli",
3
- "version": "0.1.23",
3
+ "version": "0.2.0",
4
4
  "description": "CLI for managing a web3 smart account and executing blockchain transactions via CoinFello",
5
5
  "repository": "CoinFello/agent-cli",
6
6
  "homepage": "https://coinfello.com",
@@ -10,7 +10,8 @@
10
10
  "coinfello": "./dist/index.js"
11
11
  },
12
12
  "files": [
13
- "dist"
13
+ "dist",
14
+ "README.md"
14
15
  ],
15
16
  "publishConfig": {
16
17
  "access": "public"