@codeam/shared 2.61.77 → 2.61.79

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
@@ -720,6 +720,35 @@ interface AgentReviewReport {
720
720
  findings?: AgentReviewFinding[];
721
721
  }
722
722
 
723
+ type RepoStack = 'frontend' | 'backend' | 'fullstack' | 'mobile' | 'unknown';
724
+ /** The Session Tools stack-detection result (wire type, carried by the
725
+ * SESSION_STACK_DETECTED event). `source` distinguishes the deterministic
726
+ * dependency scan from the agent one-shot fallback. */
727
+ interface RepoStackDetection {
728
+ stack: RepoStack;
729
+ /** Integrations the repo's dependencies directly evidence (high confidence). */
730
+ detected: IntegrationId[];
731
+ /** Integrations commonly paired with the classified stack, minus `detected`. */
732
+ recommended: IntegrationId[];
733
+ source: 'scan' | 'agent';
734
+ }
735
+ /** Exact dependency name → integration (across ecosystems: npm, pip, go, gem…). */
736
+ declare const DEP_TO_INTEGRATION: Record<string, IntegrationId>;
737
+ /** Classify the repo stack from its dependency NAMES. */
738
+ declare function classifyStack(depNames: string[]): RepoStack;
739
+ /** Integrations directly evidenced by the repo's dependencies (deduped, stable order). */
740
+ declare function detectedIntegrationsFromDeps(depNames: string[]): IntegrationId[];
741
+ /** Commonly-paired integrations per classified stack (the curated inference layer). */
742
+ declare const STACK_TO_RECOMMENDED: Record<RepoStack, IntegrationId[]>;
743
+ /**
744
+ * The deterministic core of Session Tools "Recommended": classify the stack and
745
+ * combine direct-evidence detections with stack inference. `recommended`
746
+ * excludes anything already `detected`. Returns `source:'scan'`. When both
747
+ * `detected` and `recommended` are empty (unrecognized stack), the CLI falls
748
+ * back to the agent one-shot (B).
749
+ */
750
+ declare function recommendForDeps(depNames: string[]): RepoStackDetection;
751
+
723
752
  /** Curated skills shipped with the client. Grows over time. */
724
753
  type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development' | 'code-naming';
725
754
  /** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
@@ -1571,6 +1600,7 @@ declare const USER_EVENTS: {
1571
1600
  readonly INTEGRATION_LINKED: "integration_linked";
1572
1601
  readonly INTEGRATION_UNLINKED: "integration_unlinked";
1573
1602
  readonly INTEGRATION_CREDENTIAL_INVALID: "integration_credential_invalid";
1603
+ readonly SESSION_INTEGRATIONS_CHANGED: "session_integrations_changed";
1574
1604
  readonly CODERABBIT_PROGRESS: "coderabbit_progress";
1575
1605
  readonly CODERABBIT_STATUS: "coderabbit_status";
1576
1606
  readonly CODERABBIT_REVIEW: "coderabbit_review";
@@ -1595,4 +1625,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
1595
1625
  */
1596
1626
  declare const PREVIEW_DETECT_PROMPT: string;
1597
1627
 
1598
- export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
1628
+ export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
package/dist/index.d.ts CHANGED
@@ -720,6 +720,35 @@ interface AgentReviewReport {
720
720
  findings?: AgentReviewFinding[];
721
721
  }
722
722
 
