@essentialai/cogent-plugin 3.20.0 → 3.20.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogent",
3
- "version": "3.20.0",
3
+ "version": "3.20.1",
4
4
  "description": "Inter-session communication bridge for Claude Code with Slack integration. Enables CC agents and Slack team members to communicate in real time.",
5
5
  "author": {
6
6
  "name": "Essential AI Solutions",
@@ -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.20.0") {
26393
- return "3.20.0";
26392
+ if ("3.20.1") {
26393
+ return "3.20.1";
26394
26394
  }
26395
26395
  try {
26396
26396
  const require2 = createRequire(import.meta.url);
@@ -27253,6 +27253,8 @@ var init_cc_cli = __esm({
27253
27253
  import { execFile as execFile2 } from "node:child_process";
27254
27254
  import { promisify as promisify2 } from "node:util";
27255
27255
  import fs8 from "node:fs/promises";
27256
+ import { join } from "node:path";
27257
+ import os5 from "node:os";
27256
27258
  function analyzeCodexHelp(helpText) {
27257
27259
  const checked = EXPECTED_CODEX_RESUME_FLAGS.map((f) => f.flag);
27258
27260
  const missing = EXPECTED_CODEX_RESUME_FLAGS.filter(
@@ -27357,6 +27359,27 @@ async function preflightCodexSandbox(config2) {
27357
27359
  }
27358
27360
  return res;
27359
27361
  }
27362
+ function detectCodexCogentServerCollision(configTomlText) {
27363
+ return /^[ \t]*\[mcp_servers\.cogent(\.[^\]]+)?\]/m.test(configTomlText);
27364
+ }
27365
+ function codexConfigPath(codexHomeDir2) {
27366
+ const home = codexHomeDir2 || process.env.CODEX_HOME || join(os5.homedir(), ".codex");
27367
+ return join(home, "config.toml");
27368
+ }
27369
+ async function preflightCodexServerCollision(codexHomeDir2) {
27370
+ const cfgPath = codexConfigPath(codexHomeDir2);
27371
+ let text;
27372
+ try {
27373
+ text = await fs8.readFile(cfgPath, "utf8");
27374
+ } catch {
27375
+ return false;
27376
+ }
27377
+ if (!detectCodexCogentServerCollision(text)) return false;
27378
+ logger.error(
27379
+ `Codex config collision: ${cfgPath} defines a standalone [mcp_servers.cogent] server, which has the SAME NAME as the cogent@cogent plugin's MCP server. Codex collapses the two by name and MCP startup can fail ("MCP client for cogent failed to start \u2026 connection closed: initialize response"). FIX: remove the [mcp_servers.cogent] block from ${cfgPath} \u2014 the plugin already provides the cogent tools \u2014 then restart Codex (new thread). Use the plugin OR a manual 'codex mcp add cogent', never both.`
27380
+ );
27381
+ return true;
27382
+ }
27360
27383
  var execFileAsync, EXPECTED_CODEX_RESUME_FLAGS;
27361
27384
  var init_codex_preflight = __esm({
27362
27385
  "src/services/codex-preflight.ts"() {
@@ -32194,7 +32217,7 @@ var init_cloud = __esm({
32194
32217
  // src/services/codex-cli.ts
32195
32218
  import { spawn as spawn2 } from "node:child_process";
32196
32219
  import fs10 from "node:fs/promises";
32197
- import os5 from "node:os";
32220
+ import os6 from "node:os";
32198
32221
  import path11 from "node:path";
32199
32222
  import { randomUUID } from "node:crypto";
32200
32223
  import { createReadStream } from "node:fs";
@@ -32223,7 +32246,7 @@ function execCodex(sessionId, message, cwd, timeoutMs) {
32223
32246
  const config2 = getConfig();
32224
32247
  const effectiveTimeout = timeoutMs ?? config2.COGENT_TIMEOUT_MS;
32225
32248
  const truncated = config2.COGENT_CHAR_LIMIT > 0 && message.length > config2.COGENT_CHAR_LIMIT ? message.slice(0, config2.COGENT_CHAR_LIMIT) + "\n...[truncated]" : message;
32226
- const lastMsgFile = path11.join(os5.tmpdir(), `cogent-codex-${randomUUID()}.txt`);
32249
+ const lastMsgFile = path11.join(os6.tmpdir(), `cogent-codex-${randomUUID()}.txt`);
32227
32250
  const args = [
32228
32251
  "exec",
32229
32252
  "resume",
@@ -33963,7 +33986,7 @@ __export(startup_exports, {
33963
33986
  runStartup: () => runStartup,
33964
33987
  triggerReRegistration: () => triggerReRegistration
33965
33988
  });
33966
- import os6 from "node:os";
33989
+ import os7 from "node:os";
33967
33990
  import path13 from "node:path";
33968
33991
  import fs12 from "node:fs/promises";
33969
33992
  import readline2 from "node:readline";
@@ -34164,10 +34187,10 @@ async function runStartup() {
34164
34187
  if (envStatePath) {
34165
34188
  statePath = envStatePath;
34166
34189
  } else {
34167
- const defaultPath = path13.join(os6.homedir(), ".cogent");
34190
+ const defaultPath = path13.join(os7.homedir(), ".cogent");
34168
34191
  statePath = await firstRunPrompt(defaultPath);
34169
34192
  }
34170
- if (!envStatePath && statePath !== path13.join(os6.homedir(), ".cogent")) {
34193
+ if (!envStatePath && statePath !== path13.join(os7.homedir(), ".cogent")) {
34171
34194
  process.env.COGENT_STATE_PATH = statePath;
34172
34195
  } else if (!envStatePath) {
34173
34196
  process.env.COGENT_STATE_PATH = statePath;
@@ -34275,6 +34298,7 @@ async function runPreflights() {
34275
34298
  const config2 = getConfig();
34276
34299
  if (config2.COGENT_PLATFORM === "codex") {
34277
34300
  await preflightCodex(config2.COGENT_CODEX_PATH);
34301
+ await preflightCodexServerCollision();
34278
34302
  const sandbox = await preflightCodexSandbox(config2);
34279
34303
  if (sandbox.status === "blocked" && config2.COGENT_CODEX_SANDBOX_FALLBACK) {
34280
34304
  setSandboxOverride("bypass");
@@ -34305,7 +34329,7 @@ var init_startup = __esm({
34305
34329
  init_auto_relay();
34306
34330
  UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
34307
34331
  execFileAsync3 = promisify4(execFile5);
34308
- PERSIST_PATH = path13.join(os6.homedir(), ".cogent-config.json");
34332
+ PERSIST_PATH = path13.join(os7.homedir(), ".cogent-config.json");
34309
34333
  legacyWarnEmitted = false;
34310
34334
  cloudWsClient = null;
34311
34335
  cloudInbox = null;
@@ -34318,10 +34342,10 @@ var init_startup = __esm({
34318
34342
  import crypto3 from "node:crypto";
34319
34343
  import fs13 from "node:fs/promises";
34320
34344
  import path14 from "node:path";
34321
- import os7 from "node:os";
34345
+ import os8 from "node:os";
34322
34346
  function defaultMailCredentialPath(cwd = process.cwd()) {
34323
34347
  const hash = crypto3.createHash("sha256").update(path14.resolve(cwd)).digest("hex").slice(0, 16);
34324
- return path14.join(os7.homedir(), ".cogent", "mail-credentials", `${hash}.json`);
34348
+ return path14.join(os8.homedir(), ".cogent", "mail-credentials", `${hash}.json`);
34325
34349
  }
34326
34350
  function resolveMailCredentialPath(credentialPath) {
34327
34351
  if (credentialPath) return credentialPath;
@@ -36322,7 +36346,7 @@ var init_mail_fetcher = __esm({
36322
36346
  });
36323
36347
 
36324
36348
  // src/tools/fetch-mail.ts
36325
- import os8 from "node:os";
36349
+ import os9 from "node:os";
36326
36350
  import path17 from "node:path";
36327
36351
  function registerFetchMailTool(server, deps = {}) {
36328
36352
  const makeFetcher = deps.fetcherFactory ?? ((creds) => new ImapflowMailFetcher(creds));
@@ -36385,7 +36409,7 @@ var init_fetch_mail = __esm({
36385
36409
  init_mail_fetcher();
36386
36410
  init_auth_error();
36387
36411
  init_validate();
36388
- DEFAULT_DOWNLOAD_DIR = path17.join(os8.homedir(), ".cogent", "mail-downloads");
36412
+ DEFAULT_DOWNLOAD_DIR = path17.join(os9.homedir(), ".cogent", "mail-downloads");
36389
36413
  }
36390
36414
  });
36391
36415
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@essentialai/cogent-plugin",
3
- "version": "3.20.0",
3
+ "version": "3.20.1",
4
4
  "description": "Cogent — Claude Code plugin (skills + slash-commands + MCP server) for the cross-agent comms fabric.",
5
5
  "author": { "name": "Essential AI Solutions Ltd.", "url": "https://essentialai.uk" },
6
6
  "homepage": "https://cogent.tools",