@belugafinancial/advisor-cli 0.1.0 → 0.3.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.
@@ -0,0 +1,17 @@
1
+ export interface InitArgs {
2
+ /** Base64-encoded 64-byte ed25519 secret to import. Mutually exclusive with keypairFile. */
3
+ keypairBase64?: string;
4
+ /** Path to a Solana keygen JSON (int array) to import. Mutually exclusive with keypairBase64. */
5
+ keypairFile?: string;
6
+ rpcUrl?: string;
7
+ programId?: string;
8
+ feeBps?: number;
9
+ autoAccept?: boolean;
10
+ autoExecute?: boolean;
11
+ watchIntervalMs?: number;
12
+ configPath?: string;
13
+ installSkill: boolean;
14
+ /** Skip prompts entirely; use provided flags + defaults. */
15
+ yes: boolean;
16
+ }
17
+ export declare function initCommand(args: InitArgs): Promise<void>;
@@ -0,0 +1,186 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join } from "node:path";
4
+ import { createInterface } from "node:readline/promises";
5
+ import { stdin, stdout } from "node:process";
6
+ import { Keypair } from "@solana/web3.js";
7
+ import { BELUGA_PROGRAM_ID_MAINNET, deriveX25519Keypair, loadKeypairFromBase64, } from "@belugafinancial/advisor-sdk";
8
+ import { installSkillCommand } from "./install-skill.js";
9
+ const DEFAULT_CONFIG_PATH = join(homedir(), ".openclaw", "openclaw.json");
10
+ const DEFAULT_RPC = "https://api.mainnet-beta.solana.com";
11
+ const DEFAULT_FEE_BPS = 50;
12
+ const DEFAULT_WATCH_INTERVAL_MS = 30_000;
13
+ const INVITE_BASE = "https://app.beluga.financial/invite";
14
+ const RECOMMENDED_FUNDING_SOL = 0.05;
15
+ function loadKeypairFromFile(path) {
16
+ if (!existsSync(path)) {
17
+ throw new Error(`Keypair file not found: ${path}`);
18
+ }
19
+ const parsed = JSON.parse(readFileSync(path, "utf-8"));
20
+ if (!Array.isArray(parsed)) {
21
+ throw new Error(`Keypair file ${path} is not a Solana keygen JSON array.`);
22
+ }
23
+ return Keypair.fromSecretKey(Uint8Array.from(parsed));
24
+ }
25
+ function resolveKeypair(args) {
26
+ if (args.keypairBase64 && args.keypairFile) {
27
+ throw new Error("Pass at most one of --keypair-base64 / --keypair-file.");
28
+ }
29
+ if (args.keypairBase64)
30
+ return loadKeypairFromBase64(args.keypairBase64);
31
+ if (args.keypairFile)
32
+ return loadKeypairFromFile(args.keypairFile);
33
+ return Keypair.generate();
34
+ }
35
+ async function promptYesNo(rl, question, defaultYes) {
36
+ const suffix = defaultYes ? " [Y/n]: " : " [y/N]: ";
37
+ const answer = (await rl.question(question + suffix)).trim().toLowerCase();
38
+ if (!answer)
39
+ return defaultYes;
40
+ return answer === "y" || answer === "yes";
41
+ }
42
+ async function promptString(rl, question, defaultValue) {
43
+ const answer = (await rl.question(`${question} [${defaultValue}]: `)).trim();
44
+ return answer || defaultValue;
45
+ }
46
+ async function promptInt(rl, question, defaultValue) {
47
+ const answer = (await rl.question(`${question} [${defaultValue}]: `)).trim();
48
+ if (!answer)
49
+ return defaultValue;
50
+ const n = parseInt(answer, 10);
51
+ if (!Number.isFinite(n)) {
52
+ throw new Error(`${question}: expected an integer, got ${answer}`);
53
+ }
54
+ return n;
55
+ }
56
+ async function resolveConfig(args) {
57
+ const interactive = !args.yes && stdin.isTTY;
58
+ const keypair = resolveKeypair(args);
59
+ const x25519 = deriveX25519Keypair(keypair);
60
+ const keypairBase64 = Buffer.from(keypair.secretKey).toString("base64");
61
+ if (!interactive) {
62
+ return {
63
+ keypairBase64,
64
+ pubkey: keypair.publicKey.toBase58(),
65
+ x25519Pubkey: Buffer.from(x25519.publicKey).toString("base64"),
66
+ rpcUrl: args.rpcUrl ?? DEFAULT_RPC,
67
+ programId: args.programId ?? BELUGA_PROGRAM_ID_MAINNET,
68
+ feeBps: args.feeBps ?? DEFAULT_FEE_BPS,
69
+ autoAccept: args.autoAccept ?? true,
70
+ autoExecute: args.autoExecute ?? true,
71
+ watchIntervalMs: args.watchIntervalMs ?? DEFAULT_WATCH_INTERVAL_MS,
72
+ configPath: args.configPath ?? DEFAULT_CONFIG_PATH,
73
+ };
74
+ }
75
+ const rl = createInterface({ input: stdin, output: stdout });
76
+ try {
77
+ process.stderr.write(`\nGenerated advisor pubkey: ${keypair.publicKey.toBase58()}\n\n`);
78
+ const rpcUrl = args.rpcUrl ?? await promptString(rl, "Solana RPC URL", DEFAULT_RPC);
79
+ const feeBps = args.feeBps ?? await promptInt(rl, "Default advisor fee (bps)", DEFAULT_FEE_BPS);
80
+ const autoAccept = args.autoAccept
81
+ ?? await promptYesNo(rl, "Auto-accept new client invitations in watch mode?", true);
82
+ const autoExecute = args.autoExecute
83
+ ?? await promptYesNo(rl, "Auto-execute approved proposals in watch mode?", true);
84
+ const configPath = args.configPath ?? DEFAULT_CONFIG_PATH;
85
+ return {
86
+ keypairBase64,
87
+ pubkey: keypair.publicKey.toBase58(),
88
+ x25519Pubkey: Buffer.from(x25519.publicKey).toString("base64"),
89
+ rpcUrl,
90
+ programId: args.programId ?? BELUGA_PROGRAM_ID_MAINNET,
91
+ feeBps,
92
+ autoAccept,
93
+ autoExecute,
94
+ watchIntervalMs: args.watchIntervalMs ?? DEFAULT_WATCH_INTERVAL_MS,
95
+ configPath,
96
+ };
97
+ }
98
+ finally {
99
+ rl.close();
100
+ }
101
+ }
102
+ function mergeOpenClawConfig(configPath, resolved) {
103
+ let existing = {};
104
+ let previouslyExisted = false;
105
+ if (existsSync(configPath)) {
106
+ previouslyExisted = true;
107
+ try {
108
+ existing = JSON.parse(readFileSync(configPath, "utf-8"));
109
+ }
110
+ catch (err) {
111
+ throw new Error(`Could not parse existing config at ${configPath}: ${err instanceof Error ? err.message : err}`);
112
+ }
113
+ }
114
+ const skills = (existing.skills ??= {});
115
+ const entries = (skills.entries ??= {});
116
+ entries["beluga-advisor"] = {
117
+ enabled: true,
118
+ env: {
119
+ BELUGA_ADVISOR_KEYPAIR: resolved.keypairBase64,
120
+ SOLANA_RPC_URL: resolved.rpcUrl,
121
+ BELUGA_PROGRAM_ID: resolved.programId,
122
+ BELUGA_ACCEPT_FEE_BPS: String(resolved.feeBps),
123
+ BELUGA_AUTO_ACCEPT: String(resolved.autoAccept),
124
+ BELUGA_AUTO_EXECUTE: String(resolved.autoExecute),
125
+ BELUGA_WATCH_INTERVAL_MS: String(resolved.watchIntervalMs),
126
+ },
127
+ };
128
+ mkdirSync(dirname(configPath), { recursive: true });
129
+ writeFileSync(configPath, JSON.stringify(existing, null, 2) + "\n");
130
+ return { previouslyExisted };
131
+ }
132
+ export async function initCommand(args) {
133
+ const resolved = await resolveConfig(args);
134
+ const { previouslyExisted } = mergeOpenClawConfig(resolved.configPath, resolved);
135
+ let skillResult = null;
136
+ if (args.installSkill) {
137
+ try {
138
+ // installSkillCommand writes JSON to stdout itself; capture by swapping
139
+ // stdout briefly so the final init JSON stays the only stdout payload.
140
+ const chunks = [];
141
+ const orig = stdout.write.bind(stdout);
142
+ stdout.write = ((chunk) => {
143
+ chunks.push(typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf-8"));
144
+ return true;
145
+ });
146
+ try {
147
+ installSkillCommand({ destination: undefined, force: true });
148
+ }
149
+ finally {
150
+ stdout.write = orig;
151
+ }
152
+ const last = chunks.join("").trim().split("\n").pop();
153
+ skillResult = last ? JSON.parse(last) : null;
154
+ }
155
+ catch (err) {
156
+ process.stderr.write(`[init] install-skill failed: ${err instanceof Error ? err.message : err}\n`);
157
+ }
158
+ }
159
+ const inviteUrl = `${INVITE_BASE}?advisor=${resolved.pubkey}`;
160
+ process.stderr.write(`\n✓ Wrote skill config to ${resolved.configPath}` +
161
+ `${previouslyExisted ? " (merged into existing file)" : ""}\n` +
162
+ (args.installSkill ? `✓ Installed OpenClaw skill\n` : "") +
163
+ `\nAdvisor pubkey: ${resolved.pubkey}\n` +
164
+ `Invite URL: ${inviteUrl}\n` +
165
+ `\nNext steps:\n` +
166
+ ` 1. Fund the advisor pubkey above with a little SOL.\n` +
167
+ ` This is the agent's address — it pays gas on every transaction\n` +
168
+ ` it signs (accepting your invitation, executing your approved\n` +
169
+ ` proposals). ~${RECOMMENDED_FUNDING_SOL} SOL is plenty for low-volume use.\n` +
170
+ ` 2. Open the invite URL in the Beluga app and sign the invitation\n` +
171
+ ` from your client wallet. That delegates trade-proposal authority\n` +
172
+ ` to the agent so it can advise your vault.\n` +
173
+ ` 3. Restart your OpenClaw agent so it picks up the new skill config.\n`);
174
+ process.stdout.write(JSON.stringify({
175
+ pubkey: resolved.pubkey,
176
+ x25519Pubkey: resolved.x25519Pubkey,
177
+ inviteUrl,
178
+ fundingAddress: resolved.pubkey,
179
+ recommendedFundingSol: RECOMMENDED_FUNDING_SOL,
180
+ configPath: resolved.configPath,
181
+ configMerged: previouslyExisted,
182
+ skillInstalled: skillResult !== null,
183
+ skill: skillResult,
184
+ }, null, 2) + "\n");
185
+ }
186
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,eAAe,C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D,qBAAqB,QAAQ,CAAC,MAAM,IAAI;QACxC,mBAAmB,SAAS,IAAI;QAChC,iBAAiB;QACjB,yDAAyD;QACzD,uEAAuE;QACvE,qEAAqE;QACrE,qBAAqB,uBAAuB,sCAAsC;QAClF,sEAAsE;QACtE,yEAAyE;QACzE,kDAAkD;QAClD,yEAAyE,CAC1E,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,SAAS;QACT,cAAc,EAAE,QAAQ,CAAC,MAAM;QAC/B,qBAAqB,EAAE,uBAAuB;QAC9C,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,YAAY,EAAE,iBAAiB;QAC/B,cAAc,EAAE,WAAW,KAAK,IAAI;QACpC,KAAK,EAAE,WAAW;KACnB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { BelugaAdvisor } from "@belugafinancial/advisor-sdk";
2
+ export declare function portfolioCommand(advisor: BelugaAdvisor): Promise<void>;
@@ -0,0 +1,33 @@
1
+ export async function portfolioCommand(advisor) {
2
+ const accounts = await advisor.portfolio();
3
+ // bigints don't survive JSON.stringify by default; serialize amounts as strings.
4
+ const serializable = accounts.map((acct) => ({
5
+ ...acct,
6
+ holdings: acct.holdings.map((h) => ({
7
+ mint: h.mint,
8
+ amount: h.amount.toString(),
9
+ decimals: h.decimals,
10
+ uiAmount: Number(h.amount) / Math.pow(10, h.decimals),
11
+ })),
12
+ }));
13
+ const summary = {
14
+ advisor: advisor.pubkey.toBase58(),
15
+ x25519Pubkey: Buffer.from(advisor.x25519.publicKey).toString("base64"),
16
+ totalAccounts: accounts.length,
17
+ activeAccounts: accounts.filter((a) => a.status === "active").length,
18
+ pendingAccounts: accounts.filter((a) => a.status === "pending").length,
19
+ actionItems: {
20
+ pendingInvitations: accounts
21
+ .filter((a) => a.status === "pending")
22
+ .map((a) => ({ advisoryAccount: a.address, owner: a.owner })),
23
+ approvedProposals: accounts.flatMap((a) => a.approvedProposalAddresses.map((addr) => ({
24
+ proposalAddress: addr,
25
+ advisoryAccount: a.address,
26
+ owner: a.owner,
27
+ }))),
28
+ },
29
+ accounts: serializable,
30
+ };
31
+ process.stdout.write(JSON.stringify(summary, null, 2) + "\n");
32
+ }
33
+ //# sourceMappingURL=portfolio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portfolio.js","sourceRoot":"","sources":["../../src/commands/portfolio.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAsB;IAC3D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;IAE3C,iFAAiF;IACjF,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3C,GAAG,IAAI;QACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC3B,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC;SACtD,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;IAEJ,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;QAClC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACtE,aAAa,EAAE,QAAQ,CAAC,MAAM;QAC9B,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,MAAM;QACpE,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,MAAM;QACtE,WAAW,EAAE;YACX,kBAAkB,EAAE,QAAQ;iBACzB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;iBACrC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YAC/D,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACxC,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACzC,eAAe,EAAE,IAAI;gBACrB,eAAe,EAAE,CAAC,CAAC,OAAO;gBAC1B,KAAK,EAAE,CAAC,CAAC,KAAK;aACf,CAAC,CAAC,CACJ;SACF;QACD,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAChE,CAAC"}
package/dist/index.js CHANGED
@@ -4,12 +4,19 @@ import { statusCommand } from "./commands/status.js";
4
4
  import { acceptCommand } from "./commands/accept.js";
5
5
  import { proposeCommand } from "./commands/propose.js";
6
6
  import { executeCommand } from "./commands/execute.js";
7
+ import { initCommand } from "./commands/init.js";
7
8
  import { installSkillCommand } from "./commands/install-skill.js";
9
+ import { portfolioCommand } from "./commands/portfolio.js";
8
10
  import { watchStartCommand, watchStatusCommand, watchStopCommand, } from "./commands/watch.js";
9
11
  const HELP = `beluga-advisor — operate a Beluga advisor account from the command line.
10
12
 
11
13
  Usage:
14
+ beluga-advisor init [--yes] [--rpc-url <url>] [--fee-bps <n>]
15
+ [--auto-accept true|false] [--auto-execute true|false]
16
+ [--keypair-base64 <secret> | --keypair-file <path>]
17
+ [--config-path <path>] [--no-install-skill]
12
18
  beluga-advisor install-skill [--destination <dir>] [--force]
19
+ beluga-advisor portfolio
13
20
  beluga-advisor status
14
21
  beluga-advisor accept [<advisory-account-address>] [--fee-bps <n>]
15
22
  beluga-advisor propose <advisory-account-address> [--payload <file|->] [--payload-json <json>]
@@ -19,8 +26,8 @@ Usage:
19
26
  beluga-advisor watch status
20
27
  beluga-advisor pubkey
21
28
 
22
- Environment:
23
- BELUGA_ADVISOR_KEYPAIR base64 64-byte ed25519 secret (required for all commands except install-skill)
29
+ Environment (set automatically by \`init\`):
30
+ BELUGA_ADVISOR_KEYPAIR base64 64-byte ed25519 secret (required for ops commands)
24
31
  SOLANA_RPC_URL RPC endpoint (default: mainnet-beta)
25
32
  BELUGA_PROGRAM_ID program ID (default: mainnet)
26
33
  BELUGA_WATCH_INTERVAL_MS watch tick interval in ms (default: 30000)
@@ -60,6 +67,31 @@ async function main() {
60
67
  force: rest.includes("--force"),
61
68
  });
62
69
  }
70
+ if (command === "init") {
71
+ const parseBool = (v) => {
72
+ if (v === undefined)
73
+ return undefined;
74
+ if (v === "true")
75
+ return true;
76
+ if (v === "false")
77
+ return false;
78
+ throw new Error(`Expected true|false, got ${v}`);
79
+ };
80
+ const parseInt10 = (v) => v === undefined ? undefined : parseInt(v, 10);
81
+ return initCommand({
82
+ keypairBase64: getFlag(rest, "keypair-base64"),
83
+ keypairFile: getFlag(rest, "keypair-file"),
84
+ rpcUrl: getFlag(rest, "rpc-url"),
85
+ programId: getFlag(rest, "program-id"),
86
+ feeBps: parseInt10(getFlag(rest, "fee-bps")),
87
+ autoAccept: parseBool(getFlag(rest, "auto-accept")),
88
+ autoExecute: parseBool(getFlag(rest, "auto-execute")),
89
+ watchIntervalMs: parseInt10(getFlag(rest, "watch-interval-ms")),
90
+ configPath: getFlag(rest, "config-path"),
91
+ installSkill: !rest.includes("--no-install-skill"),
92
+ yes: rest.includes("--yes") || rest.includes("-y"),
93
+ });
94
+ }
63
95
  const env = loadEnv();
64
96
  const advisor = buildAdvisor(env);
65
97
  switch (command) {
@@ -69,6 +101,9 @@ async function main() {
69
101
  x25519Pubkey: Buffer.from(advisor.x25519.publicKey).toString("base64"),
70
102
  }) + "\n");
71
103
  return;
104
+ case "portfolio":
105
+ await portfolioCommand(advisor);
106
+ return;
72
107
  case "status":
73
108
  await statusCommand(advisor);
74
109
  return;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBZ,CAAC;AAEF,SAAS,OAAO,CAAC,IAAc,EAAE,IAAY;IAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAA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I,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC/D,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,11 +1,10 @@
1
1
  ---
2
2
  name: beluga-advisor
3
- description: Operate a Beluga advisor account on Solana — accept advisory accounts, build encrypted swap proposals on client vaults, and execute approved proposals. Use whenever the user wants to act as an advisor on a Beluga vault, propose trades for a client, check pending or approved proposals, or run an automated watcher that handles the boring parts of the lifecycle.
3
+ description: Be the user's Beluga advisor. The user is a Beluga client — they own a vault and have delegated trade-proposal authority to this skill's keypair. The skill IS their advisor: it forms opinions on what trades to propose, drafts encrypted swap proposals against the user's vault, and executes them once the user approves in the Beluga app. Activate whenever the user mentions Beluga, their vault, holdings the agent should manage, or a swap they're considering.
4
4
  metadata:
5
5
  openclaw:
6
6
  requires:
7
7
  bins: [beluga-advisor]
8
- env: [BELUGA_ADVISOR_KEYPAIR]
9
8
  install:
10
9
  node:
11
10
  package: "@belugafinancial/advisor-cli"
@@ -15,60 +14,126 @@ metadata:
15
14
 
16
15
  # Beluga Advisor
17
16
 
18
- Beluga is a Solana investment advisory platform. Advisors propose swaps on
19
- client vaults; clients approve or reject them. The on-chain program handles
20
- custody, fees, and execution via Raydium AMMs.
17
+ Beluga is a Solana investment advisory platform. A *client* owns a vault and
18
+ custodies the assets themselves; an *advisor* holds a Solana keypair that
19
+ authorizes them to propose encrypted swap trades against the client's vault.
20
+ The client approves or rejects each proposal in the Beluga app. Only after
21
+ approval can the advisor execute the swap on-chain via Raydium AMMs.
21
22
 
22
- This skill lets the host agent act as an advisor: accept advisory account
23
- invitations, build encrypted swap proposals against a client's vault, and
24
- execute proposals that the client has approved.
23
+ ## Your role
25
24
 
26
- ## When to invoke
25
+ **You — the agent — are the advisor.** The advisor keypair stored in this
26
+ skill's config is *your* identity. You're the entity invited on-chain, you
27
+ draft the proposals, you sign the execution transactions. You are paid the
28
+ configured fee for trades you successfully execute.
27
29
 
28
- - The user asks to check on Beluga clients, advisory accounts, vault balances,
29
- or pending/approved proposals.
30
- - The user describes a trade they want to suggest to a Beluga client and the
31
- trade involves a Raydium-listed token.
32
- - The user wants to run a background watcher that auto-accepts new advisory
33
- accounts and auto-executes approved proposals.
34
- - The agent is operating autonomously on a Beluga deployment and needs to
35
- handle the lifecycle of advisory accounts.
30
+ **The user is the client.** They own a Beluga vault, they invited your
31
+ pubkey to advise it, they bear custody of the assets, and every proposal
32
+ you submit must be approved by them in the Beluga app before you can
33
+ execute it. You cannot move their funds without their approval.
36
34
 
37
- ## Setup
35
+ Speak from this perspective. "Your vault holds $4,200 in USDC" — not "the
36
+ client's vault." "I think we should swap 30% to SOL" — not "the advisor
37
+ recommends." "Approve the proposal I just sent in the Beluga app" — not
38
+ "the proposal needs approval."
38
39
 
39
- 1. Generate or supply a Solana keypair. Set the base64 64-byte secret as
40
- `BELUGA_ADVISOR_KEYPAIR` in the skill config.
41
- 2. Optionally set `SOLANA_RPC_URL` (defaults to mainnet-beta) and
42
- `BELUGA_PROGRAM_ID` (defaults to mainnet program).
43
- 3. Run `beluga-advisor pubkey` to print the advisor pubkey. This is the
44
- address the client will invite via the Beluga app:
45
- `https://app.beluga.financial/invite?advisor=<pubkey>`.
40
+ (Edge case: the same advisor pubkey can be invited by *multiple* Beluga
41
+ clients. If `beluga-advisor portfolio` returns more than one advisory
42
+ account, brief the user on each — the user is one of them, the others are
43
+ people who have separately invited you. Treat each as a distinct advisory
44
+ relationship.)
46
45
 
47
- ## Commands
46
+ ## First contact: brief, don't menu
48
47
 
49
- All commands print JSON to stdout and human-readable status to stderr.
48
+ When the user opens this skill (`/beluga_advisor`, "show me my Beluga
49
+ vault", "what should I trade", or any vague entry), your **first action**
50
+ is to run:
50
51
 
51
- ### Inspect state
52
+ ```
53
+ beluga-advisor portfolio
54
+ ```
55
+
56
+ Read the JSON, then open with a portfolio briefing — never a menu of
57
+ options. For each advisory account, cover in this order:
58
+
59
+ 1. **Vault state.** Holdings (mint addresses if you don't recognize the
60
+ symbols — look them up via web search), and any in-flight proposals.
61
+ 2. **Action items.**
62
+ - Approved proposals waiting for *you* to execute on-chain. Offer to
63
+ execute them now.
64
+ - Pending invitations (clients who invited you but you haven't accepted
65
+ yet). Offer to accept.
66
+ - Drift / opportunities you spotted while reading the holdings.
67
+ 3. **A recommendation, not a question.** Form an opinion. End the briefing
68
+ with one or two specific trade ideas — what would *you* do next, and
69
+ why. Don't fall back to "what would you like to do?" until the user has
70
+ seen your read.
71
+
72
+ If the portfolio is empty (no advisory accounts yet), the user hasn't
73
+ invited you to advise anything. Show them your pubkey and the invite URL
74
+ from `beluga-advisor pubkey` and tell them to invite you from the Beluga
75
+ app.
76
+
77
+ ## Forming recommendations
78
+
79
+ You are expected to bring market judgment to every interaction. Use every
80
+ tool available to you:
81
+
82
+ - **Web search** for current token prices, recent news on each holding,
83
+ sector trends, and the user's broader thesis if they've shared one.
84
+ - **Other skills** the user has installed — DeFi data feeds, on-chain
85
+ analytics, news aggregators, anything that helps inform the call.
86
+ - **The vault data itself** — concentration risk, idle stablecoin balances
87
+ that should be deployed, holdings that have drifted from the user's
88
+ stated allocation.
89
+
90
+ A useful recommendation is *specific*: "swap 30% of your USDC into SOL —
91
+ SOL is up 8% this week on a Raydium volume surge, and your vault is 100%
92
+ USDC right now which is a missed opportunity given the growth thesis you
93
+ mentioned last week." Not: "you could consider rebalancing".
94
+
95
+ When the user accepts a recommendation, draft and submit the proposal
96
+ yourself (see "Propose a swap" below). Then tell them to **open the
97
+ Beluga app and approve** — without their approval you can't execute.
98
+ When they reject, ask one clarifying question and adapt.
99
+
100
+ ## The CLI you operate
101
+
102
+ All commands print JSON to stdout and human-readable status to stderr. You
103
+ read the JSON; the user reads your synthesis.
104
+
105
+ ### Portfolio briefing — your default open
106
+
107
+ ```
108
+ beluga-advisor portfolio
109
+ ```
110
+
111
+ Returns: every advisory account where you're the advisor, with each
112
+ account's status, fee, holdings (mint + raw amount + decimals + uiAmount),
113
+ and proposal action items (pending invitations from clients, approved
114
+ proposals waiting for you to execute). Run this on first contact and any
115
+ time the user asks "what's going on" or you need refreshed state.
116
+
117
+ ### Inspect proposal state
52
118
 
53
119
  ```
54
120
  beluga-advisor status
55
121
  ```
56
122
 
57
- Returns the advisor's advisory accounts (pending and active), their proposal
58
- counts, and the addresses of any approved proposals waiting to be executed.
59
- Run this first whenever the user asks "what's going on" or you need to know
60
- which clients have what state.
123
+ Lighter than `portfolio` — accounts and proposal counts, no balances. Use
124
+ this when you only need to check whether something has changed.
61
125
 
62
126
  ### Accept a pending advisory account
63
127
 
64
128
  ```
65
- beluga-advisor accept # accept ALL pending accounts
66
- beluga-advisor accept <advisory-account> # accept a specific one
67
- beluga-advisor accept --fee-bps 75 # override default 50bps fee
129
+ beluga-advisor accept # accept ALL pending invites
130
+ beluga-advisor accept <advisory-account> # accept one
131
+ beluga-advisor accept --fee-bps 75 # override fee
68
132
  ```
69
133
 
70
- When a client invites this advisor, an advisory account appears with status
71
- `pending`. Accepting locks in the fee and activates the relationship.
134
+ Used when the user (or another client) has invited you and you haven't
135
+ accepted yet. Accepting locks in your fee. Default fee comes from
136
+ `BELUGA_ACCEPT_FEE_BPS`.
72
137
 
73
138
  ### Propose a swap
74
139
 
@@ -92,19 +157,25 @@ The payload JSON shape is:
92
157
  }
93
158
  ```
94
159
 
95
- - `amount` and `other_amount_threshold` are in raw token units (lamports for
96
- SOL, microUSDC for USDC, etc.). The agent must look up token decimals before
97
- building the payload.
98
- - `a_to_b: true` means swap mint_a → mint_b. `amount_specified_is_input: true`
99
- means `amount` is the input amount; `other_amount_threshold` is the minimum
100
- acceptable output (slippage protection).
101
- - `pool_type` is `"cpmm"` for Raydium constant-product or `"clmm"` for
102
- concentrated-liquidity pools.
103
- - `rationale` is encrypted and shown to the client only — keep it concise
104
- (under ~200 chars) since the on-chain envelope is capped at 512 bytes.
105
-
106
- The proposal is encrypted with the client's x25519 public key (read from the
107
- advisory account on-chain) so only the client and this advisor can decrypt it.
160
+ - `amount` and `other_amount_threshold` are in raw token units (lamports
161
+ for SOL, microUSDC for USDC, etc.). Look up token decimals via web
162
+ search or on-chain mint metadata before building the payload.
163
+ - `a_to_b: true` means swap `mint_a → mint_b`. `amount_specified_is_input:
164
+ true` means `amount` is the input amount; `other_amount_threshold` is
165
+ the minimum acceptable output (slippage protection).
166
+ - `pool` is a Raydium pool — find one via web search of Raydium's pool
167
+ list or their API. `pool_type` is `"cpmm"` for constant-product or
168
+ `"clmm"` for concentrated-liquidity.
169
+ - `rationale` is encrypted on-chain and shown to the client only — keep
170
+ it concise (under ~200 chars) since the envelope is capped at 512
171
+ bytes. The client (your user) sees this when deciding whether to
172
+ approve, so make it persuasive but honest.
173
+
174
+ The proposal is encrypted with the client's x25519 public key (read from
175
+ the advisory account on-chain) so only the client and you can decrypt it.
176
+
177
+ After you submit, **always tell the user to open the Beluga app and
178
+ approve the proposal**. Until they approve, you cannot execute it.
108
179
 
109
180
  ### Execute approved proposals
110
181
 
@@ -114,10 +185,11 @@ beluga-advisor execute <proposal-address> # execute one
114
185
  beluga-advisor execute --account <advisory-account> # all approved on one client
115
186
  ```
116
187
 
117
- Once a client approves a proposal in the Beluga app, the advisor can execute
118
- it. The CLI handles vault initialization and Raydium routing automatically.
188
+ Once the user (or another client) has approved a proposal in the Beluga
189
+ app, this command pushes it on-chain. Vault initialization and Raydium
190
+ routing are automatic.
119
191
 
120
- ### Watch mode (long-running)
192
+ ### Watch mode (background lifecycle)
121
193
 
122
194
  ```
123
195
  beluga-advisor watch start # spawn background daemon
@@ -125,30 +197,86 @@ beluga-advisor watch status # is it running?
125
197
  beluga-advisor watch stop # kill the daemon
126
198
  ```
127
199
 
128
- The watcher polls every 30 seconds (configurable via `BELUGA_WATCH_INTERVAL_MS`)
129
- and, by default, auto-accepts pending advisory accounts and auto-executes any
130
- proposals the client has approved. It does NOT auto-propose — proposing is
131
- left to the host agent's strategy logic.
200
+ The watcher polls every 30 seconds and, by default, auto-accepts pending
201
+ client invitations and auto-executes approved proposals. It does NOT
202
+ auto-propose — proposing is your job (you, the agent, decide what to
203
+ suggest).
204
+
205
+ To opt out, set `BELUGA_AUTO_ACCEPT=false` or `BELUGA_AUTO_EXECUTE=false`
206
+ in the skill config.
207
+
208
+ ## First-time setup (chat-driven)
209
+
210
+ Use this when `BELUGA_ADVISOR_KEYPAIR` is not yet set, or when the user
211
+ asks to "set up Beluga", "create my advisor", or similar. Common trigger
212
+ phrasings: "/init-beluga-advisor", "configure beluga", "set me up".
213
+
214
+ Frame it as creating *your* (the agent's) Beluga identity — the keypair
215
+ you'll use to advise the user's vault. Walk the user through these
216
+ questions in chat, accepting the default for anything they don't have an
217
+ opinion on:
218
+
219
+ 1. **Keypair** — "Should I generate a fresh advisor identity, or use one
220
+ you already have?" Default: generate. If they have one, ask whether
221
+ they have a base64-encoded 64-byte secret or a Solana keygen JSON
222
+ file.
223
+ 2. **RPC URL** — "Which Solana RPC should I use?"
224
+ Default: `https://api.mainnet-beta.solana.com`. Recommend a private
225
+ RPC (QuikNode/Helius/Triton) if they plan to run watch mode.
226
+ 3. **Fee** — "What fee should I charge per trade, in basis points?"
227
+ Default: 50 (0.5%). Range: 0 – ~500. (This is the fee you collect on
228
+ every executed trade, paid out of the input mint.)
229
+ 4. **Auto-accept** — "Should the watcher auto-accept new client invitations
230
+ I receive?" Default: yes.
231
+ 5. **Auto-execute** — "Should the watcher auto-execute proposals once
232
+ you've approved them in the Beluga app?" Default: yes.
233
+
234
+ Then run init non-interactively with the answers:
235
+
236
+ ```
237
+ beluga-advisor init --yes \
238
+ --rpc-url <answer> \
239
+ --fee-bps <answer> \
240
+ --auto-accept <true|false> \
241
+ --auto-execute <true|false>
242
+ ```
243
+
244
+ (Add `--keypair-base64 <secret>` or `--keypair-file <path>` only if the
245
+ user chose to import an existing keypair.)
246
+
247
+ `init` writes a merged config to `~/.openclaw/openclaw.json`, installs
248
+ (or re-installs) the skill, and prints a JSON object containing your new
249
+ advisor pubkey and an invite URL the user should open.
250
+
251
+ After init succeeds, tell the user (in this order — funding comes first
252
+ because you can't transact without SOL):
132
253
 
133
- To opt out of either behavior, set `BELUGA_AUTO_ACCEPT=false` or
134
- `BELUGA_AUTO_EXECUTE=false` in the skill config.
254
+ 1. **Fund the advisor pubkey.** Show your new pubkey from the JSON output
255
+ and tell them to send a small amount of SOL to it (~0.05 SOL is plenty
256
+ for low-volume use). You can't accept their invitation or execute
257
+ proposals until this address holds SOL.
258
+ 2. **Open the invite URL** in the Beluga app and confirm the invitation
259
+ from their wallet — that's how they (the client) invite you (the
260
+ advisor) on-chain.
261
+ 3. **Restart OpenClaw** so it picks up the new env from
262
+ `~/.openclaw/openclaw.json`.
135
263
 
136
- The watcher is a detached child process. Its PID lives at
137
- `~/.beluga-advisor/watch.pid`; if it exits unexpectedly, the file is cleaned
138
- up on next `watch status`.
264
+ After OpenClaw restarts, the watcher (or the next time the user invokes
265
+ the skill) will accept the invitation and you'll be live as their
266
+ advisor.
139
267
 
140
268
  ## Concurrency
141
269
 
142
- The CLI's one-shot commands and the watcher can both run safely against the
143
- same advisor. Already-executed proposals fail idempotently on-chain (the
144
- program rejects double-execution), so a race between the two only produces a
145
- harmless failed transaction.
270
+ The CLI's one-shot commands and the watcher can both run safely. Already-
271
+ executed proposals fail idempotently on-chain (the program rejects double-
272
+ execution), so a race only produces a harmless failed transaction.
146
273
 
147
274
  ## Trust model
148
275
 
149
- - The advisor's keypair only authorizes proposing and executing swaps within
150
- the limits enforced by the on-chain program. It cannot withdraw funds.
151
- - The client retains custody of vault assets and must approve every proposal
152
- before it is executable.
153
- - Encrypted proposal payloads are decryptable by the advisor and the client
154
- only — not by anyone observing the chain.
276
+ - Your keypair only authorizes proposing and executing swaps within the
277
+ limits enforced by the on-chain program. You cannot withdraw the
278
+ client's funds.
279
+ - The client retains custody of their vault assets and must approve every
280
+ proposal in the Beluga app before you can execute it.
281
+ - Encrypted proposal payloads are decryptable by you and the client only
282
+ — not by anyone observing the chain.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belugafinancial/advisor-cli",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Command-line tool to operate a Beluga advisor account: accept invitations, propose encrypted swaps, execute approved proposals, and run a watch daemon for the boring lifecycle bits.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@belugafinancial/advisor-sdk": "^0.1.0",
26
+ "@belugafinancial/advisor-sdk": "^0.3.0",
27
27
  "@solana/web3.js": "^1.98.0"
28
28
  },
29
29
  "devDependencies": {