@lucid-agents/taskmarket 0.5.4 → 0.6.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/dist/commands/address.js +3 -10
- package/dist/commands/address.js.map +1 -1
- package/dist/commands/agents.js +3 -33
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/deposit.js +5 -16
- package/dist/commands/deposit.js.map +1 -1
- package/dist/commands/identity.js +5 -29
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/inbox.js +4 -35
- package/dist/commands/inbox.js.map +1 -1
- package/dist/commands/init.js +15 -44
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/stats.js +9 -20
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/task/accept.js +2 -9
- package/dist/commands/task/accept.js.map +1 -1
- package/dist/commands/task/bid.js +2 -9
- package/dist/commands/task/bid.js.map +1 -1
- package/dist/commands/task/claim.js +3 -10
- package/dist/commands/task/claim.js.map +1 -1
- package/dist/commands/task/create.js +3 -10
- package/dist/commands/task/create.js.map +1 -1
- package/dist/commands/task/download.js +4 -11
- package/dist/commands/task/download.js.map +1 -1
- package/dist/commands/task/get.js +4 -19
- package/dist/commands/task/get.js.map +1 -1
- package/dist/commands/task/pitch.js +2 -9
- package/dist/commands/task/pitch.js.map +1 -1
- package/dist/commands/task/proof.js +2 -9
- package/dist/commands/task/proof.js.map +1 -1
- package/dist/commands/task/rate.js +3 -10
- package/dist/commands/task/rate.js.map +1 -1
- package/dist/commands/task/search.js +2 -22
- package/dist/commands/task/search.js.map +1 -1
- package/dist/commands/task/select-winner.js +4 -13
- package/dist/commands/task/select-winner.js.map +1 -1
- package/dist/commands/task/select-worker.js +2 -9
- package/dist/commands/task/select-worker.js.map +1 -1
- package/dist/commands/task/submissions.js +5 -28
- package/dist/commands/task/submissions.js.map +1 -1
- package/dist/commands/task/submit.js +2 -9
- package/dist/commands/task/submit.js.map +1 -1
- package/dist/commands/wallet/balance.js +2 -10
- package/dist/commands/wallet/balance.js.map +1 -1
- package/dist/commands/wallet/import.js +8 -43
- package/dist/commands/wallet/import.js.map +1 -1
- package/dist/commands/wallet/set-withdrawal-address.js +5 -12
- package/dist/commands/wallet/set-withdrawal-address.js.map +1 -1
- package/dist/commands/withdraw.js +6 -15
- package/dist/commands/withdraw.js.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/output.js +4 -19
- package/dist/lib/output.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/address.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { loadKeystore } from '../lib/keystore.js';
|
|
3
|
-
import {
|
|
3
|
+
import { printResult } from '../lib/output.js';
|
|
4
4
|
export const addressCommand = new Command('address')
|
|
5
5
|
.description('Print the wallet address')
|
|
6
|
-
.
|
|
7
|
-
.action(async (opts) => {
|
|
8
|
-
const human = isHumanMode(opts.human);
|
|
6
|
+
.action(async () => {
|
|
9
7
|
const keystore = await loadKeystore();
|
|
10
|
-
|
|
11
|
-
console.log(keystore.walletAddress);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
printResult({ address: keystore.walletAddress }, human);
|
|
15
|
-
}
|
|
8
|
+
printResult({ address: keystore.walletAddress });
|
|
16
9
|
});
|
|
17
10
|
//# sourceMappingURL=address.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/commands/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KACjD,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
|
package/dist/commands/agents.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { apiGet } from '../lib/api.js';
|
|
3
|
-
import {
|
|
3
|
+
import { printResult } from '../lib/output.js';
|
|
4
4
|
export const agentsCommand = new Command('agents')
|
|
5
5
|
.description('Browse the agent directory')
|
|
6
6
|
.option('--sort <order>', 'Sort order: reputation or tasks', 'reputation')
|
|
7
7
|
.option('--skill <tag>', 'Filter by skill tag')
|
|
8
8
|
.option('--search <query>', 'Search by agentId or wallet address')
|
|
9
9
|
.option('--limit <n>', 'Maximum results to return', '20')
|
|
10
|
-
.option('--human', 'Human-readable output')
|
|
11
10
|
.action(async (opts) => {
|
|
12
|
-
const human = isHumanMode(opts.human);
|
|
13
11
|
const params = new URLSearchParams();
|
|
14
12
|
if (opts.sort)
|
|
15
13
|
params.set('sort', opts.sort);
|
|
@@ -19,35 +17,7 @@ export const agentsCommand = new Command('agents')
|
|
|
19
17
|
params.set('search', opts.search);
|
|
20
18
|
if (opts.limit)
|
|
21
19
|
params.set('limit', opts.limit);
|
|
22
|
-
const result =
|
|
23
|
-
|
|
24
|
-
printResult(result, human);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (!result || result.length === 0) {
|
|
28
|
-
console.log('No agents found.');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const header = [
|
|
32
|
-
'Rank'.padEnd(5),
|
|
33
|
-
'Agent ID'.padEnd(12),
|
|
34
|
-
'Address'.padEnd(14),
|
|
35
|
-
'Tasks'.padStart(6),
|
|
36
|
-
'Rating'.padStart(7),
|
|
37
|
-
'Earned (USDC)'.padStart(14),
|
|
38
|
-
'Skills',
|
|
39
|
-
].join(' ');
|
|
40
|
-
console.log(header);
|
|
41
|
-
console.log('-'.repeat(header.length));
|
|
42
|
-
for (const agent of result) {
|
|
43
|
-
const rank = `#${agent.rank}`.padEnd(5);
|
|
44
|
-
const agentId = (agent.agentId ?? '-').slice(0, 10).padEnd(12);
|
|
45
|
-
const addr = `${agent.address.slice(0, 6)}...${agent.address.slice(-4)}`.padEnd(14);
|
|
46
|
-
const tasks = String(agent.completedTasks).padStart(6);
|
|
47
|
-
const rating = agent.averageRating > 0 ? agent.averageRating.toFixed(1).padStart(7) : ' N/A';
|
|
48
|
-
const earned = (Number(agent.totalEarnings) / 1e6).toFixed(3).padStart(14);
|
|
49
|
-
const skills = agent.skills.length > 0 ? agent.skills.join(', ') : '-';
|
|
50
|
-
console.log([rank, agentId, addr, tasks, rating, earned, skills].join(' '));
|
|
51
|
-
}
|
|
20
|
+
const result = await apiGet(`/api/agents/leaderboard?${params.toString()}`);
|
|
21
|
+
printResult(result);
|
|
52
22
|
});
|
|
53
23
|
//# sourceMappingURL=agents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,4BAA4B,CAAC;KACzC,MAAM,CAAC,gBAAgB,EAAE,iCAAiC,EAAE,YAAY,CAAC;KACzE,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC;KAC9C,MAAM,CAAC,kBAAkB,EAAE,qCAAqC,CAAC;KACjE,MAAM,CAAC,aAAa,EAAE,2BAA2B,EAAE,IAAI,CAAC;KACxD,MAAM,CAAC,KAAK,EAAE,IAAwE,EAAE,EAAE;IACzF,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,IAAI;QAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,IAAI,CAAC,MAAM;QAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,2BAA2B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC5E,WAAW,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC"}
|
package/dist/commands/deposit.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { getWalletAddress } from '../lib/signer.js';
|
|
3
|
-
import {
|
|
3
|
+
import { printResult, printError } from '../lib/output.js';
|
|
4
4
|
import { apiGet } from '../lib/api.js';
|
|
5
5
|
export const depositCommand = new Command('deposit')
|
|
6
6
|
.description('Show wallet address and network info for funding')
|
|
7
|
-
.
|
|
8
|
-
.action(async (opts) => {
|
|
9
|
-
const human = isHumanMode(opts.human);
|
|
7
|
+
.action(async () => {
|
|
10
8
|
let address;
|
|
11
9
|
try {
|
|
12
10
|
address = await getWalletAddress();
|
|
13
11
|
}
|
|
14
12
|
catch (err) {
|
|
15
13
|
const msg = err instanceof Error ? err.message : 'No keystore found. Run `taskmarket init` first.';
|
|
16
|
-
printError(msg
|
|
14
|
+
printError(msg);
|
|
17
15
|
}
|
|
18
16
|
let networkInfo;
|
|
19
17
|
try {
|
|
@@ -22,7 +20,7 @@ export const depositCommand = new Command('deposit')
|
|
|
22
20
|
}
|
|
23
21
|
catch (err) {
|
|
24
22
|
const msg = err instanceof Error ? err.message : 'Failed to fetch network info from backend.';
|
|
25
|
-
printError(msg
|
|
23
|
+
printError(msg);
|
|
26
24
|
}
|
|
27
25
|
const data = {
|
|
28
26
|
address: address,
|
|
@@ -31,15 +29,6 @@ export const depositCommand = new Command('deposit')
|
|
|
31
29
|
currency: 'USDC',
|
|
32
30
|
usdcContract: networkInfo.usdcAddress,
|
|
33
31
|
};
|
|
34
|
-
|
|
35
|
-
printResult(data, human);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
console.log('\nFund your wallet to use Taskmarket');
|
|
39
|
-
console.log('');
|
|
40
|
-
console.log(` Address: ${data.address}`);
|
|
41
|
-
console.log(` Network: ${data.network} (chain ID ${data.chainId})`);
|
|
42
|
-
console.log(` Currency: ${data.currency}`);
|
|
43
|
-
console.log(` Contract: ${data.usdcContract}`);
|
|
32
|
+
printResult(data);
|
|
44
33
|
});
|
|
45
34
|
//# sourceMappingURL=deposit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit.js","sourceRoot":"","sources":["../../src/commands/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WA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jB,OAAO,EAAE,WAAY,CAAC,WAAW;QACjC,OAAO,EAAE,WAAY,CAAC,OAAO;QAC7B,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,WAAY,CAAC,WAAW;KACvC,CAAC;IAEF,WAAW,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -2,45 +2,21 @@ import { Command } from 'commander';
|
|
|
2
2
|
import { loadKeystore } from '../lib/keystore.js';
|
|
3
3
|
import { apiGet } from '../lib/api.js';
|
|
4
4
|
import { x402Post } from '../lib/x402.js';
|
|
5
|
-
import {
|
|
5
|
+
import { printResult } from '../lib/output.js';
|
|
6
6
|
export const identityCommand = new Command('identity').description('Manage agent identity');
|
|
7
7
|
identityCommand
|
|
8
8
|
.command('register')
|
|
9
9
|
.description('Register ERC-8004 agent identity (costs 0.001 USDC)')
|
|
10
|
-
.
|
|
11
|
-
.action(async (opts) => {
|
|
12
|
-
const human = isHumanMode(opts.human);
|
|
10
|
+
.action(async () => {
|
|
13
11
|
const result = (await x402Post('/api/identity/register', {}));
|
|
14
|
-
|
|
15
|
-
if (result.alreadyRegistered) {
|
|
16
|
-
console.log('Already registered. Agent ID:', result.agentId);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
console.log('Agent ID:', result.agentId);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
printResult({ agentId: result.agentId }, human);
|
|
24
|
-
}
|
|
12
|
+
printResult({ agentId: result.agentId });
|
|
25
13
|
});
|
|
26
14
|
identityCommand
|
|
27
15
|
.command('status')
|
|
28
16
|
.description('Check identity registration status')
|
|
29
|
-
.
|
|
30
|
-
.action(async (opts) => {
|
|
31
|
-
const human = isHumanMode(opts.human);
|
|
17
|
+
.action(async () => {
|
|
32
18
|
const keystore = await loadKeystore();
|
|
33
19
|
const result = (await apiGet(`/api/identity/status?address=${keystore.walletAddress}`));
|
|
34
|
-
|
|
35
|
-
if (result.registered) {
|
|
36
|
-
console.log('Registered. Agent ID:', result.agentId);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
console.log('Not registered. Run: taskmarket identity register');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
printResult({ registered: result.registered, agentId: result.agentId }, human);
|
|
44
|
-
}
|
|
20
|
+
printResult({ registered: result.registered, agentId: result.agentId });
|
|
45
21
|
});
|
|
46
22
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/commands/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/commands/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAE5F,eAAe;KACZ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,qDAAqD,CAAC;KAClE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAG3D,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEL,eAAe;KACZ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,gCAAgC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAGrF,CAAC;IACF,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC"}
|
package/dist/commands/inbox.js
CHANGED
|
@@ -1,50 +1,19 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { apiGet } from '../lib/api.js';
|
|
3
3
|
import { getWalletAddress } from '../lib/signer.js';
|
|
4
|
-
import {
|
|
5
|
-
function formatTaskLine(task) {
|
|
6
|
-
const desc = task.description.length > 60 ? task.description.slice(0, 57) + '...' : task.description;
|
|
7
|
-
const reward = (Number(task.reward) / 1e6).toFixed(3);
|
|
8
|
-
const tags = task.tags.length > 0 ? task.tags.join(', ') : '-';
|
|
9
|
-
console.log(` ${task.id.slice(0, 10)}... ${desc}`);
|
|
10
|
-
console.log(` Reward: ${reward} USDC | Mode: ${task.mode} | Status: ${task.status}`);
|
|
11
|
-
console.log(` Tags: ${tags}`);
|
|
12
|
-
}
|
|
4
|
+
import { printResult, printError } from '../lib/output.js';
|
|
13
5
|
export const inboxCommand = new Command('inbox')
|
|
14
6
|
.description('Show tasks you created and tasks you are working on')
|
|
15
|
-
.
|
|
16
|
-
.action(async (opts) => {
|
|
17
|
-
const human = isHumanMode(opts.human);
|
|
7
|
+
.action(async () => {
|
|
18
8
|
let address;
|
|
19
9
|
try {
|
|
20
10
|
address = await getWalletAddress();
|
|
21
11
|
}
|
|
22
12
|
catch (err) {
|
|
23
13
|
const msg = err instanceof Error ? err.message : 'No keystore found. Run `taskmarket init` first.';
|
|
24
|
-
printError(msg
|
|
14
|
+
printError(msg);
|
|
25
15
|
}
|
|
26
16
|
const result = (await apiGet(`/api/agents/inbox?address=${encodeURIComponent(address)}`));
|
|
27
|
-
|
|
28
|
-
printResult(result, human);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
console.log('\n=== Tasks Created (requester) ===');
|
|
32
|
-
if (result.asRequester.length === 0) {
|
|
33
|
-
console.log(' (none)');
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
for (const task of result.asRequester) {
|
|
37
|
-
formatTaskLine(task);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
console.log('\n=== Tasks Working On (worker) ===');
|
|
41
|
-
if (result.asWorker.length === 0) {
|
|
42
|
-
console.log(' (none)');
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
for (const task of result.asWorker) {
|
|
46
|
-
formatTaskLine(task);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
17
|
+
printResult(result);
|
|
49
18
|
});
|
|
50
19
|
//# sourceMappingURL=inbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAgB3D,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,qDAAqD,CAAC;KAClE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,gBAAgB,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,GAAG,GACP,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,iDAAiD,CAAC;QACzF,UAAU,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAC1B,6BAA6B,kBAAkB,CAAC,OAAQ,CAAC,EAAE,CAC5D,CAAgB,CAAC;IAClB,WAAW,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { generateKeypair, encryptPrivateKey, saveKeystore, keystoreExists,
|
|
2
|
+
import { generateKeypair, encryptPrivateKey, saveKeystore, keystoreExists, loadKeystore, } from '../lib/keystore.js';
|
|
3
3
|
import { API_URL, apiGet } from '../lib/api.js';
|
|
4
|
-
import {
|
|
4
|
+
import { printResult } from '../lib/output.js';
|
|
5
5
|
import { pollAgentId } from '../lib/agent.js';
|
|
6
6
|
export const initCommand = new Command('init')
|
|
7
7
|
.description('Create and register a new agent wallet (safe to re-run)')
|
|
8
|
-
.
|
|
9
|
-
.action(async (opts) => {
|
|
10
|
-
const human = isHumanMode(opts.human);
|
|
8
|
+
.action(async () => {
|
|
11
9
|
if (await keystoreExists()) {
|
|
12
10
|
const keystore = await loadKeystore();
|
|
13
11
|
// Poll for agentId if not yet assigned (background registration in progress)
|
|
@@ -26,26 +24,12 @@ export const initCommand = new Command('init')
|
|
|
26
24
|
catch {
|
|
27
25
|
// Non-fatal
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
console.log('Network info:');
|
|
36
|
-
console.log(` Network: ${networkInfo.networkName} (chain ID ${networkInfo.chainId})`);
|
|
37
|
-
console.log(' Currency: USDC');
|
|
38
|
-
console.log(` Contract: ${networkInfo.usdcAddress}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
printResult({
|
|
43
|
-
address: keystore.walletAddress,
|
|
44
|
-
agentId,
|
|
45
|
-
network: networkInfo?.networkName,
|
|
46
|
-
chainId: networkInfo?.chainId,
|
|
47
|
-
}, human);
|
|
48
|
-
}
|
|
27
|
+
printResult({
|
|
28
|
+
address: keystore.walletAddress,
|
|
29
|
+
agentId,
|
|
30
|
+
network: networkInfo?.networkName,
|
|
31
|
+
chainId: networkInfo?.chainId,
|
|
32
|
+
});
|
|
49
33
|
return;
|
|
50
34
|
}
|
|
51
35
|
const { privateKey, address } = generateKeypair();
|
|
@@ -80,24 +64,11 @@ export const initCommand = new Command('init')
|
|
|
80
64
|
catch {
|
|
81
65
|
// Non-fatal — show fallback text if backend unreachable
|
|
82
66
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
console.log(` Address: ${address}`);
|
|
90
|
-
if (networkInfo) {
|
|
91
|
-
console.log(` Network: ${networkInfo.networkName} (chain ID ${networkInfo.chainId})`);
|
|
92
|
-
console.log(' Currency: USDC');
|
|
93
|
-
console.log(` Contract: ${networkInfo.usdcAddress}`);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.log(' Run `taskmarket deposit` for network and deposit instructions.');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
printResult({ address, agentId, network: networkInfo?.networkName, chainId: networkInfo?.chainId }, human);
|
|
101
|
-
}
|
|
67
|
+
printResult({
|
|
68
|
+
address,
|
|
69
|
+
agentId,
|
|
70
|
+
network: networkInfo?.networkName,
|
|
71
|
+
chainId: networkInfo?.chainId,
|
|
72
|
+
});
|
|
102
73
|
});
|
|
103
74
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAU9C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,yDAAyD,CAAC;KACtE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,MAAM,cAAc,EAAE,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;QACtC,6EAA6E;QAC7E,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC/B,IAAI,CA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,mBAAmB,EACnB,OAAO,EAAE,cAAc,GACxB,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAKpB,CAAC;IAEF,MAAM,YAAY,GAAG,iBAAiB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;IAExE,8EAA8E;IAC9E,IAAI,OAAO,GAAkB,cAAc,CAAC;IAC5C,MAAM,YAAY,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAE1F,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;YACtC,MAAM,YAAY,CAAC,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,6CAA6C;IAC7C,IAAI,WAAoC,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAEnD,CAAC;QACF,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;IAC1D,CAAC;IAED,WAAW,CAAC;QACV,OAAO;QACP,OAAO;QACP,OAAO,EAAE,WAAW,EAAE,WAAW;QACjC,OAAO,EAAE,WAAW,EAAE,OAAO;KAC9B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/commands/stats.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { loadKeystore } from '../lib/keystore.js';
|
|
3
3
|
import { apiGet } from '../lib/api.js';
|
|
4
|
-
import {
|
|
4
|
+
import { printResult } from '../lib/output.js';
|
|
5
5
|
export const statsCommand = new Command('stats')
|
|
6
6
|
.description('View agent statistics')
|
|
7
7
|
.option('--address <addr>', 'Wallet address (defaults to own wallet)')
|
|
8
|
-
.option('--human', 'Human-readable output')
|
|
9
8
|
.action(async (opts) => {
|
|
10
|
-
const human = isHumanMode(opts.human);
|
|
11
9
|
let address = opts.address;
|
|
12
10
|
if (!address) {
|
|
13
11
|
const keystore = await loadKeystore();
|
|
@@ -17,22 +15,13 @@ export const statsCommand = new Command('stats')
|
|
|
17
15
|
apiGet(`/api/agents/stats?address=${address}`),
|
|
18
16
|
apiGet(`/api/wallet/balance?address=${address}`),
|
|
19
17
|
]);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
printResult({
|
|
29
|
-
address,
|
|
30
|
-
balanceUsdc: balanceResult.balanceUsdc,
|
|
31
|
-
balanceBaseUnits: balanceResult.balanceBaseUnits,
|
|
32
|
-
completedTasks: result.completedTasks,
|
|
33
|
-
averageRating: result.averageRating,
|
|
34
|
-
totalEarnings: result.totalEarnings,
|
|
35
|
-
}, human);
|
|
36
|
-
}
|
|
18
|
+
printResult({
|
|
19
|
+
address,
|
|
20
|
+
balanceUsdc: balanceResult.balanceUsdc,
|
|
21
|
+
balanceBaseUnits: balanceResult.balanceBaseUnits,
|
|
22
|
+
completedTasks: result.completedTasks,
|
|
23
|
+
averageRating: result.averageRating,
|
|
24
|
+
totalEarnings: result.totalEarnings,
|
|
25
|
+
});
|
|
37
26
|
});
|
|
38
27
|
//# sourceMappingURL=stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/commands/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/commands/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,uBAAuB,CAAC;KACpC,MAAM,CAAC,kBAAkB,EAAE,yCAAyC,CAAC;KACrE,MAAM,CAAC,KAAK,EAAE,IAA0B,EAAE,EAAE;IAC3C,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;QACtC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChD,MAAM,CAAC,6BAA6B,OAAO,EAAE,CAI3C;QACF,MAAM,CAAC,+BAA+B,OAAO,EAAE,CAG7C;KACH,CAAC,CAAC;IAEH,WAAW,CAAC;QACV,OAAO;QACP,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,gBAAgB,EAAE,aAAa,CAAC,gBAAgB;QAChD,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,aAAa,EAAE,MAAM,CAAC,aAAa;KACpC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { x402Post } from '../../lib/x402.js';
|
|
3
|
-
import {
|
|
3
|
+
import { printResult } from '../../lib/output.js';
|
|
4
4
|
export const acceptCmd = new Command('accept')
|
|
5
5
|
.description('Accept a submission (costs 0.001 USDC)')
|
|
6
6
|
.argument('<taskId>', 'Task ID (0x-prefixed hex)')
|
|
7
7
|
.requiredOption('--worker <addr>', 'Worker wallet address')
|
|
8
|
-
.option('--human', 'Human-readable output')
|
|
9
8
|
.action(async (taskId, opts) => {
|
|
10
|
-
const human = isHumanMode(opts.human);
|
|
11
9
|
await x402Post(`/api/tasks/${taskId}/accept`, {
|
|
12
10
|
taskId,
|
|
13
11
|
worker: opts.worker,
|
|
14
12
|
});
|
|
15
|
-
|
|
16
|
-
console.log('Accepted');
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
printResult({ accepted: true }, human);
|
|
20
|
-
}
|
|
13
|
+
printResult({ accepted: true });
|
|
21
14
|
});
|
|
22
15
|
//# sourceMappingURL=accept.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../../src/commands/task/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../../../src/commands/task/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC3C,WAAW,CAAC,wCAAwC,CAAC;KACrD,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;KACjD,cAAc,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;KAC1D,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAwB,EAAE,EAAE;IACzD,MAAM,QAAQ,CAAC,cAAc,MAAM,SAAS,EAAE;QAC5C,MAAM;QACN,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { loadKeystore } from '../../lib/keystore.js';
|
|
3
3
|
import { apiPost } from '../../lib/api.js';
|
|
4
|
-
import {
|
|
4
|
+
import { printResult } from '../../lib/output.js';
|
|
5
5
|
export const bidCmd = new Command('bid')
|
|
6
6
|
.description('Submit a bid on an auction task')
|
|
7
7
|
.argument('<taskId>', 'Task ID (0x-prefixed hex)')
|
|
8
8
|
.requiredOption('--price <usdc>', 'Bid price in USDC (e.g. 3 or 1.5)')
|
|
9
|
-
.option('--human', 'Human-readable output')
|
|
10
9
|
.action(async (taskId, opts) => {
|
|
11
|
-
const human = isHumanMode(opts.human);
|
|
12
10
|
const keystore = await loadKeystore();
|
|
13
11
|
const priceBaseUnits = String(Math.round(parseFloat(opts.price) * 1e6));
|
|
14
12
|
const result = (await apiPost(`/api/tasks/${taskId}/bids`, {
|
|
@@ -16,11 +14,6 @@ export const bidCmd = new Command('bid')
|
|
|
16
14
|
price: priceBaseUnits,
|
|
17
15
|
workerAddress: keystore.walletAddress,
|
|
18
16
|
}));
|
|
19
|
-
|
|
20
|
-
console.log('Bid submitted:', result.bidId);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
printResult({ bidId: result.bidId }, human);
|
|
24
|
-
}
|
|
17
|
+
printResult({ bidId: result.bidId });
|
|
25
18
|
});
|
|
26
19
|
//# sourceMappingURL=bid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bid.js","sourceRoot":"","sources":["../../../src/commands/task/bid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"bid.js","sourceRoot":"","sources":["../../../src/commands/task/bid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;KACrC,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;KACjD,cAAc,CAAC,gBAAgB,EAAE,mCAAmC,CAAC;KACrE,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAAuB,EAAE,EAAE;IACxD,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,cAAc,MAAM,OAAO,EAAE;QACzD,MAAM;QACN,KAAK,EAAE,cAAc;QACrB,aAAa,EAAE,QAAQ,CAAC,aAAa;KACtC,CAAC,CAAsB,CAAC;IAEzB,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { loadKeystore } from '../../lib/keystore.js';
|
|
3
3
|
import { apiPost } from '../../lib/api.js';
|
|
4
|
-
import {
|
|
4
|
+
import { printResult } from '../../lib/output.js';
|
|
5
5
|
export const claimCmd = new Command('claim')
|
|
6
6
|
.description('Claim a task as a worker')
|
|
7
7
|
.argument('<taskId>', 'Task ID (0x-prefixed hex)')
|
|
8
|
-
.
|
|
9
|
-
.action(async (taskId, opts) => {
|
|
10
|
-
const human = isHumanMode(opts.human);
|
|
8
|
+
.action(async (taskId) => {
|
|
11
9
|
const keystore = await loadKeystore();
|
|
12
10
|
const result = (await apiPost(`/api/tasks/${taskId}/claim`, {
|
|
13
11
|
workerAddress: keystore.walletAddress,
|
|
14
12
|
}));
|
|
15
|
-
|
|
16
|
-
console.log('Claimed. Claim ID:', result.claimId);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
printResult({ claimId: result.claimId }, human);
|
|
20
|
-
}
|
|
13
|
+
printResult({ claimId: result.claimId });
|
|
21
14
|
});
|
|
22
15
|
//# sourceMappingURL=claim.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../../src/commands/task/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../../src/commands/task/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KACzC,WAAW,CAAC,0BAA0B,CAAC;KACvC,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;KACjD,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;IAC/B,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IAEtC,MAAM,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,cAAc,MAAM,QAAQ,EAAE;QAC1D,aAAa,EAAE,QAAQ,CAAC,aAAa;KACtC,CAAC,CAAwB,CAAC;IAE3B,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { x402Post } from '../../lib/x402.js';
|
|
3
|
-
import {
|
|
3
|
+
import { printResult, printError } from '../../lib/output.js';
|
|
4
4
|
export const createCmd = new Command('create')
|
|
5
5
|
.description('Create a new task (costs reward amount in USDC)')
|
|
6
6
|
.requiredOption('--description <text>', 'Task description')
|
|
@@ -11,11 +11,9 @@ export const createCmd = new Command('create')
|
|
|
11
11
|
.option('--pitch-deadline <hours>', 'Pitch deadline in hours from now (pitch mode only)')
|
|
12
12
|
.option('--bid-deadline <hours>', 'Bid deadline in hours from now (auction mode only)')
|
|
13
13
|
.option('--max-price <usdc>', 'Maximum bid price in USDC (required for auction mode)')
|
|
14
|
-
.option('--human', 'Human-readable output')
|
|
15
14
|
.action(async (opts) => {
|
|
16
|
-
const human = isHumanMode(opts.human);
|
|
17
15
|
if (opts.mode === 'auction' && !opts.maxPrice) {
|
|
18
|
-
printError('--max-price is required for auction mode'
|
|
16
|
+
printError('--max-price is required for auction mode');
|
|
19
17
|
}
|
|
20
18
|
const rewardBaseUnits = String(Math.round(parseFloat(opts.reward) * 1e6));
|
|
21
19
|
const tags = opts.tags ? opts.tags.split(',').map((t) => t.trim()) : [];
|
|
@@ -38,11 +36,6 @@ export const createCmd = new Command('create')
|
|
|
38
36
|
body.maxPrice = String(Math.round(parseFloat(opts.maxPrice) * 1e6));
|
|
39
37
|
}
|
|
40
38
|
const result = (await x402Post('/api/tasks', body));
|
|
41
|
-
|
|
42
|
-
console.log('Task created:', result.taskId);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
printResult({ taskId: result.taskId }, human);
|
|
46
|
-
}
|
|
39
|
+
printResult({ taskId: result.taskId });
|
|
47
40
|
});
|
|
48
41
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/task/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/task/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC3C,WAAW,CAAC,iDAAiD,CAAC;KAC9D,cAAc,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;KAC1D,cAAc,CAAC,iBAAiB,EAAE,oCAAoC,CAAC;KACvE,cAAc,CAAC,oBAAoB,EAAE,wBAAwB,CAAC;KAC9D,MAAM,CAAC,eAAe,EAAE,qDAAqD,EAAE,QAAQ,CAAC;KACxF,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC;KAC/C,MAAM,CAAC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