@codeam/shared 2.61.76 → 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
@@ -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' | 'cloudflare';
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' | 'convex' | '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
@@ -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
@@ -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' | 'cloudflare';
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' | 'convex' | '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
@@ -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,
@@ -1505,6 +1510,41 @@ var INTEGRATION_REGISTRY = {
1505
1510
  }
1506
1511
  }
1507
1512
  },
1513
+ convex: {
1514
+ id: "convex",
1515
+ name: "Convex",
1516
+ icon: "convex",
1517
+ category: "database",
1518
+ // LIVE — OAuth 2.0 (authorization code, Confidential). authorize
1519
+ // dashboard.convex.dev/oauth/authorize/team (the scope is the URL PATH —
1520
+ // `team` for team-wide access — NOT a query param); token
1521
+ // api.convex.dev/oauth/token (form-urlencoded, client creds in the BODY).
1522
+ // ⚠️ Convex issues NO refresh token and the team-scoped application token
1523
+ // does not expire, so there is nothing to rotate (refresh() is a re-link
1524
+ // surface). The OAuth app (Team Settings → OAuth Applications) is registered
1525
+ // and CONVEX_OAUTH_CLIENT_ID/SECRET/REDIRECT_URI are in Secret Manager
1526
+ // (prod+dev); the config-gated 503 keeps this safe mid-rollout.
1527
+ enabled: true,
1528
+ auth: {
1529
+ kind: "oauth_redirect",
1530
+ // ⚠️ Convex's scope is the authorize URL path (`/team`), NOT sent in the
1531
+ // authorize URL as a query param — this list is informational.
1532
+ scopes: []
1533
+ },
1534
+ delivery: {
1535
+ mcp: {
1536
+ // Convex's OFFICIAL MCP server ships inside the `convex` npm package
1537
+ // (`convex mcp start`). The team-scoped OAuth application token doubles
1538
+ // as the CLI/MCP deploy key → fed via CONVEX_DEPLOY_KEY (env only, never
1539
+ // argv). Version PINNED; bump only after re-verifying headless.
1540
+ command: "npx",
1541
+ args: ["-y", "convex@1.42.3", "mcp", "start"],
1542
+ envMapping: {
1543
+ CONVEX_DEPLOY_KEY: "accessToken"
1544
+ }
1545
+ }
1546
+ }
1547
+ },
1508
1548
  confluence: {
1509
1549
  id: "confluence",
1510
1550
  name: "Confluence",
@@ -1842,6 +1882,14 @@ var INTEGRATION_BRANDING = {
1842
1882
  brandColor: "#3FCF8E",
1843
1883
  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>'
1844
1884
  },
1885
+ convex: {
1886
+ id: "convex",
1887
+ name: "Convex",
1888
+ vendor: "Convex",
1889
+ tagline: "Reactive database & backend",
1890
+ brandColor: "#EE342F",
1891
+ logoSvg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Convex</title><path fill="#FFFFFF" d="M15.09 18.916c3.488-.387 6.776-2.246 8.586-5.348-.857 7.673-9.247 12.522-16.095 9.545a3.47 3.47 0 0 1-1.547-1.314c-1.539-2.417-2.044-5.492-1.318-8.282 2.077 3.584 6.3 5.78 10.374 5.399m-10.501-7.65c-1.414 3.266-1.475 7.092.258 10.24-6.1-4.59-6.033-14.41-.074-18.953a3.44 3.44 0 0 1 1.893-.707c2.825-.15 5.695.942 7.708 2.977-4.09.04-8.073 2.66-9.785 6.442m11.757-5.437C14.283 2.951 11.053.992 7.515.933c6.84-3.105 15.253 1.929 16.17 9.37a3.6 3.6 0 0 1-.334 2.02c-1.278 2.594-3.647 4.607-6.416 5.352 2.029-3.763 1.778-8.36-.589-11.847"/></svg>'
1892
+ },
1845
1893
  cloudflare: {
1846
1894
  id: "cloudflare",
1847
1895
  name: "Cloudflare",
@@ -1935,6 +1983,145 @@ function getIntegrationBranding(id) {
1935
1983
  return INTEGRATION_BRANDING[id] ?? null;
1936
1984
  }
1937
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
+
1938
2125
  // src/skills/code-review.ts
1939
2126
  var CODE_REVIEW_BODY = `Use this skill when reviewing a pull request. It defines what a high-signal
1940
2127
  review looks like so your inline comments are worth the author's time.
@@ -2369,6 +2556,14 @@ var USER_EVENTS = {
2369
2556
  INTEGRATION_LINKED: "integration_linked",
2370
2557
  INTEGRATION_UNLINKED: "integration_unlinked",
2371
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",
2372
2567
  // CodeRabbit reviewer — the CLI posts these to /api/coderabbit/events; the
2373
2568
  // backend re-publishes them on the per-user SSE bus (mirrored in repo A).
2374
2569
  CODERABBIT_PROGRESS: "coderabbit_progress",
@@ -2435,6 +2630,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2435
2630
  0 && (module.exports = {
2436
2631
  AGENT_REGISTRY,
2437
2632
  DEFAULT_API_BASE_URL,
2633
+ DEP_TO_INTEGRATION,
2438
2634
  DEV_API_BASE_URL,
2439
2635
  HEADROOM_BACKEND_ENV,
2440
2636
  HEADROOM_EXTRAS_BY_SURFACE,
@@ -2459,10 +2655,13 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2459
2655
  PUBLIC_TO_INTERNAL,
2460
2656
  SKILL_REGISTRY,
2461
2657
  SSE_SOCKET_TIMEOUT_MS,
2658
+ STACK_TO_RECOMMENDED,
2462
2659
  TERMINAL_AGENT_PREFIX,
2463
2660
  UNKNOWN_MODEL_PRICING,
2464
2661
  UPCOMING_INTEGRATION_IDS,
2465
2662
  USER_EVENTS,
2663
+ classifyStack,
2664
+ detectedIntegrationsFromDeps,
2466
2665
  getAgent,
2467
2666
  getContextWindow,
2468
2667
  getEnabledAgents,
@@ -2485,6 +2684,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
2485
2684
  isSkillId,
2486
2685
  normalizeAgentId,
2487
2686
  publicToInternal,
2687
+ recommendForDeps,
2488
2688
  renderToLines,
2489
2689
  resolveApiBaseUrl,
2490
2690
  skillHasRail,