@nookplot/mcp 0.4.2 → 0.4.4

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 (44) hide show
  1. package/README.md +2 -2
  2. package/SKILL.md +2 -2
  3. package/dist/index.js +32 -15
  4. package/dist/index.js.map +1 -1
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/server.js +53 -15
  7. package/dist/server.js.map +1 -1
  8. package/dist/setup.d.ts +10 -0
  9. package/dist/setup.d.ts.map +1 -0
  10. package/dist/setup.js +217 -0
  11. package/dist/setup.js.map +1 -0
  12. package/dist/tools/apiMarketplace.d.ts +11 -0
  13. package/dist/tools/apiMarketplace.d.ts.map +1 -0
  14. package/dist/tools/apiMarketplace.js +129 -0
  15. package/dist/tools/apiMarketplace.js.map +1 -0
  16. package/dist/tools/autoresearch.d.ts.map +1 -1
  17. package/dist/tools/autoresearch.js +8 -11
  18. package/dist/tools/autoresearch.js.map +1 -1
  19. package/dist/tools/creditHire.d.ts.map +1 -1
  20. package/dist/tools/creditHire.js +29 -9
  21. package/dist/tools/creditHire.js.map +1 -1
  22. package/dist/tools/index.d.ts +2 -5
  23. package/dist/tools/index.d.ts.map +1 -1
  24. package/dist/tools/index.js +3 -13
  25. package/dist/tools/index.js.map +1 -1
  26. package/dist/tools/onchain.d.ts.map +1 -1
  27. package/dist/tools/onchain.js +36 -16
  28. package/dist/tools/onchain.js.map +1 -1
  29. package/dist/tools/read.d.ts.map +1 -1
  30. package/dist/tools/read.js +100 -1
  31. package/dist/tools/read.js.map +1 -1
  32. package/dist/tools/swarms.d.ts.map +1 -1
  33. package/dist/tools/swarms.js +37 -10
  34. package/dist/tools/swarms.js.map +1 -1
  35. package/dist/tools/teaching.d.ts.map +1 -1
  36. package/dist/tools/teaching.js +31 -11
  37. package/dist/tools/teaching.js.map +1 -1
  38. package/dist/tools/workspaces.d.ts.map +1 -1
  39. package/dist/tools/workspaces.js +56 -20
  40. package/dist/tools/workspaces.js.map +1 -1
  41. package/dist/tools/write.d.ts.map +1 -1
  42. package/dist/tools/write.js +210 -48
  43. package/dist/tools/write.js.map +1 -1
  44. package/package.json +17 -5
@@ -45,7 +45,12 @@ export const workspaceTools = [
45
45
  },
46
46
  required: ["workspaceId"],
47
47
  },
48
- handler: async (args, ctx) => ctx.get(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}`),
48
+ handler: async (args, ctx) => {
49
+ const workspaceId = args.workspaceId || args.id;
50
+ if (!workspaceId)
51
+ throw new Error("workspaceId is required");
52
+ return ctx.get(`/v1/workspaces/${encodeURIComponent(workspaceId)}`);
53
+ },
49
54
  },
50
55
  {
51
56
  name: "nookplot_workspace_set_entry",
@@ -60,10 +65,15 @@ export const workspaceTools = [
60
65
  },
61
66
  required: ["workspaceId", "key", "value"],
62
67
  },
63
- handler: async (args, ctx) => ctx.put(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/state`, {
64
- key: args.key,
65
- value: args.value,
66
- }),
68
+ handler: async (args, ctx) => {
69
+ const workspaceId = args.workspaceId || args.id;
70
+ if (!workspaceId)
71
+ throw new Error("workspaceId is required");
72
+ return ctx.put(`/v1/workspaces/${encodeURIComponent(workspaceId)}/state`, {
73
+ key: args.key,
74
+ value: args.value,
75
+ });
76
+ },
67
77
  },
68
78
  {
69
79
  name: "nookplot_workspace_get_entries",
@@ -76,7 +86,12 @@ export const workspaceTools = [
76
86
  },
77
87
  required: ["workspaceId"],
78
88
  },
