@codeam/shared 2.61.77 → 2.61.78

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,
@@ -1978,6 +1983,145 @@ function getIntegrationBranding(id) {
1978
1983
  return INTEGRATION_BRANDING[id] ?? null;
1979
1984
  }
1980
1985
 
1986
+ // src/integrations/stack-detect.ts
1987
+ var DEP_TO_INTEGRATION = {
1988
+ // errors / observability
1989
+ "@sentry/node": "sentry",
1990
+ "@sentry/react": "sentry",
1991
+ "@sentry/nextjs": "sentry",
1992
+ "@sentry/browser": "sentry",
1993
+ "sentry-sdk": "sentry",
1994
+ "dd-trace": "datadog",
1995
+ "datadog-api-client": "datadog",
1996
+ "datadog-metrics": "datadog",
1997
+ // analytics
1998
+ "posthog-js": "posthog",
1999
+ "posthog-node": "posthog",
2000
+ posthog: "posthog",
2001
+ mixpanel: "mixpanel",
2002
+ "mixpanel-browser": "mixpanel",
2003
+ // database / backend platforms
2004
+ convex: "convex",
2005
+ "@supabase/supabase-js": "supabase",
2006
+ "supabase": "supabase",
2007
+ // infra / deploy
2008
+ vercel: "vercel",
2009
+ "@vercel/node": "vercel",
2010
+ wrangler: "cloudflare",
2011
+ // comms
2012
+ "@slack/web-api": "slack",
2013
+ "@slack/bolt": "slack",
2014
+ "discord.js": "discord",
2015
+ "discord-py": "discord",
2016
+ "discord": "discord",
2017
+ // trackers / docs / design
2018
+ "@linear/sdk": "linear",
2019
+ "@notionhq/client": "notion",
2020
+ "jira.js": "jira",
2021
+ jira: "jira",
2022
+ newman: "postman",
2023
+ "figma-api": "figma",
2024
+ "figma-js": "figma",
2025
+ // email / automation
2026
+ resend: "resend",
2027
+ n8n: "n8n"
2028
+ };
2029
+ var DEP_PREFIX_TO_INTEGRATION = [
2030
+ ["@sentry/", "sentry"],
2031
+ ["@vercel/", "vercel"],
2032
+ ["@cloudflare/", "cloudflare"],
2033
+ ["@supabase/", "supabase"],
2034
+ ["@slack/", "slack"],
2035
+ ["@datadog/", "datadog"],
2036
+ ["@linear/", "linear"],
2037
+ ["@notionhq/", "notion"]
2038
+ ];
2039
+ var FRONTEND_MARKERS = [
2040
+ "react",
2041
+ "react-dom",
2042
+ "next",
2043
+ "vue",
2044
+ "nuxt",
2045
+ "@angular/core",
2046
+ "svelte",
2047
+ "@sveltejs/kit",
2048
+ "solid-js",
2049
+ "astro",
2050
+ "gatsby",
2051
+ "remix",
2052
+ "@remix-run/react"
2053
+ ];
2054
+ var MOBILE_MARKERS = ["react-native", "expo", "@react-native/core", "@ionic/core", "flutter"];
2055
+ var BACKEND_MARKERS = [
2056
+ "express",
2057
+ "fastify",
2058
+ "@nestjs/core",
2059
+ "koa",
2060
+ "@hapi/hapi",
2061
+ "django",
2062
+ "flask",
2063
+ "fastapi",
2064
+ "rails",
2065
+ "sinatra",
2066
+ "gin-gonic",
2067
+ "laravel/framework",
2068
+ "actix-web",
2069
+ "spring-boot"
2070
+ ];
2071
+ function hasAny(deps, markers) {
2072
+ for (const m of markers) if (deps.has(m)) return true;
2073
+ return false;
2074
+ }
2075
+ function classifyStack(depNames) {
2076
+ const deps = new Set(depNames);
2077
+ const mobile = hasAny(deps, MOBILE_MARKERS);
2078
+ if (mobile) return "mobile";
2079
+ const frontend = hasAny(deps, FRONTEND_MARKERS);
2080
+ const backend = hasAny(deps, BACKEND_MARKERS);
2081
+ if (frontend && backend) return "fullstack";
2082
+ if (frontend) return "frontend";
2083
+ if (backend) return "backend";
2084
+ return "unknown";
2085
+ }
2086
+ function detectedIntegrationsFromDeps(depNames) {
2087
+ const out = [];
2088
+ const seen = /* @__PURE__ */ new Set();
2089
+ const push = (id) => {
2090
+ if (!seen.has(id)) {
2091
+ seen.add(id);
2092
+ out.push(id);
2093
+ }
2094
+ };
2095
+ for (const name of depNames) {
2096
+ const exact = DEP_TO_INTEGRATION[name];
2097
+ if (exact) {
2098
+ push(exact);
2099
+ continue;
2100
+ }
2101
+ for (const [prefix, id] of DEP_PREFIX_TO_INTEGRATION) {
2102
+ if (name.startsWith(prefix)) {
2103
+ push(id);
2104
+ break;
2105
+ }
2106
+ }
2107
+ }
2108
+ return out;
2109
+ }
2110
+ var STACK_TO_RECOMMENDED = {
2111
+ frontend: ["figma", "sentry", "posthog", "vercel"],
2112
+ backend: ["sentry", "datadog", "supabase", "convex", "cloudflare"],
2113
+ fullstack: ["sentry", "posthog", "vercel", "supabase", "convex"],
2114
+ mobile: ["sentry", "posthog"],
2115
+ unknown: []
2116
+ };
2117
+ function recommendForDeps(depNames) {
2118
+ const stack = classifyStack(depNames);
2119
+ const detected = detectedIntegrationsFromDeps(depNames);
2120
+ const detectedSet = new Set(detected);
2121
+ const recommended = STACK_TO_RECOMMENDED[stack].filter((id) => !detectedSet.has(id));
2122
+ return { stack, detected, recommended, source: "scan" };
2123
+ }
2124
+
1981
2125
  // src/skills/code-review.ts
