@commonlyai/cli 0.1.315 → 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 +1 -1
- package/skills/commonly/SKILL.md +5 -0
- package/src/commands/agent.js +7 -44
- package/src/commands/daemon.js +14 -6
- package/src/lib/machine-host.js +29 -0
package/package.json
CHANGED
package/skills/commonly/SKILL.md
CHANGED
|
@@ -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.
|
package/src/commands/agent.js
CHANGED
|
@@ -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
|
-
//
|
|
1789
|
-
// top-level
|
|
1790
|
-
//
|
|
1791
|
-
//
|
|
1792
|
-
//
|
|
1793
|
-
//
|
|
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}${
|
|
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);
|
package/src/commands/daemon.js
CHANGED
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
createReachCache, loadPodReach, readSessionLastTurn,
|
|
51
51
|
} from '../lib/daemon-agent-states.js';
|
|
52
52
|
import { installedCliVersion, startUpdateNotice, UPDATE_CHECK_OPT_OUT_ENV } from '../lib/update-check.js';
|
|
53
|
+
import { machineHostReport } from '../lib/machine-host.js';
|
|
53
54
|
|
|
54
55
|
// One supervised seat, as `commonly daemon status --verbose` names it. Two of these
|
|
55
56
|
// fields are worth reading closely: the seat's `instanceId` (the identity the
|
|
@@ -182,9 +183,12 @@ export const registerDaemonMachine = async ({
|
|
|
182
183
|
instanceUrl,
|
|
183
184
|
name,
|
|
184
185
|
persist = saveDaemonRecord,
|
|
186
|
+
host = machineHostReport(),
|
|
185
187
|
}) => {
|
|
188
|
+
// TASK-784: the host report is metadata only (platform, OS release major,
|
|
189
|
+
// arch, CLI version). An older server ignores it.
|
|
186
190
|
const { machine, daemonToken } = requireRegistrationResponse(
|
|
187
|
-
await client.post('/api/machines', { name }),
|
|
191
|
+
await client.post('/api/machines', { name, host }),
|
|
188
192
|
);
|
|
189
193
|
const record = {
|
|
190
194
|
machineDbId: machine.id,
|
|
@@ -213,6 +217,14 @@ export const registerDaemonMachine = async ({
|
|
|
213
217
|
return { machine, record };
|
|
214
218
|
};
|
|
215
219
|
|
|
220
|
+
// What each supervisor check-in tells the server about this computer.
|
|
221
|
+
// Native Windows has no OS sandbox for any adapter, so it never reports
|
|
222
|
+
// 'default': Codex there runs on its own profiles only, and a removed marker
|
|
223
|
+
// must not read as "confined" while seats may still run. An older daemon sends
|
|
224
|
+
// neither field, which leaves the server's record. TASK-784: the host report
|
|
225
|
+
// rides along, so a machine an older CLI registered fills in on upgrade.
|
|
226
|
+
export const daemonMachineReport = () => ({ sandbox: hostSandboxReport(), host: machineHostReport() });
|
|
227
|
+
|
|
216
228
|
export const heartbeatDaemonMachine = async ({ client, record }) => (
|
|
217
229
|
client.post(`/api/machines/${record.machineDbId}/heartbeat`)
|
|
218
230
|
);
|
|
@@ -656,11 +668,7 @@ Examples:
|
|
|
656
668
|
},
|
|
657
669
|
loadToken: loadAgentToken,
|
|
658
670
|
saveToken: saveAgentToken,
|
|
659
|
-
|
|
660
|
-
// reports 'default': Codex there runs on its own profiles only, and a
|
|
661
|
-
// removed marker must not read as "confined" while seats may still run.
|
|
662
|
-
// An older daemon sends nothing, which leaves the server's record.
|
|
663
|
-
machineReport: () => ({ sandbox: hostSandboxReport() }),
|
|
671
|
+
machineReport: daemonMachineReport,
|
|
664
672
|
runtimeInventory: async () => {
|
|
665
673
|
if (!cachedInventory || Date.now() - inventoryCheckedAt > 300_000) {
|
|
666
674
|
cachedInventory = await collectRuntimeInventory(getAdapter);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TASK-784 (D164): what the daemon's computer runs, as the server stores it.
|
|
3
|
+
* Metadata only: Node's platform and arch names, the OS release's leading
|
|
4
|
+
* number, and this CLI's version. Nothing here may name the machine or the
|
|
5
|
+
* person (no hostname, path or user name); the server drops anything else.
|
|
6
|
+
*/
|
|
7
|
+
import { release as osRelease } from 'os';
|
|
8
|
+
import { installedCliVersion } from './update-check.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The leading number of an OS release string: Windows "10.0.22631" is 10,
|
|
12
|
+
* a Darwin kernel "25.4.0" is 25, Linux "6.5.0-1025-azure" is 6.
|
|
13
|
+
*/
|
|
14
|
+
export const osReleaseMajor = (release) => {
|
|
15
|
+
const match = /^(\d{1,4})(?:\D|$)/.exec(String(release ?? ''));
|
|
16
|
+
return match ? Number(match[1]) : null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const machineHostReport = ({
|
|
20
|
+
platform = process.platform,
|
|
21
|
+
release = osRelease(),
|
|
22
|
+
arch = process.arch,
|
|
23
|
+
cliVersion = installedCliVersion(),
|
|
24
|
+
} = {}) => ({
|
|
25
|
+
platform,
|
|
26
|
+
osMajor: osReleaseMajor(release),
|
|
27
|
+
arch,
|
|
28
|
+
cliVersion: cliVersion || null,
|
|
29
|
+
});
|