@codeam/shared 2.61.65 → 2.61.67

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' | 'posthog' | 'datadog' | 'stitch' | 'github_issues' | 'github' | 'gitlab' | 'vercel' | 'trello' | 'clickup' | 'n8n' | 'postman' | 'mixpanel' | 'supabase' | 'confluence';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'posthog' | 'datadog' | 'stitch' | 'github_issues' | 'github' | 'gitlab' | 'vercel' | 'trello' | 'clickup' | 'n8n' | 'postman' | 'mixpanel' | 'supabase' | 'confluence' | 'cloudflare';
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
@@ -469,6 +469,18 @@ interface IntegrationDefinition {
469
469
  * resolves the credential by delegating to the source integration, and the
470
470
  * client renders it as "part of <source>" with no Connect action of its own. */
471
471
  aliasOf?: IntegrationId;
472
+ /** SECONDARY api-key / PAT path for a PRIMARY OAuth integration. OAuth
473
+ * (`kind`) stays the primary/preferred flow; this lets the user paste a
474
+ * personal access token instead — a fallback while the vendor's OAuth app
475
+ * is in review, or a permanent alternative (like GitHub OAuth + PAT).
476
+ * ⚠️ The PAT often needs a DIFFERENT delivery env var than the OAuth token
477
+ * (e.g. Figma: OAuth → `FIGMA_OAUTH_TOKEN`/Bearer, PAT →
478
+ * `FIGMA_API_KEY`/`X-Figma-Token`), so it carries its OWN `envMapping` used
479
+ * INSTEAD of `delivery.mcp.envMapping` when the credential was linked via PAT. */
480
+ apiKeyFallback?: {
481
+ fields: IntegrationApiKeyField[];
482
+ envMapping: Record<string, string>;
483
+ };
472
484
  };
473
485
  delivery: IntegrationDelivery;
474
486
  }
@@ -528,6 +540,11 @@ interface BrokeredIntegrationToken {
528
540
  secretKey?: string;
529
541
  /** Project/workspace id some analytics APIs require (Mixpanel project id). */
530
542
  projectId?: string;
543
+ /** Cloudflare account id — the Cloudflare MCP needs it alongside the OAuth
544
+ * access token (`CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_API_TOKEN`) for
545
+ * account-level operations. Captured at link time from `GET /accounts`.
546
+ * Absent for non-Cloudflare integrations. */
547
+ accountId?: string;
531
548
  }
532
549
 
533
550
  /**
@@ -575,7 +592,7 @@ interface IntegrationBranding {
575
592
  logoSvg: string;
576
593
  }
577
594
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
578
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "figma", "asana", "stripe", "pendo", "pagerduty", "amplitude"];
595
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "asana", "stripe", "pendo", "pagerduty", "amplitude"];
579
596
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
580
597
 
581
598
  /**
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' | 'posthog' | 'datadog' | 'stitch' | 'github_issues' | 'github' | 'gitlab' | 'vercel' | 'trello' | 'clickup' | 'n8n' | 'postman' | 'mixpanel' | 'supabase' | 'confluence';
354
+ type IntegrationId = 'jira' | 'sentry' | 'linear' | 'slack' | 'notion' | 'azure_devops' | 'figma' | 'microsoft_teams' | 'google_chat' | 'discord' | 'resend' | 'posthog' | 'datadog' | 'stitch' | 'github_issues' | 'github' | 'gitlab' | 'vercel' | 'trello' | 'clickup' | 'n8n' | 'postman' | 'mixpanel' | 'supabase' | 'confluence' | 'cloudflare';
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
@@ -469,6 +469,18 @@ interface IntegrationDefinition {
469
469
  * resolves the credential by delegating to the source integration, and the
470
470
  * client renders it as "part of <source>" with no Connect action of its own. */
471
471
  aliasOf?: IntegrationId;
