@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
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Plan rendering — the one place that knows the shape of a motion's plan.
3
+ *
4
+ * A plan is a tree (V2) : each item is either a step (one assignee, a
5
+ * step_type) or a group holding children, run in parallel or in sequence.
6
+ * Older motions still hold the flat V1 shape (`assignees[]`, `approval`), so
7
+ * both are read here and rendered the same way — a reader that walked only the
8
+ * top level printed `undefined` for a group and never showed the steps inside
9
+ * it, which is exactly the state the people on those steps needed to see.
10
+ *
11
+ * Numbering is hierarchical and 1-based (`1.`, `1.1.`, `1.2.`) because it is
12
+ * also the address a client passes back to `approve` / `reject`.
13
+ */
14
+ const STATUS_ICONS = {
15
+ pending: "⏳",
16
+ in_progress: "🔄",
17
+ done: "✅",
18
+ skipped: "⏭️",
19
+ };
20
+ export function isGroup(item) {
21
+ return item.kind === "group" || Array.isArray(item.children);
22
+ }
23
+ /** True when the plan uses the tree shape — one `kind` is enough to tell. */
24
+ export function isTreePlan(plan) {
25
+ return (Array.isArray(plan) &&
26
+ plan.some((item) => item && typeof item === "object" && "kind" in item));
27
+ }
28
+ /** The single assignee of a step, reading both shapes. */
29
+ function assigneeOf(step) {
30
+ if (step.assignee)
31
+ return step.assignee;
32
+ return (step.assignees || []).find((a) => a) || null;
33
+ }
34
+ /** Non-task types worth naming; `approval` keeps its lock, as it always had. */
35
+ function typeSuffix(step) {
36
+ const type = step.step_type || (step.approval ? "approval" : "task");
37
+ if (type === "approval")
38
+ return " 🔒";
39
+ return type === "task" ? "" : ` [${type}]`;
40
+ }
41
+ function renderStep(step, label, indent, nameMap) {
42
+ const icon = STATUS_ICONS[step.status] || "⏳";
43
+ const assignee = assigneeOf(step);
44
+ const assigneeStr = assignee ? ` → ${nameMap.get(assignee) || assignee}` : "";
45
+ const due = step.due_date ? ` (due ${step.due_date})` : "";
46
+ return `${indent}${label}. ${icon} ${step.content}${assigneeStr}${typeSuffix(step)}${due}`;
47
+ }
48
+ /**
49
+ * One line per item, children indented under their group. `prefix` carries the
50
+ * parent's number so a child reads `1.2.`; `depth` only drives indentation.
51
+ */
52
+ export function renderPlanItems(items, nameMap, prefix = "", depth = 0) {
53
+ const indent = " ".repeat(depth + 1);
54
+ const lines = [];
55
+ items.forEach((item, i) => {
56
+ const label = `${prefix}${i + 1}`;
57
+ if (isGroup(item)) {
58
+ lines.push(`${indent}${label}. 📂 ${item.title} (${item.execution})`);
59
+ lines.push(...renderPlanItems(item.children || [], nameMap, `${label}.`, depth + 1));
60
+ }
61
+ else {
62
+ lines.push(renderStep(item, label, indent, nameMap));
63
+ }
64
+ });
65
+ return lines;
66
+ }
67
+ /**
68
+ * The reverse of the numbering above : turn the label a client read in
69
+ * `get_motion` ("1.2") into the 0-based index path the API addresses a step
70
+ * with ([0, 1]). Kept beside the renderer on purpose — the label format and
71
+ * its parser are one convention, and they drift apart the moment they live in
72
+ * two files.
73
+ */
74
+ export function parsePlanPath(label) {
75
+ const trimmed = label.trim().replace(/\.$/, "");
76
+ if (!/^\d+(\.\d+)*$/.test(trimmed)) {
77
+ throw new Error(`Invalid step path "${label}". Use the number shown in get_motion, e.g. "2" for a top-level step or "1.2" for the second step of the first group.`);
78
+ }
79
+ const path = trimmed.split(".").map((part) => Number(part) - 1);
80
+ if (path.some((index) => index < 0)) {
81
+ throw new Error(`Invalid step path "${label}". Step numbers start at 1.`);
82
+ }
83
+ return path;
84
+ }
85
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/rendering/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,YAAY,GAA2B;IAC3C,OAAO,EAAE,GAAG;I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AC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,uHAAuH,CACnJ,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,6BAA6B,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What a tool handler may hand back.
3
+ *
4
+ * It was `string` until a tool had to return an image: a screenshot attached to
5
+ * a motion is the one thing whose description is worth less than the thing
6
+ * itself. Every other handler keeps returning a plain string and is untouched —
7
+ * `toContentBlocks` is what makes both shapes reach the client the same way.
8
+ */
9
+ export type ToolTextBlock = {
10
+ type: "text";
11
+ text: string;
12
+ };
13
+ export type ToolImageBlock = {
14
+ type: "image";
15
+ data: string;
16
+ mimeType: string;
17
+ };
18
+ export type ToolContent = ToolTextBlock | ToolImageBlock;
19
+ export type ToolResult = string | ToolContent[];
20
+ export declare function toContentBlocks(result: ToolResult): ToolContent[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * What a tool handler may hand back.
3
+ *
4
+ * It was `string` until a tool had to return an image: a screenshot attached to
5
+ * a motion is the one thing whose description is worth less than the thing
6
+ * itself. Every other handler keeps returning a plain string and is untouched —
7
+ * `toContentBlocks` is what makes both shapes reach the client the same way.
8
+ */
9
+ export function toContentBlocks(result) {
10
+ return typeof result === "string" ? [{ type: "text", text: result }] : result;
11
+ }
12
+ //# sourceMappingURL=tool-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-result.js","sourceRoot":"","sources":["../src/tool-result.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,UAAU,eAAe,CAAC,MAAkB;IAChD,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAChF,CAAC"}
@@ -13,10 +13,9 @@ export declare const APPROVE_TOOL_DEFINITION: {
13
13
  type: string;
14
14
  description: string;
15
15
  };
16
- step_index: {
16
+ step_path: {
17
17
  type: string;
18
18
  description: string;
19
- minimum: number;
20
19
  };
21
20
  };
22
21
  required: string[];
@@ -1,22 +1,22 @@
1
1
  import { z } from "zod";
2
2
  import { apiFetch, resolveWorkspaceId } from "../client.js";
3
+ import { parsePlanPath } from "../rendering/plan.js";
3
4
  const ApproveArgs = 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
  });
