:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(signals): add a per-scout mcp tool picker behind a flag (#115826)
posthog[bot]4a13a473a767
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 0861dcb4e996..6db341f17541 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -11918,6 +11918,14 @@ snapshots:hash: v1.k794b7964.b993087e480fc1db681058fc86f14bf1320b761a28da857e794cce6af50b0b99.-nJybLR6PljBiMrTrLZm0x-iWWMqIJHWFKWMe3JQqFIscenes-app-inbox-scoutsuggestionsstrip--uneven-motivations--light:hash: v1.k794b7964.507bd34c3dfd17859203839ee2b48fde2356feeb39c5ea68a85111e81bde3653.BAUoWqxWUpZedEPIrw8_XyDM2Gpe1d49RqS76agw8H8+ scenes-app-inbox-scouttoolspicker--new-list--dark:+ hash: v1.k794b7964.18bf48eade276601c7783528df0fc84ac717e8c0739f52406747aefede33677e.8-nhlqAAYOP5pI-v0HfM8URoqmlVVUdPVQ2bE53MTSM+ scenes-app-inbox-scouttoolspicker--new-list--light:+ hash: v1.k794b7964.0a0606a1bf64b6caa050f6c7a5d718b0df423ec14d6bc860e34b5275ff49c9fe.Yvd6rtUmpfIRts4ZVQuHdo1j3Ya1Ww21N-6KLyD0npM+ scenes-app-inbox-scouttoolspicker--saved-list-with-write-tools--dark:+ hash: v1.k794b7964.19657b3ef3e0fc42aebbc4b011084746616956255c4c06cc9d5c3be853959119.sac8-fP5Ovs2x8H9ipt-ylomHEfr9OxJeRrBCWwihmE+ scenes-app-inbox-scouttoolspicker--saved-list-with-write-tools--light:+ hash: v1.k794b7964.165566360be802cd5609b351f4aaafe0d2ca753fc54eb27289d215a730d2d39b.gr4y0M7qOIGmgB7zeGrLUUHOwynreveUI4yerlVwCYYscenes-app-inbox-scoutwriteaccesstag--compact--dark:hash: v1.k794b7964.449b1898c216f12c6a62f2c0a1544ce814cdc7e4d519c69287d686e8b9a90b79.yXNYamE5tvB24QXwyniqxYtd3IAlRpo-RoLspp9zOKQscenes-app-inbox-scoutwriteaccesstag--compact--light:diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex a5b2e09e4863..14319940a753 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -244,6 +244,7 @@ export const FEATURE_FLAGS = {REPLAY_SETTINGS_HELP: 'replay-settings-help', // owner: @veryayskiy #team-replaySCOUT_TRIALS: 'scout-trials', // owner: #team-self-driving, gates new trial and judging requests; saved results remain readableSCOUTS_MODEL_CONFIG: 'scouts-model-config', // owner: #team-self-driving, gates the per-scout model pin in the inbox scout settings (also checked server-side)+ SCOUTS_TOOL_ACCESS: 'scouts-tool-access', // owner: #team-self-driving, gates the per-scout MCP tool list in the inbox scout settings (also checked server-side)SELF_DRIVING_FREE_TRIAL: 'self-driving-free-trial', // owner: #team-self-driving, the org is on a Self-driving free trial: reports only, no pull requests (also checked server-side)SELF_DRIVING_QUOTA_ENFORCEMENT: 'self-driving-quota-enforcement', // owner: #team-self-driving, gates self-driving PR-limit enforcement (also checked server-side)SELF_OPTIMISING_WORKFLOWS: 'self-optimising-workflows', // owner: #team-workflows, gates agent-suggested workflow changes (also checked server-side)diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsxindex 0599d4d82ecc..b42b1a83e544 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx@@ -40,6 +40,7 @@ import { ScoutRepositoriesPicker } from './ScoutRepositoriesPicker'import { ScoutSlackDestination } from './ScoutSlackDestination'import { ScoutStructuredOutputSection } from './ScoutStructuredOutputSection'import { ScoutTagsEditor } from './ScoutTagsEditor'+import { ScoutToolsSection } from './ScoutToolsSection'import { ScoutWriteAccessSection } from './ScoutWriteAccessSection'interface ScoutConfigControlsProps {@@ -385,6 +386,7 @@ export function ScoutConfigForm({updating={updating}onUnsavedChange={setSchemaUnsaved}/>+ <ScoutToolsSection config={config} onUpdate={onUpdate} updating={updating} surface={surface} /><ScoutWriteAccessSection config={config} onUpdate={onUpdate} updating={updating} />{/* Only custom scouts are deletable. A canonical scout would be re-seeded from disk afterdeletion (and couldn't be re-added from the UI), so its terminal action stays disable. */}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsxindex 00029e393a8a..53e46c53d738 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutNameCell.tsx@@ -8,6 +8,7 @@ import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signalsimport { ScoutGroupKey, scoutSubtitle } from '../../../utils/scoutGroups'import { scoutDisplayName, ScoutRollup } from '../../../utils/scoutRunsWindow'import { ScoutExemptionBadge } from './ScoutBadges'+import { ScoutToolsTag } from './ScoutToolsTag'import { ScoutWriteAccessTag } from './ScoutWriteAccessTag'const SUBTITLE_TONE_CLASS = {@@ -36,6 +37,7 @@ export function ScoutNameCell({{scoutDisplayName(config)}</Link><ScoutWriteAccessTag writeScopes={config.write_scopes} emit={config.emit} compact={compact} />+ <ScoutToolsTag allowedTools={config.allowed_mcp_tools} compact={compact} /><ScoutExemptionBadge config={config} group={group} /></div>{subtitle && (diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsxindex 2edb032c8cde..8dcdcaee82c7 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutRosterCard.tsx@@ -18,6 +18,7 @@ import { ScoutCostLine } from './ScoutCostLine'import { ScoutNextRunLabel } from './ScoutNextRunLabel'import { ScoutRosterRunBoxes } from './ScoutRosterRunBoxes'import { ScoutStatusDot } from './ScoutStatusDot'+import { ScoutToolsTag } from './ScoutToolsTag'import { ScoutWriteAccessTag } from './ScoutWriteAccessTag'const SUBTITLE_TONE_CLASS = {@@ -69,6 +70,7 @@ export const ScoutRosterCard = memo(function ScoutRosterCard({ row }: { row: Sco{scoutDisplayName(config)}</span><ScoutWriteAccessTag writeScopes={config.write_scopes} emit={config.emit} />+ <ScoutToolsTag allowedTools={config.allowed_mcp_tools} /><ScoutExemptionBadge config={config} group={group} /><ScoutLifecycleBadge config={config} /><ScoutDeprecationBadge config={config} />diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.stories.tsxnew file mode 100644index 000000000000..e3f1c7c6e8cd--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.stories.tsx@@ -0,0 +1,34 @@+import type { Meta, StoryObj } from '@storybook/react'++import { mswDecorator } from '~/mocks/browser'++import { SCOUT_TOOL_CATALOGUE } from './scoutToolFixtures'+import { ScoutToolsPicker } from './ScoutToolsPicker'++const meta: Meta<typeof ScoutToolsPicker> = {+ title: 'Scenes-App/Inbox/ScoutToolsPicker',+ component: ScoutToolsPicker,+ args: { scoutName: 'Dashboard hygiene', savedTools: null, onSave: () => {}, onClose: () => {} },+ parameters: {+ layout: 'fullscreen',+ testOptions: { waitForLoadersToDisappear: true },+ },+ decorators: [+ mswDecorator({+ get: {+ '/api/projects/:team_id/signals/scout/configs/tool_catalogue/': () => [200, SCOUT_TOOL_CATALOGUE],+ },+ }),+ ],+}+export default meta++type Story = StoryObj<typeof ScoutToolsPicker>++/** A scout that can call every tool, about to get its first list. The write access panel reads "Read only". */+export const NewList: Story = {}++/** A saved list with write tools, so the panel names the write access the list gives. */+export const SavedListWithWriteTools: Story = {+ args: { savedTools: ['dashboard-get', 'dashboard-update', 'insight-create', 'insight-get'] },+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.tsxnew file mode 100644index 000000000000..f8374dbd7b87--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsPicker.tsx@@ -0,0 +1,245 @@+import { useMountedLogic, useActions, useValues } from 'kea'+import { useState } from 'react'++import { IconCheck } from '@posthog/icons'+import { LemonButton, LemonCheckbox, LemonInput, LemonModal, LemonTag, Spinner } from '@posthog/lemon-ui'++import type { ScoutToolCatalogueApi, ToolPresetEnumApi } from 'products/signals/frontend/generated/api.schemas'++import { scoutToolCatalogueLogic } from '../../../logics/scoutToolCatalogueLogic'+import {+ deriveScoutToolWriteScopes,+ groupScoutTools,+ runContextScoutToolLabels,+ scoutToolUnavailableReason,+ selectableScoutTools,+} from './scoutTools'+import { scoutWriteScopeLabels } from './scoutWriteScopes'++/** What a save sends. Never `write_scopes`: the API derives those from the list. */+export type ScoutToolsSelection = { allowed_mcp_tools: string[] } | { tool_preset: ToolPresetEnumApi }++interface ScoutToolsPickerProps {+ scoutName: string+ /** The saved list, or null when the scout may call every tool. */+ savedTools: readonly string[] | null+ onSave: (selection: ScoutToolsSelection) => void+ onClose: () => void+}++/**+ * Picks the MCP tools one scout may call. The draft stays here until the save button, because a+ * list with write tools widens what an unattended agent can change in the project.+ */+export function ScoutToolsPicker({ scoutName, savedTools, onSave, onClose }: ScoutToolsPickerProps): JSX.Element {+ useMountedLogic(scoutToolCatalogueLogic)+ const { catalogue, catalogueLoading, catalogueFailed } = useValues(scoutToolCatalogueLogic)+ const { loadCatalogue } = useActions(scoutToolCatalogueLogic)+ const [selected, setSelected] = useState<string[]>([...(savedTools ?? [])])+ // Set only while the draft is exactly a preset someone picked, so the save names the preset.+ const [preset, setPreset] = useState<ToolPresetEnumApi | null>(null)+ const edited = preset !== null || [...selected].sort().join() !== [...(savedTools ?? [])].sort().join()+ // Moving from all tools to a list is a change even when the list is still empty.+ const changed = edited || savedTools === null++ let body: JSX.Element+ if (catalogue) {+ body = (+ <ToolCatalogueBody+ catalogue={catalogue}+ selected={selected}+ preset={preset}+ onChange={(tools, nextPreset = null) => {+ setSelected(tools)+ setPreset(nextPreset)+ }}+ />+ )+ } else if (catalogueFailed) {+ body = (+ <div className="flex flex-col items-start gap-2 rounded border border-dashed px-3 py-3">+ <span className="text-sm">+ Couldn't load the tool list. Try again, or close this and come back later.+ </span>+ <LemonButton size="small" type="secondary" onClick={loadCatalogue} loading={catalogueLoading}>+ Try again+ </LemonButton>+ </div>+ )+ } else {+ body = (+ <div className="flex items-center gap-2 rounded border border-dashed px-3 py-4 text-sm text-secondary">+ <Spinner /> Loading tools...+ </div>+ )+ }++ return (+ <LemonModal+ isOpen+ onClose={onClose}+ title={`Tools for ${scoutName}`}+ description="Choose the tools this scout can call. It can't call any other tool."+ width={640}+ hasUnsavedInput={edited}+ footer={+ <>+ <LemonButton type="secondary" onClick={onClose}>+ Cancel+ </LemonButton>+ <LemonButton+ type="primary"+ disabledReason={!catalogue ? 'Loading tools' : !changed ? 'No changes to save' : undefined}+ onClick={() => {+ onSave(preset ? { tool_preset: preset } : { allowed_mcp_tools: [...selected].sort() })+ }}+ data-attr="scout-tools-save"+ >+ Save tools+ </LemonButton>+ </>+ }+ >+ {body}+ </LemonModal>+ )+}++function ToolCatalogueBody({+ catalogue,+ selected,+ preset,+ onChange,+}: {+ catalogue: ScoutToolCatalogueApi+ selected: string[]+ preset: ToolPresetEnumApi | null+ onChange: (tools: string[], preset?: ToolPresetEnumApi | null) => void+}): JSX.Element {+ const [search, setSearch] = useState('')+ const groups = groupScoutTools(catalogue, search)+ const selectable = new Set(selectableScoutTools(catalogue).map((tool) => tool.name))+ const alwaysHeld = runContextScoutToolLabels(catalogue)+ const writeScopes = deriveScoutToolWriteScopes(catalogue, selected)+ const toggle = (name: string, checked: boolean): void => {+ onChange(checked ? [...selected, name] : selected.filter((tool) => tool !== name))+ }++ return (+ <div className="flex flex-col gap-3">+ <div className="flex flex-wrap items-center gap-2">+ <span className="text-xs text-secondary">Start from</span>+ {catalogue.tool_presets.map((option) => (+ <LemonButton+ key={option.name}+ size="xsmall"+ type="secondary"+ active={preset === option.name}+ onClick={() =>+ onChange(+ option.tools.filter((tool) => selectable.has(tool)),+ option.name as ToolPresetEnumApi+ )+ }+ data-attr={`scout-tools-preset-${option.name}`}+ >+ {option.label}+ </LemonButton>+ ))}+ <LemonButton+ size="xsmall"+ type="tertiary"+ disabledReason={selected.length === 0 ? 'No tools chosen' : undefined}+ onClick={() => onChange([])}+ >+ Clear+ </LemonButton>+ </div>+ <LemonInput+ type="search"+ size="small"+ placeholder="Search tools"+ value={search}+ onChange={setSearch}+ fullWidth+ autoFocus+ />+ <div className="flex max-h-[50vh] flex-col gap-3 overflow-y-auto pr-1">+ {groups.length === 0 ? (+ <span className="text-sm text-secondary">No tools match "{search}". Try another search.</span>+ ) : (+ groups.map((group) => (+ <div key={group.category} className="flex flex-col gap-1">+ <div className="flex items-baseline justify-between gap-2">+ <span className="text-[11px] font-medium uppercase tracking-wide text-muted">+ {group.category}+ </span>+ <span className="shrink-0 text-[11px] text-muted">+ {group.tools.filter((tool) => selected.includes(tool.name)).length} of{' '}+ {group.tools.length}+ </span>+ </div>+ {group.tools.map((tool) => (+ <div key={tool.name} className="flex items-start justify-between gap-2">+ <LemonCheckbox+ className="min-w-0"+ checked={selected.includes(tool.name)}+ onChange={(checked) => toggle(tool.name, checked)}+ disabledReason={scoutToolUnavailableReason(tool)}+ label={+ <span className="flex min-w-0 flex-col">+ <span className="text-sm">{tool.title}</span>+ <span className="line-clamp-2 text-xs text-secondary">+ {tool.summary}+ </span>+ </span>+ }+ />+ <LemonTag size="small" type={tool.is_read_only ? 'muted' : 'warning'}>+ {tool.is_read_only ? 'Read' : 'Write'}+ </LemonTag>+ </div>+ ))}+ </div>+ ))+ )}+ <div className="flex flex-col gap-1">+ <span className="text-[11px] font-medium uppercase tracking-wide text-muted">Always available</span>+ <span className="text-xs text-secondary">+ Every scout run can use these to report findings and keep its memory.+ </span>+ <div className="flex flex-wrap gap-1">+ {alwaysHeld.map((label) => (+ <LemonTag key={label} size="small" type="muted" icon={<IconCheck />}>+ {label}+ </LemonTag>+ ))}+ </div>+ </div>+ </div>+ <div className="flex flex-col gap-1 rounded border border-primary bg-surface-secondary px-3 py-2">+ <span className="text-xs font-medium">Write access from this list</span>+ {writeScopes.length === 0 ? (+ <span className="text-xs text-secondary">+ Read only. The scout can still write notebooks, its findings, and its memory.+ </span>+ ) : (+ <>+ <div className="flex flex-wrap gap-1">+ {writeScopes+ .map((scope) => scoutWriteScopeLabels([scope])[0] ?? scope)+ .map((label) => (+ <LemonTag key={label} size="small" type="option">+ {label}+ </LemonTag>+ ))}+ </div>+ <span className="text-xs text-secondary">+ Each one covers every object of its kind in the project, not only the ones the scout makes.+ </span>+ </>+ )}+ </div>+ </div>+ )+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.test.tsxnew file mode 100644index 000000000000..5dceba7bb5ad--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.test.tsx@@ -0,0 +1,87 @@+import '@testing-library/jest-dom'++import { cleanup, fireEvent, render, screen } from '@testing-library/react'++import { FEATURE_FLAGS } from 'lib/constants'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'++import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'++import type { SignalScoutConfigApi } from 'products/signals/frontend/generated/api.schemas'++import { mockScoutConfigs } from '../../../__mocks__/scoutConfigs'+import { SCOUT_TOOL_CATALOGUE } from './scoutToolFixtures'+import { ScoutToolsSection } from './ScoutToolsSection'++describe('ScoutToolsSection', () => {+ beforeEach(() => {+ localStorage.clear()+ useMocks({+ get: {+ '/api/projects/:team_id/signals/scout/configs/tool_catalogue/': () => [200, SCOUT_TOOL_CATALOGUE],+ },+ })+ initKeaTests()+ featureFlagLogic.mount()+ featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.SCOUTS_TOOL_ACCESS], {+ [FEATURE_FLAGS.SCOUTS_TOOL_ACCESS]: true,+ })+ })+ afterEach(cleanup)++ const renderSection = (overrides: Partial<SignalScoutConfigApi> = {}): jest.Mock => {+ const onUpdate = jest.fn()+ render(+ <ScoutToolsSection+ config={{ ...mockScoutConfigs[0], id: 'config-1', ...overrides }}+ onUpdate={onUpdate}+ surface="scout_detail"+ />+ )+ return onUpdate+ }++ it('opens the picker without saving when someone chooses a tool list', async () => {+ // Saving an empty list here would cut the scout off from every tool before anyone picked one.+ const onUpdate = renderSection()++ fireEvent.click(screen.getByText('Chosen tools'))++ expect(await screen.findByText('Get insight')).toBeInTheDocument()+ expect(onUpdate).not.toHaveBeenCalled()+ })++ it.each([+ ['an unchanged preset', ['Read only'], { tool_preset: 'read_only' }],+ [+ 'a preset with a tool added',+ ['Read only', 'Create insight'],+ { allowed_mcp_tools: ['dashboard-get', 'insight-create', 'insight-get'] },+ ],+ ['a hand-picked list', ['Update dashboard'], { allowed_mcp_tools: ['dashboard-update'] }],+ ])('saves %s as a tool selection with no write scopes', async (_name, clicks, expected) => {+ // The API rejects `write_scopes` next to a tool selection, so the save must carry only one.+ const onUpdate = renderSection()+ fireEvent.click(screen.getByText('Chosen tools'))+ await screen.findByText('Get insight')++ for (const label of clicks) {+ fireEvent.click(screen.getByText(label))+ }+ fireEvent.click(screen.getByText('Save tools'))++ expect(onUpdate).toHaveBeenCalledWith('config-1', expected)+ })++ it('keeps an unavailable tool off the list', async () => {+ const onUpdate = renderSection({ allowed_mcp_tools: ['insight-get'] })+ fireEvent.click(screen.getByText('Edit tools'))+ await screen.findByText('Delete feature flag')++ fireEvent.click(screen.getByText('Delete feature flag'))+ fireEvent.click(screen.getByText('Save tools'))++ expect(onUpdate).not.toHaveBeenCalled()+ })+})diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.tsxnew file mode 100644index 000000000000..fef455b2065f--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsSection.tsx@@ -0,0 +1,119 @@+import { useValues } from 'kea'+import { useState } from 'react'++import { LemonButton, LemonDialog, LemonSegmentedButton } from '@posthog/lemon-ui'++import { FEATURE_FLAGS } from 'lib/constants'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'++import type {+ PatchedSignalScoutConfigUpdateApi as SignalScoutConfigUpdate,+ SignalScoutConfigApi as SignalScoutConfig,+} from 'products/signals/frontend/generated/api.schemas'++import { captureScoutToolsPickerOpened, type ScoutSurface } from '../../../inboxAnalytics'+import { scoutDisplayName } from '../../../utils/scoutRunsWindow'+import { ScoutToolsPicker } from './ScoutToolsPicker'++type ScoutToolsMode = 'all' | 'list'++/**+ * Which MCP tools one scout may call: every tool, or a chosen list. "All tools" saves+ * `allowed_mcp_tools: null`. A list is picked and saved in {@link ScoutToolsPicker}, so choosing the+ * list mode only opens the picker.+ */+export function ScoutToolsSection({+ config,+ onUpdate,+ updating = false,+ surface,+}: {+ config: SignalScoutConfig+ onUpdate: (configId: string, updates: SignalScoutConfigUpdate) => void+ updating?: boolean+ surface: ScoutSurface+}): JSX.Element | null {+ const { featureFlags } = useValues(featureFlagLogic)+ const [pickerOpen, setPickerOpen] = useState(false)+ if (!featureFlags[FEATURE_FLAGS.SCOUTS_TOOL_ACCESS]) {+ return null+ }++ const savedTools = config.allowed_mcp_tools ?? null+ const mode: ScoutToolsMode = savedTools === null ? 'all' : 'list'+ const disabledReason = updating ? 'Saving scout settings' : undefined+ const openPicker = (): void => {+ captureScoutToolsPickerOpened({ skillName: config.skill_name, surface, hasToolList: savedTools !== null })+ setPickerOpen(true)+ }+ const confirmAllTools = (): void => {+ LemonDialog.open({+ title: 'Let this scout call every tool?',+ description:+ 'The scout can call every tool its write access allows. Its current write access stays as it is.',+ primaryButton: {+ children: 'Allow all tools',+ onClick: () => onUpdate(config.id, { allowed_mcp_tools: null }),+ },+ secondaryButton: { children: 'Cancel' },+ })+ }++ return (+ <div className="flex flex-col gap-2 border-t border-primary pt-2">+ <div className="flex flex-wrap items-center justify-between gap-2">+ <div className="flex min-w-0 flex-col">+ <span className="text-xs text-default">Tools</span>+ <span className="text-[11.5px] text-muted">+ {savedTools === null+ ? 'This scout can call every tool.'+ : `This scout can call ${savedTools.length} chosen ${savedTools.length === 1 ? 'tool' : 'tools'}.`}+ </span>+ </div>+ <div className="flex items-center gap-2">+ {savedTools !== null && (+ <LemonButton+ size="small"+ type="secondary"+ onClick={openPicker}+ disabledReason={disabledReason}+ data-attr="scout-tools-edit"+ >+ Edit tools+ </LemonButton>+ )}+ <LemonSegmentedButton<ScoutToolsMode>+ size="small"+ value={mode}+ disabledReason={disabledReason}+ onChange={(next) => {+ if (next === mode) {+ return+ }+ if (next === 'list') {+ openPicker()+ } else {+ confirmAllTools()+ }+ }}+ options={[+ { value: 'all', label: 'All tools', 'data-attr': 'scout-tools-mode-all' },+ { value: 'list', label: 'Chosen tools', 'data-attr': 'scout-tools-mode-list' },+ ]}+ />+ </div>+ </div>+ {pickerOpen && (+ <ScoutToolsPicker+ scoutName={scoutDisplayName(config)}+ savedTools={savedTools}+ onClose={() => setPickerOpen(false)}+ onSave={(selection) => {+ onUpdate(config.id, selection)+ setPickerOpen(false)+ }}+ />+ )}+ </div>+ )+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutToolsTag.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsTag.tsxnew file mode 100644index 000000000000..e9df4b426db7--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutToolsTag.tsx@@ -0,0 +1,34 @@+import { useValues } from 'kea'++import { IconWrench } from '@posthog/icons'+import { LemonTag, Tooltip } from '@posthog/lemon-ui'++import { FEATURE_FLAGS } from 'lib/constants'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'++/**+ * Marks a scout limited to a chosen tool list. A scout that can call every tool gets no tag, because+ * that is the default.+ */+export function ScoutToolsTag({+ allowedTools,+ compact = false,+}: {+ /** The scout's `allowed_mcp_tools`. Null means every tool. */+ allowedTools: readonly string[] | null | undefined+ /** Icon only, for a row too narrow to carry the label. The tooltip still gives the count. */+ compact?: boolean+}): JSX.Element | null {+ const { featureFlags } = useValues(featureFlagLogic)+ if (!featureFlags[FEATURE_FLAGS.SCOUTS_TOOL_ACCESS] || allowedTools == null) {+ return null+ }+ const label = `${allowedTools.length} ${allowedTools.length === 1 ? 'tool' : 'tools'}`+ return (+ <Tooltip title={`This scout can call only its ${label} chosen in settings, plus its built-in run tools`}>+ <LemonTag size="small" type="muted" icon={<IconWrench />} data-attr="scout-tools-tag">+ {compact ? null : label}+ </LemonTag>+ </Tooltip>+ )+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsxindex 9d846ad1ef0a..ee1157367334 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.test.tsx@@ -98,4 +98,19 @@ describe('ScoutWriteAccessSection', () => {fireEvent.click(screen.getByText('Save write access'))expect(onUpdate).toHaveBeenCalledWith('config-1', { write_scopes: ['dashboard:write'] })})+ it('shows write access read-only when a tool list sets it', () => {+ // The API rejects a `write_scopes` change on a scout with a tool list, so no save may be offered.+ const onUpdate = jest.fn()+ render(+ <ScoutWriteAccessSection+ config={{ ...CONFIG, write_scopes: ['insight:write'], allowed_mcp_tools: ['insight-create'] }}+ onUpdate={onUpdate}+ />+ )+ fireEvent.click(screen.getByText('Write access'))++ fireEvent.click(screen.getByLabelText('Let this scout write dashboards'))+ expect(screen.queryByText('Save write access')).not.toBeInTheDocument()+ expect(onUpdate).not.toHaveBeenCalled()+ })})diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.tsxindex 3ee28431ffc9..77cd6cd03922 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutWriteAccessSection.tsx@@ -21,6 +21,9 @@ import { ScoutWriteScopesPicker } from './ScoutWriteScopesPicker'* The switches stay live for everyone. Only the person the scout's runs act as or a project admin* may save, and the client cannot resolve the former, so the API refuses and its message names who* can.+ *+ * A scout with a tool list gets its write access from that list, and the API rejects a+ * `write_scopes` change on it, so the section only shows what the list grants.*/export function ScoutWriteAccessSection({config,@@ -38,7 +41,12 @@ export function ScoutWriteAccessSection({const selected = draft ?? savedconst changed = [...selected].sort().join() !== [...saved].sort().join()const heldLabels = scoutWriteScopeLabels(saved)- const disabledReason = updating ? 'Saving scout settings' : undefined+ const fromToolList = config.allowed_mcp_tools != null+ const disabledReason = fromToolList+ ? "Write access comes from this scout's tool list"+ : updating+ ? 'Saving scout settings'+ : undefinedreturn (<div className="border-t border-primary pt-2">@@ -70,27 +78,36 @@ export function ScoutWriteAccessSection({),content: (<div className="flex flex-col gap-2">+ {fromToolList && (+ <p className="text-[11.5px] text-muted mb-0">+ This scout's tool list sets its write access. Edit the tools to change it.+ </p>+ )}<ScoutWriteScopesPickercompactselectedScopes={selected}onChange={setDraft}disabledReason={disabledReason}/>- <div className="flex justify-end">- <LemonButton- size="small"- type="secondary"- loading={updating}- disabledReason={disabledReason ?? (changed ? undefined : 'No changes to save')}- onClick={() => {- onUpdate(config.id, { write_scopes: selected })- setDraft(null)- }}- data-attr="scout-write-access-save"- >- Save write access- </LemonButton>- </div>+ {!fromToolList && (+ <div className="flex justify-end">+ <LemonButton+ size="small"+ type="secondary"+ loading={updating}+ disabledReason={+ disabledReason ?? (changed ? undefined : 'No changes to save')+ }+ onClick={() => {+ onUpdate(config.id, { write_scopes: selected })+ setDraft(null)+ }}+ data-attr="scout-write-access-save"+ >+ Save write access+ </LemonButton>+ </div>+ )}</div>),},diff --git a/products/signals/frontend/inbox/components/config/scouts/scoutToolFixtures.ts b/products/signals/frontend/inbox/components/config/scouts/scoutToolFixtures.tsnew file mode 100644index 000000000000..675803fbf01a--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/scoutToolFixtures.ts@@ -0,0 +1,67 @@+import type { ScoutToolCatalogueApi, ScoutToolCatalogueEntryApi } from 'products/signals/frontend/generated/api.schemas'++function tool(+ name: string,+ title: string,+ category: string,+ overrides: Partial<ScoutToolCatalogueEntryApi> = {}+): ScoutToolCatalogueEntryApi {+ return {+ name,+ title,+ summary: `${title} in this project.`,+ category,+ feature: category.toLowerCase().replace(/ /g, '_'),+ required_scopes: [],+ is_read_only: true,+ requires_ai_consent: false,+ holdable: true,+ missing_scopes: [],+ feature_flag: null,+ feature_flag_behavior: null,+ feature_flag_variant: null,+ hidden_when_flag_on: null,+ feature_entitlement: null,+ ...overrides,+ }+}++/** A small catalogue with read, write, unavailable, and run context tools, for tests and stories. */+export const SCOUT_TOOL_CATALOGUE: ScoutToolCatalogueApi = {+ tools: [+ tool('dashboard-get', 'Get dashboard', 'Dashboards', { required_scopes: ['dashboard:read'] }),+ tool('dashboard-update', 'Update dashboard', 'Dashboards', {+ required_scopes: ['dashboard:write'],+ is_read_only: false,+ missing_scopes: ['dashboard:write'],+ }),+ tool('insight-get', 'Get insight', 'Product analytics', { required_scopes: ['insight:read'] }),+ tool('insight-create', 'Create insight', 'Product analytics', {+ required_scopes: ['insight:write', 'query:read'],+ is_read_only: false,+ missing_scopes: ['insight:write'],+ }),+ tool('conversations-tickets-notes-create', 'Add a private ticket note', 'Support', {+ required_scopes: ['ticket:write'],+ is_read_only: false,+ }),+ tool('feature-flag-delete', 'Delete feature flag', 'Feature flags', {+ required_scopes: ['feature_flag:write'],+ is_read_only: false,+ holdable: false,+ missing_scopes: ['feature_flag:write'],+ }),+ tool('scout-emit-report', 'Emit report', 'Scouts'),+ tool('scout-notes-list', 'List scout notes', 'Scouts'),+ ],+ tool_presets: [+ { name: 'read_only', label: 'Read only', tools: ['dashboard-get', 'insight-get'] },+ {+ name: 'support_notes',+ label: 'Support notes',+ tools: ['conversations-tickets-notes-create', 'dashboard-get', 'insight-get'],+ },+ ],+ presets: [],+ grantable_write_scopes: ['dashboard:write', 'insight:write'],+}diff --git a/products/signals/frontend/inbox/components/config/scouts/scoutTools.test.ts b/products/signals/frontend/inbox/components/config/scouts/scoutTools.test.tsnew file mode 100644index 000000000000..25349a2b3676--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/scoutTools.test.ts@@ -0,0 +1,25 @@+import { SCOUT_TOOL_CATALOGUE } from './scoutToolFixtures'+import { deriveScoutToolWriteScopes, groupScoutTools } from './scoutTools'++describe('scoutTools', () => {+ it.each([+ ['read tools only', ['dashboard-get', 'insight-get'], []],+ // `query:read` rides along on a write tool but is not a grant, so it must not show as write access.+ ['a write tool with a read scope too', ['insight-create'], ['insight:write']],+ // `ticket:write` is not grantable, so the API drops it from the derived scopes.+ ['a write tool outside the grantable set', ['conversations-tickets-notes-create'], []],+ ['two write tools', ['insight-create', 'dashboard-update'], ['dashboard:write', 'insight:write']],+ ])('derives the write access the API saves, for %s', (_name, selected, expected) => {+ expect(deriveScoutToolWriteScopes(SCOUT_TOOL_CATALOGUE, selected)).toEqual(expected)+ })++ it.each([+ ['', ['Dashboards', 'Feature flags', 'Product analytics', 'Support']],+ ['insight', ['Product analytics']],+ ['DASHBOARD', ['Dashboards']],+ // The run context tools are always held, so a search never offers them as choices.+ ['scout', []],+ ])('groups the selectable tools for search %p', (search, categories) => {+ expect(groupScoutTools(SCOUT_TOOL_CATALOGUE, search).map((group) => group.category)).toEqual(categories)+ })+})diff --git a/products/signals/frontend/inbox/components/config/scouts/scoutTools.ts b/products/signals/frontend/inbox/components/config/scouts/scoutTools.tsnew file mode 100644index 000000000000..9188573fd928--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/scoutTools.ts@@ -0,0 +1,83 @@+import type { ScoutToolCatalogueApi, ScoutToolCatalogueEntryApi } from 'products/signals/frontend/generated/api.schemas'++/**+ * The tools every scout run holds whatever its list says, mirroring `SCOUT_RUN_CONTEXT_TOOLS` in+ * `products/signals/backend/scout_harness/tool_catalogue.py`. The API rejects a list that names one,+ * so the picker shows them apart and never sends them.+ */+export const SCOUT_RUN_CONTEXT_TOOLS: readonly string[] = [+ 'scout-emit-report',+ 'scout-edit-report',+ 'scout-emit-signal',+ 'scout-scratchpad-search',+ 'scout-scratchpad-remember',+ 'scout-scratchpad-forget',+ 'scout-notes-list',+ 'scout-metadata-get',+ 'scout-project-profile-get',+ 'scout-record-output',+ 'scout-check-record-result',+]++export interface ScoutToolGroup {+ category: string+ tools: ScoutToolCatalogueEntryApi[]+}++/** Why a tool cannot go on a list, or undefined when it can. */+export function scoutToolUnavailableReason(tool: ScoutToolCatalogueEntryApi): string | undefined {+ return tool.holdable ? undefined : 'No scout can hold the access this tool needs'+}++/** The catalogue tools a list can name: everything except the run context tools. */+export function selectableScoutTools(catalogue: ScoutToolCatalogueApi): ScoutToolCatalogueEntryApi[] {+ return catalogue.tools.filter((tool) => !SCOUT_RUN_CONTEXT_TOOLS.includes(tool.name))+}++/** Labels for the run context tools, for the always-held group. A tool the catalogue lacks shows its name. */+export function runContextScoutToolLabels(catalogue: ScoutToolCatalogueApi): string[] {+ return SCOUT_RUN_CONTEXT_TOOLS.map((name) => catalogue.tools.find((tool) => tool.name === name)?.title || name)+}++/**+ * Selectable tools grouped by category, narrowed to the ones whose name, title, summary, or category+ * contains the search text. Groups and tools are in alphabetical order.+ */+export function groupScoutTools(catalogue: ScoutToolCatalogueApi, search: string): ScoutToolGroup[] {+ const needle = search.trim().toLowerCase()+ const matches = selectableScoutTools(catalogue).filter(+ (tool) =>+ !needle ||+ [tool.name, tool.title, tool.summary, tool.category].some((text) => text.toLowerCase().includes(needle))+ )+ const byCategory = new Map<string, ScoutToolCatalogueEntryApi[]>()+ for (const tool of matches) {+ byCategory.set(tool.category, [...(byCategory.get(tool.category) ?? []), tool])+ }+ return [...byCategory.entries()]+ .sort(([a], [b]) => a.localeCompare(b))+ .map(([category, tools]) => ({+ category,+ tools: [...tools].sort((a, b) => a.title.localeCompare(b.title)),+ }))+}++/**+ * The write scopes a saved list gives the scout. Mirrors the derivation in+ * `_resolve_scout_config_grants` in `products/signals/backend/scout_harness/views.py`: the required+ * scopes of each chosen write tool, limited to the scopes a person can grant.+ */+export function deriveScoutToolWriteScopes(catalogue: ScoutToolCatalogueApi, selected: readonly string[]): string[] {+ const derived = new Set<string>()+ for (const tool of catalogue.tools) {+ if (tool.is_read_only || !selected.includes(tool.name)) {+ continue+ }+ for (const scope of tool.required_scopes) {+ if (catalogue.grantable_write_scopes.includes(scope)) {+ derived.add(scope)+ }+ }+ }+ return [...derived].sort()+}diff --git a/products/signals/frontend/inbox/inboxAnalytics.ts b/products/signals/frontend/inbox/inboxAnalytics.tsindex 3bc8d19d88f7..fd96b48ffaed 100644--- a/products/signals/frontend/inbox/inboxAnalytics.ts+++ b/products/signals/frontend/inbox/inboxAnalytics.ts@@ -64,6 +64,10 @@ export const INBOX_EVENTS = {SCOUT_CONFIG_CHANGED: 'Scout config changed',SCOUT_ACTION: 'Scout action',SCOUT_CHAT_STARTED: 'Scout chat started',+ // The per-scout tool picker. Cloud-only for now, like the suggestions strip below.+ SCOUT_TOOLS_PICKER_OPENED: 'Scout tools picker opened',+ SCOUT_TOOLS_SAVED: 'Scout tools saved',+ SCOUT_TOOLS_SAVE_FAILED: 'Scout tools save failed',// The pre-computed "Suggested for this project" strip. Cloud-only for now — desktop has no// suggestions surface — so these carry `inbox_client: 'cloud'` on every row.SCOUT_SUGGESTIONS_SHOWN: 'Scout suggestions shown',@@ -1052,6 +1056,38 @@ export function captureScoutConfigChanged(params: {})}+/** The tool picker opened. `has_tool_list` says whether the scout already had a list. */+export function captureScoutToolsPickerOpened(params: {+ skillName: string+ surface: ScoutSurface+ hasToolList: boolean+}): void {+ captureInboxEvent(INBOX_EVENTS.SCOUT_TOOLS_PICKER_OPENED, {+ skill_name: params.skillName,+ surface: params.surface,+ has_tool_list: params.hasToolList,+ })+}++/**+ * A tool selection save ended. The event carries counts, not tool names. `tool_count` is null for a+ * preset, which the API expands, and for a return to all tools.+ */+export function captureScoutToolsSaveResult(params: {+ skillName: string+ allTools: boolean+ toolPreset: string | null+ toolCount: number | null+ success: boolean+}): void {+ captureInboxEvent(params.success ? INBOX_EVENTS.SCOUT_TOOLS_SAVED : INBOX_EVENTS.SCOUT_TOOLS_SAVE_FAILED, {+ skill_name: params.skillName,+ all_tools: params.allTools,+ tool_preset: params.toolPreset,+ tool_count: params.toolCount,+ })+}+/** Any non-config interaction on the scout surfaces — expanding a run, copying a link, opening a skill. */export function captureScoutAction(params: {actionType: ScoutActionTypediff --git a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.tsindex 367000202c4e..ce815a61c7d1 100644--- a/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts+++ b/products/signals/frontend/inbox/logics/scoutFleetLogic.test.ts@@ -214,6 +214,31 @@ describe('scoutFleetLogic', () => {expect(logic.values.updatingScoutIds).toEqual([])})+ it.each([+ [+ 'a tool list after write access',+ { write_scopes: ['dashboard:write'] },+ { allowed_mcp_tools: ['insight-get'] },+ ],+ [+ 'write access after a tool preset',+ { tool_preset: 'read_only' as const },+ { write_scopes: ['insight:write'] },+ ],+ ])('never queues write access and a tool selection into one request, for %s', async (_name, earlier, later) => {+ // The API rejects a request that carries both, which would drop the later edit too.+ const firstRequest = deferred<SignalScoutConfigApi>()+ mockSignalsScoutConfigUpdate.mockReturnValueOnce(firstRequest.promise).mockResolvedValueOnce(BASE_CONFIG)++ logic.actions.updateScoutConfig(BASE_CONFIG.id, { enabled: false })+ logic.actions.updateScoutConfig(BASE_CONFIG.id, earlier)+ logic.actions.updateScoutConfig(BASE_CONFIG.id, later)+ firstRequest.resolve({ ...BASE_CONFIG, enabled: false })+ await expectLogic(logic).toFinishAllListeners()++ expect(mockSignalsScoutConfigUpdate).toHaveBeenNthCalledWith(2, String(MOCK_TEAM_ID), BASE_CONFIG.id, later)+ })+it('publishes a scout against its canonical project and preserves its tags', async () => {const config = { ...BASE_CONFIG, scout_origin: 'custom' as const, tags: ['errors'] }logic.actions.loadScoutConfigsSuccess([config])diff --git a/products/signals/frontend/inbox/logics/scoutFleetLogic.ts b/products/signals/frontend/inbox/logics/scoutFleetLogic.tsindex d78ddc76d2c9..9f5f7fd9aae3 100644--- a/products/signals/frontend/inbox/logics/scoutFleetLogic.ts+++ b/products/signals/frontend/inbox/logics/scoutFleetLogic.ts@@ -53,6 +53,7 @@ import {captureScoutAction,captureScoutChatStarted,captureScoutConfigChanged,+ captureScoutToolsSaveResult,ScoutChatType,ScoutFleetSyncOutcome,ScoutSurface,@@ -139,6 +140,40 @@ function captureScoutConfigUpdates(success,})}+ if ('allowed_mcp_tools' in updates || 'tool_preset' in updates) {+ captureScoutToolsSaveResult({+ skillName: config?.skill_name ?? '',+ allTools: !updates.tool_preset && updates.allowed_mcp_tools === null,+ toolPreset: updates.tool_preset ?? null,+ toolCount: updates.allowed_mcp_tools?.length ?? null,+ success,+ })+ }+}++/**+ * Folds a later update into a queued one. A tool selection and `write_scopes` must never travel in+ * one request, because the API rejects that pair, so the later of the two replaces the earlier.+ */+export function mergeQueuedScoutConfigUpdates(+ queued: SignalScoutConfigUpdate | undefined,+ next: SignalScoutConfigUpdate+): SignalScoutConfigUpdate {+ const merged = { ...queued, ...next }+ if ('write_scopes' in next) {+ delete merged.allowed_mcp_tools+ delete merged.tool_preset+ }+ if ('allowed_mcp_tools' in next || 'tool_preset' in next) {+ delete merged.write_scopes+ if (!('tool_preset' in next)) {+ delete merged.tool_preset+ }+ if (!('allowed_mcp_tools' in next)) {+ delete merged.allowed_mcp_tools+ }+ }+ return merged}// Fleet runs are refetched on a slow cadence so "running now" / recent emissions@@ -1781,7 +1816,7 @@ export const scoutFleetLogic = kea<scoutFleetLogicType>([if (inFlight.has(configId)) {actions.patchScoutConfigLocally(configId, updates)- pendingUpdates.set(configId, { ...pendingUpdates.get(configId), ...updates })+ pendingUpdates.set(configId, mergeQueuedScoutConfigUpdates(pendingUpdates.get(configId), updates))return}diff --git a/products/signals/frontend/inbox/logics/scoutToolCatalogueLogic.ts b/products/signals/frontend/inbox/logics/scoutToolCatalogueLogic.tsnew file mode 100644index 000000000000..be6ba89ca145--- /dev/null+++ b/products/signals/frontend/inbox/logics/scoutToolCatalogueLogic.ts@@ -0,0 +1,73 @@+import { MakeLogicType, afterMount, connect, kea, path, reducers } from 'kea'+import { loaders } from 'kea-loaders'++import { teamLogic } from 'scenes/teamLogic'++import { signalsScoutConfigToolCatalogue } from 'products/signals/frontend/generated/api'+import type { ScoutToolCatalogueApi } from 'products/signals/frontend/generated/api.schemas'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface scoutToolCatalogueLogicValues {+ currentTeamId: number | null // teamLogic+ catalogue: ScoutToolCatalogueApi | null+ catalogueFailed: boolean+ catalogueLoading: boolean+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface scoutToolCatalogueLogicActions {+ loadCatalogue: () => any+ loadCatalogueFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadCatalogueSuccess: (+ catalogue: ScoutToolCatalogueApi | null,+ payload?: any+ ) => {+ catalogue: ScoutToolCatalogueApi | null+ payload?: any+ }+}++export type scoutToolCatalogueLogicType = MakeLogicType<scoutToolCatalogueLogicValues, scoutToolCatalogueLogicActions>++/**+ * The MCP tool catalogue the scout tool picker reads. It is the same for every project and changes+ * only with a deploy, so one load per mount is enough.+ */+export const scoutToolCatalogueLogic = kea<scoutToolCatalogueLogicType>([+ path(['products', 'signals', 'inbox', 'logics', 'scoutToolCatalogueLogic']),+ connect({+ values: [teamLogic, ['currentTeamId']],+ }),+ loaders(({ values }) => ({+ catalogue: [+ null as ScoutToolCatalogueApi | null,+ {+ loadCatalogue: async () => {+ if (values.currentTeamId === null) {+ return null+ }+ return await signalsScoutConfigToolCatalogue(String(values.currentTeamId))+ },+ },+ ],+ })),+ reducers({+ catalogueFailed: [+ false,+ {+ loadCatalogue: () => false,+ loadCatalogueSuccess: () => false,+ loadCatalogueFailure: () => true,+ },+ ],+ }),+ afterMount(({ actions }) => {+ actions.loadCatalogue()+ }),+])