@monnet/mcp 0.4.1 → 0.7.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 (48) hide show
  1. package/README.md +25 -4
  2. package/dist/client.d.ts +12 -0
  3. package/dist/client.js +14 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/index.js +3 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/instructions.js +1 -1
  8. package/dist/motion-detail.d.ts +56 -0
  9. package/dist/motion-detail.js +24 -0
  10. package/dist/motion-detail.js.map +1 -0
  11. package/dist/registry.d.ts +2 -1
  12. package/dist/registry.js +9 -3
  13. package/dist/registry.js.map +1 -1
  14. package/dist/rendering/inbox.d.ts +9 -2
  15. package/dist/rendering/inbox.js +41 -21
  16. package/dist/rendering/inbox.js.map +1 -1
  17. package/dist/rendering/motion.d.ts +11 -7
  18. package/dist/rendering/motion.js +30 -15
  19. package/dist/rendering/motion.js.map +1 -1
  20. package/dist/rendering/plan.d.ts +50 -0
  21. package/dist/rendering/plan.js +85 -0
  22. package/dist/rendering/plan.js.map +1 -0
  23. package/dist/tool-result.d.ts +20 -0
  24. package/dist/tool-result.js +12 -0
  25. package/dist/tool-result.js.map +1 -0
  26. package/dist/tools/approve.d.ts +1 -2
  27. package/dist/tools/approve.js +11 -12
  28. package/dist/tools/approve.js.map +1 -1
  29. package/dist/tools/{create-motion.d.ts → create-thread.d.ts} +2 -2
  30. package/dist/tools/create-thread.js +45 -0
  31. package/dist/tools/create-thread.js.map +1 -0
  32. package/dist/tools/get-inbox.d.ts +9 -0
  33. package/dist/tools/get-inbox.js +36 -14
  34. package/dist/tools/get-inbox.js.map +1 -1
  35. package/dist/tools/get-motion.js +5 -5
  36. package/dist/tools/get-motion.js.map +1 -1
  37. package/dist/tools/list-workspaces.js +1 -1
  38. package/dist/tools/read-motion-file.d.ts +28 -0
  39. package/dist/tools/read-motion-file.js +131 -0
  40. package/dist/tools/read-motion-file.js.map +1 -0
  41. package/dist/tools/reject.d.ts +1 -2
  42. package/dist/tools/reject.js +13 -12
  43. package/dist/tools/reject.js.map +1 -1
  44. package/dist/tools/update-motion.js +17 -2
  45. package/dist/tools/update-motion.js.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/tools/create-motion.js +0 -41
  48. package/dist/tools/create-motion.js.map +0 -1
@@ -1,26 +1,28 @@
1
1
  import { z } from "zod";
2
2
  import { apiFetch, resolveWorkspaceId } from "../client.js";
3
+ import { parsePlanPath } from "../rendering/plan.js";
3
4
  const RejectArgs = z.object({
4
5
  workspace_slug: z.string().min(1),
5
6
  motion_short_id: z.string().min(1),
6
- step_index: z.number().int().min(0),
7
+ step_path: z.string().min(1),
7
8
  reason: z.string().max(2000).optional(),
8
9
  });
9
10
  export async function handleReject(args) {
10
- const { workspace_slug, motion_short_id, step_index, reason } = RejectArgs.parse(args);
11
+ const { workspace_slug, motion_short_id, step_path, reason } = RejectArgs.parse(args);
11
12
  const wsId = await resolveWorkspaceId(workspace_slug);
12
- const result = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/plan/steps/${step_index}/reject`, {
13
+ const path = parsePlanPath(step_path);
14
+ const result = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/plan/reject`, {
13
15
  method: "POST",
14
- body: JSON.stringify({ reason: reason || "" }),
16
+ body: JSON.stringify({ path, reason: reason || "" }),
15
17
  });
16
18
  return result.ok
17
- ? `Step ${step_index} rejected${reason ? ` (reason: ${reason})` : ""}. Plan now has ${result.plan.length} step(s).`
19
+ ? `Step ${step_path} rejected${reason ? ` (reason: ${reason})` : ""}.`
18
20
  : "Rejection failed.";
19
21
  }
