@taskhunt/mcp-server 0.2.1 → 0.2.3
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/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/tools/submit-result.d.ts +10 -23
- package/dist/tools/submit-result.d.ts.map +1 -1
- package/dist/tools/submit-result.js +27 -27
- package/dist/tools/submit-result.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/tools/submit-result.ts +35 -28
package/dist/config.js
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
|
export function validateConfig() {
|
|
6
6
|
if (!config.apiKey) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +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,
|
|
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"}
|
|
@@ -6,8 +6,9 @@ export declare const submitResultTool: {
|
|
|
6
6
|
properties: {
|
|
7
7
|
taskId: {
|
|
8
8
|
type: string;
|
|
9
|
+
description: string;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
outputs: {
|
|
11
12
|
type: string;
|
|
12
13
|
items: {
|
|
13
14
|
type: string;
|
|
@@ -16,11 +17,12 @@ export declare const submitResultTool: {
|
|
|
16
17
|
type: string;
|
|
17
18
|
description: string;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
type: {
|
|
20
21
|
type: string;
|
|
22
|
+
enum: string[];
|
|
21
23
|
description: string;
|
|
22
24
|
};
|
|
23
|
-
|
|
25
|
+
value: {
|
|
24
26
|
type: string;
|
|
25
27
|
description: string;
|
|
26
28
|
};
|
|
@@ -29,30 +31,15 @@ export declare const submitResultTool: {
|
|
|
29
31
|
};
|
|
30
32
|
description: string;
|
|
31
33
|
};
|
|
32
|
-
|
|
34
|
+
summary: {
|
|
33
35
|
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
36
|
description: string;
|
|
53
37
|
};
|
|
54
|
-
|
|
38
|
+
toolsUsed: {
|
|
55
39
|
type: string;
|
|
40
|
+
items: {
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
56
43
|
description: string;
|
|
57
44
|
};
|
|
58
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-result.d.ts","sourceRoot":"","sources":["../../src/tools/submit-result.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"submit-result.d.ts","sourceRoot":"","sources":["../../src/tools/submit-result.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC5B,CAAC;AAQF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAoBrE"}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { client } from '../api-client.js';
|
|
2
2
|
export const submitResultTool = {
|
|
3
3
|
name: 'taskhunt_submit_result',
|
|
4
|
-
description: "Submit your completed work for a task. Include ALL required
|
|
4
|
+
description: "Submit your completed work for a task. Include ALL required outputs listed in the task's spec.outputs. Each output name must exactly match the name in spec.outputs. This is final — make sure everything is complete.",
|
|
5
5
|
inputSchema: {
|
|
6
6
|
type: 'object',
|
|
7
7
|
properties: {
|
|
8
|
-
taskId: { type: 'string' },
|
|
9
|
-
|
|
8
|
+
taskId: { type: 'string', description: 'Task UUID' },
|
|
9
|
+
outputs: {
|
|
10
10
|
type: 'array',
|
|
11
11
|
items: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
|
-
name: { type: 'string', description: 'Must match a name in
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
name: { type: 'string', description: 'Must exactly match a name in spec.outputs' },
|
|
15
|
+
type: { type: 'string', enum: ['TEXT', 'JSON', 'FILE', 'URL'], description: 'Output type (default: TEXT)' },
|
|
16
|
+
value: { type: 'string', description: 'The output content or file URL' },
|
|
17
17
|
},
|
|
18
|
-
required: ['name'],
|
|
18
|
+
required: ['name', 'value'],
|
|
19
19
|
},
|
|
20
|
-
description: 'All
|
|
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',
|
|
20
|
+
description: 'All outputs required by the task spec',
|
|
34
21
|
},
|
|
35
22
|
summary: {
|
|
36
23
|
type: 'string',
|
|
37
|
-
description: 'Brief summary of what you did and key findings.
|
|
24
|
+
description: 'Brief summary of what you did and key findings. Shown to the poster.',
|
|
25
|
+
},
|
|
26
|
+
toolsUsed: {
|
|
27
|
+
type: 'array',
|
|
28
|
+
items: { type: 'string' },
|
|
29
|
+
description: 'Tools you used, e.g. ["web_search", "web_fetch"]',
|
|
38
30
|
},
|
|
39
31
|
},
|
|
40
|
-
required: ['taskId', '
|
|
32
|
+
required: ['taskId', 'outputs', 'summary'],
|
|
41
33
|
},
|
|
42
34
|
};
|
|
43
35
|
export async function handleSubmitResult(args) {
|
|
44
36
|
const taskId = String(args.taskId);
|
|
37
|
+
// Normalize outputs: ensure each has type field
|
|
38
|
+
const rawOutputs = args.outputs ?? [];
|
|
39
|
+
const outputs = rawOutputs.map(o => ({
|
|
40
|
+
name: o.name,
|
|
41
|
+
type: o.type ?? 'TEXT',
|
|
42
|
+
value: o.value,
|
|
43
|
+
}));
|
|
45
44
|
const body = {
|
|
46
|
-
content: args.summary,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
summary: args.summary,
|
|
45
|
+
content: String(args.summary),
|
|
46
|
+
summary: String(args.summary),
|
|
47
|
+
outputs,
|
|
50
48
|
};
|
|
49
|
+
if (args.toolsUsed)
|
|
50
|
+
body.toolsUsed = args.toolsUsed;
|
|
51
51
|
const result = await client.post(`/tasks/${taskId}/submissions`, body);
|
|
52
52
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
53
53
|
}
|
|
@@ -1 +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,
|
|
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,wNAAwN;IACrO,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE;YACpD,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;wBAClF,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE;wBAC3G,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;qBACzE;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;iBAC5B;gBACD,WAAW,EAAE,uCAAuC;aACrD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sEAAsE;aACpF;YACD,SAAS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.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 {
|
|
@@ -2,54 +2,61 @@ import { client } from '../api-client.js';
|
|
|
2
2
|
|
|
3
3
|
export const submitResultTool = {
|
|
4
4
|
name: 'taskhunt_submit_result',
|
|
5
|
-
description: "Submit your completed work for a task. Include ALL required
|
|
5
|
+
description: "Submit your completed work for a task. Include ALL required outputs listed in the task's spec.outputs. Each output name must exactly match the name in spec.outputs. This is final — make sure everything is complete.",
|
|
6
6
|
inputSchema: {
|
|
7
7
|
type: 'object' as const,
|
|
8
8
|
properties: {
|
|
9
|
-
taskId: { type: 'string' },
|
|
10
|
-
|
|
9
|
+
taskId: { type: 'string', description: 'Task UUID' },
|
|
10
|
+
outputs: {
|
|
11
11
|
type: 'array',
|
|
12
12
|
items: {
|
|
13
13
|
type: 'object',
|
|
14
14
|
properties: {
|
|
15
|
-
name: { type: 'string', description: 'Must match a name in
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
name: { type: 'string', description: 'Must exactly match a name in spec.outputs' },
|
|
16
|
+
type: { type: 'string', enum: ['TEXT', 'JSON', 'FILE', 'URL'], description: 'Output type (default: TEXT)' },
|
|
17
|
+
value: { type: 'string', description: 'The output content or file URL' },
|
|
18
18
|
},
|
|
19
|
-
required: ['name'],
|
|
19
|
+
required: ['name', 'value'],
|
|
20
20
|
},
|
|
21
|
-
description: 'All
|
|
22
|
-
},
|
|
23
|
-
proofs: {
|
|
24
|
-
type: 'array',
|
|
25
|
-
items: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
type: { type: 'string', description: 'e.g. LOCATION_VERIFICATION, API_ACCESS, BROWSER_EXECUTION' },
|
|
29
|
-
verificationId: { type: 'string', description: 'ID from taskhunt_verify_location' },
|
|
30
|
-
evidence: { type: 'string', description: 'Additional evidence description or file URL' },
|
|
31
|
-
},
|
|
32
|
-
required: ['type'],
|
|
33
|
-
},
|
|
34
|
-
description: 'Execution proofs required by the task',
|
|
21
|
+
description: 'All outputs required by the task spec',
|
|
35
22
|
},
|
|
36
23
|
summary: {
|
|
37
24
|
type: 'string',
|
|
38
|
-
description: 'Brief summary of what you did and key findings.
|
|
25
|
+
description: 'Brief summary of what you did and key findings. Shown to the poster.',
|
|
26
|
+
},
|
|
27
|
+
toolsUsed: {
|
|
28
|
+
type: 'array',
|
|
29
|
+
items: { type: 'string' },
|
|
30
|
+
description: 'Tools you used, e.g. ["web_search", "web_fetch"]',
|
|
39
31
|
},
|
|
40
32
|
},
|
|
41
|
-
required: ['taskId', '
|
|
33
|
+
required: ['taskId', 'outputs', 'summary'],
|
|
42
34
|
},
|
|
43
35
|
};
|
|
44
36
|
|
|
37
|
+
interface OutputItem {
|
|
38
|
+
name: string;
|
|
39
|
+
type?: string;
|
|
40
|
+
value: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
45
43
|
export async function handleSubmitResult(args: Record<string, unknown>) {
|
|
46
44
|
const taskId = String(args.taskId);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
|
|
46
|
+
// Normalize outputs: ensure each has type field
|
|
47
|
+
const rawOutputs = (args.outputs as OutputItem[] | undefined) ?? [];
|
|
48
|
+
const outputs = rawOutputs.map(o => ({
|
|
49
|
+
name: o.name,
|
|
50
|
+
type: o.type ?? 'TEXT',
|
|
51
|
+
value: o.value,
|
|
52
|
+
}));
|
|
53
|
+
|
|
54
|
+
const body: Record<string, unknown> = {
|
|
55
|
+
content: String(args.summary),
|
|
56
|
+
summary: String(args.summary),
|
|
57
|
+
outputs,
|
|
52
58
|
};
|
|
59
|
+
if (args.toolsUsed) body.toolsUsed = args.toolsUsed;
|
|
53
60
|
|
|
54
61
|
const result = await client.post(`/tasks/${taskId}/submissions`, body);
|
|
55
62
|
return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };
|