@essentialai/cogent-plugin 3.20.1 → 3.20.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogent",
3
- "version": "3.20.1",
3
+ "version": "3.20.3",
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.1") {
26393
- return "3.20.1";
26392
+ if ("3.20.3") {
26393
+ return "3.20.3";
26394
26394
  }
26395
26395
  try {
26396
26396
  const require2 = createRequire(import.meta.url);
@@ -26621,7 +26621,7 @@ var init_config = __esm({
26621
26621
  // purely additive/opt-in: nothing changes for any agent until a codex user
26622
26622
  // launches via the daemon (see bin/cogent-codex) and sets this to `app-server`.
26623
26623
  // Only affects COGENT_PLATFORM=codex; claude/gemini/mail rails never read it.
26624
- COGENT_CODEX_WAKE: import_zod2.z.enum(["exec-resume", "app-server"]).default("exec-resume"),
26624
+ COGENT_CODEX_WAKE: import_zod2.z.enum(["auto", "exec-resume", "app-server"]).default("auto"),
26625
26625
  // Auto-recovery for a blocked Codex sandbox. On a host where the OS sandbox
26626
26626
  // can't initialize (unprivileged user namespaces blocked — Ubuntu 24.04's
26627
26627
  // apparmor_restrict_unprivileged_userns, containers, hardened kernels),
@@ -32464,13 +32464,42 @@ var init_codex_cli = __esm({
32464
32464
  // src/services/codex-app-server.ts
32465
32465
  import path12 from "node:path";
32466
32466
  import fs11 from "node:fs/promises";
32467
- import { spawn as spawn3 } from "node:child_process";
32467
+ import { spawn as spawn3, spawnSync } from "node:child_process";
32468
32468
  function appServerSocketPath(codexHome = codexHomeDir()) {
32469
32469
  return path12.join(codexHome, "app-server-control", "app-server-control.sock");
32470
32470
  }
32471
32471
  function rpcUrl(sock) {
32472
32472
  return `ws+unix://${sock}:/rpc`;
32473
32473
  }
32474
+ function ancestryHasAppServer(startPid, getProc, maxDepth = 8) {
32475
+ let pid = startPid;
32476
+ for (let i = 0; i < maxDepth && pid > 1; i++) {
32477
+ const p = getProc(pid);
32478
+ if (!p) return false;
32479
+ if (/(?:^|\/)codex\S*\s+app-server(?:\s|$)/.test(p.cmd)) return true;
32480
+ pid = p.ppid;
32481
+ }
32482
+ return false;
32483
+ }
32484
+ function psProc(pid) {
32485
+ try {
32486
+ const out = spawnSync("ps", ["-o", "ppid=,args=", "-p", String(pid)], {
32487
+ encoding: "utf8",
32488
+ timeout: 3e3
32489
+ }).stdout?.trim();
32490
+ const m = out?.match(/^(\d+)\s+(.*)$/s);
32491
+ if (!m) return null;
32492
+ return { ppid: parseInt(m[1], 10), cmd: m[2] };
32493
+ } catch {
32494
+ return null;
32495
+ }
32496
+ }
32497
+ function runningUnderAppServerDaemon() {
32498
+ if (_underDaemon === void 0) {
32499
+ _underDaemon = ancestryHasAppServer(process.ppid, psProc);
32500
+ }
32501
+ return _underDaemon;
32502
+ }
32474
32503
  async function ensureDaemon(codexHome = codexHomeDir(), deps = {}) {
32475
32504
  if (ensuredSock) return ensuredSock;
32476
32505
  const run = deps.run ?? defaultRun;
@@ -32658,7 +32687,7 @@ async function _injectTurn(threadId, message, cwd, timeoutMs, deps = {}) {
32658
32687
  client.close();
32659
32688
  }
32660
32689
  }
32661
- var defaultWsFactory, ensuredSock, defaultRun, defaultSocketExists, sleep2, AppServerClient, idempotencyCache, IDEMPOTENCY_TTL_MS;
32690
+ var defaultWsFactory, _underDaemon, ensuredSock, defaultRun, defaultSocketExists, sleep2, AppServerClient, idempotencyCache, IDEMPOTENCY_TTL_MS;
32662
32691
  var init_codex_app_server = __esm({
32663
32692
  "src/services/codex-app-server.ts"() {
32664
32693
  "use strict";
@@ -32766,7 +32795,9 @@ var init_codex_app_server = __esm({
32766
32795
 
32767
32796
  // src/services/exec-remote.ts
32768
32797
  async function execCodexWake(sessionId, message, cwd, timeoutMs, idempotencyKey) {
32769
- if (getConfig().COGENT_CODEX_WAKE === "app-server") {
32798
+ const wake = getConfig().COGENT_CODEX_WAKE;
32799
+ const useAppServer = wake === "app-server" || wake === "auto" && runningUnderAppServerDaemon();
32800
+ if (useAppServer) {
32770
32801
  try {
32771
32802
  const sock = await ensureDaemon();
32772
32803
  const result = await execCodexViaAppServer(sessionId, message, cwd, timeoutMs, { socketPath: sock, idempotencyKey });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@essentialai/cogent-plugin",
3
- "version": "3.20.1",
3
+ "version": "3.20.3",
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",