@hasna/conversations 0.2.35 → 0.2.37
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 +21 -8
- package/bin/mcp.js +21 -8
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -14914,7 +14914,7 @@ var init_presence = __esm(() => {
|
|
|
14914
14914
|
var require_package = __commonJS((exports, module) => {
|
|
14915
14915
|
module.exports = {
|
|
14916
14916
|
name: "@hasna/conversations",
|
|
14917
|
-
version: "0.2.
|
|
14917
|
+
version: "0.2.37",
|
|
14918
14918
|
description: "Real-time CLI messaging for AI agents",
|
|
14919
14919
|
type: "module",
|
|
14920
14920
|
bin: {
|
|
@@ -44722,7 +44722,8 @@ function registerMessagingTools(server, resolveProjectId) {
|
|
|
44722
44722
|
target_session_id: exports_external2.string().optional().describe("If provided, sends to a specific agent-claude session ID (UUID). The message auto-injects into that session's conversation.")
|
|
44723
44723
|
}
|
|
44724
44724
|
}, async (args) => {
|
|
44725
|
-
const { from: fromParam, to, content, priority, blocking, project_id, target_session_id } = args;
|
|
44725
|
+
const { from: fromParam, to: toParam, to_agent, content, priority, blocking, project_id, target_session_id } = args;
|
|
44726
|
+
const to = toParam || to_agent;
|
|
44726
44727
|
const from = resolveIdentity(fromParam);
|
|
44727
44728
|
const msg = sendMessage({
|
|
44728
44729
|
from,
|
|
@@ -44804,14 +44805,16 @@ function registerMessagingTools(server, resolveProjectId) {
|
|
|
44804
44805
|
};
|
|
44805
44806
|
});
|
|
44806
44807
|
server.registerTool("reply", {
|
|
44807
|
-
description: "Reply to a specific message, creating a thread.
|
|
44808
|
+
description: "Reply to a specific message by its numeric ID, creating a thread. Use read_messages first to find the message ID.",
|
|
44808
44809
|
inputSchema: {
|
|
44809
|
-
message_id: exports_external2.coerce.number(),
|
|
44810
|
+
message_id: exports_external2.coerce.number().describe("Numeric message ID (integer) to reply to. Use read_messages to find IDs."),
|
|
44810
44811
|
content: exports_external2.string(),
|
|
44811
|
-
from: exports_external2.string().optional()
|
|
44812
|
+
from: exports_external2.string().optional(),
|
|
44813
|
+
reply_to: exports_external2.coerce.number().optional().describe("Alias for message_id")
|
|
44812
44814
|
}
|
|
44813
44815
|
}, async (args) => {
|
|
44814
|
-
const { from: fromParam, message_id, content } = args;
|
|
44816
|
+
const { from: fromParam, message_id: mid, reply_to, content } = args;
|
|
44817
|
+
const message_id = mid || reply_to;
|
|
44815
44818
|
const original = getMessageById(message_id);
|
|
44816
44819
|
if (!original) {
|
|
44817
44820
|
return {
|
|
@@ -46948,17 +46951,21 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
46948
46951
|
}
|
|
46949
46952
|
}
|
|
46950
46953
|
function pushNotification(msg) {
|
|
46954
|
+
console.error(`[channel-bridge] pushing notification: from=${msg.from_agent}, id=${msg.id}, content=${msg.content.slice(0, 50)}`);
|
|
46951
46955
|
server.server.notification({
|
|
46952
46956
|
method: "notifications/claude/channel",
|
|
46953
46957
|
params: {
|
|
46954
46958
|
content: msg.content,
|
|
46955
46959
|
meta: {
|
|
46956
46960
|
from: msg.from_agent,
|
|
46961
|
+
message_id: String(msg.id),
|
|
46957
46962
|
session_id: msg.session_id,
|
|
46958
46963
|
...msg.space ? { space: msg.space } : {},
|
|
46959
46964
|
...msg.priority && msg.priority !== "normal" ? { priority: msg.priority } : {}
|
|
46960
46965
|
}
|
|
46961
46966
|
}
|
|
46967
|
+
}).catch((err) => {
|
|
46968
|
+
console.error(`[channel-bridge] notification error: ${err}`);
|
|
46962
46969
|
});
|
|
46963
46970
|
}
|
|
46964
46971
|
function startPolling2() {
|
|
@@ -46966,8 +46973,11 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
46966
46973
|
return;
|
|
46967
46974
|
const agentId = getAgentId();
|
|
46968
46975
|
const sessionId = getSessionId();
|
|
46969
|
-
|
|
46976
|
+
console.error(`[channel-bridge] startPolling: agentId=${agentId}, sessionId=${sessionId}`);
|
|
46977
|
+
if (!agentId && !sessionId) {
|
|
46978
|
+
console.error("[channel-bridge] no agentId or sessionId \u2014 not polling");
|
|
46970
46979
|
return;
|
|
46980
|
+
}
|
|
46971
46981
|
if (agentId)
|
|
46972
46982
|
seedLastSeen(agentId, sessionId);
|
|
46973
46983
|
pollTimer = setInterval(() => {
|
|
@@ -46999,7 +47009,10 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
46999
47009
|
} catch {}
|
|
47000
47010
|
}, POLL_INTERVAL_MS);
|
|
47001
47011
|
}
|
|
47002
|
-
setTimeout(() =>
|
|
47012
|
+
setTimeout(() => {
|
|
47013
|
+
console.error("[channel-bridge] attempting to start polling...");
|
|
47014
|
+
startPolling2();
|
|
47015
|
+
}, 2000);
|
|
47003
47016
|
}
|
|
47004
47017
|
var POLL_INTERVAL_MS = 1000;
|
|
47005
47018
|
var init_channel = __esm(() => {
|
package/bin/mcp.js
CHANGED
|
@@ -41218,7 +41218,8 @@ function registerMessagingTools(server, resolveProjectId) {
|
|
|
41218
41218
|
target_session_id: exports_external.string().optional().describe("If provided, sends to a specific agent-claude session ID (UUID). The message auto-injects into that session's conversation.")
|
|
41219
41219
|
}
|
|
41220
41220
|
}, async (args) => {
|
|
41221
|
-
const { from: fromParam, to, content, priority, blocking, project_id, target_session_id } = args;
|
|
41221
|
+
const { from: fromParam, to: toParam, to_agent, content, priority, blocking, project_id, target_session_id } = args;
|
|
41222
|
+
const to = toParam || to_agent;
|
|
41222
41223
|
const from = resolveIdentity(fromParam);
|
|
41223
41224
|
const msg = sendMessage({
|
|
41224
41225
|
from,
|
|
@@ -41300,14 +41301,16 @@ function registerMessagingTools(server, resolveProjectId) {
|
|
|
41300
41301
|
};
|
|
41301
41302
|
});
|
|
41302
41303
|
server.registerTool("reply", {
|
|
41303
|
-
description: "Reply to a specific message, creating a thread.
|
|
41304
|
+
description: "Reply to a specific message by its numeric ID, creating a thread. Use read_messages first to find the message ID.",
|
|
41304
41305
|
inputSchema: {
|
|
41305
|
-
message_id: exports_external.coerce.number(),
|
|
41306
|
+
message_id: exports_external.coerce.number().describe("Numeric message ID (integer) to reply to. Use read_messages to find IDs."),
|
|
41306
41307
|
content: exports_external.string(),
|
|
41307
|
-
from: exports_external.string().optional()
|
|
41308
|
+
from: exports_external.string().optional(),
|
|
41309
|
+
reply_to: exports_external.coerce.number().optional().describe("Alias for message_id")
|
|
41308
41310
|
}
|
|
41309
41311
|
}, async (args) => {
|
|
41310
|
-
const { from: fromParam, message_id, content } = args;
|
|
41312
|
+
const { from: fromParam, message_id: mid, reply_to, content } = args;
|
|
41313
|
+
const message_id = mid || reply_to;
|
|
41311
41314
|
const original = getMessageById(message_id);
|
|
41312
41315
|
if (!original) {
|
|
41313
41316
|
return {
|
|
@@ -44095,17 +44098,21 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
44095
44098
|
}
|
|
44096
44099
|
}
|
|
44097
44100
|
function pushNotification(msg) {
|
|
44101
|
+
console.error(`[channel-bridge] pushing notification: from=${msg.from_agent}, id=${msg.id}, content=${msg.content.slice(0, 50)}`);
|
|
44098
44102
|
server.server.notification({
|
|
44099
44103
|
method: "notifications/claude/channel",
|
|
44100
44104
|
params: {
|
|
44101
44105
|
content: msg.content,
|
|
44102
44106
|
meta: {
|
|
44103
44107
|
from: msg.from_agent,
|
|
44108
|
+
message_id: String(msg.id),
|
|
44104
44109
|
session_id: msg.session_id,
|
|
44105
44110
|
...msg.space ? { space: msg.space } : {},
|
|
44106
44111
|
...msg.priority && msg.priority !== "normal" ? { priority: msg.priority } : {}
|
|
44107
44112
|
}
|
|
44108
44113
|
}
|
|
44114
|
+
}).catch((err) => {
|
|
44115
|
+
console.error(`[channel-bridge] notification error: ${err}`);
|
|
44109
44116
|
});
|
|
44110
44117
|
}
|
|
44111
44118
|
function startPolling() {
|
|
@@ -44113,8 +44120,11 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
44113
44120
|
return;
|
|
44114
44121
|
const agentId = getAgentId();
|
|
44115
44122
|
const sessionId = getSessionId();
|
|
44116
|
-
|
|
44123
|
+
console.error(`[channel-bridge] startPolling: agentId=${agentId}, sessionId=${sessionId}`);
|
|
44124
|
+
if (!agentId && !sessionId) {
|
|
44125
|
+
console.error("[channel-bridge] no agentId or sessionId \u2014 not polling");
|
|
44117
44126
|
return;
|
|
44127
|
+
}
|
|
44118
44128
|
if (agentId)
|
|
44119
44129
|
seedLastSeen(agentId, sessionId);
|
|
44120
44130
|
pollTimer = setInterval(() => {
|
|
@@ -44146,7 +44156,10 @@ function registerChannelBridge(server, getAgentId, getSessionId) {
|
|
|
44146
44156
|
} catch {}
|
|
44147
44157
|
}, POLL_INTERVAL_MS);
|
|
44148
44158
|
}
|
|
44149
|
-
setTimeout(() =>
|
|
44159
|
+
setTimeout(() => {
|
|
44160
|
+
console.error("[channel-bridge] attempting to start polling...");
|
|
44161
|
+
startPolling();
|
|
44162
|
+
}, 2000);
|
|
44150
44163
|
}
|
|
44151
44164
|
|
|
44152
44165
|
// src/cli/commands/tmux.ts
|
|
@@ -44297,7 +44310,7 @@ function registerTmuxTools(server) {
|
|
|
44297
44310
|
// package.json
|
|
44298
44311
|
var package_default = {
|
|
44299
44312
|
name: "@hasna/conversations",
|
|
44300
|
-
version: "0.2.
|
|
44313
|
+
version: "0.2.37",
|
|
44301
44314
|
description: "Real-time CLI messaging for AI agents",
|
|
44302
44315
|
type: "module",
|
|
44303
44316
|
bin: {
|