> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grafana

> 89 actions available for Grafana through StackOne. Use via Actions RPC, Toolset SDK, MCP, or A2A.

export const GettingStarted = ({connector}) => {
  const linkStyle = {
    textDecoration: 'none'
  };
  const authConfigGuides = connector?.authentication?.filter(a => a?.setupGuide) ?? [];
  const linkAccountGuides = connector?.authentication?.filter(a => a?.configGuide) ?? [];
  return <div style={{
    marginTop: '32px',
    paddingTop: '24px',
    borderTop: '1px solid #e2e8f0'
  }}>
      <div style={{
    fontSize: '20px',
    fontWeight: '600',
    marginBottom: '12px'
  }}>Getting Started</div>
      <Steps>
        <Step title="Create or Select a Project">
          Set up a new project or select an existing one. See the <a href="/guides/managing-projects" style={linkStyle}>Projects Guide</a>.
        </Step>
        <Step title="Configure the Connector">
          <>
            Enable the connector and set up auth configuration in your project. See <a href="/guides/explore-connectors" style={linkStyle}>Managing Connectors</a>.
            {authConfigGuides.length > 0 && <>
              <Columns cols={2}>
                {authConfigGuides.map(auth => <Card title="Auth Config" href={`/${auth.setupGuide}`} icon={connector.icon} horizontal>
                    {connector.name} - {auth.label}
                  </Card>)}
              </Columns> 
              </>}
          </>
        </Step>
        <Step title="Link an Account">
          <>
            Connect an account using <a href="/guides/embedding-stackone-hub" style={linkStyle}>StackOne Hub</a> or <a href="/guides/auth-link" style={linkStyle}>Auth Link</a>.
            {linkAccountGuides.length > 0 && <>
                <Columns cols={2}>
                  {linkAccountGuides.map(auth => <Card title="Link Account" href={`/${auth.configGuide}`} icon={connector.icon} horizontal>
                      {connector.name} - {auth.label}
                    </Card>)}
                </Columns>
              </>}
          </>
        </Step>
        <Step title="Use Actions">
          <>
            Invoke actions using one of the methods below:
            <ul style={{
    marginTop: '8px',
    paddingLeft: '20px'
  }}>
              <li style={{
    marginBottom: '4px'
  }}><a href="/mcp/quickstart" style={linkStyle}>MCP</a> – Model Context Protocol for AI assistants</li>
              <li style={{
    marginBottom: '4px'
  }}><a href="/a2a/quickstart" style={linkStyle}>A2A</a> – Agent-to-Agent protocol</li>
              <li style={{
    marginBottom: '4px'
  }}><a href="/agents/typescript/introduction" style={linkStyle}>AI Toolset (TypeScript)</a> – TypeScript SDK for AI agents</li>
              <li style={{
    marginBottom: '4px'
  }}><a href="/agents/python/introduction" style={linkStyle}>AI Toolset (Python)</a> – Python SDK for AI agents</li>
              <li style={{
    marginBottom: '4px'
  }}><a href="/platform/api-reference/actions/make-an-rpc-call-to-an-action" style={linkStyle}>Actions RPC</a> – Direct API calls</li>
              <li style={{
    marginBottom: '4px'
  }}><a href="/guides/playground" style={linkStyle}>Playground</a> – Test actions in the dashboard</li>
            </ul>
          </>
        </Step>
      </Steps>
    </div>;
};

