@cpenned/mcp 0.9.1 → 0.11.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 +37 -8
- package/dist/apps.js +74 -0
- package/dist/apps.js.map +1 -0
- package/dist/open.js +90 -0
- package/dist/open.js.map +1 -0
- package/dist/server.js +17 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/api.js +2 -0
- package/dist/tools/api.js.map +1 -1
- package/dist/tools/history.js +93 -0
- package/dist/tools/history.js.map +1 -0
- package/dist/tools/index.js +0 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/ui.js +4 -37
- package/dist/tools/ui.js.map +1 -1
- package/dist-ui/agenda.html +656 -0
- package/dist-ui/board.html +661 -0
- package/dist-ui/habits.html +656 -0
- package/dist-ui/receipt.html +655 -0
- package/dist-ui/reviews.html +654 -0
- package/dist-ui/task.html +659 -0
- package/dist-ui/triage.html +654 -0
- package/package.json +6 -4
- package/skills/open-brain-mcp/SKILL.md +42 -5
package/README.md
CHANGED
|
@@ -15,8 +15,9 @@ Set via environment variables:
|
|
|
15
15
|
| `OPEN_BRAIN_CLIENT_TYPE` | no | `X-Client` stamped on the audit log (default `mcp`) |
|
|
16
16
|
|
|
17
17
|
The key's scopes gate the tools: resource tools need `<resource>:read|write`,
|
|
18
|
-
review tools `reviews:*`, settings tools `settings:read|write`,
|
|
19
|
-
`
|
|
18
|
+
review tools `reviews:*`, settings tools `settings:read|write`, history tools
|
|
19
|
+
`history:read` (plus `history:write` and the entity's write scope for
|
|
20
|
+
`revert_change`), and `find_tasks` / `ai_triage` need `ai:invoke`. `list_shares`/`list_shared_tasks`
|
|
20
21
|
additionally need the key to have been minted with `includeGrants: true` (via
|
|
21
22
|
`create_key`'s `includeGrants` flag or the web app) - without it, a key only
|
|
22
23
|
ever sees the vault's own data, even with `*`.
|
|
@@ -101,8 +102,8 @@ Point the `args` at the absolute `packages/mcp/dist/index.js` path with
|
|
|
101
102
|
`add_person_links`/`remove_person_links` (link people to tasks, projects,
|
|
102
103
|
gardens, and other people — person-to-person connections are symmetric and
|
|
103
104
|
take an optional label like "spouse", plus `readingListItemIds` and
|
|
104
|
-
`habitIds` on either side). People with an elapsed contact cadence appear in
|
|
105
|
-
|
|
105
|
+
`habitIds` on either side). People with an elapsed contact cadence appear in
|
|
106
|
+
`get_reviews`; `list_tasks` filters by `person` ids.
|
|
106
107
|
- **Reading list**: `create_reading_item` (only `url` is required; title/
|
|
107
108
|
description are fetched from the page in the background), `list_reading_items`,
|
|
108
109
|
`get_reading_item`, `update_reading_item` (drives status
|
|
@@ -169,10 +170,28 @@ Point the `args` at the absolute `packages/mcp/dist/index.js` path with
|
|
|
169
170
|
deadlines resolve against. `yearlyBookGoal` sets the reading-challenge
|
|
170
171
|
target (books finished this calendar year); `null` clears it.
|
|
171
172
|
- **AI**: `find_tasks` (hybrid search), `ai_triage` (brain-dump triage).
|
|
172
|
-
- **
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
- **Interactive cards (MCP Apps)**: in hosts that support
|
|
174
|
+
[MCP Apps](https://modelcontextprotocol.io/docs/extensions/apps) (Claude
|
|
175
|
+
desktop and web, ChatGPT, VS Code), these tools render a card in the chat
|
|
176
|
+
alongside their normal JSON:
|
|
177
|
+
|
|
178
|
+
| Tool | Card | Actions |
|
|
179
|
+
| --- | --- | --- |
|
|
180
|
+
| `get_task`, `create_task`, `update_task` | Task | Done / Reopen, Defer to tomorrow, Open |
|
|
181
|
+
| `get_view` | Today / upcoming / overdue agenda | Tick to complete |
|
|
182
|
+
| `create_tasks` | Created tasks | Undo, Undo all |
|
|
183
|
+
| `ai_triage` | Captured tasks, habits, reading, books + questions | Undo, Undo all |
|
|
184
|
+
| `get_reviews` | Review queue | Reviewed, Contacted |
|
|
185
|
+
| `list_habits` | Habits with streaks and progress | Tick to check in / undo today |
|
|
186
|
+
| `review_garden` | Garden board (status columns) | Tick to complete |
|
|
187
|
+
|
|
188
|
+
Titles open the item in the Open Brain Mac app when it is installed
|
|
189
|
+
(`openbrain://` links), otherwise in the web app (its address comes from
|
|
190
|
+
`GET /v1/profile`'s `webUrl`, which needs `settings:read`). Card buttons call
|
|
191
|
+
the normal tools, so they need the same scopes, and each action is reported
|
|
192
|
+
back to the model. Clients without MCP Apps support (Claude Code, the CLI)
|
|
193
|
+
ignore the cards and read the same JSON as before. The old inline `ui_*`
|
|
194
|
+
tools were removed in favor of these cards.
|
|
176
195
|
- **Mind Meld** (shared gardens, guest side - sharing/invites/revoke are
|
|
177
196
|
web-app-only): `list_shares` (gardens shared with the caller: capabilities,
|
|
178
197
|
owner, participants - empty unless the key has `includeGrants`),
|
|
@@ -186,6 +205,16 @@ Point the `args` at the absolute `packages/mcp/dist/index.js` path with
|
|
|
186
205
|
- **Profile**: `get_profile`, `update_profile` (`displayName`, 1-60 chars,
|
|
187
206
|
and/or `notifications: {emailOnMention?, emailOnAssign?}` to turn mention and
|
|
188
207
|
assignment emails on or off; avatar upload is web-only).
|
|
208
|
+
- **History** (every change from every surface, with before/after values):
|
|
209
|
+
`list_history` (filters `entityType`, `entityId`, `source`, `actor`,
|
|
210
|
+
`since`/`until` as epoch ms or ISO, `batchId`, `limit` 1-200, `cursor`;
|
|
211
|
+
only entity types the key can read), `get_history_entry`, `revert_change`
|
|
212
|
+
(`{id}` or `{batchId}` for a whole bulk action, `force?`). An update revert
|
|
213
|
+
restores fields still equal to their `after` value and reports the rest as
|
|
214
|
+
conflicts unless `force`; reverting a create soft-deletes, reverting a delete
|
|
215
|
+
restores, tag/link adds and removes invert. The result's `batchId` reverts
|
|
216
|
+
the revert (redo). System rows, recurrence spawns, settings, keys, webhooks
|
|
217
|
+
and attachments are not revertable (400).
|
|
189
218
|
- **Key management**: `create_key` (optional `includeGrants` so the minted key
|
|
190
219
|
can see gardens shared with its owner - only settable if the calling key
|
|
191
220
|
itself has it), `list_keys`, `rotate_key`, `revoke_key`
|
package/dist/apps.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// MCP Apps: interactive cards that UI-capable hosts (Claude, ChatGPT, VS Code)
|
|
2
|
+
// render in place of a tool's JSON. Each card is a static HTML resource built
|
|
3
|
+
// from ui/ into dist-ui/ (scripts/build-ui.mjs); the host feeds it the tool's
|
|
4
|
+
// input and result, and its buttons call back into the regular tools. Clients
|
|
5
|
+
// without UI support ignore the metadata and keep reading the JSON text.
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
|
+
import { RESOURCE_MIME_TYPE, RESOURCE_URI_META_KEY, registerAppResource, } from "@modelcontextprotocol/ext-apps/server";
|
|
8
|
+
export const APP_CARDS = {
|
|
9
|
+
task: {
|
|
10
|
+
title: "Task card",
|
|
11
|
+
description: "One task with Done / Reopen / Defer to tomorrow actions.",
|
|
12
|
+
},
|
|
13
|
+
agenda: {
|
|
14
|
+
title: "Agenda card",
|
|
15
|
+
description: "A today / upcoming / overdue view with check-to-complete rows.",
|
|
16
|
+
},
|
|
17
|
+
receipt: {
|
|
18
|
+
title: "Created tasks card",
|
|
19
|
+
description: "What a batch create made, with per-task and bulk Undo.",
|
|
20
|
+
},
|
|
21
|
+
reviews: {
|
|
22
|
+
title: "Review queue card",
|
|
23
|
+
description: "Tasks and projects due for review and people to reach out to.",
|
|
24
|
+
},
|
|
25
|
+
habits: {
|
|
26
|
+
title: "Habits card",
|
|
27
|
+
description: "Habits with streaks and progress; tick to check in for today.",
|
|
28
|
+
},
|
|
29
|
+
board: {
|
|
30
|
+
title: "Garden board card",
|
|
31
|
+
description: "A garden's open tasks in status columns, plus its projects.",
|
|
32
|
+
},
|
|
33
|
+
triage: {
|
|
34
|
+
title: "Triage card",
|
|
35
|
+
description: "What a brain-dump triage captured, with Undo and open questions.",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const cardUri = (card) => `ui://open-brain/${card}.html`;
|
|
39
|
+
export const TOOL_CARDS = {
|
|
40
|
+
get_task: "task",
|
|
41
|
+
create_task: "task",
|
|
42
|
+
update_task: "task",
|
|
43
|
+
get_view: "agenda",
|
|
44
|
+
create_tasks: "receipt",
|
|
45
|
+
get_reviews: "reviews",
|
|
46
|
+
list_habits: "habits",
|
|
47
|
+
review_garden: "board",
|
|
48
|
+
ai_triage: "triage",
|
|
49
|
+
};
|
|
50
|
+
// Both the current key and the legacy flat key, as registerAppTool emits them.
|
|
51
|
+
export function cardMeta(toolName) {
|
|
52
|
+
const card = TOOL_CARDS[toolName];
|
|
53
|
+
if (!card)
|
|
54
|
+
return undefined;
|
|
55
|
+
const uri = cardUri(card);
|
|
56
|
+
return { ui: { resourceUri: uri }, [RESOURCE_URI_META_KEY]: uri };
|
|
57
|
+
}
|
|
58
|
+
// src/apps.ts and dist/apps.js both sit one level under the package root.
|
|
59
|
+
const UI_DIR = new URL("../dist-ui/", import.meta.url);
|
|
60
|
+
export function registerAppCards(server) {
|
|
61
|
+
for (const [card, { title, description }] of Object.entries(APP_CARDS)) {
|
|
62
|
+
const uri = cardUri(card);
|
|
63
|
+
registerAppResource(server, title, uri, { description, mimeType: RESOURCE_MIME_TYPE }, async () => ({
|
|
64
|
+
contents: [
|
|
65
|
+
{
|
|
66
|
+
uri,
|
|
67
|
+
mimeType: RESOURCE_MIME_TYPE,
|
|
68
|
+
text: await readFile(new URL(`${card}.html`, UI_DIR), "utf8"),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=apps.js.map
|
package/dist/apps.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../src/apps.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,M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AAE,CAAC,qBAAqB,CAAC,EAAE,GAAG,EAAE,CAAC;AACpE,CAAC;AAED,0EAA0E;AAC1E,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvD,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACvE,MAAM,GAAG,GAAG,OAAO,CAAC,IAAe,CAAC,CAAC;QACrC,mBAAmB,CACjB,MAAM,EACN,KAAK,EACL,GAAG,EACH,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAC7C,KAAK,IAAI,EAAE,CAAC,CAAC;YACX,QAAQ,EAAE;gBACR;oBACE,GAAG;oBACH,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC;iBAC9D;aACF;SACF,CAAC,CACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/open.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// "Open" from a card: prefer the native app (openbrain:// deep link, handled by
|
|
2
|
+
// the macOS app) and fall back to the web app. The stdio server runs on the
|
|
3
|
+
// user's own machine, so it can launch either itself; a hosted server can't,
|
|
4
|
+
// and hands the web URL back for the card to open through the host.
|
|
5
|
+
import { execFile } from "node:child_process";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { runTool } from "./result.js";
|
|
8
|
+
import { idField } from "./tools/schemas.js";
|
|
9
|
+
export const systemOpener = (url) => {
|
|
10
|
+
const command = process.platform === "darwin"
|
|
11
|
+
? "open"
|
|
12
|
+
: process.platform === "linux"
|
|
13
|
+
? "xdg-open"
|
|
14
|
+
: undefined;
|
|
15
|
+
if (!command)
|
|
16
|
+
return Promise.resolve(false);
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
execFile(command, [url], (error) => resolve(!error));
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export const openKindEnum = z.enum([
|
|
22
|
+
"task",
|
|
23
|
+
"project",
|
|
24
|
+
"garden",
|
|
25
|
+
"habit",
|
|
26
|
+
"person",
|
|
27
|
+
"reading",
|
|
28
|
+
"book",
|
|
29
|
+
]);
|
|
30
|
+
// The macOS app's DeepLink routes; habits only open as the list, people not at all.
|
|
31
|
+
const APP_PATH = {
|
|
32
|
+
task: (id) => `task/${id}`,
|
|
33
|
+
project: (id) => `project/${id}`,
|
|
34
|
+
garden: (id) => `garden/${id}`,
|
|
35
|
+
habit: () => "habits",
|
|
36
|
+
person: () => undefined,
|
|
37
|
+
reading: () => undefined,
|
|
38
|
+
book: () => undefined,
|
|
39
|
+
};
|
|
40
|
+
// packages/web/src/routes/_authed: task.$taskId, habits_.$habitId, ...
|
|
41
|
+
const WEB_PATH = {
|
|
42
|
+
task: "task",
|
|
43
|
+
project: "project",
|
|
44
|
+
garden: "garden",
|
|
45
|
+
habit: "habits",
|
|
46
|
+
person: "person",
|
|
47
|
+
reading: "reading",
|
|
48
|
+
book: "books",
|
|
49
|
+
};
|
|
50
|
+
export function appUrl(kind, id) {
|
|
51
|
+
const path = APP_PATH[kind](id);
|
|
52
|
+
return path ? `openbrain://${path}` : undefined;
|
|
53
|
+
}
|
|
54
|
+
export function webUrl(origin, kind, id) {
|
|
55
|
+
return `${origin.replace(/\/+$/, "")}/${WEB_PATH[kind]}/${encodeURIComponent(id)}`;
|
|
56
|
+
}
|
|
57
|
+
const openItemSchema = z.object({ kind: openKindEnum, id: idField });
|
|
58
|
+
export function registerOpenTool(server, client, opener) {
|
|
59
|
+
let origin;
|
|
60
|
+
const webOrigin = () => {
|
|
61
|
+
origin ??= client
|
|
62
|
+
.get("/v1/profile")
|
|
63
|
+
.then(({ webUrl }) => {
|
|
64
|
+
if (!webUrl)
|
|
65
|
+
throw new Error("This deployment has no web app URL (SITE_URL).");
|
|
66
|
+
return webUrl;
|
|
67
|
+
})
|
|
68
|
+
.catch((error) => {
|
|
69
|
+
origin = undefined;
|
|
70
|
+
throw error;
|
|
71
|
+
});
|
|
72
|
+
return origin;
|
|
73
|
+
};
|
|
74
|
+
async function openItem({ kind, id }) {
|
|
75
|
+
const native = appUrl(kind, id);
|
|
76
|
+
if (opener && native && (await opener(native)))
|
|
77
|
+
return { opened: "app", url: native };
|
|
78
|
+
const url = webUrl(await webOrigin(), kind, id);
|
|
79
|
+
if (opener && (await opener(url)))
|
|
80
|
+
return { opened: "web", url };
|
|
81
|
+
return { opened: null, url };
|
|
82
|
+
}
|
|
83
|
+
server.registerTool("open_item", {
|
|
84
|
+
title: "Open in Open Brain",
|
|
85
|
+
description: "Card-only: open a task, project, garden, habit, person, reading item or book in the Open Brain app, falling back to the web app.",
|
|
86
|
+
inputSchema: openItemSchema.shape,
|
|
87
|
+
_meta: { ui: { visibility: ["app"] } },
|
|
88
|
+
}, (args) => runTool(() => openItem(args)));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=open.js.map
|
package/dist/open.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../src/open.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,6EAA6E;AAC7E,oEAAoE;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK7C,MAAM,CAAC,MAAM,YAAY,GAAW,CAAC,GAAG,EAAE,EAAE;IAC1C,MAAM,OAAO,GACX,OAAO,CAAC,QAAQ,KAAK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AM,IAAI,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;YAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QACtF,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,MAAM,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACjE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,YAAY,CACjB,WAAW,EACX;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,kIAAkI;QACpI,WAAW,EAAE,cAAc,CAAC,KAAK;QACjC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;KACvC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACxC,CAAC;AACJ,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { cardMeta, registerAppCards } from "./apps.js";
|
|
3
|
+
import { registerOpenTool, systemOpener } from "./open.js";
|
|
2
4
|
import { registerAllTools } from "./tools/index.js";
|
|
3
5
|
import { registerSkillTools, skillsStatus } from "./tools/skills.js";
|
|
4
6
|
// Surfaced to the client on initialize. When the bundled skill isn't installed
|
|
@@ -14,7 +16,7 @@ function buildInstructions(localSkills) {
|
|
|
14
16
|
return (`${base} The bundled agent skill (${missing.map((s) => s.name).join(", ")}) is not installed on this machine. ` +
|
|
15
17
|
"Early in the first conversation, offer once to install it with the install_skills tool (a local copy into ~/.claude/skills) so future sessions drive these tools well; respect the user's answer and don't re-offer.");
|
|
16
18
|
}
|
|
17
|
-
const READ_ONLY_TOOL = /^(get|list|find|search
|
|
19
|
+
const READ_ONLY_TOOL = /^(get|list|find|search)_|^review_garden$/;
|
|
18
20
|
const DESTRUCTIVE_TOOL = /^(delete|revoke|rotate|remove)_/;
|
|
19
21
|
// Derived from the tool naming convention so every new tool is annotated
|
|
20
22
|
// without per-registration boilerplate. Unmatched tools keep the SDK defaults.
|
|
@@ -25,15 +27,26 @@ export function toolAnnotations(name) {
|
|
|
25
27
|
return { destructiveHint: true };
|
|
26
28
|
return undefined;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
// Annotations and MCP App card metadata both key off the tool name, so tool
|
|
31
|
+
// modules stay plain registerTool calls (convex/chat.ts reuses them as-is).
|
|
32
|
+
function decorateRegistrations(server) {
|
|
29
33
|
const register = server.registerTool.bind(server);
|
|
30
|
-
server.registerTool = ((name, config, cb) =>
|
|
34
|
+
server.registerTool = ((name, config, cb) => {
|
|
35
|
+
const meta = cardMeta(name);
|
|
36
|
+
return register(name, {
|
|
37
|
+
...config,
|
|
38
|
+
annotations: { ...toolAnnotations(name), ...config.annotations },
|
|
39
|
+
...(meta ? { _meta: { ...meta, ...config._meta } } : {}),
|
|
40
|
+
}, cb);
|
|
41
|
+
});
|
|
31
42
|
}
|
|
32
43
|
export function createServer(client, options = {}) {
|
|
33
44
|
const localSkills = options.localSkills ?? true;
|
|
34
45
|
const server = new McpServer({ name: "open-brain", version: "0.1.0" }, { instructions: buildInstructions(localSkills) });
|
|
35
|
-
|
|
46
|
+
decorateRegistrations(server);
|
|
36
47
|
registerAllTools(server, client);
|
|
48
|
+
registerAppCards(server);
|
|
49
|
+
registerOpenTool(server, client, options.opener ?? (localSkills ? systemOpener : undefined));
|
|
37
50
|
if (localSkills)
|
|
38
51
|
registerSkillTools(server);
|
|
39
52
|
return server;
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAe,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAErE,+EAA+E;AAC/E,+EAA+E;AAC/E,2EAA2E;AAC3E,SAAS,iBAAiB,CAAC,WAAoB;IAC7C,MAAM,IAAI,GACR,8GAA8G,CAAC;IACjH,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,CACL,GAAG,IAAI,6BAA6B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,sCAAsC;QAC/G,sNAAsN,CACvN,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,0CAA0C,CAAC;AAClE,MAAM,gBAAgB,GAAG,iCAAiC,CAAC;AAE3D,yEAAyE;AACzE,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,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zB,gBAAgB,CACd,MAAM,EACN,MAAM,EACN,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3D,CAAC;IACF,IAAI,WAAW;QAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/tools/api.js
CHANGED
|
@@ -5,6 +5,7 @@ import { registerCalendarTools } from "./calendar.js";
|
|
|
5
5
|
import { registerCommentTools } from "./comments.js";
|
|
6
6
|
import { registerGardenTools } from "./gardens.js";
|
|
7
7
|
import { registerHabitTools } from "./habits.js";
|
|
8
|
+
import { registerHistoryTools } from "./history.js";
|
|
8
9
|
import { registerKeyTools } from "./keys.js";
|
|
9
10
|
import { registerListTools } from "./lists.js";
|
|
10
11
|
import { registerPeopleTools } from "./people.js";
|
|
@@ -37,5 +38,6 @@ export function registerApiTools(server, client) {
|
|
|
37
38
|
registerSettingsTools(server, client);
|
|
38
39
|
registerShareTools(server, client);
|
|
39
40
|
registerProfileTools(server, client);
|
|
41
|
+
registerHistoryTools(server, client);
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=api.js.map
|
package/dist/tools/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/tools/api.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC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C,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Change history tools. Every write to the vault (from any surface) is recorded
|
|
2
|
+
// with before/after values; list_history browses it and revert_change undoes a
|
|
3
|
+
// change or a whole batch. Reverting a revert is a redo.
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { apiPath } from "../client.js";
|
|
6
|
+
import { runTool } from "../result.js";
|
|
7
|
+
import { idField } from "./schemas.js";
|
|
8
|
+
export const historyEntityTypeEnum = z.enum([
|
|
9
|
+
"task",
|
|
10
|
+
"project",
|
|
11
|
+
"garden",
|
|
12
|
+
"tag",
|
|
13
|
+
"person",
|
|
14
|
+
"list",
|
|
15
|
+
"apiKey",
|
|
16
|
+
"attachment",
|
|
17
|
+
"webhook",
|
|
18
|
+
"vault",
|
|
19
|
+
"readingListItem",
|
|
20
|
+
"stravaActivity",
|
|
21
|
+
"habit",
|
|
22
|
+
"book",
|
|
23
|
+
"calendarEvent",
|
|
24
|
+
"calendarConnection",
|
|
25
|
+
"taskComment",
|
|
26
|
+
]);
|
|
27
|
+
const timeField = z
|
|
28
|
+
.union([z.number(), z.string()])
|
|
29
|
+
.describe("Epoch milliseconds or an ISO date/time, e.g. 2026-11-04 or 2026-11-04T09:00:00Z");
|
|
30
|
+
const listHistorySchema = z.object({
|
|
31
|
+
entityType: historyEntityTypeEnum.optional(),
|
|
32
|
+
entityId: z.string().optional().describe("Only changes to this entity"),
|
|
33
|
+
source: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("Surface that made the change: web, mac, ios, mcp, cli, raycast, api, ai, chat, email, meld, integration, system, strava, linear"),
|
|
37
|
+
actor: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Who made it: an API key id, a user id, "ai", "email" or "system"'),
|
|
41
|
+
since: timeField.optional(),
|
|
42
|
+
until: timeField.optional(),
|
|
43
|
+
batchId: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Only the changes of one bulk/multi-entity action"),
|
|
47
|
+
limit: z.number().int().min(1).max(200).optional().describe("Page size, default 50"),
|
|
48
|
+
cursor: z.string().optional().describe("nextCursor from a previous page"),
|
|
49
|
+
});
|
|
50
|
+
export function listHistory(client, args) {
|
|
51
|
+
return client.get("/v1/history", { ...args });
|
|
52
|
+
}
|
|
53
|
+
const getHistoryEntrySchema = z.object({ id: idField.describe("History entry id") });
|
|
54
|
+
export function getHistoryEntry(client, args) {
|
|
55
|
+
return client.get(apiPath `/v1/history/${args.id}`);
|
|
56
|
+
}
|
|
57
|
+
const revertChangeSchema = z.object({
|
|
58
|
+
id: idField.optional().describe("History entry id to revert"),
|
|
59
|
+
batchId: idField
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Revert every change of one batch instead (a bulk or multi-entity action)"),
|
|
62
|
+
force: z
|
|
63
|
+
.boolean()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Overwrite fields that changed since this entry (conflicts). Default false skips them."),
|
|
66
|
+
});
|
|
67
|
+
export function revertChange(client, args) {
|
|
68
|
+
const body = args.force === undefined ? {} : { force: args.force };
|
|
69
|
+
if (args.batchId && !args.id)
|
|
70
|
+
return client.post(apiPath `/v1/history/batches/${args.batchId}/revert`, body);
|
|
71
|
+
if (args.id && !args.batchId)
|
|
72
|
+
return client.post(apiPath `/v1/history/${args.id}/revert`, body);
|
|
73
|
+
throw new Error("Pass exactly one of id or batchId");
|
|
74
|
+
}
|
|
75
|
+
export function registerHistoryTools(server, client) {
|
|
76
|
+
server.registerTool("list_history", {
|
|
77
|
+
title: "List change history",
|
|
78
|
+
description: "Recent changes across the vault, newest first: { items, hasMore, nextCursor }. Each entry has id, entityType, entityId, action, summary, actor, source, at (epoch ms), fields, before/after (changed fields only; a missing key means unset), batchId, revertOf, revertedBy and revertable. Only entity types this key can read are returned. Filter by entity, type, source, actor, time window or batch.",
|
|
79
|
+
inputSchema: listHistorySchema.shape,
|
|
80
|
+
}, (args) => runTool(() => listHistory(client, args)));
|
|
81
|
+
server.registerTool("get_history_entry", {
|
|
82
|
+
title: "Get history entry",
|
|
83
|
+
description: "One change history entry by id, with its before/after values.",
|
|
84
|
+
inputSchema: getHistoryEntrySchema.shape,
|
|
85
|
+
}, (args) => runTool(() => getHistoryEntry(client, args)));
|
|
86
|
+
server.registerTool("revert_change", {
|
|
87
|
+
title: "Revert change",
|
|
88
|
+
description: "Undo one change (id) or every change of a batch (batchId). Updates write back `before` for each field still equal to `after`; fields edited since are conflicts and skipped unless force. Reverting a create soft-deletes (tasks/projects canceled, gardens/people/habits archived, tags/saved lists hard-deleted); reverting a delete restores; tag/link adds and removes invert. Returns { batchId, results, entries }: per-entity status (reverted, partial, conflict, noop, skipped), reverted fields, conflicts, skipped and newEntityId when a hard-deleted record returns under a new id. Revert the returned batchId to redo. Some changes are not revertable (system rows, recurrence spawns, settings, keys, webhooks, attachments) and fail with 400. Needs history:write plus the entity's write scope.",
|
|
89
|
+
inputSchema: revertChangeSchema.shape,
|
|
90
|
+
annotations: { destructiveHint: true },
|
|
91
|
+
}, (args) => runTool(() => revertChange(client, args)));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/tools/history.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,yDAAyD;AAGzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAwB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,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AS,EAAE,IAAI,CAAC,CAAC;IACnE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAuB;IAC7E,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,4YAA4Y;QAC9Y,WAAW,EAAE,iBAAiB,CAAC,KAAK;KACrC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACnD,CAAC;IACF,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,+DAA+D;QAC5E,WAAW,EAAE,qBAAqB,CAAC,KAAK;KACzC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACvD,CAAC;IACF,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,qxBAAqxB;QACvxB,WAAW,EAAE,kBAAkB,CAAC,KAAK;QACrC,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;KACvC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACpD,CAAC;AACJ,CAAC"}
|
package/dist/tools/index.js
CHANGED
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAuB;IACzE,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/tools/ui.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// defer, reschedule from the UI) are a later sub-stage.
|
|
1
|
+
// Legacy read-only MCPUI resources, returned inline in the tool result. The
|
|
2
|
+
// interactive MCP App cards (src/apps.ts) replace these one at a time: ui_view
|
|
3
|
+
// is now the get_view agenda card.
|
|
5
4
|
import { createUIResource } from "@mcp-ui/server";
|
|
6
5
|
import { z } from "zod";
|
|
7
6
|
import { apiPath } from "../client.js";
|
|
@@ -29,33 +28,6 @@ async function uiResult(uri, html, nextCursor) {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
const cursorOf = (page) => page.hasMore === false ? null : (page.nextCursor ?? null);
|
|
32
|
-
const VIEW_TITLES = {
|
|
33
|
-
today: "Today",
|
|
34
|
-
upcoming: "Upcoming",
|
|
35
|
-
overdue: "Overdue",
|
|
36
|
-
};
|
|
37
|
-
const viewUiSchema = z.object({
|
|
38
|
-
view: z.enum(["today", "upcoming", "overdue"]),
|
|
39
|
-
tz: z.string().optional(),
|
|
40
|
-
limit: z.number().int().positive().optional(),
|
|
41
|
-
cursor: z.string().optional().describe("Cursor from a previous page"),
|
|
42
|
-
});
|
|
43
|
-
export async function viewUi(client, args) {
|
|
44
|
-
try {
|
|
45
|
-
const data = await client.get(apiPath `/v1/views/${args.view}`, {
|
|
46
|
-
tz: args.tz,
|
|
47
|
-
limit: args.limit,
|
|
48
|
-
cursor: args.cursor,
|
|
49
|
-
});
|
|
50
|
-
const title = VIEW_TITLES[args.view];
|
|
51
|
-
const next = cursorOf(data);
|
|
52
|
-
const html = htmlDoc(title, section(title, data.items ?? []) + moreNote(next));
|
|
53
|
-
return uiResult(`ui://open-brain/view/${args.view}`, html, next);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return errorResult(error);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
31
|
const reviewQueueUiSchema = z.object({ gardenId: z.string().optional() });
|
|
60
32
|
export async function reviewQueueUi(client, args) {
|
|
61
33
|
try {
|
|
@@ -109,11 +81,6 @@ export async function habitsUi(client, args) {
|
|
|
109
81
|
}
|
|
110
82
|
}
|
|
111
83
|
export function registerUiTools(server, client) {
|
|
112
|
-
server.registerTool("ui_view", {
|
|
113
|
-
title: "View (UI)",
|
|
114
|
-
description: "Render a computed view (today/upcoming/overdue) as an HTML UI. When the page is cut short the result says so and gives the cursor for the next page.",
|
|
115
|
-
inputSchema: viewUiSchema.shape,
|
|
116
|
-
}, (args) => viewUi(client, args));
|
|
117
84
|
server.registerTool("ui_review_queue", {
|
|
118
85
|
title: "Review queue (UI)",
|
|
119
86
|
description: "Render the due-review queue (tasks + projects + people due for contact) as an HTML UI.",
|
|
@@ -126,7 +93,7 @@ export function registerUiTools(server, client) {
|
|
|
126
93
|
}, (args) => gardenBoardUi(client, args));
|
|
127
94
|
server.registerTool("ui_habits", {
|
|
128
95
|
title: "Habits (UI)",
|
|
129
|
-
description: "Render habits with status, due/progress, and streak metadata as an HTML UI.
|
|
96
|
+
description: "Render habits with status, due/progress, and streak metadata as an HTML UI. Pass cursor for the next page.",
|
|
130
97
|
inputSchema: habitsUiSchema.shape,
|
|
131
98
|
}, (args) => habitsUi(client, args));
|
|
132
99
|
}
|
package/dist/tools/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/tools/ui.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/tools/ui.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+E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