codeam-cli 2.61.44 → 2.61.46

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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `codeam-cli` are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.61.45] — 2026-07-26
8
+
9
+ ### Added
10
+
11
+ - **shared,cli:** PostHog integration + mcp-shim HTTP transport
12
+
13
+ ## [2.61.44] — 2026-07-25
14
+
15
+ ### Added
16
+
17
+ - **shared:** Resend integration — api_key (send-only comms), excluded from From-Conversation
18
+
7
19
  ## [2.61.43] — 2026-07-25
8
20
 
9
21
  ### Added
package/dist/index.js CHANGED
@@ -6,6 +6,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ };
9
12
  var __commonJS = (cb, mod) => function __require() {
10
13
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
14
  };
@@ -86,6 +89,72 @@ var require_src = __commonJS({
86
89
  }
87
90
  });
88
91
 
92
+ // src/integrations/http-relay.ts
93
+ var http_relay_exports = {};
94
+ __export(http_relay_exports, {
95
+ buildHttpHeaders: () => buildHttpHeaders,
96
+ fillTemplate: () => fillTemplate,
97
+ runHttpRelay: () => runHttpRelay
98
+ });
99
+ function fillTemplate(template, token) {
100
+ return template.replace(/\{(\w+)\}/g, (_m, field) => {
101
+ const v = token[field];
102
+ return typeof v === "string" ? v : "";
103
+ });
104
+ }
105
+ function buildHttpHeaders(httpHeaders, token) {
106
+ const headers = {};
107
+ for (const [name, template] of Object.entries(httpHeaders ?? {})) {
108
+ headers[name] = fillTemplate(template, token);
109
+ }
110
+ return headers;
111
+ }
112
+ async function runHttpRelay(delivery, client3, id) {
113
+ if (!delivery.httpUrl) throw new Error("runHttpRelay called without delivery.httpUrl");
114
+ const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
115
+ const { StreamableHTTPClientTransport } = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
116
+ const token = await client3.getToken(id);
117
+ const url2 = new URL(fillTemplate(delivery.httpUrl, token));
118
+ const httpTransport = new StreamableHTTPClientTransport(url2, {
119
+ requestInit: { headers: buildHttpHeaders(delivery.httpHeaders, token) }
120
+ });
121
+ const stdioTransport = new StdioServerTransport();
122
+ await new Promise((resolve8, reject) => {
123
+ let done = false;
124
+ const finish = (err) => {
125
+ if (done) return;
126
+ done = true;
127
+ void httpTransport.close().catch(() => void 0);
128
+ void stdioTransport.close().catch(() => void 0);
129
+ if (err) reject(err);
130
+ else resolve8();
131
+ };
132
+ stdioTransport.onmessage = (msg) => {
133
+ void httpTransport.send(msg).catch((e) => {
134
+ process.stderr.write(`[mcp-run http] send\u2192remote failed: ${String(e)}
135
+ `);
136
+ });
137
+ };
138
+ httpTransport.onmessage = (msg) => {
139
+ void stdioTransport.send(msg).catch(() => void 0);
140
+ };
141
+ stdioTransport.onclose = () => finish();
142
+ httpTransport.onclose = () => finish();
143
+ stdioTransport.onerror = (e) => process.stderr.write(`[mcp-run http] stdio: ${String(e)}
144
+ `);
145
+ httpTransport.onerror = (e) => process.stderr.write(`[mcp-run http] http: ${String(e)}
146
+ `);
147
+ Promise.all([httpTransport.start(), stdioTransport.start()]).catch(
148
+ (e) => finish(e instanceof Error ? e : new Error(String(e)))
149
+ );
150
+ });
151
+ }
152
+ var init_http_relay = __esm({
153
+ "src/integrations/http-relay.ts"() {
154
+ "use strict";
155
+ }
156
+ });
157
+
89
158
  // src/commands/start.ts
90
159
  var import_picocolors4 = __toESM(require("picocolors"));
91
160
 
@@ -854,6 +923,98 @@ var INTEGRATION_REGISTRY = {
854
923
  }
855
924
  }
856
925
  },