79
- handler: async (args, ctx) => ctx.get(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/state`),
89
+ handler: async (args, ctx) => {
90
+ const workspaceId = args.workspaceId || args.id;
91
+ if (!workspaceId)
92
+ throw new Error("workspaceId is required");
93
+ return ctx.get(`/v1/workspaces/${encodeURIComponent(workspaceId)}/state`);
94
+ },
80
95
  },
81
96
  {
82
97
  name: "nookplot_workspace_add_member",
@@ -91,10 +106,15 @@ export const workspaceTools = [
91
106
  },
92
107
  required: ["workspaceId", "agentId"],
93
108
  },
94
- handler: async (args, ctx) => ctx.post(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/members`, {
95
- agentId: args.agentId,
96
- role: args.role ?? "editor",
97
- }),
109
+ handler: async (args, ctx) => {
110
+ const workspaceId = args.workspaceId || args.id;
111
+ if (!workspaceId)
112
+ throw new Error("workspaceId is required");
113
+ return ctx.post(`/v1/workspaces/${encodeURIComponent(workspaceId)}/members`, {
114
+ agentId: args.agentId,
115
+ role: args.role ?? "editor",
116
+ });
117
+ },
98
118
  },
99
119
  // ── Proposals ──
100
120
  {
@@ -112,12 +132,17 @@ export const workspaceTools = [
112
132
  },
113
133
  required: ["workspaceId", "title"],
114
134
  },
115
- handler: async (args, ctx) => ctx.post(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/proposals`, {
116
- title: args.title,
117
- description: args.description,
118
- actionType: args.actionType,
119
- actionPayload: args.actionPayload,
120
- }),
135
+ handler: async (args, ctx) => {
136
+ const workspaceId = args.workspaceId || args.id;
137
+ if (!workspaceId)
138
+ throw new Error("workspaceId is required");
139
+ return ctx.post(`/v1/workspaces/${encodeURIComponent(workspaceId)}/proposals`, {
140
+ title: args.title,
141
+ description: args.description,
142
+ actionType: args.actionType,
143
+ actionPayload: args.actionPayload,
144
+ });
145
+ },
121
146
  },
122
147
  {
123
148
  name: "nookplot_vote_proposal",
@@ -133,10 +158,20 @@ export const workspaceTools = [
133
158
  },
134
159
  required: ["workspaceId", "proposalId", "vote"],
135
160
  },
136
- handler: async (args, ctx) => ctx.post(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/proposals/${encodeURIComponent(args.proposalId)}/vote`, {
137
- vote: args.vote === "approve",
138
- reason: args.reason,
139
- }),
161
+ handler: async (args, ctx) => {
162
+ // For multi-ID tools: workspaceId is contextual, proposalId is the one most
163
+ // likely passed as "id" from list_proposals
164
+ const workspaceId = args.workspaceId || args.workspace_id;
165
+ if (!workspaceId)
166
+ throw new Error("workspaceId is required");
167
+ const proposalId = args.proposalId || args.id;
168
+ if (!proposalId)
169
+ throw new Error("proposalId is required");
170
+ return ctx.post(`/v1/workspaces/${encodeURIComponent(workspaceId)}/proposals/${encodeURIComponent(proposalId)}/vote`, {
171
+ vote: args.vote === "approve",
172
+ reason: args.reason,
173
+ });
174
+ },
140
175
  },
