@sherwoodagent/cli 0.4.0 → 0.5.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/dist/{chat-7655UEFF.js → chat-HHXJOCKN.js} +6 -6
- package/dist/chat-HHXJOCKN.js.map +1 -0
- package/dist/{chunk-J4J7VSMJ.js → chunk-3WZLP6BH.js} +50 -147
- package/dist/chunk-3WZLP6BH.js.map +1 -0
- package/dist/index.js +96 -130
- package/dist/index.js.map +1 -1
- package/dist/{xmtp-3N7K2GIW.js → xmtp-PICTODCB.js} +5 -4
- package/dist/xmtp-PICTODCB.js.map +1 -0
- package/package.json +1 -1
- package/dist/chat-7655UEFF.js.map +0 -1
- package/dist/chunk-J4J7VSMJ.js.map +0 -1
- package/dist/xmtp-3N7K2GIW.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -15,14 +15,12 @@ import {
|
|
|
15
15
|
UNISWAP_QUOTER_V2_ABI,
|
|
16
16
|
VENICE,
|
|
17
17
|
VENICE_STAKING_ABI,
|
|
18
|
-
addTarget,
|
|
19
18
|
approveDepositor,
|
|
20
19
|
cacheGroupId,
|
|
21
20
|
deposit,
|
|
22
21
|
executeBatch,
|
|
23
22
|
getAccount,
|
|
24
23
|
getAgentId,
|
|
25
|
-
getAllowedTargets,
|
|
26
24
|
getAssetDecimals,
|
|
27
25
|
getBalance,
|
|
28
26
|
getChain,
|
|
@@ -40,7 +38,6 @@ import {
|
|
|
40
38
|
ragequit,
|
|
41
39
|
registerAgent,
|
|
42
40
|
removeDepositor,
|
|
43
|
-
removeTarget,
|
|
44
41
|
resolveSyndicate,
|
|
45
42
|
resolveVaultSyndicate,
|
|
46
43
|
setAgentId,
|
|
@@ -51,7 +48,7 @@ import {
|
|
|
51
48
|
setVaultAddress,
|
|
52
49
|
setVeniceApiKey,
|
|
53
50
|
simulateBatch
|
|
54
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-3WZLP6BH.js";
|
|
55
52
|
|
|
56
53
|
// src/index.ts
|
|
57
54
|
import { config as loadDotenv } from "dotenv";
|
|
@@ -437,7 +434,6 @@ async function runLeveredSwap(opts) {
|
|
|
437
434
|
console.log(chalk.bold("Batch calls (6):"));
|
|
438
435
|
console.log(formatBatch(calls));
|
|
439
436
|
console.log();
|
|
440
|
-
const assetAmount = 0n;
|
|
441
437
|
const simSpinner = ora("Simulating via vault...").start();
|
|
442
438
|
try {
|
|
443
439
|
const results = await simulateBatch(calls);
|
|
@@ -472,7 +468,7 @@ async function runLeveredSwap(opts) {
|
|
|
472
468
|
}
|
|
473
469
|
const execSpinner = ora("Executing batch via vault...").start();
|
|
474
470
|
try {
|
|
475
|
-
const txHash = await executeBatch(calls
|
|
471
|
+
const txHash = await executeBatch(calls);
|
|
476
472
|
execSpinner.succeed(`Batch executed: ${txHash}`);
|
|
477
473
|
console.log(chalk.dim(` ${getExplorerUrl(txHash)}`));
|
|
478
474
|
} catch (err) {
|
|
@@ -503,12 +499,6 @@ async function createSyndicate(params) {
|
|
|
503
499
|
asset: params.asset,
|
|
504
500
|
name: params.name,
|
|
505
501
|
symbol: params.symbol,
|
|
506
|
-
caps: {
|
|
507
|
-
maxPerTx: params.maxPerTx,
|
|
508
|
-
maxDailyTotal: params.maxDailyTotal,
|
|
509
|
-
maxBorrowRatio: params.maxBorrowRatio
|
|
510
|
-
},
|
|
511
|
-
initialTargets: params.initialTargets,
|
|
512
502
|
openDeposits: params.openDeposits,
|
|
513
503
|
subdomain: params.subdomain
|
|
514
504
|
}
|
|
@@ -1065,7 +1055,7 @@ function registerVeniceCommands(program2) {
|
|
|
1065
1055
|
}
|
|
1066
1056
|
const execSpinner = ora2("Executing batch via vault...").start();
|
|
1067
1057
|
try {
|
|
1068
|
-
const txHash = await executeBatch(calls
|
|
1058
|
+
const txHash = await executeBatch(calls);
|
|
1069
1059
|
execSpinner.succeed(`Batch executed: ${txHash}`);
|
|
1070
1060
|
console.log(chalk2.dim(` ${getExplorerUrl(txHash)}`));
|
|
1071
1061
|
} catch (err) {
|
|
@@ -1478,7 +1468,7 @@ function registerAllowanceCommands(program2) {
|
|
|
1478
1468
|
}
|
|
1479
1469
|
const execSpinner = ora3("Executing batch via vault...").start();
|
|
1480
1470
|
try {
|
|
1481
|
-
const txHash = await executeBatch(calls
|
|
1471
|
+
const txHash = await executeBatch(calls);
|
|
1482
1472
|
execSpinner.succeed(`Batch executed: ${txHash}`);
|
|
1483
1473
|
console.log(chalk3.dim(` ${getExplorerUrl(txHash)}`));
|
|
1484
1474
|
} catch (err) {
|
|
@@ -1811,6 +1801,56 @@ async function revokeAttestation(schemaUid, attestationUid) {
|
|
|
1811
1801
|
value: 0n
|
|
1812
1802
|
});
|
|
1813
1803
|
}
|
|
1804
|
+
async function queryApprovals(attester) {
|
|
1805
|
+
assertSchemasRegistered();
|
|
1806
|
+
const schemaUid = EAS_SCHEMAS().AGENT_APPROVED;
|
|
1807
|
+
const url = getEasGraphqlUrl();
|
|
1808
|
+
const query2 = `
|
|
1809
|
+
query Approvals($schemaId: String!, $attester: String!) {
|
|
1810
|
+
attestations(
|
|
1811
|
+
where: {
|
|
1812
|
+
schemaId: { equals: $schemaId }
|
|
1813
|
+
attester: { equals: $attester }
|
|
1814
|
+
revoked: { equals: false }
|
|
1815
|
+
}
|
|
1816
|
+
orderBy: [{ time: desc }]
|
|
1817
|
+
) {
|
|
1818
|
+
id
|
|
1819
|
+
attester
|
|
1820
|
+
recipient
|
|
1821
|
+
time
|
|
1822
|
+
data
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
`;
|
|
1826
|
+
const response = await fetch(url, {
|
|
1827
|
+
method: "POST",
|
|
1828
|
+
headers: { "Content-Type": "application/json" },
|
|
1829
|
+
body: JSON.stringify({
|
|
1830
|
+
query: query2,
|
|
1831
|
+
variables: { schemaId: schemaUid, attester }
|
|
1832
|
+
})
|
|
1833
|
+
});
|
|
1834
|
+
if (!response.ok) {
|
|
1835
|
+
throw new Error(`EAS GraphQL query failed: ${response.statusText}`);
|
|
1836
|
+
}
|
|
1837
|
+
const json = await response.json();
|
|
1838
|
+
if (!json.data?.attestations) return [];
|
|
1839
|
+
return json.data.attestations.map((a) => {
|
|
1840
|
+
const decoded = decodeAbiParameters(AGENT_APPROVED_PARAMS, a.data);
|
|
1841
|
+
return {
|
|
1842
|
+
uid: a.id,
|
|
1843
|
+
attester: a.attester,
|
|
1844
|
+
recipient: a.recipient,
|
|
1845
|
+
time: a.time,
|
|
1846
|
+
decoded: {
|
|
1847
|
+
syndicateId: decoded[0],
|
|
1848
|
+
agentId: decoded[1],
|
|
1849
|
+
vault: decoded[2]
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1814
1854
|
async function queryJoinRequests(recipient) {
|
|
1815
1855
|
assertSchemasRegistered();
|
|
1816
1856
|
const schemaUid = EAS_SCHEMAS().SYNDICATE_JOIN_REQUEST;
|
|
@@ -1869,7 +1909,7 @@ try {
|
|
|
1869
1909
|
} catch {
|
|
1870
1910
|
}
|
|
1871
1911
|
async function loadXmtp() {
|
|
1872
|
-
return import("./xmtp-
|
|
1912
|
+
return import("./xmtp-PICTODCB.js");
|
|
1873
1913
|
}
|
|
1874
1914
|
var G = chalk5.green;
|
|
1875
1915
|
var W = chalk5.white;
|
|
@@ -1891,7 +1931,7 @@ program.name("sherwood").description("CLI for agent-managed investment syndicate
|
|
|
1891
1931
|
}
|
|
1892
1932
|
});
|
|
1893
1933
|
var syndicate = program.command("syndicate");
|
|
1894
|
-
syndicate.command("create").description("Create a new syndicate via the factory (interactive)").option("--subdomain <name>", "ENS subdomain (skip prompt)").option("--name <name>", "Syndicate name (skip prompt)").option("--agent-id <id>", "ERC-8004 agent identity token ID (skip prompt)").option("--asset <address>", "Underlying asset address").option("--
|
|
1934
|
+
syndicate.command("create").description("Create a new syndicate via the factory (interactive)").option("--subdomain <name>", "ENS subdomain (skip prompt)").option("--name <name>", "Syndicate name (skip prompt)").option("--agent-id <id>", "ERC-8004 agent identity token ID (skip prompt)").option("--asset <address>", "Underlying asset address").option("--description <text>", "Short description").option("--metadata-uri <uri>", "Override metadata URI (skip IPFS upload)").option("--open-deposits", "Allow anyone to deposit (no whitelist)").option("--public-chat", "Enable dashboard spectator mode", false).action(async (opts) => {
|
|
1895
1935
|
try {
|
|
1896
1936
|
console.log();
|
|
1897
1937
|
console.log(LABEL(" \u25C6 Create Syndicate"));
|
|
@@ -1919,18 +1959,6 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
1919
1959
|
message: G("Open deposits? (anyone can deposit)"),
|
|
1920
1960
|
default: true
|
|
1921
1961
|
});
|
|
1922
|
-
const maxPerTx = opts.maxPerTx || await input({
|
|
1923
|
-
message: G("Max per transaction (USDC)"),
|
|
1924
|
-
default: "10000"
|
|
1925
|
-
});
|
|
1926
|
-
const maxDaily = opts.maxDaily || await input({
|
|
1927
|
-
message: G("Max daily spend (USDC)"),
|
|
1928
|
-
default: "50000"
|
|
1929
|
-
});
|
|
1930
|
-
const borrowRatio = opts.borrowRatio || await input({
|
|
1931
|
-
message: G("Max borrow ratio (bps, 7500 = 75%)"),
|
|
1932
|
-
default: "7500"
|
|
1933
|
-
});
|
|
1934
1962
|
const asset = opts.asset || TOKENS().USDC;
|
|
1935
1963
|
const publicClient = getPublicClient();
|
|
1936
1964
|
const [decimals, assetSymbol] = await Promise.all([
|
|
@@ -1938,7 +1966,6 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
1938
1966
|
publicClient.readContract({ address: asset, abi: ERC20_ABI, functionName: "symbol" })
|
|
1939
1967
|
]);
|
|
1940
1968
|
const symbol = `sw${assetSymbol}`;
|
|
1941
|
-
const targets = opts.targets ? opts.targets.split(",").map((a) => a.trim()) : [];
|
|
1942
1969
|
console.log();
|
|
1943
1970
|
console.log(LABEL(" \u25C6 Review"));
|
|
1944
1971
|
SEP();
|
|
@@ -1948,13 +1975,7 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
1948
1975
|
console.log(W(` Agent ID: #${agentIdStr}`));
|
|
1949
1976
|
console.log(W(` Asset: ${assetSymbol} (${asset.slice(0, 10)}...)`));
|
|
1950
1977
|
console.log(W(` Share token: ${symbol}`));
|
|
1951
|
-
console.log(W(` Max per tx: ${maxPerTx} ${assetSymbol}`));
|
|
1952
|
-
console.log(W(` Max daily: ${maxDaily} ${assetSymbol}`));
|
|
1953
|
-
console.log(W(` Borrow ratio: ${(Number(borrowRatio) / 100).toFixed(1)}%`));
|
|
1954
1978
|
console.log(W(` Open deposits: ${openDeposits ? G("yes") : chalk5.red("no (whitelist)")}`));
|
|
1955
|
-
if (targets.length > 0) {
|
|
1956
|
-
console.log(W(` Targets: ${targets.length} address(es)`));
|
|
1957
|
-
}
|
|
1958
1979
|
SEP();
|
|
1959
1980
|
const go = await confirm({ message: G("Deploy syndicate?"), default: true });
|
|
1960
1981
|
if (!go) {
|
|
@@ -1992,10 +2013,6 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
1992
2013
|
asset,
|
|
1993
2014
|
name,
|
|
1994
2015
|
symbol,
|
|
1995
|
-
maxPerTx: parseUnits8(maxPerTx, decimals),
|
|
1996
|
-
maxDailyTotal: parseUnits8(maxDaily, decimals),
|
|
1997
|
-
maxBorrowRatio: BigInt(borrowRatio),
|
|
1998
|
-
initialTargets: targets,
|
|
1999
2016
|
openDeposits,
|
|
2000
2017
|
subdomain
|
|
2001
2018
|
});
|
|
@@ -2008,10 +2025,8 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
2008
2025
|
BigInt(agentIdStr),
|
|
2009
2026
|
creatorAddress,
|
|
2010
2027
|
// pkp = creator EOA (direct execution)
|
|
2011
|
-
creatorAddress
|
|
2028
|
+
creatorAddress
|
|
2012
2029
|
// operator = creator EOA
|
|
2013
|
-
parseUnits8(maxPerTx, decimals),
|
|
2014
|
-
parseUnits8(maxDaily, decimals)
|
|
2015
2030
|
);
|
|
2016
2031
|
} catch (regErr) {
|
|
2017
2032
|
console.warn(chalk5.yellow("\n \u26A0 Could not auto-register creator as agent \u2014 register manually with `syndicate add`"));
|
|
@@ -2125,12 +2140,10 @@ syndicate.command("info").description("Display syndicate details by ID").argumen
|
|
|
2125
2140
|
const vaultInfo = await getVaultInfo();
|
|
2126
2141
|
console.log();
|
|
2127
2142
|
console.log(chalk5.bold(" Vault Stats"));
|
|
2128
|
-
console.log(` Total Assets:
|
|
2129
|
-
console.log(` Agent Count:
|
|
2130
|
-
console.log(`
|
|
2131
|
-
console.log(`
|
|
2132
|
-
console.log(` Max Daily: ${vaultInfo.syndicateCaps.maxDailyTotal}`);
|
|
2133
|
-
console.log(` Max Borrow: ${vaultInfo.syndicateCaps.maxBorrowRatio}`);
|
|
2143
|
+
console.log(` Total Assets: ${vaultInfo.totalAssets}`);
|
|
2144
|
+
console.log(` Agent Count: ${vaultInfo.agentCount}`);
|
|
2145
|
+
console.log(` Redemptions Locked: ${vaultInfo.redemptionsLocked}`);
|
|
2146
|
+
console.log(` Management Fee: ${Number(vaultInfo.managementFeeBps) / 100}%`);
|
|
2134
2147
|
console.log();
|
|
2135
2148
|
} catch (err) {
|
|
2136
2149
|
spinner.fail("Failed to load syndicate info");
|
|
@@ -2200,7 +2213,7 @@ syndicate.command("remove-depositor").description("Remove an address from the de
|
|
|
2200
2213
|
process.exit(1);
|
|
2201
2214
|
}
|
|
2202
2215
|
});
|
|
2203
|
-
syndicate.command("add").description("Register an agent on a syndicate vault (creator only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--pkp <address>", "Agent PKP address").requiredOption("--eoa <address>", "Operator EOA address").
|
|
2216
|
+
syndicate.command("add").description("Register an agent on a syndicate vault (creator only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--pkp <address>", "Agent PKP address").requiredOption("--eoa <address>", "Operator EOA address").action(async (opts) => {
|
|
2204
2217
|
const spinner = ora5("Verifying creator...").start();
|
|
2205
2218
|
try {
|
|
2206
2219
|
resolveVault(opts);
|
|
@@ -2211,16 +2224,11 @@ syndicate.command("add").description("Register an agent on a syndicate vault (cr
|
|
|
2211
2224
|
spinner.fail("Only the syndicate creator can add agents");
|
|
2212
2225
|
process.exit(1);
|
|
2213
2226
|
}
|
|
2214
|
-
const decimals = await getAssetDecimals();
|
|
2215
|
-
const maxPerTx = parseUnits8(opts.maxPerTx, decimals);
|
|
2216
|
-
const dailyLimit = parseUnits8(opts.dailyLimit, decimals);
|
|
2217
2227
|
spinner.text = "Registering agent...";
|
|
2218
2228
|
const hash = await registerAgent(
|
|
2219
2229
|
BigInt(opts.agentId),
|
|
2220
2230
|
opts.pkp,
|
|
2221
|
-
opts.eoa
|
|
2222
|
-
maxPerTx,
|
|
2223
|
-
dailyLimit
|
|
2231
|
+
opts.eoa
|
|
2224
2232
|
);
|
|
2225
2233
|
spinner.succeed(`Agent registered: ${hash}`);
|
|
2226
2234
|
console.log(chalk5.dim(` ${getExplorerUrl(hash)}`));
|
|
@@ -2346,7 +2354,14 @@ syndicate.command("requests").description("View pending join requests for a synd
|
|
|
2346
2354
|
process.exit(1);
|
|
2347
2355
|
}
|
|
2348
2356
|
spinner.text = "Querying EAS attestations...";
|
|
2349
|
-
const
|
|
2357
|
+
const [allRequests, approvals] = await Promise.all([
|
|
2358
|
+
queryJoinRequests(creatorAddress),
|
|
2359
|
+
queryApprovals(creatorAddress)
|
|
2360
|
+
]);
|
|
2361
|
+
const approvedAgentIds = new Set(approvals.map((a) => a.decoded.agentId.toString()));
|
|
2362
|
+
const requests = allRequests.filter(
|
|
2363
|
+
(r) => !approvedAgentIds.has(r.decoded.agentId.toString())
|
|
2364
|
+
);
|
|
2350
2365
|
spinner.stop();
|
|
2351
2366
|
if (requests.length === 0) {
|
|
2352
2367
|
console.log(DIM("\n No pending join requests.\n"));
|
|
@@ -2365,7 +2380,7 @@ syndicate.command("requests").description("View pending join requests for a synd
|
|
|
2365
2380
|
console.log();
|
|
2366
2381
|
}
|
|
2367
2382
|
console.log(G(" To approve:"));
|
|
2368
|
-
console.log(DIM(` sherwood syndicate approve --agent-id <id> --pkp <addr> --eoa <addr
|
|
2383
|
+
console.log(DIM(` sherwood syndicate approve --agent-id <id> --pkp <addr> --eoa <addr>`));
|
|
2369
2384
|
console.log(G(" To reject:"));
|
|
2370
2385
|
console.log(DIM(` sherwood syndicate reject --attestation <uid>`));
|
|
2371
2386
|
console.log();
|
|
@@ -2375,7 +2390,7 @@ syndicate.command("requests").description("View pending join requests for a synd
|
|
|
2375
2390
|
process.exit(1);
|
|
2376
2391
|
}
|
|
2377
2392
|
});
|
|
2378
|
-
syndicate.command("approve").description("Approve an agent join request (registers agent + creates EAS approval)").option("--vault <address>", "Vault address (default: from config)").option("--subdomain <name>", "Syndicate subdomain (alternative to --vault)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--pkp <address>", "Agent PKP address").requiredOption("--eoa <address>", "Operator EOA address").
|
|
2393
|
+
syndicate.command("approve").description("Approve an agent join request (registers agent + creates EAS approval)").option("--vault <address>", "Vault address (default: from config)").option("--subdomain <name>", "Syndicate subdomain (alternative to --vault)").requiredOption("--agent-id <id>", "Agent's ERC-8004 identity token ID").requiredOption("--pkp <address>", "Agent PKP address").requiredOption("--eoa <address>", "Operator EOA address").action(async (opts) => {
|
|
2379
2394
|
const spinner = ora5("Verifying creator...").start();
|
|
2380
2395
|
try {
|
|
2381
2396
|
if (opts.subdomain && !opts.vault) {
|
|
@@ -2391,17 +2406,12 @@ syndicate.command("approve").description("Approve an agent join request (registe
|
|
|
2391
2406
|
spinner.fail("Only the syndicate creator can approve agents");
|
|
2392
2407
|
process.exit(1);
|
|
2393
2408
|
}
|
|
2394
|
-
const decimals = await getAssetDecimals();
|
|
2395
|
-
const maxPerTx = parseUnits8(opts.maxPerTx, decimals);
|
|
2396
|
-
const dailyLimit = parseUnits8(opts.dailyLimit, decimals);
|
|
2397
2409
|
spinner.text = "Registering agent on vault...";
|
|
2398
2410
|
try {
|
|
2399
2411
|
const regHash = await registerAgent(
|
|
2400
2412
|
BigInt(opts.agentId),
|
|
2401
2413
|
opts.pkp,
|
|
2402
|
-
opts.eoa
|
|
2403
|
-
maxPerTx,
|
|
2404
|
-
dailyLimit
|
|
2414
|
+
opts.eoa
|
|
2405
2415
|
);
|
|
2406
2416
|
console.log(DIM(` Agent registered: ${getExplorerUrl(regHash)}`));
|
|
2407
2417
|
} catch (regErr) {
|
|
@@ -2412,19 +2422,24 @@ syndicate.command("approve").description("Approve an agent join request (registe
|
|
|
2412
2422
|
throw regErr;
|
|
2413
2423
|
}
|
|
2414
2424
|
}
|
|
2415
|
-
spinner.text = "
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
BigInt(opts.agentId)
|
|
2419
|
-
vaultAddress,
|
|
2420
|
-
opts.eoa
|
|
2425
|
+
spinner.text = "Checking for existing approval...";
|
|
2426
|
+
const existingApprovals = await queryApprovals(getAccount().address);
|
|
2427
|
+
const alreadyApproved = existingApprovals.find(
|
|
2428
|
+
(a) => a.decoded.agentId === BigInt(opts.agentId) && a.decoded.vault.toLowerCase() === vaultAddress.toLowerCase()
|
|
2421
2429
|
);
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2430
|
+
let approvalUid;
|
|
2431
|
+
if (alreadyApproved) {
|
|
2432
|
+
approvalUid = alreadyApproved.uid;
|
|
2433
|
+
console.log(DIM(` Approval attestation already exists \u2014 skipping`));
|
|
2434
|
+
} else {
|
|
2435
|
+
spinner.text = "Creating approval attestation...";
|
|
2436
|
+
const result = await createApproval(
|
|
2437
|
+
syndicateId,
|
|
2438
|
+
BigInt(opts.agentId),
|
|
2439
|
+
vaultAddress,
|
|
2440
|
+
opts.eoa
|
|
2427
2441
|
);
|
|
2442
|
+
approvalUid = result.uid;
|
|
2428
2443
|
}
|
|
2429
2444
|
try {
|
|
2430
2445
|
spinner.text = "Adding to chat...";
|
|
@@ -2512,15 +2527,11 @@ vaultCmd.command("info").description("Display vault state").option("--vault <add
|
|
|
2512
2527
|
console.log();
|
|
2513
2528
|
console.log(chalk5.bold("Vault Info"));
|
|
2514
2529
|
console.log(chalk5.dim("\u2500".repeat(40)));
|
|
2515
|
-
console.log(` Address:
|
|
2516
|
-
console.log(` Total Assets:
|
|
2517
|
-
console.log(` Agent Count:
|
|
2518
|
-
console.log(`
|
|
2519
|
-
console.log();
|
|
2520
|
-
console.log(chalk5.bold(" Syndicate Caps"));
|
|
2521
|
-
console.log(` Max Per Tx: ${info.syndicateCaps.maxPerTx}`);
|
|
2522
|
-
console.log(` Max Daily: ${info.syndicateCaps.maxDailyTotal}`);
|
|
2523
|
-
console.log(` Max Borrow: ${info.syndicateCaps.maxBorrowRatio}`);
|
|
2530
|
+
console.log(` Address: ${info.address}`);
|
|
2531
|
+
console.log(` Total Assets: ${info.totalAssets}`);
|
|
2532
|
+
console.log(` Agent Count: ${info.agentCount}`);
|
|
2533
|
+
console.log(` Redemptions Locked: ${info.redemptionsLocked}`);
|
|
2534
|
+
console.log(` Management Fee: ${Number(info.managementFeeBps) / 100}%`);
|
|
2524
2535
|
console.log();
|
|
2525
2536
|
} catch (err) {
|
|
2526
2537
|
spinner.fail("Failed to load vault info");
|
|
@@ -2547,51 +2558,6 @@ vaultCmd.command("balance").description("Show LP share balance and asset value")
|
|
|
2547
2558
|
process.exit(1);
|
|
2548
2559
|
}
|
|
2549
2560
|
});
|
|
2550
|
-
vaultCmd.command("add-target").description("Add a target to the vault allowlist (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--target <address>", "Target address to allow").action(async (opts) => {
|
|
2551
|
-
resolveVault(opts);
|
|
2552
|
-
const spinner = ora5("Adding target...").start();
|
|
2553
|
-
try {
|
|
2554
|
-
const hash = await addTarget(opts.target);
|
|
2555
|
-
spinner.succeed(`Target added: ${hash}`);
|
|
2556
|
-
console.log(chalk5.dim(` ${getExplorerUrl(hash)}`));
|
|
2557
|
-
} catch (err) {
|
|
2558
|
-
spinner.fail("Failed to add target");
|
|
2559
|
-
console.error(chalk5.red(err instanceof Error ? err.message : String(err)));
|
|
2560
|
-
process.exit(1);
|
|
2561
|
-
}
|
|
2562
|
-
});
|
|
2563
|
-
vaultCmd.command("remove-target").description("Remove a target from the vault allowlist (owner only)").option("--vault <address>", "Vault address (default: from config)").requiredOption("--target <address>", "Target address to remove").action(async (opts) => {
|
|
2564
|
-
resolveVault(opts);
|
|
2565
|
-
const spinner = ora5("Removing target...").start();
|
|
2566
|
-
try {
|
|
2567
|
-
const hash = await removeTarget(opts.target);
|
|
2568
|
-
spinner.succeed(`Target removed: ${hash}`);
|
|
2569
|
-
console.log(chalk5.dim(` ${getExplorerUrl(hash)}`));
|
|
2570
|
-
} catch (err) {
|
|
2571
|
-
spinner.fail("Failed to remove target");
|
|
2572
|
-
console.error(chalk5.red(err instanceof Error ? err.message : String(err)));
|
|
2573
|
-
process.exit(1);
|
|
2574
|
-
}
|
|
2575
|
-
});
|
|
2576
|
-
vaultCmd.command("targets").description("List allowed targets for a vault").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
|
|
2577
|
-
resolveVault(opts);
|
|
2578
|
-
const spinner = ora5("Loading targets...").start();
|
|
2579
|
-
try {
|
|
2580
|
-
const targets = await getAllowedTargets();
|
|
2581
|
-
spinner.stop();
|
|
2582
|
-
console.log();
|
|
2583
|
-
console.log(chalk5.bold(`Allowed Targets (${targets.length})`));
|
|
2584
|
-
console.log(chalk5.dim("\u2500".repeat(50)));
|
|
2585
|
-
for (const t of targets) {
|
|
2586
|
-
console.log(` ${t}`);
|
|
2587
|
-
}
|
|
2588
|
-
console.log();
|
|
2589
|
-
} catch (err) {
|
|
2590
|
-
spinner.fail("Failed to load targets");
|
|
2591
|
-
console.error(chalk5.red(err instanceof Error ? err.message : String(err)));
|
|
2592
|
-
process.exit(1);
|
|
2593
|
-
}
|
|
2594
|
-
});
|
|
2595
2561
|
var strategy = program.command("strategy");
|
|
2596
2562
|
strategy.command("list").description("List registered strategies").option("--type <id>", "Filter by strategy type").action(async (opts) => {
|
|
2597
2563
|
const spinner = ora5("Loading strategies...").start();
|
|
@@ -2678,7 +2644,7 @@ ${info.name} (${info.type})`);
|
|
|
2678
2644
|
}
|
|
2679
2645
|
});
|
|
2680
2646
|
try {
|
|
2681
|
-
const { registerChatCommands } = await import("./chat-
|
|
2647
|
+
const { registerChatCommands } = await import("./chat-HHXJOCKN.js");
|
|
2682
2648
|
registerChatCommands(program);
|
|
2683
2649
|
} catch {
|
|
2684
2650
|
program.command("chat <name> [action] [actionArgs...]").description("Syndicate chat (XMTP) \u2014 requires @xmtp/cli").action(() => {
|