@essentialai/cogent-bridge-bundled 3.21.8 → 3.21.9
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/cogent-bridge.mjs +33 -9
- package/package.json +1 -1
package/cogent-bridge.mjs
CHANGED
|
@@ -26389,8 +26389,8 @@ var init_stdio2 = __esm({
|
|
|
26389
26389
|
// src/constants.ts
|
|
26390
26390
|
import { createRequire } from "node:module";
|
|
26391
26391
|
function resolveVersion() {
|
|
26392
|
-
if ("3.21.
|
|
26393
|
-
return "3.21.
|
|
26392
|
+
if ("3.21.9") {
|
|
26393
|
+
return "3.21.9";
|
|
26394
26394
|
}
|
|
26395
26395
|
try {
|
|
26396
26396
|
const require2 = createRequire(import.meta.url);
|
|
@@ -26499,8 +26499,26 @@ function isNewer(current, latest) {
|
|
|
26499
26499
|
return false;
|
|
26500
26500
|
}
|
|
26501
26501
|
function setLastNudge(nudge) {
|
|
26502
|
+
if (nudge !== lastNudge) shownNudge = null;
|
|
26502
26503
|
lastNudge = nudge;
|
|
26503
26504
|
}
|
|
26505
|
+
function consumeNudgeOnce() {
|
|
26506
|
+
if (!lastNudge || lastNudge === shownNudge) return null;
|
|
26507
|
+
shownNudge = lastNudge;
|
|
26508
|
+
return lastNudge;
|
|
26509
|
+
}
|
|
26510
|
+
function startUpdateCheckLoop(current, opts = {}) {
|
|
26511
|
+
const { intervalMs = 6 * 60 * 60 * 1e3, ...checkOpts } = opts;
|
|
26512
|
+
const run = () => {
|
|
26513
|
+
void checkForUpdate(current, checkOpts).then((nudge) => {
|
|
26514
|
+
if (nudge) setLastNudge(nudge);
|
|
26515
|
+
});
|
|
26516
|
+
};
|
|
26517
|
+
run();
|
|
26518
|
+
const timer = setInterval(run, intervalMs);
|
|
26519
|
+
timer.unref?.();
|
|
26520
|
+
return () => clearInterval(timer);
|
|
26521
|
+
}
|
|
26504
26522
|
function getLastNudge() {
|
|
26505
26523
|
return lastNudge;
|
|
26506
26524
|
}
|
|
@@ -26524,13 +26542,14 @@ async function checkForUpdate(current, opts = {}) {
|
|
|
26524
26542
|
clearTimeout(timer);
|
|
26525
26543
|
}
|
|
26526
26544
|
}
|
|
26527
|
-
var NPM_LATEST_URL, lastNudge;
|
|
26545
|
+
var NPM_LATEST_URL, lastNudge, shownNudge;
|
|
26528
26546
|
var init_npm_update_check = __esm({
|
|
26529
26547
|
"src/backend/npm-update-check.ts"() {
|
|
26530
26548
|
"use strict";
|
|
26531
26549
|
init_logger();
|
|
26532
26550
|
NPM_LATEST_URL = "https://registry.npmjs.org/@essentialai/cogent-bridge/latest";
|
|
26533
26551
|
lastNudge = null;
|
|
26552
|
+
shownNudge = null;
|
|
26534
26553
|
}
|
|
26535
26554
|
});
|
|
26536
26555
|
|
|
@@ -33238,7 +33257,15 @@ function formatRelayMessage(fromLabel, fromPeerId, message, attachments) {
|
|
|
33238
33257
|
${message}${formatAttachmentsBlock(attachments)}
|
|
33239
33258
|
|
|
33240
33259
|
---
|
|
33241
|
-
Respond directly to the message above. Your entire response is delivered automatically to whoever should receive it \u2014 a broadcast question (to the whole channel) is answered to everyone; a direct message, to the sender. You do NOT need to \u2014 and should NOT \u2014 call cogent_send_message or any bridge tool to deliver it; just answer normally
|
|
33260
|
+
Respond directly to the message above. Your entire response is delivered automatically to whoever should receive it \u2014 a broadcast question (to the whole channel) is answered to everyone; a direct message, to the sender. You do NOT need to \u2014 and should NOT \u2014 call cogent_send_message or any bridge tool to deliver it; just answer normally.` + updateNoticeFooter();
|
|
33261
|
+
}
|
|
33262
|
+
function updateNoticeFooter() {
|
|
33263
|
+
const nudge = consumeNudgeOnce();
|
|
33264
|
+
if (!nudge) return "";
|
|
33265
|
+
return `
|
|
33266
|
+
|
|
33267
|
+
---
|
|
33268
|
+
[Cogent FYI \u2014 not part of the message above, and not a task for you] ${nudge} You cannot apply this yourself; mention it to your operator when convenient, then carry on. Do not reply about it and do not call any cogent_* tool for it.`;
|
|
33242
33269
|
}
|
|
33243
33270
|
function formatInjectOnlyMessage(fromLabel, fromPeerId, message, attachments) {
|
|
33244
33271
|
return `[Cogent Bridge: Response from ${fromLabel} (${fromPeerId})]
|
|
@@ -33334,6 +33361,7 @@ var init_auto_relay = __esm({
|
|
|
33334
33361
|
init_codex_cli();
|
|
33335
33362
|
init_wake_inflight();
|
|
33336
33363
|
init_logger();
|
|
33364
|
+
init_npm_update_check();
|
|
33337
33365
|
RELAY_STATUS = {
|
|
33338
33366
|
QUEUED: "queued",
|
|
33339
33367
|
PROCESSING: "processing",
|
|
@@ -37023,11 +37051,7 @@ async function main() {
|
|
|
37023
37051
|
`Preflight error (non-fatal): ${err instanceof Error ? err.message : String(err)}`
|
|
37024
37052
|
);
|
|
37025
37053
|
});
|
|
37026
|
-
|
|
37027
|
-
setLastNudge(nudge);
|
|
37028
|
-
if (nudge) process.stderr.write(`${nudge}
|
|
37029
|
-
`);
|
|
37030
|
-
});
|
|
37054
|
+
startUpdateCheckLoop(SERVER_VERSION);
|
|
37031
37055
|
logger.info(
|
|
37032
37056
|
"Server ready. Tools: cogent_register_peer, cogent_deregister_peer, cogent_send_message, cogent_list_peers, cogent_get_history, cogent_health_check, cogent_create_session, cogent_join_session"
|
|
37033
37057
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@essentialai/cogent-bridge-bundled",
|
|
3
|
-
"version": "3.21.
|
|
3
|
+
"version": "3.21.9",
|
|
4
4
|
"description": "Zero-dependency, pre-bundled Cogent MCP bridge — a single self-contained file for fast cold `npx` startup (used by the Codex plugin, whose MCP startup window is short). Functionally identical to @essentialai/cogent-bridge; carries no npm dependencies so `npx` skips dependency install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|