@essentialai/cogent-plugin 3.13.0 → 3.14.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.
- package/.claude-plugin/plugin.json +1 -1
- package/bridge/cogent-bridge.mjs +56 -23
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.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",
|
package/bridge/cogent-bridge.mjs
CHANGED
|
@@ -152,31 +152,33 @@ var init_detect = __esm({
|
|
|
152
152
|
});
|
|
153
153
|
|
|
154
154
|
// src/wizard/templates.ts
|
|
155
|
-
function
|
|
155
|
+
function cogentEnv(mode) {
|
|
156
|
+
const env = {
|
|
157
|
+
COGENT_LOG_LEVEL: "info",
|
|
158
|
+
COGENT_TIMEOUT_MS: "300000"
|
|
159
|
+
};
|
|
160
|
+
if (mode === "local") env.COGENT_LOCAL = "1";
|
|
161
|
+
return env;
|
|
162
|
+
}
|
|
163
|
+
function mcpJsonContent(npxPath, mode = "cloud") {
|
|
156
164
|
const config2 = {
|
|
157
165
|
mcpServers: {
|
|
158
166
|
"cogent": {
|
|
159
167
|
command: npxPath,
|
|
160
168
|
args: ["-y", "@essentialai/cogent-bridge"],
|
|
161
|
-
env:
|
|
162
|
-
COGENT_LOG_LEVEL: "info",
|
|
163
|
-
COGENT_TIMEOUT_MS: "300000"
|
|
164
|
-
}
|
|
169
|
+
env: cogentEnv(mode)
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
};
|
|
168
173
|
return JSON.stringify(config2, null, 2) + "\n";
|
|
169
174
|
}
|
|
170
|
-
function mcpJsonMerge(existing, npxPath) {
|
|
175
|
+
function mcpJsonMerge(existing, npxPath, mode = "cloud") {
|
|
171
176
|
const parsed = JSON.parse(existing);
|
|
172
177
|
if (!parsed.mcpServers) parsed.mcpServers = {};
|
|
173
178
|
parsed.mcpServers["cogent"] = {
|
|
174
179
|
command: npxPath,
|
|
175
180
|
args: ["-y", "@essentialai/cogent-bridge"],
|
|
176
|
-
env:
|
|
177
|
-
COGENT_LOG_LEVEL: "info",
|
|
178
|
-
COGENT_TIMEOUT_MS: "300000"
|
|
179
|
-
}
|
|
181
|
+
env: cogentEnv(mode)
|
|
180
182
|
};
|
|
181
183
|
return JSON.stringify(parsed, null, 2) + "\n";
|
|
182
184
|
}
|
|
@@ -380,14 +382,14 @@ var init_scaffold_demo = __esm({
|
|
|
380
382
|
// src/wizard/scaffold-real.ts
|
|
381
383
|
import fs2 from "node:fs";
|
|
382
384
|
import path2 from "node:path";
|
|
383
|
-
function writeMcpJson(projectPath, npxPath) {
|
|
385
|
+
function writeMcpJson(projectPath, npxPath, mode) {
|
|
384
386
|
const filePath = path2.join(projectPath, ".mcp.json");
|
|
385
387
|
if (fs2.existsSync(filePath)) {
|
|
386
388
|
const existing = fs2.readFileSync(filePath, "utf-8");
|
|
387
|
-
fs2.writeFileSync(filePath, mcpJsonMerge(existing, npxPath), "utf-8");
|
|
389
|
+
fs2.writeFileSync(filePath, mcpJsonMerge(existing, npxPath, mode), "utf-8");
|
|
388
390
|
return "modified";
|
|
389
391
|
}
|
|
390
|
-
fs2.writeFileSync(filePath, mcpJsonContent(npxPath), "utf-8");
|
|
392
|
+
fs2.writeFileSync(filePath, mcpJsonContent(npxPath, mode), "utf-8");
|
|
391
393
|
return "created";
|
|
392
394
|
}
|
|
393
395
|
function writeClaudeMd(projectPath, peerId, label, otherPeerId) {
|
|
@@ -408,7 +410,8 @@ function scaffoldReal(config2) {
|
|
|
408
410
|
const created = [];
|
|
409
411
|
const modified = [];
|
|
410
412
|
const skipped = [];
|
|
411
|
-
const
|
|
413
|
+
const mode = config2.mode ?? "cloud";
|
|
414
|
+
const mcpA = writeMcpJson(config2.projectAPath, config2.npxPath, mode);
|
|
412
415
|
const mcpAPath = path2.join(config2.projectAPath, ".mcp.json");
|
|
413
416
|
if (mcpA === "created") created.push(mcpAPath);
|
|
414
417
|
else modified.push(mcpAPath);
|
|
@@ -422,7 +425,7 @@ function scaffoldReal(config2) {
|
|
|
422
425
|
if (claudeA === "created") created.push(claudeAPath);
|
|
423
426
|
else if (claudeA === "modified") modified.push(claudeAPath);
|
|
424
427
|
else skipped.push(claudeAPath);
|
|
425
|
-
const mcpB = writeMcpJson(config2.projectBPath, config2.npxPath);
|
|
428
|
+
const mcpB = writeMcpJson(config2.projectBPath, config2.npxPath, mode);
|
|
426
429
|
const mcpBPath = path2.join(config2.projectBPath, ".mcp.json");
|
|
427
430
|
if (mcpB === "created") created.push(mcpBPath);
|
|
428
431
|
else modified.push(mcpBPath);
|
|
@@ -565,6 +568,11 @@ async function runWizard() {
|
|
|
565
568
|
const idB = await ask(rl, "Peer ID for Project B:", defaultIdB);
|
|
566
569
|
const defaultLabelB = "CC_" + path3.basename(pathB).replace(/[^a-zA-Z0-9]/g, "_");
|
|
567
570
|
const labelB = await ask(rl, "Label for Project B:", defaultLabelB);
|
|
571
|
+
const modeIdx = await choose(rl, "How should these agents connect?", [
|
|
572
|
+
"Cloud \u2014 collaborate with remote agents over cogent.tools (recommended)",
|
|
573
|
+
"Local \u2014 offline, this machine only (self-hosted / local-LLM / air-gapped)"
|
|
574
|
+
]);
|
|
575
|
+
const mode2 = modeIdx === 1 ? "local" : "cloud";
|
|
568
576
|
heading("Configuring projects");
|
|
569
577
|
const result = scaffoldReal({
|
|
570
578
|
projectAPath: path3.resolve(pathA),
|
|
@@ -573,7 +581,8 @@ async function runWizard() {
|
|
|
573
581
|
projectBPath: path3.resolve(pathB),
|
|
574
582
|
projectBId: idB,
|
|
575
583
|
projectBLabel: labelB,
|
|
576
|
-
npxPath
|
|
584
|
+
npxPath,
|
|
585
|
+
mode: mode2
|
|
577
586
|
});
|
|
578
587
|
printRealNextSteps(path3.resolve(pathA), idA, labelA, path3.resolve(pathB), idB, labelB, result);
|
|
579
588
|
}
|
|
@@ -26380,8 +26389,8 @@ var init_stdio2 = __esm({
|
|
|
26380
26389
|
// src/constants.ts
|
|
26381
26390
|
import { createRequire } from "node:module";
|
|
26382
26391
|
function resolveVersion() {
|
|
26383
|
-
if ("3.
|
|
26384
|
-
return "3.
|
|
26392
|
+
if ("3.14.1") {
|
|
26393
|
+
return "3.14.1";
|
|
26385
26394
|
}
|
|
26386
26395
|
try {
|
|
26387
26396
|
const require2 = createRequire(import.meta.url);
|
|
@@ -26528,6 +26537,12 @@ var init_npm_update_check = __esm({
|
|
|
26528
26537
|
// src/config.ts
|
|
26529
26538
|
import os3 from "node:os";
|
|
26530
26539
|
import path6 from "node:path";
|
|
26540
|
+
function isLocalOptOut(value) {
|
|
26541
|
+
if (value === void 0) return false;
|
|
26542
|
+
return ["1", "true", "yes", "on", "enable", "enabled"].includes(
|
|
26543
|
+
value.trim().toLowerCase()
|
|
26544
|
+
);
|
|
26545
|
+
}
|
|
26531
26546
|
function loadConfig(env = process.env) {
|
|
26532
26547
|
const result = configSchema.safeParse(env);
|
|
26533
26548
|
if (!result.success) {
|
|
@@ -26535,22 +26550,40 @@ function loadConfig(env = process.env) {
|
|
|
26535
26550
|
throw new Error(`Invalid configuration:
|
|
26536
26551
|
${issues}`);
|
|
26537
26552
|
}
|
|
26538
|
-
|
|
26553
|
+
const data = { ...result.data };
|
|
26554
|
+
if (isLocalOptOut(data.COGENT_LOCAL)) {
|
|
26555
|
+
data.COGENT_ENDPOINT = void 0;
|
|
26556
|
+
} else if (!data.COGENT_ENDPOINT) {
|
|
26557
|
+
data.COGENT_ENDPOINT = DEFAULT_FREE_ENDPOINT;
|
|
26558
|
+
}
|
|
26559
|
+
_config = Object.freeze(data);
|
|
26539
26560
|
return _config;
|
|
26540
26561
|
}
|
|
26541
26562
|
function getConfig() {
|
|
26542
26563
|
if (!_config) throw new Error("Config not loaded. Call loadConfig() first.");
|
|
26543
26564
|
return _config;
|
|
26544
26565
|
}
|
|
26545
|
-
var import_zod2, defaultStatePath, configSchema, _config;
|
|
26566
|
+
var import_zod2, defaultStatePath, DEFAULT_FREE_ENDPOINT, configSchema, _config;
|
|
26546
26567
|
var init_config = __esm({
|
|
26547
26568
|
"src/config.ts"() {
|
|
26548
26569
|
"use strict";
|
|
26549
26570
|
import_zod2 = __toESM(require_zod(), 1);
|
|
26550
26571
|
defaultStatePath = path6.join(os3.homedir(), ".cogent");
|
|
26572
|
+
DEFAULT_FREE_ENDPOINT = "https://cogent.tools";
|
|
26551
26573
|
configSchema = import_zod2.z.object({
|
|
26552
26574
|
COGENT_STATE_PATH: import_zod2.z.string().default(defaultStatePath),
|
|
26575
|
+
// Relay URL for free (password) channels. **Zero-config default = the hosted FREE
|
|
26576
|
+
// relay (cogent.tools)** — see the loadConfig() resolution below. A hand-rolled MCP
|
|
26577
|
+
// config that OMITTED this used to silently run LOCAL and never reach any cloud
|
|
26578
|
+
// channel (the marvin-coder confusion, 2026-08-06); defaulting it makes "cloud" the
|
|
26579
|
+
// out-of-the-box mode. Opt OUT to local/offline mode with COGENT_LOCAL. An explicit
|
|
26580
|
+
// value (a free self-host URL, or the Team URL for a custom Team agent) always wins.
|
|
26553
26581
|
COGENT_ENDPOINT: import_zod2.z.string().optional(),
|
|
26582
|
+
// **Local mode opt-out.** Set truthy (1/true/yes/on) to force LOCAL file-based state
|
|
26583
|
+
// even when COGENT_ENDPOINT would otherwise default to the free relay. This is the
|
|
26584
|
+
// switch for offline use, air-gapped/self-contained agents, and (upcoming) local-LLM
|
|
26585
|
+
// operation where no cloud relay is wanted. When set, it wins over any COGENT_ENDPOINT.
|
|
26586
|
+
COGENT_LOCAL: import_zod2.z.string().optional(),
|
|
26554
26587
|
// Team (business) relay. cogent_join_session auto-routes here when an Org_ID is
|
|
26555
26588
|
// supplied (free joins use COGENT_ENDPOINT). Default = the hosted Team relay; a
|
|
26556
26589
|
// self-hosted Team deployment overrides it. No runtime flipping — the presence of
|
|
@@ -34372,9 +34405,9 @@ var init_peer = __esm({
|
|
|
34372
34405
|
label: import_zod5.z.string().describe("Human-readable label"),
|
|
34373
34406
|
registeredAt: import_zod5.z.string().datetime().describe("ISO 8601 registration timestamp"),
|
|
34374
34407
|
lastSeenAt: import_zod5.z.string().datetime().describe("ISO 8601 last activity timestamp"),
|
|
34375
|
-
platform: import_zod5.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp"]).optional().describe("Platform this peer belongs to"),
|
|
34408
|
+
platform: import_zod5.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp", "telegram", "discord"]).optional().describe("Platform this peer belongs to"),
|
|
34376
34409
|
type: import_zod5.z.enum(["agent", "human"]).optional().describe("Peer type: AI agent or human user"),
|
|
34377
|
-
transport: import_zod5.z.enum(["ws", "slack-bot", "gchat-bot", "websocket", "whatsapp-cloud"]).optional().describe("Transport mechanism for this peer"),
|
|
34410
|
+
transport: import_zod5.z.enum(["ws", "slack-bot", "gchat-bot", "websocket", "whatsapp-cloud", "telegram-bot", "discord-bot"]).optional().describe("Transport mechanism for this peer"),
|
|
34378
34411
|
platformIdentity: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.string()).optional().describe("Platform-specific identity fields (slackUserId, slackChannelId, etc.)"),
|
|
34379
34412
|
workspaceId: import_zod5.z.string().optional().describe("Durable workspace identifier (Slice 5) \u2014 stable id not tied to the mutable cwd hint"),
|
|
34380
34413
|
threadId: import_zod5.z.string().optional().describe("Durable thread/conversation identifier (Slice 5)"),
|
|
@@ -34400,7 +34433,7 @@ var init_message = __esm({
|
|
|
34400
34433
|
durationMs: import_zod6.z.number().nullable().describe("Round-trip duration in ms"),
|
|
34401
34434
|
success: import_zod6.z.boolean().describe("Whether delivery succeeded"),
|
|
34402
34435
|
error: import_zod6.z.string().nullable().describe("Error message if delivery failed"),
|
|
34403
|
-
originPlatform: import_zod6.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp"]).optional().describe("Platform that originated this message")
|
|
34436
|
+
originPlatform: import_zod6.z.enum(["cc", "codex", "slack", "gchat", "web", "gemini", "whatsapp", "telegram", "discord"]).optional().describe("Platform that originated this message")
|
|
34404
34437
|
});
|
|
34405
34438
|
}
|
|
34406
34439
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@essentialai/cogent-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.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",
|