@monnet/mcp 0.2.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +20 -27
  2. package/dist/approval.d.ts +19 -11
  3. package/dist/approval.js +73 -52
  4. package/dist/approval.js.map +1 -1
  5. package/dist/client.js +1 -1
  6. package/dist/client.js.map +1 -1
  7. package/dist/index.js +10 -44
  8. package/dist/index.js.map +1 -1
  9. package/dist/instructions.d.ts +15 -0
  10. package/dist/instructions.js +31 -0
  11. package/dist/instructions.js.map +1 -0
  12. package/dist/registry.d.ts +95 -0
  13. package/dist/registry.js +50 -0
  14. package/dist/registry.js.map +1 -0
  15. package/dist/rendering/motion.d.ts +4 -13
  16. package/dist/rendering/motion.js +12 -28
  17. package/dist/rendering/motion.js.map +1 -1
  18. package/dist/test-env.d.ts +15 -0
  19. package/dist/test-env.js +17 -0
  20. package/dist/test-env.js.map +1 -0
  21. package/dist/tools/list-motions.js +1 -2
  22. package/dist/tools/list-motions.js.map +1 -1
  23. package/dist/tools/wiki/_common.d.ts +102 -0
  24. package/dist/tools/wiki/_common.js +132 -0
  25. package/dist/tools/wiki/_common.js.map +1 -0
  26. package/dist/tools/wiki/index.d.ts +21 -0
  27. package/dist/tools/wiki/index.js +48 -0
  28. package/dist/tools/wiki/index.js.map +1 -0
  29. package/dist/tools/wiki/read.d.ts +68 -0
  30. package/dist/tools/wiki/read.js +124 -0
  31. package/dist/tools/wiki/read.js.map +1 -0
  32. package/dist/tools/wiki/sources.d.ts +114 -0
  33. package/dist/tools/wiki/sources.js +288 -0
  34. package/dist/tools/wiki/sources.js.map +1 -0
  35. package/dist/tools/wiki/write.d.ts +174 -0
  36. package/dist/tools/wiki/write.js +280 -0
  37. package/dist/tools/wiki/write.js.map +1 -0
  38. package/package.json +3 -8
  39. package/LICENSE +0 -21
  40. package/dist/tools/get-workspace-memory.d.ts +0 -15
  41. package/dist/tools/get-workspace-memory.js +0 -35
  42. package/dist/tools/get-workspace-memory.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @monnet/mcp
2
2
 
