@codeam/shared 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/dist/index.d.mts CHANGED
@@ -351,7 +351,7 @@ declare function isHeadroomWrappable(agentId: string): boolean;
351
351
  * ubiquitous CLI for the tool → `cliEnv`; otherwise → `mcp`. A tool may
352
352
  * declare both.
353
353
  */
354
- type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'github_issues' | 'github' | 'gitlab';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'posthog' | 'datadog' | 'github_issues' | 'github' | 'gitlab';
355
355
  /**
356
356
  * `derived` = no link flow of its own: the credential is BORROWED live from a
357
357
  * connection the user already made elsewhere (see `derivedFrom`). The backend
@@ -388,8 +388,9 @@ type IntegrationCategory = 'version_control' | 'tracker' | 'design' | 'comms' |
388
388
  * field the delivery `envMapping` references.
389
389
  */
390
390
  interface IntegrationApiKeyField {
391
- /** Maps to a BrokeredIntegrationToken field (`accessToken`, `orgUrl`, …). */
392
- key: 'accessToken' | 'orgUrl';
391
+ /** Maps to a BrokeredIntegrationToken field (`accessToken`, `orgUrl`,
392
+ * `appKey`, `host`, …). */
393
+ key: 'accessToken' | 'orgUrl' | 'appKey' | 'host';
393
394
  /** Form label. */
394
395
  label: string;
395
396
  /** Example / placeholder. */
@@ -400,15 +401,35 @@ interface IntegrationApiKeyField {
400
401
  help?: string;
401
402
  }
402
403
  type IntegrationHealth = 'ok' | 'expired' | 'revoked';
403
- /** stdio MCP server spec, executed as DATA by the CLI shim (`codeam mcp-run <id>`). */
404
+ /** stdio MCP server spec, executed as DATA by the CLI shim (`codeam mcp-run <id>`).
405
+ *
406
+ * Two transports:
407
+ * - **stdio (default):** the shim spawns `command args` (with `envMapping`
408
+ * credentials in the env) and byte-pipes it to the agent.
409
+ * - **HTTP (`httpUrl` set):** the shim connects to a REMOTE MCP over
410
+ * Streamable HTTP and relays it to the agent's stdio — for vendors that only
411
+ * ship a hosted MCP (e.g. PostHog `mcp.posthog.com`). `command`/`args` are
412
+ * unused (empty); credentials go in `httpHeaders` (never `envMapping`).
413
+ */
404
414
  interface IntegrationMcpDelivery {
405
415
  command: string;
406
416
  args: string[];
407
- /** env var name → credential field (`accessToken` | `cloudId` | …). Env only, never argv. */
417
+ /** env var name → credential field (`accessToken` | `cloudId` | …). Env only, never argv. STDIO transport. */
408
418
  envMapping: Record<string, string>;
409
419
  /** Static, non-credential env the server needs to boot (e.g. mode flags).
410
- * Merged into the child env BENEATH the credential envMapping. Never secrets. */
420
+ * Merged into the child env BENEATH the credential envMapping. Never secrets. STDIO transport. */
411
421
  staticEnv?: Record<string, string>;
422
+ /** HTTP transport — a REMOTE MCP URL (Streamable HTTP). When set, the shim
423
+ * relays to it instead of spawning `command`. May carry `{field}` placeholders
424
+ * filled from the BrokeredIntegrationToken (e.g. a per-user regional host:
425
+ * `https://mcp.{host}/…`). */
426
+ httpUrl?: string;
427
+ /** HTTP transport — header name → value TEMPLATE with `{field}` placeholders
428
+ * filled from the BrokeredIntegrationToken at spawn (e.g.
429
+ * `{ Authorization: 'Bearer {accessToken}' }` or Datadog's
430
+ * `{ 'DD-API-KEY': '{accessToken}', 'DD-APPLICATION-KEY': '{appKey}' }`). The
431
+ * token stays server-side of the shim — never on argv. */
432
+ httpHeaders?: Record<string, string>;
412
433
  }
413
434
  interface IntegrationDelivery {
414
435
  mcp?: IntegrationMcpDelivery;
@@ -484,6 +505,10 @@ interface BrokeredIntegrationToken {
484
505
  * single BOT token, injected by the broker from config — the per-user
485
506
  * credential IS the guildId. Absent for non-Discord integrations. */
486
507
  guildId?: string;
508
+ /** Datadog Application key (user-scoped) — sent alongside the API key
509
+ * (`accessToken`) as the `DD-APPLICATION-KEY` header; `host` carries the
510
+ * regional site. Absent for non-Datadog integrations. */
511
+ appKey?: string;
487
512
  }
488
513
 
489
514
  /**
@@ -531,7 +556,7 @@ interface IntegrationBranding {
531
556
  logoSvg: string;
532
557
  }
533
558
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
534
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
559
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude"];
535
560
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
536
561
 
537
562
  /**
package/dist/index.d.ts CHANGED
@@ -351,7 +351,7 @@ declare function isHeadroomWrappable(agentId: string): boolean;
351
351
  * ubiquitous CLI for the tool → `cliEnv`; otherwise → `mcp`. A tool may
352
352
  * declare both.
353
353
  */
354
- type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'github_issues' | 'github' | 'gitlab';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'posthog' | 'datadog' | 'github_issues' | 'github' | 'gitlab';
355
355
  /**
356
356
  * `derived` = no link flow of its own: the credential is BORROWED live from a
357
357
  * connection the user already made elsewhere (see `derivedFrom`). The backend
@@ -388,8 +388,9 @@ type IntegrationCategory = 'version_control' | 'tracker' | 'design' | 'comms' |
388
388
  * field the delivery `envMapping` references.
389
389
  */
390
390
  interface IntegrationApiKeyField {
391
- /** Maps to a BrokeredIntegrationToken field (`accessToken`, `orgUrl`, …). */
392
- key: 'accessToken' | 'orgUrl';
391
+ /** Maps to a BrokeredIntegrationToken field (`accessToken`, `orgUrl`,
392
+ * `appKey`, `host`, …). */
393
+ key: 'accessToken' | 'orgUrl' | 'appKey' | 'host';
393
394
  /** Form label. */
394
395
  label: string;
395
396
  /** Example / placeholder. */
@@ -400,15 +401,35 @@ interface IntegrationApiKeyField {
400
401
  help?: string;
401
402
  }
402
403
  type IntegrationHealth = 'ok' | 'expired' | 'revoked';
403
- /** stdio MCP server spec, executed as DATA by the CLI shim (`codeam mcp-run <id>`). */
404
+ /** stdio MCP server spec, executed as DATA by the CLI shim (`codeam mcp-run <id>`).
405
+ *
406
+ * Two transports:
407
+ * - **stdio (default):** the shim spawns `command args` (with `envMapping`
408
+ * credentials in the env) and byte-pipes it to the agent.
409
+ * - **HTTP (`httpUrl` set):** the shim connects to a REMOTE MCP over
410
+ * Streamable HTTP and relays it to the agent's stdio — for vendors that only
411
+ * ship a hosted MCP (e.g. PostHog `mcp.posthog.com`). `command`/`args` are
412
+ * unused (empty); credentials go in `httpHeaders` (never `envMapping`).
413
+ */
404
414
  interface IntegrationMcpDelivery {
405
415
  command: string;
406
416
  args: string[];
407
- /** env var name → credential field (`accessToken` | `cloudId` | …). Env only, never argv. */
417
+ /** env var name → credential field (`accessToken` | `cloudId` | …). Env only, never argv. STDIO transport. */
408
418
  envMapping: Record<string, string>;
409
419
  /** Static, non-credential env the server needs to boot (e.g. mode flags).
410
- * Merged into the child env BENEATH the credential envMapping. Never secrets. */
420
+ * Merged into the child env BENEATH the credential envMapping. Never secrets. STDIO transport. */
411
421
  staticEnv?: Record<string, string>;
422
+ /** HTTP transport — a REMOTE MCP URL (Streamable HTTP). When set, the shim
423
+ * relays to it instead of spawning `command`. May carry `{field}` placeholders
424
+ * filled from the BrokeredIntegrationToken (e.g. a per-user regional host:
425
+ * `https://mcp.{host}/…`). */
426
+ httpUrl?: string;
427
+ /** HTTP transport — header name → value TEMPLATE with `{field}` placeholders
428
+ * filled from the BrokeredIntegrationToken at spawn (e.g.
429
+ * `{ Authorization: 'Bearer {accessToken}' }` or Datadog's
430
+ * `{ 'DD-API-KEY': '{accessToken}', 'DD-APPLICATION-KEY': '{appKey}' }`). The
431
+ * token stays server-side of the shim — never on argv. */
432
+ httpHeaders?: Record<string, string>;
412
433
  }
413
434
  interface IntegrationDelivery {
414
435
  mcp?: IntegrationMcpDelivery;
@@ -484,6 +505,10 @@ interface BrokeredIntegrationToken {
484
505
  * single BOT token, injected by the broker from config — the per-user
485
506
  * credential IS the guildId. Absent for non-Discord integrations. */
486
507
  guildId?: string;
508
+ /** Datadog Application key (user-scoped) — sent alongside the API key
509
+ * (`accessToken`) as the `DD-APPLICATION-KEY` header; `host` carries the
510
+ * regional site. Absent for non-Datadog integrations. */
511
+ appKey?: string;
487
512
  }
488
513
 
489
514
  /**
@@ -531,7 +556,7 @@ interface IntegrationBranding {
531
556
  logoSvg: string;
532
557
  }
533
558
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
534
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "posthog", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude", "datadog"];
559
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "clickup", "figma", "trello", "vercel", "supabase", "asana", "postman", "n8n", "stripe", "mixpanel", "pendo", "pagerduty", "amplitude"];
535
560
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
536
561
 
537
562
  /**
package/dist/index.js CHANGED
@@ -909,6 +909,98 @@ var INTEGRATION_REGISTRY = {
909
909
  }
910
910
  }
911
911
  },
912
+ posthog: {
913
+ id: "posthog",
914
+ name: "PostHog",
915
+ icon: "posthog",
916
+ category: "observability",
917
+ // LIVE — api_key: the user pastes a PostHog Personal API Key (phx_…, created
918
+ // with the "MCP Server" preset). PostHog's MCP is HOSTED-ONLY
919
+ // (mcp.posthog.com) over HTTP, and its stdio bridge (mcp-remote) forces its
920
+ // own browser OAuth — incompatible with our headless broker. So delivery
921
+ // uses the shim's HTTP transport: it relays to the hosted MCP with the key
922
+ // as a Bearer header (exactly Cursor's {url, headers} config). No OAuth, no
923
+ // GSM secret; a backend VALIDATOR proves the key + vaults it.
924
+ enabled: true,
925
+ auth: {
926
+ kind: "api_key",
927
+ fields: [
928
+ {
929
+ key: "accessToken",
930
+ label: "Personal API Key",
931
+ placeholder: "phx_xxxxxxxxxxxxxxxx",
932
+ secret: true,
933
+ help: 'PostHog \u2192 Settings \u2192 Personal API keys \u2192 create with the "MCP Server" preset (scopes it to a project).'
934
+ }
935
+ ]
936
+ },
937
+ delivery: {
938
+ mcp: {
939
+ // HTTP transport (not a spawned stdio server) — the shim relays to
940
+ // PostHog's hosted MCP with the key as a Bearer header. The key stays
941
+ // server-side of the shim, never on argv.
942
+ command: "",
943
+ args: [],
944
+ envMapping: {},
945
+ httpUrl: "https://mcp.posthog.com/mcp",
946
+ httpHeaders: { Authorization: "Bearer {accessToken}" }
947
+ }
948
+ }
949
+ },
950
+ datadog: {
951
+ id: "datadog",
952
+ name: "Datadog",
953
+ icon: "datadog",
954
+ category: "observability",
955
+ // LIVE — api_key: the user pastes a Datadog API key (org-scoped) + an
956
+ // Application key (user-scoped, grants the read scopes) + their regional
957
+ // site. Datadog's OFFICIAL hosted MCP (mcp.<site>) accepts these as headers
958
+ // headless (verified) — no OAuth, no GSM secret. Delivery uses the shim's
959
+ // HTTP transport with the site templated into the URL and both keys sent as
960
+ // DD-API-KEY / DD-APPLICATION-KEY headers.
961
+ enabled: true,
962
+ auth: {
963
+ kind: "api_key",
964
+ fields: [
965
+ {
966
+ key: "accessToken",
967
+ label: "API Key",
968
+ placeholder: "Datadog API key",
969
+ secret: true,
970
+ help: "Organization API key \u2014 Datadog \u2192 Organization Settings \u2192 API Keys."
971
+ },
972
+ {
973
+ key: "appKey",
974
+ label: "Application Key",
975
+ placeholder: "Datadog application key",
976
+ secret: true,
977
+ help: "User Application key (grants the read scopes) \u2014 Datadog \u2192 Organization Settings \u2192 Application Keys."
978
+ },
979
+ {
980
+ key: "host",
981
+ label: "Site",
982
+ placeholder: "datadoghq.com",
983
+ secret: false,
984
+ 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."
985
+ }
986
+ ]
987
+ },
988
+ delivery: {
989
+ mcp: {
990
+ // HTTP transport — the shim relays to Datadog's hosted MCP for the
991
+ // user's site, with both keys as headers. Keys stay server-side of the
992
+ // shim, never on argv.
993
+ command: "",
994
+ args: [],
995
+ envMapping: {},
996
+ httpUrl: "https://mcp.{host}/api/unstable/mcp-server/mcp",
997
+ httpHeaders: {
998
+ "DD-API-KEY": "{accessToken}",
999
+ "DD-APPLICATION-KEY": "{appKey}"
1000
+ }
1001
+ }
1002
+ }
1003
+ },
912
1004
  notion: {
913
1005
  id: "notion",
914
1006
  name: "Notion",
@@ -1313,7 +1405,6 @@ var INTEGRATION_BRANDING = {
1313
1405
  };
1314
1406
  var UPCOMING_INTEGRATION_IDS = [
1315
1407
  "gmail",
1316
- "posthog",
1317
1408
  "clickup",
1318
1409
  "figma",
1319
1410
  "trello",
@@ -1326,8 +1417,7 @@ var UPCOMING_INTEGRATION_IDS = [
1326
1417
  "mixpanel",
1327
1418
  "pendo",
1328
1419
  "pagerduty",
1329
- "amplitude",
1330
- "datadog"
1420
+ "amplitude"
1331
1421
  ];
1332
1422
  function getIntegrationBranding(id) {
1333
1423
  return INTEGRATION_BRANDING[id] ?? null;