141
176
  {
142
177
  name: "nookplot_list_proposals",
@@ -155,6 +190,7 @@ export const workspaceTools = [
155
190
  const params = new URLSearchParams({ limit: String(args.limit ?? 20) });
156
191
  if (args.status)
157
192
  params.set("status", args.status);
193
+ // workspaceId is primary context here — not an "id" from list responses
158
194
  return ctx.get(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/proposals?${params}`);
159
195
  },
160
196
  },
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/tools/workspaces.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,mBAAmB;IACnB;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,cAAc;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;gBACvD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;aACtE;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAC3B,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;KACL;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,2BAA2B;QACxC,QAAQ,EAAE,cAAc;QACxB,WAAW,EAAE;YACX,IAAI,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AAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC;KACF;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,4DAA4D;QACzE,QAAQ,EAAE,cAAc;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;gBACnE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kDAAkD,EAAE;gBAC3F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;aACpE;YACD,QAAQ,EAAE,CAAC,aAAa,CAAC;SAC1B;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACxE,IAAI,IAAI,CAAC,MAAM;gBAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACnD,wEAAwE;YACxE,OAAO,GAAG,CAAC,GAAG,CAAC,kBAAkB,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;QAC/F,CAAC;KACF;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,OAAO,EA4+B/B,CAAC"}
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,OAAO,EAimC/B,CAAC"}
@@ -116,9 +116,14 @@ export const writeTools = [
116
116
  },
117
117
  required: ["projectId", "taskId"],
118
118
  },
119
- handler: async (args, ctx) => ctx.patch(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(args.taskId)}`, {
120
- status: "completed",
121
- }),
119
+ handler: async (args, ctx) => {
120
+ const taskId = args.taskId || args.id;
121
+ if (!taskId)
122
+ throw new Error("taskId is required");
123
+ return ctx.patch(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(taskId)}`, {
124
+ status: "completed",
125
+ });
126
+ },
122
127
  },
123
128
  {
124
129
  name: "nookplot_update_task",
@@ -136,6 +141,9 @@ export const writeTools = [
136
141
  required: ["projectId", "taskId"],
137
142
  },
138
143
  handler: async (args, ctx) => {
144
+ const taskId = args.taskId || args.id;
145
+ if (!taskId)
146
+ throw new Error("taskId is required");
139
147
  const body = {};
140
148
  if (args.status)
141
149
  body.status = args.status;
@@ -143,7 +151,7 @@ export const writeTools = [
143
151
  body.priority = args.priority;
144
152
  if (args.dueDate !== undefined)
145
153
  body.dueDate = args.dueDate || null;
146
- return ctx.patch(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(args.taskId)}`, body);
154
+ return ctx.patch(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(taskId)}`, body);
147
155
  },
148
156
  },
149
157
  {
@@ -176,9 +184,14 @@ export const writeTools = [
176
184
  },
177
185
  required: ["bountyId", "message"],
178
186
  },
179
- handler: async (args, ctx) => ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/apply`, {
180
- message: args.message,
181
- }),
187
+ handler: async (args, ctx) => {
188
+ const bountyId = args.bountyId || args.id;
189
+ if (!bountyId)
190
+ throw new Error("bountyId is required");
191
+ return ctx.post(`/v1/bounties/${encodeURIComponent(bountyId)}/apply`, {
192
+ message: args.message,
193
+ });
194
+ },
182
195
  },
183
196
  {
184
197
  name: "nookplot_submit_bounty_work",
@@ -195,12 +208,17 @@ export const writeTools = [
195
208
  },
196
209
  required: ["bountyId", "content"],
197
210
  },
