@hasna/conversations 0.2.53 → 0.2.55
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 +4 -4
- package/bin/mcp.js +4 -4
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -14503,6 +14503,7 @@ function sendMessage(opts) {
|
|
|
14503
14503
|
throw new Error(`Message content exceeds maximum size of ${MAX_MESSAGE_BYTES} bytes (64 KB).`);
|
|
14504
14504
|
}
|
|
14505
14505
|
checkRateLimit(opts.from);
|
|
14506
|
+
const validatedAttachments = opts.attachments && opts.attachments.length > 0 ? opts.attachments.map((att) => validateAttachment(att.source_path, att.name)) : [];
|
|
14506
14507
|
const db2 = getDb();
|
|
14507
14508
|
const explicitSession = opts.session_id && opts.session_id.trim().length > 0 ? opts.session_id : undefined;
|
|
14508
14509
|
const sessionId = explicitSession ?? (opts.space ? `space:${opts.space}` : `${[opts.from, opts.to].sort().join("-")}-${randomUUID3().slice(0, 8)}`);
|
|
@@ -14518,12 +14519,11 @@ function sendMessage(opts) {
|
|
|
14518
14519
|
`);
|
|
14519
14520
|
const row = stmt.get(msgUuid, sessionId, opts.from, opts.to, opts.space || null, opts.project_id || null, opts.content, normalizedPriority, opts.working_dir || null, opts.repository || null, opts.branch || null, metadata, blocking, replyTo);
|
|
14520
14521
|
const message = parseMessage(row);
|
|
14521
|
-
if (
|
|
14522
|
+
if (validatedAttachments.length > 0) {
|
|
14522
14523
|
const attachmentsDir = join11(getAttachmentsDir(), String(message.id));
|
|
14523
14524
|
mkdirSync8(attachmentsDir, { recursive: true });
|
|
14524
14525
|
const attachmentInfos = [];
|
|
14525
|
-
for (const
|
|
14526
|
-
const { safeSource, safeName } = validateAttachment(att.source_path, att.name);
|
|
14526
|
+
for (const { safeSource, safeName } of validatedAttachments) {
|
|
14527
14527
|
const destPath = join11(attachmentsDir, safeName);
|
|
14528
14528
|
copyFileSync3(safeSource, destPath);
|
|
14529
14529
|
const stat = statSync2(destPath);
|
|
@@ -15549,7 +15549,7 @@ var init_space_notifications = __esm(() => {
|
|
|
15549
15549
|
var require_package = __commonJS((exports, module) => {
|
|
15550
15550
|
module.exports = {
|
|
15551
15551
|
name: "@hasna/conversations",
|
|
15552
|
-
version: "0.2.
|
|
15552
|
+
version: "0.2.55",
|
|
15553
15553
|
description: "Real-time CLI messaging for AI agents",
|
|
15554
15554
|
type: "module",
|
|
15555
15555
|
bin: {
|
package/bin/mcp.js
CHANGED
|
@@ -41164,6 +41164,7 @@ function sendMessage(opts) {
|
|
|
41164
41164
|
throw new Error(`Message content exceeds maximum size of ${MAX_MESSAGE_BYTES} bytes (64 KB).`);
|
|
41165
41165
|
}
|
|
41166
41166
|
checkRateLimit(opts.from);
|
|
41167
|
+
const validatedAttachments = opts.attachments && opts.attachments.length > 0 ? opts.attachments.map((att) => validateAttachment(att.source_path, att.name)) : [];
|
|
41167
41168
|
const db2 = getDb();
|
|
41168
41169
|
const explicitSession = opts.session_id && opts.session_id.trim().length > 0 ? opts.session_id : undefined;
|
|
41169
41170
|
const sessionId = explicitSession ?? (opts.space ? `space:${opts.space}` : `${[opts.from, opts.to].sort().join("-")}-${randomUUID().slice(0, 8)}`);
|
|
@@ -41179,12 +41180,11 @@ function sendMessage(opts) {
|
|
|
41179
41180
|
`);
|
|
41180
41181
|
const row = stmt.get(msgUuid, sessionId, opts.from, opts.to, opts.space || null, opts.project_id || null, opts.content, normalizedPriority, opts.working_dir || null, opts.repository || null, opts.branch || null, metadata, blocking, replyTo);
|
|
41181
41182
|
const message = parseMessage(row);
|
|
41182
|
-
if (
|
|
41183
|
+
if (validatedAttachments.length > 0) {
|
|
41183
41184
|
const attachmentsDir = join10(getAttachmentsDir(), String(message.id));
|
|
41184
41185
|
mkdirSync7(attachmentsDir, { recursive: true });
|
|
41185
41186
|
const attachmentInfos = [];
|
|
41186
|
-
for (const
|
|
41187
|
-
const { safeSource, safeName } = validateAttachment(att.source_path, att.name);
|
|
41187
|
+
for (const { safeSource, safeName } of validatedAttachments) {
|
|
41188
41188
|
const destPath = join10(attachmentsDir, safeName);
|
|
41189
41189
|
copyFileSync3(safeSource, destPath);
|
|
41190
41190
|
const stat = statSync2(destPath);
|
|
@@ -46900,7 +46900,7 @@ function startMcpHttpServer(options) {
|
|
|
46900
46900
|
// package.json
|
|
46901
46901
|
var package_default = {
|
|
46902
46902
|
name: "@hasna/conversations",
|
|
46903
|
-
version: "0.2.
|
|
46903
|
+
version: "0.2.55",
|
|
46904
46904
|
description: "Real-time CLI messaging for AI agents",
|
|
46905
46905
|
type: "module",
|
|
46906
46906
|
bin: {
|
package/dist/index.js
CHANGED
|
@@ -12165,6 +12165,7 @@ function sendMessage(opts) {
|
|
|
12165
12165
|
throw new Error(`Message content exceeds maximum size of ${MAX_MESSAGE_BYTES} bytes (64 KB).`);
|
|
12166
12166
|
}
|
|
12167
12167
|
checkRateLimit(opts.from);
|
|
12168
|
+
const validatedAttachments = opts.attachments && opts.attachments.length > 0 ? opts.attachments.map((att) => validateAttachment(att.source_path, att.name)) : [];
|
|
12168
12169
|
const db2 = getDb();
|
|
12169
12170
|
const explicitSession = opts.session_id && opts.session_id.trim().length > 0 ? opts.session_id : undefined;
|
|
12170
12171
|
const sessionId = explicitSession ?? (opts.space ? `space:${opts.space}` : `${[opts.from, opts.to].sort().join("-")}-${randomUUID().slice(0, 8)}`);
|
|
@@ -12180,12 +12181,11 @@ function sendMessage(opts) {
|
|
|
12180
12181
|
`);
|
|
12181
12182
|
const row = stmt.get(msgUuid, sessionId, opts.from, opts.to, opts.space || null, opts.project_id || null, opts.content, normalizedPriority, opts.working_dir || null, opts.repository || null, opts.branch || null, metadata, blocking, replyTo);
|
|
12182
12183
|
const message = parseMessage(row);
|
|
12183
|
-
if (
|
|
12184
|
+
if (validatedAttachments.length > 0) {
|
|
12184
12185
|
const attachmentsDir = join8(getAttachmentsDir(), String(message.id));
|
|
12185
12186
|
mkdirSync6(attachmentsDir, { recursive: true });
|
|
12186
12187
|
const attachmentInfos = [];
|
|
12187
|
-
for (const
|
|
12188
|
-
const { safeSource, safeName } = validateAttachment(att.source_path, att.name);
|
|
12188
|
+
for (const { safeSource, safeName } of validatedAttachments) {
|
|
12189
12189
|
const destPath = join8(attachmentsDir, safeName);
|
|
12190
12190
|
copyFileSync3(safeSource, destPath);
|
|
12191
12191
|
const stat = statSync2(destPath);
|