agentaos 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -50
- package/dist/cli/commands/admin.command.d.ts +5 -0
- package/dist/cli/commands/admin.command.d.ts.map +1 -1
- package/dist/cli/commands/admin.command.js +50 -2
- package/dist/cli/commands/admin.command.js.map +1 -1
- package/dist/cli/commands/init.command.d.ts.map +1 -1
- package/dist/cli/commands/init.command.js +101 -292
- package/dist/cli/commands/init.command.js.map +1 -1
- package/dist/cli/commands/login.command.d.ts.map +1 -1
- package/dist/cli/commands/login.command.js +60 -54
- package/dist/cli/commands/login.command.js.map +1 -1
- package/dist/cli/commands/pay.command.d.ts +3 -0
- package/dist/cli/commands/pay.command.d.ts.map +1 -0
- package/dist/cli/commands/pay.command.js +186 -0
- package/dist/cli/commands/pay.command.js.map +1 -0
- package/dist/cli/commands/status.command.d.ts.map +1 -1
- package/dist/cli/commands/status.command.js +231 -56
- package/dist/cli/commands/status.command.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +51 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +9 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +35 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/lib/ensure-session.d.ts +16 -0
- package/dist/lib/ensure-session.d.ts.map +1 -0
- package/dist/lib/ensure-session.js +53 -0
- package/dist/lib/ensure-session.js.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/pay-create-checkout.d.ts +3 -0
- package/dist/mcp/tools/pay-create-checkout.d.ts.map +1 -0
- package/dist/mcp/tools/pay-create-checkout.js +61 -0
- package/dist/mcp/tools/pay-create-checkout.js.map +1 -0
- package/dist/mcp/tools/pay-get-checkout.d.ts +3 -0
- package/dist/mcp/tools/pay-get-checkout.d.ts.map +1 -0
- package/dist/mcp/tools/pay-get-checkout.js +30 -0
- package/dist/mcp/tools/pay-get-checkout.js.map +1 -0
- package/dist/mcp/tools/pay-list-checkouts.d.ts +3 -0
- package/dist/mcp/tools/pay-list-checkouts.d.ts.map +1 -0
- package/dist/mcp/tools/pay-list-checkouts.js +51 -0
- package/dist/mcp/tools/pay-list-checkouts.js.map +1 -0
- package/dist/mcp/tools/pay-utils.d.ts +15 -0
- package/dist/mcp/tools/pay-utils.d.ts.map +1 -0
- package/dist/mcp/tools/pay-utils.js +24 -0
- package/dist/mcp/tools/pay-utils.js.map +1 -0
- package/package.json +5 -4
|
@@ -2,10 +2,28 @@ import chalk from 'chalk';
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import { formatUnits } from 'viem';
|
|
5
|
-
import { createClientFromConfig, getDefaultSignerName, listSigners, loadSignerConfig, } from '../../lib/config.js';
|
|
6
|
-
import {
|
|
5
|
+
import { createClientFromConfig, getConfigDir, getDefaultSignerName, listSigners, loadSignerConfig, } from '../../lib/config.js';
|
|
6
|
+
import { decodeJwt, ensureSession } from '../../lib/ensure-session.js';
|
|
7
|
+
import { isJsonMode } from '../output.js';
|
|
8
|
+
import { brand, brandBold, brandDot, dim, failMark, statusColor, successMark } from '../theme.js';
|
|
7
9
|
// ---------------------------------------------------------------------------
|
|
8
|
-
//
|
|
10
|
+
// JWT decode (display only, no verification)
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
const decodeJwtPayload = decodeJwt;
|
|
13
|
+
function formatExpiry(exp) {
|
|
14
|
+
const remaining = exp * 1000 - Date.now();
|
|
15
|
+
if (remaining <= 0)
|
|
16
|
+
return chalk.red('Expired');
|
|
17
|
+
const hours = Math.floor(remaining / 3_600_000);
|
|
18
|
+
const mins = Math.floor((remaining % 3_600_000) / 60_000);
|
|
19
|
+
const timeStr = new Date(exp * 1000)
|
|
20
|
+
.toISOString()
|
|
21
|
+
.replace('T', ' ')
|
|
22
|
+
.replace(/\.\d+Z$/, ' UTC');
|
|
23
|
+
return `${timeStr} (${hours}h ${mins}m remaining)`;
|
|
24
|
+
}
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Wallet helpers (existing)
|
|
9
27
|
// ---------------------------------------------------------------------------
|
|
10
28
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: ANSI escape stripping is intentional
|
|
11
29
|
const ANSI_RE = /\u001B\[[0-9;]*m/g;
|
|
@@ -18,14 +36,7 @@ function fmtAddr(address) {
|
|
|
18
36
|
return dim('—');
|
|
19
37
|
return dim(`${address.slice(0, 6)}…${address.slice(-4)}`);
|
|
20
38
|
}
|
|
21
|
-
function
|
|
22
|
-
if (!weiStr || weiStr === '0')
|
|
23
|
-
return dim('0 ETH');
|
|
24
|
-
const eth = formatUnits(BigInt(weiStr), 18);
|
|
25
|
-
const clean = eth.includes('.') ? eth.replace(/\.?0+$/, '') : eth;
|
|
26
|
-
return `${clean} ETH`;
|
|
27
|
-
}
|
|
28
|
-
async function fetchInfo(name, config) {
|
|
39
|
+
async function fetchWalletInfo(name, config) {
|
|
29
40
|
const info = {
|
|
30
41
|
name,
|
|
31
42
|
address: config.ethAddress || '',
|
|
@@ -55,55 +66,219 @@ async function fetchInfo(name, config) {
|
|
|
55
66
|
// Command
|
|
56
67
|
// ---------------------------------------------------------------------------
|
|
57
68
|
export const statusCommand = new Command('status')
|
|
58
|
-
.
|
|
69
|
+
.alias('whoami')
|
|
70
|
+
.description('Show account and connection status')
|
|
71
|
+
.option('--json', 'Output as JSON')
|
|
59
72
|
.action(async () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
73
|
+
try {
|
|
74
|
+
const session = await ensureSession();
|
|
75
|
+
// --- JSON mode ---
|
|
76
|
+
if (isJsonMode()) {
|
|
77
|
+
await outputStatusJson(session);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// --- Human mode ---
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log(` ${chalk.bold('AgentaOS')} ${dim('CLI')}`);
|
|
83
|
+
console.log(` ${dim('─'.repeat(35))}`);
|
|
84
|
+
// --- Account info from JWT ---
|
|
85
|
+
if (!session.ok) {
|
|
86
|
+
if (session.reason === 'session-expired') {
|
|
87
|
+
console.log(` ${dim('Account:')} ${chalk.red('Session expired')}`);
|
|
88
|
+
console.log(` ${dim(' ')} Run ${chalk.bold('agenta login')} to re-authenticate.`);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.log(` ${dim('Account:')} ${chalk.yellow('Not logged in')}`);
|
|
92
|
+
console.log(` ${dim(' ')} Run ${chalk.bold('agenta login')} to get started.`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const token = session.ok ? session.token : null;
|
|
96
|
+
const serverUrl = session.ok ? session.serverUrl : null;
|
|
97
|
+
const payload = token ? decodeJwtPayload(token) : null;
|
|
98
|
+
const email = payload?.email;
|
|
99
|
+
const exp = payload?.exp;
|
|
100
|
+
if (email)
|
|
101
|
+
console.log(` ${dim('Account:')} ${email}`);
|
|
102
|
+
// --- Fetch org info from server ---
|
|
103
|
+
let orgName;
|
|
104
|
+
let walletAddress = null;
|
|
105
|
+
if (token && serverUrl) {
|
|
106
|
+
try {
|
|
107
|
+
const orgsRes = await fetch(`${serverUrl}/api/v1/orgs`, {
|
|
108
|
+
headers: { authorization: `Bearer ${token}` },
|
|
109
|
+
signal: AbortSignal.timeout(5_000),
|
|
110
|
+
});
|
|
111
|
+
if (orgsRes.ok) {
|
|
112
|
+
const orgs = (await orgsRes.json());
|
|
113
|
+
if (orgs[0]) {
|
|
114
|
+
orgName = orgs[0].name;
|
|
115
|
+
walletAddress = orgs[0].wallet_address ?? null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Offline — show what we can from JWT
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (orgName)
|
|
124
|
+
console.log(` ${dim('Organization:')} ${orgName}`);
|
|
125
|
+
if (walletAddress) {
|
|
126
|
+
const short = `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}`;
|
|
127
|
+
console.log(` ${dim('Wallet:')} ${short}`);
|
|
128
|
+
}
|
|
129
|
+
else if (orgName) {
|
|
130
|
+
console.log(` ${dim('Wallet:')} ${chalk.yellow('Not activated')}`);
|
|
131
|
+
}
|
|
132
|
+
if (exp)
|
|
133
|
+
console.log(` ${dim('JWT expires:')} ${formatExpiry(exp)}`);
|
|
134
|
+
if (serverUrl)
|
|
135
|
+
console.log(` ${dim('Server:')} ${serverUrl}`);
|
|
136
|
+
console.log(` ${dim('Config:')} ${getConfigDir()}`);
|
|
137
|
+
// --- Tool readiness ---
|
|
138
|
+
console.log('');
|
|
139
|
+
if (walletAddress) {
|
|
140
|
+
console.log(` ${dim('Payment tools:')} ${successMark('Ready')}`);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
console.log(` ${dim('Payment tools:')} ${failMark('Activate wallet first')} → ${dim('agenta login')}`);
|
|
144
|
+
}
|
|
145
|
+
const signerNames = listSigners();
|
|
146
|
+
if (signerNames.length > 0) {
|
|
147
|
+
console.log(` ${dim('Agent accounts:')} ${successMark(`Ready (${signerNames.length} sub-account${signerNames.length > 1 ? 's' : ''})`)}`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
console.log(` ${dim('Agent accounts:')} ${dim('Run')} ${chalk.bold('agenta init')} ${dim('to create a sub-account')}`);
|
|
151
|
+
}
|
|
152
|
+
// --- Next steps ---
|
|
153
|
+
console.log('');
|
|
154
|
+
if (!walletAddress) {
|
|
155
|
+
console.log(` ${dim('Next:')} ${chalk.bold('agenta login')} ${dim('to activate your wallet')}`);
|
|
156
|
+
}
|
|
157
|
+
else if (signerNames.length === 0) {
|
|
158
|
+
console.log(` ${dim('Next:')} ${chalk.bold('agenta pay checkout -a 50')} ${dim('to create a checkout')}`);
|
|
159
|
+
console.log(` ${chalk.bold('agenta init')} ${dim('to create an agent sub-account')}`);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
console.log(` ${dim('Next:')} ${chalk.bold('agenta pay checkout -a 50')} ${dim('to create a checkout')}`);
|
|
163
|
+
console.log(` ${chalk.bold('agenta pay list')} ${dim('to view your checkouts')}`);
|
|
164
|
+
}
|
|
165
|
+
// --- Signer wallets (if any) ---
|
|
166
|
+
if (signerNames.length > 0) {
|
|
167
|
+
const defaultName = getDefaultSignerName();
|
|
168
|
+
const spinner = ora({
|
|
169
|
+
text: `Checking ${signerNames.length} sub-account${signerNames.length > 1 ? 's' : ''}…`,
|
|
170
|
+
indent: 2,
|
|
171
|
+
}).start();
|
|
172
|
+
const wallets = await Promise.all(signerNames.map(async (name) => {
|
|
173
|
+
try {
|
|
174
|
+
const config = loadSignerConfig(name);
|
|
175
|
+
const info = await fetchWalletInfo(name, config);
|
|
176
|
+
info.isDefault = name === defaultName;
|
|
177
|
+
return info;
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return {
|
|
181
|
+
name,
|
|
182
|
+
address: '',
|
|
183
|
+
status: 'error',
|
|
184
|
+
balance: undefined,
|
|
185
|
+
policies: undefined,
|
|
186
|
+
isDefault: name === defaultName,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
spinner.stop();
|
|
191
|
+
console.log('');
|
|
192
|
+
console.log(` ${dim('Sub-accounts:')}`);
|
|
193
|
+
const nw = Math.max(4, ...wallets.map((w) => w.name.length)) + 3;
|
|
194
|
+
for (const w of wallets) {
|
|
195
|
+
const dot = brandDot(w.isDefault);
|
|
196
|
+
const name = w.isDefault ? brandBold(w.name) : w.name;
|
|
197
|
+
const addr = fmtAddr(w.address);
|
|
198
|
+
const status = statusColor(w.status);
|
|
199
|
+
console.log(` ${dot} ${pad(name, nw)} ${pad(addr, 15)} ${status}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
console.log('');
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
206
|
+
if (isJsonMode()) {
|
|
207
|
+
console.error(JSON.stringify({ error: message }));
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
console.error(`\n ${failMark(message)}\n`);
|
|
211
|
+
}
|
|
212
|
+
process.exitCode = 1;
|
|
64
213
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
214
|
+
});
|
|
215
|
+
async function outputStatusJson(session) {
|
|
216
|
+
const result = {};
|
|
217
|
+
if (!session.ok) {
|
|
218
|
+
result.account = {
|
|
219
|
+
authenticated: false,
|
|
220
|
+
reason: session.reason,
|
|
221
|
+
hint: session.reason === 'session-expired'
|
|
222
|
+
? 'Run agenta login to re-authenticate.'
|
|
223
|
+
: 'Run agenta login to get started.',
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
const { token, serverUrl } = session;
|
|
228
|
+
const payload = decodeJwt(token);
|
|
229
|
+
const exp = typeof payload?.exp === 'number' ? payload.exp : null;
|
|
230
|
+
const account = {
|
|
231
|
+
authenticated: true,
|
|
232
|
+
email: payload?.email ?? null,
|
|
233
|
+
server: serverUrl,
|
|
234
|
+
configDir: getConfigDir(),
|
|
235
|
+
};
|
|
236
|
+
if (exp) {
|
|
237
|
+
account.jwtExpiresAt = new Date(exp * 1000).toISOString();
|
|
238
|
+
account.jwtSecondsRemaining = Math.max(0, Math.floor((exp * 1000 - Date.now()) / 1000));
|
|
239
|
+
}
|
|
71
240
|
try {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
241
|
+
const orgsRes = await fetch(`${serverUrl}/api/v1/orgs`, {
|
|
242
|
+
headers: { authorization: `Bearer ${token}` },
|
|
243
|
+
signal: AbortSignal.timeout(5_000),
|
|
244
|
+
});
|
|
245
|
+
if (orgsRes.ok) {
|
|
246
|
+
const orgs = (await orgsRes.json());
|
|
247
|
+
if (orgs[0]) {
|
|
248
|
+
account.organization = orgs[0].name ?? null;
|
|
249
|
+
account.walletAddress = orgs[0].wallet_address ?? null;
|
|
250
|
+
account.walletActivated = !!orgs[0].wallet_address;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
76
253
|
}
|
|
77
254
|
catch {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
spinner.stop();
|
|
89
|
-
const nw = Math.max(4, ...wallets.map((w) => w.name.length)) + 3;
|
|
90
|
-
const aw = 15;
|
|
91
|
-
const sw = 10;
|
|
92
|
-
console.log('');
|
|
93
|
-
for (const w of wallets) {
|
|
94
|
-
const dot = brandDot(w.isDefault);
|
|
95
|
-
const name = w.isDefault ? brandBold(w.name) : w.name;
|
|
96
|
-
const addr = fmtAddr(w.address);
|
|
97
|
-
const status = statusColor(w.status);
|
|
98
|
-
const pol = w.policies != null ? dim(`${w.policies} pol`) : '';
|
|
99
|
-
console.log(` ${dot} ${pad(name, nw)} ${pad(addr, aw)} ${pad(status, sw)} ${pol}`);
|
|
255
|
+
account.serverReachable = false;
|
|
256
|
+
}
|
|
257
|
+
const walletReady = !!account.walletAddress;
|
|
258
|
+
account.paymentTools = {
|
|
259
|
+
ready: walletReady,
|
|
260
|
+
hint: walletReady
|
|
261
|
+
? 'Run agenta pay checkout -a 50 to create a checkout.'
|
|
262
|
+
: 'Activate wallet first via agenta login.',
|
|
263
|
+
};
|
|
264
|
+
result.account = account;
|
|
100
265
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
266
|
+
const signerNames = listSigners();
|
|
267
|
+
result.subAccounts = {
|
|
268
|
+
count: signerNames.length,
|
|
269
|
+
hint: signerNames.length === 0
|
|
270
|
+
? 'Run agenta sub init --create --name <name> to create a sub-account.'
|
|
271
|
+
: `${signerNames.length} sub-account(s). Run agenta sub info <name> for details.`,
|
|
272
|
+
items: signerNames.map((name) => {
|
|
273
|
+
try {
|
|
274
|
+
const c = loadSignerConfig(name);
|
|
275
|
+
return { name, address: c.ethAddress || null, isDefault: name === getDefaultSignerName() };
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return { name, address: null, isDefault: false };
|
|
279
|
+
}
|
|
280
|
+
}),
|
|
281
|
+
};
|
|
282
|
+
console.log(JSON.stringify(result));
|
|
283
|
+
}
|
|
109
284
|
//# sourceMappingURL=status.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.command.js","sourceRoot":"","sources":["../../../src/cli/commands/status.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAEN,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3E,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,gGAAgG;AAChG,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAEpC,SAAS,GAAG,CAAC,GAAW,EAAE,KAAa;IACtC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzC,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,CAA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AC,qEAAqE;YACvE,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,0DAA0D;QACnF,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,CAAC;gBACJ,MAAM,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,IAAI,IAAI,EAAE,SAAS,EAAE,IAAI,KAAK,oBAAoB,EAAE,EAAE,CAAC;YAC5F,CAAC;YAAC,MAAM,CAAC;gBACR,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YAClD,CAAC;QACF,CAAC,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAmDA,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CA4C5C"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import { Command } from 'commander';
|
|
2
|
-
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
const { version } = require('../../package.json');
|
|
5
|
+
import { auditCommand, pauseCommand, policiesCommand, resumeCommand, } from './commands/admin.command.js';
|
|
3
6
|
import { balanceCommand } from './commands/balance.command.js';
|
|
4
7
|
import { deployCommand } from './commands/deploy.command.js';
|
|
5
8
|
import { infoCommand } from './commands/info.command.js';
|
|
@@ -7,44 +10,72 @@ import { initCommand } from './commands/init.command.js';
|
|
|
7
10
|
import { linkCommand } from './commands/link.command.js';
|
|
8
11
|
import { loginCommand, logoutCommand } from './commands/login.command.js';
|
|
9
12
|
import { networkCommand } from './commands/network.command.js';
|
|
13
|
+
import { payCommand } from './commands/pay.command.js';
|
|
10
14
|
import { proxyCommand } from './commands/proxy.command.js';
|
|
11
15
|
import { receiveCommand } from './commands/receive.command.js';
|
|
12
16
|
import { sendCommand } from './commands/send.command.js';
|
|
13
17
|
import { signMessageCommand } from './commands/sign.command.js';
|
|
14
18
|
import { statusCommand } from './commands/status.command.js';
|
|
15
19
|
import { BRAND_BANNER, dim } from './theme.js';
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// agenta sub — agent sub-account commands
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
const subCommand = new Command('sub')
|
|
24
|
+
.description('Agent sub-account operations (send, sign, deploy)')
|
|
25
|
+
.addCommand(initCommand)
|
|
26
|
+
.addCommand(infoCommand)
|
|
27
|
+
.addCommand(balanceCommand)
|
|
28
|
+
.addCommand(sendCommand)
|
|
29
|
+
.addCommand(signMessageCommand)
|
|
30
|
+
.addCommand(policiesCommand)
|
|
31
|
+
.addCommand(pauseCommand)
|
|
32
|
+
.addCommand(resumeCommand)
|
|
33
|
+
.addCommand(auditCommand)
|
|
34
|
+
.addCommand(deployCommand)
|
|
35
|
+
.addCommand(proxyCommand)
|
|
36
|
+
.addCommand(networkCommand)
|
|
37
|
+
.addCommand(linkCommand)
|
|
38
|
+
.addCommand(receiveCommand);
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Main CLI
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
16
42
|
export async function runCli() {
|
|
17
43
|
const program = new Command();
|
|
18
44
|
program
|
|
19
45
|
.name('agenta')
|
|
20
46
|
.description(BRAND_BANNER)
|
|
21
|
-
.version(
|
|
22
|
-
.option('-s, --signer <name>', 'Signer name (default: auto-detected)')
|
|
47
|
+
.version(version)
|
|
23
48
|
.addHelpText('after', `
|
|
24
49
|
${dim('Getting started:')}
|
|
25
|
-
$ agenta login
|
|
26
|
-
$ agenta
|
|
27
|
-
$ agenta
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
$ agenta
|
|
50
|
+
$ agenta login Sign in via browser
|
|
51
|
+
$ agenta status Account, wallet & readiness overview
|
|
52
|
+
$ agenta logout Clear session
|
|
53
|
+
|
|
54
|
+
${dim('Payments (accept & track):')}
|
|
55
|
+
$ agenta pay checkout -a 50 Create a checkout session
|
|
56
|
+
$ agenta pay get <sessionId> Get checkout details
|
|
57
|
+
$ agenta pay list List your checkouts
|
|
58
|
+
|
|
59
|
+
${dim('Agent sub-accounts (send & sign):')}
|
|
60
|
+
$ agenta sub init --create --name bot1 Create a sub-account
|
|
61
|
+
$ agenta sub init --import --name bot1 \\
|
|
62
|
+
--api-key gw_... --api-secret <b64> Import existing
|
|
63
|
+
$ agenta sub info <name> Sub-account details
|
|
64
|
+
$ agenta sub balance ETH & token balances
|
|
65
|
+
$ agenta sub send 0x... 0.01 Send ETH
|
|
66
|
+
$ agenta sub sign-message "hello" Sign a message
|
|
67
|
+
$ agenta sub policies get [--json] View policies
|
|
68
|
+
$ agenta sub policies set --file p.json Set policies from JSON
|
|
69
|
+
$ agenta sub pause / resume Pause or resume signing
|
|
70
|
+
$ agenta sub audit View signing audit log
|
|
31
71
|
|
|
32
72
|
${dim('Docs: https://github.com/AgentaOS/agentaos')}
|
|
33
73
|
`);
|
|
34
74
|
program.addCommand(loginCommand);
|
|
35
75
|
program.addCommand(logoutCommand);
|
|
36
|
-
program.addCommand(initCommand);
|
|
37
76
|
program.addCommand(statusCommand);
|
|
38
|
-
program.addCommand(
|
|
39
|
-
program.addCommand(
|
|
40
|
-
program.addCommand(sendCommand);
|
|
41
|
-
program.addCommand(signMessageCommand);
|
|
42
|
-
program.addCommand(deployCommand);
|
|
43
|
-
program.addCommand(proxyCommand);
|
|
44
|
-
program.addCommand(networkCommand);
|
|
45
|
-
program.addCommand(linkCommand);
|
|
46
|
-
program.addCommand(receiveCommand);
|
|
47
|
-
program.addCommand(adminCommand);
|
|
77
|
+
program.addCommand(payCommand);
|
|
78
|
+
program.addCommand(subCommand);
|
|
48
79
|
await program.parseAsync();
|
|
49
80
|
}
|
|
50
81
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;AACzE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,GACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAA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;;;;;;;;;;;;;EAaxC,GAAG,CAAC,4CAA4C,CAAC;CAClD,CACE,CAAC;IAEH,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IACjC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAClC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAE/B,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output helper — respects --json flag or non-TTY for AI-parseable output.
|
|
3
|
+
* Human mode: chalk-formatted key-value pairs.
|
|
4
|
+
* JSON mode: single JSON line on stdout.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isJsonMode(): boolean;
|
|
7
|
+
export declare function output(data: Record<string, unknown>): void;
|
|
8
|
+
export declare function outputError(message: string): void;
|
|
9
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAc1D;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMjD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
/**
|
|
3
|
+
* Output helper — respects --json flag or non-TTY for AI-parseable output.
|
|
4
|
+
* Human mode: chalk-formatted key-value pairs.
|
|
5
|
+
* JSON mode: single JSON line on stdout.
|
|
6
|
+
*/
|
|
7
|
+
export function isJsonMode() {
|
|
8
|
+
return process.argv.includes('--json') || !process.stdout.isTTY;
|
|
9
|
+
}
|
|
10
|
+
export function output(data) {
|
|
11
|
+
if (isJsonMode()) {
|
|
12
|
+
console.log(JSON.stringify(data));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// Human-friendly
|
|
16
|
+
console.log('');
|
|
17
|
+
for (const [key, value] of Object.entries(data)) {
|
|
18
|
+
if (value === null || value === undefined)
|
|
19
|
+
continue;
|
|
20
|
+
if (typeof value === 'object' && !Array.isArray(value))
|
|
21
|
+
continue; // skip nested
|
|
22
|
+
const label = key.replace(/([A-Z])/g, ' $1').replace(/^./, (s) => s.toUpperCase());
|
|
23
|
+
console.log(` ${chalk.bold(`${label}:`)} ${value}`);
|
|
24
|
+
}
|
|
25
|
+
console.log('');
|
|
26
|
+
}
|
|
27
|
+
export function outputError(message) {
|
|
28
|
+
if (isJsonMode()) {
|
|
29
|
+
console.error(JSON.stringify({ error: message }));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.error(`\n ${chalk.red('✕')} ${message}\n`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACzB,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAA6B;IACnD,IAAI,UAAU,EAAE,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAClC,OAAO;IACR,CAAC;IACD,iBAAiB;IACjB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,cAAc;QAChF,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IAC1C,IAAI,UAAU,EAAE,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC;IACrD,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Decode JWT payload without verification (display + expiry check only). */
|
|
2
|
+
export declare function decodeJwt(token: string): Record<string, unknown> | null;
|
|
3
|
+
export type SessionResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
token: string;
|
|
6
|
+
serverUrl: string;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
reason: 'not-logged-in' | 'session-expired';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Get a valid session token, auto-refreshing if expired.
|
|
13
|
+
* Returns the session or a reason why it failed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureSession(): Promise<SessionResult>;
|
|
16
|
+
//# sourceMappingURL=ensure-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-session.d.ts","sourceRoot":"","sources":["../../src/lib/ensure-session.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQvE;AAED,MAAM,MAAM,aAAa,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB,CAAA;CAAE,CAAC;AAE9D;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,CAyC5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getRefreshToken, getSession, getSessionServerUrl, storeSession } from './keychain.js';
|
|
2
|
+
/** Decode JWT payload without verification (display + expiry check only). */
|
|
3
|
+
export function decodeJwt(token) {
|
|
4
|
+
try {
|
|
5
|
+
const parts = token.split('.');
|
|
6
|
+
if (parts.length !== 3)
|
|
7
|
+
return null;
|
|
8
|
+
return JSON.parse(Buffer.from(parts[1], 'base64url').toString('utf-8'));
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get a valid session token, auto-refreshing if expired.
|
|
16
|
+
* Returns the session or a reason why it failed.
|
|
17
|
+
*/
|
|
18
|
+
export async function ensureSession() {
|
|
19
|
+
const token = await getSession();
|
|
20
|
+
if (!token)
|
|
21
|
+
return { ok: false, reason: 'not-logged-in' };
|
|
22
|
+
const serverUrl = (await getSessionServerUrl()) || process.env.AGENTA_SERVER || 'https://api.agentaos.ai';
|
|
23
|
+
const jwt = decodeJwt(token);
|
|
24
|
+
const exp = typeof jwt?.exp === 'number' ? jwt.exp : undefined;
|
|
25
|
+
const needsUpgrade = jwt?.scope === 'setup'; // passkey was set up after token was issued
|
|
26
|
+
// Still valid and full scope (with 30s buffer)
|
|
27
|
+
if (exp && exp * 1000 > Date.now() + 30_000 && !needsUpgrade) {
|
|
28
|
+
return { ok: true, token, serverUrl };
|
|
29
|
+
}
|
|
30
|
+
// Expired or needs scope upgrade — try refresh
|
|
31
|
+
const refreshToken = await getRefreshToken();
|
|
32
|
+
if (!refreshToken)
|
|
33
|
+
return { ok: false, reason: 'session-expired' };
|
|
34
|
+
try {
|
|
35
|
+
const res = await fetch(`${serverUrl}/api/v1/auth/refresh`, {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: { 'content-type': 'application/json' },
|
|
38
|
+
body: JSON.stringify({ refreshToken }),
|
|
39
|
+
signal: AbortSignal.timeout(10_000),
|
|
40
|
+
});
|
|
41
|
+
if (!res.ok)
|
|
42
|
+
return { ok: false, reason: 'session-expired' };
|
|
43
|
+
const data = (await res.json());
|
|
44
|
+
if (!data.token)
|
|
45
|
+
return { ok: false, reason: 'session-expired' };
|
|
46
|
+
await storeSession(data.token, serverUrl, data.refreshToken);
|
|
47
|
+
return { ok: true, token: data.token, serverUrl };
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return { ok: false, reason: 'session-expired' };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=ensure-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-session.js","sourceRoot":"","sources":["../../src/lib/ensure-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe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"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,wBAAsB,MAAM,kBAsD3B"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -25,6 +25,10 @@ import { registerGetStatus } from './tools/get-status.js';
|
|
|
25
25
|
import { registerX402Check } from './tools/x402-check.js';
|
|
26
26
|
import { registerX402Discover } from './tools/x402-discover.js';
|
|
27
27
|
import { registerX402Fetch } from './tools/x402-fetch.js';
|
|
28
|
+
// Merchant payment tools (agenta_pay_*) — uses @agentaos/pay SDK
|
|
29
|
+
import { registerPayCreateCheckout } from './tools/pay-create-checkout.js';
|
|
30
|
+
import { registerPayGetCheckout } from './tools/pay-get-checkout.js';
|
|
31
|
+
import { registerPayListCheckouts } from './tools/pay-list-checkouts.js';
|
|
28
32
|
/**
|
|
29
33
|
* Start the AgentaOS MCP server with all tools.
|
|
30
34
|
* Connects via stdio transport.
|
|
@@ -59,6 +63,10 @@ export async function runMcp() {
|
|
|
59
63
|
registerX402Check(server);
|
|
60
64
|
registerX402Discover(server);
|
|
61
65
|
registerX402Fetch(server, signerManager);
|
|
66
|
+
// Merchant payment tools — no signerManager needed, uses @agentaos/pay SDK
|
|
67
|
+
registerPayCreateCheckout(server);
|
|
68
|
+
registerPayGetCheckout(server);
|
|
69
|
+
registerPayListCheckouts(server);
|
|
62
70
|
// Graceful shutdown — wipe key material
|
|
63
71
|
const shutdown = () => {
|
|
64
72
|
signerManager.destroy();
|