@hasna/conversations 0.1.19 → 0.1.21
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/bin/index.js +273 -212
- package/bin/mcp.js +273 -212
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -3503,7 +3503,7 @@ var init_poll = __esm(() => {
|
|
|
3503
3503
|
var require_package = __commonJS((exports, module) => {
|
|
3504
3504
|
module.exports = {
|
|
3505
3505
|
name: "@hasna/conversations",
|
|
3506
|
-
version: "0.1.
|
|
3506
|
+
version: "0.1.21",
|
|
3507
3507
|
description: "Real-time CLI messaging for AI agents",
|
|
3508
3508
|
type: "module",
|
|
3509
3509
|
bin: {
|
|
@@ -32474,43 +32474,22 @@ var init_mcp2 = __esm(() => {
|
|
|
32474
32474
|
version: import__package.default.version
|
|
32475
32475
|
});
|
|
32476
32476
|
server.registerTool("send_message", {
|
|
32477
|
-
|
|
32478
|
-
description: "Send a direct message to another agent.",
|
|
32477
|
+
description: "Send a DM to an agent.",
|
|
32479
32478
|
inputSchema: {
|
|
32480
|
-
|
|
32481
|
-
|
|
32482
|
-
|
|
32483
|
-
|
|
32484
|
-
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32488
|
-
metadata: exports_external.string().optional().describe("JSON metadata string"),
|
|
32489
|
-
blocking: exports_external.boolean().optional().describe("Blocking message \u2014 recipients must acknowledge before continuing")
|
|
32490
|
-
}
|
|
32491
|
-
}, async ({ from: fromParam, to, content, session_id, priority, working_dir, repository, branch, metadata, blocking }) => {
|
|
32479
|
+
to: exports_external.string(),
|
|
32480
|
+
content: exports_external.string(),
|
|
32481
|
+
from: exports_external.string().optional(),
|
|
32482
|
+
priority: exports_external.string().optional(),
|
|
32483
|
+
blocking: exports_external.boolean().optional()
|
|
32484
|
+
}
|
|
32485
|
+
}, async (args) => {
|
|
32486
|
+
const { from: fromParam, to, content, priority, blocking } = args;
|
|
32492
32487
|
const from = resolveIdentity(fromParam);
|
|
32493
|
-
let parsedMetadata;
|
|
32494
|
-
if (metadata) {
|
|
32495
|
-
try {
|
|
32496
|
-
parsedMetadata = JSON.parse(metadata);
|
|
32497
|
-
} catch {
|
|
32498
|
-
return {
|
|
32499
|
-
content: [{ type: "text", text: "invalid JSON" }],
|
|
32500
|
-
isError: true
|
|
32501
|
-
};
|
|
32502
|
-
}
|
|
32503
|
-
}
|
|
32504
32488
|
const msg = sendMessage({
|
|
32505
32489
|
from,
|
|
32506
32490
|
to,
|
|
32507
32491
|
content,
|
|
32508
|
-
session_id,
|
|
32509
32492
|
priority,
|
|
32510
|
-
working_dir,
|
|
32511
|
-
repository,
|
|
32512
|
-
branch,
|
|
32513
|
-
metadata: parsedMetadata,
|
|
32514
32493
|
blocking
|
|
32515
32494
|
});
|
|
32516
32495
|
return {
|
|
@@ -32518,45 +32497,43 @@ var init_mcp2 = __esm(() => {
|
|
|
32518
32497
|
};
|
|
32519
32498
|
});
|
|
32520
32499
|
server.registerTool("read_messages", {
|
|
32521
|
-
|
|
32522
|
-
description: "Read messages with optional filters. Returns messages sorted by time.",
|
|
32500
|
+
description: "Read DMs with optional filters.",
|
|
32523
32501
|
inputSchema: {
|
|
32524
|
-
session_id: exports_external.string().optional()
|
|
32525
|
-
from: exports_external.string().optional()
|
|
32526
|
-
to: exports_external.string().optional()
|
|
32527
|
-
space: exports_external.string().optional()
|
|
32528
|
-
since: exports_external.string().optional()
|
|
32529
|
-
limit: exports_external.number().optional()
|
|
32530
|
-
unread_only: exports_external.boolean().optional()
|
|
32531
|
-
}
|
|
32532
|
-
}, async (
|
|
32533
|
-
const messages = readMessages(
|
|
32502
|
+
session_id: exports_external.string().optional(),
|
|
32503
|
+
from: exports_external.string().optional(),
|
|
32504
|
+
to: exports_external.string().optional(),
|
|
32505
|
+
space: exports_external.string().optional(),
|
|
32506
|
+
since: exports_external.string().optional(),
|
|
32507
|
+
limit: exports_external.number().optional(),
|
|
32508
|
+
unread_only: exports_external.boolean().optional()
|
|
32509
|
+
}
|
|
32510
|
+
}, async (args) => {
|
|
32511
|
+
const messages = readMessages(args);
|
|
32534
32512
|
return {
|
|
32535
32513
|
content: [{ type: "text", text: JSON.stringify(messages, null, 2) }]
|
|
32536
32514
|
};
|
|
32537
32515
|
});
|
|
32538
32516
|
server.registerTool("list_sessions", {
|
|
32539
|
-
|
|
32540
|
-
description: "List conversation sessions, optionally filtered to a specific agent.",
|
|
32517
|
+
description: "List all sessions by agent.",
|
|
32541
32518
|
inputSchema: {
|
|
32542
|
-
agent: exports_external.string().optional()
|
|
32519
|
+
agent: exports_external.string().optional()
|
|
32543
32520
|
}
|
|
32544
|
-
}, async (
|
|
32521
|
+
}, async (args) => {
|
|
32522
|
+
const { agent } = args;
|
|
32545
32523
|
const sessions = listSessions(agent);
|
|
32546
32524
|
return {
|
|
32547
32525
|
content: [{ type: "text", text: JSON.stringify(sessions, null, 2) }]
|
|
32548
32526
|
};
|
|
32549
32527
|
});
|
|
32550
32528
|
server.registerTool("reply", {
|
|
32551
|
-
|
|
32552
|
-
description: "Reply to a message by ID. Uses the same session and sends to the original sender.",
|
|
32529
|
+
description: "Reply to a message by ID.",
|
|
32553
32530
|
inputSchema: {
|
|
32554
|
-
|
|
32555
|
-
|
|
32556
|
-
|
|
32557
|
-
priority: exports_external.enum(["low", "normal", "high", "urgent"]).optional().describe("Message priority")
|
|
32531
|
+
message_id: exports_external.number(),
|
|
32532
|
+
content: exports_external.string(),
|
|
32533
|
+
from: exports_external.string().optional()
|
|
32558
32534
|
}
|
|
32559
|
-
}, async (
|
|
32535
|
+
}, async (args) => {
|
|
32536
|
+
const { from: fromParam, message_id, content } = args;
|
|
32560
32537
|
const original = getMessageById(message_id);
|
|
32561
32538
|
if (!original) {
|
|
32562
32539
|
return {
|
|
@@ -32572,7 +32549,6 @@ var init_mcp2 = __esm(() => {
|
|
|
32572
32549
|
to,
|
|
32573
32550
|
content,
|
|
32574
32551
|
session_id: original.session_id,
|
|
32575
|
-
priority,
|
|
32576
32552
|
space
|
|
32577
32553
|
});
|
|
32578
32554
|
return {
|
|
@@ -32580,14 +32556,14 @@ var init_mcp2 = __esm(() => {
|
|
|
32580
32556
|
};
|
|
32581
32557
|
});
|
|
32582
32558
|
server.registerTool("mark_read", {
|
|
32583
|
-
|
|
32584
|
-
description: "Mark messages as read. Provide IDs or set 'all' to true.",
|
|
32559
|
+
description: "Mark messages read by IDs or all.",
|
|
32585
32560
|
inputSchema: {
|
|
32586
|
-
from: exports_external.string().optional()
|
|
32587
|
-
ids: exports_external.array(exports_external.number()).optional()
|
|
32588
|
-
all: exports_external.boolean().optional()
|
|
32561
|
+
from: exports_external.string().optional(),
|
|
32562
|
+
ids: exports_external.array(exports_external.number()).optional(),
|
|
32563
|
+
all: exports_external.boolean().optional()
|
|
32589
32564
|
}
|
|
32590
|
-
}, async (
|
|
32565
|
+
}, async (args) => {
|
|
32566
|
+
const { from: fromParam, ids, all } = args;
|
|
32591
32567
|
const agent = resolveIdentity(fromParam);
|
|
32592
32568
|
let count;
|
|
32593
32569
|
if (all) {
|
|
@@ -32605,49 +32581,49 @@ var init_mcp2 = __esm(() => {
|
|
|
32605
32581
|
};
|
|
32606
32582
|
});
|
|
32607
32583
|
server.registerTool("search_messages", {
|
|
32608
|
-
|
|
32609
|
-
description: "Full-text search across message content, newest first.",
|
|
32584
|
+
description: "Full-text search across messages.",
|
|
32610
32585
|
inputSchema: {
|
|
32611
|
-
query: exports_external.string()
|
|
32612
|
-
space: exports_external.string().optional()
|
|
32613
|
-
from: exports_external.string().optional()
|
|
32614
|
-
to: exports_external.string().optional()
|
|
32615
|
-
limit: exports_external.number().optional()
|
|
32616
|
-
}
|
|
32617
|
-
}, async (
|
|
32586
|
+
query: exports_external.string(),
|
|
32587
|
+
space: exports_external.string().optional(),
|
|
32588
|
+
from: exports_external.string().optional(),
|
|
32589
|
+
to: exports_external.string().optional(),
|
|
32590
|
+
limit: exports_external.number().optional()
|
|
32591
|
+
}
|
|
32592
|
+
}, async (args) => {
|
|
32593
|
+
const { query, space, from, to, limit } = args;
|
|
32618
32594
|
const messages = searchMessages({ query, space, from, to, limit });
|
|
32619
32595
|
return {
|
|
32620
32596
|
content: [{ type: "text", text: JSON.stringify(messages, null, 2) }]
|
|
32621
32597
|
};
|
|
32622
32598
|
});
|
|
32623
32599
|
server.registerTool("export_messages", {
|
|
32624
|
-
|
|
32625
|
-
description: "Export messages as JSON or CSV with optional filters.",
|
|
32600
|
+
description: "Export messages as JSON or CSV.",
|
|
32626
32601
|
inputSchema: {
|
|
32627
|
-
space: exports_external.string().optional()
|
|
32628
|
-
session_id: exports_external.string().optional()
|
|
32629
|
-
from: exports_external.string().optional()
|
|
32630
|
-
since: exports_external.string().optional()
|
|
32631
|
-
until: exports_external.string().optional()
|
|
32632
|
-
format: exports_external.
|
|
32633
|
-
}
|
|
32634
|
-
}, async (
|
|
32602
|
+
space: exports_external.string().optional(),
|
|
32603
|
+
session_id: exports_external.string().optional(),
|
|
32604
|
+
from: exports_external.string().optional(),
|
|
32605
|
+
since: exports_external.string().optional(),
|
|
32606
|
+
until: exports_external.string().optional(),
|
|
32607
|
+
format: exports_external.string().optional()
|
|
32608
|
+
}
|
|
32609
|
+
}, async (args) => {
|
|
32610
|
+
const { space, session_id, from, since, until, format } = args;
|
|
32635
32611
|
const result = exportMessages({ space, session_id, from, since, until, format });
|
|
32636
32612
|
return {
|
|
32637
32613
|
content: [{ type: "text", text: result }]
|
|
32638
32614
|
};
|
|
32639
32615
|
});
|
|
32640
32616
|
server.registerTool("create_space", {
|
|
32641
|
-
|
|
32642
|
-
description: "Create a new space. Creator is auto-joined. Supports nesting (max 3 levels) and project association.",
|
|
32617
|
+
description: "Create a space and auto-join.",
|
|
32643
32618
|
inputSchema: {
|
|
32644
|
-
|
|
32645
|
-
|
|
32646
|
-
description: exports_external.string().optional()
|
|
32647
|
-
parent_id: exports_external.string().optional()
|
|
32648
|
-
project_id: exports_external.string().optional()
|
|
32649
|
-
}
|
|
32650
|
-
}, async (
|
|
32619
|
+
name: exports_external.string(),
|
|
32620
|
+
from: exports_external.string().optional(),
|
|
32621
|
+
description: exports_external.string().optional(),
|
|
32622
|
+
parent_id: exports_external.string().optional(),
|
|
32623
|
+
project_id: exports_external.string().optional()
|
|
32624
|
+
}
|
|
32625
|
+
}, async (args) => {
|
|
32626
|
+
const { from: fromParam, name, description, parent_id, project_id } = args;
|
|
32651
32627
|
const agent = resolveIdentity(fromParam);
|
|
32652
32628
|
try {
|
|
32653
32629
|
const sp = createSpace(name, agent, { description, parent_id, project_id });
|
|
@@ -32668,14 +32644,14 @@ var init_mcp2 = __esm(() => {
|
|
|
32668
32644
|
}
|
|
32669
32645
|
});
|
|
32670
32646
|
server.registerTool("list_spaces", {
|
|
32671
|
-
|
|
32672
|
-
description: "List spaces with member/message counts. Archived spaces excluded by default.",
|
|
32647
|
+
description: "List spaces with counts.",
|
|
32673
32648
|
inputSchema: {
|
|
32674
|
-
project_id: exports_external.string().optional()
|
|
32675
|
-
parent_id: exports_external.string().optional()
|
|
32676
|
-
include_archived: exports_external.boolean().optional()
|
|
32649
|
+
project_id: exports_external.string().optional(),
|
|
32650
|
+
parent_id: exports_external.string().optional(),
|
|
32651
|
+
include_archived: exports_external.boolean().optional()
|
|
32677
32652
|
}
|
|
32678
|
-
}, async (
|
|
32653
|
+
}, async (args) => {
|
|
32654
|
+
const { project_id, parent_id, include_archived } = args;
|
|
32679
32655
|
const opts = {};
|
|
32680
32656
|
if (project_id)
|
|
32681
32657
|
opts.project_id = project_id;
|
|
@@ -32692,16 +32668,16 @@ var init_mcp2 = __esm(() => {
|
|
|
32692
32668
|
};
|
|
32693
32669
|
});
|
|
32694
32670
|
server.registerTool("send_to_space", {
|
|
32695
|
-
|
|
32696
|
-
description: "Send a message to a space. All members can see it.",
|
|
32671
|
+
description: "Post a message to a space.",
|
|
32697
32672
|
inputSchema: {
|
|
32698
|
-
|
|
32699
|
-
|
|
32700
|
-
|
|
32701
|
-
priority: exports_external.
|
|
32702
|
-
blocking: exports_external.boolean().optional()
|
|
32703
|
-
}
|
|
32704
|
-
}, async (
|
|
32673
|
+
space: exports_external.string(),
|
|
32674
|
+
content: exports_external.string(),
|
|
32675
|
+
from: exports_external.string().optional(),
|
|
32676
|
+
priority: exports_external.string().optional(),
|
|
32677
|
+
blocking: exports_external.boolean().optional()
|
|
32678
|
+
}
|
|
32679
|
+
}, async (args) => {
|
|
32680
|
+
const { from: fromParam, space, content, priority, blocking } = args;
|
|
32705
32681
|
const from = resolveIdentity(fromParam);
|
|
32706
32682
|
const sp = getSpace(space);
|
|
32707
32683
|
if (!sp) {
|
|
@@ -32724,27 +32700,27 @@ var init_mcp2 = __esm(() => {
|
|
|
32724
32700
|
};
|
|
32725
32701
|
});
|
|
32726
32702
|
server.registerTool("read_space", {
|
|
32727
|
-
title: "Read Space",
|
|
32728
32703
|
description: "Read messages from a space.",
|
|
32729
32704
|
inputSchema: {
|
|
32730
|
-
space: exports_external.string()
|
|
32731
|
-
since: exports_external.string().optional()
|
|
32732
|
-
limit: exports_external.number().optional()
|
|
32705
|
+
space: exports_external.string(),
|
|
32706
|
+
since: exports_external.string().optional(),
|
|
32707
|
+
limit: exports_external.number().optional()
|
|
32733
32708
|
}
|
|
32734
|
-
}, async (
|
|
32709
|
+
}, async (args) => {
|
|
32710
|
+
const { space, since, limit } = args;
|
|
32735
32711
|
const messages = readMessages({ space, since, limit });
|
|
32736
32712
|
return {
|
|
32737
32713
|
content: [{ type: "text", text: JSON.stringify(messages, null, 2) }]
|
|
32738
32714
|
};
|
|
32739
32715
|
});
|
|
32740
32716
|
server.registerTool("join_space", {
|
|
32741
|
-
|
|
32742
|
-
description: "Join a space to receive messages.",
|
|
32717
|
+
description: "Join a space as a member.",
|
|
32743
32718
|
inputSchema: {
|
|
32744
|
-
|
|
32745
|
-
|
|
32719
|
+
space: exports_external.string(),
|
|
32720
|
+
from: exports_external.string().optional()
|
|
32746
32721
|
}
|
|
32747
|
-
}, async (
|
|
32722
|
+
}, async (args) => {
|
|
32723
|
+
const { from: fromParam, space } = args;
|
|
32748
32724
|
const agent = resolveIdentity(fromParam);
|
|
32749
32725
|
const ok = joinSpace(space, agent);
|
|
32750
32726
|
if (!ok) {
|
|
@@ -32758,13 +32734,13 @@ var init_mcp2 = __esm(() => {
|
|
|
32758
32734
|
};
|
|
32759
32735
|
});
|
|
32760
32736
|
server.registerTool("leave_space", {
|
|
32761
|
-
title: "Leave Space",
|
|
32762
32737
|
description: "Leave a space.",
|
|
32763
32738
|
inputSchema: {
|
|
32764
|
-
|
|
32765
|
-
|
|
32739
|
+
space: exports_external.string(),
|
|
32740
|
+
from: exports_external.string().optional()
|
|
32766
32741
|
}
|
|
32767
|
-
}, async (
|
|
32742
|
+
}, async (args) => {
|
|
32743
|
+
const { from: fromParam, space } = args;
|
|
32768
32744
|
const agent = resolveIdentity(fromParam);
|
|
32769
32745
|
const left = leaveSpace(space, agent);
|
|
32770
32746
|
return {
|
|
@@ -32772,15 +32748,15 @@ var init_mcp2 = __esm(() => {
|
|
|
32772
32748
|
};
|
|
32773
32749
|
});
|
|
32774
32750
|
server.registerTool("update_space", {
|
|
32775
|
-
|
|
32776
|
-
description: "Update a space's description, parent, or project.",
|
|
32751
|
+
description: "Update space description or parent.",
|
|
32777
32752
|
inputSchema: {
|
|
32778
|
-
name: exports_external.string()
|
|
32779
|
-
description: exports_external.string().optional()
|
|
32780
|
-
parent_id: exports_external.string().optional()
|
|
32781
|
-
project_id: exports_external.string().optional()
|
|
32753
|
+
name: exports_external.string(),
|
|
32754
|
+
description: exports_external.string().optional(),
|
|
32755
|
+
parent_id: exports_external.string().optional(),
|
|
32756
|
+
project_id: exports_external.string().optional()
|
|
32782
32757
|
}
|
|
32783
|
-
}, async (
|
|
32758
|
+
}, async (args) => {
|
|
32759
|
+
const { name, description, parent_id, project_id } = args;
|
|
32784
32760
|
const updates = {};
|
|
32785
32761
|
if (description !== undefined)
|
|
32786
32762
|
updates.description = description;
|
|
@@ -32801,10 +32777,9 @@ var init_mcp2 = __esm(() => {
|
|
|
32801
32777
|
}
|
|
32802
32778
|
});
|
|
32803
32779
|
server.registerTool("archive_space", {
|
|
32804
|
-
|
|
32805
|
-
description: "Archive a space. Hidden from list by default.",
|
|
32780
|
+
description: "Archive a space.",
|
|
32806
32781
|
inputSchema: {
|
|
32807
|
-
name: exports_external.string()
|
|
32782
|
+
name: exports_external.string()
|
|
32808
32783
|
}
|
|
32809
32784
|
}, async ({ name }) => {
|
|
32810
32785
|
try {
|
|
@@ -32820,10 +32795,9 @@ var init_mcp2 = __esm(() => {
|
|
|
32820
32795
|
}
|
|
32821
32796
|
});
|
|
32822
32797
|
server.registerTool("unarchive_space", {
|
|
32823
|
-
|
|
32824
|
-
description: "Unarchive a previously archived space.",
|
|
32798
|
+
description: "Unarchive a space.",
|
|
32825
32799
|
inputSchema: {
|
|
32826
|
-
name: exports_external.string()
|
|
32800
|
+
name: exports_external.string()
|
|
32827
32801
|
}
|
|
32828
32802
|
}, async ({ name }) => {
|
|
32829
32803
|
try {
|
|
@@ -32839,19 +32813,19 @@ var init_mcp2 = __esm(() => {
|
|
|
32839
32813
|
}
|
|
32840
32814
|
});
|
|
32841
32815
|
server.registerTool("create_project", {
|
|
32842
|
-
|
|
32843
|
-
description: "Create a new project to organize spaces and agent collaboration.",
|
|
32816
|
+
description: "Create a project for agent collaboration.",
|
|
32844
32817
|
inputSchema: {
|
|
32845
|
-
|
|
32846
|
-
|
|
32847
|
-
description: exports_external.string().optional()
|
|
32848
|
-
path: exports_external.string().optional()
|
|
32849
|
-
repository: exports_external.string().optional()
|
|
32850
|
-
tags: exports_external.string().optional()
|
|
32851
|
-
metadata: exports_external.string().optional()
|
|
32852
|
-
settings: exports_external.string().optional()
|
|
32853
|
-
}
|
|
32854
|
-
}, async (
|
|
32818
|
+
name: exports_external.string(),
|
|
32819
|
+
from: exports_external.string().optional(),
|
|
32820
|
+
description: exports_external.string().optional(),
|
|
32821
|
+
path: exports_external.string().optional(),
|
|
32822
|
+
repository: exports_external.string().optional(),
|
|
32823
|
+
tags: exports_external.string().optional(),
|
|
32824
|
+
metadata: exports_external.string().optional(),
|
|
32825
|
+
settings: exports_external.string().optional()
|
|
32826
|
+
}
|
|
32827
|
+
}, async (args) => {
|
|
32828
|
+
const { from: fromParam, name, description, path, repository, tags, metadata, settings } = args;
|
|
32855
32829
|
const agent = resolveIdentity(fromParam);
|
|
32856
32830
|
let parsedTags;
|
|
32857
32831
|
if (tags) {
|
|
@@ -32914,22 +32888,21 @@ var init_mcp2 = __esm(() => {
|
|
|
32914
32888
|
}
|
|
32915
32889
|
});
|
|
32916
32890
|
server.registerTool("list_projects", {
|
|
32917
|
-
|
|
32918
|
-
description: "List all registered projects.",
|
|
32891
|
+
description: "List all projects.",
|
|
32919
32892
|
inputSchema: {
|
|
32920
|
-
status: exports_external.
|
|
32893
|
+
status: exports_external.string().optional()
|
|
32921
32894
|
}
|
|
32922
|
-
}, async (
|
|
32895
|
+
}, async (args) => {
|
|
32896
|
+
const { status } = args;
|
|
32923
32897
|
const projects = listProjects(status ? { status } : undefined);
|
|
32924
32898
|
return {
|
|
32925
32899
|
content: [{ type: "text", text: JSON.stringify(projects, null, 2) }]
|
|
32926
32900
|
};
|
|
32927
32901
|
});
|
|
32928
32902
|
server.registerTool("get_project", {
|
|
32929
|
-
|
|
32930
|
-
description: "Get full details of a project by ID or name.",
|
|
32903
|
+
description: "Get a project by ID or name.",
|
|
32931
32904
|
inputSchema: {
|
|
32932
|
-
id: exports_external.string()
|
|
32905
|
+
id: exports_external.string()
|
|
32933
32906
|
}
|
|
32934
32907
|
}, async ({ id }) => {
|
|
32935
32908
|
let project = getProject(id);
|
|
@@ -32947,20 +32920,20 @@ var init_mcp2 = __esm(() => {
|
|
|
32947
32920
|
};
|
|
32948
32921
|
});
|
|
32949
32922
|
server.registerTool("update_project", {
|
|
32950
|
-
|
|
32951
|
-
description: "Update a project's fields.",
|
|
32923
|
+
description: "Update project fields by ID.",
|
|
32952
32924
|
inputSchema: {
|
|
32953
|
-
id: exports_external.string()
|
|
32954
|
-
name: exports_external.string().optional()
|
|
32955
|
-
description: exports_external.string().optional()
|
|
32956
|
-
path: exports_external.string().optional()
|
|
32957
|
-
status: exports_external.
|
|
32958
|
-
repository: exports_external.string().optional()
|
|
32959
|
-
tags: exports_external.string().optional()
|
|
32960
|
-
metadata: exports_external.string().optional()
|
|
32961
|
-
settings: exports_external.string().optional()
|
|
32962
|
-
}
|
|
32963
|
-
}, async (
|
|
32925
|
+
id: exports_external.string(),
|
|
32926
|
+
name: exports_external.string().optional(),
|
|
32927
|
+
description: exports_external.string().optional(),
|
|
32928
|
+
path: exports_external.string().optional(),
|
|
32929
|
+
status: exports_external.string().optional(),
|
|
32930
|
+
repository: exports_external.string().optional(),
|
|
32931
|
+
tags: exports_external.string().optional(),
|
|
32932
|
+
metadata: exports_external.string().optional(),
|
|
32933
|
+
settings: exports_external.string().optional()
|
|
32934
|
+
}
|
|
32935
|
+
}, async (args) => {
|
|
32936
|
+
const { id, name, description, path, status, repository, tags, metadata, settings } = args;
|
|
32964
32937
|
const updates = {};
|
|
32965
32938
|
if (name !== undefined)
|
|
32966
32939
|
updates.name = name;
|
|
@@ -33015,10 +32988,9 @@ var init_mcp2 = __esm(() => {
|
|
|
33015
32988
|
}
|
|
33016
32989
|
});
|
|
33017
32990
|
server.registerTool("delete_project", {
|
|
33018
|
-
|
|
33019
|
-
description: "Delete a project permanently. Fails if spaces reference it.",
|
|
32991
|
+
description: "Delete a project permanently.",
|
|
33020
32992
|
inputSchema: {
|
|
33021
|
-
id: exports_external.string()
|
|
32993
|
+
id: exports_external.string()
|
|
33022
32994
|
}
|
|
33023
32995
|
}, async ({ id }) => {
|
|
33024
32996
|
try {
|
|
@@ -33040,13 +33012,13 @@ var init_mcp2 = __esm(() => {
|
|
|
33040
33012
|
}
|
|
33041
33013
|
});
|
|
33042
33014
|
server.registerTool("delete_message", {
|
|
33043
|
-
|
|
33044
|
-
description: "Delete a message. Only the sender can delete their own messages.",
|
|
33015
|
+
description: "Delete a message (sender only).",
|
|
33045
33016
|
inputSchema: {
|
|
33046
|
-
|
|
33047
|
-
|
|
33017
|
+
id: exports_external.number(),
|
|
33018
|
+
from: exports_external.string().optional()
|
|
33048
33019
|
}
|
|
33049
|
-
}, async (
|
|
33020
|
+
}, async (args) => {
|
|
33021
|
+
const { from: fromParam, id } = args;
|
|
33050
33022
|
const agent = resolveIdentity(fromParam);
|
|
33051
33023
|
const deleted = deleteMessage(id, agent);
|
|
33052
33024
|
if (!deleted) {
|
|
@@ -33060,14 +33032,14 @@ var init_mcp2 = __esm(() => {
|
|
|
33060
33032
|
};
|
|
33061
33033
|
});
|
|
33062
33034
|
server.registerTool("edit_message", {
|
|
33063
|
-
|
|
33064
|
-
description: "Edit a message's content. Only the sender can edit their own messages.",
|
|
33035
|
+
description: "Edit message content (sender only).",
|
|
33065
33036
|
inputSchema: {
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33037
|
+
id: exports_external.number(),
|
|
33038
|
+
content: exports_external.string(),
|
|
33039
|
+
from: exports_external.string().optional()
|
|
33069
33040
|
}
|
|
33070
|
-
}, async (
|
|
33041
|
+
}, async (args) => {
|
|
33042
|
+
const { from: fromParam, id, content } = args;
|
|
33071
33043
|
const agent = resolveIdentity(fromParam);
|
|
33072
33044
|
const msg = editMessage(id, agent, content);
|
|
33073
33045
|
if (!msg) {
|
|
@@ -33081,10 +33053,9 @@ var init_mcp2 = __esm(() => {
|
|
|
33081
33053
|
};
|
|
33082
33054
|
});
|
|
33083
33055
|
server.registerTool("pin_message", {
|
|
33084
|
-
|
|
33085
|
-
description: "Pin a message. Retrieve pinned messages with get_pinned_messages.",
|
|
33056
|
+
description: "Pin a message.",
|
|
33086
33057
|
inputSchema: {
|
|
33087
|
-
id: exports_external.number()
|
|
33058
|
+
id: exports_external.number()
|
|
33088
33059
|
}
|
|
33089
33060
|
}, async ({ id }) => {
|
|
33090
33061
|
const msg = pinMessage(id);
|
|
@@ -33099,10 +33070,9 @@ var init_mcp2 = __esm(() => {
|
|
|
33099
33070
|
};
|
|
33100
33071
|
});
|
|
33101
33072
|
server.registerTool("unpin_message", {
|
|
33102
|
-
|
|
33103
|
-
description: "Unpin a previously pinned message.",
|
|
33073
|
+
description: "Unpin a message.",
|
|
33104
33074
|
inputSchema: {
|
|
33105
|
-
id: exports_external.number()
|
|
33075
|
+
id: exports_external.number()
|
|
33106
33076
|
}
|
|
33107
33077
|
}, async ({ id }) => {
|
|
33108
33078
|
const msg = unpinMessage(id);
|
|
@@ -33117,27 +33087,27 @@ var init_mcp2 = __esm(() => {
|
|
|
33117
33087
|
};
|
|
33118
33088
|
});
|
|
33119
33089
|
server.registerTool("get_pinned_messages", {
|
|
33120
|
-
|
|
33121
|
-
description: "Retrieve pinned messages, optionally filtered by space or session.",
|
|
33090
|
+
description: "Get pinned messages by space or session.",
|
|
33122
33091
|
inputSchema: {
|
|
33123
|
-
space: exports_external.string().optional()
|
|
33124
|
-
session_id: exports_external.string().optional()
|
|
33125
|
-
limit: exports_external.number().optional()
|
|
33092
|
+
space: exports_external.string().optional(),
|
|
33093
|
+
session_id: exports_external.string().optional(),
|
|
33094
|
+
limit: exports_external.number().optional()
|
|
33126
33095
|
}
|
|
33127
|
-
}, async (
|
|
33096
|
+
}, async (args) => {
|
|
33097
|
+
const { space, session_id, limit } = args;
|
|
33128
33098
|
const messages = getPinnedMessages({ space, session_id, limit });
|
|
33129
33099
|
return {
|
|
33130
33100
|
content: [{ type: "text", text: JSON.stringify(messages, null, 2) }]
|
|
33131
33101
|
};
|
|
33132
33102
|
});
|
|
33133
33103
|
server.registerTool("heartbeat", {
|
|
33134
|
-
|
|
33135
|
-
description: "Send a heartbeat to indicate agent is alive. Optionally set a status.",
|
|
33104
|
+
description: "Send presence heartbeat.",
|
|
33136
33105
|
inputSchema: {
|
|
33137
|
-
from: exports_external.string().optional()
|
|
33138
|
-
status: exports_external.string().optional()
|
|
33106
|
+
from: exports_external.string().optional(),
|
|
33107
|
+
status: exports_external.string().optional()
|
|
33139
33108
|
}
|
|
33140
|
-
}, async (
|
|
33109
|
+
}, async (args) => {
|
|
33110
|
+
const { from: fromParam, status } = args;
|
|
33141
33111
|
const agent = resolveIdentity(fromParam);
|
|
33142
33112
|
heartbeat(agent, status);
|
|
33143
33113
|
return {
|
|
@@ -33145,24 +33115,24 @@ var init_mcp2 = __esm(() => {
|
|
|
33145
33115
|
};
|
|
33146
33116
|
});
|
|
33147
33117
|
server.registerTool("list_agents", {
|
|
33148
|
-
|
|
33149
|
-
description: "List agents with presence status (name, status, last_seen, online).",
|
|
33118
|
+
description: "List agents with presence status.",
|
|
33150
33119
|
inputSchema: {
|
|
33151
|
-
online_only: exports_external.boolean().optional()
|
|
33120
|
+
online_only: exports_external.boolean().optional()
|
|
33152
33121
|
}
|
|
33153
|
-
}, async (
|
|
33122
|
+
}, async (args) => {
|
|
33123
|
+
const { online_only } = args;
|
|
33154
33124
|
const agents = listAgents({ online_only });
|
|
33155
33125
|
return {
|
|
33156
33126
|
content: [{ type: "text", text: JSON.stringify(agents, null, 2) }]
|
|
33157
33127
|
};
|
|
33158
33128
|
});
|
|
33159
33129
|
server.registerTool("get_blockers", {
|
|
33160
|
-
|
|
33161
|
-
description: "Check for unread blocking messages targeting you. Must acknowledge before continuing.",
|
|
33130
|
+
description: "Check for unread blocking messages.",
|
|
33162
33131
|
inputSchema: {
|
|
33163
|
-
from: exports_external.string().optional()
|
|
33132
|
+
from: exports_external.string().optional()
|
|
33164
33133
|
}
|
|
33165
|
-
}, async (
|
|
33134
|
+
}, async (args) => {
|
|
33135
|
+
const { from: fromParam } = args;
|
|
33166
33136
|
const agent = resolveIdentity(fromParam);
|
|
33167
33137
|
const blockers = getUnreadBlockers(agent);
|
|
33168
33138
|
return {
|
|
@@ -33170,13 +33140,13 @@ var init_mcp2 = __esm(() => {
|
|
|
33170
33140
|
};
|
|
33171
33141
|
});
|
|
33172
33142
|
server.registerTool("remove_agent", {
|
|
33173
|
-
|
|
33174
|
-
description: "Remove an agent from the presence list.",
|
|
33143
|
+
description: "Remove an agent from presence.",
|
|
33175
33144
|
inputSchema: {
|
|
33176
|
-
from: exports_external.string().optional()
|
|
33177
|
-
agent: exports_external.string().optional()
|
|
33145
|
+
from: exports_external.string().optional(),
|
|
33146
|
+
agent: exports_external.string().optional()
|
|
33178
33147
|
}
|
|
33179
|
-
}, async (
|
|
33148
|
+
}, async (args) => {
|
|
33149
|
+
const { from: fromParam, agent: targetAgent } = args;
|
|
33180
33150
|
const self = resolveIdentity(fromParam);
|
|
33181
33151
|
const agent = targetAgent?.trim() || self;
|
|
33182
33152
|
const removed = removePresence(agent);
|
|
@@ -33191,13 +33161,13 @@ var init_mcp2 = __esm(() => {
|
|
|
33191
33161
|
};
|
|
33192
33162
|
});
|
|
33193
33163
|
server.registerTool("rename_agent", {
|
|
33194
|
-
|
|
33195
|
-
description: "Rename an agent in the presence list. Defaults to renaming yourself.",
|
|
33164
|
+
description: "Rename your agent in presence.",
|
|
33196
33165
|
inputSchema: {
|
|
33197
|
-
|
|
33198
|
-
|
|
33166
|
+
new_name: exports_external.string(),
|
|
33167
|
+
from: exports_external.string().optional()
|
|
33199
33168
|
}
|
|
33200
|
-
}, async (
|
|
33169
|
+
}, async (args) => {
|
|
33170
|
+
const { from: fromParam, new_name } = args;
|
|
33201
33171
|
const oldName = resolveIdentity(fromParam);
|
|
33202
33172
|
const newName = new_name.trim();
|
|
33203
33173
|
if (!newName) {
|
|
@@ -33224,6 +33194,97 @@ var init_mcp2 = __esm(() => {
|
|
|
33224
33194
|
};
|
|
33225
33195
|
}
|
|
33226
33196
|
});
|
|
33197
|
+
server.registerTool("search_tools", {
|
|
33198
|
+
description: "List tool names by keyword.",
|
|
33199
|
+
inputSchema: {
|
|
33200
|
+
query: exports_external.string().optional()
|
|
33201
|
+
}
|
|
33202
|
+
}, async (args) => {
|
|
33203
|
+
const { query } = args;
|
|
33204
|
+
const all = [
|
|
33205
|
+
"send_message",
|
|
33206
|
+
"read_messages",
|
|
33207
|
+
"list_sessions",
|
|
33208
|
+
"reply",
|
|
33209
|
+
"mark_read",
|
|
33210
|
+
"search_messages",
|
|
33211
|
+
"export_messages",
|
|
33212
|
+
"create_space",
|
|
33213
|
+
"list_spaces",
|
|
33214
|
+
"send_to_space",
|
|
33215
|
+
"read_space",
|
|
33216
|
+
"join_space",
|
|
33217
|
+
"leave_space",
|
|
33218
|
+
"update_space",
|
|
33219
|
+
"archive_space",
|
|
33220
|
+
"unarchive_space",
|
|
33221
|
+
"create_project",
|
|
33222
|
+
"list_projects",
|
|
33223
|
+
"get_project",
|
|
33224
|
+
"update_project",
|
|
33225
|
+
"delete_project",
|
|
33226
|
+
"delete_message",
|
|
33227
|
+
"edit_message",
|
|
33228
|
+
"pin_message",
|
|
33229
|
+
"unpin_message",
|
|
33230
|
+
"get_pinned_messages",
|
|
33231
|
+
"heartbeat",
|
|
33232
|
+
"list_agents",
|
|
33233
|
+
"get_blockers",
|
|
33234
|
+
"remove_agent",
|
|
33235
|
+
"rename_agent",
|
|
33236
|
+
"search_tools",
|
|
33237
|
+
"describe_tools"
|
|
33238
|
+
];
|
|
33239
|
+
const q = query?.toLowerCase();
|
|
33240
|
+
const matches = q ? all.filter((n) => n.includes(q)) : all;
|
|
33241
|
+
return { content: [{ type: "text", text: matches.join(", ") }] };
|
|
33242
|
+
});
|
|
33243
|
+
server.registerTool("describe_tools", {
|
|
33244
|
+
description: "Get descriptions for tools by name.",
|
|
33245
|
+
inputSchema: {
|
|
33246
|
+
names: exports_external.array(exports_external.string())
|
|
33247
|
+
}
|
|
33248
|
+
}, async ({ names }) => {
|
|
33249
|
+
const descriptions = {
|
|
33250
|
+
send_message: "Send DM to agent. Required: to, content. Optional: from?, priority?(low|normal|high|urgent), blocking?",
|
|
33251
|
+
read_messages: "Read messages with filters. Optional: session_id?, from?, to?, space?, since?(ISO), limit?, unread_only?",
|
|
33252
|
+
list_sessions: "List all DM sessions. Optional: agent?(filter by participant)",
|
|
33253
|
+
reply: "Reply to a message in same session. Required: message_id, content. Optional: from?",
|
|
33254
|
+
mark_read: "Mark messages as read. Optional: from?, ids?(array), all?(bool \u2014 mark all unread)",
|
|
33255
|
+
search_messages: "Full-text search messages. Required: query. Optional: space?, from?, to?, limit?",
|
|
33256
|
+
export_messages: "Export messages as JSON or CSV. Optional: space?, session_id?, from?, since?, until?, format?(json|csv)",
|
|
33257
|
+
create_space: "Create space and auto-join. Required: name. Optional: from?, description?, parent_id?(max 3 levels), project_id?",
|
|
33258
|
+
list_spaces: "List spaces with member/message counts. Optional: project_id?, parent_id?(use 'null' for top-level), include_archived?",
|
|
33259
|
+
send_to_space: "Post message to space. Required: space, content. Optional: from?, priority?(low|normal|high|urgent), blocking?",
|
|
33260
|
+
read_space: "Read messages in a space. Required: space. Optional: since?(ISO), limit?",
|
|
33261
|
+
join_space: "Join a space. Required: space. Optional: from?",
|
|
33262
|
+
leave_space: "Leave a space. Required: space. Optional: from?",
|
|
33263
|
+
update_space: "Update space fields. Required: name. Optional: description?, parent_id?(use 'null' to remove), project_id?(use 'null' to remove)",
|
|
33264
|
+
archive_space: "Archive a space (hidden from default list). Required: name",
|
|
33265
|
+
unarchive_space: "Restore archived space. Required: name",
|
|
33266
|
+
create_project: "Create a project. Required: name. Optional: from?, description?, path?, repository?, tags?(JSON array), metadata?(JSON), settings?(JSON)",
|
|
33267
|
+
list_projects: "List projects. Optional: status?(active|archived)",
|
|
33268
|
+
get_project: "Get project by UUID or name. Required: id",
|
|
33269
|
+
update_project: "Update project fields. Required: id. Optional: name?, description?, path?, status?(active|archived), repository?, tags?(JSON), metadata?(JSON), settings?(JSON)",
|
|
33270
|
+
delete_project: "Delete project (fails if spaces reference it). Required: id",
|
|
33271
|
+
delete_message: "Delete a message (sender only). Required: id. Optional: from?",
|
|
33272
|
+
edit_message: "Edit message content (sender only). Required: id, content. Optional: from?",
|
|
33273
|
+
pin_message: "Pin a message. Required: id",
|
|
33274
|
+
unpin_message: "Unpin a message. Required: id",
|
|
33275
|
+
get_pinned_messages: "Get pinned messages. Optional: space?, session_id?, limit?",
|
|
33276
|
+
heartbeat: "Register/refresh agent presence. Optional: from?, status?(online|busy|idle, default: online)",
|
|
33277
|
+
list_agents: "List agents with presence timestamps. Optional: online_only?(only agents seen in last 60s)",
|
|
33278
|
+
get_blockers: "Get unread blocking messages for agent. Optional: from?",
|
|
33279
|
+
remove_agent: "Remove agent from presence list. Optional: from?, agent?(defaults to self)",
|
|
33280
|
+
rename_agent: "Rename agent in presence list. Required: new_name. Optional: from?",
|
|
33281
|
+
search_tools: "Search tool names by keyword. Optional: query?",
|
|
33282
|
+
describe_tools: "Get full descriptions for tools. Required: names(array of tool names)"
|
|
33283
|
+
};
|
|
33284
|
+
const result = names.map((n) => `${n}: ${descriptions[n] || "See tool schema"}`).join(`
|
|
33285
|
+
`);
|
|
33286
|
+
return { content: [{ type: "text", text: result }] };
|
|
33287
|
+
});
|
|
33227
33288
|
isDirectRun = import.meta.url === `file://${process.argv[1]}` || process.argv[1]?.endsWith("mcp.js") || process.argv[1]?.endsWith("mcp.ts");
|
|
33228
33289
|
if (isDirectRun) {
|
|
33229
33290
|
startMcpServer().catch((error48) => {
|