@ai-matrx/agents 0.7.1 → 0.8.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.
@@ -45,6 +45,39 @@ type AgentCatalogAgentType = "user" | "builtin";
45
45
  * itself rather than being coerced into a wrong one.
46
46
  */
47
47
  type AgentAccessLevel = "owner" | "admin" | "editor" | "viewer" | "system" | (string & {});
48
+ /**
49
+ * Present on a catalog row ONLY when that agent is an **Orchestra** — a
50
+ * conductor that delegates to member agents at run time. Choosing one for a
51
+ * step, a chat or a workflow node runs the whole ensemble, so a person has to
52
+ * be able to SEE that before choosing, not discover it from the run.
53
+ *
54
+ * The DB decides. `agx_get_list_full` / `agx_get_list` / `agx_search` build
55
+ * this from `platform.associations` (the conductor self-edge plus its member
56
+ * edges) in one `agx_orchestra_badges()` join — never a second fetch, and
57
+ * never a per-row read. `null` for every ordinary agent.
58
+ *
59
+ * History: the badge lived only in the Python `GET /agents` route, so every
60
+ * client lost it when the pickers moved to the RPC. It is a ROW FIELD now, in
61
+ * the one read every client shares.
62
+ */
63
+ interface OrchestraBadge {
64
+ /** How the ensemble runs: `supervisor` | `sequential` | `parallel` | `dag`, or a future mode verbatim. */
65
+ mode: string;
66
+ /** The composition's one-line description, when its author wrote one. */
67
+ tagline: string | null;
68
+ /**
69
+ * The per-composition delegation-depth budget AS DECLARED, or `null` when
70
+ * the composition declares none. Deliberately NOT defaulted here: the
71
+ * platform's fallback ceiling is enforced by the server that runs the
72
+ * ensemble, and a badge that invented a number would be reporting a promise
73
+ * nobody made.
74
+ */
75
+ depthBudget: number | null;
76
+ /** Member edges. From the ROW count, so an unlabelled ensemble still counts. */
77
+ memberCount: number;
78
+ /** Only REAL role titles — an ensemble with unlabelled edges yields `[]`. */
79
+ memberTitles: string[];
80
+ }
48
81
  /**
49
82
  * One `agx_get_list_full()` row, camelCased. Nineteen columns, no more:
50
83
  * anything richer needs a different read and is a different type.
@@ -69,6 +102,12 @@ interface AgentSummary {
69
102
  isOwner: boolean | null;
70
103
  accessLevel: AgentAccessLevel | null;
71
104
  sharedByEmail: string | null;
105
+ /**
106
+ * The Orchestra badge, or `null` for an ordinary agent. Strict: every row
107
+ * carries the key, so a surface reads `agent.orchestra` and never has to ask
108
+ * whether the column existed.
109
+ */
110
+ orchestra: OrchestraBadge | null;
72
111
  /**
73
112
  * Set only on a mandate default row — the key it resolved through, so a
74
113
  * host can tell "the default" from a stored agent without parsing the id.
@@ -76,6 +115,21 @@ interface AgentSummary {
76
115
  mandateKey?: string;
77
116
  }
78
117
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
118
+ /**
119
+ * The sort choices a picker offers, in order. PURE DATA, so it lives in the
120
+ * pure entry: a server-reachable manifest reads it at module scope, and
121
+ * importing it from the client-stamped `./catalog/react` bundle dragged React
122
+ * into a server graph for the sake of five string pairs. `./catalog/react`
123
+ * re-exports it unchanged, so no consumer has to move.
124
+ *
125
+ * (Written "client-stamped", never with the literal directive: this comment is
126
+ * emitted into `dist/catalog/index.d.ts`, and the tarball canary rightly
127
+ * refuses that directive anywhere in a PURE entry.)
128
+ */
129
+ declare const SORT_OPTIONS: {
130
+ value: AgentSortOption;
131
+ label: string;
132
+ }[];
79
133
  /** Which ownership tab is active in the agent list. */
80
134
  type AgentTab = "mine" | "shared" | "all" | "system";
81
135
  /** Favorite filter. */
