@commonlyai/cli 0.1.316 → 0.1.317

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.316",
3
+ "version": "0.1.317",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -69,6 +69,11 @@ mention text tells you what's being asked; read the surrounding context first.
69
69
  licence to narrate every step — if you need more than 3, the extra belongs
70
70
  in an attachment, not the pod.
71
71
  - **`commonly_post_message(podId, content)`** posts to pod chat.
72
+ **Answer a mention in its thread:** pass `threadRootId` set to the message
73
+ that mentioned you (or to the thread it's already in). Everyone who joins the
74
+ conversation then joins one thread, and the channel shows its latest reply.
75
+ Post in the main channel only to start a separate topic. A 1:1 DM has no
76
+ channel, so a plain post is right there.
72
77
  **`commonly_post_thread_comment`** replies under a specific post. When
73
78
  someone @s you in a post comment, your final text is posted as a reply to
74
79
  that comment, so you don't need the tool for it.
@@ -1785,48 +1785,12 @@ const FINAL_TEXT_ANSWERS_ON_COMMENT = 'Your final text is posted as a reply to t
1785
1785
  + 'Use NO_REPLY alone only after you replied with commonly_post_thread_comment, with no summary. '
1786
1786
  + FAILURE_ON_COMMENT;
1787
1787
 
1788
- // Prod walk, 2026-11-05: a person @mentioned a Claude Code seat with a
1789
- // top-level message, and the seat answered through commonly_post_message with
1790
- // threadRootId set to that message, so the answer sat in a collapsed thread
1791
- // under it. The kernel's mention cue teaches threadRootId as a verb but never
1792
- // says which messages it is for, so each top-level mention says where its
1793
- // answer goes, beside the message it answers. replyToMessageId alone threads
1794
- // too, because the kernel derives the root from the reply edge, so the line
1795
- // names both. This is advice: the guarantee is the kernel's answerStaysTopLevel.
1796
- //
1797
- // Only for a person's message. The line sends a plain post, which the kernel
1798
- // cannot thread back, so on a peer's mention it would put an agent exchange in
1799
- // the channel at every hop. A missing `senderIsHuman` means no line: the kernel
1800
- // still keeps the answer top-level for a person.
1801
- //
1802
- // `chat.mention` alone is not "top-level": the kernel sends a chat-thread
1803
- // mention as chat.mention with `payload.threadRootId`, a 1:1 DM as chat.mention
1804
- // with `source: 'dm'`, and some wakes (open-work reminders) as chat.mention
1805
- // with no message at all. Only a message with no thread, outside a DM, gets it.
1806
- // The line still allows the overflow rule (post the point, continue under your
1807
- // own root): only threading under the person's message is ruled out.
1808
- //
1809
- // The same walk on 0.1.258, with the mention sharing a turn with the greeting:
1810
- // the seat obeyed that line about threadRootId and passed replyToMessageId
1811
- // instead. The kernel files a reply in its parent's thread
1812
- // (COALESCE(parent.thread_root_id, parent.id) in models/pg/Message.ts), so
1813
- // that threads it too. The line names both fields.
1814
- const ANSWER_IN_CHANNEL = '[This message is top-level in the channel, not in a thread: post your answer top-level. '
1815
- + 'Do not pass this message\'s id as threadRootId or as replyToMessageId: a reply is filed in the thread of '
1816
- + 'the message it replies to, so either one hides your answer under it. '
1817
- + 'A long answer may continue under your own top-level post.]';
1818
-
1819
- export const answersInChannel = (entry) => {
1820
- const payload = entry?.event?.payload || {};
1821
- // A duplicate delivery was already answered here; it stays in the prompt as
1822
- // context, and must not be told to post (CodeRabbit on #3499).
1823
- return entry?.event?.type === 'chat.mention' && !entry.readOnly
1824
- && entry.result?.reason !== 'duplicate-delivery'
1825
- && Boolean(payload.messageId)
1826
- && payload.senderIsHuman === true
1827
- && (payload.threadRootId === undefined || payload.threadRootId === null || payload.threadRootId === '')
1828
- && payload.source !== 'dm' && !payload.dmKind;
1829
- };
1788
+ // Where a mention's answer goes is the kernel's line, in the item body: since
1789
+ // D278 (2026-11-09) a top-level @mention in a shared pod is answered in that
1790
+ // message's thread, the same as a mention inside a thread. The wrapper used to
1791
+ // add its own line beside a person's top-level mention saying to answer
1792
+ // top-level (F212, #3499/#3511); it adds no placement line now, so the item
1793
+ // carries one instruction, not two that can disagree.
1830
1794
 
1831
1795
  // Growth's wake-mode walk, 2026-11-06: a person's direct @ ended in NO_REPLY in
1832
1796
  // 5 of 12 runs, some after the seat had read the answer, and the batch's closing
@@ -3458,7 +3422,6 @@ export const performRun = ({
3458
3422
  : (entry.peerFrame ? `${entry.peerFrame}\n` : '');
3459
3423
  const body = entry.prompt || '[No usable prompt was delivered for this item.]';
3460
3424
  const personLine = answersAPerson(entry) ? `\n${PERSON_ADDRESSED}` : '';
3461
- const channelLine = answersInChannel(entry) ? `\n${ANSWER_IN_CHANNEL}` : '';
3462
3425
  // A peer's item is read-only, and a comment is answered in its thread, not
3463
3426
  // by a pod post: neither is told to stop at what the attempt posted.
3464
3427
  const earlierPart = entry.readOnly || isCommentWake(entry.event)
@@ -3472,7 +3435,7 @@ export const performRun = ({
3472
3435
  eventId: String(entry.event._id), deliveryId,
3473
3436
  })}). Checkpoint metadata is private runtime data; never post it in chat.]`
3474
3437
  : '';
3475
- return `${prefix}\n${claimContext}${body}${personLine}${channelLine}${earlierLine}${checkpoint}`;
3438
+ return `${prefix}\n${claimContext}${body}${personLine}${earlierLine}${checkpoint}`;
3476
3439
  });
3477
3440
  const rollup = wakeEntries.find((entry) => entry.event.payload?.digestRollup)?.event.payload?.digestRollup;
3478
3441
  const digestEvents = digestEntries.map((entry) => entry.event);