@bankr/cli 0.1.0-beta.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 +92 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +260 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/cancel.d.ts +2 -0
- package/dist/commands/cancel.d.ts.map +1 -0
- package/dist/commands/cancel.js +25 -0
- package/dist/commands/cancel.js.map +1 -0
- package/dist/commands/capabilities.d.ts +2 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +162 -0
- package/dist/commands/capabilities.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +56 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/llm.d.ts +12 -0
- package/dist/commands/llm.d.ts.map +1 -0
- package/dist/commands/llm.js +280 -0
- package/dist/commands/llm.js.map +1 -0
- package/dist/commands/login.d.ts +4 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +122 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +13 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/prompt.d.ts +2 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/prompt.js +56 -0
- package/dist/commands/prompt.js.map +1 -0
- package/dist/commands/sign.d.ts +10 -0
- package/dist/commands/sign.d.ts.map +1 -0
- package/dist/commands/sign.js +67 -0
- package/dist/commands/sign.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +45 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/submit.d.ts +20 -0
- package/dist/commands/submit.d.ts.map +1 -0
- package/dist/commands/submit.js +124 -0
- package/dist/commands/submit.js.map +1 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +75 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +113 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +94 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +18 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +66 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/output.d.ts +32 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +82 -0
- package/dist/lib/output.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @bankr/cli
|
|
2
|
+
|
|
3
|
+
Official CLI for the [Bankr](https://bankr.bot) AI agent platform. Interact with the Bankr AI agent directly from your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @bankr/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Authenticate with your API key
|
|
15
|
+
bankr login
|
|
16
|
+
|
|
17
|
+
# Send a prompt
|
|
18
|
+
bankr prompt "what's trending on base?"
|
|
19
|
+
|
|
20
|
+
# Or use the shorthand (no subcommand)
|
|
21
|
+
bankr "what is the price of ETH?"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
### Authentication
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Log in — opens https://bankr.bot/api to generate an API key
|
|
30
|
+
bankr login
|
|
31
|
+
|
|
32
|
+
# Log in with a custom API URL
|
|
33
|
+
bankr login --api-url https://api-staging.bankr.bot
|
|
34
|
+
|
|
35
|
+
# Show current auth info and validate connection
|
|
36
|
+
bankr whoami
|
|
37
|
+
|
|
38
|
+
# Clear stored credentials
|
|
39
|
+
bankr logout
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Prompts
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Send a prompt and wait for the response
|
|
46
|
+
bankr prompt "swap 10 USDC to ETH on base"
|
|
47
|
+
|
|
48
|
+
# Shorthand — just pass the prompt directly
|
|
49
|
+
bankr "what are the top holders of VIRTUAL?"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Job Management
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Check the status of a job
|
|
56
|
+
bankr status job_ABC123DEF456
|
|
57
|
+
|
|
58
|
+
# Cancel a running job
|
|
59
|
+
bankr cancel job_ABC123DEF456
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Configuration
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# View all config
|
|
66
|
+
bankr config get
|
|
67
|
+
|
|
68
|
+
# Get a specific value
|
|
69
|
+
bankr config get apiUrl
|
|
70
|
+
|
|
71
|
+
# Set a value
|
|
72
|
+
bankr config set apiUrl https://api-staging.bankr.bot
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Configuration
|
|
76
|
+
|
|
77
|
+
Credentials are stored in `~/.bankr/config.json`.
|
|
78
|
+
|
|
79
|
+
Environment variables override stored values:
|
|
80
|
+
|
|
81
|
+
| Variable | Description |
|
|
82
|
+
|----------|-------------|
|
|
83
|
+
| `BANKR_API_KEY` | API key (overrides stored key) |
|
|
84
|
+
| `BANKR_API_URL` | API URL (default: `https://api.bankr.bot`) |
|
|
85
|
+
|
|
86
|
+
## API Key
|
|
87
|
+
|
|
88
|
+
Generate an API key at [bankr.bot/api](https://bankr.bot/api). Keys start with `bk_` and require Agent API access to be enabled.
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { input } from "@inquirer/prompts";
|
|
4
|
+
import { skillsCommand } from "./commands/capabilities.js";
|
|
5
|
+
import { cancelCommand } from "./commands/cancel.js";
|
|
6
|
+
import { configGetCommand, configSetCommand } from "./commands/config.js";
|
|
7
|
+
import { setConfigPath } from "./lib/config.js";
|
|
8
|
+
import { claudeCommand, creditsCommand, modelsCommand, setupClaudeCodeCommand, setupCursorCommand, setupOpenclawCommand, setupOpenCodeCommand, } from "./commands/llm.js";
|
|
9
|
+
import { loginCommand } from "./commands/login.js";
|
|
10
|
+
import { logoutCommand } from "./commands/logout.js";
|
|
11
|
+
import { promptCommand } from "./commands/prompt.js";
|
|
12
|
+
import { signCommand } from "./commands/sign.js";
|
|
13
|
+
import { statusCommand } from "./commands/status.js";
|
|
14
|
+
import { submitCommand, submitJsonCommand } from "./commands/submit.js";
|
|
15
|
+
import { whoamiCommand } from "./commands/whoami.js";
|
|
16
|
+
import * as output from "./lib/output.js";
|
|
17
|
+
/**
|
|
18
|
+
* Read prompt text from stdin (piped) or interactively.
|
|
19
|
+
* Bypasses shell expansion so dollar signs and special characters are preserved.
|
|
20
|
+
*/
|
|
21
|
+
async function readPromptInput() {
|
|
22
|
+
// Piped stdin (e.g. echo 'buy $50 of ETH' | bankr prompt)
|
|
23
|
+
if (!process.stdin.isTTY) {
|
|
24
|
+
const chunks = [];
|
|
25
|
+
for await (const chunk of process.stdin) {
|
|
26
|
+
chunks.push(chunk);
|
|
27
|
+
}
|
|
28
|
+
const text = Buffer.concat(chunks).toString().trim();
|
|
29
|
+
if (!text) {
|
|
30
|
+
output.error("No input received from stdin");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
return text;
|
|
34
|
+
}
|
|
35
|
+
// Interactive input — shell expansion does not apply here
|
|
36
|
+
const text = await input({
|
|
37
|
+
message: "Enter your prompt:",
|
|
38
|
+
theme: output.bankrTheme,
|
|
39
|
+
required: true,
|
|
40
|
+
});
|
|
41
|
+
return text.trim();
|
|
42
|
+
}
|
|
43
|
+
const program = new Command();
|
|
44
|
+
function colorizeHelp(text) {
|
|
45
|
+
return text
|
|
46
|
+
.split("\n")
|
|
47
|
+
.map((line) => {
|
|
48
|
+
// "Usage: ..." line
|
|
49
|
+
if (line.startsWith("Usage:"))
|
|
50
|
+
return output.fmt.brandBold(line);
|
|
51
|
+
// Section headers: "Options:" and "Commands:"
|
|
52
|
+
if (/^(Options|Commands):/.test(line))
|
|
53
|
+
return output.fmt.brandBold(line);
|
|
54
|
+
// Description line (standalone, no leading whitespace, no colon)
|
|
55
|
+
if (line === "Bankr AI agent CLI")
|
|
56
|
+
return output.fmt.brandBold(line);
|
|
57
|
+
// Command/option rows: leading whitespace then content
|
|
58
|
+
if (/^\s{2,}\S/.test(line)) {
|
|
59
|
+
const match = line.match(/^(\s+)([\w<>[\].\-,/ ]+?)(\s{2,}.+)$/);
|
|
60
|
+
if (match) {
|
|
61
|
+
return (match[1] + output.fmt.brand(match[2]) + output.fmt.dim(match[3]));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return line;
|
|
65
|
+
})
|
|
66
|
+
.join("\n");
|
|
67
|
+
}
|
|
68
|
+
program
|
|
69
|
+
.name("bankr")
|
|
70
|
+
.description("Bankr AI agent CLI")
|
|
71
|
+
.version("0.1.0-alpha.2", "-v, --version", "Show CLI version")
|
|
72
|
+
.helpOption("-h, --help", "Display help")
|
|
73
|
+
.addHelpCommand("help [command]", "Display help for command")
|
|
74
|
+
.option("--config <path>", "Path to config file (default: ~/.bankr/config.json)")
|
|
75
|
+
.configureOutput({
|
|
76
|
+
writeOut: (str) => process.stdout.write(colorizeHelp(str)),
|
|
77
|
+
writeErr: (str) => process.stderr.write(colorizeHelp(str)),
|
|
78
|
+
})
|
|
79
|
+
.hook("preAction", (thisCommand) => {
|
|
80
|
+
const configPath = thisCommand.opts().config;
|
|
81
|
+
if (configPath) {
|
|
82
|
+
setConfigPath(configPath);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
program
|
|
86
|
+
.command("login")
|
|
87
|
+
.description("Authenticate with the Bankr API")
|
|
88
|
+
.option("--api-url <url>", "Custom Bankr API URL (default: https://api.bankr.bot)")
|
|
89
|
+
.action(async (opts) => {
|
|
90
|
+
await loginCommand({ apiUrl: opts.apiUrl });
|
|
91
|
+
});
|
|
92
|
+
program
|
|
93
|
+
.command("logout")
|
|
94
|
+
.description("Clear stored credentials")
|
|
95
|
+
.action(logoutCommand);
|
|
96
|
+
program
|
|
97
|
+
.command("whoami")
|
|
98
|
+
.description("Show current authentication info")
|
|
99
|
+
.action(whoamiCommand);
|
|
100
|
+
program
|
|
101
|
+
.command("prompt [text...]")
|
|
102
|
+
.description("Send a prompt to the Bankr AI agent")
|
|
103
|
+
.action(async (text) => {
|
|
104
|
+
const joined = text.join(" ").trim();
|
|
105
|
+
await promptCommand(joined || (await readPromptInput()));
|
|
106
|
+
});
|
|
107
|
+
program
|
|
108
|
+
.command("status <jobId>")
|
|
109
|
+
.description("Check the status of a job")
|
|
110
|
+
.action(statusCommand);
|
|
111
|
+
program
|
|
112
|
+
.command("cancel <jobId>")
|
|
113
|
+
.description("Cancel a running job")
|
|
114
|
+
.action(cancelCommand);
|
|
115
|
+
const configCmd = program
|
|
116
|
+
.command("config")
|
|
117
|
+
.description("Manage CLI configuration");
|
|
118
|
+
configCmd
|
|
119
|
+
.command("get [key]")
|
|
120
|
+
.description("Get config value(s). Keys: apiKey, apiUrl, llmUrl")
|
|
121
|
+
.action(configGetCommand);
|
|
122
|
+
configCmd
|
|
123
|
+
.command("set <key> <value>")
|
|
124
|
+
.description("Set a config value. Keys: apiKey, apiUrl, llmUrl")
|
|
125
|
+
.action(configSetCommand);
|
|
126
|
+
program
|
|
127
|
+
.command("skills")
|
|
128
|
+
.description("Show all Bankr AI agent skills with examples")
|
|
129
|
+
.action(skillsCommand);
|
|
130
|
+
// Sign command
|
|
131
|
+
program
|
|
132
|
+
.command("sign")
|
|
133
|
+
.description("Sign messages, typed data, or transactions")
|
|
134
|
+
.requiredOption("-t, --type <type>", "Signature type: personal_sign, eth_signTypedData_v4, eth_signTransaction")
|
|
135
|
+
.option("-m, --message <message>", "Message to sign (for personal_sign)")
|
|
136
|
+
.option("--typed-data <json>", "EIP-712 typed data as JSON (for eth_signTypedData_v4)")
|
|
137
|
+
.option("--transaction <json>", "Transaction as JSON (for eth_signTransaction)")
|
|
138
|
+
.action(async (opts) => {
|
|
139
|
+
await signCommand({
|
|
140
|
+
type: opts.type,
|
|
141
|
+
message: opts.message,
|
|
142
|
+
typedData: opts.typedData,
|
|
143
|
+
transaction: opts.transaction,
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
// Submit command
|
|
147
|
+
const submitCmd = program
|
|
148
|
+
.command("submit")
|
|
149
|
+
.description("Submit a transaction to the blockchain");
|
|
150
|
+
submitCmd
|
|
151
|
+
.command("tx")
|
|
152
|
+
.description("Submit transaction with explicit parameters")
|
|
153
|
+
.requiredOption("--to <address>", "Destination address")
|
|
154
|
+
.requiredOption("--chain-id <id>", "Chain ID (8453=Base, 1=Ethereum, 137=Polygon)")
|
|
155
|
+
.option("--value <wei>", "Value in wei")
|
|
156
|
+
.option("--data <hex>", "Calldata (hex string)")
|
|
157
|
+
.option("--gas <limit>", "Gas limit")
|
|
158
|
+
.option("--gas-price <wei>", "Gas price (legacy)")
|
|
159
|
+
.option("--max-fee-per-gas <wei>", "Max fee per gas (EIP-1559)")
|
|
160
|
+
.option("--max-priority-fee-per-gas <wei>", "Max priority fee (EIP-1559)")
|
|
161
|
+
.option("--nonce <n>", "Transaction nonce")
|
|
162
|
+
.option("-d, --description <text>", "Description for logging")
|
|
163
|
+
.option("--no-wait", "Don't wait for confirmation")
|
|
164
|
+
.action(async (opts) => {
|
|
165
|
+
await submitCommand({
|
|
166
|
+
to: opts.to,
|
|
167
|
+
chainId: opts.chainId,
|
|
168
|
+
value: opts.value,
|
|
169
|
+
data: opts.data,
|
|
170
|
+
gas: opts.gas,
|
|
171
|
+
gasPrice: opts.gasPrice,
|
|
172
|
+
maxFeePerGas: opts.maxFeePerGas,
|
|
173
|
+
maxPriorityFeePerGas: opts.maxPriorityFeePerGas,
|
|
174
|
+
nonce: opts.nonce,
|
|
175
|
+
description: opts.description,
|
|
176
|
+
noWait: !opts.wait,
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
submitCmd
|
|
180
|
+
.command("json <transaction>")
|
|
181
|
+
.description("Submit transaction from JSON: {to, chainId, value?, data?}")
|
|
182
|
+
.option("-d, --description <text>", "Description for logging")
|
|
183
|
+
.option("--no-wait", "Don't wait for confirmation")
|
|
184
|
+
.action(async (transaction, opts) => {
|
|
185
|
+
await submitJsonCommand(transaction, {
|
|
186
|
+
noWait: !opts.wait,
|
|
187
|
+
description: opts.description,
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
// LLM Gateway tools
|
|
191
|
+
const llmCmd = program
|
|
192
|
+
.command("llm")
|
|
193
|
+
.description("LLM Gateway tools")
|
|
194
|
+
.action(() => {
|
|
195
|
+
llmCmd.help();
|
|
196
|
+
});
|
|
197
|
+
llmCmd
|
|
198
|
+
.command("models")
|
|
199
|
+
.description("List available models")
|
|
200
|
+
.action(modelsCommand);
|
|
201
|
+
llmCmd
|
|
202
|
+
.command("credits")
|
|
203
|
+
.description("Show LLM gateway credit balance")
|
|
204
|
+
.action(creditsCommand);
|
|
205
|
+
const llmSetupCmd = llmCmd
|
|
206
|
+
.command("setup")
|
|
207
|
+
.description("Generate agent config (openclaw, opencode, cursor, claude)");
|
|
208
|
+
llmSetupCmd
|
|
209
|
+
.command("openclaw")
|
|
210
|
+
.description("OpenClaw config")
|
|
211
|
+
.option("--install", "Write config to ~/.openclaw/openclaw.json")
|
|
212
|
+
.action(setupOpenclawCommand);
|
|
213
|
+
llmSetupCmd
|
|
214
|
+
.command("opencode")
|
|
215
|
+
.description("OpenCode config")
|
|
216
|
+
.option("--install", "Write config to ~/.config/opencode/opencode.json")
|
|
217
|
+
.action(setupOpenCodeCommand);
|
|
218
|
+
llmSetupCmd
|
|
219
|
+
.command("cursor")
|
|
220
|
+
.description("Cursor setup")
|
|
221
|
+
.action(setupCursorCommand);
|
|
222
|
+
llmSetupCmd
|
|
223
|
+
.command("claude")
|
|
224
|
+
.description("Claude Code config")
|
|
225
|
+
.action(setupClaudeCodeCommand);
|
|
226
|
+
llmCmd
|
|
227
|
+
.command("claude")
|
|
228
|
+
.description("Run Claude Code via gateway")
|
|
229
|
+
.allowUnknownOption()
|
|
230
|
+
.allowExcessArguments()
|
|
231
|
+
.action(async () => {
|
|
232
|
+
// Pass everything after "claude" through to the claude process
|
|
233
|
+
const idx = process.argv.indexOf("claude");
|
|
234
|
+
const args = idx >= 0 ? process.argv.slice(idx + 1) : [];
|
|
235
|
+
await claudeCommand(args);
|
|
236
|
+
});
|
|
237
|
+
// Default: treat unrecognized arguments as a prompt
|
|
238
|
+
program.arguments("[text...]").action(async (text) => {
|
|
239
|
+
if (text.length === 0) {
|
|
240
|
+
program.help();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
await promptCommand(text.join(" "));
|
|
244
|
+
});
|
|
245
|
+
async function main() {
|
|
246
|
+
try {
|
|
247
|
+
await program.parseAsync(process.argv);
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
// User cancelled an interactive prompt (Ctrl+C / Escape)
|
|
251
|
+
if (err.name === "ExitPromptError") {
|
|
252
|
+
console.log();
|
|
253
|
+
process.exit(0);
|
|
254
|
+
}
|
|
255
|
+
output.error(err.message);
|
|
256
|
+
process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
main();
|
|
260
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C;;;GAGG;AACH,KAAK,UAAU,eAAe;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM,KA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CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEL,oDAAoD;AACpD,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAc,EAAE,EAAE;IAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IACD,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yDAAyD;QACzD,IAAK,GAAa,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAC9C,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../src/commands/cancel.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cancelJob } from "../lib/api.js";
|
|
2
|
+
import { requireApiKey } from "../lib/config.js";
|
|
3
|
+
import * as output from "../lib/output.js";
|
|
4
|
+
export async function cancelCommand(jobId) {
|
|
5
|
+
requireApiKey();
|
|
6
|
+
const spin = output.spinner("Cancelling job...");
|
|
7
|
+
try {
|
|
8
|
+
const result = await cancelJob(jobId);
|
|
9
|
+
spin.stop();
|
|
10
|
+
output.label("Job", result.jobId);
|
|
11
|
+
output.label("Status", output.formatStatus(result.status));
|
|
12
|
+
if (result.status === "cancelled") {
|
|
13
|
+
output.success("Job cancelled successfully");
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
output.dim(`Job is ${result.status} and could not be cancelled.`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
spin.fail("Failed to cancel job");
|
|
21
|
+
output.error(err.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../src/commands/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa;IAC/C,aAAa,EAAE,CAAC;IAEhB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,EAAE,CAAC;QAEZ,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAE3D,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,8BAA8B,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/commands/capabilities.ts"],"names":[],"mappings":"AAyJA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBnD"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import * as output from "../lib/output.js";
|
|
2
|
+
const ALL_CHAINS = "Base, Ethereum, Polygon, Unichain, Solana";
|
|
3
|
+
const EVM_CHAINS = "Base, Ethereum, Polygon, Unichain";
|
|
4
|
+
const SKILLS = [
|
|
5
|
+
{
|
|
6
|
+
name: "Portfolio & Wallet Balances",
|
|
7
|
+
chains: ALL_CHAINS,
|
|
8
|
+
examples: [
|
|
9
|
+
'bankr "what are my balances?"',
|
|
10
|
+
'bankr "show my portfolio"',
|
|
11
|
+
'bankr "my balances on base"',
|
|
12
|
+
'bankr "how much USDC do I have?"',
|
|
13
|
+
'bankr "what\'s my portfolio worth?"',
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "Market Research & Price Tracking",
|
|
18
|
+
chains: ALL_CHAINS,
|
|
19
|
+
examples: [
|
|
20
|
+
'bankr "price of ETH"',
|
|
21
|
+
'bankr "prices of ETH, SOL, and MATIC"',
|
|
22
|
+
'bankr "show ETH chart"',
|
|
23
|
+
'bankr "BTC chart for last 24 hours"',
|
|
24
|
+
'bankr "what\'s trending on base?"',
|
|
25
|
+
'bankr "top gainers today"',
|
|
26
|
+
'bankr "analyze BNKR price action"',
|
|
27
|
+
'bankr "tell me about this token: 0x..."',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "Token Transfers & Payments",
|
|
32
|
+
chains: ALL_CHAINS,
|
|
33
|
+
examples: [
|
|
34
|
+
'bankr "send 0.1 ETH to vitalik.eth"',
|
|
35
|
+
'bankr "send 100 USDC to 0x1234..."',
|
|
36
|
+
'bankr "send $5 of DEGEN to @username"',
|
|
37
|
+
'bankr "send all my USDC to 0x1234..."',
|
|
38
|
+
'bankr "buy $5 of DEGEN and send to @username"',
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "Token Swaps & Cross-Chain Trading",
|
|
43
|
+
chains: ALL_CHAINS,
|
|
44
|
+
examples: [
|
|
45
|
+
'bankr "swap $50 of ETH to USDC"',
|
|
46
|
+
'bankr "buy $10 of BNKR"',
|
|
47
|
+
'bankr "sell all my BONK for SOL"',
|
|
48
|
+
'bankr "sell half my DEGEN"',
|
|
49
|
+
'bankr "swap 50% of my USDC to ETH"',
|
|
50
|
+
'bankr "buy $10 of BNKR and 5 USDC to DEGEN"',
|
|
51
|
+
'bankr "swap $50 USDC from polygon to ETH on base"',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Token Deployment & Fee Management",
|
|
56
|
+
chains: "Base, Solana",
|
|
57
|
+
examples: [
|
|
58
|
+
'bankr "deploy a token called MyAgent with symbol AGENT on base"',
|
|
59
|
+
'bankr "deploy a token called MyAgent with 20% vaulted for 30 days on base"',
|
|
60
|
+
'bankr "how much fees have I earned?"',
|
|
61
|
+
'bankr "claim my fees for MyAgent"',
|
|
62
|
+
'bankr "show my deployed tokens with fees"',
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Limit Orders",
|
|
67
|
+
chains: EVM_CHAINS,
|
|
68
|
+
examples: [
|
|
69
|
+
'bankr "buy 100 BNKR if it drops 10%"',
|
|
70
|
+
'bankr "buy $50 of ETH when price drops 15%"',
|
|
71
|
+
'bankr "sell my BNKR when it rises 20%"',
|
|
72
|
+
'bankr "sell DEGEN when BTC reaches $50,000"',
|
|
73
|
+
'bankr "cancel my limit order"',
|
|
74
|
+
'bankr "cancel all my automations"',
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "Stop Loss Orders",
|
|
79
|
+
chains: EVM_CHAINS,
|
|
80
|
+
examples: [
|
|
81
|
+
'bankr "stop loss on ETH at -10%"',
|
|
82
|
+
'bankr "sell all my DEGEN if it drops 20%"',
|
|
83
|
+
'bankr "set a stop loss at -20% for NEWTOKEN"',
|
|
84
|
+
'bankr "set stop loss on BNKR at -15%"',
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "DCA (Dollar Cost Averaging) Orders",
|
|
89
|
+
chains: EVM_CHAINS,
|
|
90
|
+
examples: [
|
|
91
|
+
'bankr "DCA $100 USDC into BNKR every day at 9am"',
|
|
92
|
+
'bankr "DCA $50 ETH into BNKR every 6 hours for 7 days"',
|
|
93
|
+
'bankr "DCA $50 into ETH daily for 30 days"',
|
|
94
|
+
'bankr "cancel my DCA for BNKR"',
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "TWAP (Time-Weighted Average Price) Orders",
|
|
99
|
+
chains: EVM_CHAINS,
|
|
100
|
+
examples: [
|
|
101
|
+
'bankr "TWAP $200 USDC into BNKR every 6 hours for 3 days"',
|
|
102
|
+
'bankr "TWAP $1000 into ETH over 24 hours"',
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "Leveraged Trading via Avantis Perpetuals",
|
|
107
|
+
chains: "Base",
|
|
108
|
+
examples: [
|
|
109
|
+
'bankr "long BTC/USD with 10x leverage"',
|
|
110
|
+
'bankr "short $25 of ETH/USD"',
|
|
111
|
+
'bankr "buy $10 of GOLD"',
|
|
112
|
+
'bankr "buy $50 of BTC/USD with 5% stop loss"',
|
|
113
|
+
'bankr "long ETH with 200% take profit"',
|
|
114
|
+
'bankr "buy $25 BTC/USD with 10x leverage, 5% stop loss, 200% take profit"',
|
|
115
|
+
'bankr "close my BTC position"',
|
|
116
|
+
'bankr "show my Avantis positions"',
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "Polymarket Prediction Markets",
|
|
121
|
+
chains: "Polygon",
|
|
122
|
+
examples: [
|
|
123
|
+
'bankr "what are the odds the eagles win?"',
|
|
124
|
+
'bankr "search for bitcoin markets"',
|
|
125
|
+
'bankr "bet $5 on eagles to win tonight"',
|
|
126
|
+
'bankr "buy 100 YES shares for trump winning"',
|
|
127
|
+
'bankr "show my Polymarket positions"',
|
|
128
|
+
'bankr "redeem my winning polymarket positions"',
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "NFT Trading & Management",
|
|
133
|
+
chains: EVM_CHAINS,
|
|
134
|
+
examples: [
|
|
135
|
+
'bankr "show my NFTs"',
|
|
136
|
+
'bankr "what NFTs do I own on base?"',
|
|
137
|
+
'bankr "buy the cheapest Noun"',
|
|
138
|
+
'bankr "buy this NFT: [opensea link]"',
|
|
139
|
+
'bankr "list my Noun #123 for 50 ETH"',
|
|
140
|
+
'bankr "send my Noun #123 to 0x1234..."',
|
|
141
|
+
'bankr "mint from [manifold link]"',
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
export async function skillsCommand() {
|
|
146
|
+
console.log();
|
|
147
|
+
output.brandBold(" Bankr AI Agent Skills");
|
|
148
|
+
console.log();
|
|
149
|
+
output.dim(" Full docs: https://docs.bankr.bot");
|
|
150
|
+
for (const skill of SKILLS) {
|
|
151
|
+
console.log();
|
|
152
|
+
output.brandBold(` ${skill.name}`);
|
|
153
|
+
console.log();
|
|
154
|
+
for (const ex of skill.examples) {
|
|
155
|
+
output.dim(` ${ex}`);
|
|
156
|
+
}
|
|
157
|
+
console.log();
|
|
158
|
+
output.muted(` [${skill.chains}]`);
|
|
159
|
+
}
|
|
160
|
+
console.log();
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/commands/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAC/D,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAQvD,MAAM,MAAM,GAAY;IACtB;QACE,IAAI,EAAE,6BAA6B;QACnC,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE;YACR,+BAA+B;YAC/B,2BAA2B;YAC3B,6BAA6B;YAC7B,kCAAkC;YAClC,qCAAqC;SACtC;KACF;IACD;QACE,IAAI,EAAE,kCAAkC;QACxC,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE;YACR,sBAAsB;YACtB,uCAAuC;YACvC,wBAAwB;YACxB,qCAAqC;YACrC,mCAAmC;YACnC,2BAA2B;YAC3B,mCAAmC;YACnC,yCAAyC;SAC1C;KACF;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE;YACR,qCAAqC;YACrC,oCAAoC;YACpC,uCAAuC;YACvC,uCAAuC;YACvC,+CAA+C;SAChD;KACF;IACD;QACE,IAAI,EAAE,mCAAmC;QACzC,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE;YACR,iCAAiC;YACjC,yBAAyB;YACzB,kCAAkC;YAClC,4BAA4B;YAC5B,oCAAoC;YACpC,6CAA6C;Y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rC,+BAA+B;YAC/B,sCAAsC;YACtC,sCAAsC;YACtC,wCAAwC;YACxC,mCAAmC;SACpC;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IAElD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAyCA,wBAAsB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBlE;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DEFAULT_API_URL, DEFAULT_LLM_URL, getConfigPath, readConfig, writeConfig, } from "../lib/config.js";
|
|
2
|
+
import * as output from "../lib/output.js";
|
|
3
|
+
const ALLOWED_KEYS = ["apiKey", "apiUrl", "llmUrl"];
|
|
4
|
+
const KEY_LABELS = {
|
|
5
|
+
apiKey: "Bankr API Key",
|
|
6
|
+
apiUrl: "Bankr API URL",
|
|
7
|
+
llmUrl: "Bankr LLM Gateway URL",
|
|
8
|
+
};
|
|
9
|
+
function isValidKey(key) {
|
|
10
|
+
return ALLOWED_KEYS.includes(key);
|
|
11
|
+
}
|
|
12
|
+
function requireValidKey(key) {
|
|
13
|
+
if (!isValidKey(key)) {
|
|
14
|
+
output.error(`Unknown config key "${key}". Valid keys: ${ALLOWED_KEYS.join(", ")}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function displayValue(key, value) {
|
|
19
|
+
return key === "apiKey" ? output.maskApiKey(value) : value;
|
|
20
|
+
}
|
|
21
|
+
function fallbackValue(key) {
|
|
22
|
+
if (key === "apiUrl")
|
|
23
|
+
return `(default: ${DEFAULT_API_URL})`;
|
|
24
|
+
if (key === "llmUrl")
|
|
25
|
+
return `(default: ${DEFAULT_LLM_URL})`;
|
|
26
|
+
return "(not set)";
|
|
27
|
+
}
|
|
28
|
+
export async function configGetCommand(key) {
|
|
29
|
+
const config = readConfig();
|
|
30
|
+
if (key) {
|
|
31
|
+
requireValidKey(key);
|
|
32
|
+
const value = config[key];
|
|
33
|
+
if (value !== undefined) {
|
|
34
|
+
console.log(displayValue(key, value));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
output.dim(fallbackValue(key));
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
output.label("Config file", getConfigPath());
|
|
42
|
+
console.log();
|
|
43
|
+
for (const k of ALLOWED_KEYS) {
|
|
44
|
+
const value = config[k];
|
|
45
|
+
const display = value !== undefined ? displayValue(k, value) : fallbackValue(k);
|
|
46
|
+
output.label(KEY_LABELS[k], display);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export async function configSetCommand(key, value) {
|
|
50
|
+
requireValidKey(key);
|
|
51
|
+
const config = readConfig();
|
|
52
|
+
config[key] = value;
|
|
53
|
+
writeConfig(config);
|
|
54
|
+
output.success(`Set ${KEY_LABELS[key]} = ${displayValue(key, value)}`);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG7D,MAAM,UAAU,GAA8B;IAC5C,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,uBAAuB;CAChC,CAAC;AAEF,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAgB,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,KAAK,CACV,uBAAuB,GAAG,kBAAkB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,GAAc,EAAE,KAAa;IACjD,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7D,CAAC;AAED,SAAS,aAAa,CAAC,GAAc;IACnC,IAAI,GAAG,KAAK,QAAQ;QAAE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