@cpenned/mcp 0.4.1 → 0.6.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 +12 -2
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/reading.js +21 -6
- package/dist/tools/reading.js.map +1 -1
- package/dist/tools/schemas.js +1 -1
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/strava.js +124 -0
- package/dist/tools/strava.js.map +1 -0
- package/package.json +1 -1
- package/skills/open-brain-mcp/SKILL.md +56 -18
package/README.md
CHANGED
|
@@ -78,8 +78,18 @@ Point the `args` at the absolute `packages/mcp/dist/index.js` path with
|
|
|
78
78
|
- **Reading list**: `create_reading_item` (only `url` is required; title/
|
|
79
79
|
description are fetched from the page in the background), `list_reading_items`,
|
|
80
80
|
`get_reading_item`, `update_reading_item` (drives status
|
|
81
|
-
`unread|reading|read
|
|
82
|
-
|
|
81
|
+
`unread|reading|read`; stamps/clears `readAt`; `archived`/`deleted` toggle
|
|
82
|
+
independently of status), `delete_reading_item` (true soft delete, hidden
|
|
83
|
+
everywhere; restore with `{deleted: false}`), `add_reading_tags`/
|
|
84
|
+
`remove_reading_tags`.
|
|
85
|
+
- **Strava**: `list_strava_activities`, `get_strava_activity`,
|
|
86
|
+
`update_strava_activity` (`notes`/`archived`/`deleted` only — everything
|
|
87
|
+
else is Strava-authoritative), `delete_strava_activity` (soft delete;
|
|
88
|
+
restore with `{deleted: false}`), `add_strava_activity_tags`/
|
|
89
|
+
`remove_strava_activity_tags`, `sync_strava_activities` (manual
|
|
90
|
+
backfill/fallback; real-time ingestion is a webhook). No create tool —
|
|
91
|
+
activities only arrive via webhook or sync. Requires connecting a Strava
|
|
92
|
+
account first, from the web app's Settings page.
|
|
83
93
|
- **Views & reviews**: `get_view`, `get_reviews`, `review_garden`,
|
|
84
94
|
`request_garden_review`, `mark_task_reviewed`, `mark_project_reviewed`.
|
|
85
95
|
- **Settings**: `get_settings`, `update_settings` — the default review period
|
package/dist/tools/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { registerPeopleTools } from "./people.js";
|
|
|
6
6
|
import { registerProjectTools } from "./projects.js";
|
|
7
7
|
import { registerReadingTools } from "./reading.js";
|
|
8
8
|
import { registerSettingsTools } from "./settings.js";
|
|
9
|
+
import { registerStravaTools } from "./strava.js";
|
|
9
10
|
import { registerTagTools } from "./tags.js";
|
|
10
11
|
import { registerTaskTools } from "./tasks.js";
|
|
11
12
|
import { registerUiTools } from "./ui.js";
|
|
@@ -17,6 +18,7 @@ export function registerAllTools(server, client) {
|
|
|
17
18
|
registerTagTools(server, client);
|
|
18
19
|
registerPeopleTools(server, client);
|
|
19
20
|
registerReadingTools(server, client);
|
|
21
|
+
registerStravaTools(server, client);
|
|
20
22
|
registerListTools(server, client);
|
|
21
23
|
registerViewTools(server, client);
|
|
22
24
|
registerAiTools(server, client);
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE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EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAuB;IACzE,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/tools/reading.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Reading list tools: save a URL to read later. title/description are
|
|
2
2
|
// user-supplied or best-effort fetched from the page shortly after creation
|
|
3
3
|
// (async - a get_reading_item right after create may still show the raw url
|
|
4
|
-
// as title until the fetch lands). status is a manual
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// as title until the fetch lands). status (unread/reading/read) is a manual
|
|
5
|
+
// read-tracking flag, not a workflow machine. archived/deleted are
|
|
6
|
+
// independent of status - a "read" item can also be archived (find-later) or
|
|
7
|
+
// deleted (hidden everywhere). Person links live on the person side
|
|
8
|
+
// (add_person_links/remove_person_links), not here.
|
|
7
9
|
import { z } from "zod";
|
|
8
10
|
import { runTool } from "../result.js";
|
|
9
11
|
import { idempotencyKey, readingStatusEnum } from "./schemas.js";
|
|
@@ -32,6 +34,10 @@ const listReadingItemsSchema = z.object({
|
|
|
32
34
|
.optional()
|
|
33
35
|
.describe("Case-insensitive substring search over title/description/tags"),
|
|
34
36
|
limit: z.number().int().positive().optional(),
|
|
37
|
+
includeArchived: z
|
|
38
|
+
.boolean()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Include archived items. Defaults to false"),
|
|
35
41
|
});
|
|
36
42
|
export function listReadingItems(client, args) {
|
|
37
43
|
return client.get("/v1/reading", {
|
|
@@ -41,6 +47,7 @@ export function listReadingItems(client, args) {
|
|
|
41
47
|
person: args.personIds?.length ? args.personIds.join(",") : undefined,
|
|
42
48
|
q: args.query,
|
|
43
49
|
limit: args.limit,
|
|
50
|
+
includeArchived: args.includeArchived,
|
|
44
51
|
});
|
|
45
52
|
}
|
|
46
53
|
const getReadingItemSchema = z.object({ id: z.string() });
|
|
@@ -55,6 +62,14 @@ const updateReadingItemSchema = z.object({
|
|
|
55
62
|
status: readingStatusEnum
|
|
56
63
|
.optional()
|
|
57
64
|
.describe('Moving to "read" stamps readAt (once); moving to "unread"/"reading" clears it.'),
|
|
65
|
+
archived: z
|
|
66
|
+
.boolean()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Find-later flag, independent of status; true hides it from the default list (unless includeArchived), false restores it."),
|
|
69
|
+
deleted: z
|
|
70
|
+
.boolean()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("true deletes (same as delete_reading_item, hidden everywhere); false restores."),
|
|
58
73
|
});
|
|
59
74
|
export function updateReadingItem(client, args) {
|
|
60
75
|
const { id, ...patch } = args;
|
|
@@ -81,7 +96,7 @@ export function registerReadingTools(server, client) {
|
|
|
81
96
|
}, (args) => runTool(() => createReadingItem(client, args)));
|
|
82
97
|
server.registerTool("list_reading_items", {
|
|
83
98
|
title: "List reading list items",
|
|
84
|
-
description: "List saved URLs, multi-get by ids, or filter by status/tags/people/query.",
|
|
99
|
+
description: "List saved URLs, multi-get by ids, or filter by status/tags/people/query. Archived items are excluded unless includeArchived is set.",
|
|
85
100
|
inputSchema: listReadingItemsSchema.shape,
|
|
86
101
|
}, (args) => runTool(() => listReadingItems(client, args)));
|
|
87
102
|
server.registerTool("get_reading_item", {
|
|
@@ -91,12 +106,12 @@ export function registerReadingTools(server, client) {
|
|
|
91
106
|
}, (args) => runTool(() => getReadingItem(client, args)));
|
|
92
107
|
server.registerTool("update_reading_item", {
|
|
93
108
|
title: "Update reading list item",
|
|
94
|
-
description: "Update any subset of a reading list item's fields
|
|
109
|
+
description: "Update any subset of a reading list item's fields: status (unread/reading/read), archived (find-later flag), or deleted.",
|
|
95
110
|
inputSchema: updateReadingItemSchema.shape,
|
|
96
111
|
}, (args) => runTool(() => updateReadingItem(client, args)));
|
|
97
112
|
server.registerTool("delete_reading_item", {
|
|
98
113
|
title: "Delete reading list item",
|
|
99
|
-
description:
|
|
114
|
+
description: "Soft-delete a reading list item (hidden everywhere). Restore with update_reading_item {deleted: false}.",
|
|
100
115
|
inputSchema: deleteReadingItemSchema.shape,
|
|
101
116
|
}, (args) => runTool(() => deleteReadingItem(client, args)));
|
|
102
117
|
server.registerTool("add_reading_tags", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reading.js","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"reading.js","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,4EA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,+BAA+B;QAC5C,WAAW,EAAE,iBAAiB,CAAC,KAAK;KACrC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACzD,CAAC;AACJ,CAAC"}
|
package/dist/tools/schemas.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
export const statusEnum = z.enum(["backlog", "todo", "in_progress", "done", "canceled"]);
|
|
7
7
|
export const priorityEnum = z.enum(["none", "low", "medium", "high"]);
|
|
8
|
-
export const readingStatusEnum = z.enum(["unread", "reading", "read"
|
|
8
|
+
export const readingStatusEnum = z.enum(["unread", "reading", "read"]);
|
|
9
9
|
export const dateField = z
|
|
10
10
|
.union([z.number(), z.string()])
|
|
11
11
|
.describe('Calendar day "YYYY-MM-DD", or a relative token like "today"/"+3d"');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"A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MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CAAC,iEAAiE,CAAC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Strava activity tools. Activities are never created here - they're only
|
|
2
|
+
// ingested via webhook or sync_strava_activities (a manual/backfill trigger).
|
|
3
|
+
// Every other field except title/notes/archived/deleted/tags is
|
|
4
|
+
// Strava-authoritative and rejected by update_strava_activity's underlying
|
|
5
|
+
// endpoint if attempted.
|
|
6
|
+
// GPS/speed streams aren't exposed as a tool - they're large binary-ish data
|
|
7
|
+
// meant for the web UI's map, not an agent's context; get_strava_activity
|
|
8
|
+
// exposes hasStreams so an agent can point the user at the web UI to view it.
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { runTool } from "../result.js";
|
|
11
|
+
const listStravaActivitiesSchema = z.object({
|
|
12
|
+
ids: z.array(z.string()).optional(),
|
|
13
|
+
tagIds: z.array(z.string()).optional(),
|
|
14
|
+
type: z.string().optional().describe("Strava activity type, e.g. Run, Ride, Swim"),
|
|
15
|
+
query: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Case-insensitive substring search over name/notes/tags"),
|
|
19
|
+
limit: z.number().int().positive().optional(),
|
|
20
|
+
includeArchived: z
|
|
21
|
+
.boolean()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Include archived activities. Defaults to false"),
|
|
24
|
+
});
|
|
25
|
+
export function listStravaActivities(client, args) {
|
|
26
|
+
return client.get("/v1/strava/activities", {
|
|
27
|
+
ids: args.ids?.length ? args.ids.join(",") : undefined,
|
|
28
|
+
tag: args.tagIds?.length ? args.tagIds.join(",") : undefined,
|
|
29
|
+
type: args.type,
|
|
30
|
+
q: args.query,
|
|
31
|
+
limit: args.limit,
|
|
32
|
+
includeArchived: args.includeArchived,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const getStravaActivitySchema = z.object({ id: z.string() });
|
|
36
|
+
export function getStravaActivity(client, args) {
|
|
37
|
+
return client.get(`/v1/strava/activities/${args.id}`);
|
|
38
|
+
}
|
|
39
|
+
const updateStravaActivitySchema = z.object({
|
|
40
|
+
id: z.string(),
|
|
41
|
+
title: z
|
|
42
|
+
.string()
|
|
43
|
+
.nullable()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Overrides the Strava-synced name for display; null reverts to it."),
|
|
46
|
+
notes: z.string().optional(),
|
|
47
|
+
archived: z
|
|
48
|
+
.boolean()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Find-later flag; true hides it from the default list (unless includeArchived), false restores it."),
|
|
51
|
+
deleted: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("true deletes (same as delete_strava_activity, hidden everywhere); false restores."),
|
|
55
|
+
});
|
|
56
|
+
export function updateStravaActivity(client, args) {
|
|
57
|
+
const { id, ...patch } = args;
|
|
58
|
+
return client.patch(`/v1/strava/activities/${id}`, patch);
|
|
59
|
+
}
|
|
60
|
+
const deleteStravaActivitySchema = z.object({ id: z.string() });
|
|
61
|
+
export function deleteStravaActivity(client, args) {
|
|
62
|
+
return client.del(`/v1/strava/activities/${args.id}`);
|
|
63
|
+
}
|
|
64
|
+
const stravaActivityTagsSchema = z.object({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
tagIds: z.array(z.string()),
|
|
67
|
+
});
|
|
68
|
+
export function addStravaActivityTags(client, args) {
|
|
69
|
+
return client.post(`/v1/strava/activities/${args.id}/tags`, { tagIds: args.tagIds });
|
|
70
|
+
}
|
|
71
|
+
export function removeStravaActivityTags(client, args) {
|
|
72
|
+
return client.request("DELETE", `/v1/strava/activities/${args.id}/tags`, {
|
|
73
|
+
body: { tagIds: args.tagIds },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const syncStravaActivitiesSchema = z.object({
|
|
77
|
+
sinceDays: z
|
|
78
|
+
.number()
|
|
79
|
+
.int()
|
|
80
|
+
.positive()
|
|
81
|
+
.optional()
|
|
82
|
+
.describe("Only import activities from the last N days. Omit to sync all history."),
|
|
83
|
+
});
|
|
84
|
+
export function syncStravaActivities(client, args) {
|
|
85
|
+
return client.post("/v1/strava/sync", args);
|
|
86
|
+
}
|
|
87
|
+
export function registerStravaTools(server, client) {
|
|
88
|
+
server.registerTool("list_strava_activities", {
|
|
89
|
+
title: "List Strava activities",
|
|
90
|
+
description: "List Strava activities, multi-get by ids, or filter by tags/type/query. Archived activities are excluded unless includeArchived is set.",
|
|
91
|
+
inputSchema: listStravaActivitiesSchema.shape,
|
|
92
|
+
}, (args) => runTool(() => listStravaActivities(client, args)));
|
|
93
|
+
server.registerTool("get_strava_activity", {
|
|
94
|
+
title: "Get Strava activity",
|
|
95
|
+
description: "Fetch one Strava activity with its tags. Use hasStreams to know whether a GPS/speed map is available in the web UI.",
|
|
96
|
+
inputSchema: getStravaActivitySchema.shape,
|
|
97
|
+
}, (args) => runTool(() => getStravaActivity(client, args)));
|
|
98
|
+
server.registerTool("update_strava_activity", {
|
|
99
|
+
title: "Update Strava activity",
|
|
100
|
+
description: "Update a Strava activity's title (override the synced name; null reverts to it), notes, archived (find-later flag), or deleted. Every other field (distance, etc.) is Strava-authoritative and can't be edited here.",
|
|
101
|
+
inputSchema: updateStravaActivitySchema.shape,
|
|
102
|
+
}, (args) => runTool(() => updateStravaActivity(client, args)));
|
|
103
|
+
server.registerTool("delete_strava_activity", {
|
|
104
|
+
title: "Delete Strava activity",
|
|
105
|
+
description: "Soft-delete a Strava activity (hidden everywhere). Restore with update_strava_activity {deleted: false}.",
|
|
106
|
+
inputSchema: deleteStravaActivitySchema.shape,
|
|
107
|
+
}, (args) => runTool(() => deleteStravaActivity(client, args)));
|
|
108
|
+
server.registerTool("add_strava_activity_tags", {
|
|
109
|
+
title: "Tag Strava activity",
|
|
110
|
+
description: "Attach tags to a Strava activity.",
|
|
111
|
+
inputSchema: stravaActivityTagsSchema.shape,
|
|
112
|
+
}, (args) => runTool(() => addStravaActivityTags(client, args)));
|
|
113
|
+
server.registerTool("remove_strava_activity_tags", {
|
|
114
|
+
title: "Untag Strava activity",
|
|
115
|
+
description: "Detach tags from a Strava activity.",
|
|
116
|
+
inputSchema: stravaActivityTagsSchema.shape,
|
|
117
|
+
}, (args) => runTool(() => removeStravaActivityTags(client, args)));
|
|
118
|
+
server.registerTool("sync_strava_activities", {
|
|
119
|
+
title: "Sync Strava activities",
|
|
120
|
+
description: "Manually pull recent activities from Strava (backfill/fallback alongside the real-time webhook). Capped per call; re-run to continue further back in history.",
|
|
121
|
+
inputSchema: syncStravaActivitiesSchema.shape,
|
|
122
|
+
}, (args) => runTool(() => syncStravaActivities(client, args)));
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=strava.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strava.js","sourceRoot":"","sources":["../../src/tools/strava.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8EAA8E;AAC9E,gEAAgE;AAChE,2EAA2E;AAC3E,yBAAyB;AACzB,6EAA6E;AAC7E,0EAA0E;AAC1E,8EAA8E;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,K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OAAO,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAChE,CAAC;IACF,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,+JAA+J;QACjK,WAAW,EAAE,0BAA0B,CAAC,KAAK;KAC9C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAC5D,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -49,13 +49,27 @@ pre-guessing constraints.
|
|
|
49
49
|
restarts the clock. Names + `aliases` are how mentions resolve — when the user
|
|
50
50
|
mentions someone ("call Megan"), `list_people`, match name/aliases, and link.
|
|
51
51
|
- **Reading list item** = a saved URL to read later: `status`
|
|
52
|
-
(`unread|reading|read
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
(`unread|reading|read`) plus `readAt` (stamped when moved to `read`,
|
|
53
|
+
cleared on any move away from it). `archived` (find-later flag) and
|
|
54
|
+
`deleted` (true soft delete) are independent booleans, not status values —
|
|
55
|
+
an item can be `status: "read"` AND `archived: true` at once. `title`/
|
|
56
|
+
`description` are user-supplied or fetched from the page in the background
|
|
57
|
+
shortly after creation — best-effort, so a `get_reading_item` right after
|
|
58
|
+
`create_reading_item` may still show the raw URL as the title. Tags via
|
|
59
|
+
`add_reading_tags`/`remove_reading_tags`; person links live on the person
|
|
60
|
+
side (`add_person_links`/`remove_person_links` with `readingListItemIds`),
|
|
61
|
+
not here.
|
|
62
|
+
- **Strava activity** = a GPS-tracked activity mirrored in from Strava
|
|
63
|
+
(real-time webhook, plus `sync_strava_activities` for backfill/fallback).
|
|
64
|
+
Never created here — every field except `notes`, `archived`, `deleted`, and
|
|
65
|
+
tags is Strava-authoritative and rejected if you try to patch it.
|
|
66
|
+
`detailStatus` (`pending|ready|failed`) tracks the async enrichment fetch;
|
|
67
|
+
`hasStreams` tells you whether a GPS/speed map is available (streams land
|
|
68
|
+
slightly after the summary, so a just-synced activity may briefly show
|
|
69
|
+
`hasStreams: false`). `archived`/`deleted` are independent booleans, same
|
|
70
|
+
reversible semantics as reading list items. GPS/speed stream data itself
|
|
71
|
+
isn't exposed as a tool (too large for an agent's context) — point the user
|
|
72
|
+
at the web UI's activity detail page to see the map.
|
|
59
73
|
|
|
60
74
|
## Tool catalog
|
|
61
75
|
|
|
@@ -82,17 +96,28 @@ pre-guessing constraints.
|
|
|
82
96
|
filters by `person` ids.
|
|
83
97
|
- **Reading list**: `create_reading_item` (`{url, title?, description?,
|
|
84
98
|
status?, tagIds?, personIds?}` — only `url` is required), `list_reading_items`
|
|
85
|
-
(filter by `status[]`/`tagIds`/`personIds`/`query`, or multi-get via `ids
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
`
|
|
99
|
+
(filter by `status[]`/`tagIds`/`personIds`/`query`, or multi-get via `ids`;
|
|
100
|
+
archived items are excluded unless `includeArchived` is set), `get_reading_item`,
|
|
101
|
+
`update_reading_item` (drives status; `description: null` clears it;
|
|
102
|
+
`archived`/`deleted` toggle independently of status), `delete_reading_item`
|
|
103
|
+
(true soft delete, hidden everywhere; restore with `update_reading_item
|
|
104
|
+
{deleted: false}`), `add_reading_tags`/`remove_reading_tags`.
|
|
105
|
+
- **Strava**: `list_strava_activities` (filter by `tagIds`/`type`/`query`, or
|
|
106
|
+
multi-get via `ids`; archived excluded unless `includeArchived`),
|
|
107
|
+
`get_strava_activity`, `update_strava_activity` (`notes`/`archived`/
|
|
108
|
+
`deleted` only), `delete_strava_activity` (soft delete; restore with
|
|
109
|
+
`update_strava_activity {deleted: false}`),
|
|
110
|
+
`add_strava_activity_tags`/`remove_strava_activity_tags`,
|
|
111
|
+
`sync_strava_activities` (manual backfill; optional `sinceDays`; capped per
|
|
112
|
+
call — re-run to pull further back in history).
|
|
89
113
|
- **Saved lists** (named, reusable task-list filters): `list_saved_lists`,
|
|
90
114
|
`create_saved_list`, `update_saved_list`, `delete_saved_list`.
|
|
91
115
|
- **Views & reviews**: `get_view` (today/upcoming/overdue, timezone-aware),
|
|
92
116
|
`get_reviews` (due queue), `review_garden` (deep review),
|
|
93
117
|
`request_garden_review`, `mark_task_reviewed`, `mark_project_reviewed`.
|
|
94
118
|
- **AI**: `find_tasks` (hybrid keyword + semantic search), `ai_triage`
|
|
95
|
-
(brain dump → garden-assigned tasks
|
|
119
|
+
(brain dump → garden-assigned tasks, plus reading-list saves/edits/cancels -
|
|
120
|
+
see Workflows).
|
|
96
121
|
- **UI (read-only)**: `ui_view`, `ui_review_queue`, `ui_garden_board` return
|
|
97
122
|
`ui://` HTML resources.
|
|
98
123
|
- **Settings**: `get_settings`, `update_settings` (the default review period
|
|
@@ -104,8 +129,15 @@ pre-guessing constraints.
|
|
|
104
129
|
## Workflows
|
|
105
130
|
|
|
106
131
|
- **Capture a brain dump** → `ai_triage` with the raw text. It returns
|
|
107
|
-
`{ created, clarifications, errors
|
|
108
|
-
|
|
132
|
+
`{ created, clarifications, errors, readingItems: { created, updated, clarifications, errors } }`.
|
|
133
|
+
If either `clarifications` array is non-empty, ask the user those questions
|
|
134
|
+
and re-run with the answers folded in — do not guess. `ai_triage` also
|
|
135
|
+
recognizes URLs to save ("save this for later: https://...") and references
|
|
136
|
+
to existing saved items ("I finished reading X" → marks it read; "remove Y
|
|
137
|
+
from my reading list" → archives it, reversibly, independent of status) —
|
|
138
|
+
it matches existing items by exact title, so an unmatched or ambiguous
|
|
139
|
+
reference comes back as a reading-list clarification rather than a silent
|
|
140
|
+
no-op or a task.
|
|
109
141
|
- **Plan today** → `get_view today`. Pass the user's IANA `tz` if known so the
|
|
110
142
|
day boundary is correct.
|
|
111
143
|
- **Add a task** → need a garden: `list_gardens` first, then `create_task` with
|
|
@@ -160,14 +192,20 @@ pre-guessing constraints.
|
|
|
160
192
|
from the web app's Settings page, not `apiKeys:bootstrap`.
|
|
161
193
|
- Scopes gate tools: resource tools need `<resource>:read|write` (people tools
|
|
162
194
|
`people:read|write`, settings tools `settings:read|write`, reading list tools
|
|
163
|
-
`reading:read|write`), review tools
|
|
164
|
-
`ai:invoke`, the `*_key` tools
|
|
165
|
-
|
|
166
|
-
unless they hold `*`.
|
|
195
|
+
`reading:read|write`, Strava tools `strava:read|write`), review tools
|
|
196
|
+
`reviews:*`, `find_tasks`/`ai_triage` need `ai:invoke`, the `*_key` tools
|
|
197
|
+
need `keys:manage`. A missing scope returns a 403 tool error. Keys minted
|
|
198
|
+
before a feature shipped won't carry its scope unless they hold `*`.
|
|
199
|
+
- `sync_strava_activities` requires a Strava account already connected (via
|
|
200
|
+
the web UI's Settings page) — it does nothing useful if nobody has
|
|
201
|
+
authorized the app yet.
|
|
167
202
|
- `create_reading_item`'s title/description fetch is best-effort and
|
|
168
203
|
asynchronous — a failed fetch (unreachable page, timeout, non-HTML response)
|
|
169
204
|
silently leaves the item with its URL as the title; this is expected, not a
|
|
170
205
|
bug, and the item is otherwise fully usable.
|
|
206
|
+
- `ai_triage`'s reading-list edits match an existing saved item by its EXACT
|
|
207
|
+
title (from the list the model is given), so a vague reference comes back as
|
|
208
|
+
a `readingItems.clarifications` entry rather than editing the wrong item.
|
|
171
209
|
- `delete_person` archives (links kept); restore with `update_person
|
|
172
210
|
{archived: false}`. Birthdays/anniversaries are `"YYYY-MM-DD"` or `"MM-DD"`
|
|
173
211
|
strings, not timestamps. `mark_contacted` also works with a `reviews:write`
|