export const ActionsLibrary = ({search, setSearch, filtered, sharedStyles = {}, KeyCell, ScopesCell, availableScopes, selectedScopes, setSelectedScopes}) => {
  const libraryStyles = {
    section: {
      marginTop: '24px',
      marginBottom: '16px'
    },
    sectionTitle: {
      fontSize: '18px',
      fontWeight: '600',
      marginBottom: '12px'
    },
    filterRow: {
      display: 'flex',
      gap: '12px',
      marginBottom: '12px',
      alignItems: 'stretch'
    },
    count: {
      color: '#64748b',
      fontSize: '12px',
      marginBottom: '8px'
    },
    scopesFilterRow: {
      marginBottom: '12px'
    },
    scopesDropdown: {
      display: 'inline-block',
      fontSize: '12px',
      color: '#475569'
    },
    scopesSummary: {
      cursor: 'pointer',
      padding: '6px 10px',
      borderRadius: '999px',
      border: '1px solid #e2e8f0',
      backgroundColor: '#ffffff',
      listStyle: 'none',
      display: 'inline-flex',
      alignItems: 'center',
      gap: '6px'
    },
    scopesSummaryLabel: {
      margin: 0,
      padding: 0
    },
    scopesChipsContainer: {
      marginTop: '8px',
      padding: '4px 2px 2px',
      display: 'flex',
      flexWrap: 'wrap',
      gap: '6px',
      maxHeight: '90px',
      overflowY: 'auto'
    },
    scopeChip: {
      borderRadius: '999px',
      border: '1px solid #e2e8f0',
      padding: '4px 8px',
      fontSize: '11px',
      backgroundColor: '#f8fafc',
      color: '#475569',
      cursor: 'pointer'
    },
    scopeChipActive: {
      backgroundColor: '#dbeafe',
      borderColor: '#2563eb',
      color: '#1d4ed8'
    },
    tableContainer: {
      maxHeight: '500px',
      overflowY: 'auto',
      overflowX: 'auto',
      border: '1px solid #e2e8f0',
      borderRadius: '8px',
      fontSize: '13px'
    },
    gridTable: {
      display: 'grid',
      minWidth: '600px',
      gridTemplateColumns: '200px 1fr'
    },
    gridTableWithScopes: {
      gridTemplateColumns: '200px 1fr 150px'
    },
    gridHeader: {
      display: 'contents'
    },
    gridHeaderCell: {
      position: 'sticky',
      top: 0,
      backgroundColor: '#f8fafc',
      padding: '10px 12px',
      fontWeight: '600',
      borderBottom: '1px solid #e2e8f0',
      zIndex: 1
    },
    gridRow: {
      display: 'contents'
    },
    gridCellAction: {
      padding: '10px 12px',
      fontWeight: '500',
      borderBottom: '1px solid #f1f5f9'
    },
    gridCellKey: {
      padding: '10px 12px',
      borderBottom: '1px solid #f1f5f9'
    },
    gridCellScopes: {
      padding: '10px 12px',
      borderBottom: '1px solid #f1f5f9',
      color: '#475569',
      fontSize: '12px'
    },
    gridCellDescription: {
      padding: '10px 12px',
      color: '#64748b',
      borderBottom: '1px solid #f1f5f9'
    }
  };
  const styles = {
    ...libraryStyles,
    ...sharedStyles
  };
  const safeAvailableScopes = Array.isArray(availableScopes) ? availableScopes : [];
  const safeSelectedScopes = Array.isArray(selectedScopes) ? selectedScopes : [];
  const hasScopesColumn = safeAvailableScopes.length > 0;
  const hasScopeFilter = safeAvailableScopes.length > 0 && typeof setSelectedScopes === 'function';
  const ScopesCellComponent = ScopesCell || (() => null);
  return <div style={styles.section}>
      <div style={styles.sectionTitle}>Actions</div>
      <div style={styles.filterRow}>
        <SearchBar value={search} onChange={setSearch} placeholder="Search actions" />
        {hasScopeFilter && <FilterDropdown label="Scopes" items={safeAvailableScopes} selectedItems={safeSelectedScopes} onChange={setSelectedScopes} searchPlaceholder="Search scopes..." emptyLabel="No scopes found" />}
      </div>
      <div style={styles.count}>
        {filtered.length === 0 ? '0 actions found' : `${filtered.length} action${filtered.length !== 1 ? 's' : ''}`}
      </div>
      {}
      <div className="not-prose" style={styles.tableContainer}>
        <div style={{
    ...hasScopesColumn ? {
      ...styles.gridTable,
      ...styles.gridTableWithScopes
    } : styles.gridTable
  }}>
          {}
          <div style={styles.gridHeader}>
            <div style={styles.gridHeaderCell}>Action</div>
            <div style={styles.gridHeaderCell}>Description</div>
            {hasScopesColumn && <div style={styles.gridHeaderCell}>Required scopes</div>}
          </div>
          {}
          {filtered.map(a => <div key={a.id} style={styles.gridRow}>
              <div style={styles.gridCellAction}>
                <div>{a.label}</div>
                <div style={{
    marginTop: '4px'
  }}>
                  <KeyCell id={a.id} />
                </div>
              </div>
              <div style={styles.gridCellDescription}>{a.description}</div>
              {hasScopesColumn && <div style={styles.gridCellScopes}>
                  <ScopesCellComponent scopes={a.requiredScopes} actionId={a.id} />
                </div>}
            </div>)}
        </div>
      </div>
    </div>;
};

