@hasna/conversations 0.2.28 → 0.2.29

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 CHANGED
@@ -14928,7 +14928,7 @@ var init_presence = __esm(() => {
14928
14928
  var require_package = __commonJS((exports, module) => {
14929
14929
  module.exports = {
14930
14930
  name: "@hasna/conversations",
14931
- version: "0.2.28",
14931
+ version: "0.2.29",
14932
14932
  description: "Real-time CLI messaging for AI agents",
14933
14933
  type: "module",
14934
14934
  bin: {
@@ -48518,17 +48518,18 @@ init_presence();
48518
48518
  init_db();
48519
48519
  import chalk4 from "chalk";
48520
48520
  function registerMessagingCommands(program2) {
48521
- program2.command("send").description("Send a message to an agent").argument("<message>", "Message content").requiredOption("--to <agent>", "Recipient agent ID").option("--from <agent>", "Sender agent ID").option("--session <id>", "Session ID (auto-generated if omitted)").option("--priority <level>", "Priority: low, normal, high, urgent", "normal").option("--working-dir <path>", "Working directory context").option("--repository <repo>", "Repository context").option("--branch <branch>", "Branch context").option("--metadata <json>", "JSON metadata string").option("--blocking", "Send as a blocking message (recipient must acknowledge)").option("--json", "Output as JSON").action((message, opts) => {
48521
+ program2.command("send").description("Send a message to an agent").argument("<message>", "Message content").option("--to <agent>", "Recipient agent ID (required unless --space is used)").option("--from <agent>", "Sender agent ID").option("--session <id>", "Session ID (auto-generated if omitted)").option("--priority <level>", "Priority: low, normal, high, urgent", "normal").option("--working-dir <path>", "Working directory context").option("--repository <repo>", "Repository context").option("--branch <branch>", "Branch context").option("--metadata <json>", "JSON metadata string").option("--space <name>", "Send to a space instead of a specific agent").option("--blocking", "Send as a blocking message (recipient must acknowledge)").option("--json", "Output as JSON").action((message, opts) => {
48522
48522
  const from = resolveIdentity(opts.from).trim();
48523
48523
  const to = typeof opts.to === "string" ? opts.to.trim() : "";
48524
+ const space = typeof opts.space === "string" ? opts.space.trim() : "";
48524
48525
  const content = typeof message === "string" ? message : "";
48525
48526
  const session = typeof opts.session === "string" && opts.session.trim() ? opts.session.trim() : undefined;
48526
48527
  if (!from) {
48527
48528
  console.error(chalk4.red("Sender identity is required."));
48528
48529
  process.exit(1);
48529
48530
  }
48530
- if (!to) {
48531
- console.error(chalk4.red("Recipient is required."));
48531
+ if (!to && !space) {
48532
+ console.error(chalk4.red("Recipient is required: use --to <agent> or --space <name>."));
48532
48533
  process.exit(1);
48533
48534
  }
48534
48535
  if (!content.trim()) {
@@ -48546,7 +48547,8 @@ function registerMessagingCommands(program2) {
48546
48547
  }
48547
48548
  const msg = sendMessage({
48548
48549
  from,
48549
- to,
48550
+ to: to || from,
48551
+ space: space || undefined,
48550
48552
  content,
48551
48553
  session_id: session,
48552
48554
  priority: opts.priority,
@@ -48558,6 +48560,8 @@ function registerMessagingCommands(program2) {
48558
48560
  });
48559
48561
  if (opts.json) {
48560
48562
  console.log(JSON.stringify(msg, null, 2));
48563
+ } else if (space) {
48564
+ console.log(chalk4.green(`Message sent to #${space}`) + chalk4.dim(` (id: ${msg.id})`));
48561
48565
  } else {
48562
48566
  console.log(chalk4.green(`Message sent`) + chalk4.dim(` (id: ${msg.id}, session: ${msg.session_id})`));
48563
48567
  }
@@ -49412,7 +49416,7 @@ function registerProjectCommands(program2) {
49412
49416
  }
49413
49417
  closeDb();
49414
49418
  });
49415
- project.command("update").description("Update a project").argument("<id>", "Project ID").option("--name <name>", "New name").option("--description <text>", "New description").option("--path <path>", "New path").option("--status <status>", "New status (active/archived)").option("--repository <url>", "New repository URL").option("--tags <json>", "New tags (JSON array)").option("--json", "Output as JSON").action((id, opts) => {
49419
+ project.command("update").description("Update a project").argument("<id-or-name>", "Project ID or name").option("--name <name>", "New name").option("--description <text>", "New description").option("--path <path>", "New path").option("--status <status>", "New status (active/archived)").option("--repository <url>", "New repository URL").option("--tags <json>", "New tags (JSON array)").option("--json", "Output as JSON").action((id, opts) => {
49416
49420
  const updates = {};
49417
49421
  if (opts.name)
49418
49422
  updates.name = opts.name;
@@ -49433,7 +49437,9 @@ function registerProjectCommands(program2) {
49433
49437
  }
49434
49438
  }
49435
49439
  try {
49436
- const p = updateProject(id, updates);
49440
+ const isUuid = /^[0-9a-f-]{36}$/i.test(id);
49441
+ const resolvedId = isUuid ? id : getProjectByName(id)?.id ?? id;
49442
+ const p = updateProject(resolvedId, updates);
49437
49443
  if (opts.json) {
49438
49444
  console.log(JSON.stringify(p, null, 2));
49439
49445
  } else {
@@ -49445,9 +49451,11 @@ function registerProjectCommands(program2) {
49445
49451
  }
49446
49452
  closeDb();
49447
49453
  });
49448
- project.command("delete").description("Delete a project").argument("<id>", "Project ID").option("--json", "Output as JSON").action((id, opts) => {
49454
+ project.command("delete").description("Delete a project").argument("<id-or-name>", "Project ID or name").option("--json", "Output as JSON").action((id, opts) => {
49449
49455
  try {
49450
- const deleted = deleteProject(id);
49456
+ const isUuid = /^[0-9a-f-]{36}$/i.test(id);
49457
+ const resolvedId = isUuid ? id : getProjectByName(id)?.id ?? id;
49458
+ const deleted = deleteProject(resolvedId);
49451
49459
  if (!deleted) {
49452
49460
  console.error(chalk6.red(`Project "${id}" not found.`));
49453
49461
  process.exit(1);
package/bin/mcp.js CHANGED
@@ -44052,7 +44052,7 @@ function formatError2(e) {
44052
44052
  // package.json
44053
44053
  var package_default = {
44054
44054
  name: "@hasna/conversations",
44055
- version: "0.2.28",
44055
+ version: "0.2.29",
44056
44056
  description: "Real-time CLI messaging for AI agents",
44057
44057
  type: "module",
44058
44058
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/conversations",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "Real-time CLI messaging for AI agents",
5
5
  "type": "module",
6
6
  "bin": {