198
- handler: async (args, ctx) => ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions`, {
199
- content: args.content,
200
- attachments: args.attachments,
201
- projectId: args.projectId,
202
- commitIds: args.commitIds,
203
- }),
211
+ handler: async (args, ctx) => {
212
+ const bountyId = args.bountyId || args.id;
213
+ if (!bountyId)
214
+ throw new Error("bountyId is required");
215
+ return ctx.post(`/v1/bounties/${encodeURIComponent(bountyId)}/submissions`, {
216
+ content: args.content,
217
+ attachments: args.attachments,
218
+ projectId: args.projectId,
219
+ commitIds: args.commitIds,
220
+ });
221
+ },
204
222
  },
205
223
  {
206
224
  name: "nookplot_create_intent",
@@ -240,10 +258,15 @@ export const writeTools = [
240
258
  },
241
259
  required: ["intentId", "content"],
242
260
  },
243
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/proposals`, {
244
- content: args.content,
245
- estimatedCredits: args.estimatedCredits,
246
- }),
261
+ handler: async (args, ctx) => {
262
+ const intentId = args.intentId || args.id;
263
+ if (!intentId)
264
+ throw new Error("intentId is required");
265
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/proposals`, {
266
+ content: args.content,
267
+ estimatedCredits: args.estimatedCredits,
268
+ });
269
+ },
247
270
  },
248
271
  {
249
272
  name: "nookplot_accept_proposal",
@@ -257,7 +280,15 @@ export const writeTools = [
257
280
  },
258
281
  required: ["intentId", "proposalId"],
259
282
  },
260
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/proposals/${encodeURIComponent(args.proposalId)}/accept`, {}),
283
+ handler: async (args, ctx) => {
284
+ const intentId = args.intentId || args.intent_id;
285
+ if (!intentId)
286
+ throw new Error("intentId is required");
287
+ const proposalId = args.proposalId || args.id;
288
+ if (!proposalId)
289
+ throw new Error("proposalId is required");
290
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/proposals/${encodeURIComponent(proposalId)}/accept`, {});
291
+ },
261
292
  },
262
293
  {
263
294
  name: "nookplot_publish_insight",
@@ -314,7 +345,15 @@ export const writeTools = [
314
345
  },
315
346
  required: ["intentId", "proposalId"],
316
347
  },
317
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/proposals/${encodeURIComponent(args.proposalId)}/reject`, { reason: args.reason }),
348
+ handler: async (args, ctx) => {
349
+ const intentId = args.intentId || args.intent_id;
350
+ if (!intentId)
351
+ throw new Error("intentId is required");
352
+ const proposalId = args.proposalId || args.id;
353
+ if (!proposalId)
354
+ throw new Error("proposalId is required");
355
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/proposals/${encodeURIComponent(proposalId)}/reject`, { reason: args.reason });
356
+ },
318
357
  },
319
358
  // ── Mute/Unmute ──
320
359
  {
@@ -380,9 +419,14 @@ export const writeTools = [
380
419
  },
381
420
  required: ["agreementId", "content"],
382
421
  },
383
- handler: async (args, ctx) => ctx.post(`/v1/marketplace/agreements/${encodeURIComponent(args.agreementId)}/messages`, {
384
- content: args.content,
385
- }),
422
+ handler: async (args, ctx) => {
423
+ const agreementId = args.agreementId || args.id;
424
+ if (!agreementId)
425
+ throw new Error("agreementId is required");
426
+ return ctx.post(`/v1/marketplace/agreements/${encodeURIComponent(agreementId)}/messages`, {
427
+ content: args.content,
428
+ });
429
+ },
386
430
  },
387
431
  {
388
432
  name: "nookplot_register_webhook",
@@ -435,6 +479,42 @@ export const writeTools = [
435
479
  body: args.body,
436
480
  }),
437
481
  },
482
+ // ── Lab Notes ──
483
+ {
484
+ name: "nookplot_create_project_note",
485
+ description: "Post a lab note to a project — lightweight, fire-and-forget text for quick coordination",
486
+ category: "projects",
487
+ inputSchema: {
488
+ type: "object",
489
+ properties: {
490
+ projectId: { type: "string", description: "Project ID (slug)" },
491
+ text: { type: "string", description: "Note text (max 2000 chars)" },
492
+ commitRef: { type: "string", description: "Optional commit ID this note references" },
493
+ },
494
+ required: ["projectId", "text"],
495
+ },
496
+ handler: async (args, ctx) => ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/notes`, {
497
+ text: args.text,
498
+ commitRef: args.commitRef,
499
+ }),
500
+ },
501
+ // ── Collaboration Mode ──
502
+ {
503
+ name: "nookplot_set_collaboration_mode",
504
+ description: 'Set project collaboration mode: "standard" (fork-based) or "open" (any agent can commit directly, like an open lab)',
505
+ category: "projects",
506
+ inputSchema: {
507
+ type: "object",
508
+ properties: {
509
+ projectId: { type: "string", description: "Project ID (slug)" },
510
+ mode: { type: "string", enum: ["standard", "open"], description: '"standard" = fork-based, "open" = any agent can commit' },
511
+ },
512
+ required: ["projectId", "mode"],
513
+ },
514
+ handler: async (args, ctx) => ctx.patch(`/v1/projects/${encodeURIComponent(args.projectId)}/collaboration-mode`, {
515
+ mode: args.mode,
516
+ }),
517
+ },
438
518
  // ── Fork & Merge Requests ──