@@ -413,6 +467,18 @@ interface AgentCatalogSchemaReport {
413
467
  answered: string[];
414
468
  /** True when `agent.definition.is_favorite` is writable by this caller. */
415
469
  favoriteWritable: boolean | null;
470
+ /**
471
+ * Whether `agx_get_list_full` carries the `orchestra` badge column (added to
472
+ * the platform 2026-09-08).
473
+ *
474
+ * NOT a violation when absent — the picker degrades to no conductor marker,
475
+ * which is honest — but it is never SILENT either: a `false` here is the one
476
+ * signal that tells a host "this database predates the badge" instead of
477
+ * leaving someone to wonder why their Orchestra looks like a plain agent.
478
+ * `null` means the probe could not tell (the caller can see no agents at
479
+ * all), never "fine".
480
+ */
481
+ orchestraColumn: boolean | null;
416
482
  }
417
483
  interface AssertAgentCatalogSchemaOptions {
418
484
  /**
@@ -593,9 +659,14 @@ declare function writeAgentFavorite(client: AgentCatalogClient, agentId: string,
593
659
  * catalog/rows.ts — @ai-matrx/agents/catalog
594
660
  *
595
661
  * The ONE ingress for a database row. `agx_get_list_full()` and `agx_search()`
596
- * return the same 19 columns (search adds two ranking columns), so both come
662
+ * return the same list columns (search adds two ranking columns), so both come
597
663
  * through here and produce the identical `AgentSummary`.
598
664
  *
665
+ * UNKNOWN COLUMNS ARE IGNORED, BY DESIGN. Every column is read by NAME, so an
666
+ * additive platform migration (the way `orchestra` arrived) reaches consumers
667
+ * on `latest` without a package release, and an older database simply yields
668
+ * `null` for a column it does not have yet.
669
+ *
599
670
  * Typed over `unknown` on purpose: the truth of this boundary is a
600
671
  * HOST-generated Supabase type this package cannot see (the `@ai-matrx/data`
601
672
  * 0.2.1 lesson). Narrowing happens here, once, loudly — a row that is not an
@@ -609,6 +680,35 @@ declare function writeAgentFavorite(client: AgentCatalogClient, agentId: string,
609
680
  */
610
681
  declare function toAgentSummary(raw: unknown): AgentSummary | null;
611
682
 
683
+ /**
684
+ * catalog/orchestra.ts — @ai-matrx/agents/catalog
685
+ *
686
+ * Creator words for an Orchestra badge. A VERBATIM port of the helpers the
687
+ * Workflow Studio's hand-rolled picker carried (`apps/workflow-studio/src/
688
+ * hooks/use-agents.ts` before `c0f958b43`), lifted here so every client says
689
+ * the same sentence about the same ensemble.
690
+ *
691
+ * Pure — no React, no DOM. The row shape is `OrchestraBadge` in `./types`.
692
+ */
693
+
694
+ declare function orchestraModeLabel(mode: string): string;
695
+ /** Human label for a badge: "Orchestra · supervisor · 3 members" (singular-safe). */
696
+ declare function orchestraLabel(badge: OrchestraBadge): string;
697
+ /**
698
+ * The member-call ceiling in Creator language ("Team members can call helpers
699
+ * up to 2 levels deep"), or `null` when the composition declared none. A badge
700
+ * never invents the platform default: the server that runs the ensemble owns
701
+ * that number, and printing a promise nobody made is worse than printing
702
+ * nothing.
703
+ */
704
+ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
705
+ /**
706
+ * One visible line naming who the Orchestra delegates to, collapsing past
707
+ * `limit` into "+N more". `null` when no member carries a real role title —
708
+ * "Member, Member, Member" is noise that reads like data.
709
+ */
710
+ declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
711
+
612
712
  /**
613
713
  * catalog/default-row.ts — @ai-matrx/agents/catalog
614
714
  *
@@ -865,4 +965,4 @@ declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => nu
865
965
  /** @internal Test-only: forget every session-shared value. */
866
966
  declare function _resetCatalogGlobalState(): void;
867
967
 
868
- export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_NONE_SENTINEL, AGENT_SEARCH_LIMIT, type AgentAccessFilter, type AgentAccessLevel, type AgentArchFilter, type AgentCatalog, type AgentCatalogAgentType, type AgentCatalogClient, type AgentCatalogConfig, AgentCatalogConfigError, type AgentCatalogErrorSink, type AgentCatalogIdentity, type AgentCatalogLabels, type AgentCatalogNavigate, type AgentCatalogNotifier, type AgentCatalogOpenPeek, AgentCatalogReadError, type AgentCatalogResolveHref, type AgentCatalogRpcCall, type AgentCatalogSchemaReport, type AgentCatalogState, type AgentCatalogStatus, type AgentCatalogStorage, type AgentCatalogTableQuery, type AgentCatalogTransport, type AgentConsumerPatch, type AgentConsumerState, type AgentFavFilter, type AgentId, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, type AgentSortOption, type AgentSummary, type AgentTab, type AssertAgentCatalogSchemaOptions, DEFAULT_AGENT_CATALOG_LABELS, DEFAULT_AGENT_CONSUMER_STATE, type DefaultRowState, MandateDefaultRowError, type MandateResolutionVerdict, type PgErrorLike, type PgResultLike, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, type ResolvedDefaultRow, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesSearch, applyAgentSortComparator, asAgentId, assertAgentCatalogSchema, computeAgentSearchScore, createAgentCatalog, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, getRegisteredAgentCatalog, isMandateAgentId, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, mandateAgentId, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow };
968
+ export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_NONE_SENTINEL, AGENT_SEARCH_LIMIT, type AgentAccessFilter, type AgentAccessLevel, type AgentArchFilter, type AgentCatalog, type AgentCatalogAgentType, type AgentCatalogClient, type AgentCatalogConfig, AgentCatalogConfigError, type AgentCatalogErrorSink, type AgentCatalogIdentity, type AgentCatalogLabels, type AgentCatalogNavigate, type AgentCatalogNotifier, type AgentCatalogOpenPeek, AgentCatalogReadError, type AgentCatalogResolveHref, type AgentCatalogRpcCall, type AgentCatalogSchemaReport, type AgentCatalogState, type AgentCatalogStatus, type AgentCatalogStorage, type AgentCatalogTableQuery, type AgentCatalogTransport, type AgentConsumerPatch, type AgentConsumerState, type AgentFavFilter, type AgentId, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, type AgentSortOption, type AgentSummary, type AgentTab, type AssertAgentCatalogSchemaOptions, DEFAULT_AGENT_CATALOG_LABELS, DEFAULT_AGENT_CONSUMER_STATE, type DefaultRowState, MandateDefaultRowError, type MandateResolutionVerdict, type OrchestraBadge, type PgErrorLike, type PgResultLike, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, type ResolvedDefaultRow, SORT_OPTIONS, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesSearch, applyAgentSortComparator, asAgentId, assertAgentCatalogSchema, computeAgentSearchScore, createAgentCatalog, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, getRegisteredAgentCatalog, isMandateAgentId, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, mandateAgentId, memoize1, memoize2, memoize3, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow };
@@ -45,6 +45,39 @@ type AgentCatalogAgentType = "user" | "builtin";
45
45
  * itself rather than being coerced into a wrong one.
