@ai-matrx/agents 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -418,10 +418,23 @@ interface AgentCatalog {
418
418
  }
419
419
 
420
420
  /**
421
- * The anchor a row renders for cmd/ctrl-click. DEFAULT: a plain `<a>` — which
422
- * is a REAL, working link in every framework. A Next.js host passes
423
- * `next/link`; a TanStack host passes its own `Link`.
421
+ * The anchor a row renders for cmd/ctrl-click. DEFAULT (web): a plain `<a>` —
422
+ * which is a REAL, working link in every framework. A Next.js host passes
423
+ * `next/link`; a TanStack host passes its own `Link`. On React Native the
424
+ * default is a pressable `Text` that routes through `navigate`.
424
425
  */
426
+ /**
427
+ * What a row's link handler receives. A DOM `React.MouseEvent` satisfies this
428
+ * structurally, and the native default link supplies the two methods itself —
429
+ * so a shared component can call `preventDefault()` on either platform
430
+ * without a platform check.
431
+ */
432
+ interface AgentCatalogLinkClickEvent {
433
+ metaKey?: boolean;
434
+ ctrlKey?: boolean;
435
+ preventDefault(): void;
436
+ stopPropagation(): void;
437
+ }
425
438
  type AgentCatalogLinkComponent = ComponentType<{
426
439
  href: string;
427
440
  className?: string;
@@ -429,7 +442,7 @@ type AgentCatalogLinkComponent = ComponentType<{
429
442
  rel?: string;
430
443
  title?: string;
431
444
  "aria-label"?: string;
432
- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
445
+ onClick?: (e: AgentCatalogLinkClickEvent) => void;
433
446
  children: ReactNode;
434
447
  }>;
435
448
  /** Render a model id as whatever door the host has. DEFAULT: plain text. */
@@ -438,9 +451,9 @@ type AgentCatalogRenderModelRef = (args: {
438
451
  className?: string;
439
452
  }) => ReactNode;
440
453
  interface AgentCatalogUiPorts {
441
- /** DEFAULT: `window.location.assign`. */
454
+ /** DEFAULT (web): `window.location.assign`. DEFAULT (native): a reporting no-op. */
442
455
  navigate?: AgentCatalogNavigate;
443
- /** DEFAULT: a plain `<a>`. */
456
+ /** DEFAULT: a plain `<a>` (web) / a pressable `Text` (native). */
444
457
  LinkComponent?: AgentCatalogLinkComponent;
445
458
  /** DEFAULT: the model id as plain text. */
446
459
  renderModelRef?: AgentCatalogRenderModelRef;
@@ -449,14 +462,10 @@ interface AgentCatalogUiPorts {
449
462
  /**
450
463
  * Portal container for the desktop popover, when the picker is mounted
451
464
  * inside a dialog. DEFAULT: the document body (Radix's own default).
465
+ * Web only — the native entry ignores it.
452
466
  */
453
467
  popoverContainer?: HTMLElement | null;
454
468
  }
455
- interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
456
- catalog: AgentCatalog;
457
- children: ReactNode;
458
- }
459
- declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
460
469
  /** The headless catalog this tree is bound to. Throws with no provider. */
461
470
  declare function useAgentCatalog(): AgentCatalog;
462
471
  /** The UI ports this tree is bound to, with every default already applied. */
@@ -474,6 +483,30 @@ declare function useAgentCatalogState<T>(select: (state: AgentCatalogState) => T
474
483
  /** Every row currently in the catalogue, as one stable array. */
475
484
  declare function useAgentCatalogRows(): AgentSummary[];
476
485
 
486
+ interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
487
+ catalog: AgentCatalog;
488
+ children: ReactNode;
489
+ }
490
+ declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
491
+
492
+ /**
493
+ * catalog/shared/useAgentConsumer.ts — VERBATIM port of matrx-frontend
494
+ * `features/agents/hooks/useAgentConsumer.ts`.
495
+ *
496
+ * Wraps a single consumer slot identified by `consumerId`. Registers the slot
497
+ * on mount, optionally unregisters on unmount, and returns every filter/sort/
498
+ * pagination value plus stable write helpers.
499
+ *
500
+ * Two seams inverted, nothing else:
501
+ * - `useAppSelector`/`useAppDispatch` → `useAgentCatalog()` + the store's
502
+ * own methods.
503
+ * - `useServerAgentSearch` (a separate frontend hook) is folded IN, because
504
+ * it was already wired here and nowhere else: EVERY agent surface that
505
+ * uses a consumer searches the full server-side set. A local-only search
506
+ * over a paginated list reports "no results" for agents that were merely
507
+ * never fetched — a wrong answer, not a missing feature.
508
+ */
509
+
477
510
  interface UseAgentConsumerReturn {
478
511
  tab: AgentTab;
479
512
  sortBy: AgentSortOption;
@@ -530,26 +563,17 @@ declare function useAgentConsumer(consumerId: string, options?: {
530
563
  initialTab?: AgentTab;
531
564
  }): UseAgentConsumerReturn;
532
565
 
566
+ /**
567
+ * The four ownership counts a tab strip prints. Declared HERE, beside the code
568
+ * that computes them, so both the web tab strip and the native one name the
569
+ * same shape (0.9.0 — it used to live in the web-only `AgentListTabs`).
570
+ */
533
571
  interface AgentListTabCounts {
534
572
  mine: number;
535
573
  shared: number;
536
574
  all: number;
537
575
  system: number;
538
576
  }
539
- interface AgentListTabsProps {
540
- consumer: UseAgentConsumerReturn;
541
- tabCounts: AgentListTabCounts;
542
- /** Limit the ownership tabs for constrained pickers. */
543
- visibleTabs?: readonly AgentTab[] | undefined;
544
- /**
545
- * Label for the builtin-agent tab. Users see "Public" (that is what a
546
- * platform agent is to them); ADMIN surfaces pass "System", because there
547
- * these are the agents they own and maintain.
548
- */
549
- systemTabLabel?: string | undefined;
550
- }
551
- declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
552
-
553
577
  interface AgentListCoreOptions {
554
578
  consumerId: string;
555
579
  onSelect?: (agentId: string) => void;
@@ -707,6 +731,20 @@ interface AgentListInlinePickerProps {
707
731
  }
708
732
  declare function AgentListInlinePicker({ consumerId, onSelect, activeAgentId, className, autoFocusSearch, initialTab, includeSystemInAll, visibleTabs, systemTabLabel, resolveAgentHref, showPinnedAgent, excludeAgentIds, defaultMandateKey, }: AgentListInlinePickerProps): react.JSX.Element;
709
733
 
734
+ interface AgentListTabsProps {
735
+ consumer: UseAgentConsumerReturn;
736
+ tabCounts: AgentListTabCounts;
737
+ /** Limit the ownership tabs for constrained pickers. */
738
+ visibleTabs?: readonly AgentTab[] | undefined;
739
+ /**
740
+ * Label for the builtin-agent tab. Users see "Public" (that is what a
741
+ * platform agent is to them); ADMIN surfaces pass "System", because there
742
+ * these are the agents they own and maintain.
743
+ */
744
+ systemTabLabel?: string | undefined;
745
+ }
746
+ declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
747
+
710
748
  /**
711
749
  * catalog/react/types.ts — VERBATIM port of matrx-frontend
712
750
  * `features/agents/components/agent-listings/core/types.ts`.
@@ -886,7 +924,7 @@ type IconProps = SVGProps<SVGSVGElement> & {
886
924
  * picker used for a conductor, kept identical so the same agent wears the same
887
925
  * mark in every client.
888
926
  */
889
- declare function Music4Icon(props: IconProps): react.JSX.Element;
927
+ declare const Music4Icon: (props: IconProps) => react.JSX.Element;
890
928
 
891
929
  /**
892
930
  * catalog/orchestra.ts — @ai-matrx/agents/catalog
@@ -418,10 +418,23 @@ interface AgentCatalog {
418
418
  }
419
419
 
420
420
  /**
421
- * The anchor a row renders for cmd/ctrl-click. DEFAULT: a plain `<a>` — which
422
- * is a REAL, working link in every framework. A Next.js host passes
423
- * `next/link`; a TanStack host passes its own `Link`.
421
+ * The anchor a row renders for cmd/ctrl-click. DEFAULT (web): a plain `<a>` —
422
+ * which is a REAL, working link in every framework. A Next.js host passes
423
+ * `next/link`; a TanStack host passes its own `Link`. On React Native the
424
+ * default is a pressable `Text` that routes through `navigate`.
424
425
  */
426
+ /**
427
+ * What a row's link handler receives. A DOM `React.MouseEvent` satisfies this
428
+ * structurally, and the native default link supplies the two methods itself —
429
+ * so a shared component can call `preventDefault()` on either platform
430
+ * without a platform check.
431
+ */
432
+ interface AgentCatalogLinkClickEvent {
433
+ metaKey?: boolean;
434
+ ctrlKey?: boolean;
435
+ preventDefault(): void;
436
+ stopPropagation(): void;
437
+ }
425
438
  type AgentCatalogLinkComponent = ComponentType<{
426
439
  href: string;
427
440
  className?: string;
@@ -429,7 +442,7 @@ type AgentCatalogLinkComponent = ComponentType<{
429
442
  rel?: string;
430
443
  title?: string;
431
444
  "aria-label"?: string;
432
- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
445
+ onClick?: (e: AgentCatalogLinkClickEvent) => void;
433
446
  children: ReactNode;
434
447
  }>;
435
448
  /** Render a model id as whatever door the host has. DEFAULT: plain text. */
@@ -438,9 +451,9 @@ type AgentCatalogRenderModelRef = (args: {
438
451
  className?: string;
439
452
  }) => ReactNode;
440
453
  interface AgentCatalogUiPorts {
441
- /** DEFAULT: `window.location.assign`. */
454
+ /** DEFAULT (web): `window.location.assign`. DEFAULT (native): a reporting no-op. */
442
455
  navigate?: AgentCatalogNavigate;
443
- /** DEFAULT: a plain `<a>`. */
456
+ /** DEFAULT: a plain `<a>` (web) / a pressable `Text` (native). */
444
457
  LinkComponent?: AgentCatalogLinkComponent;
445
458
  /** DEFAULT: the model id as plain text. */
446
459
  renderModelRef?: AgentCatalogRenderModelRef;
@@ -449,14 +462,10 @@ interface AgentCatalogUiPorts {
449
462
  /**
450
463
  * Portal container for the desktop popover, when the picker is mounted
451
464
  * inside a dialog. DEFAULT: the document body (Radix's own default).
465
+ * Web only — the native entry ignores it.
452
466
  */
453
467
  popoverContainer?: HTMLElement | null;
454
468
  }
455
- interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
456
- catalog: AgentCatalog;
457
- children: ReactNode;
458
- }
459
- declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
460
469
  /** The headless catalog this tree is bound to. Throws with no provider. */
461
470
  declare function useAgentCatalog(): AgentCatalog;
462
471
  /** The UI ports this tree is bound to, with every default already applied. */
@@ -474,6 +483,30 @@ declare function useAgentCatalogState<T>(select: (state: AgentCatalogState) => T
474
483
  /** Every row currently in the catalogue, as one stable array. */
475
484
  declare function useAgentCatalogRows(): AgentSummary[];
476
485
 
486
+ interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
487
+ catalog: AgentCatalog;
488
+ children: ReactNode;
489
+ }
490
+ declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
491
+
492
+ /**
493
+ * catalog/shared/useAgentConsumer.ts — VERBATIM port of matrx-frontend
494
+ * `features/agents/hooks/useAgentConsumer.ts`.
495
+ *
496
+ * Wraps a single consumer slot identified by `consumerId`. Registers the slot
497
+ * on mount, optionally unregisters on unmount, and returns every filter/sort/
498
+ * pagination value plus stable write helpers.
499
+ *
500
+ * Two seams inverted, nothing else:
501
+ * - `useAppSelector`/`useAppDispatch` → `useAgentCatalog()` + the store's
502
+ * own methods.
503
+ * - `useServerAgentSearch` (a separate frontend hook) is folded IN, because
504
+ * it was already wired here and nowhere else: EVERY agent surface that
505
+ * uses a consumer searches the full server-side set. A local-only search
506
+ * over a paginated list reports "no results" for agents that were merely
507
+ * never fetched — a wrong answer, not a missing feature.
508
+ */
509
+
477
510
  interface UseAgentConsumerReturn {
478
511
  tab: AgentTab;
479
512
  sortBy: AgentSortOption;
@@ -530,26 +563,17 @@ declare function useAgentConsumer(consumerId: string, options?: {
530
563
  initialTab?: AgentTab;
531
564
  }): UseAgentConsumerReturn;
532
565
 
566
+ /**
567
+ * The four ownership counts a tab strip prints. Declared HERE, beside the code
568
+ * that computes them, so both the web tab strip and the native one name the
569
+ * same shape (0.9.0 — it used to live in the web-only `AgentListTabs`).
570
+ */
533
571
  interface AgentListTabCounts {
534
572
  mine: number;
535
573
  shared: number;
536
574
  all: number;
537
575
  system: number;
538
576
  }
539
- interface AgentListTabsProps {
540
- consumer: UseAgentConsumerReturn;
541
- tabCounts: AgentListTabCounts;
542
- /** Limit the ownership tabs for constrained pickers. */
543
- visibleTabs?: readonly AgentTab[] | undefined;
544
- /**
545
- * Label for the builtin-agent tab. Users see "Public" (that is what a
546
- * platform agent is to them); ADMIN surfaces pass "System", because there
547
- * these are the agents they own and maintain.
548
- */
549
- systemTabLabel?: string | undefined;
550
- }
551
- declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
552
-
553
577
  interface AgentListCoreOptions {
554
578
  consumerId: string;
555
579
  onSelect?: (agentId: string) => void;
@@ -707,6 +731,20 @@ interface AgentListInlinePickerProps {
707
731
  }
708
732
  declare function AgentListInlinePicker({ consumerId, onSelect, activeAgentId, className, autoFocusSearch, initialTab, includeSystemInAll, visibleTabs, systemTabLabel, resolveAgentHref, showPinnedAgent, excludeAgentIds, defaultMandateKey, }: AgentListInlinePickerProps): react.JSX.Element;
709
733
 
734
+ interface AgentListTabsProps {
735
+ consumer: UseAgentConsumerReturn;
736
+ tabCounts: AgentListTabCounts;
737
+ /** Limit the ownership tabs for constrained pickers. */
738
+ visibleTabs?: readonly AgentTab[] | undefined;
739
+ /**
740
+ * Label for the builtin-agent tab. Users see "Public" (that is what a
741
+ * platform agent is to them); ADMIN surfaces pass "System", because there
742
+ * these are the agents they own and maintain.
743
+ */
744
+ systemTabLabel?: string | undefined;
745
+ }
746
+ declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
747
+
710
748
  /**
711
749
  * catalog/react/types.ts — VERBATIM port of matrx-frontend
712
750
  * `features/agents/components/agent-listings/core/types.ts`.
@@ -886,7 +924,7 @@ type IconProps = SVGProps<SVGSVGElement> & {
886
924
  * picker used for a conductor, kept identical so the same agent wears the same
887
925
  * mark in every client.
888
926
  */
889
- declare function Music4Icon(props: IconProps): react.JSX.Element;
927
+ declare const Music4Icon: (props: IconProps) => react.JSX.Element;
890
928
 
891
929
  /**
892
930
  * catalog/orchestra.ts — @ai-matrx/agents/catalog