Skip to content

Commit 5877393

Browse files
authored
Merge pull request #685 from Merit-Systems/master
disable cdp error reporting
2 parents 019eaaf + e4fe39b commit 5877393

5 files changed

Lines changed: 77 additions & 21 deletions

File tree

packages/app/server/src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const env = createEnv({
2525
CDP_API_KEY_ID: z.string().optional(),
2626
CDP_API_KEY_SECRET: z.string().optional(),
2727
CDP_WALLET_SECRET: z.string().optional(),
28+
DISABLE_CDP_ERROR_REPORTING: z.coerce.boolean().default(true),
2829

2930
// Facilitator URLs
3031
PROXY_FACILITATOR_URL: z.string().url().optional(),

templates/echo-cli/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
},
1010
"scripts": {
1111
"start": "tsx src/index.ts",
12-
"dev": "tsx src/index.ts",
13-
"build": "tsc",
12+
"dev": "tsx --env-file=.env.local src/index.ts",
13+
"build": "node scripts/build.js",
1414
"clean": "rm -rf dist",
1515
"typecheck": "tsc --noEmit"
1616
},
@@ -36,6 +36,7 @@
3636
"cli-table3": "^0.6.5",
3737
"commander": "^14.0.2",
3838
"conf": "^15.0.2",
39+
"dotenv": "^16.4.7",
3940
"ink": "^6.4.0",
4041
"keytar": "^7.9.0",
4142
"open": "^10.2.0",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { execSync } from 'child_process';
2+
import dotenv from 'dotenv';
3+
import { readFileSync, writeFileSync } from 'fs';
4+
import { dirname, join } from 'path';
5+
import { fileURLToPath } from 'url';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = dirname(__filename);
9+
const rootDir = join(__dirname, '..');
10+
11+
// Load environment variables from .env.local
12+
dotenv.config({ path: join(rootDir, '.env.local') });
13+
14+
const ECHO_APP_ID = process.env.ECHO_APP_ID;
15+
16+
if (!ECHO_APP_ID) {
17+
console.error('Error: ECHO_APP_ID not found in .env.local');
18+
process.exit(1);
19+
}
20+
21+
const constantsPath = join(rootDir, 'src', 'constants.ts');
22+
23+
// Read the original file
24+
const originalContent = readFileSync(constantsPath, 'utf8');
25+
26+
// Replace process.env.ECHO_APP_ID with the actual value
27+
const modifiedContent = originalContent.replace(
28+
/export const ECHO_APP_ID = process\.env\.ECHO_APP_ID!;/,
29+
`export const ECHO_APP_ID = '${ECHO_APP_ID}';`
30+
);
31+
32+
try {
33+
// Write modified content
34+
writeFileSync(constantsPath, modifiedContent, 'utf8');
35+
console.log('Building with ECHO_APP_ID:', ECHO_APP_ID);
36+
37+
// Run TypeScript compiler
38+
execSync('tsc', { stdio: 'inherit', cwd: rootDir });
39+
40+
console.log('Build completed successfully!');
41+
} finally {
42+
// Always restore the original file
43+
writeFileSync(constantsPath, originalContent, 'utf8');
44+
console.log('Restored original constants.ts');
45+
}
Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
import { MODELS } from '@/config/models'
1+
import { MODELS } from '@/config/models';
22

3-
export { ECHODEX_ASCII_ART } from '@/config/ascii'
4-
export { MODELS, DEFAULT_MODEL } from '@/config/models'
5-
export { MESSAGE_MODES, THINKING_MESSAGES, THINKING_INTERVAL, THINKING_COLORS } from '@/config/messages'
6-
export { WALLET_CHAINS, WALLET_OPTIONAL_METHODS, AUTH_OPTIONS } from '@/config/wallet'
3+
export { ECHODEX_ASCII_ART } from '@/config/ascii';
4+
export {
5+
MESSAGE_MODES,
6+
THINKING_COLORS,
7+
THINKING_INTERVAL,
8+
THINKING_MESSAGES,
9+
} from '@/config/messages';
10+
export { DEFAULT_MODEL, MODELS } from '@/config/models';
11+
export {
12+
AUTH_OPTIONS,
13+
WALLET_CHAINS,
14+
WALLET_OPTIONAL_METHODS,
15+
} from '@/config/wallet';
716

8-
const ECHO_URL = 'https://echo.merit.systems'
9-
const ECHO_API_URL = 'https://api.echo.merit.systems/v1'
10-
const ECHO_ROUTER_URL = 'https://echo.router.merit.systems'
17+
const ECHO_URL = 'https://echo.merit.systems';
18+
const ECHO_API_URL = 'https://api.echo.merit.systems/v1';
19+
const ECHO_ROUTER_URL = 'https://echo.router.merit.systems';
1120

12-
export const AGENT_NAME = 'echodex' as const
13-
export const AVAILABLE_MODELS = MODELS
21+
export const AGENT_NAME = 'echodex' as const;
22+
export const AVAILABLE_MODELS = MODELS;
1423

15-
export const ECHO_APP_ID = 'dbfe663c-b54d-4a64-bcc1-1cb24f4da32f'
16-
export const WALLETCONNECT_PROJECT_ID = '592e3344e57cbc26ad91d191e82a4185'
17-
export const ECHO_KEYS_URL = `${ECHO_URL}/app/${ECHO_APP_ID}/keys`
24+
export const ECHO_APP_ID = process.env.ECHO_APP_ID!;
25+
export const WALLETCONNECT_PROJECT_ID = '592e3344e57cbc26ad91d191e82a4185';
26+
export const ECHO_KEYS_URL = `${ECHO_URL}/app/${ECHO_APP_ID}/keys`;
1827

1928
export const APP = {
2029
name: 'Echodex',
@@ -25,12 +34,12 @@ export const APP = {
2534
echoKeysUrl: `${ECHO_URL}/app/${ECHO_APP_ID}/keys`,
2635
echoUrl: ECHO_URL,
2736
echoApiUrl: ECHO_API_URL,
28-
echoRouterUrl: ECHO_ROUTER_URL
29-
} as const
37+
echoRouterUrl: ECHO_ROUTER_URL,
38+
} as const;
3039

3140
export const APP_METADATA = {
3241
name: APP.name,
3342
description: APP.description,
3443
url: APP.echoUrl,
35-
icons: [`${APP.echoUrl}/favicon.ico`]
36-
}
44+
icons: [`${APP.echoUrl}/favicon.ico`],
45+
};

templates/echo-cli/src/core/profile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function showEchoProfile(): Promise<void> {
4646
label('Email:', chalk.white(user.email))
4747
label('Balance:', chalk.green(`$${balance.balance.toFixed(4)}`))
4848
label('Total Spent:', chalk.yellow(`$${balance.totalSpent.toFixed(4)}`))
49-
label('Created:', chalk.white(new Date(user.createdAt).toLocaleDateString()))
49+
label('Created:', chalk.white(new Date(user.createdAt as string).toLocaleDateString()))
5050
blankLine()
5151
} catch (err) {
5252
displayAppError(createError({
@@ -89,7 +89,7 @@ async function showLocalWalletProfile(): Promise<void> {
8989
}
9090

9191
try {
92-
const balance = await getUSDCBalance(session.address, session.chainId)
92+
const balance = await getUSDCBalance(session.address as `0x${string}`, session.chainId)
9393

9494
blankLine()
9595
header('=== Local Wallet Profile ===')

0 commit comments

Comments
 (0)