export const FilterDropdown = ({label, items, selectedItems, onChange, searchPlaceholder = 'Search...', emptyLabel = 'No items found', formatLabel}) => {
  const [dropdownOpen, setDropdownOpen] = React.useState(false);
  const [search, setSearch] = React.useState('');
  const [hoveredItem, setHoveredItem] = React.useState(null);
  const dropdownRef = React.useRef(null);
  const styles = {
    dropdownContainer: {
      position: 'relative'
    },
    dropdownTrigger: {
      display: 'flex',
      alignItems: 'center',
      gap: '8px',
      padding: '10px 14px',
      borderRadius: '8px',
      border: '1px solid #e2e8f0',
      fontSize: '14px',
      backgroundColor: 'white',
      cursor: 'pointer',
      whiteSpace: 'nowrap',
      minWidth: '160px',
      justifyContent: 'space-between'
    },
    dropdownTriggerActive: {
      borderColor: '#068F56',
      backgroundColor: '#f0fdf4'
    },
    dropdownMenu: {
      position: 'absolute',
      top: '100%',
      right: 0,
      marginTop: '4px',
      backgroundColor: 'white',
      border: '1px solid #e2e8f0',
      borderRadius: '8px',
      boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
      zIndex: 50,
      minWidth: '220px',
      maxHeight: '320px',
      display: 'flex',
      flexDirection: 'column'
    },
    dropdownHeader: {
      padding: '8px 12px',
      borderBottom: '1px solid #e2e8f0'
    },
    selectActions: {
      display: 'flex',
      alignItems: 'center',
      gap: '8px',
      marginTop: '6px',
      fontSize: '12px'
    },
    selectActionBtn: {
      background: 'none',
      border: 'none',
      color: '#64748b',
      cursor: 'pointer',
      padding: '2px 4px',
      fontSize: '12px'
    },
    dropdownSearchInput: {
      width: '100%',
      padding: '8px 10px',
      borderRadius: '6px',
      border: '1px solid #e2e8f0',
      fontSize: '13px',
      outline: 'none',
      backgroundColor: '#ffffff'
    },
    dropdownList: {
      overflowY: 'auto',
      maxHeight: '220px',
      padding: '4px 0'
    },
    dropdownItem: {
      display: 'flex',
      alignItems: 'center',
      gap: '10px',
      padding: '8px 12px',
      cursor: 'pointer',
      fontSize: '13px',
      color: '#374151',
      transition: 'background-color 0.1s'
    },
    dropdownItemHover: {
      backgroundColor: '#f8fafc'
    },
    checkbox: {
      width: '16px',
      height: '16px',
      borderRadius: '4px',
      border: '2px solid #d1d5db',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      flexShrink: 0
    },
    checkboxChecked: {
      backgroundColor: '#068F56',
      borderColor: '#068F56'
    },
    checkmark: {
      color: 'white',
      fontSize: '10px',
      fontWeight: 'bold'
    },
    dropdownFooter: {
      padding: '8px 12px',
      borderTop: '1px solid #e2e8f0',
      display: 'flex',
      justifyContent: 'space-between',
      alignItems: 'center'
    },
    clearButton: {
      fontSize: '12px',
      color: '#64748b',
      cursor: 'pointer',
      padding: '4px 8px',
      borderRadius: '4px',
      border: 'none',
      background: 'none'
    },
    badge: {
      backgroundColor: '#068F56',
      color: 'white',
      fontSize: '11px',
      fontWeight: '600',
      padding: '2px 6px',
      borderRadius: '10px',
      marginLeft: '4px'
    },
    chevron: {
      fontSize: '10px',
      color: '#64748b',
      transition: 'transform 0.15s'
    },
    noResults: {
      padding: '12px',
      textAlign: 'center',
      color: '#64748b',
      fontSize: '13px'
    }
  };
  const safeSelected = Array.isArray(selectedItems) ? selectedItems : [];
  const formatItemLabel = item => {
    if (typeof formatLabel === 'function') {
      return formatLabel(item);
    }
    return item;
  };
  const filteredItems = React.useMemo(() => {
    if (!search) return items;
    const searchLower = search.toLowerCase();
    return items.filter(item => {
      const labelText = formatItemLabel(item);
      return labelText.toLowerCase().includes(searchLower);
    });
  }, [items, search, formatLabel]);
  const isSelected = item => safeSelected.includes(item);
  const toggleItem = item => {
    const next = isSelected(item) ? safeSelected.filter(v => v !== item) : [...safeSelected, item];
    onChange(next);
  };
  const clearFilters = () => {
    onChange([]);
  };
  const selectAll = () => {
    onChange(items);
  };
  React.useEffect(() => {
    const handleClickOutside = e => {
      if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
        setDropdownOpen(false);
        setSearch('');
        setHoveredItem(null);
      }
    };
    document.addEventListener('mousedown', handleClickOutside);
    return () => document.removeEventListener('mousedown', handleClickOutside);
  }, []);
  return <div style={styles.dropdownContainer} ref={dropdownRef}>
      <button type="button" onClick={() => setDropdownOpen(!dropdownOpen)} style={{
    ...styles.dropdownTrigger,
    ...safeSelected.length > 0 ? styles.dropdownTriggerActive : {}
  }}>
        <span>
          {label}
          {safeSelected.length > 0 && <span style={styles.badge}>{safeSelected.length}</span>}
        </span>
        <span style={{
    ...styles.chevron,
    transform: dropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)'
  }}>
          ▼
        </span>
      </button>
      {dropdownOpen && <div style={styles.dropdownMenu}>
          <div style={styles.dropdownHeader}>
            <input type="text" placeholder={searchPlaceholder} value={search} onChange={e => setSearch(e.target.value)} style={styles.dropdownSearchInput} autoFocus />
            <div style={styles.selectActions}>
              <button type="button" onClick={selectAll} style={styles.selectActionBtn} onMouseEnter={e => {
    e.target.style.color = '#1e293b';
  }} onMouseLeave={e => {
    e.target.style.color = '#64748b';
  }}>
                Select all
              </button>
              <span style={{
    color: '#e2e8f0'
  }}>|</span>
              <button type="button" onClick={clearFilters} style={styles.selectActionBtn} onMouseEnter={e => {
    e.target.style.color = '#1e293b';
  }} onMouseLeave={e => {
    e.target.style.color = '#64748b';
  }}>
                Clear
              </button>
            </div>
          </div>
          <div style={styles.dropdownList}>
            {filteredItems.length === 0 ? <div style={styles.noResults}>{emptyLabel}</div> : filteredItems.map(item => <div key={item} onClick={() => toggleItem(item)} onMouseEnter={() => setHoveredItem(item)} onMouseLeave={() => setHoveredItem(null)} style={{
    ...styles.dropdownItem,
    ...hoveredItem === item ? styles.dropdownItemHover : {}
  }}>
                  <div style={{
    ...styles.checkbox,
    ...isSelected(item) ? styles.checkboxChecked : {}
  }}>
                    {isSelected(item) && <span style={styles.checkmark}>✓</span>}
                  </div>
                  <span>{formatItemLabel(item)}</span>
                </div>)}
          </div>
        </div>}
    </div>;
};

export const SearchBar = ({value, onChange, placeholder = 'Search...'}) => {
  const baseStyle = {
    padding: '10px 14px',
    borderRadius: '8px',
    border: '1px solid #e2e8f0',
    fontSize: '14px',
    outline: 'none',
    backgroundColor: '#fafafa',
    flex: 1,
    minWidth: 0
  };
  return <input type="text" placeholder={placeholder} value={value} onChange={e => onChange(e.target.value)} style={baseStyle} />;
};

