@hasna/conversations 0.2.8 → 0.2.9
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 +15 -1
- package/bin/mcp.js +21 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -4441,7 +4441,7 @@ var init_poll = __esm(() => {
|
|
|
4441
4441
|
var require_package = __commonJS((exports, module) => {
|
|
4442
4442
|
module.exports = {
|
|
4443
4443
|
name: "@hasna/conversations",
|
|
4444
|
-
version: "0.2.
|
|
4444
|
+
version: "0.2.9",
|
|
4445
4445
|
description: "Real-time CLI messaging for AI agents",
|
|
4446
4446
|
type: "module",
|
|
4447
4447
|
bin: {
|
|
@@ -33780,6 +33780,19 @@ var init_mcp2 = __esm(() => {
|
|
|
33780
33780
|
content: [{ type: "text", text: JSON.stringify({ marked_read: count }) }]
|
|
33781
33781
|
};
|
|
33782
33782
|
});
|
|
33783
|
+
server.registerTool("mark_space_read", {
|
|
33784
|
+
description: "Mark ALL messages in a space as read without fetching them. Use this on busy spaces (200+ messages) where read_messages would overflow tokens.",
|
|
33785
|
+
inputSchema: {
|
|
33786
|
+
space: exports_external.string().describe("Space name"),
|
|
33787
|
+
from: exports_external.string().optional().describe("Mark read on behalf of this agent (default: current agent)")
|
|
33788
|
+
}
|
|
33789
|
+
}, async (args) => {
|
|
33790
|
+
const { space, from: fromParam } = args;
|
|
33791
|
+
const count = markSpaceRead(space, fromParam);
|
|
33792
|
+
return {
|
|
33793
|
+
content: [{ type: "text", text: JSON.stringify({ space, marked_read: count }) }]
|
|
33794
|
+
};
|
|
33795
|
+
});
|
|
33783
33796
|
server.registerTool("search_messages", {
|
|
33784
33797
|
description: "Full-text search across messages. Uses FTS5 with BM25 ranking if available, falls back to LIKE. Returns messages with snippet and relevance_score.",
|
|
33785
33798
|
inputSchema: {
|
|
@@ -34884,6 +34897,7 @@ var init_mcp2 = __esm(() => {
|
|
|
34884
34897
|
list_sessions: "List all DM sessions. Optional: agent?(filter by participant)",
|
|
34885
34898
|
reply: "Reply to a specific message, creating a thread (sets reply_to). Use read_thread to retrieve. Required: message_id, content. Optional: from?",
|
|
34886
34899
|
mark_read: "Mark messages as read. Optional: from?, ids?(array), all?(bool \u2014 mark all unread)",
|
|
34900
|
+
mark_space_read: "Mark ALL messages in a space as read without fetching. Required: space. Optional: from?",
|
|
34887
34901
|
search_messages: "Full-text search messages. Required: query. Optional: space?, from?, to?, limit?",
|
|
34888
34902
|
export_messages: "Export messages as JSON or CSV. Optional: space?, session_id?, from?, since?, until?, format?(json|csv)",
|
|
34889
34903
|
create_space: "Create space and auto-join. Required: name. Optional: from?, description?, parent_id?(max 3 levels), project_id?",
|
package/bin/mcp.js
CHANGED
|
@@ -28937,6 +28937,12 @@ function markRead(ids, reader) {
|
|
|
28937
28937
|
const result = stmt.run(...ids, reader);
|
|
28938
28938
|
return result.changes;
|
|
28939
28939
|
}
|
|
28940
|
+
function markSpaceRead(spaceName, reader) {
|
|
28941
|
+
const db2 = getDb();
|
|
28942
|
+
const stmt = db2.prepare(`UPDATE messages SET read_at = strftime('%Y-%m-%dT%H:%M:%f', 'now') WHERE space = ? AND from_agent != ? AND read_at IS NULL`);
|
|
28943
|
+
const result = stmt.run(spaceName, reader);
|
|
28944
|
+
return result.changes;
|
|
28945
|
+
}
|
|
28940
28946
|
function getMessageById(id) {
|
|
28941
28947
|
const db2 = getDb();
|
|
28942
28948
|
const row = db2.prepare("SELECT * FROM messages WHERE id = ?").get(id);
|
|
@@ -30925,7 +30931,7 @@ function getGraphStats() {
|
|
|
30925
30931
|
// package.json
|
|
30926
30932
|
var package_default = {
|
|
30927
30933
|
name: "@hasna/conversations",
|
|
30928
|
-
version: "0.2.
|
|
30934
|
+
version: "0.2.9",
|
|
30929
30935
|
description: "Real-time CLI messaging for AI agents",
|
|
30930
30936
|
type: "module",
|
|
30931
30937
|
bin: {
|
|
@@ -31143,6 +31149,19 @@ server.registerTool("mark_read", {
|
|
|
31143
31149
|
content: [{ type: "text", text: JSON.stringify({ marked_read: count }) }]
|
|
31144
31150
|
};
|
|
31145
31151
|
});
|
|
31152
|
+
server.registerTool("mark_space_read", {
|
|
31153
|
+
description: "Mark ALL messages in a space as read without fetching them. Use this on busy spaces (200+ messages) where read_messages would overflow tokens.",
|
|
31154
|
+
inputSchema: {
|
|
31155
|
+
space: exports_external.string().describe("Space name"),
|
|
31156
|
+
from: exports_external.string().optional().describe("Mark read on behalf of this agent (default: current agent)")
|
|
31157
|
+
}
|
|
31158
|
+
}, async (args) => {
|
|
31159
|
+
const { space, from: fromParam } = args;
|
|
31160
|
+
const count = markSpaceRead(space, fromParam);
|
|
31161
|
+
return {
|
|
31162
|
+
content: [{ type: "text", text: JSON.stringify({ space, marked_read: count }) }]
|
|
31163
|
+
};
|
|
31164
|
+
});
|
|
31146
31165
|
server.registerTool("search_messages", {
|
|
31147
31166
|
description: "Full-text search across messages. Uses FTS5 with BM25 ranking if available, falls back to LIKE. Returns messages with snippet and relevance_score.",
|
|
31148
31167
|
inputSchema: {
|
|
@@ -32247,6 +32266,7 @@ server.registerTool("describe_tools", {
|
|
|
32247
32266
|
list_sessions: "List all DM sessions. Optional: agent?(filter by participant)",
|
|
32248
32267
|
reply: "Reply to a specific message, creating a thread (sets reply_to). Use read_thread to retrieve. Required: message_id, content. Optional: from?",
|
|
32249
32268
|
mark_read: "Mark messages as read. Optional: from?, ids?(array), all?(bool \u2014 mark all unread)",
|
|
32269
|
+
mark_space_read: "Mark ALL messages in a space as read without fetching. Required: space. Optional: from?",
|
|
32250
32270
|
search_messages: "Full-text search messages. Required: query. Optional: space?, from?, to?, limit?",
|
|
32251
32271
|
export_messages: "Export messages as JSON or CSV. Optional: space?, session_id?, from?, since?, until?, format?(json|csv)",
|
|
32252
32272
|
create_space: "Create space and auto-join. Required: name. Optional: from?, description?, parent_id?(max 3 levels), project_id?",
|