46
46
  */
47
47
  type AgentAccessLevel = "owner" | "admin" | "editor" | "viewer" | "system" | (string & {});
48
+ /**
49
+ * Present on a catalog row ONLY when that agent is an **Orchestra** — a
50
+ * conductor that delegates to member agents at run time. Choosing one for a
51
+ * step, a chat or a workflow node runs the whole ensemble, so a person has to
52
+ * be able to SEE that before choosing, not discover it from the run.
53
+ *
54
+ * The DB decides. `agx_get_list_full` / `agx_get_list` / `agx_search` build
55
+ * this from `platform.associations` (the conductor self-edge plus its member
56
+ * edges) in one `agx_orchestra_badges()` join — never a second fetch, and
57
+ * never a per-row read. `null` for every ordinary agent.
58
+ *
59
+ * History: the badge lived only in the Python `GET /agents` route, so every
60
+ * client lost it when the pickers moved to the RPC. It is a ROW FIELD now, in
61
+ * the one read every client shares.
62
+ */
63
+ interface OrchestraBadge {
64
+ /** How the ensemble runs: `supervisor` | `sequential` | `parallel` | `dag`, or a future mode verbatim. */
65
+ mode: string;
66
+ /** The composition's one-line description, when its author wrote one. */
67
+ tagline: string | null;
68
+ /**
69
+ * The per-composition delegation-depth budget AS DECLARED, or `null` when
70
+ * the composition declares none. Deliberately NOT defaulted here: the
71
+ * platform's fallback ceiling is enforced by the server that runs the
72
+ * ensemble, and a badge that invented a number would be reporting a promise
73
+ * nobody made.
74
+ */
75
+ depthBudget: number | null;
76
+ /** Member edges. From the ROW count, so an unlabelled ensemble still counts. */
77
+ memberCount: number;
78
+ /** Only REAL role titles — an ensemble with unlabelled edges yields `[]`. */
79
+ memberTitles: string[];
80
+ }
48
81
  /**
49
82
  * One `agx_get_list_full()` row, camelCased. Nineteen columns, no more:
50
83
  * anything richer needs a different read and is a different type.
@@ -69,6 +102,12 @@ interface AgentSummary {
69
102
  isOwner: boolean | null;
70
103
  accessLevel: AgentAccessLevel | null;
71
104
  sharedByEmail: string | null;
105
+ /**
106
+ * The Orchestra badge, or `null` for an ordinary agent. Strict: every row
107
+ * carries the key, so a surface reads `agent.orchestra` and never has to ask
108
+ * whether the column existed.
109
+ */
110
+ orchestra: OrchestraBadge | null;
72
111
  /**
73
112
  * Set only on a mandate default row — the key it resolved through, so a
74
113
  * host can tell "the default" from a stored agent without parsing the id.
@@ -76,6 +115,21 @@ interface AgentSummary {
76
115
  mandateKey?: string;
77
116
  }
78
117
  type AgentSortOption = "updated-desc" | "created-desc" | "name-asc" | "name-desc" | "category-asc";
118
+ /**
119
+ * The sort choices a picker offers, in order. PURE DATA, so it lives in the
120
+ * pure entry: a server-reachable manifest reads it at module scope, and
121
+ * importing it from the client-stamped `./catalog/react` bundle dragged React
122
+ * into a server graph for the sake of five string pairs. `./catalog/react`
123
+ * re-exports it unchanged, so no consumer has to move.
124
+ *
125
+ * (Written "client-stamped", never with the literal directive: this comment is
126
+ * emitted into `dist/catalog/index.d.ts`, and the tarball canary rightly
127
+ * refuses that directive anywhere in a PURE entry.)
128
+ */
129
+ declare const SORT_OPTIONS: {
130
+ value: AgentSortOption;
131
+ label: string;
132
+ }[];
79
133
  /** Which ownership tab is active in the agent list. */
