httpcat-cli 0.3.0 → 0.3.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/.github/workflows/ci.yml +3 -0
- package/.github/workflows/rc-publish.yml +6 -0
- package/.github/workflows/release.yml +102 -0
- package/.github/workflows/sync-version.yml +31 -2
- package/README.md +1408 -109
- package/additions.txt +3 -0
- package/bun.lock +260 -25
- package/dist/agent/autonomous-trader.d.ts.map +1 -0
- package/dist/agent/autonomous-trader.js +362 -0
- package/dist/agent/autonomous-trader.js.map +1 -0
- package/dist/agent/ax-agent.d.ts.map +1 -1
- package/dist/agent/ax-agent.js +356 -18
- package/dist/agent/ax-agent.js.map +1 -1
- package/dist/agent/event-client.d.ts.map +1 -0
- package/dist/agent/event-client.js +82 -0
- package/dist/agent/event-client.js.map +1 -0
- package/dist/agent/log-stream.d.ts.map +1 -0
- package/dist/agent/log-stream.js +95 -0
- package/dist/agent/log-stream.js.map +1 -0
- package/dist/agent/memory/conversation-session.d.ts.map +1 -0
- package/dist/agent/memory/conversation-session.js +232 -0
- package/dist/agent/memory/conversation-session.js.map +1 -0
- package/dist/agent/memory/conversation-store.d.ts.map +1 -0
- package/dist/agent/memory/conversation-store.js +214 -0
- package/dist/agent/memory/conversation-store.js.map +1 -0
- package/dist/agent/memory/database-schema.d.ts.map +1 -0
- package/dist/agent/memory/database-schema.js +355 -0
- package/dist/agent/memory/database-schema.js.map +1 -0
- package/dist/agent/memory/decision-tracker.d.ts.map +1 -0
- package/dist/agent/memory/decision-tracker.js +274 -0
- package/dist/agent/memory/decision-tracker.js.map +1 -0
- package/dist/agent/memory/memory-manager.d.ts.map +1 -0
- package/dist/agent/memory/memory-manager.js +187 -0
- package/dist/agent/memory/memory-manager.js.map +1 -0
- package/dist/agent/memory/types.d.ts.map +1 -0
- package/dist/agent/memory/types.js +5 -0
- package/dist/agent/memory/types.js.map +1 -0
- package/dist/agent/message-formatter.d.ts.map +1 -0
- package/dist/agent/message-formatter.js +76 -0
- package/dist/agent/message-formatter.js.map +1 -0
- package/dist/agent/position-db.d.ts.map +1 -0
- package/dist/agent/position-db.js +154 -0
- package/dist/agent/position-db.js.map +1 -0
- package/dist/agent/simple-chat-ui-static.d.ts.map +1 -0
- package/dist/agent/simple-chat-ui-static.js +129 -0
- package/dist/agent/simple-chat-ui-static.js.map +1 -0
- package/dist/agent/simple-chat-ui.d.ts.map +1 -0
- package/dist/agent/simple-chat-ui.js +90 -0
- package/dist/agent/simple-chat-ui.js.map +1 -0
- package/dist/agent/tools.d.ts.map +1 -1
- package/dist/agent/tools.js +297 -4
- package/dist/agent/tools.js.map +1 -1
- package/dist/agent/ui.d.ts.map +1 -0
- package/dist/agent/ui.js +84 -0
- package/dist/agent/ui.js.map +1 -0
- package/dist/agent/unified-runtime.d.ts.map +1 -0
- package/dist/agent/unified-runtime.js +397 -0
- package/dist/agent/unified-runtime.js.map +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +272 -21
- package/dist/client.js.map +1 -1
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +187 -33
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +125 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/approve.d.ts.map +1 -0
- package/dist/commands/approve.js +505 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/automation.d.ts.map +1 -0
- package/dist/commands/automation.js +346 -0
- package/dist/commands/automation.js.map +1 -0
- package/dist/commands/balances.d.ts.map +1 -1
- package/dist/commands/balances.js +226 -73
- package/dist/commands/balances.js.map +1 -1
- package/dist/commands/buy.d.ts.map +1 -1
- package/dist/commands/buy.js +149 -146
- package/dist/commands/buy.js.map +1 -1
- package/dist/commands/call.d.ts.map +1 -0
- package/dist/commands/call.js +51 -0
- package/dist/commands/call.js.map +1 -0
- package/dist/commands/cex.d.ts.map +1 -0
- package/dist/commands/cex.js +958 -0
- package/dist/commands/cex.js.map +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +169 -411
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claim.d.ts.map +1 -1
- package/dist/commands/claim.js +313 -29
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +151 -43
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/gasless-swap.d.ts.map +1 -0
- package/dist/commands/gasless-swap.js +232 -0
- package/dist/commands/gasless-swap.js.map +1 -0
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +63 -7
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +131 -47
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/launchpad.d.ts.map +1 -0
- package/dist/commands/launchpad.js +708 -0
- package/dist/commands/launchpad.js.map +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +57 -23
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/market.d.ts.map +1 -0
- package/dist/commands/market.js +960 -0
- package/dist/commands/market.js.map +1 -0
- package/dist/commands/mcp-install.d.ts.map +1 -0
- package/dist/commands/mcp-install.js +387 -0
- package/dist/commands/mcp-install.js.map +1 -0
- package/dist/commands/opps.d.ts.map +1 -0
- package/dist/commands/opps.js +409 -0
- package/dist/commands/opps.js.map +1 -0
- package/dist/commands/perps.d.ts.map +1 -0
- package/dist/commands/perps.js +248 -0
- package/dist/commands/perps.js.map +1 -0
- package/dist/commands/portfolio.d.ts.map +1 -0
- package/dist/commands/portfolio.js +679 -0
- package/dist/commands/portfolio.js.map +1 -0
- package/dist/commands/positions.d.ts.map +1 -1
- package/dist/commands/positions.js +76 -47
- package/dist/commands/positions.js.map +1 -1
- package/dist/commands/predict.d.ts.map +1 -0
- package/dist/commands/predict.js +280 -0
- package/dist/commands/predict.js.map +1 -0
- package/dist/commands/predictions.d.ts.map +1 -0
- package/dist/commands/predictions.js +486 -0
- package/dist/commands/predictions.js.map +1 -0
- package/dist/commands/risk.d.ts.map +1 -0
- package/dist/commands/risk.js +225 -0
- package/dist/commands/risk.js.map +1 -0
- package/dist/commands/security.d.ts.map +1 -0
- package/dist/commands/security.js +244 -0
- package/dist/commands/security.js.map +1 -0
- package/dist/commands/sell.d.ts.map +1 -1
- package/dist/commands/sell.js +67 -34
- package/dist/commands/sell.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -0
- package/dist/commands/send.js +733 -0
- package/dist/commands/send.js.map +1 -0
- package/dist/commands/sign.d.ts.map +1 -0
- package/dist/commands/sign.js +1048 -0
- package/dist/commands/sign.js.map +1 -0
- package/dist/commands/swap.d.ts.map +1 -0
- package/dist/commands/swap.js +744 -0
- package/dist/commands/swap.js.map +1 -0
- package/dist/commands/system.d.ts.map +1 -0
- package/dist/commands/system.js +417 -0
- package/dist/commands/system.js.map +1 -0
- package/dist/commands/tools/index.d.ts.map +1 -0
- package/dist/commands/tools/index.js +2040 -0
- package/dist/commands/tools/index.js.map +1 -0
- package/dist/commands/trade.d.ts.map +1 -0
- package/dist/commands/trade.js +237 -0
- package/dist/commands/trade.js.map +1 -0
- package/dist/commands/transactions.d.ts.map +1 -1
- package/dist/commands/transactions.js +29 -17
- package/dist/commands/transactions.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +429 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +351 -40
- package/dist/config.js.map +1 -1
- package/dist/index.js +4524 -924
- package/dist/index.js.map +1 -1
- package/dist/interactive/art.d.ts.map +1 -1
- package/dist/interactive/art.js +33 -1
- package/dist/interactive/art.js.map +1 -1
- package/dist/interactive/shell.d.ts.map +1 -1
- package/dist/interactive/shell.js +467 -2652
- package/dist/interactive/shell.js.map +1 -1
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/context.js +211 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/onboarding.d.ts.map +1 -0
- package/dist/mcp/onboarding.js +266 -0
- package/dist/mcp/onboarding.js.map +1 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +222 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +51 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +4119 -169
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/types/agent-info.d.ts.map +1 -0
- package/dist/types/agent-info.js +11 -0
- package/dist/types/agent-info.js.map +1 -0
- package/dist/ui/components/ScrollableList.d.ts.map +1 -0
- package/dist/ui/components/ScrollableList.js +72 -0
- package/dist/ui/components/ScrollableList.js.map +1 -0
- package/dist/ui/components/ThemeProvider.d.ts.map +1 -0
- package/dist/ui/components/ThemeProvider.js +87 -0
- package/dist/ui/components/ThemeProvider.js.map +1 -0
- package/dist/ui/components/ThemedBox.d.ts.map +1 -0
- package/dist/ui/components/ThemedBox.js +24 -0
- package/dist/ui/components/ThemedBox.js.map +1 -0
- package/dist/ui/components/agent/ChatHeader.d.ts.map +1 -0
- package/dist/ui/components/agent/ChatHeader.js +39 -0
- package/dist/ui/components/agent/ChatHeader.js.map +1 -0
- package/dist/ui/components/agent/Header.d.ts.map +1 -0
- package/dist/ui/components/agent/Header.js +14 -0
- package/dist/ui/components/agent/Header.js.map +1 -0
- package/dist/ui/components/agent/Input.d.ts.map +1 -0
- package/dist/ui/components/agent/Input.js +23 -0
- package/dist/ui/components/agent/Input.js.map +1 -0
- package/dist/ui/components/agent/Output.d.ts.map +1 -0
- package/dist/ui/components/agent/Output.js +23 -0
- package/dist/ui/components/agent/Output.js.map +1 -0
- package/dist/ui/components/chat/TokenChatUI.d.ts.map +1 -0
- package/dist/ui/components/chat/TokenChatUI.js +133 -0
- package/dist/ui/components/chat/TokenChatUI.js.map +1 -0
- package/dist/ui/components/shell/ShellHeader.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellHeader.js +31 -0
- package/dist/ui/components/shell/ShellHeader.js.map +1 -0
- package/dist/ui/components/shell/ShellInput.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellInput.js +151 -0
- package/dist/ui/components/shell/ShellInput.js.map +1 -0
- package/dist/ui/components/shell/ShellOutput.d.ts.map +1 -0
- package/dist/ui/components/shell/ShellOutput.js +8 -0
- package/dist/ui/components/shell/ShellOutput.js.map +1 -0
- package/dist/ui/hooks/useChatWebSocket.d.ts.map +1 -0
- package/dist/ui/hooks/useChatWebSocket.js +76 -0
- package/dist/ui/hooks/useChatWebSocket.js.map +1 -0
- package/dist/ui/hooks/useCommandHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useCommandHistory.js +70 -0
- package/dist/ui/hooks/useCommandHistory.js.map +1 -0
- package/dist/ui/hooks/useDebounce.d.ts.map +1 -0
- package/dist/ui/hooks/useDebounce.js +17 -0
- package/dist/ui/hooks/useDebounce.js.map +1 -0
- package/dist/ui/hooks/useLogStream.d.ts.map +1 -0
- package/dist/ui/hooks/useLogStream.js +20 -0
- package/dist/ui/hooks/useLogStream.js.map +1 -0
- package/dist/ui/hooks/useVirtualScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useVirtualScroll.js +70 -0
- package/dist/ui/hooks/useVirtualScroll.js.map +1 -0
- package/dist/utils/admin.d.ts.map +1 -0
- package/dist/utils/admin.js +144 -0
- package/dist/utils/admin.js.map +1 -0
- package/dist/utils/autoSetup.d.ts.map +1 -0
- package/dist/utils/autoSetup.js +252 -0
- package/dist/utils/autoSetup.js.map +1 -0
- package/dist/utils/build-constants.d.ts.map +1 -0
- package/dist/utils/build-constants.js +10 -0
- package/dist/utils/build-constants.js.map +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +10 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +46 -9
- package/dist/utils/formatting.js.map +1 -1
- package/dist/utils/llm-cli-config.d.ts.map +1 -0
- package/dist/utils/llm-cli-config.js +963 -0
- package/dist/utils/llm-cli-config.js.map +1 -0
- package/dist/utils/llm-cli-detector.d.ts.map +1 -0
- package/dist/utils/llm-cli-detector.js +202 -0
- package/dist/utils/llm-cli-detector.js.map +1 -0
- package/dist/utils/loading.d.ts.map +1 -1
- package/dist/utils/loading.js +25 -3
- package/dist/utils/loading.js.map +1 -1
- package/dist/utils/maintenance.d.ts.map +1 -0
- package/dist/utils/maintenance.js +17 -0
- package/dist/utils/maintenance.js.map +1 -0
- package/dist/utils/mcp-config.d.ts.map +1 -0
- package/dist/utils/mcp-config.js +77 -0
- package/dist/utils/mcp-config.js.map +1 -0
- package/dist/utils/privateKeyPrompt.d.ts.map +1 -1
- package/dist/utils/privateKeyPrompt.js +308 -129
- package/dist/utils/privateKeyPrompt.js.map +1 -1
- package/dist/utils/process-cleanup.d.ts.map +1 -0
- package/dist/utils/process-cleanup.js +136 -0
- package/dist/utils/process-cleanup.js.map +1 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +56 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/rpc-helpers.d.ts.map +1 -0
- package/dist/utils/rpc-helpers.js +70 -0
- package/dist/utils/rpc-helpers.js.map +1 -0
- package/dist/utils/rpc-transport.d.ts.map +1 -0
- package/dist/utils/rpc-transport.js +87 -0
- package/dist/utils/rpc-transport.js.map +1 -0
- package/dist/utils/shell-setup.d.ts.map +1 -0
- package/dist/utils/shell-setup.js +531 -0
- package/dist/utils/shell-setup.js.map +1 -0
- package/dist/utils/status.d.ts.map +1 -1
- package/dist/utils/status.js +34 -5
- package/dist/utils/status.js.map +1 -1
- package/dist/utils/token-resolver.d.ts.map +1 -1
- package/dist/utils/token-resolver.js +51 -8
- package/dist/utils/token-resolver.js.map +1 -1
- package/dist/utils/x402-caller.d.ts.map +1 -0
- package/dist/utils/x402-caller.js +17 -0
- package/dist/utils/x402-caller.js.map +1 -0
- package/docs/README.md +28 -0
- package/docs/agent/README.md +18 -0
- package/docs/api/README.md +41 -0
- package/docs/cli/README.md +42 -0
- package/docs/guides/README.md +26 -0
- package/docs/implementation/README.md +18 -0
- package/docs/planning/README.md +19 -0
- package/docs/testing/README.md +15 -0
- package/docs/ux/README.md +16 -0
- package/issues.txt +2 -0
- package/package.json +24 -9
- package/scripts/cat-spin.sh +417 -0
- package/scripts/deprecate-rc-versions.js +58 -0
- package/scripts/inject-build-constants.js +43 -0
- package/scripts/monitor-foobar.js +117 -0
- package/swap.logs +61 -0
- package/swapping.txt +108 -0
- package/test.txt +12 -0
- package/tests/fixtures/test-data.json +16 -0
- package/Screenshot 2025-12-21 at 8.56.02/342/200/257PM.png +0 -0
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { listTokens } from '../commands/list.js';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { config } from '../config.js';
|
|
4
|
+
import { writeStatusLineNew } from './status.js';
|
|
5
|
+
import { getUSDCAddress } from './constants.js';
|
|
6
|
+
// Well-known token aliases for Base mainnet
|
|
7
|
+
// Note: USDC is handled separately with network-aware resolution
|
|
8
|
+
const BASE_TOKEN_ALIASES = {
|
|
9
|
+
// Native ETH
|
|
10
|
+
'eth': '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
|
|
11
|
+
// Wrapped ETH
|
|
12
|
+
'weth': '0x4200000000000000000000000000000000000006',
|
|
13
|
+
// cbBTC (Coinbase Wrapped BTC)
|
|
14
|
+
'cbbtc': '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf',
|
|
15
|
+
// DAI
|
|
16
|
+
'dai': '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
|
|
17
|
+
// USDbC (Bridged USDC)
|
|
18
|
+
'usdbc': '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
|
|
19
|
+
// AERO
|
|
20
|
+
'aero': '0x940181a94A35A4569E4529A3CDfB74e38FD98631',
|
|
21
|
+
// DEGEN
|
|
22
|
+
'degen': '0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed',
|
|
23
|
+
};
|
|
4
24
|
/**
|
|
5
25
|
* Resolves a token identifier (ID, name, or symbol) to a token ID
|
|
6
26
|
*
|
|
@@ -16,6 +36,29 @@ export async function resolveTokenId(identifier, client, silent = false) {
|
|
|
16
36
|
}
|
|
17
37
|
// Check if it's a UUID (token ID) - trim first to handle whitespace
|
|
18
38
|
const trimmedIdentifier = identifier.trim();
|
|
39
|
+
// Check for well-known token aliases (case-insensitive)
|
|
40
|
+
const aliasLower = trimmedIdentifier.toLowerCase();
|
|
41
|
+
// Special handling for network-aware tokens (USDC)
|
|
42
|
+
if (aliasLower === 'usdc') {
|
|
43
|
+
const network = client.getNetwork();
|
|
44
|
+
try {
|
|
45
|
+
const usdcAddress = getUSDCAddress(network);
|
|
46
|
+
if (!silent) {
|
|
47
|
+
writeStatusLineNew(chalk.dim(`✅ Resolved ${trimmedIdentifier.toUpperCase()} to ${usdcAddress}`));
|
|
48
|
+
}
|
|
49
|
+
return usdcAddress;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw new Error(`Failed to resolve USDC for network ${network}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Check other aliases
|
|
56
|
+
if (BASE_TOKEN_ALIASES[aliasLower]) {
|
|
57
|
+
if (!silent) {
|
|
58
|
+
writeStatusLineNew(chalk.dim(`✅ Resolved ${trimmedIdentifier.toUpperCase()} to ${BASE_TOKEN_ALIASES[aliasLower]}`));
|
|
59
|
+
}
|
|
60
|
+
return BASE_TOKEN_ALIASES[aliasLower];
|
|
61
|
+
}
|
|
19
62
|
if (trimmedIdentifier === "") {
|
|
20
63
|
throw new Error("Token identifier cannot be empty or whitespace only");
|
|
21
64
|
}
|
|
@@ -39,12 +82,12 @@ export async function resolveTokenId(identifier, client, silent = false) {
|
|
|
39
82
|
throw new Error('Cannot resolve token: identifier is empty');
|
|
40
83
|
}
|
|
41
84
|
try {
|
|
42
|
-
const { data } = await client.invoke('
|
|
85
|
+
const { data } = await client.invoke('tokens/info', {
|
|
43
86
|
tokenIdentifier: trimmedIdentifier,
|
|
44
87
|
});
|
|
45
88
|
if (data?.tokenId && typeof data.tokenId === 'string') {
|
|
46
89
|
if (!silent) {
|
|
47
|
-
|
|
90
|
+
writeStatusLineNew(chalk.dim(`✅ Found token: ${data.name} (${data.symbol})`));
|
|
48
91
|
}
|
|
49
92
|
return data.tokenId;
|
|
50
93
|
}
|
|
@@ -66,14 +109,14 @@ export async function resolveTokenId(identifier, client, silent = false) {
|
|
|
66
109
|
const matchedToken = matches[0];
|
|
67
110
|
if (!silent) {
|
|
68
111
|
if (matches.length > 1) {
|
|
69
|
-
|
|
112
|
+
writeStatusLineNew(chalk.yellow(`⚠️ Multiple tokens found matching "${trimmedIdentifier}":`));
|
|
70
113
|
for (const token of matches) {
|
|
71
|
-
|
|
114
|
+
writeStatusLineNew(chalk.dim(` - ${token.name} (${token.symbol}) - Address: ${token.address || 'N/A'}`));
|
|
72
115
|
}
|
|
73
|
-
|
|
116
|
+
writeStatusLineNew(chalk.dim(`✅ Using first match: ${matchedToken.name} (${matchedToken.symbol})`));
|
|
74
117
|
}
|
|
75
118
|
else {
|
|
76
|
-
|
|
119
|
+
writeStatusLineNew(chalk.dim(`✅ Found token: ${matchedToken.name} (${matchedToken.symbol})`));
|
|
77
120
|
}
|
|
78
121
|
}
|
|
79
122
|
// Check if tokenId exists, if not try entrypointKey as fallback
|
|
@@ -103,7 +146,7 @@ export async function resolveTokenId(identifier, client, silent = false) {
|
|
|
103
146
|
// Not in our database - if it's an address, treat as external token
|
|
104
147
|
if (isAddress) {
|
|
105
148
|
if (!silent) {
|
|
106
|
-
|
|
149
|
+
writeStatusLineNew(chalk.dim(`✅ Using external token address: ${trimmedIdentifier}`));
|
|
107
150
|
}
|
|
108
151
|
return trimmedIdentifier;
|
|
109
152
|
}
|
|
@@ -118,7 +161,7 @@ export async function resolveTokenId(identifier, client, silent = false) {
|
|
|
118
161
|
const catTokenAddress = agentInfo.catTokenAddress;
|
|
119
162
|
if (catTokenAddress) {
|
|
120
163
|
if (!silent) {
|
|
121
|
-
|
|
164
|
+
writeStatusLineNew(chalk.dim(`✅ Found platform token: CAT`));
|
|
122
165
|
}
|
|
123
166
|
return catTokenAddress;
|
|
124
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-resolver.js","sourceRoot":"","sources":["../../src/utils/token-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"token-resolver.js","sourceRoot":"","sources":["../../src/utils/token-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,4CAA4C;AAC5C,iEAAiE;AACjE,MAAM,kBAAkB,GAA2B;IACjD,aAAa;IACb,KAAK,EAAE,4CAA4C;IACnD,cAAc;IACd,MAAM,EAAE,4CAA4C;IACpD,+BAA+B;IAC/B,OAAO,EAAE,4CAA4C;IACrD,MAAM;IACN,KAAK,EAAE,4CAA4C;IACnD,uBAAuB;IACvB,OAAO,EAAE,4CAA4C;IACrD,OAAO;IACP,MAAM,EAAE,4CAA4C;IACpD,QAAQ;IACR,OAAO,EAAE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B,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;IAED,qBAAqB;IACrB,MAAM,IAAI,KAAK,CACb,wCAAwC,iBAAiB,KAAK;QAC9D,qEAAqE,CACtE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x402-caller.d.ts","sourceRoot":"","sources":["../../src/utils/x402-caller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,GAAG,CAAC;CACb,GACL,OAAO,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAWD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpcatClient } from "../client.js";
|
|
2
|
+
import { config } from "../config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Call an arbitrary x402-protected HTTP endpoint with automatic payment handling
|
|
5
|
+
*/
|
|
6
|
+
export async function callX402Endpoint(url, options = {}) {
|
|
7
|
+
// Create client with optional private key override
|
|
8
|
+
const privateKey = options.privateKey || config.getPrivateKey();
|
|
9
|
+
const client = await HttpcatClient.create(privateKey);
|
|
10
|
+
// Call the endpoint using the client's method
|
|
11
|
+
return await client.callX402Endpoint(url, {
|
|
12
|
+
method: options.method,
|
|
13
|
+
body: options.body,
|
|
14
|
+
headers: options.headers,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=x402-caller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x402-caller.js","sourceRoot":"","sources":["../../src/utils/x402-caller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,UAKI,EAAE;IAQN,mDAAmD;IACnD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAK,MAAM,CAAC,aAAa,EAAU,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAEtD,8CAA8C;IAC9C,OAAO,MAAM,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC;AACL,CAAC"}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# httpcat CLI Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains all documentation for the httpcat CLI project, organized by category.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
- **[api/](api/)** - API endpoint documentation and specifications
|
|
8
|
+
- **[cli/](cli/)** - CLI command reference and help documentation
|
|
9
|
+
- **[implementation/](implementation/)** - Technical implementation details and guides
|
|
10
|
+
- **[testing/](testing/)** - Test reports and testing documentation
|
|
11
|
+
- **[planning/](planning/)** - Product requirements documents (PRDs) and planning documents
|
|
12
|
+
- **[ux/](ux/)** - User experience guidelines and design documentation
|
|
13
|
+
- **[agent/](agent/)** - Agent platform integration and MCP documentation
|
|
14
|
+
- **[guides/](guides/)** - General guides and usage documentation
|
|
15
|
+
|
|
16
|
+
## Quick Links
|
|
17
|
+
|
|
18
|
+
- **API Reference**: See [api/FINAL_ENTRYPOINTS.md](api/FINAL_ENTRYPOINTS.md) for complete API documentation
|
|
19
|
+
- **CLI Commands**: See [cli/CLI_COMMANDS_BREAKDOWN.md](cli/CLI_COMMANDS_BREAKDOWN.md) for all CLI commands
|
|
20
|
+
- **Getting Started**: See [guides/USAGE.md](guides/USAGE.md) for usage instructions
|
|
21
|
+
- **Style Guide**: See [ux/GENERAL_STYLES.md](ux/GENERAL_STYLES.md) for CLI styling conventions
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
When adding new documentation:
|
|
26
|
+
1. Place it in the appropriate category directory
|
|
27
|
+
2. Update the relevant README.md file
|
|
28
|
+
3. Ensure cross-references are updated
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Agent Platform Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains documentation for agent platform integration, MCP (Model Context Protocol), and LLM tool integration.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[AI_TOOL_INTEGRATION.md](AI_TOOL_INTEGRATION.md)** - Documentation for AI tool integration with the httpcat CLI
|
|
8
|
+
- **[AX_LLM_ADVANCED_FEATURES.md](AX_LLM_ADVANCED_FEATURES.md)** - Advanced features for LLM integration with the AX agent system
|
|
9
|
+
- **[CAT_AGENT_BACKEND_INTEGRATION.md](CAT_AGENT_BACKEND_INTEGRATION.md)** - Backend integration guide for the CAT agent system
|
|
10
|
+
- **[CAT_AGENT_INTEGRATION.md](CAT_AGENT_INTEGRATION.md)** - Integration guide for the CAT agent system
|
|
11
|
+
- **[MCP_ONBOARDING.md](MCP_ONBOARDING.md)** - Onboarding guide for MCP (Model Context Protocol) server integration
|
|
12
|
+
|
|
13
|
+
## Key Concepts
|
|
14
|
+
|
|
15
|
+
- **MCP Server**: Model Context Protocol server for agent communication
|
|
16
|
+
- **Agent Platform**: Infrastructure for hosting and running AI agents
|
|
17
|
+
- **Tool Integration**: How LLMs and agents can use httpcat CLI commands as tools
|
|
18
|
+
- **Backend Integration**: How agents interact with the 402.cat API
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# API Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains API endpoint documentation and specifications for the 402.cat API.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[ENTRYPOINTS.md](ENTRYPOINTS.md)** - Overview of API entrypoints by category, including route structure, request/response formats, payment requirements, and migration guide from legacy routes
|
|
8
|
+
- **[FINAL_ENTRYPOINTS.md](FINAL_ENTRYPOINTS.md)** - Comprehensive documentation for every single entrypoint in the 402.cat API, designed for LLMs. Includes detailed request/response schemas, payment information, and implementation notes
|
|
9
|
+
|
|
10
|
+
## Key Information
|
|
11
|
+
|
|
12
|
+
- **Base URLs**: Production and local development URLs
|
|
13
|
+
- **Payment System**: x402 protocol v2 with `PAYMENT-SIGNATURE` header
|
|
14
|
+
- **Request Format**: JSON body with `{"input": {...}}` wrapper
|
|
15
|
+
- **Response Format**: JSON body with `{"output": {...}}` wrapper
|
|
16
|
+
- **HTTP Methods**: Most endpoints support both GET (query params) and POST (body)
|
|
17
|
+
|
|
18
|
+
## Categories
|
|
19
|
+
|
|
20
|
+
The API is organized into the following categories:
|
|
21
|
+
- Launchpad
|
|
22
|
+
- Tokens (Legacy)
|
|
23
|
+
- Swaps
|
|
24
|
+
- Perps
|
|
25
|
+
- Predictions
|
|
26
|
+
- Chat
|
|
27
|
+
- Fees (Legacy)
|
|
28
|
+
- Market Intelligence
|
|
29
|
+
- CEX.IO
|
|
30
|
+
- Security
|
|
31
|
+
- Risk
|
|
32
|
+
- Trading
|
|
33
|
+
- Opportunities
|
|
34
|
+
- Portfolio
|
|
35
|
+
- Automation
|
|
36
|
+
- System
|
|
37
|
+
- Agent
|
|
38
|
+
- Tools
|
|
39
|
+
- RPC
|
|
40
|
+
- Agent Hosting
|
|
41
|
+
- Billing
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# CLI Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains documentation for the httpcat CLI commands and help system.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[CLI_COMMANDS_BREAKDOWN.md](CLI_COMMANDS_BREAKDOWN.md)** - Complete reference for all httpcat CLI commands, organized by category (Launchpad, Trading, Portfolio, Market Intelligence, etc.). Includes global options, command syntax, examples, and API endpoint mappings
|
|
8
|
+
- **[CLI_HELP_MENU.md](CLI_HELP_MENU.md)** - Proposed help menu structure showing a cleaner, hierarchical command organization
|
|
9
|
+
- **[HELP_OUTPUT_EXAMPLE.md](HELP_OUTPUT_EXAMPLE.md)** - Example output of the `httpcat help` command after reorganization
|
|
10
|
+
|
|
11
|
+
## Command Categories
|
|
12
|
+
|
|
13
|
+
The CLI commands are organized into the following categories:
|
|
14
|
+
- Launchpad - Token creation and bonding curve operations
|
|
15
|
+
- Trading - Swaps, perps, and predictions
|
|
16
|
+
- Portfolio - Balances, positions, and transaction history
|
|
17
|
+
- Market Intelligence - Price data, market analysis
|
|
18
|
+
- Opportunities - Arbitrage and trading opportunities
|
|
19
|
+
- Send - Token transfers
|
|
20
|
+
- Approve - Token approvals
|
|
21
|
+
- Security & Safety - Token scanning and safety checks
|
|
22
|
+
- Risk Management - Risk assessment and policy management
|
|
23
|
+
- Sign - Message and transaction signing
|
|
24
|
+
- System - Health checks and system status
|
|
25
|
+
- Automation - Alerts, webhooks, and automation
|
|
26
|
+
- Tools - EVM development and interaction tools
|
|
27
|
+
- Agent - AI agent and MCP server commands
|
|
28
|
+
- Communication - Chat and messaging
|
|
29
|
+
- Configuration - Settings and environment management
|
|
30
|
+
- Shortcuts - Quick command aliases
|
|
31
|
+
|
|
32
|
+
## Global Options
|
|
33
|
+
|
|
34
|
+
All commands support:
|
|
35
|
+
- `-V, --version` - Output version number
|
|
36
|
+
- `-j, --json` - Output in JSON format
|
|
37
|
+
- `-q, --quiet` - Minimal output (exit codes only)
|
|
38
|
+
- `-v, --verbose` - Verbose error messages
|
|
39
|
+
- `--no-art` - Disable ASCII art
|
|
40
|
+
- `-k, --private-key <key>` - Private key (overrides config and env var)
|
|
41
|
+
- `-a, --account <index>` - Account index to use
|
|
42
|
+
- `-h, --help` - Display help for command
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Guides
|
|
2
|
+
|
|
3
|
+
This directory contains general guides and usage documentation.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[USAGE.md](USAGE.md)** - General usage instructions and getting started guide
|
|
8
|
+
- **[TESTING.md](TESTING.md)** - Testing guidelines and best practices
|
|
9
|
+
- **[RELEASE.md](RELEASE.md)** - Release process and versioning information
|
|
10
|
+
- **[EVENT_ENDPOINTS.md](EVENT_ENDPOINTS.md)** - Documentation for event endpoints and real-time features
|
|
11
|
+
- **[NEO_BLESSED_GUIDE.md](NEO_BLESSED_GUIDE.md)** - Guide for using the Neo Blessed UI library
|
|
12
|
+
- **[INSPO.md](INSPO.md)** - Design inspiration and reference materials
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
For new users, start with:
|
|
17
|
+
1. [USAGE.md](USAGE.md) - Learn how to use the CLI
|
|
18
|
+
2. [cli/CLI_COMMANDS_BREAKDOWN.md](../cli/CLI_COMMANDS_BREAKDOWN.md) - Explore available commands
|
|
19
|
+
3. [api/FINAL_ENTRYPOINTS.md](../api/FINAL_ENTRYPOINTS.md) - Understand the API
|
|
20
|
+
|
|
21
|
+
## Development
|
|
22
|
+
|
|
23
|
+
For developers:
|
|
24
|
+
1. [TESTING.md](TESTING.md) - Learn about testing practices
|
|
25
|
+
2. [RELEASE.md](RELEASE.md) - Understand the release process
|
|
26
|
+
3. [implementation/](../implementation/) - Review technical implementation details
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Implementation Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains technical implementation details, guides, and issue documentation.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[FRONTEND_IMPLEMENTATION_SUMMARY.md](FRONTEND_IMPLEMENTATION_SUMMARY.md)** - Summary of the three-tier RPC fallback system implementation for `viem` (Alchemy -> Public -> x402). **Note**: This document has some inaccuracies - see IMPLEMENTATION_REVIEW_AND_PLAN.md
|
|
8
|
+
- **[IMPLEMENTATION_REVIEW_AND_PLAN.md](IMPLEMENTATION_REVIEW_AND_PLAN.md)** - Review of the RPC fallback transport implementation, correcting inaccuracies in the summary document. Clarifies that the code uses `viem`'s `fallback()` transport, not a custom `fetchFn`
|
|
9
|
+
- **[RPC_TRANSPORT_BODY_CONSUMPTION_ISSUE.md](RPC_TRANSPORT_BODY_CONSUMPTION_ISSUE.md)** - Documentation of the "Body has already been read" error encountered with the custom `viem` RPC fallback transport, including root cause analysis and potential solutions
|
|
10
|
+
- **[PRD_BACKEND_RECEIPT.md](PRD_BACKEND_RECEIPT.md)** - Detailed breakdown of the RPC Proxy entrypoint implementation, including API interface, usage examples, integration with `httpcat-cli`, supported RPC methods, and technical details
|
|
11
|
+
- **[MCP_PROBLEM.md](MCP_PROBLEM.md)** - Diagnostic notes on MCP balance-check failure where MCP tool calls return "Transport closed". Includes environment context, likely root causes, and recommended next steps
|
|
12
|
+
|
|
13
|
+
## Key Technical Concepts
|
|
14
|
+
|
|
15
|
+
- **RPC Fallback Transport**: Three-tier fallback system (Alchemy -> Public RPC -> x402 paid RPC)
|
|
16
|
+
- **viem Integration**: Using `viem`'s `fallback()` transport for robust RPC calls
|
|
17
|
+
- **x402 Payment Protocol**: Integration with x402 v2 for paid RPC endpoints
|
|
18
|
+
- **MCP Server**: Model Context Protocol server for agent integration
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Planning Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains Product Requirements Documents (PRDs) and planning documents for future features and improvements.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[CLI_CEX_MARKET_PRD.md](CLI_CEX_MARKET_PRD.md)** - PRD defining CLI command implementation requirements for integrating 12 new API endpoints (3 CoinGecko, 9 CEX.IO) into the httpcat CLI. Details command structure, arguments, options, output formats, implementation snippets, error handling, testing, and documentation updates
|
|
8
|
+
- **[FRONTEND_CEX_MARKET_PRD.md](FRONTEND_CEX_MARKET_PRD.md)** - PRD defining frontend implementation requirements for integrating 12 new API endpoints (3 CoinGecko, 9 CEX.IO) into the 402.cat web application. Covers technical requirements, UI/UX specifications, component architecture, state management, API integration, error handling, and implementation phases
|
|
9
|
+
- **[PRD_TOOLS.md](PRD_TOOLS.md)** - Product Requirements Document defining a comprehensive set of EVM development and interaction tools for LLMs and agents, enabling server-side EVM interaction without local software. Outlines goals, non-goals, users, product surface, detailed API specifications for Address, ABI, Transaction, Signature, Multicall, Nonce, Gas, and Key Utilities, security considerations, implementation phases, and monetization strategy
|
|
10
|
+
- **[NEW_CLI_PLAN.md](NEW_CLI_PLAN.md)** - Comprehensive plan for reorganizing the httpcat CLI from a flat structure to a hierarchical one, aligning with the PRD's future architecture. Details current state, target state (new command structure), command mapping, implementation strategy (phases), documentation updates, testing strategy, migration examples, benefits, risks, and open questions
|
|
11
|
+
- **[NEW_PHONE_WHO_DIS.md](NEW_PHONE_WHO_DIS.md)** - Full Product Requirements Document for x402 service evolution into an Agent-Grade Launchpad + Market Intelligence + Execution Platform. Defines the system as a programmable, paid, safe, real-time financial operating system for crypto agents, with a first-class launchpad at its core
|
|
12
|
+
- **[MISSING_ENDPOINTS_AND_DATA.md](MISSING_ENDPOINTS_AND_DATA.md)** - Documents all endpoints, data structures, and implementations needed to complete placeholder CLI commands, categorized by Tools, Trade, Agent, and Gasless Swap command groups. Details status (missing backend endpoint, placeholder CLI, etc.), input/output schemas, payment, implementation notes, and provides an implementation priority list
|
|
13
|
+
|
|
14
|
+
## Implementation Priorities
|
|
15
|
+
|
|
16
|
+
1. **Tools Category**: 50+ tools endpoints need backend implementation (see MISSING_ENDPOINTS_AND_DATA.md)
|
|
17
|
+
2. **CLI Reorganization**: Migrate to hierarchical command structure (see NEW_CLI_PLAN.md)
|
|
18
|
+
3. **CEX Market Integration**: Complete backend integration for CEX.IO and CoinGecko commands
|
|
19
|
+
4. **Agent Platform**: Expand into full agent-grade financial operating layer (see NEW_PHONE_WHO_DIS.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Testing Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains test reports and testing documentation.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[BACKEND_TEST_REPORT.md](BACKEND_TEST_REPORT.md)** - Test report for the RPC Proxy Entrypoint, detailing successful tests for basic connectivity, `eth_blockNumber`, `eth_getBalance`, `eth_chainId`, and JSON-RPC format preservation. Confirms x402 payment integration is working but notes a minor issue with payment timing for rapid sequential requests
|
|
8
|
+
- **[COMMAND_TEST.md](COMMAND_TEST.md)** - Test report for market intelligence commands, showing that production endpoints returned 404 (Not Found) while local endpoints returned 405 (Payment Failed). Identifies that all market intelligence endpoints are GET-only and recommends fixing payment authorization and deploying endpoints to production
|
|
9
|
+
- **[TEST_REPORT_CEX_MARKET_COMMANDS.md](TEST_REPORT_CEX_MARKET_COMMANDS.md)** - Test report for CEX.IO & CoinGecko commands, confirming that command structure, help text, input validation, error handling, and symbol normalization passed. Notes that endpoint integration and output formatting require a running backend for full testing
|
|
10
|
+
|
|
11
|
+
## Test Status
|
|
12
|
+
|
|
13
|
+
- **RPC Proxy**: ✅ Production-ready (minor payment timing issue noted)
|
|
14
|
+
- **Market Intelligence Commands**: ⚠️ Endpoints not deployed to production, payment failing locally
|
|
15
|
+
- **CEX Market Commands**: ✅ CLI-side implementation complete, backend integration pending
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# UX Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains user experience guidelines and design documentation.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- **[GENERAL_STYLES.md](GENERAL_STYLES.md)** - Styling conventions and visual design patterns for the httpcat CLI, covering color scheme (rainbow palette), typography, headers, box formatting (`printBox`), table formatting (`cli-table3`), ASCII art (`printCat`, `printBanner`), emoji usage, status indicators, progress bars, quick commands sections, error/status messages, and special formatting functions. Emphasizes ANSI code handling
|
|
8
|
+
- **[STYLE_GUIDELINES.md](STYLE_GUIDELINES.md)** - Comprehensive design system guidelines for building on-brand UI elements for the 402.cat platform. Covers core design philosophy ("Agents are just cats with wallets"), typography (monospace fonts), color palette, spacing, borders, components, responsive design, and accessibility
|
|
9
|
+
- **[MAINTENANCE_MODE_UX.md](MAINTENANCE_MODE_UX.md)** - Implementation recommendations for handling maintenance mode in the httpcat CLI, including API behavior, health check responses, error handling, user-friendly messages, and testing. Provides TypeScript code snippets for maintenance mode checks, error handling, command-level checks, interactive mode status, and watch mode
|
|
10
|
+
|
|
11
|
+
## Design Principles
|
|
12
|
+
|
|
13
|
+
- **Terminal Aesthetic**: Monospace fonts, ASCII art, terminal-style formatting
|
|
14
|
+
- **Playful & Technical**: "Agents are just cats with wallets" - playful language with technical precision
|
|
15
|
+
- **Rainbow Color Palette**: Consistent use of magenta, blue, yellow, green, cyan, red, and dim colors
|
|
16
|
+
- **User-Friendly**: Clear error messages, helpful status indicators, intuitive command structure
|
package/issues.txt
ADDED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "httpcat-cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "CLI tool for interacting with
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "CLI tool for interacting with 402.cat - create, buy, and sell tokens with x402 payments",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"httpcat": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
|
+
"prebuild": "node scripts/inject-build-constants.js",
|
|
11
12
|
"build": "tsc",
|
|
12
13
|
"dev": "tsc --watch",
|
|
13
14
|
"start": "node dist/index.js",
|
|
@@ -16,7 +17,12 @@
|
|
|
16
17
|
"test:watch": "vitest",
|
|
17
18
|
"test:coverage": "vitest run --coverage",
|
|
18
19
|
"test:unit": "vitest run tests/unit",
|
|
19
|
-
"test:integration": "vitest run tests/integration"
|
|
20
|
+
"test:integration": "vitest run tests/integration",
|
|
21
|
+
"test:launchpad": "vitest run -t 'Launchpad'",
|
|
22
|
+
"test:system": "vitest run -t 'System'",
|
|
23
|
+
"test:swaps": "vitest run -t 'Swaps'",
|
|
24
|
+
"test:perps": "vitest run -t 'Perps'",
|
|
25
|
+
"test:predictions": "vitest run -t 'Predictions'"
|
|
20
26
|
},
|
|
21
27
|
"keywords": [
|
|
22
28
|
"402.cat",
|
|
@@ -43,29 +49,38 @@
|
|
|
43
49
|
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
44
50
|
"@scure/bip32": "^2.0.1",
|
|
45
51
|
"@scure/bip39": "^2.0.1",
|
|
52
|
+
"@x402/core": "^2.0.0",
|
|
53
|
+
"@x402/evm": "^2.0.0",
|
|
54
|
+
"@x402/fetch": "^2.0.0",
|
|
55
|
+
"better-sqlite3": "^12.5.0",
|
|
46
56
|
"chalk": "^5.3.0",
|
|
47
57
|
"cli-table3": "^0.6.3",
|
|
48
58
|
"commander": "^14.0.2",
|
|
49
59
|
"conf": "^15.0.2",
|
|
60
|
+
"eventsource": "^2.0.2",
|
|
50
61
|
"global": "^4.4.0",
|
|
62
|
+
"ink": "^5.0.1",
|
|
63
|
+
"ink-autocomplete": "^0.0.0",
|
|
64
|
+
"ink-text-input": "^6.0.0",
|
|
51
65
|
"inquirer": "^9.2.12",
|
|
52
|
-
"neo-blessed": "^0.2.0",
|
|
53
66
|
"ora": "^9.0.0",
|
|
54
|
-
"
|
|
67
|
+
"react": "^18.3.1",
|
|
68
|
+
"viem": "^2.43.5",
|
|
55
69
|
"ws": "^8.18.0",
|
|
56
|
-
"@x402/core": "^2.0.0",
|
|
57
|
-
"@x402/fetch": "^2.0.0",
|
|
58
|
-
"@x402/evm": "^2.0.0",
|
|
59
70
|
"zod": "^4.1.13"
|
|
60
71
|
},
|
|
61
72
|
"devDependencies": {
|
|
62
73
|
"@jest/globals": "^30.2.0",
|
|
63
|
-
"@
|
|
74
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
75
|
+
"@types/better-sqlite3": "^7.6.11",
|
|
76
|
+
"@types/eventsource": "^1.1.15",
|
|
64
77
|
"@types/inquirer": "^9.0.7",
|
|
65
78
|
"@types/jest": "^29.5.12",
|
|
66
79
|
"@types/node": "^25.0.0",
|
|
80
|
+
"@types/react": "^18.3.12",
|
|
67
81
|
"@types/ws": "^8.5.13",
|
|
68
82
|
"@vitest/ui": "^4.0.16",
|
|
83
|
+
"ink-testing-library": "^4.0.0",
|
|
69
84
|
"jest": "^29.7.0",
|
|
70
85
|
"ts-jest": "^29.1.2",
|
|
71
86
|
"typescript": "^5.3.3",
|