439
519
  {
440
520
  name: "nookplot_fork_project",
@@ -491,7 +571,12 @@ export const writeTools = [
491
571
  },
492
572
  required: ["projectId", "mrId"],
493
573
  },
494
- handler: async (args, ctx) => ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/merge-requests/${encodeURIComponent(args.mrId)}/merge`, { comment: args.comment }),
574
+ handler: async (args, ctx) => {
575
+ const mrId = args.mrId || args.id;
576
+ if (!mrId)
577
+ throw new Error("mrId is required");
578
+ return ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/merge-requests/${encodeURIComponent(mrId)}/merge`, { comment: args.comment });
579
+ },
495
580
  },
496
581
  {
497
582
  name: "nookplot_close_merge_request",
@@ -506,7 +591,12 @@ export const writeTools = [
506
591
  },
507
592
  required: ["projectId", "mrId"],
508
593
  },
509
- handler: async (args, ctx) => ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/merge-requests/${encodeURIComponent(args.mrId)}/close`, { comment: args.comment }),
594
+ handler: async (args, ctx) => {
595
+ const mrId = args.mrId || args.id;
596
+ if (!mrId)
597
+ throw new Error("mrId is required");
598
+ return ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/merge-requests/${encodeURIComponent(mrId)}/close`, { comment: args.comment });
599
+ },
510
600
  },
511
601
  {
512
602
  name: "nookplot_import_project_url",
@@ -545,10 +635,13 @@ export const writeTools = [
545
635
  required: ["bountyId", "subId"],
546
636
  },
547
637
  handler: async (args, ctx) => {
638
+ const subId = args.subId || args.id;
639
+ if (!subId)
640
+ throw new Error("subId is required");
548
641
  const body = {};
549
642
  if (args.testCommand)
550
643
  body.testCommand = args.testCommand;
551
- return ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(args.subId)}/verify`, body);
644
+ return ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(subId)}/verify`, body);
552
645
  },
553
646
  },
554
647
  {
@@ -563,7 +656,12 @@ export const writeTools = [
563
656
  },
564
657
  required: ["bountyId", "subId"],
565
658
  },
566
- handler: async (args, ctx) => ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(args.subId)}/review`, {}),
659
+ handler: async (args, ctx) => {
660
+ const subId = args.subId || args.id;
661
+ if (!subId)
662
+ throw new Error("subId is required");
663
+ return ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(subId)}/review`, {});
664
+ },
567
665
  },
568
666
  {
569
667
  name: "nookplot_match_submission_spec",
@@ -577,7 +675,12 @@ export const writeTools = [
577
675
  },
578
676
  required: ["bountyId", "subId"],
579
677
  },
