@henrikogard/auroradocs-mcp 0.1.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.
@@ -0,0 +1,423 @@
1
+ const TOOL_EFFECTS = {
2
+ search_objects: 'read',
3
+ search: 'read',
4
+ list_objects: 'read',
5
+ list_recent: 'read',
6
+ wiki_search: 'read',
7
+ wiki_get_page: 'read',
8
+ wiki_related: 'read',
9
+ wiki_recent: 'read',
10
+ get_object: 'read',
11
+ list_workspace_members: 'read',
12
+ list_task_lists: 'read',
13
+ list_task_statuses: 'read',
14
+ list_week_plan: 'read',
15
+ schedule_task_block: 'write',
16
+ read_canvas: 'read',
17
+ get_mcp_tool_coverage: 'read',
18
+ get_mcp_workflow_recipes: 'read',
19
+ create_object: 'write',
20
+ create_task: 'write',
21
+ update_task: 'write',
22
+ update_object_title: 'write',
23
+ update_object: 'write',
24
+ set_content: 'write',
25
+ append_block: 'write',
26
+ set_property: 'write',
27
+ delete_object: 'write',
28
+ };
29
+ const TOOL_DEFINITIONS = [
30
+ {
31
+ name: 'search_objects',
32
+ description: 'Search for objects (pages, notes, tasks, etc.) in the workspace by title keyword.',
33
+ inputSchema: {
34
+ type: 'object',
35
+ properties: {
36
+ query: { type: 'string', description: 'Keyword to search for in object titles' },
37
+ type: { type: 'string', description: 'Optional object type filter (page, note, task, etc.)' },
38
+ },
39
+ required: ['query'],
40
+ },
41
+ },
42
+ {
43
+ name: 'search',
44
+ description: 'Alias for search_objects. Search workspace objects by title keyword.',
45
+ inputSchema: {
46
+ type: 'object',
47
+ properties: {
48
+ query: { type: 'string', description: 'Keyword to search for in object titles' },
49
+ type: { type: 'string', description: 'Optional object type filter (page, note, task, etc.)' },
50
+ },
51
+ required: ['query'],
52
+ },
53
+ },
54
+ {
55
+ name: 'list_objects',
56
+ description: 'List objects in the workspace, optionally filtered by type.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: {
60
+ type: { type: 'string', description: 'Optional object type to filter by' },
61
+ limit: { type: 'number', description: 'Maximum results to return (default 20)' },
62
+ },
63
+ },
64
+ },
65
+ {
66
+ name: 'list_recent',
67
+ description: 'List the most recently updated objects in the workspace.',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: {
71
+ type: { type: 'string', description: 'Optional object type to filter by' },
72
+ limit: { type: 'number', description: 'Maximum results to return (default 20)' },
73
+ },
74
+ },
75
+ },
76
+ {
77
+ name: 'wiki_search',
78
+ description: 'Search workspace knowledge and return citation-ready sources.',
79
+ inputSchema: {
80
+ type: 'object',
81
+ properties: {
82
+ query: { type: 'string', description: 'Search query to run against workspace knowledge' },
83
+ limit: { type: 'number', description: 'Maximum results to return (default 20, max 50)' },
84
+ },
85
+ required: ['query'],
86
+ },
87
+ },
88
+ {
89
+ name: 'wiki_get_page',
90
+ description: 'Read one object as a wiki source and optionally include full text.',
91
+ inputSchema: {
92
+ type: 'object',
93
+ properties: {
94
+ id: { type: 'string', description: 'The object ID' },
95
+ includeFullText: { type: 'boolean', description: 'Include the full readable text payload when available' },
96
+ },
97
+ required: ['id'],
98
+ },
99
+ },
100
+ {
101
+ name: 'wiki_related',
102
+ description: 'Find related workspace sources for an object.',
103
+ inputSchema: {
104
+ type: 'object',
105
+ properties: {
106
+ id: { type: 'string', description: 'The object ID' },
107
+ limit: { type: 'number', description: 'Maximum results to return (default 6, max 10)' },
108
+ },
109
+ required: ['id'],
110
+ },
111
+ },
112
+ {
113
+ name: 'wiki_recent',
114
+ description: 'List recently updated readable workspace sources.',
115
+ inputSchema: {
116
+ type: 'object',
117
+ properties: {
118
+ limit: { type: 'number', description: 'Maximum results to return (default 6, max 10)' },
119
+ },
120
+ },
121
+ },
122
+ {
123
+ name: 'get_object',
124
+ description: 'Get the content, details, and properties of a specific object by its ID.',
125
+ inputSchema: {
126
+ type: 'object',
127
+ properties: {
128
+ id: { type: 'string', description: 'The object ID' },
129
+ },
130
+ required: ['id'],
131
+ },
132
+ },
133
+ {
134
+ name: 'list_workspace_members',
135
+ description: 'List workspace members with their roles.',
136
+ inputSchema: { type: 'object', properties: {} },
137
+ },
138
+ {
139
+ name: 'list_task_lists',
140
+ description: 'List available task lists in the workspace.',
141
+ inputSchema: { type: 'object', properties: {} },
142
+ },
143
+ {
144
+ name: 'list_task_statuses',
145
+ description: 'List the task statuses available in the workspace.',
146
+ inputSchema: { type: 'object', properties: {} },
147
+ },
148
+ {
149
+ name: 'list_week_plan',
150
+ description: 'Return the AuroraDocs Week Planning view for a Monday-start week, including scheduled and optionally unscheduled tasks.',
151
+ inputSchema: {
152
+ type: 'object',
153
+ properties: {
154
+ anchor_date: { type: 'string', description: 'Date inside the requested week, formatted YYYY-MM-DD. Defaults to today.' },
155
+ include_unscheduled: { type: 'boolean', description: 'Include incomplete tasks without a due date. Defaults to true.' },
156
+ unscheduled_limit: { type: 'number', description: 'Maximum unscheduled tasks to return. Defaults to 12, max 50.' },
157
+ },
158
+ },
159
+ },
160
+ {
161
+ name: 'schedule_task_block',
162
+ description: 'Schedule an existing task into Week Planning or create a task-backed time block.',
163
+ inputSchema: {
164
+ type: 'object',
165
+ properties: {
166
+ mode: { type: 'string', description: 'schedule_existing_task or create_time_block' },
167
+ task_id: { type: 'string', description: 'Existing task object ID when mode is schedule_existing_task' },
168
+ title: { type: 'string', description: 'Time-block title when mode is create_time_block' },
169
+ date: { type: 'string', description: 'Target date formatted YYYY-MM-DD' },
170
+ start_time: { type: 'string', description: 'Optional start time formatted HH:mm' },
171
+ duration_minutes: { type: 'number', description: 'Time-block duration in minutes. Defaults to 30.' },
172
+ },
173
+ required: ['mode', 'date'],
174
+ },
175
+ },
176
+ {
177
+ name: 'read_canvas',
178
+ description: 'Read a Canvas object structure, including cards/nodes and edges/links, without modifying the canvas.',
179
+ inputSchema: {
180
+ type: 'object',
181
+ properties: {
182
+ id: { type: 'string', description: 'Canvas object ID' },
183
+ include_text: { type: 'boolean', description: 'Include card text when available. Defaults to true.' },
184
+ },
185
+ required: ['id'],
186
+ },
187
+ },
188
+ {
189
+ name: 'get_mcp_tool_coverage',
190
+ description: 'Return AuroraDocs MCP tool coverage areas, implemented tools, and prioritized gaps.',
191
+ inputSchema: { type: 'object', properties: {} },
192
+ },
193
+ {
194
+ name: 'get_mcp_workflow_recipes',
195
+ description: 'Return documented agent workflow recipes and the MCP tools/scopes they use.',
196
+ inputSchema: { type: 'object', properties: {} },
197
+ },
198
+ {
199
+ name: 'create_object',
200
+ description: 'Create a new non-task object (page, note, bookmark, etc.) in the workspace. Use create_task for tasks.',
201
+ inputSchema: {
202
+ type: 'object',
203
+ properties: {
204
+ type: { type: 'string', description: 'Object type: page, note, bookmark, etc.' },
205
+ title: { type: 'string', description: 'Title for the new object' },
206
+ },
207
+ required: ['type', 'title'],
208
+ },
209
+ },
210
+ {
211
+ name: 'create_task',
212
+ description: 'Create a new task in the workspace with full task fields. Assignees can be names, emails, or user IDs. Task list can be a name or ID.',
213
+ inputSchema: {
214
+ type: 'object',
215
+ properties: {
216
+ title: { type: 'string', description: 'Task title' },
217
+ status: { type: 'string', description: 'Task status (e.g. To Do, In Progress, Done)' },
218
+ priority: { type: 'string', description: 'Priority: Low, Medium, High, or Urgent' },
219
+ due_date: { type: 'string', description: 'Due date in ISO 8601 (e.g. 2026-04-15 or 2026-04-15T22:00)' },
220
+ assignees: { oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }], description: 'Assignee names, emails, or user IDs (array or comma-separated)' },
221
+ task_list: { type: 'string', description: 'Task list name or ID' },
222
+ labels: { oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }], description: 'Labels/tags (array or comma-separated)' },
223
+ description: { type: 'string', description: 'Task description' },
224
+ },
225
+ required: ['title'],
226
+ },
227
+ },
228
+ {
229
+ name: 'update_task',
230
+ description: 'Update an existing task. Only provided fields are changed. Empty strings/arrays clear optional fields.',
231
+ inputSchema: {
232
+ type: 'object',
233
+ properties: {
234
+ id: { type: 'string', description: 'The task object ID' },
235
+ title: { type: 'string', description: 'New task title' },
236
+ status: { type: 'string', description: 'Task status' },
237
+ priority: { type: 'string', description: 'Priority: Low, Medium, High, Urgent, or empty to clear' },
238
+ due_date: { type: 'string', description: 'Due date (ISO 8601) or empty to clear' },
239
+ assignees: { oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }], description: 'Assignees (names/emails/IDs) or empty to clear' },
240
+ task_list: { type: 'string', description: 'Task list name/ID or empty to clear' },
241
+ labels: { oneOf: [{ type: 'array', items: { type: 'string' } }, { type: 'string' }], description: 'Labels or empty to clear' },
242
+ description: { type: 'string', description: 'Task description or empty to clear' },
243
+ },
244
+ required: ['id'],
245
+ },
246
+ },
247
+ {
248
+ name: 'update_object_title',
249
+ description: 'Update the title of an existing object.',
250
+ inputSchema: {
251
+ type: 'object',
252
+ properties: {
253
+ id: { type: 'string', description: 'The object ID' },
254
+ title: { type: 'string', description: 'The new title' },
255
+ },
256
+ required: ['id', 'title'],
257
+ },
258
+ },
259
+ {
260
+ name: 'update_object',
261
+ description: 'Update an existing object title and/or replace its plain-text content.',
262
+ inputSchema: {
263
+ type: 'object',
264
+ properties: {
265
+ id: { type: 'string', description: 'The object ID' },
266
+ title: { type: 'string', description: 'Optional new title' },
267
+ text: { type: 'string', description: 'Optional plain text content to replace the existing content' },
268
+ content: { type: 'string', description: 'Alias for text' },
269
+ },
270
+ required: ['id'],
271
+ },
272
+ },
273
+ {
274
+ name: 'set_content',
275
+ description: 'Set the text content of an object. The text is converted to a structured document format.',
276
+ inputSchema: {
277
+ type: 'object',
278
+ properties: {
279
+ id: { type: 'string', description: 'The object ID' },
280
+ text: { type: 'string', description: 'Plain text content (newlines become paragraphs)' },
281
+ },
282
+ required: ['id'],
283
+ },
284
+ },
285
+ {
286
+ name: 'append_block',
287
+ description: 'Append plain text to the end of an object as one or more paragraph blocks.',
288
+ inputSchema: {
289
+ type: 'object',
290
+ properties: {
291
+ id: { type: 'string', description: 'The object ID' },
292
+ text: { type: 'string', description: 'Plain text to append (newlines become paragraphs)' },
293
+ content: { type: 'string', description: 'Alias for text' },
294
+ },
295
+ required: ['id', 'text'],
296
+ },
297
+ },
298
+ {
299
+ name: 'set_property',
300
+ description: 'Set a generic property value on an object. For task-specific fields, use create_task or update_task instead.',
301
+ inputSchema: {
302
+ type: 'object',
303
+ properties: {
304
+ object_id: { type: 'string', description: 'The object ID' },
305
+ key: { type: 'string', description: 'Property key/name' },
306
+ value_type: { type: 'string', description: 'Value type: text, date, number, boolean' },
307
+ value: { type: 'string', description: 'The value to set' },
308
+ },
309
+ required: ['object_id', 'key', 'value_type', 'value'],
310
+ },
311
+ },
312
+ {
313
+ name: 'delete_object',
314
+ description: 'Soft-delete an object (moves to trash). This is reversible.',
315
+ inputSchema: {
316
+ type: 'object',
317
+ properties: {
318
+ id: { type: 'string', description: 'The object ID to delete' },
319
+ },
320
+ required: ['id'],
321
+ },
322
+ },
323
+ ];
324
+ export function getToolDefinitions() {
325
+ return TOOL_DEFINITIONS.map((tool) => ({
326
+ ...tool,
327
+ inputSchema: {
328
+ ...tool.inputSchema,
329
+ properties: { ...tool.inputSchema.properties },
330
+ required: tool.inputSchema.required ? [...tool.inputSchema.required] : undefined,
331
+ },
332
+ }));
333
+ }
334
+ export function getToolEffect(name) {
335
+ return TOOL_EFFECTS[name];
336
+ }
337
+ export function getToolEffects() {
338
+ return { ...TOOL_EFFECTS };
339
+ }
340
+ export function getMcpToolCoverageAudit() {
341
+ return {
342
+ generatedAt: '2026-07-08',
343
+ areas: [
344
+ {
345
+ id: 'knowledge',
346
+ label: 'Knowledge search and source lookup',
347
+ status: 'covered',
348
+ implementedTools: ['wiki_search', 'wiki_get_page', 'wiki_related', 'wiki_recent', 'get_object'],
349
+ missingTools: [],
350
+ },
351
+ {
352
+ id: 'tasks',
353
+ label: 'Task triage and planning',
354
+ status: 'covered',
355
+ implementedTools: ['list_task_lists', 'list_task_statuses', 'create_task', 'update_task'],
356
+ missingTools: [],
357
+ },
358
+ {
359
+ id: 'objects',
360
+ label: 'Object CRUD',
361
+ status: 'partial',
362
+ implementedTools: ['search_objects', 'list_objects', 'list_recent', 'create_object', 'update_object', 'append_block', 'delete_object'],
363
+ missingTools: [
364
+ {
365
+ name: 'restore_object',
366
+ priority: 'low',
367
+ reason: 'Deletes are reversible in the app, but MCP currently lacks an explicit trash restore command.',
368
+ },
369
+ ],
370
+ },
371
+ {
372
+ id: 'calendar',
373
+ label: 'Calendar and week planning',
374
+ status: 'covered',
375
+ implementedTools: ['list_week_plan', 'schedule_task_block'],
376
+ missingTools: [],
377
+ },
378
+ {
379
+ id: 'canvas',
380
+ label: 'Canvas and visual planning',
381
+ status: 'covered',
382
+ implementedTools: ['read_canvas'],
383
+ missingTools: [],
384
+ },
385
+ ],
386
+ };
387
+ }
388
+ export function getMcpWorkflowRecipes() {
389
+ return [
390
+ {
391
+ id: 'weekly_summary',
392
+ title: 'Weekly summary',
393
+ goal: 'Summarize recent workspace changes and outstanding work for a weekly review.',
394
+ requiredScopes: ['search', 'read:objects', 'read:content', 'tasks'],
395
+ toolSteps: ['wiki_recent', 'wiki_search', 'list_task_statuses', 'list_objects'],
396
+ prompt: 'Review recent sources, search for this week or active project terms, then summarize completed work, open decisions, and next actions with citations.',
397
+ },
398
+ {
399
+ id: 'task_triage',
400
+ title: 'Task triage',
401
+ goal: 'Review unsorted or stale tasks and propose status, priority, list, or assignee updates.',
402
+ requiredScopes: ['read:objects', 'tasks', 'write:objects'],
403
+ toolSteps: ['list_task_lists', 'list_task_statuses', 'list_objects', 'get_object', 'update_task'],
404
+ prompt: 'List task objects, inspect unclear items, then update only fields the user explicitly confirms or that match the agreed triage rule.',
405
+ },
406
+ {
407
+ id: 'research_synthesis',
408
+ title: 'Research synthesis',
409
+ goal: 'Find relevant project sources and produce a citation-backed synthesis.',
410
+ requiredScopes: ['search', 'read:objects', 'read:content'],
411
+ toolSteps: ['wiki_search', 'wiki_get_page', 'wiki_related'],
412
+ prompt: 'Search for the topic, read the top sources, follow related items, then answer with citations and a separate uncertainty list.',
413
+ },
414
+ {
415
+ id: 'source_lookup',
416
+ title: 'Source lookup',
417
+ goal: 'Locate the source object behind a claim, task, or project reference.',
418
+ requiredScopes: ['search', 'read:objects'],
419
+ toolSteps: ['search_objects', 'wiki_search', 'wiki_get_page'],
420
+ prompt: 'Search by title and content terms, return the best matching object IDs/deep links, and explain which matched fields support each result.',
421
+ },
422
+ ];
423
+ }
@@ -0,0 +1,105 @@
1
+ import type { WorkspaceKnowledgeSource } from './auroraClient.js';
2
+ import type { McpCanvasReadResult, McpWeekPlan } from './planningTools.js';
3
+ import type { McpToolCoverageAudit, McpWorkflowRecipe } from './toolCatalog.js';
4
+ export type ToolResult = {
5
+ type: 'objects';
6
+ objects: {
7
+ id: string;
8
+ title: string | null;
9
+ type: string;
10
+ icon: string | null;
11
+ }[];
12
+ } | {
13
+ type: 'object';
14
+ object: {
15
+ id: string;
16
+ title: string | null;
17
+ type: string;
18
+ icon: string | null;
19
+ };
20
+ content: string | null;
21
+ properties: Record<string, string>;
22
+ } | {
23
+ type: 'created';
24
+ id: string;
25
+ title: string;
26
+ } | {
27
+ type: 'task_created';
28
+ id: string;
29
+ title: string;
30
+ status: string | null;
31
+ task_list_name: string | null;
32
+ } | {
33
+ type: 'task_updated';
34
+ id: string;
35
+ title: string;
36
+ changed_fields: string[];
37
+ } | {
38
+ type: 'object_updated';
39
+ id: string;
40
+ changed_fields: string[];
41
+ } | {
42
+ type: 'updated';
43
+ id: string;
44
+ title: string;
45
+ } | {
46
+ type: 'deleted';
47
+ id: string;
48
+ } | {
49
+ type: 'content_set';
50
+ id: string;
51
+ } | {
52
+ type: 'content_appended';
53
+ id: string;
54
+ } | {
55
+ type: 'property_set';
56
+ objectId: string;
57
+ key: string;
58
+ value: string;
59
+ } | {
60
+ type: 'knowledge_sources';
61
+ sources: WorkspaceKnowledgeSource[];
62
+ } | {
63
+ type: 'mcp_tool_coverage';
64
+ audit: McpToolCoverageAudit;
65
+ } | {
66
+ type: 'mcp_workflow_recipes';
67
+ recipes: McpWorkflowRecipe[];
68
+ } | {
69
+ type: 'week_plan';
70
+ plan: McpWeekPlan;
71
+ } | {
72
+ type: 'canvas';
73
+ canvas: McpCanvasReadResult;
74
+ } | {
75
+ type: 'scheduled_task_block';
76
+ id: string;
77
+ title: string | null;
78
+ due_date: string;
79
+ mode: string;
80
+ } | {
81
+ type: 'members';
82
+ members: {
83
+ id: string;
84
+ name: string | null;
85
+ email: string;
86
+ role: string;
87
+ }[];
88
+ } | {
89
+ type: 'task_lists';
90
+ task_lists: {
91
+ id: string;
92
+ name: string;
93
+ }[];
94
+ } | {
95
+ type: 'task_statuses';
96
+ statuses: string[];
97
+ } | {
98
+ type: 'no_op';
99
+ message: string;
100
+ } | {
101
+ type: 'error';
102
+ message: string;
103
+ };
104
+ export declare function executeToolCall(name: string, input: Record<string, unknown>, workspaceId: string): Promise<ToolResult>;
105
+ export declare function formatToolResult(result: ToolResult): string;