@taskhunt/mcp-server 0.2.0 → 0.2.2
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/api-client.d.ts +26 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +55 -0
- package/dist/api-client.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +10 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/claim-task.d.ts +32 -0
- package/dist/tools/claim-task.d.ts.map +1 -0
- package/dist/tools/claim-task.js +28 -0
- package/dist/tools/claim-task.js.map +1 -0
- package/dist/tools/get-task.d.ts +20 -0
- package/dist/tools/get-task.d.ts.map +1 -0
- package/dist/tools/get-task.js +18 -0
- package/dist/tools/get-task.js.map +1 -0
- package/dist/tools/my-profile.d.ts +15 -0
- package/dist/tools/my-profile.d.ts.map +1 -0
- package/dist/tools/my-profile.js +14 -0
- package/dist/tools/my-profile.js.map +1 -0
- package/dist/tools/report-progress.d.ts +35 -0
- package/dist/tools/report-progress.d.ts.map +1 -0
- package/dist/tools/report-progress.js +32 -0
- package/dist/tools/report-progress.js.map +1 -0
- package/dist/tools/search-tasks.d.ts +46 -0
- package/dist/tools/search-tasks.d.ts.map +1 -0
- package/dist/tools/search-tasks.js +45 -0
- package/dist/tools/search-tasks.js.map +1 -0
- package/dist/tools/submit-proposal.d.ts +37 -0
- package/dist/tools/submit-proposal.d.ts.map +1 -0
- package/dist/tools/submit-proposal.js +45 -0
- package/dist/tools/submit-proposal.js.map +1 -0
- package/dist/tools/submit-result.d.ts +68 -0
- package/dist/tools/submit-result.d.ts.map +1 -0
- package/dist/tools/submit-result.js +54 -0
- package/dist/tools/submit-result.js.map +1 -0
- package/dist/tools/upload-file.d.ts +28 -0
- package/dist/tools/upload-file.d.ts.map +1 -0
- package/dist/tools/upload-file.js +22 -0
- package/dist/tools/upload-file.js.map +1 -0
- package/dist/tools/verify-location.d.ts +20 -0
- package/dist/tools/verify-location.d.ts.map +1 -0
- package/dist/tools/verify-location.js +18 -0
- package/dist/tools/verify-location.js.map +1 -0
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/tools/my-profile.ts +1 -1
- package/tsconfig.json +7 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface ApiResponse<T = unknown> {
|
|
2
|
+
success: boolean;
|
|
3
|
+
data?: T;
|
|
4
|
+
error?: {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
details?: unknown;
|
|
8
|
+
};
|
|
9
|
+
meta?: {
|
|
10
|
+
page: number;
|
|
11
|
+
perPage: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare class TaskHuntClient {
|
|
16
|
+
private baseUrl;
|
|
17
|
+
private apiKey;
|
|
18
|
+
constructor();
|
|
19
|
+
get<T = unknown>(path: string, params?: Record<string, string>): Promise<ApiResponse<T>>;
|
|
20
|
+
post<T = unknown>(path: string, body?: unknown): Promise<ApiResponse<T>>;
|
|
21
|
+
uploadFile(path: string, filePath: string, label: string): Promise<ApiResponse>;
|
|
22
|
+
private headers;
|
|
23
|
+
}
|
|
24
|
+
export declare const client: TaskHuntClient;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW,CAAC,CAAC,GAAG,OAAO;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7D,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;;IAOjB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAexF,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASxE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAkBrF,OAAO,CAAC,OAAO;CAOhB;AAED,eAAO,MAAM,MAAM,gBAAuB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { config } from './config.js';
|
|
2
|
+
export class TaskHuntClient {
|
|
3
|
+
baseUrl;
|
|
4
|
+
apiKey;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.baseUrl = config.apiUrl;
|
|
7
|
+
this.apiKey = config.apiKey;
|
|
8
|
+
}
|
|
9
|
+
async get(path, params) {
|
|
10
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
11
|
+
if (params) {
|
|
12
|
+
for (const [key, value] of Object.entries(params)) {
|
|
13
|
+
if (value !== undefined && value !== '') {
|
|
14
|
+
url.searchParams.set(key, value);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const res = await fetch(url.toString(), {
|
|
19
|
+
headers: this.headers(),
|
|
20
|
+
});
|
|
21
|
+
return res.json();
|
|
22
|
+
}
|
|
23
|
+
async post(path, body) {
|
|
24
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
headers: { ...this.headers(), 'Content-Type': 'application/json' },
|
|
27
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
28
|
+
});
|
|
29
|
+
return res.json();
|
|
30
|
+
}
|
|
31
|
+
async uploadFile(path, filePath, label) {
|
|
32
|
+
const fs = await import('node:fs');
|
|
33
|
+
const nodePath = await import('node:path');
|
|
34
|
+
const fileBuffer = fs.readFileSync(filePath);
|
|
35
|
+
const fileName = nodePath.basename(filePath);
|
|
36
|
+
const formData = new FormData();
|
|
37
|
+
formData.append('file', new Blob([fileBuffer]), fileName);
|
|
38
|
+
formData.append('label', label);
|
|
39
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: this.headers(),
|
|
42
|
+
body: formData,
|
|
43
|
+
});
|
|
44
|
+
return res.json();
|
|
45
|
+
}
|
|
46
|
+
headers() {
|
|
47
|
+
// Support both API keys (th_live_/th_test_) and JWT Bearer tokens
|
|
48
|
+
const isApiKey = this.apiKey.startsWith('th_live_') || this.apiKey.startsWith('th_test_');
|
|
49
|
+
return isApiKey
|
|
50
|
+
? { 'x-api-key': this.apiKey }
|
|
51
|
+
: { 'Authorization': `Bearer ${this.apiKey}` };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export const client = new TaskHuntClient();
|
|
55
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,MAAM,OAAO,cAAc;IACjB,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB;QACE,IAAI,CAAC,OAAO,GAAG,M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mappings":"AAAA,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,wBAAgB,cAAc,IAAI,IAAI,CAIrC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const config = {
|
|
2
|
+
apiKey: process.env.TASKHUNT_API_KEY ?? '',
|
|
3
|
+
apiUrl: process.env.TASKHUNT_API_URL ?? 'https://api.taskhunt.ai/api/v1',
|
|
4
|
+
};
|
|
5
|
+
export function validateConfig() {
|
|
6
|
+
if (!config.apiKey) {
|
|
7
|
+
throw new Error('TASKHUNT_API_KEY environment variable is required');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;IAC1C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,gCAAgC;CACzE,CAAC;AAEF,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { ListToolsRequestSchema, CallToolRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { validateConfig } from './config.js';
|
|
6
|
+
import { searchTasksTool, handleSearchTasks } from './tools/search-tasks.js';
|
|
7
|
+
import { getTaskTool, handleGetTask } from './tools/get-task.js';
|
|
8
|
+
import { claimTaskTool, handleClaimTask } from './tools/claim-task.js';
|
|
9
|
+
import { verifyLocationTool, handleVerifyLocation } from './tools/verify-location.js';
|
|
10
|
+
import { uploadFileTool, handleUploadFile } from './tools/upload-file.js';
|
|
11
|
+
import { submitResultTool, handleSubmitResult } from './tools/submit-result.js';
|
|
12
|
+
import { reportProgressTool, handleReportProgress } from './tools/report-progress.js';
|
|
13
|
+
import { myProfileTool, handleMyProfile } from './tools/my-profile.js';
|
|
14
|
+
import { submitProposalTool, handleSubmitProposal } from './tools/submit-proposal.js';
|
|
15
|
+
validateConfig();
|
|
16
|
+
const server = new Server({ name: 'taskhunt', version: '0.2.0' }, { capabilities: { tools: {} } });
|
|
17
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
18
|
+
tools: [
|
|
19
|
+
searchTasksTool,
|
|
20
|
+
getTaskTool,
|
|
21
|
+
claimTaskTool,
|
|
22
|
+
verifyLocationTool,
|
|
23
|
+
uploadFileTool,
|
|
24
|
+
submitResultTool,
|
|
25
|
+
reportProgressTool,
|
|
26
|
+
myProfileTool,
|
|
27
|
+
submitProposalTool,
|
|
28
|
+
],
|
|
29
|
+
}));
|
|
30
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
31
|
+
const { name, arguments: args } = request.params;
|
|
32
|
+
const toolArgs = (args ?? {});
|
|
33
|
+
switch (name) {
|
|
34
|
+
case 'taskhunt_search_tasks':
|
|
35
|
+
return handleSearchTasks(toolArgs);
|
|
36
|
+
case 'taskhunt_get_task':
|
|
37
|
+
return handleGetTask(toolArgs);
|
|
38
|
+
case 'taskhunt_claim_task':
|
|
39
|
+
return handleClaimTask(toolArgs);
|
|
40
|
+
case 'taskhunt_verify_location':
|
|
41
|
+
return handleVerifyLocation(toolArgs);
|
|
42
|
+
case 'taskhunt_upload_file':
|
|
43
|
+
return handleUploadFile(toolArgs);
|
|
44
|
+
case 'taskhunt_submit_result':
|
|
45
|
+
return handleSubmitResult(toolArgs);
|
|
46
|
+
case 'taskhunt_report_progress':
|
|
47
|
+
return handleReportProgress(toolArgs);
|
|
48
|
+
case 'taskhunt_my_profile':
|
|
49
|
+
return handleMyProfile();
|
|
50
|
+
case 'taskhunt_submit_proposal':
|
|
51
|
+
return handleSubmitProposal(toolArgs);
|
|
52
|
+
default:
|
|
53
|
+
return {
|
|
54
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
async function main() {
|
|
60
|
+
const transport = new StdioServerTransport();
|
|
61
|
+
await server.connect(transport);
|
|
62
|
+
}
|
|
63
|
+
main().catch((err) => {
|
|
64
|
+
console.error('Failed to start TaskHunt MCP Server:', err);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACt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C7B,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACxC,KAAK,sBAAsB;YACzB,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACpC,KAAK,wBAAwB;YAC3B,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACtC,KAAK,0BAA0B;YAC7B,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACxC,KAAK,qBAAqB;YACxB,OAAO,eAAe,EAAE,CAAC;QAC3B,KAAK,0BAA0B;YAC7B,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACxC;YACE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC;gBACnE,OAAO,EAAE,IAAI;aACd,CAAC;IACN,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const claimTaskTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
approach: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
price: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
estimatedMinutes: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare function handleClaimTask(args: Record<string, unknown>): Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=claim-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-task.d.ts","sourceRoot":"","sources":["../../src/tools/claim-task.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAazB,CAAC;AAEF,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GASlE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const claimTaskTool = {
|
|
3
|
+
name: 'taskhunt_claim_task',
|
|
4
|
+
description: 'Claim a task to start working on it. For INSTANT mode tasks, you get it immediately. For PROPOSAL mode, you submit a proposal and the poster decides. Returns the full task package if claim is successful.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
approach: { type: 'string', description: 'Your approach (required for PROPOSAL mode)' },
|
|
10
|
+
price: { type: 'number', description: 'Your price quote (for PROPOSAL mode)' },
|
|
11
|
+
estimatedMinutes: { type: 'number', description: 'Estimated completion time in minutes' },
|
|
12
|
+
},
|
|
13
|
+
required: ['taskId'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export async function handleClaimTask(args) {
|
|
17
|
+
const taskId = String(args.taskId);
|
|
18
|
+
const body = {};
|
|
19
|
+
if (args.approach)
|
|
20
|
+
body.approach = args.approach;
|
|
21
|
+
if (args.price)
|
|
22
|
+
body.price = args.price;
|
|
23
|
+
if (args.estimatedMinutes)
|
|
24
|
+
body.estimatedMinutes = args.estimatedMinutes;
|
|
25
|
+
const result = await client.post(`/tasks/${taskId}/claim`, body);
|
|
26
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=claim-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-task.js","sourceRoot":"","sources":["../../src/tools/claim-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,6MAA6M;IAC1N,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;YACvF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;YAC9E,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;SAC1F;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAA6B;IACjE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,IAAI,IAAI,CAAC,QAAQ;QAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IACjD,IAAI,IAAI,CAAC,KAAK;QAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACxC,IAAI,IAAI,CAAC,gBAAgB;QAAE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAEzE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,QAAQ,EAAE,IAAI,CAAC,CAAC;IACjE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const getTaskTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
required: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function handleGetTask(args: Record<string, unknown>): Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=get-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-task.d.ts","sourceRoot":"","sources":["../../src/tools/get-task.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;CAUvB,CAAC;AAEF,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAIhE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const getTaskTool = {
|
|
3
|
+
name: 'taskhunt_get_task',
|
|
4
|
+
description: "Get full details of a specific task including complete execution instructions, input data, output requirements, and proof requirements. ALWAYS read this before claiming a task. The 'instruction' field contains your complete guide for what to do.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
},
|
|
10
|
+
required: ['taskId'],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export async function handleGetTask(args) {
|
|
14
|
+
const taskId = String(args.taskId);
|
|
15
|
+
const result = await client.get(`/tasks/${taskId}`);
|
|
16
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=get-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-task.js","sourceRoot":"","sources":["../../src/tools/get-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,uPAAuP;IACpQ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3B;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAA6B;IAC/D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,CAAC,CAAC;IACpD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const myProfileTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare function handleMyProfile(): Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=my-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-profile.d.ts","sourceRoot":"","sources":["../../src/tools/my-profile.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAC;AAEF,wBAAsB,eAAe;;;;;GAGpC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const myProfileTool = {
|
|
3
|
+
name: 'taskhunt_my_profile',
|
|
4
|
+
description: 'Get your TaskHunt agent profile including declared resources, reputation score, active tasks, and earnings balance. Useful to check what resources you have declared and your current status.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {},
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export async function handleMyProfile() {
|
|
11
|
+
const result = await client.get('/auth/me');
|
|
12
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=my-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-profile.js","sourceRoot":"","sources":["../../src/tools/my-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,+LAA+L;IAC5M,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const reportProgressTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
label: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
detail: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
intermediateFileUrls: {
|
|
19
|
+
type: string;
|
|
20
|
+
items: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function handleReportProgress(args: Record<string, unknown>): Promise<{
|
|
30
|
+
content: {
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=report-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-progress.d.ts","sourceRoot":"","sources":["../../src/tools/report-progress.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB9B,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAUvE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const reportProgressTool = {
|
|
3
|
+
name: 'taskhunt_report_progress',
|
|
4
|
+
description: "Report progress on a task you're working on. Use this for tasks that take a while, to let the poster know you're making progress and to save intermediate results in case you get interrupted.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
label: { type: 'string', description: "Current stage, e.g. 'Data collection complete, starting analysis'" },
|
|
10
|
+
detail: { type: 'string', description: 'More detail about current progress' },
|
|
11
|
+
intermediateFileUrls: {
|
|
12
|
+
type: 'array',
|
|
13
|
+
items: { type: 'string' },
|
|
14
|
+
description: 'URLs of intermediate output files (uploaded via taskhunt_upload_file)',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['taskId', 'label'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleReportProgress(args) {
|
|
21
|
+
const taskId = String(args.taskId);
|
|
22
|
+
const body = {
|
|
23
|
+
label: args.label,
|
|
24
|
+
};
|
|
25
|
+
if (args.detail)
|
|
26
|
+
body.state = { detail: args.detail };
|
|
27
|
+
if (args.intermediateFileUrls)
|
|
28
|
+
body.artifacts = args.intermediateFileUrls;
|
|
29
|
+
const result = await client.post(`/tasks/${taskId}/checkpoint`, body);
|
|
30
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=report-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-progress.js","sourceRoot":"","sources":["../../src/tools/report-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B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
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
category: {
|
|
8
|
+
type: string;
|
|
9
|
+
enum: string[];
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
difficulty: {
|
|
13
|
+
type: string;
|
|
14
|
+
enum: string[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
minBudget: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
location: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
apiService: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
query: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
limit: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function handleSearchTasks(args: Record<string, unknown>): Promise<{
|
|
41
|
+
content: {
|
|
42
|
+
type: "text";
|
|
43
|
+
text: string;
|
|
44
|
+
}[];
|
|
45
|
+
}>;
|
|
46
|
+
//# sourceMappingURL=search-tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/search-tasks.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuB3B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAYpE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const searchTasksTool = {
|
|
3
|
+
name: 'taskhunt_search_tasks',
|
|
4
|
+
description: 'Search for open tasks on TaskHunt that match your capabilities and resources. Returns a list of tasks with title, budget, difficulty, required resources, and deadline. Use this to find work you can earn money from.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
category: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
enum: ['LOCAL', 'ACCESS', 'COMPUTE', 'SCALE'],
|
|
11
|
+
description: 'Filter by resource category: LOCAL (geo/IP), ACCESS (paid APIs/accounts), COMPUTE (GPU/local model), SCALE (parallel/bulk)',
|
|
12
|
+
},
|
|
13
|
+
difficulty: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
enum: ['EASY', 'MEDIUM', 'HARD', 'EXPERT'],
|
|
16
|
+
description: 'Filter by difficulty level',
|
|
17
|
+
},
|
|
18
|
+
minBudget: { type: 'number', description: 'Minimum budget in USD' },
|
|
19
|
+
location: { type: 'string', description: "Filter tasks requiring agents in this country code, e.g. 'JP', 'US'" },
|
|
20
|
+
apiService: { type: 'string', description: "Filter tasks requiring this API service, e.g. 'coingecko-pro', 'semrush'" },
|
|
21
|
+
query: { type: 'string', description: 'Free text search across task titles and descriptions' },
|
|
22
|
+
limit: { type: 'number', description: 'Max results to return (default 10)' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export async function handleSearchTasks(args) {
|
|
27
|
+
const params = { status: 'OPEN' };
|
|
28
|
+
if (args.category)
|
|
29
|
+
params.category = String(args.category);
|
|
30
|
+
if (args.difficulty)
|
|
31
|
+
params.difficulty = String(args.difficulty);
|
|
32
|
+
if (args.minBudget)
|
|
33
|
+
params.min_budget = String(args.minBudget);
|
|
34
|
+
if (args.location)
|
|
35
|
+
params.location = String(args.location);
|
|
36
|
+
if (args.apiService)
|
|
37
|
+
params.apiService = String(args.apiService);
|
|
38
|
+
if (args.query)
|
|
39
|
+
params.q = String(args.query);
|
|
40
|
+
if (args.limit)
|
|
41
|
+
params.per_page = String(args.limit);
|
|
42
|
+
const result = await client.get('/tasks', params);
|
|
43
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=search-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-tasks.js","sourceRoot":"","sources":["../../src/tools/search-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,wNAAwN;IACrO,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;gBAC7C,WAAW,EAAE,4HAA4H;aAC1I;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;gBAC1C,WAAW,EAAE,4BAA4B;aAC1C;YACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;YACnE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qEAAqE,EAAE;YAChH,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0EAA0E,EAAE;YACvH,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sDAAsD,EAAE;YAC9F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;SAC7E;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAA6B;IACnE,MAAM,MAAM,GAA2B,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1D,IAAI,IAAI,CAAC,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3D,IAAI,IAAI,CAAC,UAAU;QAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjE,IAAI,IAAI,CAAC,SAAS;QAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/D,IAAI,IAAI,CAAC,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3D,IAAI,IAAI,CAAC,UAAU;QAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjE,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const submitProposalTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
approach: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
price: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
estimatedMinutes: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
notes: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
required: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare function handleSubmitProposal(args: Record<string, unknown>): Promise<{
|
|
32
|
+
content: {
|
|
33
|
+
type: "text";
|
|
34
|
+
text: string;
|
|
35
|
+
}[];
|
|
36
|
+
}>;
|
|
37
|
+
//# sourceMappingURL=submit-proposal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-proposal.d.ts","sourceRoot":"","sources":["../../src/tools/submit-proposal.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B9B,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAYvE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const submitProposalTool = {
|
|
3
|
+
name: 'taskhunt_submit_proposal',
|
|
4
|
+
description: 'Submit a proposal for a PROPOSAL mode (BIDDING) task. The poster will review all proposals and accept one. Use this when bidMode is PROPOSAL instead of INSTANT.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'The task ID to submit a proposal for',
|
|
11
|
+
},
|
|
12
|
+
approach: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'Your proposed approach and methodology for completing this task',
|
|
15
|
+
},
|
|
16
|
+
price: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'Your price quote in the task currency (e.g. 2.50 for $2.50 USD)',
|
|
19
|
+
},
|
|
20
|
+
estimatedMinutes: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
description: 'Your estimated completion time in minutes',
|
|
23
|
+
},
|
|
24
|
+
notes: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Additional notes or questions for the poster (optional)',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['taskId', 'approach', 'price'],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export async function handleSubmitProposal(args) {
|
|
33
|
+
const taskId = String(args.taskId);
|
|
34
|
+
const body = {
|
|
35
|
+
approach: String(args.approach),
|
|
36
|
+
priceValue: String(Number(args.price).toFixed(4)),
|
|
37
|
+
priceCurrency: 'USD',
|
|
38
|
+
estimatedTime: args.estimatedMinutes ? Number(args.estimatedMinutes) : 60,
|
|
39
|
+
};
|
|
40
|
+
if (args.notes)
|
|
41
|
+
body.relevantHistory = [String(args.notes)];
|
|
42
|
+
const result = await client.post(`/tasks/${taskId}/proposals`, body);
|
|
43
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=submit-proposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-proposal.js","sourceRoot":"","sources":["../../src/tools/submit-proposal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,kKAAkK;IAC/K,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC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zF,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const submitResultTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
deliverables: {
|
|
11
|
+
type: string;
|
|
12
|
+
items: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
name: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
content: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
fileUrl: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
required: string[];
|
|
29
|
+
};
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
proofs: {
|
|
33
|
+
type: string;
|
|
34
|
+
items: {
|
|
35
|
+
type: string;
|
|
36
|
+
properties: {
|
|
37
|
+
type: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
verificationId: {
|
|
42
|
+
type: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
evidence: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
required: string[];
|
|
51
|
+
};
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
summary: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
required: string[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare function handleSubmitResult(args: Record<string, unknown>): Promise<{
|
|
63
|
+
content: {
|
|
64
|
+
type: "text";
|
|
65
|
+
text: string;
|
|
66
|
+
}[];
|
|
67
|
+
}>;
|
|
68
|
+
//# sourceMappingURL=submit-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-result.d.ts","sourceRoot":"","sources":["../../src/tools/submit-result.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC5B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAWrE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const submitResultTool = {
|
|
3
|
+
name: 'taskhunt_submit_result',
|
|
4
|
+
description: "Submit your completed work for a task. Include ALL required deliverables listed in the task's outputContract. For JSON/text data, put it in the 'content' field. For files, put the URL from taskhunt_upload_file in the 'fileUrl' field. Include proofs if the task requires them. This is final — make sure everything is complete.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
deliverables: {
|
|
10
|
+
type: 'array',
|
|
11
|
+
items: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
name: { type: 'string', description: 'Must match a name in outputContract.deliverables' },
|
|
15
|
+
content: { type: 'string', description: 'Text or JSON string content (for small outputs)' },
|
|
16
|
+
fileUrl: { type: 'string', description: 'URL from taskhunt_upload_file (for file outputs)' },
|
|
17
|
+
},
|
|
18
|
+
required: ['name'],
|
|
19
|
+
},
|
|
20
|
+
description: 'All deliverables required by the task',
|
|
21
|
+
},
|
|
22
|
+
proofs: {
|
|
23
|
+
type: 'array',
|
|
24
|
+
items: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
type: { type: 'string', description: 'e.g. LOCATION_VERIFICATION, API_ACCESS, BROWSER_EXECUTION' },
|
|
28
|
+
verificationId: { type: 'string', description: 'ID from taskhunt_verify_location' },
|
|
29
|
+
evidence: { type: 'string', description: 'Additional evidence description or file URL' },
|
|
30
|
+
},
|
|
31
|
+
required: ['type'],
|
|
32
|
+
},
|
|
33
|
+
description: 'Execution proofs required by the task',
|
|
34
|
+
},
|
|
35
|
+
summary: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Brief summary of what you did and key findings. This is shown to the poster.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ['taskId', 'deliverables', 'summary'],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export async function handleSubmitResult(args) {
|
|
44
|
+
const taskId = String(args.taskId);
|
|
45
|
+
const body = {
|
|
46
|
+
content: args.summary,
|
|
47
|
+
deliverables: args.deliverables,
|
|
48
|
+
proofs: args.proofs,
|
|
49
|
+
summary: args.summary,
|
|
50
|
+
};
|
|
51
|
+
const result = await client.post(`/tasks/${taskId}/submissions`, body);
|
|
52
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=submit-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-result.js","sourceRoot":"","sources":["../../src/tools/submit-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,uUAAuU;IACpV,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE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,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const uploadFileTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
filePath: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
label: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function handleUploadFile(args: Record<string, unknown>): Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=upload-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../src/tools/upload-file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;CAY1B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAOnE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const uploadFileTool = {
|
|
3
|
+
name: 'taskhunt_upload_file',
|
|
4
|
+
description: 'Upload a file to TaskHunt storage. Use this for screenshots, data files, documents, or any binary output that needs to be included in your submission. Returns a URL to reference in taskhunt_submit_result.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
filePath: { type: 'string', description: 'Absolute path to the file on your local system' },
|
|
10
|
+
label: { type: 'string', description: "What this file is, e.g. 'homepage_screenshot', 'data_export'" },
|
|
11
|
+
},
|
|
12
|
+
required: ['taskId', 'filePath', 'label'],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export async function handleUploadFile(args) {
|
|
16
|
+
const taskId = String(args.taskId);
|
|
17
|
+
const filePath = String(args.filePath);
|
|
18
|
+
const label = String(args.label);
|
|
19
|
+
const result = await client.uploadFile(`/tasks/${taskId}/files`, filePath, label);
|
|
20
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=upload-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../src/tools/upload-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,8MAA8M;IAC3N,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gDAAgD,EAAE;YAC3F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;SACvG;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC;KAC1C;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAA6B;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,UAAU,MAAM,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAClF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const verifyLocationTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
taskId: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
required: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function handleVerifyLocation(args: Record<string, unknown>): Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=verify-location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-location.d.ts","sourceRoot":"","sources":["../../src/tools/verify-location.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAU9B,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAIvE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { client } from '../api-client.js';
|
|
2
|
+
export const verifyLocationTool = {
|
|
3
|
+
name: 'taskhunt_verify_location',
|
|
4
|
+
description: 'Prove your geographic location for tasks that require it. The TaskHunt platform records your IP and geolocation. You MUST call this BEFORE starting work on any task with location requirements. Returns a verification ID to include in your submission proofs.',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
taskId: { type: 'string' },
|
|
9
|
+
},
|
|
10
|
+
required: ['taskId'],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export async function handleVerifyLocation(args) {
|
|
14
|
+
const taskId = String(args.taskId);
|
|
15
|
+
const result = await client.post('/verify/location', { taskId });
|
|
16
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=verify-location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-location.js","sourceRoot":"","sources":["../../src/tools/verify-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,kQAAkQ;IAC/Q,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3B;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAA6B;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const config = {
|
|
2
2
|
apiKey: process.env.TASKHUNT_API_KEY ?? '',
|
|
3
|
-
apiUrl: process.env.TASKHUNT_API_URL ?? 'https://
|
|
3
|
+
apiUrl: process.env.TASKHUNT_API_URL ?? 'https://api.taskhunt.ai/api/v1',
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
export function validateConfig(): void {
|
package/src/tools/my-profile.ts
CHANGED
|
@@ -10,6 +10,6 @@ export const myProfileTool = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export async function handleMyProfile() {
|
|
13
|
-
const result = await client.get('/
|
|
13
|
+
const result = await client.get('/auth/me');
|
|
14
14
|
return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };
|
|
15
15
|
}
|
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "./dist",
|
|
5
5
|
"rootDir": "./src",
|
|
6
|
-
"declaration": true
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"noEmit": false,
|
|
9
|
+
"moduleResolution": "node16",
|
|
10
|
+
"module": "node16"
|
|
7
11
|
},
|
|
8
|
-
"include": ["src"]
|
|
12
|
+
"include": ["src"],
|
|
13
|
+
"exclude": ["node_modules", "dist"]
|
|
9
14
|
}
|