8
9
  export async function handleApprove(args) {
9
- const { workspace_slug, motion_short_id, step_index } = ApproveArgs.parse(args);
10
+ const { workspace_slug, motion_short_id, step_path } = ApproveArgs.parse(args);
10
11
  const wsId = await resolveWorkspaceId(workspace_slug);
11
- const result = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/plan/steps/${step_index}/approve`, { method: "POST" });
12
- return result.ok
13
- ? `Step ${step_index} approved. Plan now has ${result.plan.length} step(s).`
14
- : "Approval failed.";
12
+ const path = parsePlanPath(step_path);
13
+ const result = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/plan/approve`, { method: "POST", body: JSON.stringify({ path }) });
14
+ return result.ok ? `Step ${step_path} approved.` : "Approval failed.";
15
15
  }
16
16
  export const APPROVE_TOOL_DEFINITION = {
17
17
  name: "approve",
18
18
  description: "Approve a plan step on a motion. Requires editor role on the motion. " +
19
- "Use get_motion first to see the plan and identify the step_index (0-based).",
19
+ "Use get_motion first to see the plan and read the step's number.",
20
20
  inputSchema: {
21
21
  type: "object",
22
22
  properties: {
@@ -28,13 +28,12 @@ export const APPROVE_TOOL_DEFINITION = {
28
28
  type: "string",
29
29
  description: "The first 8 characters of the motion UUID.",
30
30
  },
31
- step_index: {
32
- type: "integer",
33
- description: "0-based index of the plan step to approve.",
34
- minimum: 0,
31
+ step_path: {
32
+ type: "string",
33
+ 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.",
35
34
  },
36
35
  },
37
- required: ["workspace_slug", "motion_short_id", "step_index"],
36
+ required: ["workspace_slug", "motion_short_id", "step_path"],
38
37
  },
39
38
  };
40
39
  //# sourceMappingURL=approve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approve.js","sourceRoot":"","sources":["../../src/tools/approve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,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,EA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AAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4HAA4H;aAC/H;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,CAAC;KAC7D;CACF,CAAC"}
@@ -1,5 +1,5 @@
1
- export declare function handleCreateMotion(args: unknown): Promise<string>;
2
- export declare const CREATE_MOTION_TOOL_DEFINITION: {
1
+ export declare function handleCreateThread(args: unknown): Promise<string>;
2
+ export declare const CREATE_THREAD_TOOL_DEFINITION: {
3
3
  name: string;
4
4
  description: string;
5
5
  inputSchema: {
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ import { apiFetch, resolveWorkspaceId } from "../client.js";
3
+ const CreateThreadArgs = z.object({
4
+ workspace_slug: z.string().min(1),
5
+ // Trim first: a whitespace-only prompt passes min(1) but opens a thread with
6
+ // no opening message, and the background run then wakes on nothing.
7
+ prompt: z.string().trim().min(1).max(10000),
8
+ });
9
+ export async function handleCreateThread(args) {
10
+ const { workspace_slug, prompt } = CreateThreadArgs.parse(args);
11
+ const wsId = await resolveWorkspaceId(workspace_slug);
12
+ const motion = await apiFetch(`/workspaces/${wsId}/motions/generate`, {
13
+ method: "POST",
14
+ body: JSON.stringify({ prompt }),
15
+ });
16
+ return JSON.stringify({
17
+ id: motion.id,
18
+ short_id: motion.id.slice(0, 8),
19
+ summary: motion.summary,
20
+ status: motion.status,
21
+ url: `https://app.monnet.ai/${workspace_slug}/motions/${motion.id.slice(0, 8)}`,
22
+ note: "This is a thread, not a motion yet: Monnet is opening the conversation " +
23
+ "in the background and writes a doc only if the idea earns one. Call " +
24
+ "get_motion with the returned short_id to read what it has made of it.",
25
+ }, null, 2);
26
+ }
27
+ export const CREATE_THREAD_TOOL_DEFINITION = {
28
+ name: "create_thread",
29
+ description: "Open a new thread in a Monnet workspace from a free-form prompt. A thread is a pre-motion conversation: Monnet picks it up in the background and shapes the idea with the author, and it becomes a motion — a doc, a plan, people to coordinate — only when it earns one. Returns the thread's id and URL immediately; call `get_motion` with the returned short_id to read where it got to.",
30
+ inputSchema: {
31
+ type: "object",
32
+ properties: {
33
+ workspace_slug: {
34
+ type: "string",
35
+ description: "The workspace slug (e.g. 'monnet-team-410b').",
36
+ },
37
+ prompt: {
38
+ type: "string",
39
+ description: "What the thread is about, in the user's own words plus any relevant context. Substance matters — Monnet reads it as the opening message of the conversation.",
40
+ },
41
+ },
42
+ required: ["workspace_slug", "prompt"],
43
+ },
44
+ };
45
+ //# sourceMappingURL=create-thread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-thread.js","sourceRoot":"","sources":["../../src/tools/create-thread.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,6EAA6E;IAC7E,oEAAoE;IACpE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAa;IACpD,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAI1B,eAAe,IAAI,mBAAmB,EAAE;QACzC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACjC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,GAAG,EAAE,yBAAyB,cAAc,YAAY,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC/E,IAAI,EACF,yEAAyE;YACzE,sEAAsE;YACtE,uEAAuE;KAC1E,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,8XAA8X;IAChY,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+CAA+C;aAC7D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8JAA8J;aAC5K;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,QAAQ,CAAC;KACvC;CACF,CAAC"}
@@ -5,6 +5,15 @@ export declare const GET_INBOX_TOOL_DEFINITION: {
5
5
  inputSchema: {
6
6
  type: "object";
7
7
  properties: {
8
+ workspace_slug: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ tag: {
13
+ type: string;
14
+ enum: string[];
15
+ description: string;
16
+ };
8
17
  page: {
9
18
  type: string;
10
19
  description: string;
@@ -1,25 +1,36 @@
1
1
  import { z } from "zod";
2
- import { apiFetch } from "../client.js";
2
+ import { apiFetch, resolveWorkspaceId } from "../client.js";
3
3
  import { renderInbox } from "../rendering/inbox.js";
4
4
  const GetInboxArgs = z.object({
5
+ workspace_slug: z.string().min(1).optional(),
6
+ tag: z.enum(["priority", "active"]).optional(),
5
7
  page: z.number().int().min(1).optional(),
6
8
  limit: z.number().int().min(1).max(50).optional(),
7
9
  });
8
10
  export async function handleGetInbox(args) {
9
- const parsed = GetInboxArgs.parse(args);
10
- const page = parsed.page ?? 1;
11
- const limit = parsed.limit ?? 10;
11
+ const { workspace_slug, tag, page: rawPage, limit } = GetInboxArgs.parse(args);
12
+ const page = rawPage ?? 1;
12
13
  const params = new URLSearchParams({
13
14
  page: String(page),
14
- limit: String(limit),
15
+ // `pageSize`, camelCase, because that is the query parameter the route
16
+ // declares — `limit` was silently ignored and every call came back with
17
+ // the default page size.
18
+ pageSize: String(limit ?? 10),
15
19
  });
16
- const data = await apiFetch(`/motions/for-you?${params.toString()}`);
20
+ if (tag)
21
+ params.set("tag", tag);
22
+ // The route scopes by workspace id, not by slug. Resolving here is also what
23
+ // turns an unknown slug into a clear 404 about the slug, instead of a feed
24
+ // that quietly spans every workspace.
25
+ if (workspace_slug)
26
+ params.set("workspace_id", await resolveWorkspaceId(workspace_slug));
27
+ const data = await apiFetch(`/motions/inbox?${params.toString()}`);
17
28
  return renderInbox({
18
- total: data.total,
19
29
  page,
20
- motions: data.motions.map((m) => ({
30
+ counts: data.counts ?? {},
31
+ motions: (data.motions ?? []).map((m) => ({
21
32
  short_id: m.id.slice(0, 8),
22
- summary: m.summary,
33
+ summary: m.summary || m.prompt,
23
34
  status: m.status,
24
35
  priority: m.priority,
25
36
  workspace: m.workspace_name,
@@ -27,25 +38,36 @@ export async function handleGetInbox(args) {
27
38
  last_activity: m.last_activity_summary,
28
39
  last_activity_at: m.last_activity_at,
29
40
  is_unread: m.is_unread,
41
+ tag: m.tag,
30
42
  })),
31
43
  });
32
44
  }
33
45
  export const GET_INBOX_TOOL_DEFINITION = {
34
46
  name: "get_inbox",
35
- description: "Fetch the user's 'For You' feed motions across all their workspaces that need attention " +
36
- "(pending approvals, unread activity, assigned steps). Use this when the user asks " +
37
- "'what's on my plate', 'what needs my attention', or similar.",
47
+ description: "Fetch the user's inbox the motions they follow, in two buckets: 'priority' is what is waiting on them " +
48
+ "(an open motion with a step assigned to them, not yet dismissed), 'active' is everything else they follow. " +
49
+ "Spans every workspace unless one is named. Use this when the user asks 'what's on my plate', " +
50
+ "'what needs my attention', or similar.",
38
51
  inputSchema: {
39
52
  type: "object",
40
53
  properties: {
54
+ workspace_slug: {
55
+ type: "string",
56
+ description: "Limit the inbox to one workspace (e.g. 'monnet-team-410b'). Omit for every workspace the user belongs to.",
57
+ },
58
+ tag: {
59
+ type: "string",
60
+ enum: ["priority", "active"],
61
+ description: "Return only one bucket, which is also how you page through it. Omit for the first page of both.",
62
+ },
41
63
  page: {
42
64
  type: "integer",
43
- description: "Page number (1-based). Default: 1.",
65
+ description: "Page number (1-based). Default: 1. Only meaningful together with `tag`.",
44
66
  minimum: 1,
45
67
  },
46
68
  limit: {
47
69
  type: "integer",
48
- description: "Number of motions per page (1-50). Default: 10.",
70
+ description: "Motions per bucket (1-50). Default: 10.",
49
71
  minimum: 1,
50
72
  maximum: 50,
51
73
  },
@@ -1 +1 @@
1
- {"version":3,"file":"get-inbox.js","sourceRoot":"","sources":["../../src/tools/get-inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAm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;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,0GAA0G;QAC1G,6GAA6G;QAC7G,+FAA+F;QAC/F,wCAAwC;IAC1C,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,2GAA2G;aAC9G;YACD,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;gBAC5B,WAAW,EACT,iGAAiG;aACpG;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,yEAAyE;gBACtF,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,yCAAyC;gBACtD,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,EAAE;aACZ;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { apiFetch, resolveWorkspaceId } from "../client.js";
2
+ import { fetchMotionDetail, motionFiles } from "../motion-detail.js";
3
3
  import { renderMotionDetail } from "../rendering/motion.js";
4
4
  const GetMotionArgs = z.object({
5
5
  workspace_slug: z.string().min(1),
@@ -7,9 +7,8 @@ const GetMotionArgs = z.object({
7
7
  });
8
8
  export async function handleGetMotion(args) {
9
9
  const { workspace_slug, motion_short_id } = GetMotionArgs.parse(args);
10
- const wsId = await resolveWorkspaceId(workspace_slug);
11
- const detail = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/detail`);
12
- const { motion, workspace_name, members, motion_members, messages } = detail;
10
+ const fetched = await fetchMotionDetail(workspace_slug, motion_short_id);
11
+ const { motion, workspace_name, members, motion_members, messages } = fetched.detail;
13
12
  return renderMotionDetail({
14
13
  id: motion.id,
15
14
  summary: motion.summary,
@@ -23,13 +22,14 @@ export async function handleGetMotion(args) {
23
22
  workspace: workspace_name,
24
23
  members: members.map((m) => ({ user_id: m.user_id, name: m.name, role: m.role, function: m.function })),
25
24
  motion_members: motion_members.map((mm) => ({ user_id: mm.user_id, role: mm.role })),
25
+ files: motionFiles(fetched),
26
26
  messages: messages || [],
27
27
  });
28
28
  }
29
29
  export const GET_MOTION_TOOL_DEFINITION = {
30
30
  name: "get_motion",
31
31
  description: "Read a Monnet motion's full details — summary, body, status, priority, plan steps with assignees, member roles, " +
32
- "and threaded comments (each comment shows a short id usable as parent_id in the comment tool to reply in its thread). " +
32
+ "threaded comments (each comment shows a short id usable as parent_id in the comment tool to reply in its thread), and the files attached to it, each with the id read_motion_file takes. " +
33
33
  "Call this when the user references a specific motion by its short id or URL.",
34
34
  inputSchema: {
35
35
  type: "object",
@@ -1 +1 @@
1
- {"version":3,"file":"get-motion.js","sourceRoot":"","sources":["../../src/tools/get-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC;AA4BH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAa;IACjD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM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,MAAM,EAAE,MAAM,CAAC,WAAW;QAC1B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5G,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACpF,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;QAC3B,QAAQ,EAAE,QAAQ,IAAI,EAAE;KACzB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,kHAAkH;QAClH,2LAA2L;QAC3L,8EAA8E;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,iHAAiH;aACpH;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACrF;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAChD;CACF,CAAC"}
@@ -13,7 +13,7 @@ export async function handleListWorkspaces() {
13
13
  export const LIST_WORKSPACES_TOOL_DEFINITION = {
14
14
  name: "list_workspaces",
15
15
  description: "List all Monnet workspaces you are a member of. Returns the workspace name and slug " +
16
- "needed by other tools (get_motion, list_motions, create_motion, etc.). " +
16
+ "needed by other tools (get_motion, list_motions, create_thread, etc.). " +
17
17
  "Call this first if you don't know the workspace slug.",
18
18
  inputSchema: {
19
19
  type: "object",
@@ -0,0 +1,28 @@
1
+ import type { ToolResult } from "../tool-result.js";
2
+ export declare function handleReadMotionFile(args: unknown): Promise<ToolResult>;
3
+ export declare const READ_MOTION_FILE_TOOL_DEFINITION: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: {
7
+ type: "object";
8
+ properties: {
9
+ workspace_slug: {
10
+ type: string;
11
+ description: string;
12
+ };
13
+ motion_short_id: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ file_id: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ filename: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ };
@@ -0,0 +1,131 @@
1
+ import { z } from "zod";
2
+ import { apiFetch, MonnetApiError } from "../client.js";
3
+ import { fetchMotionDetail, motionFiles } from "../motion-detail.js";
4
+ import { humanSize } from "../rendering/motion.js";
5
+ const ReadMotionFileArgs = z.object({
6
+ workspace_slug: z.string().min(1),
7
+ motion_short_id: z.string().min(1),
8
+ file_id: z.string().min(1).optional(),
9
+ filename: z.string().min(1).optional(),
10
+ });
11
+ export async function handleReadMotionFile(args) {
12
+ const { workspace_slug, motion_short_id, file_id, filename } = ReadMotionFileArgs.parse(args);
13
+ if (!file_id && !filename) {
14
+ return "Pass either file_id or filename. Both are listed under FILES in get_motion.";
15
+ }
16
+ const fetched = await fetchMotionDetail(workspace_slug, motion_short_id);
17
+ const files = motionFiles(fetched);
18
+ const target = resolve(files, file_id, filename);
19
+ // A string is the explanation of why no single file was meant; it is the
20
+ // tool's whole answer.
21
+ if (typeof target === "string")
22
+ return target;
23
+ const path = `/workspaces/${fetched.workspaceId}/motions/${fetched.detail.motion.id}/files/${target.id}/content`;
24
+ let content;
25
+ try {
26
+ content = await apiFetch(path);
27
+ }
28
+ catch (err) {
29
+ // A 404 here is ambiguous in a way the generic message gets wrong: the
30
+ // file was listed a moment ago, so either it has just been deleted or the
31
+ // backend predates this route — this client and the API are versioned and
32
+ // deployed apart. Either way "check the workspace slug" is bad advice.
33
+ if (err instanceof MonnetApiError && err.status === 404) {
34
+ return (`${target.filename} could not be read: it was just deleted, or this Monnet backend ` +
35
+ `does not support reading file contents yet. Open it at ${target.url}`);
36
+ }
37
+ throw err;
38
+ }
39
+ return render(content, target);
40
+ }
41
+ /**
42
+ * The one file the caller meant, or an explanation of why that is unclear.
43
+ *
44
+ * Nothing makes a motion's filenames unique — the upload path does not
45
+ * deduplicate them the way the workspace one does — so two attachments really
46
+ * can share a name. Picking the first, which is what the in-app agent does,
47
+ * means silently reading the wrong document; naming the ids instead hands the
48
+ * caller the way out, which is the reason `file_id` is accepted at all.
49
+ *
50
+ * Returns the message rather than throwing: nothing here crosses a module or
51
+ * an async boundary, so an exception would only be a longer way to return.
52
+ */
53
+ function resolve(files, fileId, filename) {
54
+ if (!files.length)
55
+ return "This motion has no files attached.";
56
+ return fileId ? byId(files, fileId) : byName(files, filename);
57
+ }
58
+ function byId(files, fileId) {
59
+ return (files.find((f) => f.id === fileId) ??
60
+ `No file with id ${fileId} on this motion. Attached: ${listOf(files)}`);
61
+ }
62
+ function byName(files, filename) {
63
+ // Exact first: two files differing only in case are two files, and folding
64
+ // them together would report an ambiguity that does not exist. The
65
+ // case-insensitive pass is the fallback, for a name retyped from memory.
66
+ const exact = files.filter((f) => f.filename === filename);
67
+ const wanted = filename.toLowerCase();
68
+ const matches = exact.length ? exact : files.filter((f) => f.filename.toLowerCase() === wanted);
69
+ if (matches.length === 1)
70
+ return matches[0];
71
+ if (!matches.length) {
72
+ return `No file named "${filename}" on this motion. Attached: ${listOf(files)}`;
73
+ }
74
+ return (`${matches.length} files on this motion are named "${filename}". ` +
75
+ `Call again with one of these file_id values: ${matches.map((f) => f.id).join(", ")}`);
76
+ }
77
+ function listOf(files) {
78
+ return files.map((f) => f.filename).join(", ");
79
+ }
80
+ function render(content, file) {
81
+ const size = humanSize(content.size_bytes);
82
+ switch (content.kind) {
83
+ case "text":
84
+ return content.text?.trim() ? content.text : `${content.filename} is empty.`;
85
+ case "image":
86
+ // No data means the image is past the size the backend will inline. Its
87
+ // URL still opens for anyone on the motion, so say so rather than fail.
88
+ if (!content.data || !content.media_type) {
89
+ return `${content.filename} is a ${size} image — too large to return inline. Open it at ${file.url}`;
90
+ }
91
+ return [
92
+ { type: "text", text: `${content.filename} (${size})` },
93
+ { type: "image", data: content.data, mimeType: content.media_type },
94
+ ];
95
+ case "document":
96
+ return (`${content.filename} is a PDF (${size}). Monnet extracts text from Word, Excel and PowerPoint ` +
97
+ `files, but not from PDFs, so its contents cannot be read here. Open it at ${file.url}`);
98
+ default:
99
+ return `${content.text ?? `${content.filename} cannot be read as text.`} Open it at ${file.url}`;
100
+ }
101
+ }
102
+ export const READ_MOTION_FILE_TOOL_DEFINITION = {
103
+ name: "read_motion_file",
104
+ description: "Read a file attached to a motion. Text, markdown, CSV, JSON and source files come back as their contents; " +
105
+ "Word, Excel and PowerPoint documents come back as their extracted text; images come back as the image itself. " +
106
+ "A PDF cannot be read this way — you get its URL to open instead. " +
107
+ "Call get_motion first: it lists every attachment with the id and the filename this tool takes.",
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ workspace_slug: {
112
+ type: "string",
113
+ description: "The workspace slug from the motion URL (e.g. 'monnet-team-410b').",
114
+ },
115
+ motion_short_id: {
116
+ type: "string",
117
+ description: "The first 8 characters of the motion UUID, visible in the motion URL.",
118
+ },
119
+ file_id: {
120
+ type: "string",
121
+ description: "The file's id, from the FILES section of get_motion. Prefer it over filename — two attachments on one motion may share a name.",
122
+ },
123
+ filename: {
124
+ type: "string",
125
+ description: "The file's name, exactly as get_motion lists it. Used only when file_id is not given.",
126
+ },
127
+ },
128
+ required: ["workspace_slug", "motion_short_id"],
129
+ },
130
+ };
131
+ //# sourceMappingURL=read-motion-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uFAAuF;aACrG;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KAChD;CACF,CAAC"}
@@ -13,10 +13,9 @@ export declare const REJECT_TOOL_DEFINITION: {
13
13
  type: string;
14
14
  description: string;
15
15
  };
16
- step_index: {
16
+ step_path: {
17
17
  type: string;
18
18
  description: string;
19
- minimum: number;
20
19
  };
21
20
  reason: {
22
21
  type: string;