@cfio/cohort-sync 0.31.9 → 0.31.11

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/dist/index.js CHANGED
@@ -11880,6 +11880,17 @@ function deriveConvexUrl(apiUrl2) {
11880
11880
  }
11881
11881
  return normalized;
11882
11882
  }
11883
+ async function buildHookResponseError(response) {
11884
+ let detail = "";
11885
+ try {
11886
+ const body = await response.text();
11887
+ if (body.trim()) {
11888
+ detail = `: ${body.trim().slice(0, 500)}`;
11889
+ }
11890
+ } catch {
11891
+ }
11892
+ return new Error(`/hooks/agent returned ${response.status} ${response.statusText}${detail}`);
11893
+ }
11883
11894
  var savedLogger = null;
11884
11895
  function setLogger(logger) {
11885
11896
  savedLogger = logger;
@@ -12223,7 +12234,7 @@ async function injectNotification(port, hooksToken, n, agentId = "main") {
12223
12234
  signal: AbortSignal.timeout(1e4)
12224
12235
  });
12225
12236
  if (!response.ok) {
12226
- throw new Error(`/hooks/agent returned ${response.status} ${response.statusText}`);
12237
+ throw await buildHookResponseError(response);
12227
12238
  }
12228
12239
  }
12229
12240
  function buildBriefingGenerationMessage(args) {
@@ -12258,12 +12269,12 @@ async function injectBriefingGeneration(port, hooksToken, args) {
12258
12269
  name: "Cohort",
12259
12270
  agentId: args.agentId,
12260
12271
  deliver: false,
12261
- sessionKey: args.agentId === "main" ? `hook:cohort:briefing-${args.requestId}` : `agent:${args.agentId}:hook:cohort:briefing-${args.requestId}`
12272
+ sessionKey: `hook:cohort:briefing-${args.requestId}`
12262
12273
  }),
12263
12274
  signal: AbortSignal.timeout(1e4)
12264
12275
  });
12265
12276
  if (!response.ok) {
12266
- throw new Error(`/hooks/agent returned ${response.status} ${response.statusText}`);
12277
+ throw await buildHookResponseError(response);
12267
12278
  }
12268
12279
  }
12269
12280
  var deliveryFailures = /* @__PURE__ */ new Map();
@@ -13730,7 +13741,7 @@ function dumpEvent(event) {
13730
13741
  function positiveNumber(value) {
13731
13742
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
13732
13743
  }
13733
- var PLUGIN_VERSION = true ? "0.31.9" : "unknown";
13744
+ var PLUGIN_VERSION = true ? "0.31.11" : "unknown";
13734
13745
  function resolveGatewayToken(api) {
13735
13746
  const token2 = api.config?.gateway?.auth?.token;
13736
13747
  return typeof token2 === "string" ? token2 : null;
@@ -12,6 +12,8 @@
12
12
  "tools": [
13
13
  "cohort_comment",
14
14
  "cohort_context",
15
+ "cohort_briefing_context",
16
+ "cohort_briefing",
15
17
  "cohort_task",
16
18
  "cohort_transition",
17
19
  "cohort_assign"
@@ -72,5 +74,5 @@
72
74
  }
73
75
  }
74
76
  },
75
- "version": "0.31.9"
77
+ "version": "0.31.11"
76
78
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.31.9",
3
+ "version": "0.31.11",
4
4
  "description": "OpenClaw plugin — syncs agent telemetry, sessions, and activity to the Cohort dashboard",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -10,6 +10,8 @@
10
10
  "tools": [
11
11
  "cohort_comment",
12
12
  "cohort_context",
13
+ "cohort_briefing_context",
14
+ "cohort_briefing",
13
15
  "cohort_task",
14
16
  "cohort_transition",
15
17
  "cohort_assign"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfio/cohort-sync",
3
- "version": "0.31.9",
3
+ "version": "0.31.11",
4
4
  "description": "OpenClaw plugin — syncs agent telemetry, sessions, and activity to the Cohort dashboard",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.cohort.bot/gateway",