@ai-matrx/agents 0.7.1 → 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.
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ComponentType, ReactNode, Ref } from 'react';
2
+ import { ComponentType, ReactNode, Ref, SVGProps } from 'react';
3
3
 
4
4
  /**
5
5
  * `@ai-matrx/agents/catalog` — the row shape and the per-consumer view state.
@@ -42,6 +42,39 @@ type AgentCatalogAgentType = "user" | "builtin";
42
42
  * itself rather than being coerced into a wrong one.
43
43
  */
44
44
  type AgentAccessLevel = "owner" | "admin" | "editor" | "viewer" | "system" | (string & {});
45
+ /**
46
+ * Present on a catalog row ONLY when that agent is an **Orchestra** — a
47
+ * conductor that delegates to member agents at run time. Choosing one for a
48
+ * step, a chat or a workflow node runs the whole ensemble, so a person has to
49
+ * be able to SEE that before choosing, not discover it from the run.
50
+ *
51
+ * The DB decides. `agx_get_list_full` / `agx_get_list` / `agx_search` build
52
+ * this from `platform.associations` (the conductor self-edge plus its member
53
+ * edges) in one `agx_orchestra_badges()` join — never a second fetch, and
54
+ * never a per-row read. `null` for every ordinary agent.
55
+ *
56
+ * History: the badge lived only in the Python `GET /agents` route, so every
57
+ * client lost it when the pickers moved to the RPC. It is a ROW FIELD now, in
58
+ * the one read every client shares.
59
+ */
60
+ interface OrchestraBadge {
61
+ /** How the ensemble runs: `supervisor` | `sequential` | `parallel` | `dag`, or a future mode verbatim. */
62
+ mode: string;
63
+ /** The composition's one-line description, when its author wrote one. */
64
+ tagline: string | null;
65
+ /**
66
+ * The per-composition delegation-depth budget AS DECLARED, or `null` when
67
+ * the composition declares none. Deliberately NOT defaulted here: the
68
+ * platform's fallback ceiling is enforced by the server that runs the
69
+ * ensemble, and a badge that invented a number would be reporting a promise
70
+ * nobody made.
71
+ */
72
+ depthBudget: number | null;
73
+ /** Member edges. From the ROW count, so an unlabelled ensemble still counts. */
74
+ memberCount: number;
75
+ /** Only REAL role titles — an ensemble with unlabelled edges yields `[]`. */
76
+ memberTitles: string[];
77
+ }
45
78
  /**
46
79
  * One `agx_get_list_full()` row, camelCased. Nineteen columns, no more:
47
80
  * anything richer needs a different read and is a different type.
@@ -66,6 +99,12 @@ interface AgentSummary {
66
99
  isOwner: boolean | null;
67
100
  accessLevel: AgentAccessLevel | null;
68
101
  sharedByEmail: string | null;
102
+ /**
103
+ * The Orchestra badge, or `null` for an ordinary agent. Strict: every row
104
+ * carries the key, so a surface reads `agent.orchestra` and never has to ask
105
+ * whether the column existed.
106
+ */
107
+ orchestra: OrchestraBadge | null;
69
108
  /**
70
109
  * Set only on a mandate default row — the key it resolved through, so a
71
110
  * host can tell "the default" from a stored agent without parsing the id.
@@ -73,6 +112,21 @@ interface AgentSummary {
73
112
  mandateKey?: string;
74
113
  }
75
114
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
115
+ /**
116
+ * The sort choices a picker offers, in order. PURE DATA, so it lives in the
117
+ * pure entry: a server-reachable manifest reads it at module scope, and
118
+ * importing it from the client-stamped `./catalog/react` bundle dragged React
119
+ * into a server graph for the sake of five string pairs. `./catalog/react`
120
+ * re-exports it unchanged, so no consumer has to move.
121
+ *
122
+ * (Written "client-stamped", never with the literal directive: this comment is
123
+ * emitted into `dist/catalog/index.d.ts`, and the tarball canary rightly
124
+ * refuses that directive anywhere in a PURE entry.)
125
+ */
126
+ declare const SORT_OPTIONS: {
127
+ value: AgentSortOption;
128
+ label: string;
129
+ }[];
76
130
  /** Which ownership tab is active in the agent list. */
77
131
  type AgentTab = "mine" | "shared" | "all" | "system";
78
132
  /** Favorite filter. */