1982
2126
  var CODE_REVIEW_BODY = `Use this skill when reviewing a pull request. It defines what a high-signal
1983
2127
  review looks like so your inline comments are worth the author's time.
@@ -2412,6 +2556,14 @@ var USER_EVENTS = {
2412
2556
  INTEGRATION_LINKED: "integration_linked",
2413
2557
  INTEGRATION_UNLINKED: "integration_unlinked",
2414
2558
  INTEGRATION_CREDENTIAL_INVALID: "integration_credential_invalid",
2559
+ // Session Tools — add/remove Agent Toolkit integrations on an ALREADY-ACTIVE
2560
+ // session. The backend publishes SESSION_INTEGRATIONS_CHANGED after it persists
2561
+ // the new attached set + relays `integrations_sync` to the box (the CLI rewrites
2562
+ // the manifest + reprovisions the live agent, answered synchronously via the
2563
+ // command result). Drives live UI on the sending device AND any other paired
2564
+ // device on the same session. Mirrored in repo A. (`integrations_detect` is a
2565
+ // pure request/response over the relay — no event.)
2566
+ SESSION_INTEGRATIONS_CHANGED: "session_integrations_changed",
2415
2567
  // CodeRabbit reviewer — the CLI posts these to /api/coderabbit/events; the
2416
2568
  // backend re-publishes them on the per-user SSE bus (mirrored in repo A).
2417
2569
  CODERABBIT_PROGRESS: "coderabbit_progress",
@@ -2478,6 +2630,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2478
2630
  0 && (module.exports = {
2479
2631
  AGENT_REGISTRY,
2480
2632
  DEFAULT_API_BASE_URL,
2633
+ DEP_TO_INTEGRATION,
2481
2634
  DEV_API_BASE_URL,
2482
2635
  HEADROOM_BACKEND_ENV,
2483
2636
  HEADROOM_EXTRAS_BY_SURFACE,
@@ -2502,10 +2655,13 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2502
2655
  PUBLIC_TO_INTERNAL,
2503
2656
  SKILL_REGISTRY,
2504
2657
  SSE_SOCKET_TIMEOUT_MS,
2658
+ STACK_TO_RECOMMENDED,
2505
2659
  TERMINAL_AGENT_PREFIX,
2506
2660
  UNKNOWN_MODEL_PRICING,
2507
2661
  UPCOMING_INTEGRATION_IDS,
2508
2662
  USER_EVENTS,
2663
+ classifyStack,
2664
+ detectedIntegrationsFromDeps,
2509
2665
  getAgent,
2510
2666
  getContextWindow,
2511
2667
  getEnabledAgents,
@@ -2528,6 +2684,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2528
2684
  isSkillId,
2529
2685
  normalizeAgentId,
2530
2686
  publicToInternal,
2687
+ recommendForDeps,
2531
2688
  renderToLines,
2532
2689
  resolveApiBaseUrl,
2533
2690
  skillHasRail,