agent-cards 0.5.46 → 0.5.47
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/src/commands/buy-chat.d.ts +7 -9
- package/dist/src/commands/buy-chat.d.ts.map +1 -1
- package/dist/src/commands/buy-chat.js +165 -89
- package/dist/src/commands/buy-chat.js.map +1 -1
- package/dist/src/lib/config.d.ts +8 -0
- package/dist/src/lib/config.d.ts.map +1 -1
- package/dist/src/lib/config.js +28 -0
- package/dist/src/lib/config.js.map +1 -1
- package/package.json +8 -4
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Natural-language `buy` chat.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* response (the loop runs several DoorDash/Anthropic round-trips server-side, so a turn can
|
|
6
|
-
* take 10–30s — we show an `ora` spinner while it runs). No SSE needed.
|
|
2
|
+
* Natural-language `buy` chat. Runs a Vercel AI SDK ToolLoopAgent locally: it connects to the
|
|
3
|
+
* AgentCard MCP server (`/mcp`, authenticated with the stored JWT), loads ALL of its tools, and
|
|
4
|
+
* lets the model use any of them. Model calls go through the backend `/buy/agent/llm` gateway.
|
|
7
5
|
*
|
|
8
|
-
* `seed` is an optional first message auto-sent right after the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* `seed` is an optional first message auto-sent right after the banner — this is how
|
|
7
|
+
* `agent-cards buy <free text>` works: the free text becomes the first turn, then the user stays
|
|
8
|
+
* in the interactive loop. The chat is in-memory for the session (no server-stored conversation),
|
|
9
|
+
* so `--resume` is not supported here; it prints a notice and starts fresh.
|
|
12
10
|
*/
|
|
13
11
|
export declare function buyChat(resume?: string, seed?: string): Promise<void>;
|
|
14
12
|
//# sourceMappingURL=buy-chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy-chat.d.ts","sourceRoot":"","sources":["../../../src/commands/buy-chat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buy-chat.d.ts","sourceRoot":"","sources":["../../../src/commands/buy-chat.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6H3E"}
|
|
@@ -2,29 +2,84 @@ import chalk from 'chalk';
|
|
|
2
2
|
import readline from 'readline';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import figlet from 'figlet';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { createMCPClient } from '@ai-sdk/mcp';
|
|
6
|
+
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
7
|
+
import { ToolLoopAgent, stepCountIs } from 'ai';
|
|
8
|
+
import { getJwt, getApiUrl, getMcpUrl } from '../lib/config.js';
|
|
9
|
+
// The buy chat runs the agent loop HERE in the CLI (Vercel AI SDK), connecting to the AgentCard
|
|
10
|
+
// MCP server as a client to get the user's FULL toolset (shopping, cards, wallet, KYC, plan,
|
|
11
|
+
// transactions, support, …). Model calls are proxied through the backend `/buy/agent/llm` gateway
|
|
12
|
+
// so the dedicated Anthropic key stays server-side and never ships in this public npm package.
|
|
13
|
+
// Claude model the loop runs. Must be a `claude-*` id (the gateway allowlists that family).
|
|
14
|
+
// Matches the backend's BUY_AGENT_MODEL default; override with AGENT_CARDS_BUY_MODEL.
|
|
15
|
+
const MODEL_ID = process.env.AGENT_CARDS_BUY_MODEL || 'claude-sonnet-4-6';
|
|
16
|
+
// Hard ceiling on tool round-trips per turn — a backstop against a runaway loop.
|
|
17
|
+
const MAX_STEPS = 30;
|
|
18
|
+
const SYSTEM = [
|
|
19
|
+
'You are the AgentCard agent, operating inside the `agent-cards` command-line tool for a logged-in user.',
|
|
20
|
+
'You have the user\'s full AgentCard toolset over MCP: natural-language shopping + checkout (the `buy` tool),',
|
|
21
|
+
'virtual cards, wallet & funding, KYC, plan/subscription, transactions, connected apps, settings, and support.',
|
|
22
|
+
'',
|
|
23
|
+
'MONEY SAFETY (critical): never place an order, create or fund a card, or move money without the user\'s',
|
|
24
|
+
'explicit confirmation in the conversation. Before any purchase, show the itemized cart and the exact total,',
|
|
25
|
+
'then wait for a clear "yes". The shopping/checkout tools also confirm server-side — never try to bypass that.',
|
|
26
|
+
'',
|
|
27
|
+
'Be concise and conversational. Briefly say what you\'re about to do, then do it. When a tool needs information',
|
|
28
|
+
'you don\'t have yet (a delivery address, which card, an amount), ask the user rather than guessing.',
|
|
29
|
+
].join('\n');
|
|
30
|
+
function printYou(text) {
|
|
31
|
+
console.log(`${chalk.cyan('you')} ${text}`);
|
|
9
32
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
/** Animated green ASCII banner (kept from the original chat UX). */
|
|
34
|
+
async function renderBanner() {
|
|
35
|
+
const banner = figlet.textSync('buy', { font: 'Small' });
|
|
36
|
+
const lines = banner.split('\n');
|
|
37
|
+
const totalChars = Math.max(...lines.map((l) => l.length));
|
|
38
|
+
const frames = totalChars + 6;
|
|
39
|
+
const bannerHeight = lines.length;
|
|
40
|
+
console.log();
|
|
41
|
+
for (const line of lines)
|
|
42
|
+
console.log(chalk.dim(line));
|
|
43
|
+
for (let frame = 0; frame < frames; frame++) {
|
|
44
|
+
process.stdout.write(`\x1B[${bannerHeight}A`);
|
|
45
|
+
for (const line of lines) {
|
|
46
|
+
let out = '';
|
|
47
|
+
for (let i = 0; i < line.length; i++) {
|
|
48
|
+
if (i >= frame - 3 && i <= frame)
|
|
49
|
+
out += chalk.green(line[i]);
|
|
50
|
+
else if (i < frame - 3)
|
|
51
|
+
out += chalk.greenBright(line[i]);
|
|
52
|
+
else
|
|
53
|
+
out += chalk.dim(line[i]);
|
|
54
|
+
}
|
|
55
|
+
process.stdout.write('\x1B[2K' + out + '\n');
|
|
56
|
+
}
|
|
57
|
+
await new Promise((r) => setTimeout(r, 12));
|
|
58
|
+
}
|
|
59
|
+
process.stdout.write(`\x1B[${bannerHeight}A`);
|
|
60
|
+
for (const line of lines)
|
|
61
|
+
process.stdout.write('\x1B[2K' + chalk.green(line) + '\n');
|
|
62
|
+
}
|
|
63
|
+
/** Turn an agent/HTTP error into a short, user-facing line. */
|
|
64
|
+
function friendlyError(err) {
|
|
65
|
+
const status = err?.statusCode ?? err?.status ?? err?.data?.error?.status;
|
|
66
|
+
if (status === 401)
|
|
67
|
+
return 'your session expired. run `agent-cards login` and try again.';
|
|
68
|
+
if (status === 429)
|
|
69
|
+
return 'you\'ve hit today\'s usage limit. try again later.';
|
|
70
|
+
if (status === 503)
|
|
71
|
+
return 'buy chat isn\'t available right now. try again in a moment.';
|
|
72
|
+
return `something went wrong: ${err?.message ?? String(err)}`;
|
|
16
73
|
}
|
|
17
74
|
/**
|
|
18
|
-
* Natural-language `buy` chat.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* response (the loop runs several DoorDash/Anthropic round-trips server-side, so a turn can
|
|
22
|
-
* take 10–30s — we show an `ora` spinner while it runs). No SSE needed.
|
|
75
|
+
* Natural-language `buy` chat. Runs a Vercel AI SDK ToolLoopAgent locally: it connects to the
|
|
76
|
+
* AgentCard MCP server (`/mcp`, authenticated with the stored JWT), loads ALL of its tools, and
|
|
77
|
+
* lets the model use any of them. Model calls go through the backend `/buy/agent/llm` gateway.
|
|
23
78
|
*
|
|
24
|
-
* `seed` is an optional first message auto-sent right after the
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
79
|
+
* `seed` is an optional first message auto-sent right after the banner — this is how
|
|
80
|
+
* `agent-cards buy <free text>` works: the free text becomes the first turn, then the user stays
|
|
81
|
+
* in the interactive loop. The chat is in-memory for the session (no server-stored conversation),
|
|
82
|
+
* so `--resume` is not supported here; it prints a notice and starts fresh.
|
|
28
83
|
*/
|
|
29
84
|
export async function buyChat(resume, seed) {
|
|
30
85
|
const jwt = getJwt();
|
|
@@ -35,85 +90,106 @@ export async function buyChat(resume, seed) {
|
|
|
35
90
|
console.log();
|
|
36
91
|
process.exit(1);
|
|
37
92
|
}
|
|
38
|
-
|
|
93
|
+
await renderBanner();
|
|
39
94
|
if (resume) {
|
|
40
|
-
|
|
41
|
-
console.log(chalk.dim(`resuming ${conversationId}\n`));
|
|
42
|
-
const messages = await api(`/buy/agent/conversations/${conversationId}/messages`);
|
|
43
|
-
for (const msg of messages) {
|
|
44
|
-
printMsg(msg.role, msg.body, ts(msg.createdAt));
|
|
45
|
-
}
|
|
46
|
-
console.log();
|
|
95
|
+
console.log(chalk.dim('the buy chat now runs locally and starts fresh each session — --resume isn\'t available.'));
|
|
47
96
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
out += chalk.dim(line[i]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
process.stdout.write('\x1B[2K' + out + '\n');
|
|
79
|
-
}
|
|
80
|
-
await new Promise(r => setTimeout(r, 12));
|
|
81
|
-
}
|
|
82
|
-
// final state: all green
|
|
83
|
-
process.stdout.write(`\x1B[${bannerHeight}A`);
|
|
84
|
-
for (const line of lines) {
|
|
85
|
-
process.stdout.write('\x1B[2K' + chalk.green(line) + '\n');
|
|
86
|
-
}
|
|
87
|
-
console.log(chalk.dim('tell me what to buy — e.g. "order a burrito from chipotle on doordash". ctrl+c to exit.\n'));
|
|
97
|
+
// Connect to the MCP server and build the agent over its full toolset.
|
|
98
|
+
const connecting = ora({ text: chalk.dim('connecting'), color: 'green', discardStdin: false }).start();
|
|
99
|
+
let mcpClient;
|
|
100
|
+
let agent;
|
|
101
|
+
try {
|
|
102
|
+
mcpClient = await createMCPClient({
|
|
103
|
+
transport: { type: 'http', url: getMcpUrl(), headers: { Authorization: `Bearer ${jwt}` } },
|
|
104
|
+
});
|
|
105
|
+
const tools = await mcpClient.tools();
|
|
106
|
+
const anthropic = createAnthropic({
|
|
107
|
+
baseURL: `${getApiUrl()}/buy/agent/llm/v1`, // provider calls `${baseURL}/messages`
|
|
108
|
+
apiKey: 'managed-by-agentcard', // placeholder; the custom fetch below strips it and the gateway injects the real key
|
|
109
|
+
// Authenticate the gateway with the user's JWT (Bearer), and never send a client x-api-key.
|
|
110
|
+
fetch: async (input, init) => {
|
|
111
|
+
const headers = new Headers(init?.headers);
|
|
112
|
+
headers.delete('x-api-key');
|
|
113
|
+
headers.set('authorization', `Bearer ${jwt}`);
|
|
114
|
+
return fetch(input, { ...init, headers });
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
agent = new ToolLoopAgent({
|
|
118
|
+
model: anthropic(MODEL_ID),
|
|
119
|
+
tools,
|
|
120
|
+
instructions: SYSTEM,
|
|
121
|
+
stopWhen: stepCountIs(MAX_STEPS),
|
|
122
|
+
});
|
|
123
|
+
connecting.succeed(chalk.dim(`connected · ${Object.keys(tools).length} tools`));
|
|
88
124
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// the
|
|
125
|
+
catch (err) {
|
|
126
|
+
connecting.stop();
|
|
127
|
+
console.error(chalk.red(`couldn't connect to AgentCard: ${err?.message ?? String(err)}`));
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
console.log(chalk.dim('tell me what to do — e.g. "order a burrito from chipotle on doordash", "show my cards", "what\'s my balance". ctrl+c to exit.\n'));
|
|
131
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: chalk.cyan('> ') });
|
|
132
|
+
// Conversation history, fed to the agent each turn (in-memory for this session).
|
|
133
|
+
const messages = [];
|
|
134
|
+
/** Run one turn: stream the assistant's text + tool activity, then persist the new messages. */
|
|
97
135
|
async function sendTurn(text, fromInput) {
|
|
98
136
|
if (fromInput) {
|
|
137
|
+
// Rewrite the line the terminal just echoed into a formatted `you` line.
|
|
99
138
|
readline.moveCursor(process.stdout, 0, -1);
|
|
100
139
|
readline.clearLine(process.stdout, 0);
|
|
101
140
|
readline.cursorTo(process.stdout, 0);
|
|
102
141
|
}
|
|
103
|
-
|
|
104
|
-
|
|
142
|
+
printYou(text);
|
|
143
|
+
messages.push({ role: 'user', content: text });
|
|
105
144
|
const spinner = ora({ text: chalk.dim('thinking'), color: 'green', discardStdin: false }).start();
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
method: 'POST',
|
|
109
|
-
body: { body: text },
|
|
110
|
-
});
|
|
145
|
+
let spinnerOn = true;
|
|
146
|
+
const stopSpinner = () => { if (spinnerOn) {
|
|
111
147
|
spinner.stop();
|
|
112
|
-
|
|
148
|
+
spinnerOn = false;
|
|
149
|
+
} };
|
|
150
|
+
let printedLabel = false;
|
|
151
|
+
let midText = false;
|
|
152
|
+
try {
|
|
153
|
+
const result = await agent.stream({ messages });
|
|
154
|
+
for await (const chunk of result.fullStream) {
|
|
155
|
+
if (chunk.type === 'text-delta') {
|
|
156
|
+
stopSpinner();
|
|
157
|
+
if (!printedLabel) {
|
|
158
|
+
process.stdout.write(`${chalk.green('buy')} `);
|
|
159
|
+
printedLabel = true;
|
|
160
|
+
}
|
|
161
|
+
process.stdout.write(chunk.text);
|
|
162
|
+
midText = true;
|
|
163
|
+
}
|
|
164
|
+
else if (chunk.type === 'tool-call') {
|
|
165
|
+
stopSpinner();
|
|
166
|
+
if (midText) {
|
|
167
|
+
process.stdout.write('\n');
|
|
168
|
+
midText = false;
|
|
169
|
+
}
|
|
170
|
+
console.log(chalk.dim(` · ${chunk.toolName}`));
|
|
171
|
+
}
|
|
172
|
+
else if (chunk.type === 'error') {
|
|
173
|
+
stopSpinner();
|
|
174
|
+
if (midText) {
|
|
175
|
+
process.stdout.write('\n');
|
|
176
|
+
midText = false;
|
|
177
|
+
}
|
|
178
|
+
console.error(chalk.red(` ${friendlyError(chunk.error)}`));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
stopSpinner();
|
|
182
|
+
if (midText)
|
|
183
|
+
process.stdout.write('\n');
|
|
184
|
+
// Persist the model's generated messages (assistant text + tool calls/results) so the next
|
|
185
|
+
// turn has full context.
|
|
186
|
+
messages.push(...(await result.response).messages);
|
|
113
187
|
}
|
|
114
188
|
catch (err) {
|
|
115
|
-
|
|
116
|
-
|
|
189
|
+
stopSpinner();
|
|
190
|
+
if (midText)
|
|
191
|
+
process.stdout.write('\n');
|
|
192
|
+
console.error(chalk.red(friendlyError(err)));
|
|
117
193
|
}
|
|
118
194
|
}
|
|
119
195
|
rl.on('line', async (line) => {
|
|
@@ -125,19 +201,19 @@ export async function buyChat(resume, seed) {
|
|
|
125
201
|
await sendTurn(text, true);
|
|
126
202
|
rl.prompt();
|
|
127
203
|
});
|
|
128
|
-
// Auto-send the seeded first message (from `buy <free text>`)
|
|
129
|
-
|
|
130
|
-
if (seed && !resume) {
|
|
204
|
+
// Auto-send the seeded first message (from `buy <free text>`), then continue interactively.
|
|
205
|
+
if (seed) {
|
|
131
206
|
await sendTurn(seed, false);
|
|
132
207
|
}
|
|
133
208
|
rl.prompt();
|
|
134
209
|
function cleanup() {
|
|
210
|
+
void mcpClient.close().catch(() => { });
|
|
135
211
|
rl.close();
|
|
136
212
|
process.exit(0);
|
|
137
213
|
}
|
|
138
214
|
rl.on('close', cleanup);
|
|
139
215
|
process.on('SIGINT', () => {
|
|
140
|
-
console.log(chalk.dim(
|
|
216
|
+
console.log(chalk.dim('\n\nbye.'));
|
|
141
217
|
cleanup();
|
|
142
218
|
});
|
|
143
219
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy-chat.js","sourceRoot":"","sources":["../../../src/commands/buy-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAiB,MAAM,KAAK,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buy-chat.js","sourceRoot":"","sources":["../../../src/commands/buy-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAiB,MAAM,KAAK,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqB,MAAM,IAAI,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,+FAA+F;AAE/F,4FAA4F;AAC5F,sFAAsF;AACtF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,mBAAmB,CAAC;AAC1E,iFAAiF;AACjF,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,MAAM,GAAG;IACb,yGAAyG;IACzG,8GAA8G;IAC9G,+GAA+G;IAC/G,EAAE;IACF,yGAAyG;IACzG,6GAA6G;IAC7G,+GAA+G;IAC/G,EAAE;IACF,gHAAgH;IAChH,qGAAqG;CACtG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,SAAS,QAAQ,CAAC,IAAY;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?: string;
|
|
4
4
|
jwt?: string;
|
|
5
5
|
apiUrl?: string;
|
|
6
|
+
mcpUrl?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function readConfig(): Config;
|
|
8
9
|
export declare function writeConfig(data: Partial<Config>): void;
|
|
9
10
|
export declare function getApiUrl(): string;
|
|
10
11
|
export declare function getJwt(): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The AgentCard MCP server URL (Streamable HTTP, `/mcp`) the `buy` chat connects to as an MCP
|
|
14
|
+
* client. Resolution order: stored config → AGENT_CARDS_MCP_URL env → derived from the API URL
|
|
15
|
+
* (api.agentcard.sh → mcp.agentcard.sh/mcp) → prod default. Local dev runs the MCP HTTP server on
|
|
16
|
+
* a separate port (`pnpm dev:mcp-http`), so set AGENT_CARDS_MCP_URL=http://localhost:3002/mcp there.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getMcpUrl(): string;
|
|
11
19
|
/** Remove stored auth (email + jwt) so user can log in as someone else. */
|
|
12
20
|
export declare function clearAuth(): void;
|
|
13
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,QAAkC,CAAC;AAG1D,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,IAAI,MAAM,CAOnC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAIvD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAGlC;AAED,wBAAgB,MAAM,IAAI,MAAM,GAAG,SAAS,CAE3C;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,IAAI,IAAI,CAQhC"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,QAAkC,CAAC;AAG1D,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,IAAI,MAAM,CAOnC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAIvD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAGlC;AAED,wBAAgB,MAAM,IAAI,MAAM,GAAG,SAAS,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAkBlC;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,IAAI,IAAI,CAQhC"}
|
package/dist/src/lib/config.js
CHANGED
|
@@ -25,6 +25,34 @@ export function getApiUrl() {
|
|
|
25
25
|
export function getJwt() {
|
|
26
26
|
return readConfig().jwt ?? process.env.AGENT_CARDS_JWT;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The AgentCard MCP server URL (Streamable HTTP, `/mcp`) the `buy` chat connects to as an MCP
|
|
30
|
+
* client. Resolution order: stored config → AGENT_CARDS_MCP_URL env → derived from the API URL
|
|
31
|
+
* (api.agentcard.sh → mcp.agentcard.sh/mcp) → prod default. Local dev runs the MCP HTTP server on
|
|
32
|
+
* a separate port (`pnpm dev:mcp-http`), so set AGENT_CARDS_MCP_URL=http://localhost:3002/mcp there.
|
|
33
|
+
*/
|
|
34
|
+
export function getMcpUrl() {
|
|
35
|
+
const cfg = readConfig();
|
|
36
|
+
if (cfg.mcpUrl)
|
|
37
|
+
return cfg.mcpUrl;
|
|
38
|
+
if (process.env.AGENT_CARDS_MCP_URL)
|
|
39
|
+
return process.env.AGENT_CARDS_MCP_URL;
|
|
40
|
+
try {
|
|
41
|
+
const u = new URL(getApiUrl());
|
|
42
|
+
if (u.hostname.startsWith('api.')) {
|
|
43
|
+
u.hostname = `mcp.${u.hostname.slice(4)}`;
|
|
44
|
+
return `${u.origin}/mcp`;
|
|
45
|
+
}
|
|
46
|
+
if (u.hostname.includes('.api.')) {
|
|
47
|
+
u.hostname = u.hostname.replace('.api.', '.mcp.');
|
|
48
|
+
return `${u.origin}/mcp`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
/* fall through to the prod default */
|
|
53
|
+
}
|
|
54
|
+
return 'https://mcp.agentcard.sh/mcp';
|
|
55
|
+
}
|
|
28
56
|
/** Remove stored auth (email + jwt) so user can log in as someone else. */
|
|
29
57
|
export function clearAuth() {
|
|
30
58
|
const cfg = readConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,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
"version": "0.5.47",
|
|
4
4
|
"description": "CLI for managing virtual debit cards for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"assets"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=22"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"dev": "tsx bin/agent-cards.ts",
|
|
@@ -19,14 +19,18 @@
|
|
|
19
19
|
"prepublishOnly": "pnpm build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@ai-sdk/anthropic": "^4.0.1",
|
|
23
|
+
"@ai-sdk/mcp": "^2.0.3",
|
|
24
|
+
"ai": "^7.0.4",
|
|
22
25
|
"chalk": "^5.3.0",
|
|
23
26
|
"cli-table3": "^0.6.3",
|
|
24
27
|
"commander": "^12.0.0",
|
|
25
|
-
"posthog-node": "^4.0.0",
|
|
26
28
|
"figlet": "^1.10.0",
|
|
27
29
|
"inquirer": "^9.2.15",
|
|
28
30
|
"open": "^10.1.0",
|
|
29
|
-
"ora": "^8.2.0"
|
|
31
|
+
"ora": "^8.2.0",
|
|
32
|
+
"posthog-node": "^4.0.0",
|
|
33
|
+
"zod": "^4.4.3"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
36
|
"@types/figlet": "^1.7.0",
|