export const ConnectorPage = ({connector}) => {
  const styles = {
    header: {
      display: 'flex',
      alignItems: 'center',
      gap: '12px',
      marginBottom: '24px'
    },
    tagsRow: {
      display: 'flex',
      flexWrap: 'wrap',
      gap: '6px',
      marginTop: '8px'
    },
    releaseTag: {
      display: 'inline-block',
      padding: '2px 8px',
      borderRadius: '4px',
      fontSize: '11px',
      fontWeight: '500'
    },
    betaTag: {
      backgroundColor: '#fef3c7',
      color: '#b45309'
    },
    previewTag: {
      backgroundColor: '#E1E9F4',
      color: '#0D58AE',
      border: '1px solid #BFD5F1'
    },
    categoryTag: {
      display: 'inline-block',
      padding: '2px 8px',
      borderRadius: '4px',
      fontSize: '11px',
      fontWeight: '500',
      backgroundColor: '#f1f5f9',
      color: '#475569'
    },
    icon: {
      width: '48px',
      height: '48px',
      borderRadius: '10px',
      backgroundColor: '#f8fafc',
      padding: '2px'
    },
    title: {
      fontSize: '24px',
      fontWeight: '600'
    },
    subtitle: {
      fontSize: '14px',
      color: '#64748b'
    },
    authDescription: {
      fontSize: '14px',
      color: '#64748b',
      marginTop: 0
    },
    sectionTitle: {
      fontSize: '18px',
      fontWeight: '600',
      marginBottom: '12px'
    },
    authList: {
      paddingLeft: '20px',
      color: '#374151'
    },
    codeWrapper: {
      position: 'relative',
      display: 'inline-flex',
      alignItems: 'center',
      maxWidth: '100%',
      cursor: 'pointer',
      overflowX: 'auto',
      overflowY: 'hidden',
      msOverflowStyle: 'none',
      scrollbarWidth: 'none'
    },
    code: {
      backgroundColor: '#f1f5f9',
      padding: '4px 8px',
      borderRadius: '4px',
      fontSize: '11px',
      color: '#475569',
      display: 'inline-block',
      whiteSpace: 'nowrap',
      transition: 'background-color 0.15s'
    },
    codeHover: {
      backgroundColor: '#e2e8f0'
    },
    codeCopied: {
      backgroundColor: '#d1fae5',
      color: '#065f46'
    },
    tooltip: {
      position: 'absolute',
      top: '100%',
      left: '50%',
      transform: 'translateX(-50%)',
      backgroundColor: '#1e293b',
      color: 'white',
      padding: '6px 10px',
      borderRadius: '6px',
      fontSize: '11px',
      whiteSpace: 'nowrap',
      marginTop: '6px',
      zIndex: 50,
      maxWidth: '300px',
      wordBreak: 'break-all'
    },
    tooltipArrow: {
      position: 'absolute',
      bottom: '100%',
      left: '50%',
      transform: 'translateX(-50%)',
      borderWidth: '5px',
      borderStyle: 'solid',
      borderColor: 'transparent transparent #1e293b transparent',
      zIndex: 50
    },
    tdDescription: {
      padding: '10px 12px',
      color: '#64748b',
      verticalAlign: 'top',
      maxWidth: '400px'
    }
  };
  const [search, setSearch] = React.useState('');
  const [copiedId, setCopiedId] = React.useState(null);
  const [selectedScopes, setSelectedScopes] = React.useState([]);
  const availableScopes = React.useMemo(() => {
    const set = new Set();
    connector.actions.forEach(a => {
      if (Array.isArray(a.requiredScopes)) {
        a.requiredScopes.forEach(s => {
          if (s) set.add(s);
        });
      }
    });
    return Array.from(set).sort();
  }, [connector.actions]);
  const filtered = React.useMemo(() => {
    const searchLower = search.toLowerCase();
    return connector.actions.filter(a => {
      const matchesSearch = a.label.toLowerCase().includes(searchLower) || a.description.toLowerCase().includes(searchLower) || a.id.toLowerCase().includes(searchLower);
      if (!matchesSearch) return false;
      if (selectedScopes.length === 0) return true;
      const scopes = Array.isArray(a.requiredScopes) ? a.requiredScopes : [];
      if (scopes.length === 0) return false;
      return selectedScopes.some(scope => scopes.includes(scope));
    });
  }, [connector.actions, search, selectedScopes]);
  const handleImageError = e => {
    e.target.style.display = 'none';
  };
  const formatCategoryLabel = cat => {
    const acronyms = ['ats', 'crm', 'hris', 'iam', 'lms'];
    if (acronyms.includes(cat.toLowerCase())) {
      return cat.toUpperCase();
    }
    return cat.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
  };
  const ReleaseTag = () => {
    if (!connector.releaseStage || connector.releaseStage === 'ga') return null;
    const tagStyle = connector.releaseStage === 'beta' ? {
      ...styles.releaseTag,
      ...styles.betaTag
    } : {
      ...styles.releaseTag,
      ...styles.previewTag
    };
    return <span style={tagStyle}>
        {connector.releaseStage.charAt(0).toUpperCase() + connector.releaseStage.slice(1)}
      </span>;
  };
  const CategoryTags = () => {
    if (!connector.categories || connector.categories.length === 0) return null;
    return <>
        {connector.categories.map(cat => <span key={cat} style={styles.categoryTag}>
            {formatCategoryLabel(cat)}
          </span>)}
      </>;
  };
  const copyToClipboard = async (text, id) => {
    try {
      await navigator.clipboard.writeText(text);
      setCopiedId(id);
      setTimeout(() => setCopiedId(null), 1500);
    } catch (err) {
      console.error('Failed to copy:', err);
    }
  };
  const CopyChip = ({text, copyId}) => {
    const [isHovered, setIsHovered] = React.useState(false);
    const isCopied = copiedId === copyId;
    if (!text) {
      return null;
    }
    const codeStyle = {
      ...styles.code,
      ...isCopied ? styles.codeCopied : isHovered ? styles.codeHover : {}
    };
    return <div style={styles.codeWrapper} onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} onClick={() => copyToClipboard(text, copyId)} title="">
        {(isHovered || isCopied) && <div style={styles.tooltip}>
            {isCopied ? '✓ Copied!' : 'Click to copy'}
            <div style={styles.tooltipArrow} />
          </div>}
        <code style={codeStyle}>
          {text}
        </code>
      </div>;
  };
  const KeyCell = ({id}) => <CopyChip text={id} copyId={id} />;
  const ScopesCell = ({scopes, actionId}) => {
    const scopeList = Array.isArray(scopes) ? scopes.filter(Boolean) : [];
    if (scopeList.length === 0) return null;
    return <div style={{
      display: 'flex',
      flexWrap: 'wrap',
      gap: '6px'
    }}>
        {scopeList.map(scope => <CopyChip key={scope} text={scope} copyId={`scopes:${actionId}:${scope}`} />)}
      </div>;
  };
  return <div>
      {}
      <div style={styles.header}>
        <img src={connector.icon} alt={connector.name} style={styles.icon} onError={handleImageError} />
        <div>
          <div style={styles.title}>{connector.name}</div>
          <div style={styles.subtitle}>
            {connector.actions.length} actions · {connector.authentication.length} auth method{connector.authentication.length !== 1 ? 's' : ''}
          </div>
          {connector.releaseStage && connector.releaseStage !== 'ga' || connector.categories && connector.categories.length > 0 ? <div style={styles.tagsRow}>
              <ReleaseTag />
              <CategoryTags />
            </div> : null}
        </div>
      </div>

      {}
      <div style={styles.sectionTitle}>Authentication</div>
      <Columns cols={2}>        
        {connector.authentication.length > 0 ? connector.authentication.map(auth => {
    const authLabel = auth?.label || '';
    const authDescription = auth?.description;
    const configGuide = auth?.configGuide;
    const setupGuide = auth?.setupGuide;
    const hasConfigGuide = !!configGuide;
    const hasSetupGuide = !!setupGuide;
    const hasAnyGuide = hasConfigGuide || hasSetupGuide;
    return <Card key={authLabel} title={authLabel}>
                {authDescription && <p style={{
      ...styles.authDescription,
      marginBottom: hasAnyGuide ? '8px' : 0
    }}>
                    {authDescription}
                  </p>}
                {hasAnyGuide && <span style={{
      fontSize: '14px'
    }}>
                    Guides: {hasSetupGuide && <a href={`/${setupGuide}`} style={{
      textDecoration: 'none'
    }}>Auth Config</a>}
                    {hasConfigGuide && hasSetupGuide && ', '}
                    {hasConfigGuide && <a href={`/${configGuide}`} style={{
      textDecoration: 'none'
    }}>Link Account</a>}
                  </span>}
              </Card>;
  }) : <>
            Contact StackOne for authentication details.
          </>}
      </Columns>

      {connector.documentation?.references?.length > 0 && <>
          <div style={styles.sectionTitle}>References</div>
          <Columns cols={2}>
            {connector.documentation.references.map(ref => {
    let safeHref;
    try {
      const parsed = new URL(ref.url);
      safeHref = parsed.protocol === 'http:' || parsed.protocol === 'https:' ? ref.url : undefined;
    } catch {
      safeHref = undefined;
    }
    return <Card key={`${ref.title}-${ref.url}`} title={ref.title} href={safeHref}>
                  {ref.description}
                </Card>;
  })}
          </Columns>
        </>}

      <ActionsLibrary search={search} setSearch={setSearch} filtered={filtered} sharedStyles={{
    sectionTitle: styles.sectionTitle
  }} KeyCell={KeyCell} ScopesCell={ScopesCell} availableScopes={availableScopes} selectedScopes={selectedScopes} setSelectedScopes={setSelectedScopes} />

      <GettingStarted connector={connector} />

    </div>;
};

