arcagent-mcp 0.1.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.
Files changed (234) hide show
  1. package/README.md +84 -0
  2. package/dist/auth/apiKeyAuth.d.ts +16 -0
  3. package/dist/auth/apiKeyAuth.d.ts.map +1 -0
  4. package/dist/auth/apiKeyAuth.js +65 -0
  5. package/dist/auth/apiKeyAuth.js.map +1 -0
  6. package/dist/config.d.ts +21 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +63 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/convex/client.d.ts +7 -0
  11. package/dist/convex/client.d.ts.map +1 -0
  12. package/dist/convex/client.js +60 -0
  13. package/dist/convex/client.js.map +1 -0
  14. package/dist/index.d.ts +13 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +370 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/lib/clerk.d.ts +12 -0
  19. package/dist/lib/clerk.d.ts.map +1 -0
  20. package/dist/lib/clerk.js +77 -0
  21. package/dist/lib/clerk.js.map +1 -0
  22. package/dist/lib/context.d.ts +30 -0
  23. package/dist/lib/context.d.ts.map +1 -0
  24. package/dist/lib/context.js +73 -0
  25. package/dist/lib/context.js.map +1 -0
  26. package/dist/lib/crypto.d.ts +14 -0
  27. package/dist/lib/crypto.d.ts.map +1 -0
  28. package/dist/lib/crypto.js +25 -0
  29. package/dist/lib/crypto.js.map +1 -0
  30. package/dist/lib/httpError.d.ts +10 -0
  31. package/dist/lib/httpError.d.ts.map +1 -0
  32. package/dist/lib/httpError.js +13 -0
  33. package/dist/lib/httpError.js.map +1 -0
  34. package/dist/lib/lruCache.d.ts +13 -0
  35. package/dist/lib/lruCache.d.ts.map +1 -0
  36. package/dist/lib/lruCache.js +52 -0
  37. package/dist/lib/lruCache.js.map +1 -0
  38. package/dist/lib/rateLimit.d.ts +14 -0
  39. package/dist/lib/rateLimit.d.ts.map +1 -0
  40. package/dist/lib/rateLimit.js +108 -0
  41. package/dist/lib/rateLimit.js.map +1 -0
  42. package/dist/lib/sessionStore.d.ts +15 -0
  43. package/dist/lib/sessionStore.d.ts.map +1 -0
  44. package/dist/lib/sessionStore.js +86 -0
  45. package/dist/lib/sessionStore.js.map +1 -0
  46. package/dist/lib/telemetry.d.ts +21 -0
  47. package/dist/lib/telemetry.d.ts.map +1 -0
  48. package/dist/lib/telemetry.js +43 -0
  49. package/dist/lib/telemetry.js.map +1 -0
  50. package/dist/lib/toolHelper.d.ts +13 -0
  51. package/dist/lib/toolHelper.d.ts.map +1 -0
  52. package/dist/lib/toolHelper.js +20 -0
  53. package/dist/lib/toolHelper.js.map +1 -0
  54. package/dist/lib/toolProfiles.d.ts +62 -0
  55. package/dist/lib/toolProfiles.d.ts.map +1 -0
  56. package/dist/lib/toolProfiles.js +110 -0
  57. package/dist/lib/toolProfiles.js.map +1 -0
  58. package/dist/lib/types.d.ts +128 -0
  59. package/dist/lib/types.d.ts.map +1 -0
  60. package/dist/lib/types.js +3 -0
  61. package/dist/lib/types.js.map +1 -0
  62. package/dist/server.d.ts +7 -0
  63. package/dist/server.d.ts.map +1 -0
  64. package/dist/server.js +101 -0
  65. package/dist/server.js.map +1 -0
  66. package/dist/tools/cancelBounty.d.ts +3 -0
  67. package/dist/tools/cancelBounty.d.ts.map +1 -0
  68. package/dist/tools/cancelBounty.js +59 -0
  69. package/dist/tools/cancelBounty.js.map +1 -0
  70. package/dist/tools/checkNotifications.d.ts +3 -0
  71. package/dist/tools/checkNotifications.d.ts.map +1 -0
  72. package/dist/tools/checkNotifications.js +69 -0
  73. package/dist/tools/checkNotifications.js.map +1 -0
  74. package/dist/tools/claimBounty.d.ts +3 -0
  75. package/dist/tools/claimBounty.d.ts.map +1 -0
  76. package/dist/tools/claimBounty.js +59 -0
  77. package/dist/tools/claimBounty.js.map +1 -0
  78. package/dist/tools/createBounty.d.ts +3 -0
  79. package/dist/tools/createBounty.d.ts.map +1 -0
  80. package/dist/tools/createBounty.js +90 -0
  81. package/dist/tools/createBounty.js.map +1 -0
  82. package/dist/tools/extendClaim.d.ts +3 -0
  83. package/dist/tools/extendClaim.d.ts.map +1 -0
  84. package/dist/tools/extendClaim.js +68 -0
  85. package/dist/tools/extendClaim.js.map +1 -0
  86. package/dist/tools/fundBountyEscrow.d.ts +3 -0
  87. package/dist/tools/fundBountyEscrow.d.ts.map +1 -0
  88. package/dist/tools/fundBountyEscrow.js +49 -0
  89. package/dist/tools/fundBountyEscrow.js.map +1 -0
  90. package/dist/tools/getAgentProfile.d.ts +3 -0
  91. package/dist/tools/getAgentProfile.d.ts.map +1 -0
  92. package/dist/tools/getAgentProfile.js +45 -0
  93. package/dist/tools/getAgentProfile.js.map +1 -0
  94. package/dist/tools/getBountyDetails.d.ts +3 -0
  95. package/dist/tools/getBountyDetails.d.ts.map +1 -0
  96. package/dist/tools/getBountyDetails.js +79 -0
  97. package/dist/tools/getBountyDetails.js.map +1 -0
  98. package/dist/tools/getBountyGenerationStatus.d.ts +3 -0
  99. package/dist/tools/getBountyGenerationStatus.d.ts.map +1 -0
  100. package/dist/tools/getBountyGenerationStatus.js +71 -0
  101. package/dist/tools/getBountyGenerationStatus.js.map +1 -0
  102. package/dist/tools/getClaimStatus.d.ts +3 -0
  103. package/dist/tools/getClaimStatus.d.ts.map +1 -0
  104. package/dist/tools/getClaimStatus.js +78 -0
  105. package/dist/tools/getClaimStatus.js.map +1 -0
  106. package/dist/tools/getLeaderboard.d.ts +3 -0
  107. package/dist/tools/getLeaderboard.d.ts.map +1 -0
  108. package/dist/tools/getLeaderboard.js +40 -0
  109. package/dist/tools/getLeaderboard.js.map +1 -0
  110. package/dist/tools/getMyAgentStats.d.ts +3 -0
  111. package/dist/tools/getMyAgentStats.d.ts.map +1 -0
  112. package/dist/tools/getMyAgentStats.js +65 -0
  113. package/dist/tools/getMyAgentStats.js.map +1 -0
  114. package/dist/tools/getRepoMap.d.ts +3 -0
  115. package/dist/tools/getRepoMap.d.ts.map +1 -0
  116. package/dist/tools/getRepoMap.js +139 -0
  117. package/dist/tools/getRepoMap.js.map +1 -0
  118. package/dist/tools/getSubmissionFeedback.d.ts +3 -0
  119. package/dist/tools/getSubmissionFeedback.d.ts.map +1 -0
  120. package/dist/tools/getSubmissionFeedback.js +81 -0
  121. package/dist/tools/getSubmissionFeedback.js.map +1 -0
  122. package/dist/tools/getTestSuites.d.ts +3 -0
  123. package/dist/tools/getTestSuites.d.ts.map +1 -0
  124. package/dist/tools/getTestSuites.js +64 -0
  125. package/dist/tools/getTestSuites.js.map +1 -0
  126. package/dist/tools/getVerificationStatus.d.ts +3 -0
  127. package/dist/tools/getVerificationStatus.d.ts.map +1 -0
  128. package/dist/tools/getVerificationStatus.js +115 -0
  129. package/dist/tools/getVerificationStatus.js.map +1 -0
  130. package/dist/tools/importWorkItem.d.ts +3 -0
  131. package/dist/tools/importWorkItem.d.ts.map +1 -0
  132. package/dist/tools/importWorkItem.js +156 -0
  133. package/dist/tools/importWorkItem.js.map +1 -0
  134. package/dist/tools/listBounties.d.ts +3 -0
  135. package/dist/tools/listBounties.d.ts.map +1 -0
  136. package/dist/tools/listBounties.js +49 -0
  137. package/dist/tools/listBounties.js.map +1 -0
  138. package/dist/tools/listMySubmissions.d.ts +3 -0
  139. package/dist/tools/listMySubmissions.d.ts.map +1 -0
  140. package/dist/tools/listMySubmissions.js +46 -0
  141. package/dist/tools/listMySubmissions.js.map +1 -0
  142. package/dist/tools/rateAgent.d.ts +3 -0
  143. package/dist/tools/rateAgent.d.ts.map +1 -0
  144. package/dist/tools/rateAgent.js +94 -0
  145. package/dist/tools/rateAgent.js.map +1 -0
  146. package/dist/tools/registerAccount.d.ts +3 -0
  147. package/dist/tools/registerAccount.d.ts.map +1 -0
  148. package/dist/tools/registerAccount.js +103 -0
  149. package/dist/tools/registerAccount.js.map +1 -0
  150. package/dist/tools/releaseClaim.d.ts +3 -0
  151. package/dist/tools/releaseClaim.d.ts.map +1 -0
  152. package/dist/tools/releaseClaim.js +43 -0
  153. package/dist/tools/releaseClaim.js.map +1 -0
  154. package/dist/tools/setupPaymentMethod.d.ts +3 -0
  155. package/dist/tools/setupPaymentMethod.d.ts.map +1 -0
  156. package/dist/tools/setupPaymentMethod.js +53 -0
  157. package/dist/tools/setupPaymentMethod.js.map +1 -0
  158. package/dist/tools/setupPayoutAccount.d.ts +3 -0
  159. package/dist/tools/setupPayoutAccount.d.ts.map +1 -0
  160. package/dist/tools/setupPayoutAccount.js +44 -0
  161. package/dist/tools/setupPayoutAccount.js.map +1 -0
  162. package/dist/tools/submitSolution.d.ts +3 -0
  163. package/dist/tools/submitSolution.d.ts.map +1 -0
  164. package/dist/tools/submitSolution.js +98 -0
  165. package/dist/tools/submitSolution.js.map +1 -0
  166. package/dist/tools/workspaceApplyPatch.d.ts +41 -0
  167. package/dist/tools/workspaceApplyPatch.d.ts.map +1 -0
  168. package/dist/tools/workspaceApplyPatch.js +328 -0
  169. package/dist/tools/workspaceApplyPatch.js.map +1 -0
  170. package/dist/tools/workspaceBatchRead.d.ts +3 -0
  171. package/dist/tools/workspaceBatchRead.d.ts.map +1 -0
  172. package/dist/tools/workspaceBatchRead.js +95 -0
  173. package/dist/tools/workspaceBatchRead.js.map +1 -0
  174. package/dist/tools/workspaceBatchWrite.d.ts +3 -0
  175. package/dist/tools/workspaceBatchWrite.d.ts.map +1 -0
  176. package/dist/tools/workspaceBatchWrite.js +94 -0
  177. package/dist/tools/workspaceBatchWrite.js.map +1 -0
  178. package/dist/tools/workspaceCrashReports.d.ts +3 -0
  179. package/dist/tools/workspaceCrashReports.d.ts.map +1 -0
  180. package/dist/tools/workspaceCrashReports.js +76 -0
  181. package/dist/tools/workspaceCrashReports.js.map +1 -0
  182. package/dist/tools/workspaceEditFile.d.ts +3 -0
  183. package/dist/tools/workspaceEditFile.d.ts.map +1 -0
  184. package/dist/tools/workspaceEditFile.js +93 -0
  185. package/dist/tools/workspaceEditFile.js.map +1 -0
  186. package/dist/tools/workspaceExec.d.ts +3 -0
  187. package/dist/tools/workspaceExec.d.ts.map +1 -0
  188. package/dist/tools/workspaceExec.js +65 -0
  189. package/dist/tools/workspaceExec.js.map +1 -0
  190. package/dist/tools/workspaceExecStream.d.ts +3 -0
  191. package/dist/tools/workspaceExecStream.d.ts.map +1 -0
  192. package/dist/tools/workspaceExecStream.js +110 -0
  193. package/dist/tools/workspaceExecStream.js.map +1 -0
  194. package/dist/tools/workspaceGlob.d.ts +3 -0
  195. package/dist/tools/workspaceGlob.d.ts.map +1 -0
  196. package/dist/tools/workspaceGlob.js +78 -0
  197. package/dist/tools/workspaceGlob.js.map +1 -0
  198. package/dist/tools/workspaceGrep.d.ts +3 -0
  199. package/dist/tools/workspaceGrep.d.ts.map +1 -0
  200. package/dist/tools/workspaceGrep.js +184 -0
  201. package/dist/tools/workspaceGrep.js.map +1 -0
  202. package/dist/tools/workspaceListFiles.d.ts +3 -0
  203. package/dist/tools/workspaceListFiles.d.ts.map +1 -0
  204. package/dist/tools/workspaceListFiles.js +86 -0
  205. package/dist/tools/workspaceListFiles.js.map +1 -0
  206. package/dist/tools/workspaceReadFile.d.ts +3 -0
  207. package/dist/tools/workspaceReadFile.d.ts.map +1 -0
  208. package/dist/tools/workspaceReadFile.js +94 -0
  209. package/dist/tools/workspaceReadFile.js.map +1 -0
  210. package/dist/tools/workspaceSearch.d.ts +3 -0
  211. package/dist/tools/workspaceSearch.d.ts.map +1 -0
  212. package/dist/tools/workspaceSearch.js +102 -0
  213. package/dist/tools/workspaceSearch.js.map +1 -0
  214. package/dist/tools/workspaceShell.d.ts +3 -0
  215. package/dist/tools/workspaceShell.d.ts.map +1 -0
  216. package/dist/tools/workspaceShell.js +64 -0
  217. package/dist/tools/workspaceShell.js.map +1 -0
  218. package/dist/tools/workspaceStatus.d.ts +3 -0
  219. package/dist/tools/workspaceStatus.d.ts.map +1 -0
  220. package/dist/tools/workspaceStatus.js +105 -0
  221. package/dist/tools/workspaceStatus.js.map +1 -0
  222. package/dist/tools/workspaceWriteFile.d.ts +3 -0
  223. package/dist/tools/workspaceWriteFile.d.ts.map +1 -0
  224. package/dist/tools/workspaceWriteFile.js +81 -0
  225. package/dist/tools/workspaceWriteFile.js.map +1 -0
  226. package/dist/worker/client.d.ts +9 -0
  227. package/dist/worker/client.d.ts.map +1 -0
  228. package/dist/worker/client.js +53 -0
  229. package/dist/worker/client.js.map +1 -0
  230. package/dist/workspace/cache.d.ts +29 -0
  231. package/dist/workspace/cache.d.ts.map +1 -0
  232. package/dist/workspace/cache.js +57 -0
  233. package/dist/workspace/cache.js.map +1 -0
  234. package/package.json +61 -0
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceStatus = registerWorkspaceStatus;
4
+ const zod_1 = require("zod");
5
+ const context_1 = require("../lib/context");
6
+ const cache_1 = require("../workspace/cache");
7
+ const client_1 = require("../worker/client");
8
+ const toolHelper_1 = require("../lib/toolHelper");
9
+ function registerWorkspaceStatus(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_status", "Check workspace readiness, time remaining, and resource usage.", {
11
+ bountyId: zod_1.z
12
+ .string()
13
+ .optional()
14
+ .describe("Bounty ID (optional if you only have one active claim)"),
15
+ showTree: zod_1.z
16
+ .string()
17
+ .optional()
18
+ .describe("Set to 'true' to show top-level directory listing"),
19
+ }, async (args) => {
20
+ (0, context_1.requireScope)("workspace:read");
21
+ const user = (0, context_1.requireAuthUser)();
22
+ if (!args.bountyId) {
23
+ return {
24
+ content: [
25
+ {
26
+ type: "text",
27
+ text: "# Getting Started\n\n" +
28
+ "1. `list_bounties` — Browse available bounties\n" +
29
+ "2. `get_bounty_details` — Read requirements + Gherkin specs\n" +
30
+ "3. `claim_bounty` — Claim a bounty (workspace provisioned automatically)\n" +
31
+ "4. `workspace_status` — Check when workspace is ready (~30-90s)\n" +
32
+ "5. `workspace_exec`, `workspace_read_file`, `workspace_write_file` — Develop\n" +
33
+ "6. `submit_solution` — Submit for verification\n" +
34
+ "7. `get_verification_status` — Check results\n\n" +
35
+ "Provide a `bountyId` to check a specific workspace.",
36
+ },
37
+ ],
38
+ };
39
+ }
40
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
41
+ if (!ws.found) {
42
+ return {
43
+ content: [
44
+ {
45
+ type: "text",
46
+ text: "No workspace found for this bounty.\n\n" +
47
+ "Use `claim_bounty` to claim the bounty — a workspace will be provisioned automatically.\n" +
48
+ "Then use `workspace_status` to check when it's ready (~30-90 seconds).",
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ const parts = [];
54
+ parts.push(`## Workspace Status: **${ws.status}**`);
55
+ parts.push(`- **Workspace ID:** ${ws.workspaceId}`);
56
+ const remaining = ws.expiresAt - Date.now();
57
+ if (remaining > 0) {
58
+ const mins = Math.floor(remaining / 60000);
59
+ const hours = Math.floor(mins / 60);
60
+ parts.push(`- **Time remaining:** ${hours}h ${mins % 60}m`);
61
+ }
62
+ else {
63
+ parts.push("- **Status:** Expired");
64
+ }
65
+ if (ws.status === "provisioning") {
66
+ parts.push("\nWorkspace is being set up. Check again in 15-30 seconds.");
67
+ return {
68
+ content: [{ type: "text", text: parts.join("\n") }],
69
+ };
70
+ }
71
+ if (ws.status !== "ready") {
72
+ parts.push(`\nWorkspace is in status: ${ws.status}`);
73
+ return {
74
+ content: [{ type: "text", text: parts.join("\n") }],
75
+ };
76
+ }
77
+ // Show directory tree if requested
78
+ if (args.showTree === "true") {
79
+ try {
80
+ const treeResult = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/exec", {
81
+ workspaceId: ws.workspaceId,
82
+ command: "find /workspace -maxdepth 2 -not -path '*/node_modules/*' -not -path '*/.git/*' | head -80",
83
+ timeoutMs: 10000,
84
+ });
85
+ if (treeResult.stdout) {
86
+ parts.push("\n### Directory Structure\n```");
87
+ parts.push(treeResult.stdout.trim());
88
+ parts.push("```");
89
+ }
90
+ }
91
+ catch {
92
+ parts.push("\n*(Could not fetch directory listing)*");
93
+ }
94
+ }
95
+ parts.push("\n### Available Commands");
96
+ parts.push("- `workspace_exec` — Run shell commands");
97
+ parts.push("- `workspace_read_file` — Read source files");
98
+ parts.push("- `workspace_write_file` — Write/create files");
99
+ parts.push("- `submit_solution` — Submit changes for verification");
100
+ return {
101
+ content: [{ type: "text", text: parts.join("\n") }],
102
+ };
103
+ });
104
+ }
105
+ //# sourceMappingURL=workspaceStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceStatus.js","sourceRoot":"","sources":["../../src/tools/workspaceStatus.ts"],"names":[],"mappings":";;AAOA,0DAuHC;AA7HD,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,SAAgB,uBAAuB,CAAC,MAAiB;IACvD,IAAA,yBAAY,EACV,MAAM,EACN,kBAAkB,EAClB,gEAAgE,EAChE;QACE,QAAQ,EAAE,OAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,wDAAwD,CAAC;QACrE,QAAQ,EAAE,OAAC;aACR,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EACF,uBAAuB;4BACvB,kDAAkD;4BAClD,+DAA+D;4BAC/D,4EAA4E;4BAC5E,mEAAmE;4BACnE,gFAAgF;4BAChF,kDAAkD;4BAClD,kDAAkD;4BAClD,qDAAqD;qBACxD;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAoB,EAAC,IAAI,CAAC,M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,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceWriteFile(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceWriteFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceWriteFile.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceWriteFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqFlE"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceWriteFile = registerWorkspaceWriteFile;
4
+ const zod_1 = require("zod");
5
+ const context_1 = require("../lib/context");
6
+ const cache_1 = require("../workspace/cache");
7
+ const client_1 = require("../worker/client");
8
+ const toolHelper_1 = require("../lib/toolHelper");
9
+ function registerWorkspaceWriteFile(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_write_file", "Write or create a file in your workspace. Creates parent directories. Paths relative to /workspace.", {
11
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
12
+ path: zod_1.z.string().describe("File path relative to /workspace"),
13
+ content: zod_1.z.string().describe("File content (max 1MB)"),
14
+ }, async (args) => {
15
+ (0, context_1.requireScope)("workspace:write");
16
+ const user = (0, context_1.requireAuthUser)();
17
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
18
+ if (!ws.found || ws.status !== "ready") {
19
+ return {
20
+ content: [
21
+ {
22
+ type: "text",
23
+ text: ws.found
24
+ ? `Workspace is not ready (status: ${ws.status}).`
25
+ : "No workspace found. Claim the bounty first.",
26
+ },
27
+ ],
28
+ isError: true,
29
+ };
30
+ }
31
+ // SECURITY (W3): Defense-in-depth path validation at MCP layer
32
+ const normalizedPath = args.path.replace(/\\/g, "/");
33
+ if (normalizedPath.includes("..") && !normalizedPath.startsWith("/workspace/")) {
34
+ return {
35
+ content: [
36
+ {
37
+ type: "text",
38
+ text: "Path traversal not allowed. Paths must resolve within /workspace/.",
39
+ },
40
+ ],
41
+ isError: true,
42
+ };
43
+ }
44
+ // Check content size
45
+ const sizeBytes = Buffer.byteLength(args.content, "utf-8");
46
+ if (sizeBytes > 1024 * 1024) {
47
+ return {
48
+ content: [
49
+ {
50
+ type: "text",
51
+ text: `File content too large (${(sizeBytes / 1024).toFixed(0)}KB > 1024KB max).`,
52
+ },
53
+ ],
54
+ isError: true,
55
+ };
56
+ }
57
+ try {
58
+ const result = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/write-file", {
59
+ workspaceId: ws.workspaceId,
60
+ path: args.path,
61
+ content: args.content,
62
+ });
63
+ return {
64
+ content: [
65
+ {
66
+ type: "text",
67
+ text: `Written ${result.bytesWritten} bytes to \`${result.path}\``,
68
+ },
69
+ ],
70
+ };
71
+ }
72
+ catch (err) {
73
+ const message = err instanceof Error ? err.message : "File write failed";
74
+ return {
75
+ content: [{ type: "text", text: `Error: ${message}` }],
76
+ isError: true,
77
+ };
78
+ }
79
+ });
80
+ }
81
+ //# sourceMappingURL=workspaceWriteFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceWriteFile.js","sourceRoot":"","sources":["../../src/tools/workspaceWriteFile.ts"],"names":[],"mappings":";;AAOA,gEAqFC;AA3FD,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,SAAgB,0BAA0B,CAAC,MAAiB;IAC1D,IAAA,yBAAY,EACV,MAAM,EACN,sBAAsB,EACtB,qGAAqG,EACrG;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC/D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC7D,OAAO,EAAE,OAAC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C,SAAS,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB;qBAClF;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,EAG5B,EAAE,CAAC,UAAU,EAAE,2BAA2B,EAAE;gBAC7C,WAAW,EAAE,EAAE,CAAC,WAAW;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,WAAW,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,IAAI,IAAI;qBACnE;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;YAC3D,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Direct HTTP client for workspace operations on the worker.
3
+ *
4
+ * Bypasses Convex for latency-sensitive interactive operations
5
+ * (exec, file read/write). Auth: WORKER_SHARED_SECRET bearer token.
6
+ */
7
+ export declare function initWorkerClient(secret: string): void;
8
+ export declare function callWorker<T = unknown>(workerHost: string, path: string, body: Record<string, unknown>, timeoutMs?: number): Promise<T>;
9
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/worker/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,wBAAsB,UAAU,CAAC,CAAC,GAAG,OAAO,EAC1C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,GAAE,MAA2B,GACrC,OAAO,CAAC,CAAC,CAAC,CAuCZ"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * Direct HTTP client for workspace operations on the worker.
4
+ *
5
+ * Bypasses Convex for latency-sensitive interactive operations
6
+ * (exec, file read/write). Auth: WORKER_SHARED_SECRET bearer token.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.initWorkerClient = initWorkerClient;
10
+ exports.callWorker = callWorker;
11
+ let workerSecret;
12
+ const DEFAULT_TIMEOUT_MS = 130_000; // slightly over max command timeout
13
+ function initWorkerClient(secret) {
14
+ workerSecret = secret;
15
+ }
16
+ async function callWorker(workerHost, path, body, timeoutMs = DEFAULT_TIMEOUT_MS) {
17
+ const url = `${workerHost.replace(/\/+$/, "")}${path}`;
18
+ const controller = new AbortController();
19
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
20
+ try {
21
+ const response = await fetch(url, {
22
+ method: "POST",
23
+ headers: {
24
+ "Content-Type": "application/json",
25
+ Authorization: `Bearer ${workerSecret}`,
26
+ },
27
+ body: JSON.stringify(body),
28
+ signal: controller.signal,
29
+ });
30
+ clearTimeout(timer);
31
+ if (!response.ok) {
32
+ const rawText = await response.text().catch(() => "");
33
+ let errorMessage;
34
+ try {
35
+ const parsed = JSON.parse(rawText);
36
+ errorMessage = parsed.error || parsed.message || rawText.slice(0, 200);
37
+ }
38
+ catch {
39
+ errorMessage = `Worker error (${response.status}). ${rawText.slice(0, 200)}`;
40
+ }
41
+ throw new Error(errorMessage);
42
+ }
43
+ return (await response.json());
44
+ }
45
+ catch (err) {
46
+ clearTimeout(timer);
47
+ if (err instanceof Error && err.name === "AbortError") {
48
+ throw new Error(`Worker request timed out: ${path}`);
49
+ }
50
+ throw err;
51
+ }
52
+ }
53
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/worker/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAMH,4CAEC;AAED,gCA4CC;AApDD,IAAI,YAAoB,CAAC;AAEzB,MAAM,kBAAkB,GAAG,OAAO,CAAC,CAAC,oCAAoC;AAExE,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,YAAY,GAAG,MAAM,CAAC;AACxB,CAAC;AAEM,KAAK,UAAU,UAAU,CAC9B,UAAkB,EAClB,IAAY,EACZ,IAA6B,EAC7B,YAAoB,kBAAkB;IAEtC,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;IAEvD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;IAE9D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,YAAY,EAAE;aACxC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC,CAAC;QAEH,YAAY,CAAC,KAAK,CAAC,CAAC;QAEpB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACtD,IAAI,YAAoB,CAAC;YACzB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACnC,YAAY,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACzE,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY,GAAG,iBAAiB,QAAQ,CAAC,MAAM,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;YAC/E,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 120-second TTL cache for workspace lookups.
3
+ *
4
+ * Avoids hitting Convex on every workspace command.
5
+ * Invalidated automatically on TTL expiry.
6
+ */
7
+ interface WorkspaceLookup {
8
+ found: boolean;
9
+ workspaceId: string;
10
+ workerHost: string;
11
+ status: string;
12
+ expiresAt: number;
13
+ }
14
+ /**
15
+ * Get workspace info for an agent + bounty pair.
16
+ * Returns cached result if fresh, otherwise fetches from Convex.
17
+ */
18
+ export declare function getWorkspaceForAgent(agentId: string, bountyId: string): Promise<WorkspaceLookup>;
19
+ /**
20
+ * Invalidate cache for an agent + bounty pair.
21
+ */
22
+ export declare function invalidateWorkspaceCache(agentId: string, bountyId: string): void;
23
+ /**
24
+ * Invalidate all cached entries for an agent.
25
+ */
26
+ export declare function invalidateAllForAgent(agentId: string): void;
27
+ export declare function getWorkspaceCacheSize(): number;
28
+ export {};
29
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/workspace/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,UAAU,eAAe;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAmBD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,CAAC,CAe1B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAM3D;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * 120-second TTL cache for workspace lookups.
4
+ *
5
+ * Avoids hitting Convex on every workspace command.
6
+ * Invalidated automatically on TTL expiry.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getWorkspaceForAgent = getWorkspaceForAgent;
10
+ exports.invalidateWorkspaceCache = invalidateWorkspaceCache;
11
+ exports.invalidateAllForAgent = invalidateAllForAgent;
12
+ exports.getWorkspaceCacheSize = getWorkspaceCacheSize;
13
+ const client_1 = require("../convex/client");
14
+ const lruCache_1 = require("../lib/lruCache");
15
+ // ---------------------------------------------------------------------------
16
+ // Cache
17
+ // ---------------------------------------------------------------------------
18
+ const TTL_MS = 120_000; // 120 seconds — workspace status rarely changes during active use
19
+ const MAX_ENTRIES = 10_000;
20
+ const cache = new lruCache_1.LruTtlCache(MAX_ENTRIES, TTL_MS);
21
+ function cacheKey(agentId, bountyId) {
22
+ return `${agentId}:${bountyId}`;
23
+ }
24
+ /**
25
+ * Get workspace info for an agent + bounty pair.
26
+ * Returns cached result if fresh, otherwise fetches from Convex.
27
+ */
28
+ async function getWorkspaceForAgent(agentId, bountyId) {
29
+ const key = cacheKey(agentId, bountyId);
30
+ const cached = cache.get(key);
31
+ if (cached && Date.now() - cached.fetchedAt < TTL_MS) {
32
+ return cached.data;
33
+ }
34
+ const data = await (0, client_1.callConvex)("/api/mcp/workspace/lookup", { agentId, bountyId });
35
+ cache.set(key, { data, fetchedAt: Date.now() });
36
+ return data;
37
+ }
38
+ /**
39
+ * Invalidate cache for an agent + bounty pair.
40
+ */
41
+ function invalidateWorkspaceCache(agentId, bountyId) {
42
+ cache.delete(cacheKey(agentId, bountyId));
43
+ }
44
+ /**
45
+ * Invalidate all cached entries for an agent.
46
+ */
47
+ function invalidateAllForAgent(agentId) {
48
+ for (const key of cache.keys()) {
49
+ if (key.startsWith(`${agentId}:`)) {
50
+ cache.delete(key);
51
+ }
52
+ }
53
+ }
54
+ function getWorkspaceCacheSize() {
55
+ return cache.size();
56
+ }
57
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/workspace/cache.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAsCH,oDAkBC;AAKD,4DAKC;AAKD,sDAMC;AAED,sDAEC;AA/ED,6CAA8C;AAC9C,8CAA8C;AAmB9C,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,kEAAkE;AAC1F,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,sBAAW,CAAqB,WAAW,E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ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "arcagent-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for arcagent — AI agents earn bounties by solving coding tasks",
5
+ "homepage": "https://github.com/araujota/arcagent/tree/main/mcp-server",
6
+ "bugs": {
7
+ "url": "https://github.com/araujota/arcagent/issues"
8
+ },
9
+ "funding": {
10
+ "type": "github",
11
+ "url": "https://github.com/araujota"
12
+ },
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "provenance": true
19
+ },
20
+ "bin": {
21
+ "arcagent-mcp": "./dist/index.js"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "dev": "tsx watch src/index.ts",
28
+ "build": "tsc",
29
+ "clean": "rimraf dist",
30
+ "prepack": "npm run clean && npm run build",
31
+ "start": "node dist/index.js",
32
+ "prepublishOnly": "npm test && npm run prepack",
33
+ "pack:check": "node scripts/pack-check.mjs",
34
+ "test": "vitest run",
35
+ "test:watch": "vitest",
36
+ "test:coverage": "vitest run --coverage"
37
+ },
38
+ "keywords": ["mcp", "ai-agents", "bounties", "coding"],
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/araujota/arcagent.git",
43
+ "directory": "mcp-server"
44
+ },
45
+ "dependencies": {
46
+ "@clerk/backend": "^2.30.1",
47
+ "@modelcontextprotocol/sdk": "^1.12.1",
48
+ "express": "^4.21.0",
49
+ "redis": "^4.7.1",
50
+ "zod": "^3.25.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/express": "^5.0.0",
54
+ "@types/node": "^20",
55
+ "@vitest/coverage-v8": "^4.0.18",
56
+ "rimraf": "^6.1.0",
57
+ "tsx": "^4.19.0",
58
+ "typescript": "^5",
59
+ "vitest": "^4.0.18"
60
+ }
61
+ }