3
- Model Context Protocol (MCP) server for [Monnet](https://monnet.ai).
3
+ Model Context Protocol (MCP) server for Monnet.
4
4
 
5
5
  Exposes motions, plans, and approvals to MCP-compatible clients (Claude Desktop, Cursor, etc.) so you can work with your Monnet workspace from your terminal without leaving your AI assistant.
6
6
 
@@ -22,38 +22,19 @@ Add this to your MCP client config (e.g. `~/Library/Application Support/Claude/c
22
22
  }
23
23
  ```
24
24
 
25
- Generate an API key at **https://app.monnet.ai/settings** (API Keys tab).
25
+ Generate an API key from the Monnet web app: Settings → API Keys → Generate new key.
26
26
 
27
27
  ## Environment variables
28
28
 
29
29
  | Variable | Required | Default | Purpose |
30
30
  |---|---|---|---|
31
- | `MONNET_API_KEY` | yes | — | API key (`mnk_*`), sent as the `X-API-Key` header on every request |
31
+ | `MONNET_API_KEY` | yes | — | Bearer token (`mnk_*`), sent as `X-API-Key` header on every request |
32
32
  | `MONNET_API_URL` | no | `https://api.monnet.ai` | Override for self-hosted or local dev backends |
33
33
 
34
- ## Tools
35
-
36
- | Tool | Purpose |
37
- |---|---|
38
- | `monnet_whoami` | Verify the connection and list the API keys on your account |
39
- | `list_workspaces` | List the workspaces you belong to |
40
- | `get_inbox` | Fetch your inbox |
41
- | `list_motions` | List motions in a workspace |
42
- | `get_motion` | Read a motion — summary, body, plan, members, comments |
43
- | `create_motion` | Create a new draft motion from a free-form prompt |
44
- | `update_motion` | Update a motion's summary, body, priority, or plan |
45
- | `comment` | Post a comment on a motion (approval-gated, see below) |
46
- | `approve` | Approve a plan step |
47
- | `reject` | Reject a plan step (with an optional reason) |
48
- | `ask_monnet` | Ask Monnet a question on a motion |
49
-
50
- ## Approval gate on send actions
51
-
52
- Tools that send a message under your identity (e.g. `comment`) never dispatch automatically. Before the message leaves the MCP server, your client shows a confirmation dialog (MCP elicitation) with a preview; nothing is sent unless you explicitly approve. If your MCP client does not support elicitation, the send is aborted — the gate fails closed.
53
-
54
34
  ## Local development
55
35
 
56
36
  ```bash
37
+ cd mcp-server
57
38
  npm install
58
39
  npm run build
59
40
  ```
@@ -65,7 +46,7 @@ Point your MCP client at the local build:
65
46
  "mcpServers": {
66
47
  "monnet": {
67
48
  "command": "node",
68
- "args": ["/absolute/path/to/monnet-mcp/dist/index.js"],
49
+ "args": ["/absolute/path/to/mcp-server/dist/index.js"],
69
50
  "env": {
70
51
  "MONNET_API_KEY": "mnk_...",
71
52
  "MONNET_API_URL": "http://localhost:8000"
@@ -75,8 +56,20 @@ Point your MCP client at the local build:
75
56
  }
76
57
  ```
77
58
 
78
- Restart your MCP client after editing the config.
59
+ Restart Claude Desktop / Cursor after editing the config.
79
60
 
80
- ## License
61
+ ## Tools
62
+
63
+ Current scaffold ships with one tool for end-to-end validation:
64
+
65
+ - `monnet_whoami` — verifies the MCP connection and lists the API keys on your account.
66
+
67
+ Additional tools (`get_motion`, `list_motions`, `create_motion`, `update_motion`, `comment`, `ask_monnet`, `get_inbox`, `approve`, `reject`) will follow as Phase 4 and 5 of the implementation plan.
68
+
69
+ ## Approval gate on send actions
81
70
 
82
- [MIT](./LICENSE)
71
+ Tools that send a message under your identity (currently `comment`) never
72
+ dispatch automatically. Before the message leaves the MCP server, your client
73
+ shows a confirmation dialog (MCP elicitation) with a preview of the message;
74
+ nothing is sent unless you explicitly approve. If your MCP client does not
75
+ support elicitation, the send is aborted — the gate fails closed.
@@ -1,21 +1,29 @@
1
1
  /**
2
- * Approval gate for MCP tools that send messages under the user's identity.
2
+ * Approval gate for MCP tools whose effect a person cannot take back.
3
3
  *
4
- * No send-type tool call may reach the Monnet backend without the user's
5
- * explicit go-ahead. The gate uses MCP elicitation: the client (Claude
6
- * Desktop, Cursor, …) renders a native confirmation dialog to the human user,
7
- * out of band of the model. If the client does not support elicitation, the
8
- * gate fails closed — the message is aborted, never sent.
4
+ * Two kinds qualify, and for the same reason: a message sent under the user's
5
+ * identity is out in the world, and a deleted page takes its comments and its
6
+ * version history with it. Neither is something a model should be able to do
7
+ * on its own reading of the situation.
8
+ *
9
+ * The gate uses MCP elicitation: the client (Claude Desktop, Cursor, …)
10
+ * renders a native confirmation dialog to the human, out of band of the model.
11
+ * If the client does not support elicitation, the gate fails closed — the call
12
+ * is abandoned, never made. A sentence in a tool description asking the model
13
+ * to check first is not this: the model is free to skip it, and nothing
14
+ * downstream would know.
9
15
  */
10
16
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
11
- export declare function requiresSendApproval(toolName: string): boolean;
17
+ /** The gated names, for anything that must stay in step with this list. */
18
+ export declare const GATED_TOOL_NAMES: string[];
19
+ export declare function requiresApproval(toolName: string): boolean;
12
20
  export interface ApprovalVerdict {
13
21
  approved: boolean;
14
- /** Tool result text explaining why nothing was sent. Empty when approved. */
22
+ /** Tool result text explaining why nothing happened. Empty when approved. */
15
23
  deniedReason: string;
16
24
  }
17
25
  /**
18
- * Ask the human user (via client-side elicitation) to approve an outbound
19
- * message. Anything other than an explicit accept-with-confirm is a denial.
26
+ * Ask the human user (via client-side elicitation) to approve the call.
27
+ * Anything other than an explicit accept-with-confirm is a denial.
20
28
  */
21
- export declare function requestSendApproval(server: Server, toolName: string, args: Record<string, unknown>): Promise<ApprovalVerdict>;
29
+ export declare function requestApproval(server: Server, toolName: string, args: Record<string, unknown>): Promise<ApprovalVerdict>;
package/dist/approval.js CHANGED
@@ -1,66 +1,95 @@
1
1
  /**
2
- * Approval gate for MCP tools that send messages under the user's identity.
2
+ * Approval gate for MCP tools whose effect a person cannot take back.
3
3
  *
4
- * No send-type tool call may reach the Monnet backend without the user's
5
- * explicit go-ahead. The gate uses MCP elicitation: the client (Claude
6
- * Desktop, Cursor, …) renders a native confirmation dialog to the human user,
7
- * out of band of the model. If the client does not support elicitation, the
8
- * gate fails closed — the message is aborted, never sent.
4
+ * Two kinds qualify, and for the same reason: a message sent under the user's
5
+ * identity is out in the world, and a deleted page takes its comments and its
6
+ * version history with it. Neither is something a model should be able to do
7
+ * on its own reading of the situation.
8
+ *
9
+ * The gate uses MCP elicitation: the client (Claude Desktop, Cursor, …)
10
+ * renders a native confirmation dialog to the human, out of band of the model.
11
+ * If the client does not support elicitation, the gate fails closed — the call
12
+ * is abandoned, never made. A sentence in a tool description asking the model
13
+ * to check first is not this: the model is free to skip it, and nothing
14
+ * downstream would know.
9
15
  */
10
16
  /**
11
- * Send-type tools that require human approval, mapped to a preview builder.
12
- *
13
- * The preview is rendered defensively from the raw (not yet validated)
14
- * arguments so a malformed call still produces a readable prompt; full
15
- * validation happens in the tool handler after approval.
17
+ * Every tool that must not run unasked. Gating a new one = one entry here.
16
18
  *
17
- * Gating a new send-type tool = one entry here. Read/fetch tools and
18
- * `ask_monnet` (a private query visible only to the user and Monnet) are
19
- * intentionally not gated.
19
+ * Read and fetch tools are not gated, nor is `ask_monnet` (a private query
20
+ * visible only to the user and Monnet). Neither are the wiki WRITES: a page
21
+ * edited wrongly is a page that can be edited again, and every one of them
22
+ * leaves a version to restore from — which is exactly what deleting does not.
20
23
  */
21
- const SEND_TOOL_PREVIEWS = {
22
- comment: (args) => `Post a PUBLIC comment as you on motion ${str(args.motion_short_id)} ` +
23
- `in workspace "${str(args.workspace_slug)}":\n\n${str(args.content)}`,
24
+ const GATED_TOOLS = {
25
+ comment: {
26
+ pastTense: "sent",
27
+ headline: "Monnet MCP is about to send a message on your behalf.",
28
+ preview: (args) => `Post a PUBLIC comment as you on motion ${str(args.motion_short_id)} ` +
29
+ `in workspace "${str(args.workspace_slug)}":\n\n${str(args.content)}`,
30
+ },
31
+ delete_wiki_page: {
32
+ pastTense: "deleted",
33
+ headline: "Monnet MCP is about to delete a page from your company brain.",
34
+ preview: (args) => `Delete wiki page ${str(args.page_id)} in workspace ` +
35
+ `"${str(args.workspace_slug)}".\n\nIts comments and its full version ` +
36
+ `history go with it, and any page linking to it will be left with a ` +
37
+ `dead link. This cannot be undone.`,
38
+ },
39
+ delete_wiki_source: {
40
+ pastTense: "deleted",
41
+ headline: "Monnet MCP is about to delete a source document from your company brain.",
42
+ preview: (args) => `Delete source ${str(args.source_id)} in workspace ` +
43
+ `"${str(args.workspace_slug)}".\n\nThe stored document goes with it. A ` +
44
+ `source is the record a page was built from, and unlike a page it has ` +
45
+ `no version history to restore from. This cannot be undone.`,
46
+ },
47
+ delete_wiki_folder: {
48
+ pastTense: "deleted",
49
+ headline: "Monnet MCP is about to delete a folder from your company brain.",
50
+ preview: (args) => `Delete wiki folder "${str(args.folder_path)}" in workspace ` +
51
+ `"${str(args.workspace_slug)}".\n\nThe pages it holds are moved up ` +
52
+ `rather than deleted, but the folder itself cannot be restored.`,
53
+ },
24
54
  };
25
55
  function str(value) {
26
56
  return typeof value === "string" ? value : JSON.stringify(value ?? "(missing)");
27
57
  }
28
- export function requiresSendApproval(toolName) {
29
- return toolName in SEND_TOOL_PREVIEWS;
58
+ /** The gated names, for anything that must stay in step with this list. */
59
+ export const GATED_TOOL_NAMES = Object.keys(GATED_TOOLS);
60
+ export function requiresApproval(toolName) {
61
+ return toolName in GATED_TOOLS;
30
62
  }
31
- const NOT_SENT_PREFIX = "Message NOT sent ";
32
- const DO_NOT_RETRY = " Do not retry this call unless the user explicitly asks you to send it again.";
63
+ const DO_NOT_RETRY = " Do not retry this call unless the user explicitly asks you to do it again.";
33
64
  // Humans read and decide; give them more than the SDK's 60s default.
34
65
  const APPROVAL_TIMEOUT_MS = 5 * 60_000;
35
66
  /**
36
- * Ask the human user (via client-side elicitation) to approve an outbound
37
- * message. Anything other than an explicit accept-with-confirm is a denial.
67
+ * Ask the human user (via client-side elicitation) to approve the call.
68
+ * Anything other than an explicit accept-with-confirm is a denial.
38
69
  */
39
- export async function requestSendApproval(server, toolName, args) {
70
+ export async function requestApproval(server, toolName, args) {
71
+ const tool = GATED_TOOLS[toolName];
72
+ const refused = (why) => ({
73
+ approved: false,
74
+ deniedReason: `Nothing was ${tool.pastTense} — ${why}${DO_NOT_RETRY}`,
75
+ });
40
76
  if (!server.getClientCapabilities()?.elicitation) {
41
- return {
42
- approved: false,
43
- deniedReason: NOT_SENT_PREFIX +
44
- "this MCP client does not support elicitation, so Monnet cannot ask " +
45
- "the user for approval. Sending messages on the user's behalf " +
46
- "requires their explicit confirmation. Ask the user to post the " +
47
- "message themselves in the Monnet web app." +
48
- DO_NOT_RETRY,
49
- };
77
+ return refused("this MCP client does not support elicitation, so Monnet cannot ask " +
78
+ "the user for approval. Doing this on the user's behalf requires their " +
79
+ "explicit confirmation. Ask the user to do it themselves in the Monnet " +
80
+ "web app.");
50
81
  }
51
82
  let result;
52
83
  try {
53
84
  result = await server.elicitInput({
54
- message: "Monnet MCP is about to send a message on your behalf.\n\n" +
55
- SEND_TOOL_PREVIEWS[toolName](args) +
56
- "\n\nApprove sending this message?",
85
+ message: `${tool.headline}\n\n${tool.preview(args)}\n\nApprove?`,
57
86
  requestedSchema: {
58
87
  type: "object",
59
88
  properties: {
60
89
  confirm: {
61
90
  type: "boolean",
62
- title: "Send this message",
63
- description: "Check to approve sending the message under your identity.",
91
+ title: "Approve",
92
+ description: "Check to approve this action under your identity.",
64
93
  },
65
94
  },
66
95
  required: ["confirm"],
@@ -69,23 +98,15 @@ export async function requestSendApproval(server, toolName, args) {
69
98
  }
70
99
  catch (err) {
71
100
  const message = err instanceof Error ? err.message : String(err);
72
- return {
73
- approved: false,
74
- deniedReason: NOT_SENT_PREFIX + `the approval prompt failed (${message}).` + DO_NOT_RETRY,
75
- };
101
+ return refused(`the approval prompt failed (${message}).`);
76
102
  }
77
103
  if (result.action === "accept" && result.content?.confirm === true) {
78
104
  return { approved: true, deniedReason: "" };
79
105
  }
80
- return {
81
- approved: false,
82
- deniedReason: NOT_SENT_PREFIX +
83
- (result.action === "decline"
84
- ? "the user declined the approval prompt."
85
- : result.action === "cancel"
86
- ? "the user dismissed the approval prompt without answering."
87
- : "the user did not confirm sending.") +
88
- DO_NOT_RETRY,
89
- };
106
+ return refused(result.action === "decline"
107
+ ? "the user declined the approval prompt."
108
+ : result.action === "cancel"
109
+ ? "the user dismissed the approval prompt without answering."
110
+ : "the user did not confirm.");
90
111
  }
91
112
  //# sourceMappingURL=approval.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../src/approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,kBAAkB,GAA8D;IACpF,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,0CAA0C,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG;QACtE,iBAAiB,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;CACxE,CAAC;AAEF,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,QAAQ,IAAI,kBAAkB,CAAC;AACxC,CAAC;AAQD,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAChB,+EAA+E,CAAC;AAElF,qEAAqE;AACrE,MAAM,mBAAmB,GAAG,CAAC,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,QAAgB,EAChB,IAA6B;IAE7B,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,EAAE,WAAW,EAAE,CAAC;QACjD,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,YAAY,EACV,eAAe;gBACf,qEAAqE;gBACrE,+DAA+D;gBAC/D,iEAAiE;gBACjE,2CAA2C;gBAC3C,YAAY;SACf,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;Q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AAC;aACtB;SACF,EACD,EAAE,OAAO,EAAE,mBAAmB,EAAE,CACjC,CAAC;IACJ,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,OAAO,CAAC,+BAA+B,OAAO,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAC9C,CAAC;IAED,OAAO,OAAO,CACZ,MAAM,CAAC,MAAM,KAAK,SAAS;QACzB,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ;YAC1B,CAAC,CAAC,2DAA2D;YAC7D,CAAC,CAAC,2BAA2B,CAClC,CAAC;AACJ,CAAC"}
package/dist/client.js CHANGED
@@ -8,7 +8,7 @@ const MONNET_API_URL = (process.env.MONNET_API_URL || "https://api.monnet.ai").r
8
8
  const MONNET_API_KEY = process.env.MONNET_API_KEY;
9
9
  if (!MONNET_API_KEY) {
10
10
  process.stderr.write("Error: MONNET_API_KEY environment variable is not set.\n" +
11
- "Generate one at https://app.monnet.ai/settings (API Keys tab) and add it to your MCP client config.\n");
11
+ "Generate one at https://app.monnet.ai/settings and add it to your MCP client config.\n");
12
12
  process.exit(1);
13
13
  }
14
14
  export class MonnetApiError extends Error {
@@ -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,C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,48 +9,14 @@
9
9
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
10
10
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
11
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
12
- import { handleWhoami, WHOAMI_TOOL_DEFINITION } from "./tools/whoami.js";
13
- import { handleGetMotion, GET_MOTION_TOOL_DEFINITION } from "./tools/get-motion.js";
14
- import { handleListMotions, LIST_MOTIONS_TOOL_DEFINITION } from "./tools/list-motions.js";
15
- import { handleGetInbox, GET_INBOX_TOOL_DEFINITION } from "./tools/get-inbox.js";
16
- import { handleCreateMotion, CREATE_MOTION_TOOL_DEFINITION } from "./tools/create-motion.js";
17
- import { handleUpdateMotion, UPDATE_MOTION_TOOL_DEFINITION } from "./tools/update-motion.js";
18
- import { handleComment, COMMENT_TOOL_DEFINITION } from "./tools/comment.js";
19
- import { handleApprove, APPROVE_TOOL_DEFINITION } from "./tools/approve.js";
20
- import { handleReject, REJECT_TOOL_DEFINITION } from "./tools/reject.js";
21
- import { handleAskMonnet, ASK_MONNET_TOOL_DEFINITION } from "./tools/ask-monnet.js";
22
- import { handleListWorkspaces, LIST_WORKSPACES_TOOL_DEFINITION } from "./tools/list-workspaces.js";
23
- import { handleGetWorkspaceMemory, GET_WORKSPACE_MEMORY_TOOL_DEFINITION } from "./tools/get-workspace-memory.js";
24
- import { requiresSendApproval, requestSendApproval } from "./approval.js";
25
- const TOOLS = [
26
- WHOAMI_TOOL_DEFINITION,
27
- LIST_WORKSPACES_TOOL_DEFINITION,
28
- GET_WORKSPACE_MEMORY_TOOL_DEFINITION,
29
- GET_MOTION_TOOL_DEFINITION,
30
- LIST_MOTIONS_TOOL_DEFINITION,
31
- GET_INBOX_TOOL_DEFINITION,
32
- CREATE_MOTION_TOOL_DEFINITION,
33
- UPDATE_MOTION_TOOL_DEFINITION,
34
- COMMENT_TOOL_DEFINITION,
35
- APPROVE_TOOL_DEFINITION,
36
- REJECT_TOOL_DEFINITION,
37
- ASK_MONNET_TOOL_DEFINITION,
38
- ];
39
- const HANDLERS = {
40
- monnet_whoami: handleWhoami,
41
- list_workspaces: handleListWorkspaces,
42
- get_workspace_memory: handleGetWorkspaceMemory,
43
- get_motion: handleGetMotion,
44
- list_motions: handleListMotions,
45
- get_inbox: handleGetInbox,
46
- create_motion: handleCreateMotion,
47
- update_motion: handleUpdateMotion,
48
- comment: handleComment,
49
- approve: handleApprove,
50
- reject: handleReject,
51
- ask_monnet: handleAskMonnet,
52
- };
53
- const server = new Server({ name: "monnet", version: "0.1.0" }, { capabilities: { tools: {} } });
12
+ import { SERVER_INSTRUCTIONS } from "./instructions.js";
13
+ import { TOOLS, HANDLERS } from "./registry.js";
14
+ import { requiresApproval, requestApproval } from "./approval.js";
15
+ const server = new Server({ name: "monnet", version: "0.4.0" },
16
+ // `instructions` reaches the client before any tool call, which is the only
17
+ // place to say what Monnet IS. A tool description explains one call;
18
+ // nothing else explains the surface the calls sit on.
19
+ { capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS });
54
20
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
55
21
  tools: TOOLS,
56
22
  }));
@@ -65,8 +31,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
65
31
  };
66
32
  }
67
33
  try {
68
- if (requiresSendApproval(toolName)) {
69
- const verdict = await requestSendApproval(server, toolName, args);
34
+ if (requiresApproval(toolName)) {
35
+ const verdict = await requestApproval(server, toolName, args);
70
36
  if (!verdict.approved) {
71
37
  return { content: [{ type: "text", text: verdict.deniedReason }] };
72
38
  }
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,E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CAAC,EAAE,CAAC;IAC/C,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"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What a client is told about Monnet before it calls anything.
3
+ *
4
+ * Server-level, so it belongs here rather than inside one feature folder — the
5
+ * wiki paragraph used to be the whole thing, which left eleven motion and
6
+ * inbox tools unexplained and no obvious place to explain them.
7
+ *
8
+ * Deliberately NOT Monnet's own system prompt. That one is hundreds of lines
9
+ * about facilitating a conversation it is currently inside, with a motion in
10
+ * context and tools this server does not expose; a client reading it would be
11
+ * following instructions that mostly do not apply to it. What belongs here is
12
+ * the shape of the product and the handful of things an agent gets wrong
13
+ * without being told — everything else is on the tools themselves.
14
+ */
15
+ export declare const SERVER_INSTRUCTIONS: string;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * What a client is told about Monnet before it calls anything.
3
+ *
4
+ * Server-level, so it belongs here rather than inside one feature folder — the
5
+ * wiki paragraph used to be the whole thing, which left eleven motion and
6
+ * inbox tools unexplained and no obvious place to explain them.
7
+ *
8
+ * Deliberately NOT Monnet's own system prompt. That one is hundreds of lines
9
+ * about facilitating a conversation it is currently inside, with a motion in
10
+ * context and tools this server does not expose; a client reading it would be
11
+ * following instructions that mostly do not apply to it. What belongs here is
12
+ * the shape of the product and the handful of things an agent gets wrong
13
+ * without being told — everything else is on the tools themselves.
14
+ */
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
+
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.
18
+
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
+ const HOW_TO_ACT = `Two habits matter more than the rest.
21
+
22
+ Read before you write. get_motion before updating one, get_wiki_tree before deciding a subject has no page. Most of what looks new belongs on something that already exists, and Monnet is working the same material from inside the app.
23
+
24
+ Anything a person will see, or cannot take back, is theirs to approve. The tools that stop and ask them out of band are comment, delete_wiki_page, delete_wiki_folder and delete_wiki_source; none of them happens if they decline. Say what you are about to do in your own words first: you will not be able to explain it inside the dialog.`;
25
+ const WIKI = `Before your first write to a workspace's company brain, call get_wiki_schema. It carries that team's own rules for how their brain is organised — page types, templates, the link format — and is the same text the nightly ingest job runs on, so a page you write matches the ones Monnet writes.
26
+
27
+ Sources are the raw material a brain is built from. list_wiki_sources shows them and read_wiki_source opens one — worth doing when a page looks wrong, since the source is the record and the page is only what was made of it. They are never edited: correct the page instead.
28
+
29
+ You can do the digesting yourself rather than leaving it to the nightly job: read the queued FILES, fold what they say into the pages they belong on, then mark_wiki_source_ingested each one. That last step is not optional — a source left queued is read again that night and written over your work, and requeue_wiki_source is there if you marked one too early. A closed motion listed as queued is read with get_motion and cannot be marked: it leaves the queue on the next run's date. Push long or many-subject material with push_wiki_source and let the job take it instead; write a page yourself when you already know where a fact belongs.`;
30
+ export const SERVER_INSTRUCTIONS = [WHAT_MONNET_IS, HOW_TO_ACT, WIKI].join("\n\n");
31
+ //# sourceMappingURL=instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,cAAc,GAAG;;;;0MAImL,CAAC;AAE3M,MAAM,UAAU,GAAG;;;;gVAI6T,CAAC;AAEjV,MAAM,IAAI,GAAG;;;;+nBAIknB,CAAC;AAEhoB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Every tool this server exposes, and the handler each name dispatches to.
3
+ *
4
+ * Its own module because `index.ts` connects the transport at the top level:
5
+ * importing it starts a server, so nothing could read the registry to check
6
+ * it — and the two things worth checking are both name matches that `tsc`
7
+ * cannot see. The approval gate keys off these names, and so does the
8
+ * client-facing brief in `instructions.ts`.
9
+ */
10
+ export declare const TOOLS: ({
11
+ name: string;
12
+ description: string;
13
+ inputSchema: {
14
+ type: "object";
15
+ properties: {};
16
+ required: never[];
17
+ };
18
+ } | {
19
+ name: string;
20
+ description: string;
21
+ inputSchema: {
22
+ type: "object";
23
+ properties: {
24
+ workspace_slug: {
25
+ type: string;
26
+ description: string;
27
+ };
28
+ motion_short_id: {
29
+ type: string;
30
+ description: string;
31
+ };
32
+ };
33
+ required: string[];
34
+ };
35
+ } | {
36
+ name: string;
37
+ description: string;
38
+ inputSchema: {
39
+ type: "object";
40
+ properties: {
41
+ workspace_slug: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ status: {
46
+ type: string;
47
+ description: string;
48
+ enum: readonly ["draft", "open", "closed"];
49
+ };
50
+ page: {
51
+ type: string;
52
+ description: string;
53
+ minimum: number;
54
+ };
55
+ limit: {
56
+ type: string;
57
+ description: string;
58
+ minimum: number;
59
+ maximum: number;
60
+ };
61
+ };
62
+ required: string[];
63
+ };
64
+ } | {
65
+ name: string;
66
+ description: string;
67
+ inputSchema: {
68
+ type: "object";
69
+ properties: {
70
+ workspace_slug: {
71
+ type: string;
72
+ description: string;
73
+ };
74
+ prompt: {
75
+ type: string;
76
+ description: string;
77
+ };
78
+ };
79
+ required: string[];
80
+ };
81
+ } | {
82
+ name: string;
83
+ description: string;
84
+ inputSchema: {
85
+ type: "object";
86
+ properties: {
87
+ workspace_slug: {
88
+ type: "string";
89
+ description: string;
90
+ };
91
+ };
92
+ required: string[];
93
+ };
94
+ })[];
95
+ export declare const HANDLERS: Record<string, (args: unknown) => Promise<string>>;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Every tool this server exposes, and the handler each name dispatches to.
3
+ *
4
+ * Its own module because `index.ts` connects the transport at the top level:
5
+ * importing it starts a server, so nothing could read the registry to check
6
+ * it — and the two things worth checking are both name matches that `tsc`
7
+ * cannot see. The approval gate keys off these names, and so does the
8
+ * client-facing brief in `instructions.ts`.
9
+ */
10
+ import { handleWhoami, WHOAMI_TOOL_DEFINITION } from "./tools/whoami.js";
11
+ import { handleGetMotion, GET_MOTION_TOOL_DEFINITION } from "./tools/get-motion.js";
12
+ import { handleListMotions, LIST_MOTIONS_TOOL_DEFINITION } from "./tools/list-motions.js";
13
+ import { handleGetInbox, GET_INBOX_TOOL_DEFINITION } from "./tools/get-inbox.js";
14
+ import { handleCreateMotion, CREATE_MOTION_TOOL_DEFINITION } from "./tools/create-motion.js";
15
+ import { handleUpdateMotion, UPDATE_MOTION_TOOL_DEFINITION } from "./tools/update-motion.js";
16
+ import { handleComment, COMMENT_TOOL_DEFINITION } from "./tools/comment.js";
17
+ import { handleApprove, APPROVE_TOOL_DEFINITION } from "./tools/approve.js";
18
+ import { handleReject, REJECT_TOOL_DEFINITION } from "./tools/reject.js";
19
+ import { handleAskMonnet, ASK_MONNET_TOOL_DEFINITION } from "./tools/ask-monnet.js";
20
+ import { handleListWorkspaces, LIST_WORKSPACES_TOOL_DEFINITION } from "./tools/list-workspaces.js";
21
+ import { WIKI_HANDLERS, WIKI_TOOLS } from "./tools/wiki/index.js";
22
+ export const TOOLS = [
23
+ WHOAMI_TOOL_DEFINITION,
24
+ LIST_WORKSPACES_TOOL_DEFINITION,
25
+ GET_MOTION_TOOL_DEFINITION,
26
+ LIST_MOTIONS_TOOL_DEFINITION,
27
+ GET_INBOX_TOOL_DEFINITION,
28
+ CREATE_MOTION_TOOL_DEFINITION,
29
+ UPDATE_MOTION_TOOL_DEFINITION,
30
+ COMMENT_TOOL_DEFINITION,
31
+ APPROVE_TOOL_DEFINITION,
32
+ REJECT_TOOL_DEFINITION,
33
+ ASK_MONNET_TOOL_DEFINITION,
34
+ ...WIKI_TOOLS,
35
+ ];
36
+ export const HANDLERS = {
37
+ monnet_whoami: handleWhoami,
38
+ list_workspaces: handleListWorkspaces,
39
+ get_motion: handleGetMotion,
40
+ list_motions: handleListMotions,
41
+ get_inbox: handleGetInbox,
42
+ create_motion: handleCreateMotion,
43
+ update_motion: handleUpdateMotion,
44
+ comment: handleComment,
45
+ approve: handleApprove,
46
+ reject: handleReject,
47
+ ask_monnet: handleAskMonnet,
48
+ ...WIKI_HANDLERS,
49
+ };
50
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +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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