80
134
  type AgentTab = "mine" | "shared" | "all" | "system";
81
135
  /** Favorite filter. */
@@ -413,6 +467,18 @@ interface AgentCatalogSchemaReport {
413
467
  answered: string[];
414
468
  /** True when `agent.definition.is_favorite` is writable by this caller. */
415
469
  favoriteWritable: boolean | null;
470
+ /**
471
+ * Whether `agx_get_list_full` carries the `orchestra` badge column (added to
472
+ * the platform 2026-09-08).
473
+ *
474
+ * NOT a violation when absent — the picker degrades to no conductor marker,
475
+ * which is honest — but it is never SILENT either: a `false` here is the one
476
+ * signal that tells a host "this database predates the badge" instead of
477
+ * leaving someone to wonder why their Orchestra looks like a plain agent.
478
+ * `null` means the probe could not tell (the caller can see no agents at
479
+ * all), never "fine".
480
+ */
481
+ orchestraColumn: boolean | null;
416
482
  }
417
483
  interface AssertAgentCatalogSchemaOptions {
418
484
  /**
@@ -593,9 +659,14 @@ declare function writeAgentFavorite(client: AgentCatalogClient, agentId: string,
593
659
  * catalog/rows.ts — @ai-matrx/agents/catalog
594
660
  *
595
661
  * The ONE ingress for a database row. `agx_get_list_full()` and `agx_search()`
596
- * return the same 19 columns (search adds two ranking columns), so both come
662
+ * return the same list columns (search adds two ranking columns), so both come
597
663
  * through here and produce the identical `AgentSummary`.
598
664
  *
665
+ * UNKNOWN COLUMNS ARE IGNORED, BY DESIGN. Every column is read by NAME, so an
666
+ * additive platform migration (the way `orchestra` arrived) reaches consumers
667
+ * on `latest` without a package release, and an older database simply yields
668
+ * `null` for a column it does not have yet.
669
+ *
599
670
  * Typed over `unknown` on purpose: the truth of this boundary is a
600
671
  * HOST-generated Supabase type this package cannot see (the `@ai-matrx/data`
601
672
  * 0.2.1 lesson). Narrowing happens here, once, loudly — a row that is not an
@@ -609,6 +680,35 @@ declare function writeAgentFavorite(client: AgentCatalogClient, agentId: string,
609
680
  */
610
681
  declare function toAgentSummary(raw: unknown): AgentSummary | null;
611
682
 
683
+ /**
684
+ * catalog/orchestra.ts — @ai-matrx/agents/catalog
685
+ *
686
+ * Creator words for an Orchestra badge. A VERBATIM port of the helpers the
687
+ * Workflow Studio's hand-rolled picker carried (`apps/workflow-studio/src/
688
+ * hooks/use-agents.ts` before `c0f958b43`), lifted here so every client says
689
+ * the same sentence about the same ensemble.
690
+ *
691
+ * Pure — no React, no DOM. The row shape is `OrchestraBadge` in `./types`.
692
+ */
693
+
694
+ declare function orchestraModeLabel(mode: string): string;
695
+ /** Human label for a badge: "Orchestra · supervisor · 3 members" (singular-safe). */
696
+ declare function orchestraLabel(badge: OrchestraBadge): string;
697
+ /**
698
+ * The member-call ceiling in Creator language ("Team members can call helpers
699
+ * up to 2 levels deep"), or `null` when the composition declared none. A badge
700
+ * never invents the platform default: the server that runs the ensemble owns
701
+ * that number, and printing a promise nobody made is worse than printing
702
+ * nothing.
703
+ */
704
+ declare function orchestraDepthLine(badge: OrchestraBadge): string | null;
705
+ /**
706
+ * One visible line naming who the Orchestra delegates to, collapsing past
707
+ * `limit` into "+N more". `null` when no member carries a real role title —
708
+ * "Member, Member, Member" is noise that reads like data.
709
+ */
710
+ declare function orchestraDelegatesLine(badge: OrchestraBadge, limit?: number): string | null;
711
+
612
712
  /**
613
713
  * catalog/default-row.ts — @ai-matrx/agents/catalog
614
714
  *
@@ -865,4 +965,4 @@ declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => nu
865
965
  /** @internal Test-only: forget every session-shared value. */
866
966
  declare function _resetCatalogGlobalState(): void;
867
967
 
868
- export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_NONE_SENTINEL, AGENT_SEARCH_LIMIT, type AgentAccessFilter, type AgentAccessLevel, type AgentArchFilter, type AgentCatalog, type AgentCatalogAgentType, type AgentCatalogClient, type AgentCatalogConfig, AgentCatalogConfigError, type AgentCatalogErrorSink, type AgentCatalogIdentity, type AgentCatalogLabels, type AgentCatalogNavigate, type AgentCatalogNotifier, type AgentCatalogOpenPeek, AgentCatalogReadError, type AgentCatalogResolveHref, type AgentCatalogRpcCall, type AgentCatalogSchemaReport, type AgentCatalogState, type AgentCatalogStatus, type AgentCatalogStorage, type AgentCatalogTableQuery, type AgentCatalogTransport, type AgentConsumerPatch, type AgentConsumerState, type AgentFavFilter, type AgentId, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, type AgentSortOption, type AgentSummary, type AgentTab, type AssertAgentCatalogSchemaOptions, DEFAULT_AGENT_CATALOG_LABELS, DEFAULT_AGENT_CONSUMER_STATE, type DefaultRowState, MandateDefaultRowError, type MandateResolutionVerdict, type PgErrorLike, type PgResultLike, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, type ResolvedDefaultRow, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesSearch, applyAgentSortComparator, asAgentId, assertAgentCatalogSchema, computeAgentSearchScore, createAgentCatalog, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, getRegisteredAgentCatalog, isMandateAgentId, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, mandateAgentId, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow };
968
+ export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_NONE_SENTINEL, AGENT_SEARCH_LIMIT, type AgentAccessFilter, type AgentAccessLevel, type AgentArchFilter, type AgentCatalog, type AgentCatalogAgentType, type AgentCatalogClient, type AgentCatalogConfig, AgentCatalogConfigError, type AgentCatalogErrorSink, type AgentCatalogIdentity, type AgentCatalogLabels, type AgentCatalogNavigate, type AgentCatalogNotifier, type AgentCatalogOpenPeek, AgentCatalogReadError, type AgentCatalogResolveHref, type AgentCatalogRpcCall, type AgentCatalogSchemaReport, type AgentCatalogState, type AgentCatalogStatus, type AgentCatalogStorage, type AgentCatalogTableQuery, type AgentCatalogTransport, type AgentConsumerPatch, type AgentConsumerState, type AgentFavFilter, type AgentId, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, type AgentSortOption, type AgentSummary, type AgentTab, type AssertAgentCatalogSchemaOptions, DEFAULT_AGENT_CATALOG_LABELS, DEFAULT_AGENT_CONSUMER_STATE, type DefaultRowState, MandateDefaultRowError, type MandateResolutionVerdict, type OrchestraBadge, type PgErrorLike, type PgResultLike, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, type ResolvedDefaultRow, SORT_OPTIONS, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesSearch, applyAgentSortComparator, asAgentId, assertAgentCatalogSchema, computeAgentSearchScore, createAgentCatalog, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, getRegisteredAgentCatalog, isMandateAgentId, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, mandateAgentId, memoize1, memoize2, memoize3, orchestraDelegatesLine, orchestraDepthLine, orchestraLabel, orchestraModeLabel, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow };
@@ -8,6 +8,13 @@ function mandateAgentId(mandateKey) {
8
8
  function isMandateAgentId(id) {
9
9
  return id.startsWith("mandate:");
10
10
  }
11
+ var SORT_OPTIONS = [
12
+ { value: "updated-desc", label: "Recent" },
13
+ { value: "created-desc", label: "Created" },
14
+ { value: "name-asc", label: "A \u2192 Z" },
15
+ { value: "name-desc", label: "Z \u2192 A" },
16
+ { value: "category-asc", label: "Category" }
17
+ ];
11
18
  var AGENT_NONE_SENTINEL = "__none__";
12
19
  var DEFAULT_AGENT_CONSUMER_STATE = {
13
20
  tab: "mine",
@@ -77,6 +84,18 @@ function stringArray(value) {
77
84
  function agentType(value) {
78
85
  return value === "builtin" ? "builtin" : "user";
79
86
  }
87
+ function orchestraBadge(value) {
88
+ if (!isRecord(value)) return null;
89
+ const depth = value["depth_budget"];
90
+ const count = value["member_count"];
91
+ return {
92
+ mode: str(value["mode"]) ?? "supervisor",
93
+ tagline: str(value["tagline"]),
94
+ depthBudget: typeof depth === "number" && Number.isFinite(depth) && depth > 0 ? depth : null,
95
+ memberCount: typeof count === "number" && Number.isFinite(count) && count >= 0 ? count : 0,
96
+ memberTitles: stringArray(value["member_titles"])
97
+ };
98
+ }
80
99
  function toAgentSummary(raw) {
81
100
  if (!isRecord(raw)) return null;
82
101
  const id = str(raw["id"]);
@@ -100,7 +119,8 @@ function toAgentSummary(raw) {
100
119
  updatedAt: str(raw["updated_at"]),
101
120
  isOwner: boolOrNull(raw["is_owner"]),
102
121
  accessLevel: str(raw["access_level"]),
103
- sharedByEmail: str(raw["shared_by_email"])
122
+ sharedByEmail: str(raw["shared_by_email"]),
123
+ orchestra: orchestraBadge(raw["orchestra"])
104
124
  };
105
125
  }
106
126
 
@@ -338,6 +358,9 @@ function defaultRowFromResolution(resolved) {
338
358
  isOwner: null,
339
359
  accessLevel: null,
340
360
  sharedByEmail: null,
361
+ // A mandate default row is a live reference to whichever agent the mandate
362
+ // resolves to; the badge belongs to the RESOLVED agent's own catalog row.
363
+ orchestra: null,
341
364
  mandateKey: resolved.mandateKey
342
365
  };
343
366
  }
@@ -442,10 +465,14 @@ async function assertAgentCatalogSchema(client, options = {}) {
442
465
  const missing = [];
443
466
  const unreachable = [];
444
467
  const answered = [];
468
+ let orchestraColumn = null;
445
469
  for (const fn of names) {
446
470
  const args = DEMANDED_RPCS[fn] ?? {};
447
471
  try {
448
- const { error } = await client.rpc(fn, args);
472
+ const { data, error } = await client.rpc(fn, args);
473
+ if (fn === "agx_get_list_full" && error == null) {
474
+ orchestraColumn = readsOrchestraColumn(data);
475
+ }
449
476
  if (error == null) answered.push(fn);
450
477
  else if (isMissingFunctionError(error)) missing.push(fn);
451
478
  else answered.push(fn);
@@ -485,7 +512,8 @@ async function assertAgentCatalogSchema(client, options = {}) {
485
512
  missing,
486
513
  unreachable,
487
514
  answered,
488
- favoriteWritable
515
+ favoriteWritable,
516
+ orchestraColumn
489
517
  };
490
518
  if (!ok && throwOnViolation) {
491
519
  const parts = [];
@@ -503,6 +531,12 @@ async function assertAgentCatalogSchema(client, options = {}) {
503
531
  }
504
532
  return report;
505
533
  }
534
+ function readsOrchestraColumn(data) {
535
+ if (!Array.isArray(data) || data.length === 0) return null;
536
+ return data.some(
537
+ (row) => typeof row === "object" && row !== null && Object.prototype.hasOwnProperty.call(row, "orchestra")
538
+ );
539
+ }
506
540
  function isPermissionRefusal(error) {
507
541
  if (!error) return false;
508
542
  const code = error.code;
@@ -876,6 +910,33 @@ function getRegisteredAgentCatalog(catalogId = "default") {
876
910
  return found;
877
911
  }
878
912
 
913
+ // catalog/orchestra.ts
914
+ var ORCHESTRA_MODE_LABEL = {
915
+ supervisor: "supervisor",
916
+ sequential: "in order",
917
+ parallel: "together",
918
+ dag: "custom flow"
919
+ };
920
+ function orchestraModeLabel(mode) {
921
+ return ORCHESTRA_MODE_LABEL[mode] ?? mode;
922
+ }
923
+ function orchestraLabel(badge) {
924
+ const n = badge.memberCount;
925
+ return `Orchestra \xB7 ${orchestraModeLabel(badge.mode)} \xB7 ${n} ${n === 1 ? "member" : "members"}`;
926
+ }
927
+ function orchestraDepthLine(badge) {
928
+ const n = badge.depthBudget;
929
+ if (typeof n !== "number" || n <= 0) return null;
930
+ return `Team members can call helpers up to ${n} ${n === 1 ? "level" : "levels"} deep`;
931
+ }
932
+ function orchestraDelegatesLine(badge, limit = 3) {
933
+ const titles = badge.memberTitles;
934
+ if (titles.length === 0) return null;
935
+ const shown = titles.slice(0, limit);
936
+ const extra = titles.length - shown.length;
937
+ return `Delegates to: ${shown.join(", ")}${extra > 0 ? ` +${extra} more` : ""}`;
938
+ }
939
+
879
940
  // catalog/labels.ts
880
941
  function agentListEmptyLabel(tab, labels) {
881
942
  switch (tab) {
@@ -1264,6 +1325,7 @@ export {
1264
1325
  DEFAULT_AGENT_CATALOG_LABELS,
1265
1326
  DEFAULT_AGENT_CONSUMER_STATE,
1266
1327
  MandateDefaultRowError,
1328
+ SORT_OPTIONS,
1267
1329
  _resetCatalogGlobalState,
1268
1330
  agentConsumerHasActiveFilters,
1269
1331
  agentListEmptyLabel,
@@ -1295,6 +1357,10 @@ export {
1295
1357
  memoize1,
1296
1358
  memoize2,
1297
1359
  memoize3,
1360
+ orchestraDelegatesLine,
1361
+ orchestraDepthLine,
1362
+ orchestraLabel,
1363
+ orchestraModeLabel,
1298
1364
  parseMandateResolution,
1299
1365
  readAgentCatalogRows,
1300
1366
  readCachedDefaultRow,