@monnet/mcp 0.5.0 → 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 +10 -0
- package/dist/rendering/motion.js +28 -0
- package/dist/rendering/motion.js.map +1 -1
- 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/{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/package.json +1 -1
- 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,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,CACL,sDAAsD;gBACtD,qEAAqE,CACtE,CAAC;QACJ,KAAK,GAAG;YACN,OAAO,mDAAmD,QAAQ,qEAAqE,CAAC;QAC1I,KAAK,GAAG;YACN,OAAO,YAAY,QAAQ,iDAAiD,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;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,kBAAkB,CAAC;AAEnD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE;AACpC,4EAA4E;AAC5E,qEAAqE;AACrE,sDAAsD;AACtD,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,mBAAmB,EAAE,CACnE,CAAC;AAEF,MAAM,CAAC,iBAAi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AAE,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;A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
-
|
|
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,EAAE,WAAW;IACnB,GAAG,EAAE,OAAO;CACb,CAAC;
|
|
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,aA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
|
|
|
1
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;
|
|
8
|
+
}
|
|
2
9
|
interface MotionDetail {
|
|
3
10
|
id: string;
|
|
4
11
|
summary: string;
|
|
@@ -20,6 +27,7 @@ interface MotionDetail {
|
|
|
20
27
|
user_id: string;
|
|
21
28
|
role: string;
|
|
22
29
|
}>;
|
|
30
|
+
files: MotionFile[];
|
|
23
31
|
messages: Array<{
|
|
24
32
|
id?: string;
|
|
25
33
|
parent_id?: string | null;
|
|
@@ -30,6 +38,8 @@ interface MotionDetail {
|
|
|
30
38
|
created_at: string;
|
|
31
39
|
}>;
|
|
32
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;
|
|
33
43
|
export declare function renderMotionDetail(data: MotionDetail): string;
|
|
34
44
|
interface MotionListItem {
|
|
35
45
|
short_id: string;
|
package/dist/rendering/motion.js
CHANGED
|
@@ -8,6 +8,21 @@ const DIVIDER = "━━━━━━━━━━━━━━━━━━━━━
|
|
|
8
8
|
function padRight(str, len) {
|
|
9
9
|
return str.length >= len ? str : str + " ".repeat(len - str.length);
|
|
10
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
|
+
}
|
|
11
26
|
export function renderMotionDetail(data) {
|
|
12
27
|
const priority = data.priority || "normal";
|
|
13
28
|
const dot = PRIORITY_DOTS[priority] || "●";
|
|
@@ -44,6 +59,19 @@ export function renderMotionDetail(data) {
|
|
|
44
59
|
lines.push("PLAN");
|
|
45
60
|
lines.push(...renderPlanItems(data.plan, nameMap));
|
|
46
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
|
+
}
|
|
74
|
+
}
|
|
47
75
|
// Members — show motion-level roles (editor/commenter) when available,
|
|
48
76
|
// fall back to workspace role (owner/member) otherwise.
|
|
49
77
|
if (data.members.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/rendering/motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe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,CAAC;IAED,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;IAClH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare const
|
|
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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AE,+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;
|
package/dist/tools/get-inbox.js
CHANGED
|
@@ -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
|
|
10
|
-
const page =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
36
|
-
"(
|
|
37
|
-
"'what's on my plate',
|
|
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: "
|
|
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;
|
|
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,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAsC,MAAM,uBAAuB,CAAC;AAExF,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC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2
|
-
import {
|
|
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
|
|
11
|
-
const
|
|
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
|
-
"
|
|
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,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AAE,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,
|
|
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,"file":"read-motion-file.js","sourceRoot":"","sources":["../../src/tools/read-motion-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,cAAc,E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}
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { apiFetch, resolveWorkspaceId } from "../client.js";
|
|
3
|
-
const CreateMotionArgs = z.object({
|
|
4
|
-
workspace_slug: z.string().min(1),
|
|
5
|
-
prompt: z.string().min(1).max(10000),
|
|
6
|
-
});
|
|
7
|
-
export async function handleCreateMotion(args) {
|
|
8
|
-
const { workspace_slug, prompt } = CreateMotionArgs.parse(args);
|
|
9
|
-
const wsId = await resolveWorkspaceId(workspace_slug);
|
|
10
|
-
const motion = await apiFetch(`/workspaces/${wsId}/motions/generate`, {
|
|
11
|
-
method: "POST",
|
|
12
|
-
body: JSON.stringify({ prompt }),
|
|
13
|
-
});
|
|
14
|
-
return JSON.stringify({
|
|
15
|
-
id: motion.id,
|
|
16
|
-
short_id: motion.id.slice(0, 8),
|
|
17
|
-
summary: motion.summary,
|
|
18
|
-
status: motion.status,
|
|
19
|
-
url: `https://app.monnet.ai/${workspace_slug}/motions/${motion.id.slice(0, 8)}`,
|
|
20
|
-
note: "Motion is being drafted in the background — call get_motion after a few seconds to read the summary, body, and plan.",
|
|
21
|
-
}, null, 2);
|
|
22
|
-
}
|
|
23
|
-
export const CREATE_MOTION_TOOL_DEFINITION = {
|
|
24
|
-
name: "create_motion",
|
|
25
|
-
description: "Create a new draft motion in a Monnet workspace from a free-form prompt. Returns the new motion's id and URL immediately — a background Monnet run drafts the summary, body, and plan over the next few seconds. Call `get_motion` with the returned short_id to inspect the draft.",
|
|
26
|
-
inputSchema: {
|
|
27
|
-
type: "object",
|
|
28
|
-
properties: {
|
|
29
|
-
workspace_slug: {
|
|
30
|
-
type: "string",
|
|
31
|
-
description: "The workspace slug (e.g. 'monnet-team-410b').",
|
|
32
|
-
},
|
|
33
|
-
prompt: {
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "What the motion should accomplish, in the user's own words plus any relevant context. Substance matters — the background Monnet run drafts the full motion from this.",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
required: ["workspace_slug", "prompt"],
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=create-motion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-motion.js","sourceRoot":"","sources":["../../src/tools/create-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;CACrC,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,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