@essentialai/cogent-bridge-bundled 3.25.1 → 3.25.3

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.
Files changed (2) hide show
  1. package/cogent-bridge.mjs +24 -6
  2. package/package.json +1 -1
package/cogent-bridge.mjs CHANGED
@@ -624,6 +624,7 @@ function hasJoinedInProcess() {
624
624
  }
625
625
  function markCloudAttemptInProcess() {
626
626
  cloudAttemptInProcessFlag = true;
627
+ joinedInProcessFlag = false;
627
628
  }
628
629
  function hasCloudAttemptInProcess() {
629
630
  return cloudAttemptInProcessFlag;
@@ -647,6 +648,12 @@ async function saveCredentials(creds, credentialPath) {
647
648
  );
648
649
  await fs4.chmod(filePath, 384);
649
650
  }
651
+ async function rememberIssuedPeerSecret(sessionId, peerId, peerSecret) {
652
+ const creds = await loadCredentials();
653
+ if (!creds || creds.sessionId !== sessionId) return;
654
+ if (creds.peerId === peerId && creds.peerSecret === peerSecret) return;
655
+ await saveCredentials({ ...creds, peerId, peerSecret, savedAt: (/* @__PURE__ */ new Date()).toISOString() });
656
+ }
650
657
  async function legacyGlobalCredentialsExist() {
651
658
  try {
652
659
  await fs4.access(LEGACY_GLOBAL_CREDENTIAL_PATH);
@@ -26389,8 +26396,8 @@ var init_stdio2 = __esm({
26389
26396
  // src/constants.ts
26390
26397
  import { createRequire } from "node:module";
26391
26398
  function resolveVersion() {
26392
- if ("3.25.1") {
26393
- return "3.25.1";
26399
+ if ("3.25.3") {
26400
+ return "3.25.3";
26394
26401
  }
26395
26402
  try {
26396
26403
  const require2 = createRequire(import.meta.url);
@@ -27806,6 +27813,7 @@ var init_http_backend = __esm({
27806
27813
  init_constants();
27807
27814
  init_config();
27808
27815
  init_relay_version_cache();
27816
+ init_credential_store();
27809
27817
  MAILBOX_DEPROVISIONED_HEADER = "X-Cogent-Mailbox-Deprovisioned";
27810
27818
  PATHS = {
27811
27819
  peers: "/api/sessions/:sessionId/peers",
@@ -27861,7 +27869,15 @@ var init_http_backend = __esm({
27861
27869
  if (peerSecret !== void 0 && await relaySupports(this.http, "peer-ownership")) {
27862
27870
  body.peerSecret = peerSecret;
27863
27871
  }
27864
- return this.http.post(path26, body);
27872
+ const peer = await this.http.post(path26, body);
27873
+ const issued = peer?.peerSecret;
27874
+ if (issued) {
27875
+ try {
27876
+ await rememberIssuedPeerSecret(this.sessionId, peerId, issued);
27877
+ } catch {
27878
+ }
27879
+ }
27880
+ return peer;
27865
27881
  }
27866
27882
  /**
27867
27883
  * Deregister a peer from the cloud session.
@@ -36721,7 +36737,9 @@ var init_message = __esm({
36721
36737
  replyExpected: import_zod6.z.boolean().optional().describe("Sender declares the message terminal \u2014 no reply expected. Absent/true = a reply is expected."),
36722
36738
  error: import_zod6.z.string().nullable().describe("Error message if delivery failed"),
36723
36739
  originPlatform: import_zod6.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp", "telegram", "discord"]).optional().describe("Platform that originated this message"),
36724
- attachments: import_zod6.z.array(AttachmentSchema).optional().describe("Cogent Mail M2.5 \u2014 file references (byte transport = email)")
36740
+ attachments: import_zod6.z.array(AttachmentSchema).optional().describe("Cogent Mail M2.5 \u2014 file references (byte transport = email)"),
36741
+ isRelayEcho: import_zod6.z.boolean().optional().describe("Relay-stamped: the record is an auto-relay echo"),
36742
+ traceId: import_zod6.z.string().optional().describe("Relay-minted trace id, carried on frames/poll")
36725
36743
  });
36726
36744
  }
36727
36745
  });
@@ -36847,9 +36865,9 @@ var init_api_requests = __esm({
36847
36865
  peerSecret: import_zod10.z.string().min(1).max(256).optional().describe("AUD-003: proof of ownership when reclaiming a peer from a different token"),
36848
36866
  cwd: import_zod10.z.string().max(FIELD_LIMITS.CWD_MAX).describe("Peer working directory path"),
36849
36867
  label: import_zod10.z.string().max(FIELD_LIMITS.PEER_LABEL_MAX).describe("Human-readable peer label"),
36850
- platform: import_zod10.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini"]).optional().describe("Platform this peer belongs to"),
36868
+ platform: import_zod10.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp", "telegram", "discord"]).optional().describe("Platform this peer belongs to"),
36851
36869
  type: import_zod10.z.enum(["agent", "human"]).optional().describe("Peer type"),
36852
- transport: import_zod10.z.enum(["ws", "slack-bot", "gchat-bot", "websocket"]).optional().describe("Transport mechanism"),
36870
+ transport: import_zod10.z.enum(["ws", "slack-bot", "gchat-bot", "websocket", "whatsapp-cloud", "telegram-bot", "discord-bot"]).optional().describe("Transport mechanism"),
36853
36871
  platformIdentity: import_zod10.z.record(import_zod10.z.string().max(64), import_zod10.z.string().max(FIELD_LIMITS.PLATFORM_IDENTITY_VALUE_MAX)).optional().describe("Platform-specific identity fields"),
36854
36872
  role: import_zod10.z.string().max(64).optional().describe("A2A role advertised by this peer (Agent Card)"),
36855
36873
  capabilities: import_zod10.z.array(import_zod10.z.string().max(64)).max(16).optional().describe("Capability strings \u2192 A2A Agent Card skills[]")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@essentialai/cogent-bridge-bundled",
3
- "version": "3.25.1",
3
+ "version": "3.25.3",
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": {