@@ -259,6 +313,18 @@ interface AgentCatalogSchemaReport {
259
313
  answered: string[];
260
314
  /** True when `agent.definition.is_favorite` is writable by this caller. */
261
315
  favoriteWritable: boolean | null;
316
+ /**
317
+ * Whether `agx_get_list_full` carries the `orchestra` badge column (added to
318
+ * the platform 2026-09-08).
319
+ *
320
+ * NOT a violation when absent — the picker degrades to no conductor marker,
321
+ * which is honest — but it is never SILENT either: a `false` here is the one
322
+ * signal that tells a host "this database predates the badge" instead of
323
+ * leaving someone to wonder why their Orchestra looks like a plain agent.
324
+ * `null` means the probe could not tell (the caller can see no agents at
325
+ * all), never "fine".
326
+ */
327
+ orchestraColumn: boolean | null;
262
328
  }
263
329
  interface AssertAgentCatalogSchemaOptions {
264
330
  /**
@@ -352,10 +418,23 @@ interface AgentCatalog {
352
418
  }
353
419
 
354
420
  /**
355
- * The anchor a row renders for cmd/ctrl-click. DEFAULT: a plain `<a>` — which
356
- * is a REAL, working link in every framework. A Next.js host passes
357
- * `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`.
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.
358
431
  */
432
+ interface AgentCatalogLinkClickEvent {
433
+ metaKey?: boolean;
434
+ ctrlKey?: boolean;
435
+ preventDefault(): void;
436
+ stopPropagation(): void;
437
+ }
359
438
  type AgentCatalogLinkComponent = ComponentType<{
360
439
  href: string;
361
440
  className?: string;
@@ -363,7 +442,7 @@ type AgentCatalogLinkComponent = ComponentType<{
363
442
  rel?: string;
364
443
  title?: string;
365
444
  "aria-label"?: string;
366
- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
445
+ onClick?: (e: AgentCatalogLinkClickEvent) => void;
367
446
  children: ReactNode;
368
447
  }>;
369
448
  /** Render a model id as whatever door the host has. DEFAULT: plain text. */
@@ -372,9 +451,9 @@ type AgentCatalogRenderModelRef = (args: {
372
451
  className?: string;
373
452
  }) => ReactNode;
374
453
  interface AgentCatalogUiPorts {
375
- /** DEFAULT: `window.location.assign`. */
454
+ /** DEFAULT (web): `window.location.assign`. DEFAULT (native): a reporting no-op. */
376
455
  navigate?: AgentCatalogNavigate;
377
- /** DEFAULT: a plain `<a>`. */
456
+ /** DEFAULT: a plain `<a>` (web) / a pressable `Text` (native). */
378
457
  LinkComponent?: AgentCatalogLinkComponent;
379
458
  /** DEFAULT: the model id as plain text. */
380
459
  renderModelRef?: AgentCatalogRenderModelRef;
@@ -383,14 +462,10 @@ interface AgentCatalogUiPorts {
383
462
  /**
384
463
  * Portal container for the desktop popover, when the picker is mounted
385
464
  * inside a dialog. DEFAULT: the document body (Radix's own default).
465
+ * Web only — the native entry ignores it.
386
466
  */
387
467
  popoverContainer?: HTMLElement | null;
388
468
  }
389
- interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
390
- catalog: AgentCatalog;
391
- children: ReactNode;
392
- }
393
- declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
394
469
  /** The headless catalog this tree is bound to. Throws with no provider. */
395
470
  declare function useAgentCatalog(): AgentCatalog;
396
471
  /** The UI ports this tree is bound to, with every default already applied. */
@@ -408,6 +483,30 @@ declare function useAgentCatalogState<T>(select: (state: AgentCatalogState) => T
408
483
  /** Every row currently in the catalogue, as one stable array. */
409
484
  declare function useAgentCatalogRows(): AgentSummary[];
410
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
+
411
510
  interface UseAgentConsumerReturn {
412
511
  tab: AgentTab;
413
512
  sortBy: AgentSortOption;
@@ -464,26 +563,17 @@ declare function useAgentConsumer(consumerId: string, options?: {
464
563
  initialTab?: AgentTab;
465
564
  }): UseAgentConsumerReturn;
466
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
+ */
467
571
  interface AgentListTabCounts {
468
572
  mine: number;
469
573
  shared: number;
470
574
  all: number;
471
575
  system: number;
472
576
  }
473
- interface AgentListTabsProps {
474
- consumer: UseAgentConsumerReturn;
475
- tabCounts: AgentListTabCounts;
476
- /** Limit the ownership tabs for constrained pickers. */
477
- visibleTabs?: readonly AgentTab[] | undefined;
478
- /**
479
- * Label for the builtin-agent tab. Users see "Public" (that is what a
480
- * platform agent is to them); ADMIN surfaces pass "System", because there
481
- * these are the agents they own and maintain.
482
- */
483
- systemTabLabel?: string | undefined;
484
- }
485
- declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
486
-
487
577
  interface AgentListCoreOptions {
488
578
  consumerId: string;
489
579
  onSelect?: (agentId: string) => void;
@@ -641,16 +731,26 @@ interface AgentListInlinePickerProps {
641
731
  }
642
732
  declare function AgentListInlinePicker({ consumerId, onSelect, activeAgentId, className, autoFocusSearch, initialTab, includeSystemInAll, visibleTabs, systemTabLabel, resolveAgentHref, showPinnedAgent, excludeAgentIds, defaultMandateKey, }: AgentListInlinePickerProps): react.JSX.Element;
643
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
+
644
748
  /**
645
749
  * catalog/react/types.ts — VERBATIM port of matrx-frontend
646
750
  * `features/agents/components/agent-listings/core/types.ts`.
647
751
  */
648
-
649
752
  type RightPanel = "detail" | "sort" | "categories" | "tags" | null;
650
- declare const SORT_OPTIONS: {
651
- value: AgentSortOption;
652
- label: string;
653
- }[];
753
+
654
754
  declare const PANEL_HEIGHT = "528px";
655
755
  /**
656
756
  * 🚨 THE PANEL NEVER OUTGROWS THE SPACE IT HAS.
@@ -816,4 +916,43 @@ declare function SidePanelHeader({ title, onClose, }: {
816
916
  onClose: () => void;
817
917
  }): react.JSX.Element;
818
918
 
819
- export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, LIST_MAX_HEIGHT, OptionRow, PANEL_HEIGHT, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
919
+ type IconProps = SVGProps<SVGSVGElement> & {
920
+ className?: string;
921
+ };
922
+ /**
923
+ * The Orchestra marker (Lucide `music-4`): the glyph the Workflow Studio's
924
+ * picker used for a conductor, kept identical so the same agent wears the same
925
+ * mark in every client.
926
+ */
927
+ declare const Music4Icon: (props: IconProps) => react.JSX.Element;
928
+
929
+ /**
930
+ * catalog/orchestra.ts — @ai-matrx/agents/catalog
931
+ *
932
+ * Creator words for an Orchestra badge. A VERBATIM port of the helpers the
933
+ * Workflow Studio's hand-rolled picker carried (`apps/workflow-studio/src/
934
+ * hooks/use-agents.ts` before `c0f958b43`), lifted here so every client says
935
+ * the same sentence about the same ensemble.
936
+ *
937
+ * Pure — no React, no DOM. The row shape is `OrchestraBadge` in `./types`.
938
+ */
939
+
940
+ declare function orchestraModeLabel(mode: string): string;
941
+ /** Human label for a badge: "Orchestra · supervisor · 3 members" (singular-safe). */
942
+ declare function orchestraLabel(badge: OrchestraBadge): string;
943
+ /**
944
+ * The member-call ceiling in Creator language ("Team members can call helpers
945
+ * up to 2 levels deep"), or `null` when the composition declared none. A badge
946
+ * never invents the platform default: the server that runs the ensemble owns
947
+ * that number, and printing a promise nobody made is worse than printing
948
+ * nothing.
949
+ */
950
+ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
951
+ /**
952
+ * One visible line naming who the Orchestra delegates to, collapsing past
953
+ * `limit` into "+N more". `null` when no member carries a real role title —
954
+ * "Member, Member, Member" is noise that reads like data.
955
+ */
956
+ declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
957
+
958
+ export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ComponentType, ReactNode, Ref } from 'react';
2
+ import { ComponentType, ReactNode, Ref, SVGProps } from 'react';
3
3
 
4
4
  /**
5
5
  * `@ai-matrx/agents/catalog` — the row shape and the per-consumer view state.
@@ -42,6 +42,39 @@ type AgentCatalogAgentType = "user" | "builtin";
42
42
  * itself rather than being coerced into a wrong one.
43
43
  */
44
44
  type AgentAccessLevel = "owner" | "admin" | "editor" | "viewer" | "system" | (string & {});
45
+ /**
46
+ * Present on a catalog row ONLY when that agent is an **Orchestra** — a
47
+ * conductor that delegates to member agents at run time. Choosing one for a
48
+ * step, a chat or a workflow node runs the whole ensemble, so a person has to
49
+ * be able to SEE that before choosing, not discover it from the run.
50
+ *
51
+ * The DB decides. `agx_get_list_full` / `agx_get_list` / `agx_search` build
52
+ * this from `platform.associations` (the conductor self-edge plus its member
53
+ * edges) in one `agx_orchestra_badges()` join — never a second fetch, and
54
+ * never a per-row read. `null` for every ordinary agent.
55
+ *
56
+ * History: the badge lived only in the Python `GET /agents` route, so every
57
+ * client lost it when the pickers moved to the RPC. It is a ROW FIELD now, in
58
+ * the one read every client shares.
59
+ */
60
+ interface OrchestraBadge {
61
+ /** How the ensemble runs: `supervisor` | `sequential` | `parallel` | `dag`, or a future mode verbatim. */
62
+ mode: string;
63
+ /** The composition's one-line description, when its author wrote one. */
64
+ tagline: string | null;
65
+ /**
66
+ * The per-composition delegation-depth budget AS DECLARED, or `null` when
67
+ * the composition declares none. Deliberately NOT defaulted here: the
68
+ * platform's fallback ceiling is enforced by the server that runs the
69
+ * ensemble, and a badge that invented a number would be reporting a promise
70
+ * nobody made.
71
+ */
72
+ depthBudget: number | null;
73
+ /** Member edges. From the ROW count, so an unlabelled ensemble still counts. */
74
+ memberCount: number;
75
+ /** Only REAL role titles — an ensemble with unlabelled edges yields `[]`. */
76
+ memberTitles: string[];
77
+ }
45
78
  /**
46
79
  * One `agx_get_list_full()` row, camelCased. Nineteen columns, no more:
47
80
  * anything richer needs a different read and is a different type.
@@ -66,6 +99,12 @@ interface AgentSummary {
66
99
  isOwner: boolean | null;
67
100
  accessLevel: AgentAccessLevel | null;
68
101
  sharedByEmail: string | null;
102
+ /**
103
+ * The Orchestra badge, or `null` for an ordinary agent. Strict: every row
104
+ * carries the key, so a surface reads `agent.orchestra` and never has to ask
105
+ * whether the column existed.
106
+ */
107
+ orchestra: OrchestraBadge | null;
69
108
  /**
70
109
  * Set only on a mandate default row — the key it resolved through, so a
71
110
  * host can tell "the default" from a stored agent without parsing the id.
@@ -73,6 +112,21 @@ interface AgentSummary {
73
112
  mandateKey?: string;
74
113
  }
75
114
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
115
+ /**
116
+ * The sort choices a picker offers, in order. PURE DATA, so it lives in the
117
+ * pure entry: a server-reachable manifest reads it at module scope, and
118
+ * importing it from the client-stamped `./catalog/react` bundle dragged React
119
+ * into a server graph for the sake of five string pairs. `./catalog/react`
120
+ * re-exports it unchanged, so no consumer has to move.
121
+ *
122
+ * (Written "client-stamped", never with the literal directive: this comment is
123
+ * emitted into `dist/catalog/index.d.ts`, and the tarball canary rightly
124
+ * refuses that directive anywhere in a PURE entry.)
125
+ */
126
+ declare const SORT_OPTIONS: {
127
+ value: AgentSortOption;
128
+ label: string;
129
+ }[];
76
130
  /** Which ownership tab is active in the agent list. */
77
131
  type AgentTab = "mine" | "shared" | "all" | "system";
78
132
  /** Favorite filter. */
@@ -259,6 +313,18 @@ interface AgentCatalogSchemaReport {
259
313
  answered: string[];
260
314
  /** True when `agent.definition.is_favorite` is writable by this caller. */
261
315
  favoriteWritable: boolean | null;
316
+ /**
317
+ * Whether `agx_get_list_full` carries the `orchestra` badge column (added to
318
+ * the platform 2026-09-08).
319
+ *
320
+ * NOT a violation when absent — the picker degrades to no conductor marker,
321
+ * which is honest — but it is never SILENT either: a `false` here is the one
322
+ * signal that tells a host "this database predates the badge" instead of
323
+ * leaving someone to wonder why their Orchestra looks like a plain agent.
324
+ * `null` means the probe could not tell (the caller can see no agents at
325
+ * all), never "fine".
326
+ */
327
+ orchestraColumn: boolean | null;
262
328
  }
263
329
  interface AssertAgentCatalogSchemaOptions {
264
330
  /**
@@ -352,10 +418,23 @@ interface AgentCatalog {
352
418
  }
353
419
 
354
420
  /**
355
- * The anchor a row renders for cmd/ctrl-click. DEFAULT: a plain `<a>` — which
356
- * is a REAL, working link in every framework. A Next.js host passes
357
- * `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`.
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.
358
431
  */
432
+ interface AgentCatalogLinkClickEvent {
433
+ metaKey?: boolean;
434
+ ctrlKey?: boolean;
435
+ preventDefault(): void;
436
+ stopPropagation(): void;
437
+ }
359
438
  type AgentCatalogLinkComponent = ComponentType<{
360
439
  href: string;
361
440
  className?: string;
@@ -363,7 +442,7 @@ type AgentCatalogLinkComponent = ComponentType<{
363
442
  rel?: string;
364
443
  title?: string;
365
444
  "aria-label"?: string;
366
- onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
445
+ onClick?: (e: AgentCatalogLinkClickEvent) => void;
367
446
  children: ReactNode;
368
447
  }>;
369
448
  /** Render a model id as whatever door the host has. DEFAULT: plain text. */
@@ -372,9 +451,9 @@ type AgentCatalogRenderModelRef = (args: {
372
451
  className?: string;
373
452
  }) => ReactNode;
374
453
  interface AgentCatalogUiPorts {
375
- /** DEFAULT: `window.location.assign`. */
454
+ /** DEFAULT (web): `window.location.assign`. DEFAULT (native): a reporting no-op. */
376
455
  navigate?: AgentCatalogNavigate;
377
- /** DEFAULT: a plain `<a>`. */
456
+ /** DEFAULT: a plain `<a>` (web) / a pressable `Text` (native). */
378
457
  LinkComponent?: AgentCatalogLinkComponent;
379
458
  /** DEFAULT: the model id as plain text. */
380
459
  renderModelRef?: AgentCatalogRenderModelRef;
@@ -383,14 +462,10 @@ interface AgentCatalogUiPorts {
383
462
  /**
384
463
  * Portal container for the desktop popover, when the picker is mounted
385
464
  * inside a dialog. DEFAULT: the document body (Radix's own default).
465
+ * Web only — the native entry ignores it.
386
466
  */
387
467
  popoverContainer?: HTMLElement | null;
388
468
  }
389
- interface AgentCatalogProviderProps extends AgentCatalogUiPorts {
390
- catalog: AgentCatalog;
391
- children: ReactNode;
392
- }
393
- declare function AgentCatalogProvider({ catalog, children, ...ports }: AgentCatalogProviderProps): react.JSX.Element;
394
469
  /** The headless catalog this tree is bound to. Throws with no provider. */
395
470
  declare function useAgentCatalog(): AgentCatalog;
396
471
  /** The UI ports this tree is bound to, with every default already applied. */
@@ -408,6 +483,30 @@ declare function useAgentCatalogState<T>(select: (state: AgentCatalogState) => T
408
483
  /** Every row currently in the catalogue, as one stable array. */
409
484
  declare function useAgentCatalogRows(): AgentSummary[];
410
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
+
411
510
  interface UseAgentConsumerReturn {
412
511
  tab: AgentTab;
413
512
  sortBy: AgentSortOption;
@@ -464,26 +563,17 @@ declare function useAgentConsumer(consumerId: string, options?: {
464
563
  initialTab?: AgentTab;
465
564
  }): UseAgentConsumerReturn;
466
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
+ */
467
571
  interface AgentListTabCounts {
468
572
  mine: number;
469
573
  shared: number;
470
574
  all: number;
471
575
  system: number;
472
576
  }
473
- interface AgentListTabsProps {
474
- consumer: UseAgentConsumerReturn;
475
- tabCounts: AgentListTabCounts;
476
- /** Limit the ownership tabs for constrained pickers. */
477
- visibleTabs?: readonly AgentTab[] | undefined;
478
- /**
479
- * Label for the builtin-agent tab. Users see "Public" (that is what a
480
- * platform agent is to them); ADMIN surfaces pass "System", because there
481
- * these are the agents they own and maintain.
482
- */
483
- systemTabLabel?: string | undefined;
484
- }
485
- declare function AgentListTabs({ consumer, tabCounts, systemTabLabel, visibleTabs, }: AgentListTabsProps): react.JSX.Element;
486
-
487
577
  interface AgentListCoreOptions {
488
578
  consumerId: string;
489
579
  onSelect?: (agentId: string) => void;
@@ -641,16 +731,26 @@ interface AgentListInlinePickerProps {
641
731
  }
642
732
  declare function AgentListInlinePicker({ consumerId, onSelect, activeAgentId, className, autoFocusSearch, initialTab, includeSystemInAll, visibleTabs, systemTabLabel, resolveAgentHref, showPinnedAgent, excludeAgentIds, defaultMandateKey, }: AgentListInlinePickerProps): react.JSX.Element;
643
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
+
644
748
  /**
645
749
  * catalog/react/types.ts — VERBATIM port of matrx-frontend
646
750
  * `features/agents/components/agent-listings/core/types.ts`.
647
751
  */
648
-
649
752
  type RightPanel = "detail" | "sort" | "categories" | "tags" | null;
650
- declare const SORT_OPTIONS: {
651
- value: AgentSortOption;
652
- label: string;
653
- }[];
753
+
654
754
  declare const PANEL_HEIGHT = "528px";
655
755
  /**
656
756
  * 🚨 THE PANEL NEVER OUTGROWS THE SPACE IT HAS.
@@ -816,4 +916,43 @@ declare function SidePanelHeader({ title, onClose, }: {
816
916
  onClose: () => void;
817
917
  }): react.JSX.Element;
818
918
 
819
- export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, LIST_MAX_HEIGHT, OptionRow, PANEL_HEIGHT, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };
919
+ type IconProps = SVGProps<SVGSVGElement> & {
920
+ className?: string;
921
+ };
922
+ /**
923
+ * The Orchestra marker (Lucide `music-4`): the glyph the Workflow Studio's
924
+ * picker used for a conductor, kept identical so the same agent wears the same
925
+ * mark in every client.
926
+ */
927
+ declare const Music4Icon: (props: IconProps) => react.JSX.Element;
928
+
929
+ /**
930
+ * catalog/orchestra.ts — @ai-matrx/agents/catalog
931
+ *
932
+ * Creator words for an Orchestra badge. A VERBATIM port of the helpers the
933
+ * Workflow Studio's hand-rolled picker carried (`apps/workflow-studio/src/
934
+ * hooks/use-agents.ts` before `c0f958b43`), lifted here so every client says
935
+ * the same sentence about the same ensemble.
936
+ *
937
+ * Pure — no React, no DOM. The row shape is `OrchestraBadge` in `./types`.
938
+ */
939
+
940
+ declare function orchestraModeLabel(mode: string): string;
941
+ /** Human label for a badge: "Orchestra · supervisor · 3 members" (singular-safe). */
942
+ declare function orchestraLabel(badge: OrchestraBadge): string;
943
+ /**
944
+ * The member-call ceiling in Creator language ("Team members can call helpers
945
+ * up to 2 levels deep"), or `null` when the composition declared none. A badge
946
+ * never invents the platform default: the server that runs the ensemble owns
947
+ * that number, and printing a promise nobody made is worse than printing
948
+ * nothing.
949
+ */
950
+ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
951
+ /**
952
+ * One visible line naming who the Orchestra delegates to, collapsing past
953
+ * `limit` into "+N more". `null` when no member carries a real role title —
954
+ * "Member, Member, Member" is noise that reads like data.
955
+ */
956
+ declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
957
+
958
+ export { type AgentCatalogLinkComponent, AgentCatalogProvider, type AgentCatalogProviderProps, type AgentCatalogRenderModelRef, type AgentCatalogUiPorts, AgentCategoriesPanel, type AgentCategoriesPanelProps, AgentDetailCard, type AgentDetailCardProps, AgentFilterBar, type AgentFilterBarProps, AgentListContent, type AgentListContentProps, type AgentListCoreOptions, AgentListDropdown, type AgentListDropdownProps, AgentListInlinePicker, type AgentListInlinePickerProps, type AgentListTabCounts, AgentListTabs, AgentMobileSubView, type AgentMobileSubViewProps, AgentRow, type AgentRowProps, AgentSortPanel, type AgentSortPanelProps, AgentTagsPanel, type AgentTagsPanelProps, CheckRow, FavoriteAgentButton, FilterChip, HOVER_GRACE_MS, type IconProps, LIST_MAX_HEIGHT, Music4Icon, OptionRow, type OrchestraBadge, PANEL_HEIGHT, type RightPanel, SORT_OPTIONS, SearchInput, SidePanelHeader, type UseAgentConsumerReturn, coerceVisibleTab, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, useAgentCatalog, useAgentCatalogRows, useAgentCatalogState, useAgentCatalogUiPorts, useAgentConsumer, useAgentListCore };