926
+ posthog: {
927
+ id: "posthog",
928
+ name: "PostHog",
929
+ icon: "posthog",
930
+ category: "observability",
931
+ // LIVE — api_key: the user pastes a PostHog Personal API Key (phx_…, created
932
+ // with the "MCP Server" preset). PostHog's MCP is HOSTED-ONLY
933
+ // (mcp.posthog.com) over HTTP, and its stdio bridge (mcp-remote) forces its
934
+ // own browser OAuth — incompatible with our headless broker. So delivery
935
+ // uses the shim's HTTP transport: it relays to the hosted MCP with the key
936
+ // as a Bearer header (exactly Cursor's {url, headers} config). No OAuth, no
937
+ // GSM secret; a backend VALIDATOR proves the key + vaults it.
938
+ enabled: true,
939
+ auth: {
940
+ kind: "api_key",
941
+ fields: [
942
+ {
943
+ key: "accessToken",
944
+ label: "Personal API Key",
945
+ placeholder: "phx_xxxxxxxxxxxxxxxx",
946
+ secret: true,
947
+ help: 'PostHog \u2192 Settings \u2192 Personal API keys \u2192 create with the "MCP Server" preset (scopes it to a project).'
948
+ }
949
+ ]
950
+ },
951
+ delivery: {
952
+ mcp: {
953
+ // HTTP transport (not a spawned stdio server) — the shim relays to
954
+ // PostHog's hosted MCP with the key as a Bearer header. The key stays
955
+ // server-side of the shim, never on argv.
956
+ command: "",
957
+ args: [],
958
+ envMapping: {},
959
+ httpUrl: "https://mcp.posthog.com/mcp",
960
+ httpHeaders: { Authorization: "Bearer {accessToken}" }
961
+ }
962
+ }
963
+ },
964
+ datadog: {
965
+ id: "datadog",
966
+ name: "Datadog",
967
+ icon: "datadog",
968
+ category: "observability",
969
+ // LIVE — api_key: the user pastes a Datadog API key (org-scoped) + an
970
+ // Application key (user-scoped, grants the read scopes) + their regional
971
+ // site. Datadog's OFFICIAL hosted MCP (mcp.<site>) accepts these as headers
972
+ // headless (verified) — no OAuth, no GSM secret. Delivery uses the shim's
973
+ // HTTP transport with the site templated into the URL and both keys sent as
974
+ // DD-API-KEY / DD-APPLICATION-KEY headers.
975
+ enabled: true,
976
+ auth: {
977
+ kind: "api_key",
978
+ fields: [
979
+ {
980
+ key: "accessToken",
981
+ label: "API Key",
982
+ placeholder: "Datadog API key",
983
+ secret: true,
984
+ help: "Organization API key \u2014 Datadog \u2192 Organization Settings \u2192 API Keys."
985
+ },
986
+ {
987
+ key: "appKey",
988
+ label: "Application Key",
989
+ placeholder: "Datadog application key",
990
+ secret: true,
991
+ help: "User Application key (grants the read scopes) \u2014 Datadog \u2192 Organization Settings \u2192 Application Keys."
992
+ },
993
+ {
994
+ key: "host",
995
+ label: "Site",
996
+ placeholder: "datadoghq.com",
997
+ secret: false,
998
+ help: "Your Datadog site \u2014 US1: datadoghq.com \xB7 EU: datadoghq.eu \xB7 US3: us3.datadoghq.com \xB7 US5: us5.datadoghq.com \xB7 AP1: ap1.datadoghq.com."
999
+ }
1000
+ ]
1001
+ },
1002
+ delivery: {
1003
+ mcp: {
1004
+ // HTTP transport — the shim relays to Datadog's hosted MCP for the
1005
+ // user's site, with both keys as headers. Keys stay server-side of the
1006
+ // shim, never on argv.
1007
+ command: "",
1008
+ args: [],
1009
+ envMapping: {},
1010
+ httpUrl: "https://mcp.{host}/api/unstable/mcp-server/mcp",
1011
+ httpHeaders: {
1012
+ "DD-API-KEY": "{accessToken}",
1013
+ "DD-APPLICATION-KEY": "{appKey}"
1014
+ }
1015
+ }
1016
+ }
1017
+ },
857
1018
  notion: {
858
1019
  id: "notion",
859
1020
  name: "Notion",
@@ -6422,7 +6583,7 @@ function readAnonId() {
6422
6583
  }
6423
6584
  function superProperties() {
6424
6585
  return {
6425
- cliVersion: true ? "2.61.44" : "0.0.0-dev",
6586
+ cliVersion: true ? "2.61.46" : "0.0.0-dev",
6426
6587
  nodeVersion: process.version,
6427
6588
  platform: process.platform,
6428
6589
  arch: process.arch,
@@ -6603,7 +6764,7 @@ var os4 = __toESM(require("os"));
6603
6764
  // package.json
6604
6765
  var package_default = {
6605
6766
  name: "codeam-cli",
6606
- version: "2.61.44",
6767
+ version: "2.61.46",
6607
6768
  description: "Workflow-continuity bridge for AI coding agents. Wrap Claude Code or Codex in a PTY and supervise, approve, and redirect the session from any device \u2014 async. The terminal companion for CodeAgent Mobile.",
6608
6769
  type: "commonjs",
6609
6770
  main: "dist/index.js",
@@ -6679,6 +6840,7 @@ var package_default = {
6679
6840
  "@agentclientprotocol/codex-acp": "1.1.4",
6680
6841
  "@agentclientprotocol/sdk": "1.2.1",
6681
6842
  "@clack/prompts": "^1.2.0",
6843
+ "@modelcontextprotocol/sdk": "1.29.0",
6682
6844
  chokidar: "^3.6.0",
6683
6845
  ignore: "^7.0.6",
6684
6846
  picocolors: "^1.1.0",
@@ -7774,7 +7936,7 @@ var CommandRelayService = class _CommandRelayService {
7774
7936
  // fresh + clear the "CLI update available" banner after a self-update
7775
7937
  // (a codespace that reinstalls @latest reconnects via heartbeat, not
7776
7938
  // pair/reconnect). Older backends ignore the extra field.
7777
- ..."2.61.44" ? { ideVersion: "2.61.44" } : {}
7939
+ ..."2.61.46" ? { ideVersion: "2.61.46" } : {}
7778
7940
  }).then(() => log.trace("relay", `heartbeat ok online=${online}`)).catch((err) => log.trace("relay", `heartbeat failed online=${online}`, err));
7779
7941
  }
7780
7942
  /**
@@ -18759,7 +18921,7 @@ async function autoUpgradeBeforeCriticalCommand() {
18759
18921
  if (process.env.NODE_ENV === "test") return;
18760
18922
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
18761
18923
  if (process.env.CI) return;
18762
- const current = true ? "2.61.44" : null;
18924
+ const current = true ? "2.61.46" : null;
18763
18925
  if (!current) return;
18764
18926
  const cache = readCache();
18765
18927
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18776,7 +18938,7 @@ function checkForUpdates() {
18776
18938
  if (process.env.CODEAM_DISABLE_UPDATE_CHECK === "1") return;
18777
18939
  if (process.env.CI) return;
18778
18940
  if (!process.stdout.isTTY) return;
18779
- const current = true ? "2.61.44" : null;
18941
+ const current = true ? "2.61.46" : null;
18780
18942
  if (!current) return;
18781
18943
  const cache = readCache();
18782
18944
  const fresh = cache && Date.now() - cache.fetchedAt < TTL_MS;
@@ -18796,7 +18958,7 @@ var SELF_UPDATE_INTERVAL_MS = 60 * 60 * 1e3;
18796
18958
  var SELF_UPDATE_VIEW_TIMEOUT_MS = 3e4;
18797
18959
  var SELF_UPDATE_INSTALL_TIMEOUT_MS = 18e4;
18798
18960
  function currentCliVersion() {
18799
- return true ? "2.61.44" : null;
18961
+ return true ? "2.61.46" : null;
18800
18962
  }
18801
18963
  function runCmd(cmd, args2, timeoutMs) {
18802
18964
  return new Promise((resolve8) => {
@@ -38922,7 +39084,7 @@ function checkChokidar() {
38922
39084
  }
38923
39085
  async function doctor(args2 = []) {
38924
39086
  const json = args2.includes("--json");
38925
- const cliVersion = true ? "2.61.44" : "0.0.0-dev";
39087
+ const cliVersion = true ? "2.61.46" : "0.0.0-dev";
38926
39088
  const apiBase2 = resolveApiBaseUrl();
38927
39089
  const diagnosticId = (0, import_node_crypto13.randomUUID)();
38928
39090
  log.info("doctor", `run id=${diagnosticId} cli=${cliVersion}`);
@@ -39406,6 +39568,17 @@ async function mcpRun(args2) {
39406
39568
  `);
39407
39569
  process.exit(1);
39408
39570
  }
39571
+ if (delivery.httpUrl) {
39572
+ const httpClient = new IntegrationTokenClient({
39573
+ sessionId,
39574
+ pluginId,
39575
+ pluginAuthToken,
39576
+ pollSecret: process.env.CODEAM_MCP_POLL_SECRET
39577
+ });
39578
+ const { runHttpRelay: runHttpRelay2 } = await Promise.resolve().then(() => (init_http_relay(), http_relay_exports));
39579
+ await runHttpRelay2(delivery, httpClient, id);
39580
+ return;
39581
+ }
39409
39582
  ensureCommand(delivery.command);
39410
39583
  const launcher = resolveLauncherPath(delivery.command);
39411
39584
  const client3 = new IntegrationTokenClient({
@@ -39433,7 +39606,7 @@ async function mcpRun(args2) {
39433
39606
  // src/commands/version.ts
39434
39607
  var import_picocolors15 = __toESM(require("picocolors"));
39435
39608
  function version2() {
39436
- const v = true ? "2.61.44" : "unknown";
39609
+ const v = true ? "2.61.46" : "unknown";
39437
39610
  console.log(`${import_picocolors15.default.bold("codeam-cli")} ${import_picocolors15.default.cyan(v)}`);
39438
39611
  }
39439
39612
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "2.61.44",
3
+ "version": "2.61.46",
4
4
  "description": "Workflow-continuity bridge for AI coding agents. Wrap Claude Code or Codex in a PTY and supervise, approve, and redirect the session from any device — async. The terminal companion for CodeAgent Mobile.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -76,6 +76,7 @@
76
76
  "@agentclientprotocol/codex-acp": "1.1.4",
77
77
  "@agentclientprotocol/sdk": "1.2.1",
78
78
  "@clack/prompts": "^1.2.0",
79
+ "@modelcontextprotocol/sdk": "1.29.0",
79
80
  "chokidar": "^3.6.0",
80
81
  "ignore": "^7.0.6",
81
82
  "picocolors": "^1.1.0",