20
22
  export const REJECT_TOOL_DEFINITION = {
21
23
  name: "reject",
22
24
  description: "Reject a plan step on a motion, with an optional reason. Requires editor role on the motion. " +
23
- "Use get_motion first to see the plan and identify the step_index (0-based).",
25
+ "Use get_motion first to see the plan and read the step's number.",
24
26
  inputSchema: {
25
27
  type: "object",
26
28
  properties: {
@@ -32,17 +34,16 @@ export const REJECT_TOOL_DEFINITION = {
32
34
  type: "string",
33
35
  description: "The first 8 characters of the motion UUID.",
34
36
  },
35
- step_index: {
36
- type: "integer",
37
- description: "0-based index of the plan step to reject.",
38
- minimum: 0,
37
+ step_path: {
38
+ type: "string",
39
+ description: "The step's number as get_motion prints it: \"2\" for a top-level step, \"1.2\" for the second step inside the first group.",
39
40
  },
40
41
  reason: {
41
42
  type: "string",
42
- description: "Optional reason for rejection (max 2,000 chars).",
43
+ description: "Why it is rejected (max 2,000 chars). Left empty, Monnet asks the user for the explanation.",
43
44
  },
44
45
  },
45
- required: ["workspace_slug", "motion_short_id", "step_index"],
46
+ required: ["workspace_slug", "motion_short_id", "step_path"],
46
47
  },
47
48
  };
48
49
  //# sourceMappingURL=reject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reject.js","sourceRoot":"","sources":["../../src/tools/reject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAa;IAC9C,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,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AAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,+FAA+F;QAC/F,kEAAkE;IACpE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4HAA4H;aAC/H;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6FAA6F;aAChG;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,CAAC;KAC7D;CACF,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { apiFetch, resolveWorkspaceId } from "../client.js";
3
+ import { isTreePlan } from "../rendering/plan.js";
3
4
  const PlanStepSchema = z.object({
4
5
  content: z.string(),
5
6
  status: z.enum(["pending", "in_progress", "done"]),
@@ -35,8 +36,21 @@ export async function handleUpdateMotion(args) {
35
36
  });
36
37
  results.push(`Updated ${Object.keys(metaFields).join(", ")}.`);
37
38
  }
38
- // Update plan if provided
39
+ // Update plan if provided. This endpoint replaces the plan wholesale with a
40
+ // flat list, which is all it has ever accepted — so it cannot express a plan
41
+ // that has groups, and writing over one would silently drop the grouping,
42
+ // the step ids, and the approvals and dates hanging off them. Refuse instead
43
+ // of destroying it, and point at the two paths that edit such a plan safely.
39
44
  if (parsed.plan) {
45
+ const detail = await apiFetch(`${motionPath}/detail`);
46
+ if (isTreePlan(detail.motion.plan)) {
47
+ // Pushed rather than returned: the metadata PATCH above has already
48
+ // happened, and swallowing it would leave the caller thinking nothing did.
49
+ results.push("Plan NOT updated: this motion's plan is a structured tree (groups, step types, ids) " +
50
+ "and this tool can only write a flat list of steps — sending one would drop that " +
51
+ "structure. Ask Monnet to make the change with ask_monnet, or edit the plan in the app.");
52
+ return results.join(" ");
53
+ }
40
54
  await apiFetch(`${motionPath}/plan`, {
41
55
  method: "PATCH",
42
56
  body: JSON.stringify({ steps: parsed.plan }),
@@ -52,7 +66,8 @@ export const UPDATE_MOTION_TOOL_DEFINITION = {
52
66
  name: "update_motion",
53
67
  description: "Update a motion's summary, body, priority, or plan. All fields are optional — " +
54
68
  "only include the ones you want to change. For plan updates, provide the full list " +
55
- "of steps (use get_motion first to see the current plan, then modify and send it back).",
69
+ "of steps (use get_motion first to see the current plan, then modify and send it back). " +
70
+ "A plan with groups cannot be written here: ask Monnet with ask_monnet instead.",
56
71
  inputSchema: {
57
72
  type: "object",
58
73
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"update-motion.js","sourceRoot":"","sources":["../../src/tools/update-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,gBAAgB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CAAC;aACpC;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,6HAA6H;gBAC/H,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE;wBACpE,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;wBACvD,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;wBAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;qBAC1D;oBACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;iBAChC;aACF;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAChD;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monnet/mcp",
3
- "version": "0.4.1",
3
+ "version": "0.7.0",
4
4
  "description": "Model Context Protocol server for Monnet — exposes motions, plans, and approvals to MCP-compatible clients like Claude Desktop and Cursor.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "dev": "tsc -p . --watch",
16
16
  "start": "node dist/index.js",
17
17
  "prepublishOnly": "npm run build",
18
- "test": "tsc -p tsconfig.test.json && node --test dist-test/**/*.test.js"
18
+ "test": "tsc -p tsconfig.test.json && node --test \"dist-test/**/*.test.js\""
19
19
  },
20
20
  "dependencies": {
21
21
  "@modelcontextprotocol/sdk": "^1.13.0",
@@ -1,41 +0,0 @@
1
- import { z } from "zod";
2
- import { apiFetch, resolveWorkspaceId } from "../client.js";
3
- const CreateMotionArgs = z.object({
4
- workspace_slug: z.string().min(1),
5
- prompt: z.string().min(1).max(10000),
6
- });
7
- export async function handleCreateMotion(args) {
8
- const { workspace_slug, prompt } = CreateMotionArgs.parse(args);
9
- const wsId = await resolveWorkspaceId(workspace_slug);
10
- const motion = await apiFetch(`/workspaces/${wsId}/motions/generate`, {
11
- method: "POST",
12
- body: JSON.stringify({ prompt }),
13
- });
14
- return JSON.stringify({
15
- id: motion.id,
16
- short_id: motion.id.slice(0, 8),
17
- summary: motion.summary,
18
- status: motion.status,
19
- url: `https://app.monnet.ai/${workspace_slug}/motions/${motion.id.slice(0, 8)}`,
20
- note: "Motion is being drafted in the background — call get_motion after a few seconds to read the summary, body, and plan.",
21
- }, null, 2);
22
- }
23
- export const CREATE_MOTION_TOOL_DEFINITION = {
24
- name: "create_motion",
25
- description: "Create a new draft motion in a Monnet workspace from a free-form prompt. Returns the new motion's id and URL immediately — a background Monnet run drafts the summary, body, and plan over the next few seconds. Call `get_motion` with the returned short_id to inspect the draft.",
26
- inputSchema: {
27
- type: "object",
28
- properties: {
29
- workspace_slug: {
30
- type: "string",
31
- description: "The workspace slug (e.g. 'monnet-team-410b').",
32
- },
33
- prompt: {
34
- type: "string",
35
- description: "What the motion should accomplish, in the user's own words plus any relevant context. Substance matters — the background Monnet run drafts the full motion from this.",
36
- },
37
- },
38
- required: ["workspace_slug", "prompt"],
39
- },
40
- };
41
- //# sourceMappingURL=create-motion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-motion.js","sourceRoot":"","sources":["../../src/tools/create-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,MAA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