@monnet/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.
- package/README.md +67 -0
- package/dist/client.d.ts +23 -0
- package/dist/client.js +175 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/rendering/inbox.d.ts +18 -0
- package/dist/rendering/inbox.js +38 -0
- package/dist/rendering/inbox.js.map +1 -0
- package/dist/rendering/motion.d.ts +46 -0
- package/dist/rendering/motion.js +86 -0
- package/dist/rendering/motion.js.map +1 -0
- package/dist/tools/approve.d.ts +24 -0
- package/dist/tools/approve.js +40 -0
- package/dist/tools/approve.js.map +1 -0
- package/dist/tools/ask-monnet.d.ts +23 -0
- package/dist/tools/ask-monnet.js +42 -0
- package/dist/tools/ask-monnet.js.map +1 -0
- package/dist/tools/comment.d.ts +23 -0
- package/dist/tools/comment.js +41 -0
- package/dist/tools/comment.js.map +1 -0
- package/dist/tools/create-motion.d.ts +19 -0
- package/dist/tools/create-motion.js +41 -0
- package/dist/tools/create-motion.js.map +1 -0
- package/dist/tools/get-inbox.d.ts +22 -0
- package/dist/tools/get-inbox.js +56 -0
- package/dist/tools/get-inbox.js.map +1 -0
- package/dist/tools/get-motion.d.ts +19 -0
- package/dist/tools/get-motion.js +47 -0
- package/dist/tools/get-motion.js.map +1 -0
- package/dist/tools/list-motions.d.ts +31 -0
- package/dist/tools/list-motions.js +69 -0
- package/dist/tools/list-motions.js.map +1 -0
- package/dist/tools/reject.d.ts +28 -0
- package/dist/tools/reject.js +48 -0
- package/dist/tools/reject.js.map +1 -0
- package/dist/tools/update-motion.d.ts +64 -0
- package/dist/tools/update-motion.js +99 -0
- package/dist/tools/update-motion.js.map +1 -0
- package/dist/tools/whoami.d.ts +15 -0
- package/dist/tools/whoami.js +26 -0
- package/dist/tools/whoami.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function handleAskMonnet(args: unknown): Promise<string>;
|
|
2
|
+
export declare const ASK_MONNET_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
motion_short_id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
question: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiPostWithSSE, resolveWorkspaceId, getCurrentUserId } from "../client.js";
|
|
3
|
+
const AskMonnetArgs = z.object({
|
|
4
|
+
workspace_slug: z.string().min(1),
|
|
5
|
+
motion_short_id: z.string().min(1),
|
|
6
|
+
question: z.string().min(1).max(10000),
|
|
7
|
+
});
|
|
8
|
+
export async function handleAskMonnet(args) {
|
|
9
|
+
const { workspace_slug, motion_short_id, question } = AskMonnetArgs.parse(args);
|
|
10
|
+
const wsId = await resolveWorkspaceId(workspace_slug);
|
|
11
|
+
const userId = await getCurrentUserId();
|
|
12
|
+
const result = await apiPostWithSSE(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/messages`, { content: question, channel: `private:${userId}` });
|
|
13
|
+
if (result.monnetResponse) {
|
|
14
|
+
return result.monnetResponse;
|
|
15
|
+
}
|
|
16
|
+
return "(Monnet did not respond — this is unexpected for a private message. The question was posted successfully.)";
|
|
17
|
+
}
|
|
18
|
+
export const ASK_MONNET_TOOL_DEFINITION = {
|
|
19
|
+
name: "ask_monnet",
|
|
20
|
+
description: "Ask Monnet a question in the context of a specific motion. " +
|
|
21
|
+
"The question is sent as a private message (only you and Monnet see it). " +
|
|
22
|
+
"Monnet's response is returned directly.",
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
workspace_slug: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "The workspace slug.",
|
|
29
|
+
},
|
|
30
|
+
motion_short_id: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "The first 8 characters of the motion UUID.",
|
|
33
|
+
},
|
|
34
|
+
question: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Your question for Monnet (1-10,000 chars).",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["workspace_slug", "motion_short_id", "question"],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=ask-monnet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-monnet.js","sourceRoot":"","sources":["../../src/tools/ask-monnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpF,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;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAa;IACjD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAExC,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,eAAe,IAAI,YAAY,kBAAkB,CAAC,eAAe,CAAC,WAAW,EAC7E,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,MAAM,EAAE,EAAE,CACpD,CAAC;IAEF,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,cAAc,CAAC;IAC/B,CAAC;IACD,OAAO,4GAA4G,CAAC;AACtH,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,6DAA6D;QAC7D,0EAA0E;QAC1E,yCAAyC;IAC3C,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,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,CAAC;KAC5D;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function handleComment(args: unknown): Promise<string>;
|
|
2
|
+
export declare const COMMENT_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
motion_short_id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
content: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiPostWithSSE, resolveWorkspaceId } from "../client.js";
|
|
3
|
+
const CommentArgs = z.object({
|
|
4
|
+
workspace_slug: z.string().min(1),
|
|
5
|
+
motion_short_id: z.string().min(1),
|
|
6
|
+
content: z.string().min(1).max(10000),
|
|
7
|
+
});
|
|
8
|
+
export async function handleComment(args) {
|
|
9
|
+
const { workspace_slug, motion_short_id, content } = CommentArgs.parse(args);
|
|
10
|
+
const wsId = await resolveWorkspaceId(workspace_slug);
|
|
11
|
+
const result = await apiPostWithSSE(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/messages`, { content, channel: "public" });
|
|
12
|
+
const parts = ["Comment posted."];
|
|
13
|
+
if (result.monnetResponse) {
|
|
14
|
+
parts.push(`\nMonnet replied:\n${result.monnetResponse}`);
|
|
15
|
+
}
|
|
16
|
+
return parts.join("");
|
|
17
|
+
}
|
|
18
|
+
export const COMMENT_TOOL_DEFINITION = {
|
|
19
|
+
name: "comment",
|
|
20
|
+
description: "Post a public comment on a motion. Monnet may respond — if it does, " +
|
|
21
|
+
"the response is included in the return value.",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
workspace_slug: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "The workspace slug.",
|
|
28
|
+
},
|
|
29
|
+
motion_short_id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The first 8 characters of the motion UUID.",
|
|
32
|
+
},
|
|
33
|
+
content: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "The comment text (1-10,000 chars).",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["workspace_slug", "motion_short_id", "content"],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/tools/comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElE,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,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAa;IAC/C,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,eAAe,IAAI,YAAY,kBAAkB,CAAC,eAAe,CAAC,WAAW,EAC7E,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAC/B,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAClC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,SAAS;IACf,WAAW,EACT,sEAAsE;QACtE,+CAA+C;IACjD,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,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oCAAoC;aAClD;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,CAAC;KAC3D;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function handleCreateMotion(args: unknown): Promise<string>;
|
|
2
|
+
export declare const CREATE_MOTION_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
prompt: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
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`, {
|
|
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
|
+
}, null, 2);
|
|
21
|
+
}
|
|
22
|
+
export const CREATE_MOTION_TOOL_DEFINITION = {
|
|
23
|
+
name: "create_motion",
|
|
24
|
+
description: "Create a new draft motion in a Monnet workspace. Describe what you want to accomplish " +
|
|
25
|
+
"and Monnet will generate the summary, body, and initial plan. Returns the new motion's id and URL.",
|
|
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: "A description of what the motion should accomplish. Monnet will draft the full motion from this.",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["workspace_slug", "prompt"],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=create-motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,EAAE,C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KACvC;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function handleGetInbox(args: unknown): Promise<string>;
|
|
2
|
+
export declare const GET_INBOX_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
page: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
minimum: number;
|
|
12
|
+
};
|
|
13
|
+
limit: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
minimum: number;
|
|
17
|
+
maximum: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
required: never[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiFetch } from "../client.js";
|
|
3
|
+
import { renderInbox } from "../rendering/inbox.js";
|
|
4
|
+
const GetInboxArgs = z.object({
|
|
5
|
+
page: z.number().int().min(1).optional(),
|
|
6
|
+
limit: z.number().int().min(1).max(50).optional(),
|
|
7
|
+
});
|
|
8
|
+
export async function handleGetInbox(args) {
|
|
9
|
+
const parsed = GetInboxArgs.parse(args);
|
|
10
|
+
const page = parsed.page ?? 1;
|
|
11
|
+
const limit = parsed.limit ?? 10;
|
|
12
|
+
const params = new URLSearchParams({
|
|
13
|
+
page: String(page),
|
|
14
|
+
limit: String(limit),
|
|
15
|
+
});
|
|
16
|
+
const data = await apiFetch(`/motions/for-you?${params.toString()}`);
|
|
17
|
+
return renderInbox({
|
|
18
|
+
total: data.total,
|
|
19
|
+
page,
|
|
20
|
+
motions: data.motions.map((m) => ({
|
|
21
|
+
short_id: m.id.slice(0, 8),
|
|
22
|
+
summary: m.summary,
|
|
23
|
+
status: m.status,
|
|
24
|
+
priority: m.priority,
|
|
25
|
+
workspace: m.workspace_name,
|
|
26
|
+
workspace_slug: m.workspace_slug,
|
|
27
|
+
last_activity: m.last_activity_summary,
|
|
28
|
+
last_activity_at: m.last_activity_at,
|
|
29
|
+
is_unread: m.is_unread,
|
|
30
|
+
})),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export const GET_INBOX_TOOL_DEFINITION = {
|
|
34
|
+
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.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
page: {
|
|
42
|
+
type: "integer",
|
|
43
|
+
description: "Page number (1-based). Default: 1.",
|
|
44
|
+
minimum: 1,
|
|
45
|
+
},
|
|
46
|
+
limit: {
|
|
47
|
+
type: "integer",
|
|
48
|
+
description: "Number of motions per page (1-50). Default: 10.",
|
|
49
|
+
minimum: 1,
|
|
50
|
+
maximum: 50,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
required: [],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=get-inbox.js.map
|
|
@@ -0,0 +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,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FAA4F;QAC5F,oFAAoF;QACpF,8DAA8D;IAChE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iDAAiD;gBAC9D,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,EAAE;aACZ;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function handleGetMotion(args: unknown): Promise<string>;
|
|
2
|
+
export declare const GET_MOTION_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
motion_short_id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiFetch, resolveWorkspaceId } from "../client.js";
|
|
3
|
+
import { renderMotionDetail } from "../rendering/motion.js";
|
|
4
|
+
const GetMotionArgs = z.object({
|
|
5
|
+
workspace_slug: z.string().min(1),
|
|
6
|
+
motion_short_id: z.string().min(1),
|
|
7
|
+
});
|
|
8
|
+
export async function handleGetMotion(args) {
|
|
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 } = detail;
|
|
13
|
+
return renderMotionDetail({
|
|
14
|
+
id: motion.id,
|
|
15
|
+
summary: motion.summary,
|
|
16
|
+
status: motion.status,
|
|
17
|
+
priority: motion.priority,
|
|
18
|
+
body: motion.body,
|
|
19
|
+
plan: motion.plan,
|
|
20
|
+
author: motion.author_name,
|
|
21
|
+
created_at: motion.created_at,
|
|
22
|
+
updated_at: motion.updated_at,
|
|
23
|
+
workspace: workspace_name,
|
|
24
|
+
members: members.map((m) => ({ name: m.name, role: m.role, function: m.function })),
|
|
25
|
+
motion_members: motion_members.map((mm) => ({ user_id: mm.user_id, role: mm.role })),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export const GET_MOTION_TOOL_DEFINITION = {
|
|
29
|
+
name: "get_motion",
|
|
30
|
+
description: "Read a Monnet motion's full details — summary, body, status, priority, plan steps with assignees, and member roles. " +
|
|
31
|
+
"Call this when the user references a specific motion by its short id or URL.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
workspace_slug: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "The workspace slug from the motion URL (e.g. 'monnet-team-410b'). Found in the path /<slug>/motions/<short_id>.",
|
|
38
|
+
},
|
|
39
|
+
motion_short_id: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "The first 8 characters of the motion UUID, visible in the motion URL.",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["workspace_slug", "motion_short_id"],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=get-motion.js.map
|
|
@@ -0,0 +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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,EAAE,CAAC,CAAC;QACnF,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;KACrF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,sHAAsH;QACtH,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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare function handleListMotions(args: unknown): Promise<string>;
|
|
2
|
+
export declare const LIST_MOTIONS_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
status: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
enum: readonly ["draft", "open", "closed"];
|
|
16
|
+
};
|
|
17
|
+
page: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
minimum: number;
|
|
21
|
+
};
|
|
22
|
+
limit: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
minimum: number;
|
|
26
|
+
maximum: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
required: string[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiFetch, resolveWorkspaceId } from "../client.js";
|
|
3
|
+
import { renderMotionList } from "../rendering/motion.js";
|
|
4
|
+
const VALID_STATUSES = ["draft", "open", "closed"];
|
|
5
|
+
const ListMotionsArgs = z.object({
|
|
6
|
+
workspace_slug: z.string().min(1),
|
|
7
|
+
status: z.enum(VALID_STATUSES).optional(),
|
|
8
|
+
page: z.number().int().min(1).optional(),
|
|
9
|
+
limit: z.number().int().min(1).max(50).optional(),
|
|
10
|
+
});
|
|
11
|
+
export async function handleListMotions(args) {
|
|
12
|
+
const parsed = ListMotionsArgs.parse(args);
|
|
13
|
+
const status = parsed.status ?? "open";
|
|
14
|
+
const page = parsed.page ?? 1;
|
|
15
|
+
const limit = parsed.limit ?? 10;
|
|
16
|
+
const wsId = await resolveWorkspaceId(parsed.workspace_slug);
|
|
17
|
+
const params = new URLSearchParams({
|
|
18
|
+
status,
|
|
19
|
+
page: String(page),
|
|
20
|
+
limit: String(limit),
|
|
21
|
+
});
|
|
22
|
+
const data = await apiFetch(`/workspaces/${wsId}/motions?${params.toString()}`);
|
|
23
|
+
return renderMotionList({
|
|
24
|
+
workspace_slug: parsed.workspace_slug,
|
|
25
|
+
status,
|
|
26
|
+
page,
|
|
27
|
+
total: data.total,
|
|
28
|
+
motions: data.motions.map((m) => ({
|
|
29
|
+
short_id: m.id.slice(0, 8),
|
|
30
|
+
summary: m.summary,
|
|
31
|
+
status: m.status,
|
|
32
|
+
priority: m.priority,
|
|
33
|
+
author: m.author_name,
|
|
34
|
+
updated_at: m.updated_at,
|
|
35
|
+
})),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export const LIST_MOTIONS_TOOL_DEFINITION = {
|
|
39
|
+
name: "list_motions",
|
|
40
|
+
description: "List motions in a workspace, filterable by status. Returns short ids so you can follow up with get_motion on a specific one. " +
|
|
41
|
+
"Default status is 'open'.",
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
workspace_slug: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "The workspace slug (e.g. 'monnet-team-410b').",
|
|
48
|
+
},
|
|
49
|
+
status: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Filter by status. Default: open.",
|
|
52
|
+
enum: VALID_STATUSES,
|
|
53
|
+
},
|
|
54
|
+
page: {
|
|
55
|
+
type: "integer",
|
|
56
|
+
description: "Page number (1-based). Default: 1.",
|
|
57
|
+
minimum: 1,
|
|
58
|
+
},
|
|
59
|
+
limit: {
|
|
60
|
+
type: "integer",
|
|
61
|
+
description: "Number of motions per page (1-50). Default: 10.",
|
|
62
|
+
minimum: 1,
|
|
63
|
+
maximum: 50,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
required: ["workspace_slug"],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=list-motions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-motions.js","sourceRoot":"","sources":["../../src/tools/list-motions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAE5D,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAA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AC,QAAQ;YACpB,MAAM,EAAE,CAAC,CAAC,WAAW;YACrB,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,+HAA+H;QAC/H,2BAA2B;IAC7B,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,kCAAkC;gBAC/C,IAAI,EAAE,cAAc;aACrB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iDAAiD;gBAC9D,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,EAAE;aACZ;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,CAAC;KAC7B;CACF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare function handleReject(args: unknown): Promise<string>;
|
|
2
|
+
export declare const REJECT_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
motion_short_id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
step_index: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
minimum: number;
|
|
20
|
+
};
|
|
21
|
+
reason: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiFetch, resolveWorkspaceId } from "../client.js";
|
|
3
|
+
const RejectArgs = z.object({
|
|
4
|
+
workspace_slug: z.string().min(1),
|
|
5
|
+
motion_short_id: z.string().min(1),
|
|
6
|
+
step_index: z.number().int().min(0),
|
|
7
|
+
reason: z.string().max(2000).optional(),
|
|
8
|
+
});
|
|
9
|
+
export async function handleReject(args) {
|
|
10
|
+
const { workspace_slug, motion_short_id, step_index, reason } = RejectArgs.parse(args);
|
|
11
|
+
const wsId = await resolveWorkspaceId(workspace_slug);
|
|
12
|
+
const result = await apiFetch(`/workspaces/${wsId}/motions/${encodeURIComponent(motion_short_id)}/plan/steps/${step_index}/reject`, {
|
|
13
|
+
method: "POST",
|
|
14
|
+
body: JSON.stringify({ reason: reason || "" }),
|
|
15
|
+
});
|
|
16
|
+
return result.ok
|
|
17
|
+
? `Step ${step_index} rejected${reason ? ` (reason: ${reason})` : ""}. Plan now has ${result.plan.length} step(s).`
|
|
18
|
+
: "Rejection failed.";
|
|
19
|
+
}
|
|
20
|
+
export const REJECT_TOOL_DEFINITION = {
|
|
21
|
+
name: "reject",
|
|
22
|
+
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).",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
workspace_slug: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "The workspace slug.",
|
|
30
|
+
},
|
|
31
|
+
motion_short_id: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "The first 8 characters of the motion UUID.",
|
|
34
|
+
},
|
|
35
|
+
step_index: {
|
|
36
|
+
type: "integer",
|
|
37
|
+
description: "0-based index of the plan step to reject.",
|
|
38
|
+
minimum: 0,
|
|
39
|
+
},
|
|
40
|
+
reason: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Optional reason for rejection (max 2,000 chars).",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ["workspace_slug", "motion_short_id", "step_index"],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=reject.js.map
|
|
@@ -0,0 +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,KAAK,CAAC,IAAI,CAAC,CAAC;IACvF,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,eAAe,IAAI,YAAY,kBAAkB,CAAC,eAAe,CAAC,eAAe,UAAU,SAAS,EACpG;QACE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;KAC/C,CACF,CAAC;IAEF,OAAO,MAAM,CAAC,EAAE;QACd,CAAC,CAAC,QAAQ,UAAU,YAAY,MAAM,CAAC,CAAC,CAAC,aAAa,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,kBAAkB,MAAM,CAAC,IAAI,CAAC,MAAM,WAAW;QACnH,CAAC,CAAC,mBAAmB,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,+FAA+F;QAC/F,6EAA6E;IAC/E,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,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,2CAA2C;gBACxD,OAAO,EAAE,CAAC;aACX;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,CAAC;KAC9D;CACF,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare function handleUpdateMotion(args: unknown): Promise<string>;
|
|
2
|
+
export declare const UPDATE_MOTION_TOOL_DEFINITION: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
workspace_slug: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
motion_short_id: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
summary: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
body: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
priority: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
enum: string[];
|
|
28
|
+
};
|
|
29
|
+
plan: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
items: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties: {
|
|
35
|
+
content: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
status: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: string[];
|
|
41
|
+
};
|
|
42
|
+
assignees: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
approval: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
approved_by: {
|
|
52
|
+
type: string;
|
|
53
|
+
items: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
required: string[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|