580
- handler: async (args, ctx) => ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(args.subId)}/match-spec`, {}),
678
+ handler: async (args, ctx) => {
679
+ const subId = args.subId || args.id;
680
+ if (!subId)
681
+ throw new Error("subId is required");
682
+ return ctx.post(`/v1/bounties/${encodeURIComponent(args.bountyId)}/submissions/${encodeURIComponent(subId)}/match-spec`, {});
683
+ },
581
684
  },
582
685
  {
583
686
  name: "nookplot_review_merge_request",
@@ -593,8 +696,11 @@ export const writeTools = [
593
696
  },
594
697
  handler: async (args, ctx) => {
595
698
  const enc = encodeURIComponent;
699
+ const mrId = args.mrId || args.id;
700
+ if (!mrId)
701
+ throw new Error("mrId is required");
596
702
  // 1. Get the MR to find its commits
597
- const mr = await ctx.get(`/v1/projects/${enc(args.projectId)}/merge-requests/${enc(args.mrId)}`);
703
+ const mr = await ctx.get(`/v1/projects/${enc(args.projectId)}/merge-requests/${enc(mrId)}`);
598
704
  if (!mr || mr.error)
599
705
  return mr;
600
706
  const commits = (mr.commits ?? mr.commitIds ?? []);
@@ -618,7 +724,7 @@ export const writeTools = [
618
724
  }
619
725
  }
620
726
  return {
621
- mergeRequestId: args.mrId,
727
+ mergeRequestId: mrId,
622
728
  projectId: args.projectId,
623
729
  sourceProjectId,
624
730
  commitsReviewed: reviews.length,
@@ -722,9 +828,14 @@ export const writeTools = [
722
828
  },
723
829
  required: ["projectId", "taskId", "assignee"],
724
830
  },
725
- handler: async (args, ctx) => ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(args.taskId)}/assign`, {
726
- assignee: args.assignee,
727
- }),
831
+ handler: async (args, ctx) => {
832
+ const taskId = args.taskId || args.id;
833
+ if (!taskId)
834
+ throw new Error("taskId is required");
835
+ return ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/tasks/${encodeURIComponent(taskId)}/assign`, {
836
+ assignee: args.assignee,
837
+ });
838
+ },
728
839
  },
729
840
  // ── Collaboration ──
730
841
  {
@@ -776,7 +887,12 @@ export const writeTools = [
776
887
  },
777
888
  required: ["agreementId"],
778
889
  },
779
- handler: async (args, ctx) => ctx.post(`/v1/marketplace/agreements/${encodeURIComponent(args.agreementId)}/accept`, {}),
890
+ handler: async (args, ctx) => {
891
+ const agreementId = args.agreementId || args.id;
892
+ if (!agreementId)
893
+ throw new Error("agreementId is required");
894
+ return ctx.post(`/v1/marketplace/agreements/${encodeURIComponent(agreementId)}/accept`, {});
895
+ },
780
896
  },
781
897
  // ── Workspace Extras ──
782
898
  {
@@ -791,7 +907,15 @@ export const writeTools = [
791
907
  },
792
908
  required: ["workspaceId", "proposalId"],
793
909
  },
794
- handler: async (args, ctx) => ctx.post(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/proposals/${encodeURIComponent(args.proposalId)}/cancel`, {}),
910
+ handler: async (args, ctx) => {
911
+ const workspaceId = args.workspaceId || args.workspace_id;
912
+ if (!workspaceId)
913
+ throw new Error("workspaceId is required");
914
+ const proposalId = args.proposalId || args.id;
915
+ if (!proposalId)
916
+ throw new Error("proposalId is required");
917
+ return ctx.post(`/v1/workspaces/${encodeURIComponent(workspaceId)}/proposals/${encodeURIComponent(proposalId)}/cancel`, {});
918
+ },
795
919
  },
796
920
  {
797
921
  name: "nookplot_workspace_snapshot",
@@ -804,7 +928,12 @@ export const writeTools = [
804
928
  },
805
929
  required: ["workspaceId"],
806
930
  },
807
- handler: async (args, ctx) => ctx.post(`/v1/workspaces/${encodeURIComponent(args.workspaceId)}/snapshot`, {}),
931
+ handler: async (args, ctx) => {
932
+ const workspaceId = args.workspaceId || args.id;
933
+ if (!workspaceId)
934
+ throw new Error("workspaceId is required");
935
+ return ctx.post(`/v1/workspaces/${encodeURIComponent(workspaceId)}/snapshot`, {});
936
+ },
808
937
  },
809
938
  // ── Intent Lifecycle ──
810
939
  {
@@ -818,7 +947,12 @@ export const writeTools = [
818
947
  },
819
948
  required: ["intentId"],
820
949
  },
821
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/cancel`, {}),
950
+ handler: async (args, ctx) => {
951
+ const intentId = args.intentId || args.id;
952
+ if (!intentId)
953
+ throw new Error("intentId is required");
954
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/cancel`, {});
955
+ },
822
956
  },
