@coinfello/agent-cli 0.1.24 → 0.2.1
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.
|
|
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
|
-
###
|
|
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
|
@@ -1194,7 +1194,7 @@ function validate(bool, cbOrMessage, message) {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
var ParameterError = class extends Error {
|
|
1196
1196
|
};
|
|
1197
|
-
var version = "6.0.0";
|
|
1197
|
+
var version$1 = "6.0.0";
|
|
1198
1198
|
var PrefixSecurityEnum = {
|
|
1199
1199
|
SILENT: "silent",
|
|
1200
1200
|
STRICT: "strict",
|
|
@@ -2640,7 +2640,7 @@ var CookieJar = class _CookieJar {
|
|
|
2640
2640
|
// The version of tough-cookie that serialized this jar. Generally a good
|
|
2641
2641
|
// practice since future versions can make data import decisions based on
|
|
2642
2642
|
// known past behavior. When/if this matters, use `semver`.
|
|
2643
|
-
version: `tough-cookie@${version}`,
|
|
2643
|
+
version: `tough-cookie@${version$1}`,
|
|
2644
2644
|
// add the store type, to make humans happy:
|
|
2645
2645
|
storeType: type,
|
|
2646
2646
|
// CookieJar configuration:
|
|
@@ -3180,8 +3180,12 @@ function parseScope(raw) {
|
|
|
3180
3180
|
throw new Error(`Unsupported delegation scope type: "${raw.type}"`);
|
|
3181
3181
|
}
|
|
3182
3182
|
}
|
|
3183
|
+
const version = "0.2.1";
|
|
3184
|
+
const packageJson = {
|
|
3185
|
+
version
|
|
3186
|
+
};
|
|
3183
3187
|
const program = new Command();
|
|
3184
|
-
program.name("coinfello").description("CoinFello CLI - Smart Account interactions").version(
|
|
3188
|
+
program.name("coinfello").description("CoinFello CLI - Smart Account interactions").version(packageJson.version);
|
|
3185
3189
|
program.command("create_account").description("Create a smart account and save its address to local config").option(
|
|
3186
3190
|
"--use-unsafe-private-key",
|
|
3187
3191
|
"Use a raw private key instead of hardware-backed key (Secure Enclave / TPM 2.0)"
|
|
@@ -3280,6 +3284,18 @@ program.command("set_delegation").description("Store a signed delegation (JSON)
|
|
|
3280
3284
|
process.exit(1);
|
|
3281
3285
|
}
|
|
3282
3286
|
});
|
|
3287
|
+
program.command("new_chat").description("Clear the saved chat ID from local config and start a fresh conversation").action(async () => {
|
|
3288
|
+
try {
|
|
3289
|
+
const config = await loadConfig();
|
|
3290
|
+
delete config.chat_id;
|
|
3291
|
+
await saveConfig(config);
|
|
3292
|
+
console.log("Saved chat ID cleared successfully.");
|
|
3293
|
+
console.log(`Config saved to: ${CONFIG_PATH}`);
|
|
3294
|
+
} catch (err) {
|
|
3295
|
+
console.error(`Failed to clear chat ID: ${err.message}`);
|
|
3296
|
+
process.exit(1);
|
|
3297
|
+
}
|
|
3298
|
+
});
|
|
3283
3299
|
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
3300
|
try {
|
|
3285
3301
|
const config = await loadConfig();
|
|
@@ -3296,8 +3312,13 @@ program.command("send_prompt").description("Send a prompt to CoinFello, creating
|
|
|
3296
3312
|
}
|
|
3297
3313
|
console.log("Sending prompt...");
|
|
3298
3314
|
const initialResponse = await sendConversation({
|
|
3299
|
-
prompt
|
|
3315
|
+
prompt,
|
|
3316
|
+
chatId: config.chat_id
|
|
3300
3317
|
});
|
|
3318
|
+
if (initialResponse.chatId && initialResponse.chatId !== config.chat_id) {
|
|
3319
|
+
config.chat_id = initialResponse.chatId;
|
|
3320
|
+
await saveConfig(config);
|
|
3321
|
+
}
|
|
3301
3322
|
if (!initialResponse.clientToolCalls?.length && !initialResponse.txn_id) {
|
|
3302
3323
|
console.log(initialResponse.responseText ?? "");
|
|
3303
3324
|
return;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinfello/agent-cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|