@cohortapp/agent-sdk 2.11.0 → 2.11.2
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/lib/channels/inbox-item.mjs +12 -0
- package/lib/channels/inbox-item.test.mjs +33 -0
- package/lib/execution/disposition.mjs +13 -2
- package/lib/execution/disposition.test.mjs +19 -2
- package/lib/execution/pipeline.test.mjs +4 -1
- package/lib/org/messaging.mjs +5 -0
- package/lib/org/messaging.test.mjs +7 -0
- package/package.json +1 -1
- package/scripts/daemon/agent-daemon.mjs +62 -2
- package/scripts/daemon/agent-daemon.test.mjs +117 -0
- package/scripts/daemon/assurance-e2e.test.mjs +4 -3
- package/scripts/daemon/assurance.mjs +34 -74
- package/scripts/daemon/assurance.test.mjs +26 -26
- package/scripts/daemon/cadence-handlers.mjs +48 -5
- package/scripts/daemon/cadence-handlers.test.mjs +57 -2
- package/scripts/daemon/classifier.mjs +27 -14
- package/scripts/daemon/execution-ladder.test.mjs +23 -0
- package/scripts/daemon/inbox-deferral.mjs +49 -24
- package/scripts/daemon/inbox-deferral.test.mjs +39 -1
- package/scripts/daemon/responder.mjs +20 -0
- package/scripts/poller/inbox-scan-poller.mjs +7 -0
- package/scripts/poller/utils.mjs +11 -0
|
@@ -111,6 +111,13 @@ export function parseInboxItemYaml(body) {
|
|
|
111
111
|
if (channelType) item.channel_type = channelType;
|
|
112
112
|
if (isPrivate !== undefined) item.is_private = isPrivate;
|
|
113
113
|
if (isDm !== undefined) item.is_dm = isDm;
|
|
114
|
+
// THE CHANNEL KIND. Cohort's only reliable DM signal, written by
|
|
115
|
+
// scripts/poller/utils.inboxItemToYaml when present. Attached only when the
|
|
116
|
+
// writer emitted it so a non-Cohort item keeps its old shape; the daemon's
|
|
117
|
+
// enrichItem reads it to tell a 1:1 DM (skips the election) from a GROUP_DM
|
|
118
|
+
// (goes through the election as a multi-participant channel).
|
|
119
|
+
const channelKind = scalar("channel_kind");
|
|
120
|
+
if (channelKind) item.channel_kind = channelKind;
|
|
114
121
|
// The hq chain kind, when the org projection carried one through the writer.
|
|
115
122
|
// Attached only when present so a non-org item keeps exactly its old shape;
|
|
116
123
|
// `lib/execution/intake.fromInboxItem` prefers it over the surface so an
|
package/scripts/poller/utils.mjs
CHANGED
|
@@ -239,6 +239,17 @@ raw_ref: "${item.raw_ref || ""}"
|
|
|
239
239
|
yaml += `channel_id: "${item.channel_id}"\n`;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
// THE CHANNEL KIND (DM / GROUP_DM / PUBLIC / …). Cohort's only reliable DM
|
|
243
|
+
// signal (its channel ids are cuids, so the "D…"/"dm/" prefix heuristics never
|
|
244
|
+
// fire). Written ONLY when present so a non-Cohort item is byte-identical to
|
|
245
|
+
// before; the daemon's `enrichItem` reads it to route a 1:1 DM past the group
|
|
246
|
+
// election gate while a GROUP_DM still goes through it. Enumerated writers like
|
|
247
|
+
// this one drop anything not named here, which is exactly how the signal was
|
|
248
|
+
// lost between eventToInboxItem and parseInboxItemYaml.
|
|
249
|
+
if (item.channel_kind) {
|
|
250
|
+
yaml += `channel_kind: "${item.channel_kind}"\n`;
|
|
251
|
+
}
|
|
252
|
+
|
|
242
253
|
// CONFIDENTIALITY SIGNALS. Slack's conversation-ID prefix is not a reliable
|
|
243
254
|
// type indicator (a private channel can carry a `C…` id), so downstream
|
|
244
255
|
// consumers — notably the daemon's fail-closed outcome gate,
|