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,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceBatchWrite = registerWorkspaceBatchWrite;
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 registerWorkspaceBatchWrite(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_batch_write", "Write or create multiple files in your workspace in a single request. " +
11
+ "Max 10 files, 1MB total content. Paths relative to /workspace.", {
12
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
13
+ files: zod_1.z
14
+ .array(zod_1.z.object({
15
+ path: zod_1.z.string().describe("File path relative to /workspace"),
16
+ content: zod_1.z.string().describe("File content"),
17
+ }))
18
+ .min(1)
19
+ .max(10)
20
+ .describe("Array of files to write (max 10)"),
21
+ }, async (args) => {
22
+ // SECURITY (H4): Scope enforcement
23
+ (0, context_1.requireScope)("workspace:write");
24
+ // SECURITY (C1): Identity from auth context
25
+ const user = (0, context_1.requireAuthUser)();
26
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
27
+ if (!ws.found || ws.status !== "ready") {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: ws.found
33
+ ? `Workspace is not ready (status: ${ws.status}).`
34
+ : "No workspace found. Claim the bounty first.",
35
+ },
36
+ ],
37
+ isError: true,
38
+ };
39
+ }
40
+ // SECURITY (W3): Defense-in-depth path traversal check on each path
41
+ for (const f of args.files) {
42
+ const norm = f.path.replace(/\\/g, "/");
43
+ if (norm.includes("..") && !norm.startsWith("/workspace/")) {
44
+ return {
45
+ content: [
46
+ {
47
+ type: "text",
48
+ text: "Path traversal not allowed. Paths must resolve within /workspace/.",
49
+ },
50
+ ],
51
+ isError: true,
52
+ };
53
+ }
54
+ }
55
+ // Check total content size at MCP layer
56
+ const totalBytes = args.files.reduce((acc, f) => acc + Buffer.byteLength(f.content, "utf-8"), 0);
57
+ if (totalBytes > 1024 * 1024) {
58
+ return {
59
+ content: [
60
+ {
61
+ type: "text",
62
+ text: `Total content too large (${(totalBytes / 1024).toFixed(0)}KB > 1024KB max).`,
63
+ },
64
+ ],
65
+ isError: true,
66
+ };
67
+ }
68
+ try {
69
+ const result = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/batch-write", {
70
+ workspaceId: ws.workspaceId,
71
+ files: args.files,
72
+ });
73
+ const lines = result.results.map((r) => r.error
74
+ ? `- \`${r.path}\` — ERROR: ${r.error}`
75
+ : `- \`${r.path}\` — ${r.bytesWritten} bytes written`);
76
+ return {
77
+ content: [
78
+ {
79
+ type: "text",
80
+ text: `Batch write complete:\n${lines.join("\n")}`,
81
+ },
82
+ ],
83
+ };
84
+ }
85
+ catch (err) {
86
+ const message = err instanceof Error ? err.message : "Batch write failed";
87
+ return {
88
+ content: [{ type: "text", text: `Error: ${message}` }],
89
+ isError: true,
90
+ };
91
+ }
92
+ });
93
+ }
94
+ //# sourceMappingURL=workspaceBatchWrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceBatchWrite.js","sourceRoot":"","sources":["../../src/tools/workspaceBatchWrite.ts"],"names":[],"mappings":";;AAOA,kEA8GC;AApHD,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,k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Q,CAAC,CAAC,YAAY,gBAAgB,CACxD,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,0BAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBACnD;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,oBAAoB,CAAC;YAC5D,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,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceCrashReports(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceCrashReports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceCrashReports.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceCrashReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiBpE,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmFrE"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceCrashReports = registerWorkspaceCrashReports;
4
+ const zod_1 = require("zod");
5
+ const context_1 = require("../lib/context");
6
+ const client_1 = require("../convex/client");
7
+ const toolHelper_1 = require("../lib/toolHelper");
8
+ function registerWorkspaceCrashReports(server) {
9
+ (0, toolHelper_1.registerTool)(server, "workspace_crash_reports", "Retrieve crash reports for your workspace. Shows commands that failed with non-zero exit codes " +
10
+ "or signals during verification or development. Useful for debugging build failures, test crashes, " +
11
+ "and OOM kills.", {
12
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
13
+ }, async (args) => {
14
+ // SECURITY (H4): Scope enforcement
15
+ (0, context_1.requireScope)("workspace:read");
16
+ // SECURITY (C1): Identity from auth context
17
+ const user = (0, context_1.requireAuthUser)();
18
+ try {
19
+ const result = await (0, client_1.callConvex)("/api/mcp/workspace/crash-reports", {
20
+ bountyId: args.bountyId,
21
+ userId: user.userId,
22
+ });
23
+ if (!result.reports || result.reports.length === 0) {
24
+ return {
25
+ content: [
26
+ {
27
+ type: "text",
28
+ text: "No crash reports found for this workspace.",
29
+ },
30
+ ],
31
+ };
32
+ }
33
+ const parts = [];
34
+ parts.push(`**${result.reports.length} crash report${result.reports.length > 1 ? "s" : ""} found:**\n`);
35
+ for (const report of result.reports) {
36
+ const timestamp = new Date(report.timestamp).toISOString();
37
+ const lines = [];
38
+ lines.push(`### Crash at ${timestamp}`);
39
+ if (report.command) {
40
+ lines.push(`- **Command:** \`${report.command}\``);
41
+ }
42
+ if (report.gate) {
43
+ lines.push(`- **Gate:** ${report.gate}`);
44
+ }
45
+ lines.push(`- **Exit code:** ${report.exitCode}`);
46
+ if (report.signal) {
47
+ lines.push(`- **Signal:** ${report.signal}`);
48
+ }
49
+ if (report.stderr) {
50
+ // Cap stderr to avoid massive output
51
+ const stderr = report.stderr.length > 2000
52
+ ? report.stderr.slice(-2000) + "\n... [truncated]"
53
+ : report.stderr;
54
+ lines.push(`- **stderr:**\n\`\`\`\n${stderr}\n\`\`\``);
55
+ }
56
+ parts.push(lines.join("\n"));
57
+ }
58
+ return {
59
+ content: [
60
+ {
61
+ type: "text",
62
+ text: parts.join("\n\n---\n\n"),
63
+ },
64
+ ],
65
+ };
66
+ }
67
+ catch (err) {
68
+ const message = err instanceof Error ? err.message : "Failed to fetch crash reports";
69
+ return {
70
+ content: [{ type: "text", text: `Error: ${message}` }],
71
+ isError: true,
72
+ };
73
+ }
74
+ });
75
+ }
76
+ //# sourceMappingURL=workspaceCrashReports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceCrashReports.js","sourceRoot":"","sources":["../../src/tools/workspaceCrashReports.ts"],"names":[],"mappings":";;AAiBA,sEAmFC;AAnGD,6BAAwB;AACxB,4CAA+D;AAC/D,6CAA8C;AAC9C,kDAAiD;AAajD,SAAgB,6BAA6B,CAAC,MAAiB;IAC7D,IAAA,yBAAY,EACV,MAAM,EACN,yBAAyB,EACzB,iGAAiG;QAC/F,oGAAoG;QACpG,gBAAgB,EAClB;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAChE,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,mCAAmC;QACnC,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC;QAC/B,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,EAE5B,kCAAkC,EAAE;gBACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,4CAA4C;yBACnD;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;YAExG,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C,IAAI,CAAC,aAAa,CAAC;qBAChC;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,+BAA+B,CAAC;YACvE,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,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceEditFile(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceEditFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceEditFile.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceEditFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkGjE"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceEditFile = registerWorkspaceEditFile;
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 registerWorkspaceEditFile(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_edit_file", "Perform a surgical text replacement in a file. Replaces the first occurrence of oldString with " +
11
+ "newString (or all occurrences if replaceAll is 'true'). This is safer than rewriting the entire file " +
12
+ "because it only touches the specific text you want to change. The oldString must match exactly " +
13
+ "(including whitespace and indentation). Paths relative to /workspace.", {
14
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
15
+ path: zod_1.z.string().describe("File path relative to /workspace"),
16
+ oldString: zod_1.z.string().describe("The exact text to find and replace"),
17
+ newString: zod_1.z.string().describe("The replacement text"),
18
+ replaceAll: zod_1.z
19
+ .string()
20
+ .optional()
21
+ .describe("Replace all occurrences: 'true' or 'false' (default 'false')"),
22
+ }, async (args) => {
23
+ // SECURITY (H4): Scope enforcement
24
+ (0, context_1.requireScope)("workspace:write");
25
+ // SECURITY (C1): Identity from auth context
26
+ const user = (0, context_1.requireAuthUser)();
27
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
28
+ if (!ws.found || ws.status !== "ready") {
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text",
33
+ text: ws.found
34
+ ? `Workspace is not ready (status: ${ws.status}).`
35
+ : "No workspace found. Claim the bounty first.",
36
+ },
37
+ ],
38
+ isError: true,
39
+ };
40
+ }
41
+ // SECURITY (W3): Defense-in-depth path validation at MCP layer
42
+ const normalizedPath = args.path.replace(/\\/g, "/");
43
+ if (normalizedPath.includes("..") && !normalizedPath.startsWith("/workspace/")) {
44
+ return {
45
+ content: [
46
+ {
47
+ type: "text",
48
+ text: "Path traversal not allowed. Paths must resolve within /workspace/.",
49
+ },
50
+ ],
51
+ isError: true,
52
+ };
53
+ }
54
+ if (args.oldString === args.newString) {
55
+ return {
56
+ content: [
57
+ {
58
+ type: "text",
59
+ text: "oldString and newString are identical. No changes needed.",
60
+ },
61
+ ],
62
+ isError: true,
63
+ };
64
+ }
65
+ try {
66
+ const result = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/edit-file", {
67
+ workspaceId: ws.workspaceId,
68
+ path: args.path,
69
+ oldString: args.oldString,
70
+ newString: args.newString,
71
+ replaceAll: args.replaceAll === "true",
72
+ });
73
+ return {
74
+ content: [
75
+ {
76
+ type: "text",
77
+ text: result.replacements === 0
78
+ ? `No matches found for the specified text in \`${result.path}\`. Verify the oldString matches exactly (including whitespace).`
79
+ : `Replaced ${result.replacements} occurrence${result.replacements > 1 ? "s" : ""} in \`${result.path}\``,
80
+ },
81
+ ],
82
+ };
83
+ }
84
+ catch (err) {
85
+ const message = err instanceof Error ? err.message : "File edit failed";
86
+ return {
87
+ content: [{ type: "text", text: `Error: ${message}` }],
88
+ isError: true,
89
+ };
90
+ }
91
+ });
92
+ }
93
+ //# sourceMappingURL=workspaceEditFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceEditFile.js","sourceRoot":"","sources":["../../src/tools/workspaceEditFile.ts"],"names":[],"mappings":";;AAOA,8DAkGC;AAxGD,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,SAAgB,yBAAyB,CAAC,MAAiB;IACzD,IAAA,yBAAY,EACV,MAAM,EACN,qBAAqB,EACrB,iGAAiG;QAC/F,uGAAuG;QACvG,iGAAiG;QACjG,uEAAuE,EACzE;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,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QACpE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACtD,UAAU,EAAE,OAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8DAA8D,CAAC;KAC5E,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,mCAAmC;QACnC,IAAA,sBAAY,EAAC,iBAAiB,CAAC,CAAC;QAChC,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAoB,EAAC,IAAI,CAAC,MAAM,EA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MAAM;aACvC,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EACF,MAAM,CAAC,YAAY,KAAK,CAAC;4BACvB,CAAC,CAAC,gDAAgD,MAAM,CAAC,IAAI,kEAAkE;4BAC/H,CAAC,CAAC,YAAY,MAAM,CAAC,YAAY,cAAc,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,MAAM,CAAC,IAAI,IAAI;qBAC9G;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,kBAAkB,CAAC;YAC1D,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,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceExec(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceExec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceExec.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceExec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsE7D"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceExec = registerWorkspaceExec;
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 registerWorkspaceExec(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_exec", "Run a shell command in your development workspace. The repository is at /workspace. " +
11
+ "Commands run as non-root user. Use for building, testing, installing packages, running scripts.", {
12
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
13
+ command: zod_1.z.string().describe("Shell command to execute"),
14
+ timeoutMs: zod_1.z
15
+ .string()
16
+ .optional()
17
+ .describe("Timeout in ms (default 120000, max 300000)"),
18
+ }, async (args) => {
19
+ (0, context_1.requireScope)("workspace:exec");
20
+ const user = (0, context_1.requireAuthUser)();
21
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
22
+ if (!ws.found || ws.status !== "ready") {
23
+ return {
24
+ content: [
25
+ {
26
+ type: "text",
27
+ text: ws.found
28
+ ? `Workspace is not ready (status: ${ws.status}). Use \`workspace_status\` to check.`
29
+ : "No workspace found for this bounty. Claim the bounty first with `claim_bounty`.",
30
+ },
31
+ ],
32
+ isError: true,
33
+ };
34
+ }
35
+ try {
36
+ const timeout = args.timeoutMs
37
+ ? Math.min(parseInt(args.timeoutMs, 10), 300000)
38
+ : 120000;
39
+ const result = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/exec", {
40
+ workspaceId: ws.workspaceId,
41
+ command: args.command,
42
+ timeoutMs: timeout,
43
+ }, timeout + 10_000);
44
+ const parts = [];
45
+ if (result.stdout) {
46
+ parts.push("**stdout:**\n```\n" + result.stdout + "\n```");
47
+ }
48
+ if (result.stderr) {
49
+ parts.push("**stderr:**\n```\n" + result.stderr + "\n```");
50
+ }
51
+ parts.push(`**exit code:** ${result.exitCode}`);
52
+ return {
53
+ content: [{ type: "text", text: parts.join("\n\n") }],
54
+ };
55
+ }
56
+ catch (err) {
57
+ const message = err instanceof Error ? err.message : "Command execution failed";
58
+ return {
59
+ content: [{ type: "text", text: `Error: ${message}` }],
60
+ isError: true,
61
+ };
62
+ }
63
+ });
64
+ }
65
+ //# sourceMappingURL=workspaceExec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceExec.js","sourceRoot":"","sources":["../../src/tools/workspaceExec.ts"],"names":[],"mappings":";;AAOA,sDAsEC;AA5ED,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,SAAgB,qBAAqB,CAAC,MAAiB;IACrD,IAAA,yBAAY,EACV,MAAM,EACN,gBAAgB,EAChB,sFAAsF;QACpF,iGAAiG,EACnG;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC/D,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACxD,SAAS,EAAE,OAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4CAA4C,CAAC;KAC1D,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAoB,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YACvC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,EAAE,CAAC,KAAK;4BACZ,CAAC,CAAC,mCAAmC,EAAE,CAAC,MAAM,uCAAuC;4BACrF,CAAC,CAAC,iFAAiF;qBACtF;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CA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ACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceExecStream(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceExecStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceExecStream.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceExecStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8HnE"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceExecStream = registerWorkspaceExecStream;
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
+ const MAX_STREAM_OUTPUT = 500 * 1024; // 500 KB
10
+ function registerWorkspaceExecStream(server) {
11
+ (0, toolHelper_1.registerTool)(server, "workspace_exec_stream", "Run a long-running command (e.g. npm test, cargo build) with streaming output. " +
12
+ "Unlike workspace_exec, this starts the command in the background and polls for output, " +
13
+ "so you get the full build log even for commands that take minutes. " +
14
+ "Max 5 minutes timeout. Use workspace_exec for quick commands (<30s).", {
15
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
16
+ command: zod_1.z.string().describe("Shell command to execute"),
17
+ timeoutMs: zod_1.z
18
+ .string()
19
+ .optional()
20
+ .describe("Timeout in ms (default 300000, max 300000)"),
21
+ }, async (args) => {
22
+ // SECURITY (H4): Scope enforcement
23
+ (0, context_1.requireScope)("workspace:exec");
24
+ // SECURITY (C1): Identity from auth context
25
+ const user = (0, context_1.requireAuthUser)();
26
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
27
+ if (!ws.found || ws.status !== "ready") {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: ws.found
33
+ ? `Workspace is not ready (status: ${ws.status}).`
34
+ : "No workspace found. Claim the bounty first.",
35
+ },
36
+ ],
37
+ isError: true,
38
+ };
39
+ }
40
+ try {
41
+ const timeout = args.timeoutMs
42
+ ? Math.min(parseInt(args.timeoutMs, 10), 300000)
43
+ : 300000;
44
+ // Start the streaming job
45
+ const startResult = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/exec-stream", {
46
+ workspaceId: ws.workspaceId,
47
+ command: args.command,
48
+ timeoutMs: timeout,
49
+ });
50
+ const jobId = startResult.jobId;
51
+ // Poll for output until done
52
+ let allStdout = "";
53
+ let allStderr = "";
54
+ let offset = 0;
55
+ let done = false;
56
+ let exitCode;
57
+ let pollCount = 0;
58
+ // Poll interval: 2s for first 5 polls, then 5s
59
+ while (!done) {
60
+ const delay = pollCount < 5 ? 2000 : 5000;
61
+ await new Promise((r) => setTimeout(r, delay));
62
+ pollCount++;
63
+ const pollResult = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/exec-output", {
64
+ workspaceId: ws.workspaceId,
65
+ jobId,
66
+ offset,
67
+ });
68
+ allStdout += pollResult.stdout;
69
+ allStderr = pollResult.stderr; // stderr is always full (not offset-based)
70
+ offset = pollResult.offset;
71
+ done = pollResult.done;
72
+ exitCode = pollResult.exitCode;
73
+ // Cap total output
74
+ if (Buffer.byteLength(allStdout, "utf-8") > MAX_STREAM_OUTPUT) {
75
+ allStdout = allStdout.slice(-MAX_STREAM_OUTPUT) +
76
+ "\n... [earlier output truncated]";
77
+ break;
78
+ }
79
+ // Safety: don't poll forever
80
+ if (pollCount > 300) {
81
+ break;
82
+ }
83
+ }
84
+ const parts = [];
85
+ if (allStdout) {
86
+ parts.push("**stdout:**\n```\n" + allStdout + "\n```");
87
+ }
88
+ if (allStderr) {
89
+ parts.push("**stderr:**\n```\n" + allStderr + "\n```");
90
+ }
91
+ if (exitCode !== undefined) {
92
+ parts.push(`**exit code:** ${exitCode}`);
93
+ }
94
+ else {
95
+ parts.push("**status:** command may still be running (polling stopped)");
96
+ }
97
+ return {
98
+ content: [{ type: "text", text: parts.join("\n\n") }],
99
+ };
100
+ }
101
+ catch (err) {
102
+ const message = err instanceof Error ? err.message : "Streaming exec failed";
103
+ return {
104
+ content: [{ type: "text", text: `Error: ${message}` }],
105
+ isError: true,
106
+ };
107
+ }
108
+ });
109
+ }
110
+ //# sourceMappingURL=workspaceExecStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceExecStream.js","sourceRoot":"","sources":["../../src/tools/workspaceExecStream.ts"],"names":[],"mappings":";;AASA,kEA8HC;AAtID,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,SAAS;AAE/C,SAAgB,2BAA2B,CAAC,MAAiB;IAC3D,IAAA,yBAAY,EACV,MAAM,EACN,uBAAuB,EACvB,iFAAiF;QAC/E,yFAAyF;QACzF,qEAAqE;QACrE,sEAAsE,EACxE;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC/D,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACxD,SAAS,EAAE,OAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4CAA4C,CAAC;KAC1D,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,mCAAmC;QACnC,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC;QAC/B,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAoB,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAA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DAA4D,CAAC,CAAC;YAC3E,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;aAC/D,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;YAC/D,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,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceGlob(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceGlob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceGlob.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceGlob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmF7D"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkspaceGlob = registerWorkspaceGlob;
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 registerWorkspaceGlob(server) {
10
+ (0, toolHelper_1.registerTool)(server, "workspace_glob", "Find files by glob pattern in your workspace. Returns matching file paths sorted by modification " +
11
+ "time (most recently modified first). Useful for discovering project structure, finding files by " +
12
+ "extension, or locating specific file names. Excludes .git and node_modules by default.", {
13
+ bountyId: zod_1.z.string().describe("The bounty ID you have claimed"),
14
+ pattern: zod_1.z
15
+ .string()
16
+ .describe("Glob pattern to match (e.g. '**/*.ts', 'src/**/*.test.*', '*.json')"),
17
+ path: zod_1.z
18
+ .string()
19
+ .optional()
20
+ .describe("Subdirectory to search in, relative to /workspace (default: workspace root)"),
21
+ }, async (args) => {
22
+ // SECURITY (H4): Scope enforcement
23
+ (0, context_1.requireScope)("workspace:read");
24
+ // SECURITY (C1): Identity from auth context
25
+ const user = (0, context_1.requireAuthUser)();
26
+ const ws = await (0, cache_1.getWorkspaceForAgent)(user.userId, args.bountyId);
27
+ if (!ws.found || ws.status !== "ready") {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: ws.found
33
+ ? `Workspace is not ready (status: ${ws.status}).`
34
+ : "No workspace found. Claim the bounty first.",
35
+ },
36
+ ],
37
+ isError: true,
38
+ };
39
+ }
40
+ try {
41
+ const result = await (0, client_1.callWorker)(ws.workerHost, "/api/workspace/glob", {
42
+ workspaceId: ws.workspaceId,
43
+ pattern: args.pattern,
44
+ path: args.path,
45
+ });
46
+ if (result.files.length === 0) {
47
+ return {
48
+ content: [
49
+ {
50
+ type: "text",
51
+ text: `No files found matching pattern: ${args.pattern}`,
52
+ },
53
+ ],
54
+ };
55
+ }
56
+ const listing = result.files.map((f) => ` ${f}`).join("\n");
57
+ const footer = result.truncated
58
+ ? `\n\n(showing ${result.files.length} of ${result.totalCount}+ matches, sorted by mtime)`
59
+ : `\n\n(${result.totalCount} files, sorted by mtime)`;
60
+ return {
61
+ content: [
62
+ {
63
+ type: "text",
64
+ text: `**Matching files:**\n${listing}${footer}`,
65
+ },
66
+ ],
67
+ };
68
+ }
69
+ catch (err) {
70
+ const message = err instanceof Error ? err.message : "Glob search failed";
71
+ return {
72
+ content: [{ type: "text", text: `Error: ${message}` }],
73
+ isError: true,
74
+ };
75
+ }
76
+ });
77
+ }
78
+ //# sourceMappingURL=workspaceGlob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceGlob.js","sourceRoot":"","sources":["../../src/tools/workspaceGlob.ts"],"names":[],"mappings":";;AAOA,sDAmFC;AAzFD,6BAAwB;AACxB,4CAA+D;AAC/D,8CAA0D;AAC1D,6CAA8C;AAC9C,kDAAiD;AAEjD,SAAgB,qBAAqB,CAAC,MAAiB;IACrD,IAAA,yBAAY,EACV,MAAM,EACN,gBAAgB,EAChB,mGAAmG;QACjG,kGAAkG;QAClG,wFAAwF,EAC1F;QACE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QAC/D,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,CAAC,qEAAqE,CAAC;QAClF,IAAI,EAAE,OAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6EAA6E,CAAC;KAC3F,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,mCAAmC;QACnC,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC;QAC/B,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAA,yBAAe,GAAE,CAAC;QAE/B,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAoB,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YACvC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,EAAE,CAAC,KAAK;4BACZ,CAAC,CAAC,mCAAmC,EAAE,CAAC,MAAM,IAAI;4BAClD,CAAC,CAAC,6CAA6C;qBAClD;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MA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C;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerWorkspaceGrep(server: McpServer): void;
3
+ //# sourceMappingURL=workspaceGrep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceGrep.d.ts","sourceRoot":"","sources":["../../src/tools/workspaceGrep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsN7D"}