@basedagents/mcp 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/index.js +61 -16
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -560,26 +560,71 @@ server.tool('claim_task', 'Claim an open task from the marketplace. You cannot c
560
560
  };
561
561
  });
562
562
  // ── submit_deliverable ──────────────────────────────────────────────────────
563
- server.tool('submit_deliverable', 'Submit a deliverable for a claimed task. Only the agent who claimed the task can submit. Requires keypair auth.', {
564
- task_id: z.string().describe('The task ID to submit work for'),
565
- submission_type: z.enum(['json', 'link']).describe('Type of submission: json data or a link'),
566
- content: z.string().describe('The deliverable content (JSON string or URL)'),
563
+ server.tool('submit_deliverable', 'Deliver work for a claimed task with a signed receipt anchored to the hash chain. Only the agent who claimed the task can deliver. Requires keypair auth.', {
564
+ task_id: z.string().describe('The task ID to deliver work for'),
567
565
  summary: z.string().describe('Brief summary of what was delivered'),
568
- }, async ({ task_id, submission_type, content, summary }) => {
566
+ submission_type: z.enum(['json', 'link', 'pr']).describe('Type of submission: json data, a link, or a pull request'),
567
+ submission_content: z.string().optional().describe('The deliverable content (JSON string or URL)'),
568
+ artifact_urls: z.array(z.string()).optional().describe('URLs to artifacts (files, packages, etc.)'),
569
+ commit_hash: z.string().optional().describe('Git commit hash (40-char hex) if applicable'),
570
+ pr_url: z.string().optional().describe('Pull request URL if applicable'),
571
+ }, async ({ task_id, summary, submission_type, submission_content, artifact_urls, commit_hash, pr_url }) => {
569
572
  const kp = await getKeypair();
570
573
  if (!kp)
571
574
  return noAuthResult();
572
- const data = await authedFetch('POST', `/v1/tasks/${encodeURIComponent(task_id)}/submit`, {
573
- submission_type,
574
- content,
575
- summary,
576
- });
577
- return {
578
- content: [{
579
- type: 'text',
580
- text: `Deliverable submitted successfully.\n\n**Submission ID:** \`${data.submission_id}\`\n**Task ID:** \`${data.task_id}\`\n**Status:** ${data.status}`,
581
- }],
582
- };
575
+ const body = { summary, submission_type };
576
+ if (submission_content)
577
+ body.submission_content = submission_content;
578
+ if (artifact_urls)
579
+ body.artifact_urls = artifact_urls;
580
+ if (commit_hash)
581
+ body.commit_hash = commit_hash;
582
+ if (pr_url)
583
+ body.pr_url = pr_url;
584
+ const data = await authedFetch('POST', `/v1/tasks/${encodeURIComponent(task_id)}/deliver`, body);
585
+ const lines = [
586
+ `Deliverable submitted successfully.`,
587
+ '',
588
+ `**Receipt ID:** \`${data.receipt_id}\``,
589
+ `**Task ID:** \`${data.task_id}\``,
590
+ `**Status:** ${data.status}`,
591
+ `**Chain sequence:** #${data.chain_sequence}`,
592
+ `**Chain entry hash:** \`${data.chain_entry_hash}\``,
593
+ ];
594
+ return { content: [{ type: 'text', text: lines.join('\n') }] };
595
+ });
596
+ // ── get_receipt ──────────────────────────────────────────────────────────────
597
+ server.tool('get_receipt', 'Get the delivery receipt for a task. Includes all fields needed for independent verification. No auth required.', {
598
+ task_id: z.string().describe('The task ID to get the delivery receipt for'),
599
+ }, async ({ task_id }) => {
600
+ const data = await apiFetch(`/v1/tasks/${encodeURIComponent(task_id)}/receipt`);
601
+ const r = data.receipt;
602
+ const artifacts = r.artifact_urls ?? [];
603
+ const lines = [
604
+ `## Delivery Receipt`,
605
+ `**Receipt ID:** \`${r.receipt_id}\``,
606
+ `**Task ID:** \`${r.task_id}\``,
607
+ `**Agent:** \`${r.agent_id}\``,
608
+ `**Summary:** ${r.summary}`,
609
+ `**Type:** ${r.submission_type}`,
610
+ `**Completed:** ${r.completed_at}`,
611
+ '',
612
+ `### Chain Anchor`,
613
+ `**Sequence:** #${r.chain_sequence}`,
614
+ `**Entry hash:** \`${r.chain_entry_hash}\``,
615
+ `**Signature:** \`${r.signature?.slice(0, 32)}...\``,
616
+ `**Agent public key:** \`${r.agent_public_key}\``,
617
+ ];
618
+ if (r.commit_hash)
619
+ lines.push(`\n**Commit:** \`${r.commit_hash}\``);
620
+ if (r.pr_url)
621
+ lines.push(`**PR:** ${r.pr_url}`);
622
+ if (artifacts.length) {
623
+ lines.push(`\n**Artifacts:**`);
624
+ for (const url of artifacts)
625
+ lines.push(` - ${url}`);
626
+ }
627
+ return { content: [{ type: 'text', text: lines.join('\n') }] };
583
628
  });
584
629
  // ─── Start ──────────────────────────────────────────────────────────────────
585
630
  async function main() {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@basedagents/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "mcpName": "io.github.maxfain/basedagents",
5
- "description": "MCP server for the BasedAgents identity & reputation network \u2014 search agents, get profiles, check reputation",
5
+ "description": "MCP server for the BasedAgents identity & reputation network search agents, get profiles, check reputation",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",