commonswarm 0.1.25 → 0.1.26
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/cswarm.cjs +11 -5
- package/package.json +1 -1
package/cswarm.cjs
CHANGED
|
@@ -34274,6 +34274,7 @@ function parseEntry(value) {
|
|
|
34274
34274
|
"principalId",
|
|
34275
34275
|
"fromId",
|
|
34276
34276
|
"fromKind",
|
|
34277
|
+
"kind",
|
|
34277
34278
|
"senderName",
|
|
34278
34279
|
"body",
|
|
34279
34280
|
"createdAt",
|
|
@@ -34282,7 +34283,7 @@ function parseEntry(value) {
|
|
|
34282
34283
|
if (Object.keys(row).some((key2) => !allowed.has(key2))) {
|
|
34283
34284
|
throw new Error("stored pending-for-main entry is malformed");
|
|
34284
34285
|
}
|
|
34285
|
-
if (typeof row.signalId !== "string" || !UUID_RE11.test(row.signalId) || typeof row.workspaceId !== "string" || !UUID_RE11.test(row.workspaceId) || typeof row.principalId !== "string" || !UUID_RE11.test(row.principalId) || typeof row.fromId !== "string" || !UUID_RE11.test(row.fromId) || row.fromKind !== "user" && row.fromKind !== "agent" || !(row.senderName === null || typeof row.senderName === "string" && row.senderName.length <= 200) || typeof row.body !== "string" || row.body.length < 1 || row.body.length > 2e3 || !checkedTimestamp2(row.createdAt) || !checkedTimestamp2(row.queuedAt)) {
|
|
34286
|
+
if (typeof row.signalId !== "string" || !UUID_RE11.test(row.signalId) || typeof row.workspaceId !== "string" || !UUID_RE11.test(row.workspaceId) || typeof row.principalId !== "string" || !UUID_RE11.test(row.principalId) || typeof row.fromId !== "string" || !UUID_RE11.test(row.fromId) || row.fromKind !== "user" && row.fromKind !== "agent" || !(row.kind === void 0 || row.kind === "ask" || row.kind === "note") || !(row.senderName === null || typeof row.senderName === "string" && row.senderName.length <= 200) || typeof row.body !== "string" || row.body.length < 1 || row.body.length > 2e3 || !checkedTimestamp2(row.createdAt) || !checkedTimestamp2(row.queuedAt)) {
|
|
34286
34287
|
throw new Error("stored pending-for-main entry is malformed");
|
|
34287
34288
|
}
|
|
34288
34289
|
return {
|
|
@@ -34291,6 +34292,7 @@ function parseEntry(value) {
|
|
|
34291
34292
|
principalId: row.principalId.toLowerCase(),
|
|
34292
34293
|
fromId: row.fromId.toLowerCase(),
|
|
34293
34294
|
fromKind: row.fromKind,
|
|
34295
|
+
...row.kind === "ask" || row.kind === "note" ? { kind: row.kind } : {},
|
|
34294
34296
|
senderName: row.senderName,
|
|
34295
34297
|
body: row.body,
|
|
34296
34298
|
createdAt: row.createdAt,
|
|
@@ -37557,6 +37559,7 @@ function entryFromSignal(signal, principalId, directory, now) {
|
|
|
37557
37559
|
principalId,
|
|
37558
37560
|
fromId: signal.from,
|
|
37559
37561
|
fromKind: signal.from_kind,
|
|
37562
|
+
...signal.kind === "ask" || signal.kind === "note" ? { kind: signal.kind } : {},
|
|
37560
37563
|
senderName,
|
|
37561
37564
|
body: signal.body,
|
|
37562
37565
|
createdAt: signal.created_at,
|
|
@@ -37572,10 +37575,13 @@ function preview(value) {
|
|
|
37572
37575
|
}
|
|
37573
37576
|
function renderHookSignal(item) {
|
|
37574
37577
|
const sender = item.senderName === null ? item.fromId : item.senderName;
|
|
37578
|
+
const senderKind = item.fromKind === "user" ? "teammate" : "agent";
|
|
37579
|
+
const intent = item.kind === "ask" ? "is asking you:" : item.kind === "note" ? "sent you a note:" : "sent you a message:";
|
|
37580
|
+
const replyLabel = item.kind === "note" ? "reply (optional):" : "reply:";
|
|
37575
37581
|
return [
|
|
37576
|
-
`[
|
|
37582
|
+
`[CommonSwarm] ${senderKind} ${JSON.stringify(sender)} ${intent}`,
|
|
37577
37583
|
preview(item.body),
|
|
37578
|
-
|
|
37584
|
+
`${replyLabel} cswarm reply ${item.signalId} "<answer>" --workspace-id ${item.workspaceId}`
|
|
37579
37585
|
].join("\n");
|
|
37580
37586
|
}
|
|
37581
37587
|
async function inboxItems(context, options) {
|
|
@@ -37844,8 +37850,8 @@ var ACCEPTED_AGENT_CREDENTIAL_MESSAGES = [
|
|
|
37844
37850
|
AGENT_CREDENTIAL_MESSAGE_D088
|
|
37845
37851
|
];
|
|
37846
37852
|
function packageVersion() {
|
|
37847
|
-
if ("0.1.
|
|
37848
|
-
return "0.1.
|
|
37853
|
+
if ("0.1.26".length > 0) {
|
|
37854
|
+
return "0.1.26";
|
|
37849
37855
|
}
|
|
37850
37856
|
try {
|
|
37851
37857
|
const value = JSON.parse(
|