472
+ /** SECONDARY api-key / PAT path for a PRIMARY OAuth integration. OAuth
473
+ * (`kind`) stays the primary/preferred flow; this lets the user paste a
474
+ * personal access token instead — a fallback while the vendor's OAuth app
475
+ * is in review, or a permanent alternative (like GitHub OAuth + PAT).
476
+ * ⚠️ The PAT often needs a DIFFERENT delivery env var than the OAuth token
477
+ * (e.g. Figma: OAuth → `FIGMA_OAUTH_TOKEN`/Bearer, PAT →
478
+ * `FIGMA_API_KEY`/`X-Figma-Token`), so it carries its OWN `envMapping` used
479
+ * INSTEAD of `delivery.mcp.envMapping` when the credential was linked via PAT. */
480
+ apiKeyFallback?: {
481
+ fields: IntegrationApiKeyField[];
482
+ envMapping: Record<string, string>;
483
+ };
472
484
  };
473
485
  delivery: IntegrationDelivery;
474
486
  }
@@ -528,6 +540,11 @@ interface BrokeredIntegrationToken {
528
540
  secretKey?: string;
529
541
  /** Project/workspace id some analytics APIs require (Mixpanel project id). */
530
542
  projectId?: string;
543
+ /** Cloudflare account id — the Cloudflare MCP needs it alongside the OAuth
544
+ * access token (`CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_API_TOKEN`) for
545
+ * account-level operations. Captured at link time from `GET /accounts`.
546
+ * Absent for non-Cloudflare integrations. */
547
+ accountId?: string;
531
548
  }
532
549
 