export const connector = {
  "key": "grafana",
  "name": "Grafana",
  "icon": "https://stackone-logos.com/api/grafana/filled/png",
  "authentication": [{
    "label": "Service Account Token",
    "description": "Connect using a Grafana Service Account Token with appropriate permissions",
    "configGuide": "connectors/grafana/guides/link-account/service-account-token",
    "setupGuide": "connectors/grafana/guides/auth-config/service-account-token"
  }],
  "actions": [{
    "id": "grafana_list_alert_rules",
    "label": "List Alert Rules",
    "description": "Retrieve all provisioned alert rules",
    "requiredScopes": ["alert.rules:read"]
  }, {
    "id": "grafana_get_alert_rule",
    "label": "Get Alert Rule",
    "description": "Retrieve a specific alert rule by its UID",
    "requiredScopes": ["alert.rules:read"]
  }, {
    "id": "grafana_create_alert_rule",
    "label": "Create Alert Rule",
    "description": "Create a new alert rule",
    "requiredScopes": ["alert.rules:write"]
  }, {
    "id": "grafana_update_alert_rule",
    "label": "Update Alert Rule",
    "description": "Update an existing alert rule by its UID",
    "requiredScopes": ["alert.rules:write"]
  }, {
    "id": "grafana_delete_alert_rule",
    "label": "Delete Alert Rule",
    "description": "Delete an alert rule by its UID",
    "requiredScopes": ["alert.rules:write"]
  }, {
    "id": "grafana_list_contact_points",
    "label": "List Contact Points",
    "description": "Retrieve all alert notification contact points",
    "requiredScopes": ["alert.provisioning:read"]
  }, {
    "id": "grafana_create_contact_point",
    "label": "Create Contact Point",
    "description": "Create a new alert notification contact point",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_delete_contact_point",
    "label": "Delete Contact Point",
    "description": "Delete an alert notification contact point by its UID",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_get_notification_policies",
    "label": "Get Notification Policies",
    "description": "Retrieve the notification policy tree",
    "requiredScopes": ["alert.provisioning:read"]
  }, {
    "id": "grafana_list_mute_timings",
    "label": "List Mute Timings",
    "description": "Retrieve all mute timing configurations",
    "requiredScopes": ["alert.provisioning:read"]
  }, {
    "id": "grafana_get_mute_timing",
    "label": "Get Mute Timing",
    "description": "Retrieve a specific mute timing by its name",
    "requiredScopes": ["alert.provisioning:read"]
  }, {
    "id": "grafana_create_mute_timing",
    "label": "Create Mute Timing",
    "description": "Create a new mute timing configuration",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_update_mute_timing",
    "label": "Update Mute Timing",
    "description": "Update an existing mute timing configuration by its name",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_delete_mute_timing",
    "label": "Delete Mute Timing",
    "description": "Delete a mute timing by its name",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_update_contact_point",
    "label": "Update Contact Point",
    "description": "Update an existing alert notification contact point by its UID",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_update_notification_policies",
    "label": "Update Notification Policies",
    "description": "Update the notification policy tree",
    "requiredScopes": ["alert.provisioning:write"]
  }, {
    "id": "grafana_list_annotations",
    "label": "List Annotations",
    "description": "Retrieve annotations filtered by time range, tags, dashboard, or user",
    "requiredScopes": ["annotations:read"]
  }, {
    "id": "grafana_create_annotation",
    "label": "Create Annotation",
    "description": "Create a new annotation on a dashboard or organization-wide",
    "requiredScopes": ["annotations:write"]
  }, {
    "id": "grafana_update_annotation",
    "label": "Update Annotation",
    "description": "Update an existing annotation by its ID",
    "requiredScopes": ["annotations:write"]
  }, {
    "id": "grafana_delete_annotation",
    "label": "Delete Annotation",
    "description": "Delete an annotation by its ID",
    "requiredScopes": ["annotations:write"]
  }, {
    "id": "grafana_list_annotation_tags",
    "label": "List Annotation Tags",
    "description": "Retrieve all tags used in annotations",
    "requiredScopes": ["annotations:read"]
  }, {
    "id": "grafana_search_dashboards",
    "label": "Search Dashboards",
    "description": "Search for dashboards and folders by query, tags, or type",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_get_dashboard",
    "label": "Get Dashboard",
    "description": "Retrieve a dashboard by its UID",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_get_dashboard_permissions",
    "label": "Get Dashboard Permissions",
    "description": "Retrieve all permissions for a dashboard",
    "requiredScopes": ["dashboards.permissions:read"]
  }, {
    "id": "grafana_update_dashboard_permissions",
    "label": "Update Dashboard Permissions",
    "description": "Update permissions for a dashboard",
    "requiredScopes": ["dashboards.permissions:write"]
  }, {
    "id": "grafana_list_dashboard_versions",
    "label": "List Dashboard Versions",
    "description": "Retrieve all versions of a dashboard",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_get_dashboard_version",
    "label": "Get Dashboard Version",
    "description": "Retrieve a specific version of a dashboard",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_create_dashboard",
    "label": "Create Dashboard",
    "description": "Create or update a dashboard",
    "requiredScopes": ["dashboards:write"]
  }, {
    "id": "grafana_delete_dashboard",
    "label": "Delete Dashboard",
    "description": "Delete a dashboard by its UID",
    "requiredScopes": ["dashboards:write"]
  }, {
    "id": "grafana_star_dashboard",
    "label": "Star Dashboard",
    "description": "Star a dashboard for the authenticated user",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_unstar_dashboard",
    "label": "Unstar Dashboard",
    "description": "Remove a star from a dashboard for the authenticated user",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_get_home_dashboard",
    "label": "Get Home Dashboard",
    "description": "Retrieve the home dashboard for the current organization",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_list_dashboard_tags",
    "label": "List Dashboard Tags",
    "description": "Retrieve all dashboard tags in the Grafana instance",
    "requiredScopes": ["dashboards:read"]
  }, {
    "id": "grafana_list_datasources",
    "label": "List Data Sources",
    "description": "Retrieve all data sources configured in the Grafana instance",
    "requiredScopes": ["datasources:read"]
  }, {
    "id": "grafana_get_datasource",
    "label": "Get Data Source",
    "description": "Retrieve a specific data source by its UID",
    "requiredScopes": ["datasources:read"]
  }, {
    "id": "grafana_create_datasource",
    "label": "Create Data Source",
    "description": "Create a new data source in Grafana",
    "requiredScopes": ["datasources:write"]
  }, {
    "id": "grafana_update_datasource",
    "label": "Update Data Source",
    "description": "Update an existing data source by its UID",
    "requiredScopes": ["datasources:write"]
  }, {
    "id": "grafana_delete_datasource",
    "label": "Delete Data Source",
    "description": "Delete a data source by its UID",
    "requiredScopes": ["datasources:write"]
  }, {
    "id": "grafana_list_correlations",
    "label": "List Correlations",
    "description": "Retrieve all correlations across data sources",
    "requiredScopes": ["datasources:read"]
  }, {
    "id": "grafana_create_correlation",
    "label": "Create Correlation",
    "description": "Create a new correlation between two data sources",
    "requiredScopes": ["datasources:write"]
  }, {
    "id": "grafana_delete_correlation",
    "label": "Delete Correlation",
    "description": "Delete a correlation by its UID",
    "requiredScopes": ["datasources:write"]
  }, {
    "id": "grafana_list_folders",
    "label": "List Folders",
    "description": "Retrieve all folders the authenticated user has permission to view",
    "requiredScopes": ["folders:read"]
  }, {
    "id": "grafana_get_folder",
    "label": "Get Folder",
    "description": "Retrieve a specific folder by its UID",
    "requiredScopes": ["folders:read"]
  }, {
    "id": "grafana_create_folder",
    "label": "Create Folder",
    "description": "Create a new folder for organizing dashboards",
    "requiredScopes": ["folders:write"]
  }, {
    "id": "grafana_update_folder",
    "label": "Update Folder",
    "description": "Update an existing folder's title",
    "requiredScopes": ["folders:write"]
  }, {
    "id": "grafana_delete_folder",
    "label": "Delete Folder",
    "description": "Delete a folder and all its dashboards",
    "requiredScopes": ["folders:write"]
  }, {
    "id": "grafana_get_folder_permissions",
    "label": "Get Folder Permissions",
    "description": "Retrieve all permissions for a folder",
    "requiredScopes": ["folders.permissions:read"]
  }, {
    "id": "grafana_update_folder_permissions",
    "label": "Update Folder Permissions",
    "description": "Update permissions for a folder",
    "requiredScopes": ["folders.permissions:write"]
  }, {
    "id": "grafana_get_organization",
    "label": "Get Organization",
    "description": "Retrieve the current organization's details",
    "requiredScopes": ["orgs:read"]
  }, {
    "id": "grafana_update_organization",
    "label": "Update Organization",
    "description": "Update the current organization's name",
    "requiredScopes": ["orgs:write"]
  }, {
    "id": "grafana_list_org_users",
    "label": "List Organization Users",
    "description": "List all users in the current organization",
    "requiredScopes": ["org.users:read"]
  }, {
    "id": "grafana_add_org_user",
    "label": "Add Organization User",
    "description": "Add an existing user to the current organization",
    "requiredScopes": ["org.users:write"]
  }, {
    "id": "grafana_update_org_user_role",
    "label": "Update Organization User Role",
    "description": "Update a user's role in the current organization",
    "requiredScopes": ["org.users:write"]
  }, {
    "id": "grafana_remove_org_user",
    "label": "Remove Organization User",
    "description": "Remove a user from the current organization",
    "requiredScopes": ["org.users:write"]
  }, {
    "id": "grafana_get_org_preferences",
    "label": "Get Organization Preferences",
    "description": "Retrieve the current organization's preference settings",
    "requiredScopes": ["orgs:read"]
  }, {
    "id": "grafana_update_org_preferences",
    "label": "Update Organization Preferences",
    "description": "Update the current organization's preference settings",
    "requiredScopes": ["orgs:write"]
  }, {
    "id": "grafana_list_playlists",
    "label": "List Playlists",
    "description": "Retrieve all playlists",
    "requiredScopes": ["playlists:read"]
  }, {
    "id": "grafana_get_playlist",
    "label": "Get Playlist",
    "description": "Retrieve a specific playlist by its UID",
    "requiredScopes": ["playlists:read"]
  }, {
    "id": "grafana_create_playlist",
    "label": "Create Playlist",
    "description": "Create a new playlist",
    "requiredScopes": ["playlists:write"]
  }, {
    "id": "grafana_update_playlist",
    "label": "Update Playlist",
    "description": "Update an existing playlist by its UID",
    "requiredScopes": ["playlists:write"]
  }, {
    "id": "grafana_delete_playlist",
    "label": "Delete Playlist",
    "description": "Delete a playlist by its UID",
    "requiredScopes": ["playlists:write"]
  }, {
    "id": "grafana_list_service_accounts",
    "label": "List Service Accounts",
    "description": "Retrieve all service accounts with pagination",
    "requiredScopes": ["serviceaccounts:read"]
  }, {
    "id": "grafana_get_service_account",
    "label": "Get Service Account",
    "description": "Retrieve a specific service account by its ID",
    "requiredScopes": ["serviceaccounts:read"]
  }, {
    "id": "grafana_create_service_account",
    "label": "Create Service Account",
    "description": "Create a new service account",
    "requiredScopes": ["serviceaccounts:write"]
  }, {
    "id": "grafana_update_service_account",
    "label": "Update Service Account",
    "description": "Update a service account's name or role",
    "requiredScopes": ["serviceaccounts:write"]
  }, {
    "id": "grafana_delete_service_account",
    "label": "Delete Service Account",
    "description": "Delete a service account by its ID",
    "requiredScopes": ["serviceaccounts:write"]
  }, {
    "id": "grafana_list_service_account_tokens",
    "label": "List Service Account Tokens",
    "description": "Retrieve all tokens for a service account",
    "requiredScopes": ["serviceaccounts:read"]
  }, {
    "id": "grafana_create_service_account_token",
    "label": "Create Service Account Token",
    "description": "Create a new token for a service account",
    "requiredScopes": ["serviceaccounts:write"]
  }, {
    "id": "grafana_delete_service_account_token",
    "label": "Delete Service Account Token",
    "description": "Delete a specific token from a service account",
    "requiredScopes": ["serviceaccounts:write"]
  }, {
    "id": "grafana_list_teams",
    "label": "List Teams",
    "description": "Retrieve all teams with pagination",
    "requiredScopes": ["teams:read"]
  }, {
    "id": "grafana_get_team",
    "label": "Get Team",
    "description": "Retrieve a specific team by its ID",
    "requiredScopes": ["teams:read"]
  }, {
    "id": "grafana_create_team",
    "label": "Create Team",
    "description": "Create a new team in the organization",
    "requiredScopes": ["teams:write"]
  }, {
    "id": "grafana_update_team",
    "label": "Update Team",
    "description": "Update a team's name or email",
    "requiredScopes": ["teams:write"]
  }, {
    "id": "grafana_delete_team",
    "label": "Delete Team",
    "description": "Delete a team by its ID",
    "requiredScopes": ["teams:write"]
  }, {
    "id": "grafana_list_team_members",
    "label": "List Team Members",
    "description": "Retrieve all members of a team",
    "requiredScopes": ["teams.permissions:read"]
  }, {
    "id": "grafana_add_team_member",
    "label": "Add Team Member",
    "description": "Add a user to a team",
    "requiredScopes": ["teams.permissions:write"]
  }, {
    "id": "grafana_remove_team_member",
    "label": "Remove Team Member",
    "description": "Remove a user from a team",
    "requiredScopes": ["teams.permissions:write"]
  }, {
    "id": "grafana_get_health",
    "label": "Get Health",
    "description": "Check the health status of the Grafana instance"
  }, {
    "id": "grafana_get_frontend_settings",
    "label": "Get Frontend Settings",
    "description": "Retrieve Grafana frontend configuration settings"
  }, {
    "id": "grafana_list_snapshots",
    "label": "List Snapshots",
    "description": "Retrieve all dashboard snapshots",
    "requiredScopes": ["snapshots:read"]
  }, {
    "id": "grafana_get_snapshot",
    "label": "Get Snapshot",
    "description": "Retrieve a dashboard snapshot by its key",
    "requiredScopes": ["snapshots:read"]
  }, {
    "id": "grafana_delete_snapshot",
    "label": "Delete Snapshot",
    "description": "Delete a dashboard snapshot by its key",
    "requiredScopes": ["snapshots:write"]
  }, {
    "id": "grafana_list_library_elements",
    "label": "List Library Elements",
    "description": "Retrieve all reusable library elements (panels)",
    "requiredScopes": ["library.panels:read"]
  }, {
    "id": "grafana_get_library_element",
    "label": "Get Library Element",
    "description": "Retrieve a specific library element by its UID",
    "requiredScopes": ["library.panels:read"]
  }, {
    "id": "grafana_create_short_url",
    "label": "Create Short URL",
    "description": "Create a shortened URL for a Grafana path"
  }, {
    "id": "grafana_create_snapshot",
    "label": "Create Snapshot",
    "description": "Create a new dashboard snapshot",
    "requiredScopes": ["snapshots:write"]
  }, {
    "id": "grafana_create_library_element",
    "label": "Create Library Element",
    "description": "Create a new reusable library element (panel)",
    "requiredScopes": ["library.panels:write"]
  }, {
    "id": "grafana_delete_library_element",
    "label": "Delete Library Element",
    "description": "Delete a library element by its UID",
    "requiredScopes": ["library.panels:write"]
  }, {
    "id": "grafana_update_library_element",
    "label": "Update Library Element",
    "description": "Update an existing library element by its UID",
    "requiredScopes": ["library.panels:write"]
  }],
  "releaseStage": "preview",
  "categories": [],
  "scopeDefinitions": [{
    "name": "dashboards:write",
    "description": "Create, update, and delete dashboards",
    "includes": ["dashboards:read"]
  }, {
    "name": "dashboards:read",
    "description": "View dashboards, search, versions, tags, and home dashboard"
  }, {
    "name": "dashboards.permissions:write",
    "description": "Manage dashboard access permissions",
    "includes": ["dashboards.permissions:read"]
  }, {
    "name": "dashboards.permissions:read",
    "description": "View dashboard access permissions"
  }, {
    "name": "folders:write",
    "description": "Create, update, and delete folders",
    "includes": ["folders:read"]
  }, {
    "name": "folders:read",
    "description": "View folders"
  }, {
    "name": "folders.permissions:write",
    "description": "Manage folder access permissions",
    "includes": ["folders.permissions:read"]
  }, {
    "name": "folders.permissions:read",
    "description": "View folder access permissions"
  }, {
    "name": "annotations:write",
    "description": "Create, update, and delete annotations",
    "includes": ["annotations:read"]
  }, {
    "name": "annotations:read",
    "description": "View annotations and annotation tags"
  }, {
    "name": "alert.rules:write",
    "description": "Create, update, and delete alert rules",
    "includes": ["alert.rules:read"]
  }, {
    "name": "alert.rules:read",
    "description": "View alert rules"
  }, {
    "name": "alert.provisioning:write",
    "description": "Manage contact points, notification policies, and mute timings",
    "includes": ["alert.provisioning:read"]
  }, {
    "name": "alert.provisioning:read",
    "description": "View contact points, notification policies, and mute timings"
  }, {
    "name": "datasources:write",
    "description": "Create, update, and delete data sources and correlations",
    "includes": ["datasources:read"]
  }, {
    "name": "datasources:read",
    "description": "View data sources and correlations"
  }, {
    "name": "playlists:write",
    "description": "Create, update, and delete playlists",
    "includes": ["playlists:read"]
  }, {
    "name": "playlists:read",
    "description": "View playlists"
  }, {
    "name": "orgs:write",
    "description": "Update organization settings and preferences",
    "includes": ["orgs:read"]
  }, {
    "name": "orgs:read",
    "description": "View organization details and preferences"
  }, {
    "name": "org.users:write",
    "description": "Add, update, and remove organization users",
    "includes": ["org.users:read"]
  }, {
    "name": "org.users:read",
    "description": "View organization users"
  }, {
    "name": "teams:write",
    "description": "Create, update, and delete teams",
    "includes": ["teams:read"]
  }, {
    "name": "teams:read",
    "description": "View teams"
  }, {
    "name": "teams.permissions:write",
    "description": "Add and remove team members",
    "includes": ["teams.permissions:read"]
  }, {
    "name": "teams.permissions:read",
    "description": "View team members"
  }, {
    "name": "serviceaccounts:write",
    "description": "Create, update, and delete service accounts and tokens",
    "includes": ["serviceaccounts:read"]
  }, {
    "name": "serviceaccounts:read",
    "description": "View service accounts and tokens"
  }, {
    "name": "library.panels:write",
    "description": "Create, update, and delete library panels",
    "includes": ["library.panels:read"]
  }, {
    "name": "library.panels:read",
    "description": "View library panels"
  }, {
    "name": "snapshots:write",
    "description": "Create and delete dashboard snapshots",
    "includes": ["snapshots:read"]
  }, {
    "name": "snapshots:read",
    "description": "View dashboard snapshots"
  }]
};

<ConnectorPage connector={connector} />
