@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.
- package/README.md +25 -4
- package/dist/client.d.ts +12 -0
- package/dist/client.js +14 -0
- package/dist/client.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/instructions.js +1 -1
- package/dist/motion-detail.d.ts +56 -0
- package/dist/motion-detail.js +24 -0
- package/dist/motion-detail.js.map +1 -0
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +9 -3
- package/dist/registry.js.map +1 -1
- package/dist/rendering/inbox.d.ts +9 -2
- package/dist/rendering/inbox.js +41 -21
- package/dist/rendering/inbox.js.map +1 -1
- package/dist/rendering/motion.d.ts +11 -7
- package/dist/rendering/motion.js +30 -15
- package/dist/rendering/motion.js.map +1 -1
- package/dist/rendering/plan.d.ts +50 -0
- package/dist/rendering/plan.js +85 -0
- package/dist/rendering/plan.js.map +1 -0
- package/dist/tool-result.d.ts +20 -0
- package/dist/tool-result.js +12 -0
- package/dist/tool-result.js.map +1 -0
- package/dist/tools/approve.d.ts +1 -2
- package/dist/tools/approve.js +11 -12
- package/dist/tools/approve.js.map +1 -1
- package/dist/tools/{create-motion.d.ts → create-thread.d.ts} +2 -2
- package/dist/tools/create-thread.js +45 -0
- package/dist/tools/create-thread.js.map +1 -0
- package/dist/tools/get-inbox.d.ts +9 -0
- package/dist/tools/get-inbox.js +36 -14
- package/dist/tools/get-inbox.js.map +1 -1
- package/dist/tools/get-motion.js +5 -5
- package/dist/tools/get-motion.js.map +1 -1
- package/dist/tools/list-workspaces.js +1 -1
- package/dist/tools/read-motion-file.d.ts +28 -0
- package/dist/tools/read-motion-file.js +131 -0
- package/dist/tools/read-motion-file.js.map +1 -0
- package/dist/tools/reject.d.ts +1 -2
- package/dist/tools/reject.js +13 -12
- package/dist/tools/reject.js.map +1 -1
- package/dist/tools/update-motion.js +17 -2
- package/dist/tools/update-motion.js.map +1 -1
- package/package.json +2 -2
- package/dist/tools/create-motion.js +0 -41
- package/dist/tools/create-motion.js.map +0 -1
package/README.md
CHANGED
|
@@ -60,15 +60,36 @@ Restart Claude Desktop / Cursor after editing the config.
|
|
|
60
60
|
|
|
61
61
|
## Tools
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
**Connection**
|
|
64
64
|
|
|
65
|
-
- `monnet_whoami` — verifies the
|
|
65
|
+
- `monnet_whoami` — verifies the connection and lists the API keys on your account.
|
|
66
|
+
- `list_workspaces` — the workspaces you belong to, with the slug every other tool takes.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
**Motions**
|
|
69
|
+
|
|
70
|
+
- `get_motion` — one motion in full: body, plan, members, comments, and its attached files.
|
|
71
|
+
- `read_motion_file` — an attachment's contents. Text and source files come back as
|
|
72
|
+
themselves, Word/Excel/PowerPoint as their extracted text, images as the image. A PDF
|
|
73
|
+
cannot be read this way — you get its URL to open instead.
|
|
74
|
+
- `list_motions` — what exists.
|
|
75
|
+
- `get_inbox` — what is waiting on you, split into `priority` (a step assigned to you) and
|
|
76
|
+
`active` (everything else you follow). Every workspace unless one is named.
|
|
77
|
+
- `create_thread` — open a pre-motion conversation from a free-form prompt.
|
|
78
|
+
- `update_motion`, `comment`, `approve`, `reject` — write paths.
|
|
79
|
+
- `ask_monnet` — ask Monnet itself, in your private channel on a motion.
|
|
80
|
+
|
|
81
|
+
**Company brain**
|
|
82
|
+
|
|
83
|
+
- Read: `get_wiki_schema`, `get_wiki_tree`, `read_wiki_page`, `search_wiki`.
|
|
84
|
+
- Write: `create_wiki_page`, `edit_wiki_page`, `create_wiki_folder`, `rename_wiki_folder`,
|
|
85
|
+
`move_wiki_node`, `delete_wiki_page`, `delete_wiki_folder`.
|
|
86
|
+
- Sources: `list_wiki_sources`, `read_wiki_source`, `push_wiki_source`,
|
|
87
|
+
`mark_wiki_source_ingested`, `requeue_wiki_source`, `delete_wiki_source`.
|
|
68
88
|
|
|
69
89
|
## Approval gate on send actions
|
|
70
90
|
|
|
71
|
-
Tools that send a message under your identity (
|
|
91
|
+
Tools that send a message under your identity (`comment`) or destroy something
|
|
92
|
+
(`delete_wiki_page`, `delete_wiki_folder`, `delete_wiki_source`) never
|
|
72
93
|
dispatch automatically. Before the message leaves the MCP server, your client
|
|
73
94
|
shows a confirmation dialog (MCP elicitation) with a preview of the message;
|
|
74
95
|
nothing is sent unless you explicitly approve. If your MCP client does not
|
package/dist/client.d.ts
CHANGED
|
@@ -19,5 +19,17 @@ export declare function apiPostWithSSE(path: string, body: unknown): Promise<{
|
|
|
19
19
|
message: string;
|
|
20
20
|
monnetResponse: string | null;
|
|
21
21
|
}>;
|
|
22
|
+
/**
|
|
23
|
+
* The canonical URL for a motion file — the `/render` route, which
|
|
24
|
+
* authenticates and checks motion access, so the URL is a reference and not a
|
|
25
|
+
* capability: safe to put in a doc or hand to a person.
|
|
26
|
+
*
|
|
27
|
+
* Assembled here rather than at each call site because that is how the two
|
|
28
|
+
* copies the backend used to have drifted apart. The backend composes the same
|
|
29
|
+
* string in `domain/services/file/_render_url.py` and the web app in
|
|
30
|
+
* `hooks/motion/use-motion-files.ts`; a change to the route has to reach all
|
|
31
|
+
* three, and this is this surface's one place to change.
|
|
32
|
+
*/
|
|
33
|
+
export declare function motionFileRenderUrl(workspaceId: string, motionId: string, fileId: string): string;
|
|
22
34
|
export declare function resolveWorkspaceId(slug: string): Promise<string>;
|
|
23
35
|
export declare function getCurrentUserId(): Promise<string>;
|
package/dist/client.js
CHANGED
|
@@ -175,6 +175,20 @@ export async function apiPostWithSSE(path, body) {
|
|
|
175
175
|
}
|
|
176
176
|
return { message: userMessage, monnetResponse: monnetText || null };
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* The canonical URL for a motion file — the `/render` route, which
|
|
180
|
+
* authenticates and checks motion access, so the URL is a reference and not a
|
|
181
|
+
* capability: safe to put in a doc or hand to a person.
|
|
182
|
+
*
|
|
183
|
+
* Assembled here rather than at each call site because that is how the two
|
|
184
|
+
* copies the backend used to have drifted apart. The backend composes the same
|
|
185
|
+
* string in `domain/services/file/_render_url.py` and the web app in
|
|
186
|
+
* `hooks/motion/use-motion-files.ts`; a change to the route has to reach all
|
|
187
|
+
* three, and this is this surface's one place to change.
|
|
188
|
+
*/
|
|
189
|
+
export function motionFileRenderUrl(workspaceId, motionId, fileId) {
|
|
190
|
+
return `${MONNET_API_URL}/workspaces/${workspaceId}/motions/${motionId}/files/${fileId}/render`;
|
|
191
|
+
}
|
|
178
192
|
/**
|
|
179
193
|
* Resolve a workspace slug to its workspace_id via GET /workspaces/by-slug/{slug}.
|
|
180
194
|
* Cached in-memory for the process lifetime (workspaces don't change often).
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,uBAAuB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAClG,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAElD,IAAI,CAAC,cAAc,EAAE,CAAC;IACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,0DAA0D;QAC1D,wFAAwF,CACzF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;IACpB;IAAnB,YAAmB,MAAc,EAAE,OAAe;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,SAAS,eAAe,CAAC,MAAc,EAAE,MAAqB;IAC5D,2EAA2E;IAC3E,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,MAA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ACvF,OAAO,GAAG,cAAc,eAAe,WAAW,YAAY,QAAQ,UAAU,MAAM,SAAS,CAAC;AAClG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAiB,uBAAuB,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7F,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,EAAE,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAkB,KAAK,CAAC,CAAC;IAClD,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC;IACvB,OAAO,EAAE,CAAC,GAAG,CAAC;AAChB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,8 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
|
|
|
12
12
|
import { SERVER_INSTRUCTIONS } from "./instructions.js";
|
|
13
13
|
import { TOOLS, HANDLERS } from "./registry.js";
|
|
14
14
|
import { requiresApproval, requestApproval } from "./approval.js";
|
|
15
|
-
|
|
15
|
+
import { toContentBlocks } from "./tool-result.js";
|
|
16
|
+
const server = new Server({ name: "monnet", version: "0.7.0" },
|
|
16
17
|
// `instructions` reaches the client before any tool call, which is the only
|
|
17
18
|
// place to say what Monnet IS. A tool description explains one call;
|
|
18
19
|
// nothing else explains the surface the calls sit on.
|
|
@@ -37,8 +38,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
37
38
|
return { content: [{ type: "text", text: verdict.deniedReason }] };
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
return { content: [{ type: "text", text }] };
|
|
41
|
+
return { content: toContentBlocks(await handler(args)) };
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
44
|
const message = err instanceof Error ? err.message : String(err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,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AC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAC3D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;YACtD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/dist/instructions.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
const WHAT_MONNET_IS = `Monnet is where a team runs its work and keeps what it knows. Two things live in it, and they are not the same:
|
|
16
16
|
|
|
17
|
-
A **motion** is a piece of work being driven to a decision — a proposal with a doc, a plan of steps with assignees, comments, and members. Monnet facilitates it: it drafts, nudges, and reacts as the conversation moves. Motions are addressed by an 8-character short id, the one in the URL.
|
|
17
|
+
A **motion** is a piece of work being driven to a decision — a proposal with a doc, a plan of steps with assignees, comments, and members. Monnet facilitates it: it drafts, nudges, and reacts as the conversation moves. Motions are addressed by an 8-character short id, the one in the URL. One starts life as a **thread** — a conversation with Monnet about an idea, no doc and no plan yet — and becomes a motion when the idea needs other people; that call is the person's, which is why create_thread opens a conversation rather than filing work.
|
|
18
18
|
|
|
19
19
|
The **company brain** is the team's wiki: an account of what they know, kept true over time. Pages are not a log of what happened — that is what motions are — they are what the team ended up believing.`;
|
|
20
20
|
const HOW_TO_ACT = `Two habits matter more than the rest.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one fetch of a motion's detail, and the shape it comes back in.
|
|
3
|
+
*
|
|
4
|
+
* Two tools need it and they need different halves — `get_motion` renders it,
|
|
5
|
+
* `read_motion_file` only wants the motion's real id and its file list — so
|
|
6
|
+
* the call lives here rather than in either of them. The route resolves a
|
|
7
|
+
* short id, which is why every caller can take the id a person actually has.
|
|
8
|
+
*/
|
|
9
|
+
import type { MotionFile } from "./rendering/motion.js";
|
|
10
|
+
export interface RawMotionFile {
|
|
11
|
+
id: string;
|
|
12
|
+
filename: string;
|
|
13
|
+
size_bytes: number | null;
|
|
14
|
+
content_type: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface MotionDetailResponse {
|
|
17
|
+
motion: {
|
|
18
|
+
id: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
body: string | null;
|
|
21
|
+
status: string;
|
|
22
|
+
priority: string | null;
|
|
23
|
+
plan: unknown[] | null;
|
|
24
|
+
author_name: string;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
};
|
|
28
|
+
workspace_name: string;
|
|
29
|
+
members: Array<{
|
|
30
|
+
user_id?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
role?: string;
|
|
33
|
+
function?: string | null;
|
|
34
|
+
}>;
|
|
35
|
+
motion_members: Array<{
|
|
36
|
+
user_id: string;
|
|
37
|
+
role: string;
|
|
38
|
+
}>;
|
|
39
|
+
files?: RawMotionFile[];
|
|
40
|
+
messages: Array<{
|
|
41
|
+
id: string;
|
|
42
|
+
parent_id: string | null;
|
|
43
|
+
author_name: string | null;
|
|
44
|
+
message_type: string;
|
|
45
|
+
content: string;
|
|
46
|
+
channel: string;
|
|
47
|
+
created_at: string;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
export interface FetchedMotion {
|
|
51
|
+
workspaceId: string;
|
|
52
|
+
detail: MotionDetailResponse;
|
|
53
|
+
}
|
|
54
|
+
export declare function fetchMotionDetail(workspaceSlug: string, motionShortId: string): Promise<FetchedMotion>;
|
|
55
|
+
/** The attachments, each carrying the URL that addresses it. */
|
|
56
|
+
export declare function motionFiles({ workspaceId, detail }: FetchedMotion): MotionFile[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one fetch of a motion's detail, and the shape it comes back in.
|
|
3
|
+
*
|
|
4
|
+
* Two tools need it and they need different halves — `get_motion` renders it,
|
|
5
|
+
* `read_motion_file` only wants the motion's real id and its file list — so
|
|
6
|
+
* the call lives here rather than in either of them. The route resolves a
|
|
7
|
+
* short id, which is why every caller can take the id a person actually has.
|
|
8
|
+
*/
|
|
9
|
+
import { apiFetch, motionFileRenderUrl, resolveWorkspaceId } from "./client.js";
|
|
10
|
+
export async function fetchMotionDetail(workspaceSlug, motionShortId) {
|
|
11
|
+
const workspaceId = await resolveWorkspaceId(workspaceSlug);
|
|
12
|
+
const detail = await apiFetch(`/workspaces/${workspaceId}/motions/${encodeURIComponent(motionShortId)}/detail`);
|
|
13
|
+
return { workspaceId, detail };
|
|
14
|
+
}
|
|
15
|
+
/** The attachments, each carrying the URL that addresses it. */
|
|
16
|
+
export function motionFiles({ workspaceId, detail }) {
|
|
17
|
+
return (detail.files ?? []).map((f) => ({
|
|
18
|
+
id: f.id,
|
|
19
|
+
filename: f.filename,
|
|
20
|
+
size_bytes: f.size_bytes,
|
|
21
|
+
url: motionFileRenderUrl(workspaceId, detail.motion.id, f.id),
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=motion-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion-detail.js","sourceRoot":"","sources":["../src/motion-detail.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA4ChF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,aAAqB,EACrB,aAAqB;IAErB,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,eAAe,WAAW,YAAY,kBAAkB,CAAC,aAAa,CAAC,SAAS,CACjF,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,WAAW,CAAC,EAAE,WAAW,EAAE,MAAM,EAAiB;IAChE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtC,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;KAC9D,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* cannot see. The approval gate keys off these names, and so does the
|
|
8
8
|
* client-facing brief in `instructions.ts`.
|
|
9
9
|
*/
|
|
10
|
+
import type { ToolResult } from "./tool-result.js";
|
|
10
11
|
export declare const TOOLS: ({
|
|
11
12
|
name: string;
|
|
12
13
|
description: string;
|
|
@@ -92,4 +93,4 @@ export declare const TOOLS: ({
|
|
|
92
93
|
required: string[];
|
|
93
94
|
};
|
|
94
95
|
})[];
|
|
95
|
-
export declare const HANDLERS: Record<string, (args: unknown) => Promise<
|
|
96
|
+
export declare const HANDLERS: Record<string, (args: unknown) => Promise<ToolResult>>;
|
package/dist/registry.js
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { handleWhoami, WHOAMI_TOOL_DEFINITION } from "./tools/whoami.js";
|
|
11
11
|
import { handleGetMotion, GET_MOTION_TOOL_DEFINITION } from "./tools/get-motion.js";
|
|
12
|
+
import { handleReadMotionFile, READ_MOTION_FILE_TOOL_DEFINITION } from "./tools/read-motion-file.js";
|
|
12
13
|
import { handleListMotions, LIST_MOTIONS_TOOL_DEFINITION } from "./tools/list-motions.js";
|
|
13
14
|
import { handleGetInbox, GET_INBOX_TOOL_DEFINITION } from "./tools/get-inbox.js";
|
|
14
|
-
import {
|
|
15
|
+
import { handleCreateThread, CREATE_THREAD_TOOL_DEFINITION } from "./tools/create-thread.js";
|
|
15
16
|
import { handleUpdateMotion, UPDATE_MOTION_TOOL_DEFINITION } from "./tools/update-motion.js";
|
|
16
17
|
import { handleComment, COMMENT_TOOL_DEFINITION } from "./tools/comment.js";
|
|
17
18
|
import { handleApprove, APPROVE_TOOL_DEFINITION } from "./tools/approve.js";
|
|
@@ -23,9 +24,10 @@ export const TOOLS = [
|
|
|
23
24
|
WHOAMI_TOOL_DEFINITION,
|
|
24
25
|
LIST_WORKSPACES_TOOL_DEFINITION,
|
|
25
26
|
GET_MOTION_TOOL_DEFINITION,
|
|
27
|
+
READ_MOTION_FILE_TOOL_DEFINITION,
|
|
26
28
|
LIST_MOTIONS_TOOL_DEFINITION,
|
|
27
29
|
GET_INBOX_TOOL_DEFINITION,
|
|
28
|
-
|
|
30
|
+
CREATE_THREAD_TOOL_DEFINITION,
|
|
29
31
|
UPDATE_MOTION_TOOL_DEFINITION,
|
|
30
32
|
COMMENT_TOOL_DEFINITION,
|
|
31
33
|
APPROVE_TOOL_DEFINITION,
|
|
@@ -37,9 +39,13 @@ export const HANDLERS = {
|
|
|
37
39
|
monnet_whoami: handleWhoami,
|
|
38
40
|
list_workspaces: handleListWorkspaces,
|
|
39
41
|
get_motion: handleGetMotion,
|
|
42
|
+
read_motion_file: handleReadMotionFile,
|
|
40
43
|
list_motions: handleListMotions,
|
|
41
44
|
get_inbox: handleGetInbox,
|
|
42
|
-
|
|
45
|
+
create_thread: handleCreateThread,
|
|
46
|
+
// Pre-rename name, kept dispatchable (and out of TOOLS) so a client whose
|
|
47
|
+
// config or prompt still says `create_motion` keeps working.
|
|
48
|
+
create_motion: handleCreateThread,
|
|
43
49
|
update_motion: handleUpdateMotion,
|
|
44
50
|
comment: handleComment,
|
|
45
51
|
approve: handleApprove,
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC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AAc;IACzB,aAAa,EAAE,kBAAkB;IACjC,0EAA0E;IAC1E,6DAA6D;IAC7D,aAAa,EAAE,kBAAkB;IACjC,aAAa,EAAE,kBAAkB;IACjC,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,eAAe;IAC3B,GAAG,aAAa;CACjB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** Which half of the inbox a motion sits in. */
|
|
2
|
+
export type InboxBucket = "priority" | "active";
|
|
3
|
+
export interface InboxMotion {
|
|
2
4
|
short_id: string;
|
|
3
5
|
summary: string;
|
|
4
6
|
status: string;
|
|
@@ -8,10 +10,15 @@ interface InboxMotion {
|
|
|
8
10
|
last_activity: string | null;
|
|
9
11
|
last_activity_at: string | null;
|
|
10
12
|
is_unread: boolean;
|
|
13
|
+
tag: InboxBucket;
|
|
11
14
|
}
|
|
12
15
|
interface InboxData {
|
|
13
|
-
total: number;
|
|
14
16
|
page: number;
|
|
17
|
+
/** Per-bucket totals, keyed by tag. Only the asked-for bucket when one was. */
|
|
18
|
+
counts: Record<string, {
|
|
19
|
+
total: number;
|
|
20
|
+
has_more: boolean;
|
|
21
|
+
}>;
|
|
15
22
|
motions: InboxMotion[];
|
|
16
23
|
}
|
|
17
24
|
export declare function renderInbox(data: InboxData): string;
|
package/dist/rendering/inbox.js
CHANGED
|
@@ -8,6 +8,14 @@ const PRIORITY_LABELS = {
|
|
|
8
8
|
normal: "🟢 normal",
|
|
9
9
|
low: "⚪ low",
|
|
10
10
|
};
|
|
11
|
+
// The buckets ARE the answer to "what's on my plate": `priority` is what is
|
|
12
|
+
// waiting on this person, `active` is what they are merely following. Rendered
|
|
13
|
+
// flat, the two are indistinguishable and the tool answers a different, vaguer
|
|
14
|
+
// question than the one it was asked.
|
|
15
|
+
const BUCKETS = [
|
|
16
|
+
{ tag: "priority", heading: "⚡ Waiting on you" },
|
|
17
|
+
{ tag: "active", heading: "👀 Following" },
|
|
18
|
+
];
|
|
11
19
|
function timeAgo(iso) {
|
|
12
20
|
if (!iso)
|
|
13
21
|
return "";
|
|
@@ -24,37 +32,49 @@ function timeAgo(iso) {
|
|
|
24
32
|
return `${days}d ago`;
|
|
25
33
|
}
|
|
26
34
|
export function renderInbox(data) {
|
|
27
|
-
const
|
|
28
|
-
lines
|
|
29
|
-
|
|
30
|
-
if (data.motions.length === 0) {
|
|
35
|
+
const total = Object.values(data.counts).reduce((sum, c) => sum + c.total, 0);
|
|
36
|
+
const lines = [`## 📥 Inbox — ${total} motion(s)`, ""];
|
|
37
|
+
if (!data.motions.length) {
|
|
31
38
|
lines.push("Nothing needs your attention right now. ✅");
|
|
32
39
|
return lines.join("\n");
|
|
33
40
|
}
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
for (const { tag, heading } of BUCKETS) {
|
|
42
|
+
const motions = data.motions.filter((m) => m.tag === tag);
|
|
43
|
+
const count = data.counts[tag];
|
|
44
|
+
// A bucket the caller did not ask for is absent, not empty — say nothing
|
|
45
|
+
// rather than claim it holds zero.
|
|
46
|
+
if (!count && !motions.length)
|
|
47
|
+
continue;
|
|
48
|
+
lines.push(`### ${heading} (${count?.total ?? motions.length})`);
|
|
49
|
+
lines.push("");
|
|
50
|
+
lines.push(motions.length ? renderTable(motions) : "_Nothing here._");
|
|
51
|
+
if (count?.has_more) {
|
|
52
|
+
lines.push("");
|
|
53
|
+
lines.push(`_More below page ${data.page} — call again with \`tag: "${tag}"\` and the next \`page\`._`);
|
|
54
|
+
}
|
|
55
|
+
lines.push("");
|
|
56
|
+
}
|
|
57
|
+
return lines.join("\n").trimEnd();
|
|
58
|
+
}
|
|
59
|
+
function renderTable(motions) {
|
|
60
|
+
// Critical first, then most recently active.
|
|
61
|
+
const sorted = [...motions].sort((a, b) => {
|
|
36
62
|
const pa = PRIORITY_ORDER[a.priority || "normal"] ?? 1;
|
|
37
63
|
const pb = PRIORITY_ORDER[b.priority || "normal"] ?? 1;
|
|
38
64
|
if (pa !== pb)
|
|
39
65
|
return pa - pb;
|
|
40
|
-
|
|
41
|
-
const tb = b.last_activity_at || "";
|
|
42
|
-
return tb.localeCompare(ta);
|
|
66
|
+
return (b.last_activity_at || "").localeCompare(a.last_activity_at || "");
|
|
43
67
|
});
|
|
44
|
-
|
|
45
|
-
lines.push("| # | Summary | Workspace | Priority | Last activity | When | Link |");
|
|
46
|
-
lines.push("|---|---------|-----------|----------|---------------|------|------|");
|
|
47
|
-
sorted.forEach((m, i) => {
|
|
68
|
+
const rows = sorted.map((m, i) => {
|
|
48
69
|
const priority = PRIORITY_LABELS[m.priority || "normal"] || "";
|
|
49
|
-
const activity = m.last_activity || "";
|
|
50
|
-
const ago = timeAgo(m.last_activity_at);
|
|
51
70
|
const url = `https://app.monnet.ai/${m.workspace_slug}/motions/${m.short_id}`;
|
|
52
|
-
|
|
71
|
+
const unread = m.is_unread ? "🔵 " : "";
|
|
72
|
+
return `| ${i + 1} | ${unread}${m.summary} | ${m.workspace} | ${priority} | ${m.last_activity || ""} | ${timeAgo(m.last_activity_at)} | ${url} |`;
|
|
53
73
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
return [
|
|
75
|
+
"| # | Summary | Workspace | Priority | Last activity | When | Link |",
|
|
76
|
+
"|---|---------|-----------|----------|---------------|------|------|",
|
|
77
|
+
...rows,
|
|
78
|
+
].join("\n");
|
|
59
79
|
}
|
|
60
80
|
//# sourceMappingURL=inbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/rendering/inbox.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAA2B;IAC7C,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,eAAe,GAA2B;IAC9C,QAAQ,EAAE,aAAa;IACvB,MAAM,EAA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S,MAAM,QAAQ,MAAM,CAAC,CAAC,aAAa,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC;IACpJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,sEAAsE;QACtE,sEAAsE;QACtE,GAAG,IAAI;KACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { type PlanItem } from "./plan.js";
|
|
2
|
+
export interface MotionFile {
|
|
3
|
+
id: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
size_bytes: number | null;
|
|
6
|
+
/** The `/render` URL, built by the caller — see `motionFileRenderUrl`. */
|
|
7
|
+
url: string;
|
|
7
8
|
}
|
|
8
9
|
interface MotionDetail {
|
|
9
10
|
id: string;
|
|
@@ -11,7 +12,7 @@ interface MotionDetail {
|
|
|
11
12
|
status: string;
|
|
12
13
|
priority: string | null;
|
|
13
14
|
body: string | null;
|
|
14
|
-
plan:
|
|
15
|
+
plan: PlanItem[] | null;
|
|
15
16
|
author: string;
|
|
16
17
|
created_at: string;
|
|
17
18
|
updated_at: string;
|
|
@@ -26,6 +27,7 @@ interface MotionDetail {
|
|
|
26
27
|
user_id: string;
|
|
27
28
|
role: string;
|
|
28
29
|
}>;
|
|
30
|
+
files: MotionFile[];
|
|
29
31
|
messages: Array<{
|
|
30
32
|
id?: string;
|
|
31
33
|
parent_id?: string | null;
|
|
@@ -36,6 +38,8 @@ interface MotionDetail {
|
|
|
36
38
|
created_at: string;
|
|
37
39
|
}>;
|
|
38
40
|
}
|
|
41
|
+
/** Bytes as something a reader can judge at a glance — "2.4 MB", not 2517483. */
|
|
42
|
+
export declare function humanSize(bytes: number | null): string;
|
|
39
43
|
export declare function renderMotionDetail(data: MotionDetail): string;
|
|
40
44
|
interface MotionListItem {
|
|
41
45
|
short_id: string;
|
package/dist/rendering/motion.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
pending: "⏳",
|
|
3
|
-
in_progress: "🔄",
|
|
4
|
-
done: "✅",
|
|
5
|
-
};
|
|
1
|
+
import { renderPlanItems } from "./plan.js";
|
|
6
2
|
const PRIORITY_DOTS = {
|
|
7
3
|
critical: "🔴",
|
|
8
4
|
normal: "●",
|
|
@@ -12,6 +8,21 @@ const DIVIDER = "━━━━━━━━━━━━━━━━━━━━━
|
|
|
12
8
|
function padRight(str, len) {
|
|
13
9
|
return str.length >= len ? str : str + " ".repeat(len - str.length);
|
|
14
10
|
}
|
|
11
|
+
/** Bytes as something a reader can judge at a glance — "2.4 MB", not 2517483. */
|
|
12
|
+
export function humanSize(bytes) {
|
|
13
|
+
if (bytes === null || !Number.isFinite(bytes) || bytes < 0)
|
|
14
|
+
return "unknown size";
|
|
15
|
+
if (bytes < 1024)
|
|
16
|
+
return `${bytes} B`;
|
|
17
|
+
const units = ["KB", "MB", "GB"];
|
|
18
|
+
let value = bytes / 1024;
|
|
19
|
+
let unit = 0;
|
|
20
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
21
|
+
value /= 1024;
|
|
22
|
+
unit += 1;
|
|
23
|
+
}
|
|
24
|
+
return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unit]}`;
|
|
25
|
+
}
|
|
15
26
|
export function renderMotionDetail(data) {
|
|
16
27
|
const priority = data.priority || "normal";
|
|
17
28
|
const dot = PRIORITY_DOTS[priority] || "●";
|
|
@@ -46,16 +57,20 @@ export function renderMotionDetail(data) {
|
|
|
46
57
|
if (data.plan && data.plan.length > 0) {
|
|
47
58
|
lines.push("");
|
|
48
59
|
lines.push("PLAN");
|
|
49
|
-
data.plan
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
lines.push(...renderPlanItems(data.plan, nameMap));
|
|
61
|
+
}
|
|
62
|
+
// Files — the id is what read_motion_file takes, so it is shown in full;
|
|
63
|
+
// the URL is here because it is the thing to hand a person, and it is the
|
|
64
|
+
// only way to reach a PDF or an oversized image, which the read tool cannot
|
|
65
|
+
// return the contents of.
|
|
66
|
+
if (data.files.length > 0) {
|
|
67
|
+
lines.push("");
|
|
68
|
+
lines.push("FILES");
|
|
69
|
+
const maxNameLen = Math.max(...data.files.map((f) => f.filename.length));
|
|
70
|
+
for (const f of data.files) {
|
|
71
|
+
lines.push(` ${padRight(f.filename, maxNameLen + 2)}${humanSize(f.size_bytes)} id: ${f.id}`);
|
|
72
|
+
lines.push(` ${f.url}`);
|
|
73
|
+
}
|
|
59
74
|
}
|
|
60
75
|
// Members — show motion-level roles (editor/commenter) when available,
|
|
61
76
|
// fall back to workspace role (owner/member) otherwise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/rendering/motion.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/rendering/motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,WAAW,CAAC;AAE3D,MAAM,aAAa,GAA2B;IAC5C,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,GAAG;CACT,CAAC;AAmCF,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAE/C,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAW;IACxC,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,SAAS,CAAC,KAAoB;IAC5C,IAAI,KAAK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
|
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
|
+
export type PlanStatus = "pending" | "in_progress" | "done" | "skipped";
|
|
15
|
+
export interface PlanStep {
|
|
16
|
+
kind?: "step";
|
|
17
|
+
content: string;
|
|
18
|
+
status: PlanStatus | string;
|
|
19
|
+
/** V2 : a step has exactly one owner. */
|
|
20
|
+
assignee?: string | null;
|
|
21
|
+
step_type?: "task" | "approval" | "decision" | "interview" | "closing";
|
|
22
|
+
due_date?: string | null;
|
|
23
|
+
/** V1 leftovers, still on motions planned before the tree shipped. */
|
|
24
|
+
assignees?: string[];
|
|
25
|
+
approval?: boolean;
|
|
26
|
+
approved_by?: string | string[] | null;
|
|
27
|
+
}
|
|
28
|
+
export interface PlanGroup {
|
|
29
|
+
kind: "group";
|
|
30
|
+
title: string;
|
|
31
|
+
execution: "parallel" | "sequential";
|
|
32
|
+
children: PlanItem[];
|
|
33
|
+
}
|
|
34
|
+
export type PlanItem = PlanStep | PlanGroup;
|
|
35
|
+
export declare function isGroup(item: PlanItem): item is PlanGroup;
|
|
36
|
+
/** True when the plan uses the tree shape — one `kind` is enough to tell. */
|
|
37
|
+
export declare function isTreePlan(plan: unknown): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* One line per item, children indented under their group. `prefix` carries the
|
|
40
|
+
* parent's number so a child reads `1.2.`; `depth` only drives indentation.
|
|
41
|
+
*/
|
|
42
|
+
export declare function renderPlanItems(items: PlanItem[], nameMap: Map<string, string>, prefix?: string, depth?: number): string[];
|
|
43
|
+
/**
|
|
44
|
+
* The reverse of the numbering above : turn the label a client read in
|
|
45
|
+
* `get_motion` ("1.2") into the 0-based index path the API addresses a step
|
|
46
|
+
* with ([0, 1]). Kept beside the renderer on purpose — the label format and
|
|
47
|
+
* its parser are one convention, and they drift apart the moment they live in
|
|
48
|
+
* two files.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parsePlanPath(label: string): number[];
|