533
550
  /**
@@ -575,7 +592,7 @@ interface IntegrationBranding {
575
592
  logoSvg: string;
576
593
  }
577
594
  declare const INTEGRATION_BRANDING: Record<string, IntegrationBranding>;
578
- declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "figma", "asana", "stripe", "pendo", "pagerduty", "amplitude"];
595
+ declare const UPCOMING_INTEGRATION_IDS: readonly ["gmail", "asana", "stripe", "pendo", "pagerduty", "amplitude"];
579
596
  declare function getIntegrationBranding(id: string): IntegrationBranding | null;
580
597
 
581
598
  /**
package/dist/index.js CHANGED
@@ -1147,11 +1147,12 @@ var INTEGRATION_REGISTRY = {
1147
1147
  name: "Figma",
1148
1148
  icon: "figma",
1149
1149
  category: "design",
1150
- // DARK pending Figma's OAuth-app review approval (submitted 2026-07-16).
1151
- // Figma OAuth apps do NOT exist publicly until review passes (authorize URL
1152
- // errors "OAuth app ... doesn't exist"). Backend provider + secrets are
1153
- // already deployed; flip to true once approved (bead codeagent-m4ix).
1154
- enabled: false,
1150
+ // LIVE. OAuth is the PRIMARY flow (app pending Figma's review until it
1151
+ // passes the authorize URL errors "OAuth app doesn't exist"), so a PAT
1152
+ // fallback (`apiKeyFallback`) ships alongside it and works TODAY: the user
1153
+ // pastes a Figma personal access token. Same OAuth-primary + PAT-secondary
1154
+ // shape as GitHub. Flip of the OAuth review is transparent (bead codeagent-m4ix).
1155
+ enabled: true,
1155
1156
  auth: {
1156
1157
  kind: "oauth_redirect",
1157
1158
  // Granular READ-ONLY scopes (legacy `files:read` is deprecated for
@@ -1165,7 +1166,25 @@ var INTEGRATION_REGISTRY = {
1165
1166
  "file_metadata:read",
1166
1167
  "file_dev_resources:read",
1167
1168
  "library_content:read"
1168
- ]
1169
+ ],
1170
+ // SECONDARY: paste a Figma personal access token instead of OAuth. The
1171
+ // PAT uses the `X-Figma-Token` header, so the delivery env var differs
1172
+ // from OAuth (`FIGMA_API_KEY` vs `FIGMA_OAUTH_TOKEN`) — hence its own
1173
+ // envMapping, used when the credential was linked via PAT.
1174
+ apiKeyFallback: {
1175
+ fields: [
1176
+ {
1177
+ key: "accessToken",
1178
+ label: "Figma personal access token",
1179
+ placeholder: "figd_\u2026",
1180
+ secret: true,
1181
+ help: "Figma \u2192 Settings \u2192 Security \u2192 Personal access tokens (read-only scopes)."
1182
+ }
1183
+ ],
1184
+ envMapping: {
1185
+ FIGMA_API_KEY: "accessToken"
1186
+ }
1187
+ }
1169
1188
  },
1170
1189
  delivery: {
1171
1190
  mcp: {
@@ -1513,6 +1532,92 @@ var INTEGRATION_REGISTRY = {
1513
1532
  staticEnv: { ATLASSIAN_OAUTH_ENABLE: "true" }
1514
1533
  }
1515
1534
  }
1535
+ },
1536
+ cloudflare: {
1537
+ id: "cloudflare",
1538
+ name: "Cloudflare",
1539
+ icon: "cloudflare",
1540
+ category: "deployment",
1541
+ // LIVE — Cloudflare self-managed OAuth (dash.cloudflare.com OAuth server,
1542
+ // the same one Wrangler uses). Confidential (Client Secret POST). The agent
1543
+ // inspects/deploys Workers, Pages, DNS, KV, R2 + reads analytics/logs on the
1544
+ // user's account. CLOUDFLARE_OAUTH_CLIENT_ID/SECRET/REDIRECT_URI in Secret
1545
+ // Manager (prod+dev); the backend CloudflareOAuthProvider is config-gated (503).
1546
+ enabled: true,
1547
+ auth: {
1548
+ kind: "oauth_redirect",
1549
+ // Cloudflare OAuth scope IDs == API-token permission-group names (dot
1550
+ // form, e.g. `workers-scripts.write`). ⚠️ MUST exactly match the scopes
1551
+ // configured on the OAuth client (b2b4b87e…). `offline_access` → refresh.
1552
+ scopes: [
1553
+ // Developer Platform (Workers / Pages / KV / R2 / D1 / observability)
1554
+ "d1.read",
1555
+ "page.read",
1556
+ "page.write",
1557
+ "workers-ci.read",
1558
+ "workers-ci.write",
1559
+ "containers.read",
1560
+ "containers.write",
1561
+ "workers-kv-storage.read",
1562
+ "workers-kv-storage.write",
1563
+ "workers-observability.read",
1564
+ "workers-observability-telemetry.write",
1565
+ "workers-observability.write",
1566
+ "r2-catalog.read",
1567
+ "r2-catalog.write",
1568
+ "r2-catalog-sql.read",
1569
+ "workers-r2-bucket-item.read",
1570
+ "workers-r2-bucket-item.write",
1571
+ "workers-r2.read",
1572
+ "workers-r2.write",
1573
+ "workers-routes.read",
1574
+ "workers-routes.write",
1575
+ "workers-scripts.read",
1576
+ "workers-scripts.write",
1577
+ "workers-tail.read",
1578
+ // DNS & Zones
1579
+ "account-dns-settings.read",
1580
+ "account-dns-settings.write",
1581
+ "dns-firewall.read",
1582
+ "dns-firewall.write",
1583
+ "dns.read",
1584
+ "dns-view.read",
1585
+ "dns.write",
1586
+ "registrar-domains.admin",
1587
+ "registrar-sandbox-domains.admin",
1588
+ "zone-dns-settings.read",
1589
+ "zone-dns-settings.write",
1590
+ "zone.read",
1591
+ "zone-settings.read",
1592
+ "zone-settings.write",
1593
+ // Analytics & Logs
1594
+ "account-analytics.read",
1595
+ "analytics.read",
1596
+ "account-logs.read",
1597
+ "logs.read",
1598
+ "radar.read",
1599
+ // Account & Billing
1600
+ "account-api-gateway.read",
1601
+ "account-settings.read",
1602
+ "memberships.read",
1603
+ "notifications.read",
1604
+ "user-details.read",
1605
+ "offline_access"
1606
+ ]
1607
+ },
1608
+ delivery: {
1609
+ mcp: {
1610
+ // Headless stdio Cloudflare MCP (Cloudflare API v4) — BYO token via env,
1611
+ // the OAuth access token works as a Bearer against api.cloudflare.com.
1612
+ // The account id is the discriminator for account-level ops. PINNED.
1613
+ command: "npx",
1614
+ args: ["-y", "@itunified.io/mcp-cloudflare@2026.4.10-1"],
1615
+ envMapping: {
1616
+ CLOUDFLARE_API_TOKEN: "accessToken",
1617
+ CLOUDFLARE_ACCOUNT_ID: "accountId"
1618
+ }
1619
+ }
1620
+ }
1516
1621
  }
1517
1622
  };
1518
1623
  function getEnabledIntegrations() {
@@ -1737,6 +1842,14 @@ var INTEGRATION_BRANDING = {
1737
1842
  brandColor: "#3FCF8E",
1738
1843
  logoSvg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Supabase</title><path fill="#FFFFFF" d="M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"/></svg>'
1739
1844
  },
1845
+ cloudflare: {
1846
+ id: "cloudflare",
1847
+ name: "Cloudflare",
1848
+ vendor: "Cloudflare",
1849
+ tagline: "Workers, Pages, DNS & R2",
1850
+ brandColor: "#F6821F",
1851
+ logoSvg: '<svg role="img" viewBox="0 0 460 271.2" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><title>Cloudflare</title><path fill="#FBAD41" d="M328.6,125.6c-0.8,0-1.5,0.6-1.8,1.4l-4.8,16.7c-2.1,7.2-1.3,13.8,2.2,18.7c3.2,4.5,8.6,7.1,15.1,7.4l26.2,1.6c0.8,0,1.5,0.4,1.9,1c0.4,0.6,0.5,1.5,0.3,2.2c-0.4,1.2-1.6,2.1-2.9,2.2l-27.3,1.6c-14.8,0.7-30.7,12.6-36.3,27.2l-2,5.1c-0.4,1,0.3,2,1.4,2h93.8c1.1,0,2.1-0.7,2.4-1.8c1.6-5.8,2.5-11.9,2.5-18.2c0-37-30.2-67.2-67.3-67.2C330.9,125.5,329.7,125.5,328.6,125.6z"/><path fill="#F6821F" d="M292.8,204.4c2.1-7.2,1.3-13.8-2.2-18.7c-3.2-4.5-8.6-7.1-15.1-7.4l-123.1-1.6c-0.8,0-1.5-0.4-1.9-1s-0.5-1.4-0.3-2.2c0.4-1.2,1.6-2.1,2.9-2.2l124.2-1.6c14.7-0.7,30.7-12.6,36.3-27.2l7.1-18.5c0.3-0.8,0.4-1.6,0.2-2.4c-8-36.2-40.3-63.2-78.9-63.2c-35.6,0-65.8,23-76.6,54.9c-7-5.2-15.9-8-25.5-7.1c-17.1,1.7-30.8,15.4-32.5,32.5c-0.4,4.4-0.1,8.7,0.9,12.7c-27.9,0.8-50.2,23.6-50.2,51.7c0,2.5,0.2,5,0.5,7.5c0.2,1.2,1.2,2.1,2.4,2.1h227.2c1.3,0,2.5-0.9,2.9-2.2L292.8,204.4z"/></svg>'
1852
+ },
1740
1853
  asana: {
1741
1854
  id: "asana",
1742
1855
  name: "Asana",
@@ -1812,7 +1925,6 @@ var INTEGRATION_BRANDING = {
1812
1925
  };
1813
1926
  var UPCOMING_INTEGRATION_IDS = [
1814
1927
  "gmail",
1815
- "figma",
1816
1928
  "asana",
1817
1929
  "stripe",
1818
1930
  "pendo",