@cliangdev/conductor 0.12.1 → 0.14.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/assets/cli-manifest.json +79 -0
- package/dist/mcp/api.d.ts +10 -0
- package/dist/mcp/api.d.ts.map +1 -1
- package/dist/mcp/api.js +23 -0
- package/dist/mcp/api.js.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +306 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/knowledge.d.ts +5 -0
- package/dist/mcp/tools/knowledge.d.ts.map +1 -1
- package/dist/mcp/tools/knowledge.js +2 -0
- package/dist/mcp/tools/knowledge.js.map +1 -1
- package/dist/mcp/tools/project-docs.d.ts +103 -0
- package/dist/mcp/tools/project-docs.d.ts.map +1 -0
- package/dist/mcp/tools/project-docs.js +400 -0
- package/dist/mcp/tools/project-docs.js.map +1 -0
- package/package.json +1 -1
package/assets/cli-manifest.json
CHANGED
|
@@ -374,6 +374,85 @@
|
|
|
374
374
|
"description": "Raise a gap report for a knowledge domain not yet in the registry. Claim-or-return on slug.",
|
|
375
375
|
"category": "knowledge",
|
|
376
376
|
"requiredParams": ["slug", "displayName", "reason"]
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "list_project_docs",
|
|
380
|
+
"description": "Map the project's Docs section — folder paths and every document as a \"Folder/Title\" path, or full-text search with query.",
|
|
381
|
+
"category": "project-docs"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "read_project_doc",
|
|
385
|
+
"description": "Read one project document by path or docId — full Markdown plus taskLines (every checkbox with its line number and state).",
|
|
386
|
+
"category": "project-docs"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "write_project_doc",
|
|
390
|
+
"description": "Create or replace a project document at a path, creating any missing folders.",
|
|
391
|
+
"category": "project-docs",
|
|
392
|
+
"requiredParams": ["path", "content"]
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"name": "move_project_doc",
|
|
396
|
+
"description": "Rename a project document and/or move it to another folder.",
|
|
397
|
+
"category": "project-docs",
|
|
398
|
+
"requiredParams": ["newPath"]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "delete_project_doc",
|
|
402
|
+
"description": "Delete a project document, along with its version history and comments.",
|
|
403
|
+
"category": "project-docs"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "set_project_doc_task",
|
|
407
|
+
"description": "Check or uncheck one Markdown checkbox in a project document by 1-based line number.",
|
|
408
|
+
"category": "project-docs",
|
|
409
|
+
"requiredParams": ["lineNumber", "checked"]
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "list_project_doc_comments",
|
|
413
|
+
"description": "Read the line-anchored comments humans left on a project document, unresolved by default.",
|
|
414
|
+
"category": "project-docs"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"name": "comment_on_project_doc",
|
|
418
|
+
"description": "Leave a comment anchored to one line of a project document.",
|
|
419
|
+
"category": "project-docs",
|
|
420
|
+
"requiredParams": ["lineNumber", "content"]
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "respond_to_project_doc_comment",
|
|
424
|
+
"description": "Answer a comment thread on a project document — reply, resolve, or both.",
|
|
425
|
+
"category": "project-docs",
|
|
426
|
+
"requiredParams": ["commentId"]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "list_project_doc_versions",
|
|
430
|
+
"description": "List a project document's edit history — version number, author and timestamp, newest first.",
|
|
431
|
+
"category": "project-docs"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "restore_project_doc_version",
|
|
435
|
+
"description": "Roll a project document back to an earlier version, appended as a new version rather than a rewind.",
|
|
436
|
+
"category": "project-docs",
|
|
437
|
+
"requiredParams": ["versionNumber"]
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "upload_project_doc_image",
|
|
441
|
+
"description": "Upload a local image file to a project document and get the Markdown snippet to embed.",
|
|
442
|
+
"category": "project-docs",
|
|
443
|
+
"requiredParams": ["filePath"]
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"name": "move_project_folder",
|
|
447
|
+
"description": "Rename a docs folder and/or move it under another one, taking its whole subtree with it.",
|
|
448
|
+
"category": "project-docs",
|
|
449
|
+
"requiredParams": ["path", "newPath"]
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "delete_project_folder",
|
|
453
|
+
"description": "Delete a docs folder and its subfolders; documents inside are kept and resurface at the project root.",
|
|
454
|
+
"category": "project-docs",
|
|
455
|
+
"requiredParams": ["path"]
|
|
377
456
|
}
|
|
378
457
|
]
|
|
379
458
|
}
|
package/dist/mcp/api.d.ts
CHANGED
|
@@ -16,4 +16,14 @@ export declare function apiPostWithStatus<T>(urlPath: string, body: unknown, con
|
|
|
16
16
|
export declare function apiPatch<T>(urlPath: string, body: unknown, config: Config): Promise<T>;
|
|
17
17
|
export declare function apiPut<T>(urlPath: string, body: unknown, config: Config): Promise<T>;
|
|
18
18
|
export declare function apiDelete(urlPath: string, config: Config): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* POSTs a single file as multipart/form-data. Deliberately does not set Content-Type: fetch has to
|
|
21
|
+
* generate it itself so the multipart boundary matches the body it builds.
|
|
22
|
+
*/
|
|
23
|
+
export declare function apiPostFile<T>(urlPath: string, file: {
|
|
24
|
+
fieldName: string;
|
|
25
|
+
filename: string;
|
|
26
|
+
contentType: string;
|
|
27
|
+
bytes: Uint8Array;
|
|
28
|
+
}, config: Config): Promise<T>;
|
|
19
29
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/mcp/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/mcp/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["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AAE,EACrF,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
|
package/dist/mcp/api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Blob } from 'node:buffer';
|
|
1
2
|
async function requestWithStatus(method, urlPath, body, config) {
|
|
2
3
|
const url = `${config.apiUrl}${urlPath}`;
|
|
3
4
|
const headers = {
|
|
@@ -49,4 +50,26 @@ export async function apiPut(urlPath, body, config) {
|
|
|
49
50
|
export async function apiDelete(urlPath, config) {
|
|
50
51
|
await request('DELETE', urlPath, undefined, config);
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* POSTs a single file as multipart/form-data. Deliberately does not set Content-Type: fetch has to
|
|
55
|
+
* generate it itself so the multipart boundary matches the body it builds.
|
|
56
|
+
*/
|
|
57
|
+
export async function apiPostFile(urlPath, file, config) {
|
|
58
|
+
// Copy into a plain ArrayBuffer: the incoming view may be backed by a pooled Node Buffer, which is
|
|
59
|
+
// both a type mismatch for Blob and a slice of a larger allocation.
|
|
60
|
+
const buffer = new ArrayBuffer(file.bytes.byteLength);
|
|
61
|
+
new Uint8Array(buffer).set(file.bytes);
|
|
62
|
+
const form = new FormData();
|
|
63
|
+
form.append(file.fieldName, new Blob([buffer], { type: file.contentType }), file.filename);
|
|
64
|
+
const response = await fetch(`${config.apiUrl}${urlPath}`, {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
headers: { Authorization: `Bearer ${config.apiKey}` },
|
|
67
|
+
body: form,
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
const text = await response.text().catch(() => '');
|
|
71
|
+
throw new Error(`API error ${response.status}: ${text}`);
|
|
72
|
+
}
|
|
73
|
+
return (await response.json());
|
|
74
|
+
}
|
|
52
75
|
//# sourceMappingURL=api.js.map
|
package/dist/mcp/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/mcp/api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ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAszBA,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAgmBlD"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { listIntegrationTools, listConnectorCatalog } from './tools/integrations
|
|
|
11
11
|
import { listAgents, createAgent, updateAgent, deleteAgent } from './tools/agents.js';
|
|
12
12
|
import { listSkills, registerSkill } from './tools/skills.js';
|
|
13
13
|
import { submitKnowledgeSource, readKnowledgeSources, searchKnowledge, readKnowledgePages, writeKnowledgePages, listKnowledgeDomains, suggestKnowledgeDomain, } from './tools/knowledge.js';
|
|
14
|
+
import { listProjectDocs, readProjectDoc, writeProjectDoc, moveProjectDoc, deleteProjectDoc, setProjectDocTask, listProjectDocComments, commentOnProjectDoc, respondToProjectDocComment, listProjectDocVersions, restoreProjectDocVersion, uploadProjectDocImage, moveProjectFolder, deleteProjectFolder, } from './tools/project-docs.js';
|
|
14
15
|
const TOOLS = [
|
|
15
16
|
// --- Canonical Work Item tools (v2 /work-items surface) ---
|
|
16
17
|
{
|
|
@@ -493,7 +494,7 @@ const TOOLS = [
|
|
|
493
494
|
},
|
|
494
495
|
{
|
|
495
496
|
name: 'write_knowledge_pages',
|
|
496
|
-
description: "Create, update, or delete wiki pages atomically. Updating an existing page requires its current version as baseVersion (read_knowledge_pages first) — a stale write returns a structured {conflict: true, conflicts: [{path, currentVersion, currentContent}]} result instead of throwing; merge and retry once.
|
|
497
|
+
description: "Create, update, or delete wiki pages atomically, plus settle the ingestion sources this batch reviewed. Updating an existing page requires its current version as baseVersion (read_knowledge_pages first) — a stale write returns a structured {conflict: true, conflicts: [{path, currentVersion, currentContent}]} result instead of throwing; merge and retry once. sourceIds are sources you filed into a page (marked PROCESSED); skipped (with a required reason each) are sources you reviewed and deliberately did not file (marked SKIPPED — the reason is shown to a human in the Inbox). Both may be set in one call; a source id belongs to exactly one — the same id in both is rejected. writes may be empty when sourceIds/skipped cover the batch, to settle sources with no page change. Verify with read_knowledge_sources.",
|
|
497
498
|
inputSchema: {
|
|
498
499
|
type: 'object',
|
|
499
500
|
properties: {
|
|
@@ -509,9 +510,21 @@ const TOOLS = [
|
|
|
509
510
|
},
|
|
510
511
|
required: ['path'],
|
|
511
512
|
},
|
|
512
|
-
description: 'Pages to write or delete; may be empty when sourceIds
|
|
513
|
+
description: 'Pages to write or delete; may be empty when sourceIds/skipped cover the batch (no wiki change needed)',
|
|
513
514
|
},
|
|
514
515
|
sourceIds: { type: 'array', items: { type: 'string' }, description: 'Knowledge-inbox source IDs to mark PROCESSED atomically with this write (optional)' },
|
|
516
|
+
skipped: {
|
|
517
|
+
type: 'array',
|
|
518
|
+
items: {
|
|
519
|
+
type: 'object',
|
|
520
|
+
properties: {
|
|
521
|
+
sourceId: { type: 'string' },
|
|
522
|
+
reason: { type: 'string', description: "Why this source wasn't filed — required, shown to a human in the Inbox" },
|
|
523
|
+
},
|
|
524
|
+
required: ['sourceId', 'reason'],
|
|
525
|
+
},
|
|
526
|
+
description: 'Knowledge-inbox sources this batch reviewed and deliberately did not file; marked SKIPPED with the given reason atomically with this write (optional)',
|
|
527
|
+
},
|
|
515
528
|
},
|
|
516
529
|
required: ['writes'],
|
|
517
530
|
},
|
|
@@ -540,6 +553,187 @@ const TOOLS = [
|
|
|
540
553
|
required: ['slug', 'displayName', 'reason'],
|
|
541
554
|
},
|
|
542
555
|
},
|
|
556
|
+
// --- Project Docs (the project's own document tree, not Work Item documents) ---
|
|
557
|
+
{
|
|
558
|
+
name: 'list_project_docs',
|
|
559
|
+
description: "Map the project's Docs section: every document as a \"Folder/Title\" path with its docId, plus each folder with its docCount and lastUpdatedAt so you can judge which parts of the tree carry weight or have gone stale. Pass query to full-text search instead. Call this first to orient before reading or writing project docs.",
|
|
560
|
+
inputSchema: {
|
|
561
|
+
type: 'object',
|
|
562
|
+
properties: {
|
|
563
|
+
folder: { type: 'string', description: 'Limit to one folder path, e.g. "Plans/Q3" (omit for the whole tree)' },
|
|
564
|
+
query: { type: 'string', description: 'Full-text search over titles and content; returns matches with snippets instead of the tree' },
|
|
565
|
+
},
|
|
566
|
+
required: [],
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
name: 'read_project_doc',
|
|
571
|
+
description: 'Read one project document by path ("Plans/Q3 Roadmap") or docId. Returns full Markdown content plus taskLines — every checkbox with its 1-based line number and state, which is what set_project_doc_task takes. Pass versionNumber (from list_project_doc_versions) to read an earlier version instead of the current one.',
|
|
572
|
+
inputSchema: {
|
|
573
|
+
type: 'object',
|
|
574
|
+
properties: {
|
|
575
|
+
path: { type: 'string', description: 'Document path, e.g. "Plans/Q3 Roadmap"' },
|
|
576
|
+
docId: { type: 'string', description: 'Document ID — use instead of path when the title contains "/"' },
|
|
577
|
+
versionNumber: { type: 'number', description: 'Read this historical version instead of current content' },
|
|
578
|
+
},
|
|
579
|
+
required: [],
|
|
580
|
+
},
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: 'write_project_doc',
|
|
584
|
+
description: 'Create or replace a project document at a path, creating any missing folders (upsert). Replaces the whole document, records a version, and marks unresolved line comments stale — to tick a checkbox use set_project_doc_task instead, which does none of that. Verify with read_project_doc.',
|
|
585
|
+
inputSchema: {
|
|
586
|
+
type: 'object',
|
|
587
|
+
properties: {
|
|
588
|
+
path: { type: 'string', description: 'Destination path, e.g. "Plans/Q3 Roadmap" — folder segments are created if missing' },
|
|
589
|
+
content: { type: 'string', description: 'Full Markdown content' },
|
|
590
|
+
},
|
|
591
|
+
required: ['path', 'content'],
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: 'move_project_doc',
|
|
596
|
+
description: 'Rename a project document and/or move it to another folder, creating missing folders in the destination path. Verify with list_project_docs.',
|
|
597
|
+
inputSchema: {
|
|
598
|
+
type: 'object',
|
|
599
|
+
properties: {
|
|
600
|
+
path: { type: 'string', description: 'Current document path' },
|
|
601
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
602
|
+
newPath: { type: 'string', description: 'New path, e.g. "Archive/Q2 Roadmap"' },
|
|
603
|
+
},
|
|
604
|
+
required: ['newPath'],
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
name: 'delete_project_doc',
|
|
609
|
+
description: 'Delete a project document. Irreversible — its version history and comments go with it. Verify with list_project_docs.',
|
|
610
|
+
inputSchema: {
|
|
611
|
+
type: 'object',
|
|
612
|
+
properties: {
|
|
613
|
+
path: { type: 'string', description: 'Document path' },
|
|
614
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
615
|
+
},
|
|
616
|
+
required: [],
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: 'set_project_doc_task',
|
|
621
|
+
description: 'Check or uncheck one Markdown checkbox in a project document. lineNumber is 1-based against raw content including frontmatter — take it from read_project_doc\'s taskLines. Unlike write_project_doc this records no version and leaves comment anchors valid. Idempotent; returns conflict: true if that line is no longer a task item.',
|
|
622
|
+
inputSchema: {
|
|
623
|
+
type: 'object',
|
|
624
|
+
properties: {
|
|
625
|
+
path: { type: 'string', description: 'Document path' },
|
|
626
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
627
|
+
lineNumber: { type: 'number', description: '1-based line number of the task item (from read_project_doc taskLines)' },
|
|
628
|
+
checked: { type: 'boolean', description: 'true to check the box, false to uncheck' },
|
|
629
|
+
},
|
|
630
|
+
required: ['lineNumber', 'checked'],
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'list_project_doc_comments',
|
|
635
|
+
description: 'Read the comments humans left on a project document — each with its anchored lineNumber, quotedText, lineStale flag and replies. Unresolved only by default. Answer them with respond_to_project_doc_comment.',
|
|
636
|
+
inputSchema: {
|
|
637
|
+
type: 'object',
|
|
638
|
+
properties: {
|
|
639
|
+
path: { type: 'string', description: 'Document path' },
|
|
640
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
641
|
+
includeResolved: { type: 'boolean', description: 'Include already-resolved threads (default false)' },
|
|
642
|
+
},
|
|
643
|
+
required: [],
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: 'comment_on_project_doc',
|
|
648
|
+
description: 'Leave a comment anchored to one line of a project document. lineNumber is 1-based against raw content including frontmatter. Verify with list_project_doc_comments.',
|
|
649
|
+
inputSchema: {
|
|
650
|
+
type: 'object',
|
|
651
|
+
properties: {
|
|
652
|
+
path: { type: 'string', description: 'Document path' },
|
|
653
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
654
|
+
lineNumber: { type: 'number', description: '1-based line number to anchor the comment to' },
|
|
655
|
+
content: { type: 'string', description: 'Comment text' },
|
|
656
|
+
quotedText: { type: 'string', description: 'Optional snippet of the line being commented on, shown as context' },
|
|
657
|
+
},
|
|
658
|
+
required: ['lineNumber', 'content'],
|
|
659
|
+
},
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: 'respond_to_project_doc_comment',
|
|
663
|
+
description: 'Answer a comment thread on a project document: post a reply, mark it resolved, or both. Verify with list_project_doc_comments.',
|
|
664
|
+
inputSchema: {
|
|
665
|
+
type: 'object',
|
|
666
|
+
properties: {
|
|
667
|
+
path: { type: 'string', description: 'Document path' },
|
|
668
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
669
|
+
commentId: { type: 'string', description: 'ID of the comment thread (from list_project_doc_comments)' },
|
|
670
|
+
reply: { type: 'string', description: 'Reply text to post on the thread' },
|
|
671
|
+
resolve: { type: 'boolean', description: 'true to mark the thread resolved' },
|
|
672
|
+
},
|
|
673
|
+
required: ['commentId'],
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
name: 'list_project_doc_versions',
|
|
678
|
+
description: 'List a project document\'s edit history — versionNumber, who wrote it and when, newest first. Every full-content write adds one; ticking a checkbox does not. Read one with read_project_doc versionNumber, or roll back with restore_project_doc_version.',
|
|
679
|
+
inputSchema: {
|
|
680
|
+
type: 'object',
|
|
681
|
+
properties: {
|
|
682
|
+
path: { type: 'string', description: 'Document path' },
|
|
683
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
684
|
+
},
|
|
685
|
+
required: [],
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
name: 'restore_project_doc_version',
|
|
690
|
+
description: 'Roll a project document back to an earlier version (from list_project_doc_versions). Appends the old content as a new version rather than rewinding, so the restore is itself undoable. Verify with read_project_doc.',
|
|
691
|
+
inputSchema: {
|
|
692
|
+
type: 'object',
|
|
693
|
+
properties: {
|
|
694
|
+
path: { type: 'string', description: 'Document path' },
|
|
695
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
696
|
+
versionNumber: { type: 'number', description: 'Version to restore, from list_project_doc_versions' },
|
|
697
|
+
},
|
|
698
|
+
required: ['versionNumber'],
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: 'upload_project_doc_image',
|
|
703
|
+
description: 'Upload a local image file (png, jpeg, gif, webp) to a project document and get the Markdown snippet to embed. Include that snippet in the content you pass to write_project_doc — the link is stored as a stable reference and re-signed on every read, so it will not expire.',
|
|
704
|
+
inputSchema: {
|
|
705
|
+
type: 'object',
|
|
706
|
+
properties: {
|
|
707
|
+
path: { type: 'string', description: 'Document path the image belongs to' },
|
|
708
|
+
docId: { type: 'string', description: 'Document ID — use instead of path' },
|
|
709
|
+
filePath: { type: 'string', description: 'Path to the image file on this machine' },
|
|
710
|
+
},
|
|
711
|
+
required: ['filePath'],
|
|
712
|
+
},
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
name: 'move_project_folder',
|
|
716
|
+
description: 'Rename a docs folder and/or move it under another one, taking its whole subtree with it. Missing folders in the destination path are created. Cannot move a folder into its own subtree. Verify with list_project_docs.',
|
|
717
|
+
inputSchema: {
|
|
718
|
+
type: 'object',
|
|
719
|
+
properties: {
|
|
720
|
+
path: { type: 'string', description: 'Current folder path, e.g. "Plans/Q3"' },
|
|
721
|
+
newPath: { type: 'string', description: 'New folder path, e.g. "Archive/2026/Q3"' },
|
|
722
|
+
},
|
|
723
|
+
required: ['path', 'newPath'],
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: 'delete_project_folder',
|
|
728
|
+
description: 'Delete a docs folder and its subfolders. Not destructive to content: documents inside are kept and resurface at the project root. Use it to clear away empty or obsolete folders after reorganising. Verify with list_project_docs.',
|
|
729
|
+
inputSchema: {
|
|
730
|
+
type: 'object',
|
|
731
|
+
properties: {
|
|
732
|
+
path: { type: 'string', description: 'Folder path to delete, e.g. "Archive/Old"' },
|
|
733
|
+
},
|
|
734
|
+
required: ['path'],
|
|
735
|
+
},
|
|
736
|
+
},
|
|
543
737
|
];
|
|
544
738
|
function authErrorResponse() {
|
|
545
739
|
return {
|
|
@@ -857,6 +1051,7 @@ export async function runMcpServer() {
|
|
|
857
1051
|
const result = await writeKnowledgePages({
|
|
858
1052
|
writes: params['writes'] ?? [],
|
|
859
1053
|
sourceIds: params['sourceIds'],
|
|
1054
|
+
skipped: params['skipped'],
|
|
860
1055
|
}, config);
|
|
861
1056
|
return successResponse(result);
|
|
862
1057
|
}
|
|
@@ -874,6 +1069,115 @@ export async function runMcpServer() {
|
|
|
874
1069
|
}, config);
|
|
875
1070
|
return successResponse(result);
|
|
876
1071
|
}
|
|
1072
|
+
// --- Project Docs ---
|
|
1073
|
+
case 'list_project_docs': {
|
|
1074
|
+
const result = await listProjectDocs({
|
|
1075
|
+
folder: params['folder'],
|
|
1076
|
+
query: params['query'],
|
|
1077
|
+
}, config);
|
|
1078
|
+
return successResponse(result);
|
|
1079
|
+
}
|
|
1080
|
+
case 'read_project_doc': {
|
|
1081
|
+
const result = await readProjectDoc({
|
|
1082
|
+
path: params['path'],
|
|
1083
|
+
docId: params['docId'],
|
|
1084
|
+
versionNumber: params['versionNumber'],
|
|
1085
|
+
}, config);
|
|
1086
|
+
return successResponse(result);
|
|
1087
|
+
}
|
|
1088
|
+
case 'write_project_doc': {
|
|
1089
|
+
const result = await writeProjectDoc({
|
|
1090
|
+
path: params['path'],
|
|
1091
|
+
content: params['content'],
|
|
1092
|
+
}, config);
|
|
1093
|
+
return successResponse(result);
|
|
1094
|
+
}
|
|
1095
|
+
case 'move_project_doc': {
|
|
1096
|
+
const result = await moveProjectDoc({
|
|
1097
|
+
path: params['path'],
|
|
1098
|
+
docId: params['docId'],
|
|
1099
|
+
newPath: params['newPath'],
|
|
1100
|
+
}, config);
|
|
1101
|
+
return successResponse(result);
|
|
1102
|
+
}
|
|
1103
|
+
case 'delete_project_doc': {
|
|
1104
|
+
const result = await deleteProjectDoc({
|
|
1105
|
+
path: params['path'],
|
|
1106
|
+
docId: params['docId'],
|
|
1107
|
+
}, config);
|
|
1108
|
+
return successResponse(result);
|
|
1109
|
+
}
|
|
1110
|
+
case 'set_project_doc_task': {
|
|
1111
|
+
const result = await setProjectDocTask({
|
|
1112
|
+
path: params['path'],
|
|
1113
|
+
docId: params['docId'],
|
|
1114
|
+
lineNumber: params['lineNumber'],
|
|
1115
|
+
checked: params['checked'],
|
|
1116
|
+
}, config);
|
|
1117
|
+
return successResponse(result);
|
|
1118
|
+
}
|
|
1119
|
+
case 'list_project_doc_comments': {
|
|
1120
|
+
const result = await listProjectDocComments({
|
|
1121
|
+
path: params['path'],
|
|
1122
|
+
docId: params['docId'],
|
|
1123
|
+
includeResolved: params['includeResolved'],
|
|
1124
|
+
}, config);
|
|
1125
|
+
return successResponse(result);
|
|
1126
|
+
}
|
|
1127
|
+
case 'comment_on_project_doc': {
|
|
1128
|
+
const result = await commentOnProjectDoc({
|
|
1129
|
+
path: params['path'],
|
|
1130
|
+
docId: params['docId'],
|
|
1131
|
+
lineNumber: params['lineNumber'],
|
|
1132
|
+
content: params['content'],
|
|
1133
|
+
quotedText: params['quotedText'],
|
|
1134
|
+
}, config);
|
|
1135
|
+
return successResponse(result);
|
|
1136
|
+
}
|
|
1137
|
+
case 'respond_to_project_doc_comment': {
|
|
1138
|
+
const result = await respondToProjectDocComment({
|
|
1139
|
+
path: params['path'],
|
|
1140
|
+
docId: params['docId'],
|
|
1141
|
+
commentId: params['commentId'],
|
|
1142
|
+
reply: params['reply'],
|
|
1143
|
+
resolve: params['resolve'],
|
|
1144
|
+
}, config);
|
|
1145
|
+
return successResponse(result);
|
|
1146
|
+
}
|
|
1147
|
+
case 'list_project_doc_versions': {
|
|
1148
|
+
const result = await listProjectDocVersions({
|
|
1149
|
+
path: params['path'],
|
|
1150
|
+
docId: params['docId'],
|
|
1151
|
+
}, config);
|
|
1152
|
+
return successResponse(result);
|
|
1153
|
+
}
|
|
1154
|
+
case 'restore_project_doc_version': {
|
|
1155
|
+
const result = await restoreProjectDocVersion({
|
|
1156
|
+
path: params['path'],
|
|
1157
|
+
docId: params['docId'],
|
|
1158
|
+
versionNumber: params['versionNumber'],
|
|
1159
|
+
}, config);
|
|
1160
|
+
return successResponse(result);
|
|
1161
|
+
}
|
|
1162
|
+
case 'move_project_folder': {
|
|
1163
|
+
const result = await moveProjectFolder({
|
|
1164
|
+
path: params['path'],
|
|
1165
|
+
newPath: params['newPath'],
|
|
1166
|
+
}, config);
|
|
1167
|
+
return successResponse(result);
|
|
1168
|
+
}
|
|
1169
|
+
case 'delete_project_folder': {
|
|
1170
|
+
const result = await deleteProjectFolder({ path: params['path'] }, config);
|
|
1171
|
+
return successResponse(result);
|
|
1172
|
+
}
|
|
1173
|
+
case 'upload_project_doc_image': {
|
|
1174
|
+
const result = await uploadProjectDocImage({
|
|
1175
|
+
path: params['path'],
|
|
1176
|
+
docId: params['docId'],
|
|
1177
|
+
filePath: params['filePath'],
|
|
1178
|
+
}, config);
|
|
1179
|
+
return successResponse(result);
|
|
1180
|
+
}
|
|
877
1181
|
default:
|
|
878
1182
|
return errorResponse(`Unknown tool: ${name}`);
|
|
879
1183
|
}
|