723
+ type RepoStack = 'frontend' | 'backend' | 'fullstack' | 'mobile' | 'unknown';
724
+ /** The Session Tools stack-detection result (wire type, carried by the
725
+ * SESSION_STACK_DETECTED event). `source` distinguishes the deterministic
726
+ * dependency scan from the agent one-shot fallback. */
727
+ interface RepoStackDetection {
728
+ stack: RepoStack;
729
+ /** Integrations the repo's dependencies directly evidence (high confidence). */
730
+ detected: IntegrationId[];
731
+ /** Integrations commonly paired with the classified stack, minus `detected`. */
732
+ recommended: IntegrationId[];
733
+ source: 'scan' | 'agent';
734
+ }
735
+ /** Exact dependency name → integration (across ecosystems: npm, pip, go, gem…). */
736
+ declare const DEP_TO_INTEGRATION: Record<string, IntegrationId>;
737
+ /** Classify the repo stack from its dependency NAMES. */
738
+ declare function classifyStack(depNames: string[]): RepoStack;
739
+ /** Integrations directly evidenced by the repo's dependencies (deduped, stable order). */
740
+ declare function detectedIntegrationsFromDeps(depNames: string[]): IntegrationId[];
741
+ /** Commonly-paired integrations per classified stack (the curated inference layer). */
742
+ declare const STACK_TO_RECOMMENDED: Record<RepoStack, IntegrationId[]>;
743
+ /**
744
+ * The deterministic core of Session Tools "Recommended": classify the stack and
745
+ * combine direct-evidence detections with stack inference. `recommended`
746
+ * excludes anything already `detected`. Returns `source:'scan'`. When both
747
+ * `detected` and `recommended` are empty (unrecognized stack), the CLI falls
748
+ * back to the agent one-shot (B).
749
+ */
750
+ declare function recommendForDeps(depNames: string[]): RepoStackDetection;
751
+
723
752
  /** Curated skills shipped with the client. Grows over time. */
724
753
  type SkillId = 'code-review' | 'resolve-conflicts' | 'spec-driven-development' | 'code-naming';
725
754
  /** Delivery rails, twin of IntegrationDelivery's mcp/cliEnv. */