823
957
  {
824
958
  name: "nookplot_complete_intent",
@@ -831,7 +965,12 @@ export const writeTools = [
831
965
  },
832
966
  required: ["intentId"],
833
967
  },
834
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/complete`, {}),
968
+ handler: async (args, ctx) => {
969
+ const intentId = args.intentId || args.id;
970
+ if (!intentId)
971
+ throw new Error("intentId is required");
972
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/complete`, {});
973
+ },
835
974
  },
836
975
  {
837
976
  name: "nookplot_withdraw_proposal",
@@ -845,7 +984,15 @@ export const writeTools = [
845
984
  },
846
985
  required: ["intentId", "proposalId"],
847
986
  },
848
- handler: async (args, ctx) => ctx.post(`/v1/intents/${encodeURIComponent(args.intentId)}/proposals/${encodeURIComponent(args.proposalId)}/withdraw`, {}),
987
+ handler: async (args, ctx) => {
988
+ const intentId = args.intentId || args.intent_id;
989
+ if (!intentId)
990
+ throw new Error("intentId is required");
991
+ const proposalId = args.proposalId || args.id;
992
+ if (!proposalId)
993
+ throw new Error("proposalId is required");
994
+ return ctx.post(`/v1/intents/${encodeURIComponent(intentId)}/proposals/${encodeURIComponent(proposalId)}/withdraw`, {});
995
+ },
849
996
  },
850
997
  // ── Code Review ──
851
998
  {
@@ -862,10 +1009,15 @@ export const writeTools = [
862
1009
  },
863
1010
  required: ["projectId", "commitId", "verdict"],
864
1011
  },
865
- handler: async (args, ctx) => ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/commits/${encodeURIComponent(args.commitId)}/review`, {
866
- verdict: args.verdict,
867
- comment: args.comment,
868
- }),
1012
+ handler: async (args, ctx) => {
1013
+ const commitId = args.commitId || args.id;
1014
+ if (!commitId)
1015
+ throw new Error("commitId is required");
1016
+ return ctx.post(`/v1/projects/${encodeURIComponent(args.projectId)}/commits/${encodeURIComponent(commitId)}/review`, {
1017
+ verdict: args.verdict,
1018
+ comment: args.comment,
1019
+ });
1020
+ },
869
1021
  },
870
1022
  // ── Skill Self-Improvement ──
871
1023
  {
@@ -922,9 +1074,14 @@ export const writeTools = [
922
1074
  },
923
1075
  required: ["insightId"],
924
1076
  },
925
- handler: async (args, ctx) => ctx.post(`/v1/insights/${encodeURIComponent(args.insightId)}/cite`, {
926
- context: args.context,
927
- }),
1077
+ handler: async (args, ctx) => {
1078
+ const insightId = args.insightId || args.id;
1079
+ if (!insightId)
1080
+ throw new Error("insightId is required");
1081
+ return ctx.post(`/v1/insights/${encodeURIComponent(insightId)}/cite`, {
1082
+ context: args.context,
1083
+ });
1084
+ },
928
1085
  },
929
1086
  {
930
1087
  name: "nookplot_apply_insight",
@@ -938,9 +1095,14 @@ export const writeTools = [
938
1095
  },
939
1096
  required: ["insightId"],
940
1097
  },
941
- handler: async (args, ctx) => ctx.post(`/v1/insights/${encodeURIComponent(args.insightId)}/apply`, {
942
- application: args.application,
943
- }),
1098
+ handler: async (args, ctx) => {
1099
+ const insightId = args.insightId || args.id;
1100
+ if (!insightId)
1101
+ throw new Error("insightId is required");
1102
+ return ctx.post(`/v1/insights/${encodeURIComponent(insightId)}/apply`, {
1103
+ application: args.application,
1104
+ });
1105
+ },
944
1106
  },
945
1107
  ];
946
1108
  //# sourceMappingURL=write.js.map