mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-17 18:02:09 -05:00
feat(a2a): added a2a protocol (#2784)
* feat(a2a): a2a added * feat(a2a): added a2a protocol * remove migrations * readd migrations * consolidated permissions utils * consolidated tag-input, output select -> combobox, added tags for A2A * cleanup up utils, share same deployed state as other tabs * ack PR comments * more * updated code examples * solely rely on tanstack query to vend data and invalidate query key's, remove custom caching --------- Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
This commit is contained in:
@@ -59,6 +59,8 @@ export type ComboboxOption = {
|
||||
export type ComboboxOptionGroup = {
|
||||
/** Optional section header label */
|
||||
section?: string
|
||||
/** Optional custom section header element (overrides section label) */
|
||||
sectionElement?: ReactNode
|
||||
/** Options in this group */
|
||||
items: ComboboxOption[]
|
||||
}
|
||||
@@ -625,11 +627,13 @@ const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
|
||||
<div className='space-y-[2px]'>
|
||||
{filteredGroups.map((group, groupIndex) => (
|
||||
<div key={group.section || `group-${groupIndex}`}>
|
||||
{group.section && (
|
||||
<div className='px-[6px] py-[4px] font-base text-[11px] text-[var(--text-tertiary)] first:pt-[4px]'>
|
||||
{group.section}
|
||||
</div>
|
||||
)}
|
||||
{group.sectionElement
|
||||
? group.sectionElement
|
||||
: group.section && (
|
||||
<div className='px-[6px] py-[4px] font-base text-[11px] text-[var(--text-tertiary)] first:pt-[4px]'>
|
||||
{group.section}
|
||||
</div>
|
||||
)}
|
||||
{group.items.map((option) => {
|
||||
const isSelected = multiSelect
|
||||
? multiSelectValues?.includes(option.value)
|
||||
|
||||
@@ -53,6 +53,8 @@ const tagVariants = cva(
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-[#bfdbfe] text-[#1d4ed8] dark:bg-[rgba(59,130,246,0.2)] dark:text-[#93c5fd]',
|
||||
secondary:
|
||||
'border border-[var(--border-1)] bg-[var(--surface-4)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]',
|
||||
invalid:
|
||||
'bg-[#fecaca] text-[var(--text-error)] dark:bg-[#551a1a] dark:text-[var(--text-error)]',
|
||||
},
|
||||
@@ -102,7 +104,9 @@ const Tag = React.memo(function Tag({
|
||||
'flex-shrink-0 opacity-80 transition-opacity hover:opacity-100 focus:outline-none',
|
||||
variant === 'invalid'
|
||||
? 'text-[var(--text-error)]'
|
||||
: 'text-[#1d4ed8] dark:text-[#93c5fd]'
|
||||
: variant === 'secondary'
|
||||
? 'text-[var(--text-tertiary)]'
|
||||
: 'text-[#1d4ed8] dark:text-[#93c5fd]'
|
||||
)}
|
||||
aria-label={`Remove ${value}`}
|
||||
>
|
||||
@@ -192,6 +196,8 @@ export interface TagInputProps extends VariantProps<typeof tagInputVariants> {
|
||||
renderTagSuffix?: (value: string, index: number) => React.ReactNode
|
||||
/** Options for enabling file input (drag/drop and file picker) */
|
||||
fileInputOptions?: FileInputOptions
|
||||
/** Variant for valid tags (defaults to 'default') */
|
||||
tagVariant?: 'default' | 'secondary'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,6 +228,7 @@ const TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(
|
||||
triggerKeys = ['Enter', ',', ' '],
|
||||
renderTagSuffix,
|
||||
fileInputOptions,
|
||||
tagVariant = 'default',
|
||||
variant,
|
||||
},
|
||||
ref
|
||||
@@ -399,7 +406,7 @@ const TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(
|
||||
<Tag
|
||||
key={`item-${index}`}
|
||||
value={item.value}
|
||||
variant={item.isValid ? 'default' : 'invalid'}
|
||||
variant={item.isValid ? tagVariant : 'invalid'}
|
||||
onRemove={() => onRemove(item.value, index, item.isValid)}
|
||||
disabled={disabled}
|
||||
suffix={item.isValid ? renderTagSuffix?.(item.value, index) : undefined}
|
||||
@@ -409,7 +416,7 @@ const TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(
|
||||
className={cn(
|
||||
'flex items-center',
|
||||
inputValue.trim() &&
|
||||
cn(tagVariants({ variant: 'default' }), 'gap-0 py-0 pr-0 pl-[4px] opacity-80')
|
||||
cn(tagVariants({ variant: tagVariant }), 'gap-0 py-0 pr-0 pl-[4px] opacity-80')
|
||||
)}
|
||||
>
|
||||
<div className='relative inline-flex'>
|
||||
|
||||
@@ -4086,6 +4086,31 @@ export function McpIcon(props: SVGProps<SVGSVGElement>) {
|
||||
)
|
||||
}
|
||||
|
||||
export function A2AIcon(props: SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg {...props} viewBox='0 0 860 860' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||||
<circle cx='544' cy='307' r='27' fill='currentColor' />
|
||||
<circle cx='154' cy='307' r='27' fill='currentColor' />
|
||||
<circle cx='706' cy='307' r='27' fill='currentColor' />
|
||||
<circle cx='316' cy='307' r='27' fill='currentColor' />
|
||||
<path
|
||||
d='M336.5 191.003H162C97.6588 191.003 45.5 243.162 45.5 307.503C45.5 371.844 97.6442 424.003 161.985 424.003C206.551 424.003 256.288 424.003 296.5 424.003C487.5 424.003 374 191.005 569 191.001C613.886 191 658.966 191 698.025 191C762.366 191.001 814.5 243.16 814.5 307.501C814.5 371.843 762.34 424.003 697.998 424.003H523.5'
|
||||
stroke='currentColor'
|
||||
strokeWidth='48'
|
||||
strokeLinecap='round'
|
||||
/>
|
||||
<path
|
||||
d='M256 510.002C270.359 510.002 282 521.643 282 536.002C282 550.361 270.359 562.002 256 562.002H148C133.641 562.002 122 550.361 122 536.002C122 521.643 133.641 510.002 148 510.002H256ZM712 510.002C726.359 510.002 738 521.643 738 536.002C738 550.361 726.359 562.002 712 562.002H360C345.641 562.002 334 550.361 334 536.002C334 521.643 345.641 510.002 360 510.002H712Z'
|
||||
fill='currentColor'
|
||||
/>
|
||||
<path
|
||||
d='M444 628.002C458.359 628.002 470 639.643 470 654.002C470 668.361 458.359 680.002 444 680.002H100C85.6406 680.002 74 668.361 74 654.002C74 639.643 85.6406 628.002 100 628.002H444ZM548 628.002C562.359 628.002 574 639.643 574 654.002C574 668.361 562.359 680.002 548 680.002C533.641 680.002 522 668.361 522 654.002C522 639.643 533.641 628.002 548 628.002ZM760 628.002C774.359 628.002 786 639.643 786 654.002C786 668.361 774.359 680.002 760 680.002H652C637.641 680.002 626 668.361 626 654.002C626 639.643 637.641 628.002 652 628.002H760Z'
|
||||
fill='currentColor'
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export function WordpressIcon(props: SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25.925 25.925'>
|
||||
|
||||
Reference in New Issue
Block a user