@@ -1571,6 +1600,7 @@ declare const USER_EVENTS: {
1571
1600
  readonly INTEGRATION_LINKED: "integration_linked";
1572
1601
  readonly INTEGRATION_UNLINKED: "integration_unlinked";
1573
1602
  readonly INTEGRATION_CREDENTIAL_INVALID: "integration_credential_invalid";
1603
+ readonly SESSION_INTEGRATIONS_CHANGED: "session_integrations_changed";
1574
1604
  readonly CODERABBIT_PROGRESS: "coderabbit_progress";
1575
1605
  readonly CODERABBIT_STATUS: "coderabbit_status";
1576
1606
  readonly CODERABBIT_REVIEW: "coderabbit_review";
@@ -1595,4 +1625,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
1595
1625
  */
1596
1626
  declare const PREVIEW_DETECT_PROMPT: string;
1597
1627
 
1598
- export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
1628
+ export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AGENT_REGISTRY: () => AGENT_REGISTRY,
24
24
  DEFAULT_API_BASE_URL: () => DEFAULT_API_BASE_URL,
25
+ DEP_TO_INTEGRATION: () => DEP_TO_INTEGRATION,
25
26
  DEV_API_BASE_URL: () => DEV_API_BASE_URL,
26
27
  HEADROOM_BACKEND_ENV: () => HEADROOM_BACKEND_ENV,
27
28
  HEADROOM_EXTRAS_BY_SURFACE: () => HEADROOM_EXTRAS_BY_SURFACE,
@@ -46,10 +47,13 @@ __export(index_exports, {
46
47
  PUBLIC_TO_INTERNAL: () => PUBLIC_TO_INTERNAL,
47
48
  SKILL_REGISTRY: () => SKILL_REGISTRY,
48
49
  SSE_SOCKET_TIMEOUT_MS: () => SSE_SOCKET_TIMEOUT_MS,
50
+ STACK_TO_RECOMMENDED: () => STACK_TO_RECOMMENDED,
49
51
  TERMINAL_AGENT_PREFIX: () => TERMINAL_AGENT_PREFIX,
50
52
  UNKNOWN_MODEL_PRICING: () => UNKNOWN_MODEL_PRICING,
51
53
  UPCOMING_INTEGRATION_IDS: () => UPCOMING_INTEGRATION_IDS,
52
54
  USER_EVENTS: () => USER_EVENTS,
55
+ classifyStack: () => classifyStack,
56
+ detectedIntegrationsFromDeps: () => detectedIntegrationsFromDeps,
53
57
  getAgent: () => getAgent,
54
58
  getContextWindow: () => getContextWindow,
55
59
  getEnabledAgents: () => getEnabledAgents,
@@ -72,6 +76,7 @@ __export(index_exports, {
72
76
  isSkillId: () => isSkillId,
73
77
  normalizeAgentId: () => normalizeAgentId,
74
78
  publicToInternal: () => publicToInternal,
79
+ recommendForDeps: () => recommendForDeps,
75
80
  renderToLines: () => renderToLines,
76
81
  resolveApiBaseUrl: () => resolveApiBaseUrl,
77
82
  skillHasRail: () => skillHasRail,
@@ -1510,28 +1515,34 @@ var INTEGRATION_REGISTRY = {
1510
1515
  name: "Convex",
1511
1516
  icon: "convex",
1512
1517
  category: "database",
1513
- // LIVE — OAuth 2.0 (authorization code, Confidential). authorize
1514
- // dashboard.convex.dev/oauth/authorize/team (the scope is the URL PATH
1515
- // `team` for team-wide accessNOT a query param); token
1516
- // api.convex.dev/oauth/token (form-urlencoded, client creds in the BODY).
1517
- // ⚠️ Convex issues NO refresh token and the team-scoped application token
1518
- // does not expire, so there is nothing to rotate (refresh() is a re-link
1519
- // surface). The OAuth app (Team Settings OAuth Applications) is registered
1520
- // and CONVEX_OAUTH_CLIENT_ID/SECRET/REDIRECT_URI are in Secret Manager
1521
- // (prod+dev); the config-gated 503 keeps this safe mid-rollout.
1518
+ // LIVE — api_key rail (the user pastes a Convex DEPLOY KEY).
1519
+ // ⚠️ Convex's OAuth application token was tried first and DOES NOT WORK with
1520
+ // the MCP: it's a narrow Management-API credentialverified live it fails
1521
+ // `convex mcp start` as BOTH CONVEX_DEPLOY_KEY and CONVEX_OVERRIDE_ACCESS_TOKEN,
1522
+ // and can't even enumerate the team's deployments ("requires a Personal
1523
+ // Access Token"). The Convex MCP's DOCUMENTED headless credential is a
1524
+ // DEPLOY KEY (CONVEX_DEPLOY_KEY=dev:…|… / prod:… / project:…), so the user
1525
+ // pastes one (Convex Dashboard Project Settings → Deploy Keys), exactly
1526
+ // like Azure DevOps / Datadog / Trello. No OAuth app, no GSM secret.
1522
1527
  enabled: true,
1523
1528
  auth: {
1524
- kind: "oauth_redirect",
1525
- // ⚠️ Convex's scope is the authorize URL path (`/team`), NOT sent in the
1526
- // authorize URL as a query param — this list is informational.
1527
- scopes: []
1529
+ kind: "api_key",
1530
+ fields: [
1531
+ {
1532
+ key: "accessToken",
1533
+ label: "Convex deploy key",
1534
+ placeholder: "prod:happy-animal-123|eyJ2\u2026",
1535
+ secret: true,
1536
+ help: "Convex Dashboard \u2192 Project Settings \u2192 Deploy Keys \u2192 Generate a deploy key."
1537
+ }
1538
+ ]
1528
1539
  },
1529
1540
  delivery: {
1530
1541
  mcp: {
1531
1542
  // Convex's OFFICIAL MCP server ships inside the `convex` npm package
1532
- // (`convex mcp start`). The team-scoped OAuth application token doubles
1533
- // as the CLI/MCP deploy key fed via CONVEX_DEPLOY_KEY (env only, never
1534
- // argv). Version PINNED; bump only after re-verifying headless.
1543
+ // (`convex mcp start`). The pasted deploy key is fed via CONVEX_DEPLOY_KEY
1544
+ // (env only, never argv) its documented non-interactive credential.
1545
+ // Version PINNED; bump only after re-verifying headless.
1535
1546
  command: "npx",
1536
1547
  args: ["-y", "convex@1.42.3", "mcp", "start"],
1537
1548
  envMapping: {
@@ -1978,6 +1989,145 @@ function getIntegrationBranding(id) {
1978
1989
  return INTEGRATION_BRANDING[id] ?? null;
1979
1990
  }
1980
1991
 
1992
+ // src/integrations/stack-detect.ts
1993
+ var DEP_TO_INTEGRATION = {
1994
+ // errors / observability
1995
+ "@sentry/node": "sentry",
1996
+ "@sentry/react": "sentry",
1997
+ "@sentry/nextjs": "sentry",
1998
+ "@sentry/browser": "sentry",
1999
+ "sentry-sdk": "sentry",
2000
+ "dd-trace": "datadog",
2001
+ "datadog-api-client": "datadog",
2002
+ "datadog-metrics": "datadog",
2003
+ // analytics
2004
+ "posthog-js": "posthog",
2005
+ "posthog-node": "posthog",
2006
+ posthog: "posthog",
2007
+ mixpanel: "mixpanel",
2008
+ "mixpanel-browser": "mixpanel",
2009
+ // database / backend platforms
2010
+ convex: "convex",
2011
+ "@supabase/supabase-js": "supabase",
2012
+ "supabase": "supabase",
2013
+ // infra / deploy
2014
+ vercel: "vercel",
2015
+ "@vercel/node": "vercel",
2016
+ wrangler: "cloudflare",
2017
+ // comms
2018
+ "@slack/web-api": "slack",
2019
+ "@slack/bolt": "slack",
2020
+ "discord.js": "discord",
2021
+ "discord-py": "discord",
2022
+ "discord": "discord",
2023
+ // trackers / docs / design
2024
+ "@linear/sdk": "linear",
2025
+ "@notionhq/client": "notion",
2026
+ "jira.js": "jira",
2027
+ jira: "jira",
2028
+ newman: "postman",
2029
+ "figma-api": "figma",
2030
+ "figma-js": "figma",
2031
+ // email / automation
2032
+ resend: "resend",
2033
+ n8n: "n8n"
2034
+ };
2035
+ var DEP_PREFIX_TO_INTEGRATION = [
2036
+ ["@sentry/", "sentry"],
2037
+ ["@vercel/", "vercel"],
2038
+ ["@cloudflare/", "cloudflare"],
2039
+ ["@supabase/", "supabase"],
2040
+ ["@slack/", "slack"],
2041
+ ["@datadog/", "datadog"],
2042
+ ["@linear/", "linear"],
2043
+ ["@notionhq/", "notion"]
2044
+ ];
2045
+ var FRONTEND_MARKERS = [
2046
+ "react",
2047
+ "react-dom",
2048
+ "next",
2049
+ "vue",
2050
+ "nuxt",
2051
+ "@angular/core",
2052
+ "svelte",
2053
+ "@sveltejs/kit",
2054
+ "solid-js",
2055
+ "astro",
2056
+ "gatsby",
2057
+ "remix",
2058
+ "@remix-run/react"
2059
+ ];
2060
+ var MOBILE_MARKERS = ["react-native", "expo", "@react-native/core", "@ionic/core", "flutter"];
2061
+ var BACKEND_MARKERS = [
2062
+ "express",
2063
+ "fastify",
2064
+ "@nestjs/core",
2065
+ "koa",
2066
+ "@hapi/hapi",
2067
+ "django",
2068
+ "flask",
2069
+ "fastapi",
2070
+ "rails",
2071
+ "sinatra",
2072
+ "gin-gonic",
2073
+ "laravel/framework",
2074
+ "actix-web",
2075
+ "spring-boot"
2076
+ ];
2077
+ function hasAny(deps, markers) {
2078
+ for (const m of markers) if (deps.has(m)) return true;
2079
+ return false;
2080
+ }
2081
+ function classifyStack(depNames) {
2082
+ const deps = new Set(depNames);
2083
+ const mobile = hasAny(deps, MOBILE_MARKERS);
2084
+ if (mobile) return "mobile";
2085
+ const frontend = hasAny(deps, FRONTEND_MARKERS);
2086
+ const backend = hasAny(deps, BACKEND_MARKERS);
2087
+ if (frontend && backend) return "fullstack";
2088
+ if (frontend) return "frontend";
2089
+ if (backend) return "backend";
2090
+ return "unknown";
2091
+ }
2092
+ function detectedIntegrationsFromDeps(depNames) {
2093
+ const out = [];
2094
+ const seen = /* @__PURE__ */ new Set();
2095
+ const push = (id) => {
2096
+ if (!seen.has(id)) {
2097
+ seen.add(id);
2098
+ out.push(id);
2099
+ }
2100
+ };
2101
+ for (const name of depNames) {
2102
+ const exact = DEP_TO_INTEGRATION[name];
2103
+ if (exact) {
2104
+ push(exact);
2105
+ continue;
2106
+ }
2107
+ for (const [prefix, id] of DEP_PREFIX_TO_INTEGRATION) {
2108
+ if (name.startsWith(prefix)) {
2109
+ push(id);
2110
+ break;
2111
+ }
2112
+ }
2113
+ }
2114
+ return out;
2115
+ }
2116
+ var STACK_TO_RECOMMENDED = {
2117
+ frontend: ["figma", "sentry", "posthog", "vercel"],
2118
+ backend: ["sentry", "datadog", "supabase", "convex", "cloudflare"],
2119
+ fullstack: ["sentry", "posthog", "vercel", "supabase", "convex"],
2120
+ mobile: ["sentry", "posthog"],
2121
+ unknown: []
2122
+ };
2123
+ function recommendForDeps(depNames) {
2124
+ const stack = classifyStack(depNames);
2125
+ const detected = detectedIntegrationsFromDeps(depNames);
2126
+ const detectedSet = new Set(detected);
2127
+ const recommended = STACK_TO_RECOMMENDED[stack].filter((id) => !detectedSet.has(id));
2128
+ return { stack, detected, recommended, source: "scan" };
2129
+ }
2130
+
1981
2131
  // src/skills/code-review.ts
1982
2132
  var CODE_REVIEW_BODY = `Use this skill when reviewing a pull request. It defines what a high-signal
1983
2133
  review looks like so your inline comments are worth the author's time.
@@ -2412,6 +2562,14 @@ var USER_EVENTS = {
2412
2562
  INTEGRATION_LINKED: "integration_linked",
2413
2563
  INTEGRATION_UNLINKED: "integration_unlinked",
2414
2564
  INTEGRATION_CREDENTIAL_INVALID: "integration_credential_invalid",
2565
+ // Session Tools — add/remove Agent Toolkit integrations on an ALREADY-ACTIVE
2566
+ // session. The backend publishes SESSION_INTEGRATIONS_CHANGED after it persists
2567
+ // the new attached set + relays `integrations_sync` to the box (the CLI rewrites
2568
+ // the manifest + reprovisions the live agent, answered synchronously via the
2569
+ // command result). Drives live UI on the sending device AND any other paired
2570
+ // device on the same session. Mirrored in repo A. (`integrations_detect` is a
2571
+ // pure request/response over the relay — no event.)
2572
+ SESSION_INTEGRATIONS_CHANGED: "session_integrations_changed",
2415
2573
  // CodeRabbit reviewer — the CLI posts these to /api/coderabbit/events; the
2416
2574
  // backend re-publishes them on the per-user SSE bus (mirrored in repo A).
2417
2575
  CODERABBIT_PROGRESS: "coderabbit_progress",
@@ -2478,6 +2636,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2478
2636
  0 && (module.exports = {
2479
2637
  AGENT_REGISTRY,
2480
2638
  DEFAULT_API_BASE_URL,
2639
+ DEP_TO_INTEGRATION,
2481
2640
  DEV_API_BASE_URL,
2482
2641
  HEADROOM_BACKEND_ENV,
2483
2642
  HEADROOM_EXTRAS_BY_SURFACE,
@@ -2502,10 +2661,13 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2502
2661
  PUBLIC_TO_INTERNAL,
2503
2662
  SKILL_REGISTRY,
2504
2663
  SSE_SOCKET_TIMEOUT_MS,
2664
+ STACK_TO_RECOMMENDED,
2505
2665
  TERMINAL_AGENT_PREFIX,
2506
2666
  UNKNOWN_MODEL_PRICING,
2507
2667
  UPCOMING_INTEGRATION_IDS,
2508
2668
  USER_EVENTS,
2669
+ classifyStack,
2670
+ detectedIntegrationsFromDeps,
2509
2671
  getAgent,
2510
2672
  getContextWindow,
2511
2673
  getEnabledAgents,
@@ -2528,6 +2690,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2528
2690
  isSkillId,
2529
2691
  normalizeAgentId,
2530
2692
  publicToInternal,
2693
+ recommendForDeps,
2531
2694
  renderToLines,
2532
2695
  resolveApiBaseUrl,
2533
2696
  skillHasRail,