@ai-matrx/agents 0.9.1 → 0.9.2

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
- import { A as AgentSummary, a as AgentCatalogClient, b as AgentCatalogTransport, c as AgentCatalogStorageLike, d as AgentCatalogErrorSink, R as ResolvedDefaultRow, e as AgentCatalogStorage, M as MandateResolutionVerdict, f as AgentTab, g as AgentCatalogLabels, h as AgentConsumerState, i as AgentArchFilter, j as AgentSortOption } from '../orchestra-CID-rsu8.cjs';
2
- export { k as AGENT_NONE_SENTINEL, l as AgentAccessFilter, m as AgentAccessLevel, n as AgentCatalog, o as AgentCatalogAgentType, p as AgentCatalogAsyncStorage, q as AgentCatalogConfig, r as AgentCatalogConfigError, s as AgentCatalogIdentity, t as AgentCatalogNavigate, u as AgentCatalogNotifier, v as AgentCatalogOpenPeek, w as AgentCatalogResolveHref, x as AgentCatalogRpcCall, y as AgentCatalogSchemaReport, z as AgentCatalogState, B as AgentCatalogStatus, C as AgentCatalogTableQuery, D as AgentConsumerPatch, E as AgentFavFilter, F as AgentId, G as AssertAgentCatalogSchemaOptions, H as DEFAULT_AGENT_CATALOG_LABELS, I as DEFAULT_AGENT_CONSUMER_STATE, J as DefaultRowState, O as OrchestraBadge, P as PgErrorLike, K as PgResultLike, S as SORT_OPTIONS, L as asAgentId, N as assertAgentCatalogSchema, Q as createAgentCatalog, T as getRegisteredAgentCatalog, U as isMandateAgentId, V as mandateAgentId, W as orchestraDelegatesLine, X as orchestraDepthLine, Y as orchestraLabel, Z as orchestraModeLabel } from '../orchestra-CID-rsu8.cjs';
1
+ import { A as AgentSummary, a as AgentCatalogClient, b as AgentCatalogTransport, c as AgentCatalogStorageLike, d as AgentCatalogErrorSink, R as ResolvedDefaultRow, e as AgentCatalogStorage, M as MandateResolutionVerdict, f as AgentArchFilter, g as AgentTab, h as AgentCatalogLabels, i as AgentConsumerState, j as AgentSortOption } from '../orchestra-DljbEiks.cjs';
2
+ export { k as AGENT_NONE_SENTINEL, l as ARCHIVE_FILTER_OPTIONS, m as ARCHIVE_FILTER_ORDER, n as AgentAccessFilter, o as AgentAccessLevel, p as AgentArchFilterOption, q as AgentCatalog, r as AgentCatalogAgentType, s as AgentCatalogAsyncStorage, t as AgentCatalogConfig, u as AgentCatalogConfigError, v as AgentCatalogDefaults, w as AgentCatalogIdentity, x as AgentCatalogNavigate, y as AgentCatalogNotifier, z as AgentCatalogOpenPeek, B as AgentCatalogResolveHref, C as AgentCatalogRpcCall, D as AgentCatalogSchemaReport, E as AgentCatalogState, F as AgentCatalogStatus, G as AgentCatalogTableQuery, H as AgentConsumerPatch, I as AgentFavFilter, J as AgentId, K as AssertAgentCatalogSchemaOptions, L as DEFAULT_AGENT_CATALOG_LABELS, N as DEFAULT_AGENT_CONSUMER_STATE, O as DefaultRowState, P as OrchestraBadge, Q as PgErrorLike, S as PgResultLike, T as SORT_OPTIONS, U as asAgentId, V as assertAgentCatalogSchema, W as createAgentCatalog, X as getRegisteredAgentCatalog, Y as isAgentArchFilter, Z as isMandateAgentId, _ as mandateAgentId, $ as nextArchFilter, a0 as orchestraDelegatesLine, a1 as orchestraDepthLine, a2 as orchestraLabel, a3 as orchestraModeLabel } from '../orchestra-DljbEiks.cjs';
3
3
 
4
4
  /**
5
5
  * catalog/data.ts — @ai-matrx/agents/catalog
@@ -206,6 +206,36 @@ declare function shouldDefaultAgentListToPublicTab(args: {
206
206
  ownedCount: number;
207
207
  agentsLoaded: boolean;
208
208
  }): boolean;
209
+ /** What the filter-bar chip reads in each state. */
210
+ declare function agentArchiveFilterChipLabel(archFilter: AgentArchFilter): string;
211
+ /** The platform's words for the state — menus, aria-labels, help text. */
212
+ declare function agentArchiveFilterStateLabel(archFilter: AgentArchFilter): string;
213
+ /**
214
+ * The accessible name of the ONE control, always naming the state it is IN
215
+ * and the state one click moves it to. A control whose label does not say
216
+ * what it currently does is the "dead or dishonest" shape the platform bans.
217
+ */
218
+ declare function agentArchiveFilterControlLabel(archFilter: AgentArchFilter): string;
219
+ /**
220
+ * THE FOOTER. It counts exactly what the list rendered and, whenever archived
221
+ * rows are involved, says so — hidden ones included.
222
+ *
223
+ * hide archived, nothing archived behind it → "412 agents"
224
+ * hide archived, 4 archived behind it → "412 agents · 4 archived hidden"
225
+ * show all → "416 agents · archived shown"
226
+ * archived only → "4 archived shown"
227
+ */
228
+ declare function agentListFooterLabel(args: {
229
+ /** Rows actually rendered. */
230
+ count: number;
231
+ archFilter: AgentArchFilter;
232
+ /**
233
+ * Rows this view WOULD render if the filter were flipped to "archived only"
234
+ * — exactly what the default state is keeping off the screen. Only ever
235
+ * read in the `active` state.
236
+ */
237
+ archivedHiddenCount: number;
238
+ }): string;
209
239
 
210
240
  /**
211
241
  * The structural shape a record needs to be searchable. Every field except
@@ -342,10 +372,27 @@ declare function filterUserTypeAgents(agents: readonly AgentSummary[], consumer:
342
372
  * Builtin/system agents (tab === "system").
343
373
  *
344
374
  * Gets the SAME filter surface every other tab has — search, favorites,
345
- * category, tags, sort. Ownership/archive/access filters are meaningless here
346
- * (a builtin is always active and belongs to the platform), so those are the
347
- * only ones skipped. A picker that offers less on one tab than another is the
348
- * exact half-built shape this list exists to prevent.
375
+ * category, tags, sort, AND THE ARCHIVE FILTER. Only the ownership/access
376
+ * filters are skipped, because a builtin has no owner to filter on. A picker
377
+ * that offers less on one tab than another is the exact half-built shape this
378
+ * list exists to prevent.
379
+ *
380
+ * 🚨 0.9.2 — THE BUILTIN ARCHIVE EXEMPTION IS GONE, AND IT IS NOW ILLEGAL.
381
+ *
382
+ * Until 0.9.1 this function applied no archive filter, on the theory that "a
383
+ * builtin belongs to the platform and is never the user's to archive". The
384
+ * database disagreed: `Foundry Planner`
385
+ * (`001b22f6-fa4d-40c6-a1a4-8575d4d04379`) is an ARCHIVED builtin, and it
386
+ * rendered at Public index 216 and was pickable — while Mine / Shared / All
387
+ * hid their archived rows. One picker, two rules, and a person could choose a
388
+ * retired agent from the one tab that did not obey.
389
+ *
390
+ * THE ARCHIVED-ITEMS LAW (`common-docs/policies/archived-items.md`, Arman
391
+ * 2026-09-09) closed the question for every entity at once: "everything should
392
+ * have an archive filter, and the default should always hide archived… all
393
+ * archived items should always be treated the same." Clause 4 makes it a
394
+ * class, not an instance — so there is no per-tab, per-entity or per-surface
395
+ * exemption left to grant, here or anywhere.
349
396
  */
350
397
  declare function filterBuiltinTypeAgents(agents: readonly AgentSummary[], consumer: AgentConsumerState): AgentSummary[];
351
398
  /** Factory: owned user-type agents with consumer filters applied (ignores tab). */
@@ -395,10 +442,13 @@ declare function agentConsumerHasActiveFilters(consumer: AgentConsumerState, def
395
442
  *
396
443
  * `is_archived` is now honoured by the same rule the list uses, so the badge,
397
444
  * the footer and the rows agree on every tab and under every archive filter.
398
- * The system tab is the exception with a reason: `filterBuiltinTypeAgents`
399
- * applies no archive filter (a builtin belongs to the platform and is never
400
- * the user's to archive), so its count applies none either — it already
401
- * counted exactly what it rendered.
445
+ *
446
+ * 🚨 0.9.2 — AND THERE IS NO LONGER AN EXCEPTION. The system tab used to be
447
+ * one ("a builtin is never the user's to archive"), which was false in the
448
+ * database and illegal under THE ARCHIVED-ITEMS LAW. Its badge now counts
449
+ * under the same archive rule its rows render under, so `Foundry Planner`
450
+ * leaves the Public badge and the Public list together, or returns to both
451
+ * together — never one without the other.
402
452
  */
403
453
  declare function agentMatchesArchiveFilter(agent: AgentSummary, archFilter: AgentArchFilter): boolean;
404
454
  /**
@@ -416,6 +466,12 @@ declare const selectAgentTabCounts: (a: readonly AgentSummary[], b: AgentArchFil
416
466
  declare const selectTotalUserAgentsCount: (a: readonly AgentSummary[]) => number;
417
467
  declare const selectTotalOwnedAgentsCount: (a: readonly AgentSummary[]) => number;
418
468
  declare const selectTotalSharedAgentsCount: (a: readonly AgentSummary[]) => number;
469
+ /**
470
+ * Live builtin agents the DEFAULT (`active`) list renders — archived builtins
471
+ * excluded, exactly like every other "total" beside it. Before 0.9.2 this
472
+ * counted archived builtins too, which is how an archived `Foundry Planner`
473
+ * reached the Public badge.
474
+ */
419
475
  declare const selectTotalBuiltinAgentsCount: (a: readonly AgentSummary[]) => number;
420
476
  declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => number;
421
477
 
@@ -435,4 +491,4 @@ declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => nu
435
491
  /** @internal Test-only: forget every session-shared value. */
436
492
  declare function _resetCatalogGlobalState(): void;
437
493
 
438
- export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_SEARCH_LIMIT, AgentArchFilter, AgentCatalogClient, AgentCatalogErrorSink, AgentCatalogLabels, AgentCatalogReadError, AgentCatalogStorage, AgentCatalogStorageLike, AgentCatalogTransport, AgentConsumerState, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, AgentSortOption, AgentSummary, AgentTab, MandateDefaultRowError, MandateResolutionVerdict, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, ResolvedDefaultRow, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesArchiveFilter, agentMatchesSearch, applyAgentSortComparator, compareAgentIds, computeAgentSearchScore, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readCachedDefaultRowAsync, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAgentTabCounts, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow, writeCachedDefaultRowAsync };
494
+ export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_SEARCH_LIMIT, AgentArchFilter, AgentCatalogClient, AgentCatalogErrorSink, AgentCatalogLabels, AgentCatalogReadError, AgentCatalogStorage, AgentCatalogStorageLike, AgentCatalogTransport, AgentConsumerState, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, AgentSortOption, AgentSummary, AgentTab, MandateDefaultRowError, MandateResolutionVerdict, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, ResolvedDefaultRow, _resetCatalogGlobalState, agentArchiveFilterChipLabel, agentArchiveFilterControlLabel, agentArchiveFilterStateLabel, agentConsumerHasActiveFilters, agentListEmptyLabel, agentListFooterLabel, agentMatchesArchiveFilter, agentMatchesSearch, applyAgentSortComparator, compareAgentIds, computeAgentSearchScore, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readCachedDefaultRowAsync, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAgentTabCounts, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow, writeCachedDefaultRowAsync };
@@ -1,5 +1,5 @@
1
- import { A as AgentSummary, a as AgentCatalogClient, b as AgentCatalogTransport, c as AgentCatalogStorageLike, d as AgentCatalogErrorSink, R as ResolvedDefaultRow, e as AgentCatalogStorage, M as MandateResolutionVerdict, f as AgentTab, g as AgentCatalogLabels, h as AgentConsumerState, i as AgentArchFilter, j as AgentSortOption } from '../orchestra-CID-rsu8.js';
2
- export { k as AGENT_NONE_SENTINEL, l as AgentAccessFilter, m as AgentAccessLevel, n as AgentCatalog, o as AgentCatalogAgentType, p as AgentCatalogAsyncStorage, q as AgentCatalogConfig, r as AgentCatalogConfigError, s as AgentCatalogIdentity, t as AgentCatalogNavigate, u as AgentCatalogNotifier, v as AgentCatalogOpenPeek, w as AgentCatalogResolveHref, x as AgentCatalogRpcCall, y as AgentCatalogSchemaReport, z as AgentCatalogState, B as AgentCatalogStatus, C as AgentCatalogTableQuery, D as AgentConsumerPatch, E as AgentFavFilter, F as AgentId, G as AssertAgentCatalogSchemaOptions, H as DEFAULT_AGENT_CATALOG_LABELS, I as DEFAULT_AGENT_CONSUMER_STATE, J as DefaultRowState, O as OrchestraBadge, P as PgErrorLike, K as PgResultLike, S as SORT_OPTIONS, L as asAgentId, N as assertAgentCatalogSchema, Q as createAgentCatalog, T as getRegisteredAgentCatalog, U as isMandateAgentId, V as mandateAgentId, W as orchestraDelegatesLine, X as orchestraDepthLine, Y as orchestraLabel, Z as orchestraModeLabel } from '../orchestra-CID-rsu8.js';
1
+ import { A as AgentSummary, a as AgentCatalogClient, b as AgentCatalogTransport, c as AgentCatalogStorageLike, d as AgentCatalogErrorSink, R as ResolvedDefaultRow, e as AgentCatalogStorage, M as MandateResolutionVerdict, f as AgentArchFilter, g as AgentTab, h as AgentCatalogLabels, i as AgentConsumerState, j as AgentSortOption } from '../orchestra-DljbEiks.js';
2
+ export { k as AGENT_NONE_SENTINEL, l as ARCHIVE_FILTER_OPTIONS, m as ARCHIVE_FILTER_ORDER, n as AgentAccessFilter, o as AgentAccessLevel, p as AgentArchFilterOption, q as AgentCatalog, r as AgentCatalogAgentType, s as AgentCatalogAsyncStorage, t as AgentCatalogConfig, u as AgentCatalogConfigError, v as AgentCatalogDefaults, w as AgentCatalogIdentity, x as AgentCatalogNavigate, y as AgentCatalogNotifier, z as AgentCatalogOpenPeek, B as AgentCatalogResolveHref, C as AgentCatalogRpcCall, D as AgentCatalogSchemaReport, E as AgentCatalogState, F as AgentCatalogStatus, G as AgentCatalogTableQuery, H as AgentConsumerPatch, I as AgentFavFilter, J as AgentId, K as AssertAgentCatalogSchemaOptions, L as DEFAULT_AGENT_CATALOG_LABELS, N as DEFAULT_AGENT_CONSUMER_STATE, O as DefaultRowState, P as OrchestraBadge, Q as PgErrorLike, S as PgResultLike, T as SORT_OPTIONS, U as asAgentId, V as assertAgentCatalogSchema, W as createAgentCatalog, X as getRegisteredAgentCatalog, Y as isAgentArchFilter, Z as isMandateAgentId, _ as mandateAgentId, $ as nextArchFilter, a0 as orchestraDelegatesLine, a1 as orchestraDepthLine, a2 as orchestraLabel, a3 as orchestraModeLabel } from '../orchestra-DljbEiks.js';
3
3
 
4
4
  /**
5
5
  * catalog/data.ts — @ai-matrx/agents/catalog
@@ -206,6 +206,36 @@ declare function shouldDefaultAgentListToPublicTab(args: {
206
206
  ownedCount: number;
207
207
  agentsLoaded: boolean;
208
208
  }): boolean;
209
+ /** What the filter-bar chip reads in each state. */
210
+ declare function agentArchiveFilterChipLabel(archFilter: AgentArchFilter): string;
211
+ /** The platform's words for the state — menus, aria-labels, help text. */
212
+ declare function agentArchiveFilterStateLabel(archFilter: AgentArchFilter): string;
213
+ /**
214
+ * The accessible name of the ONE control, always naming the state it is IN
215
+ * and the state one click moves it to. A control whose label does not say
216
+ * what it currently does is the "dead or dishonest" shape the platform bans.
217
+ */
218
+ declare function agentArchiveFilterControlLabel(archFilter: AgentArchFilter): string;
219
+ /**
220
+ * THE FOOTER. It counts exactly what the list rendered and, whenever archived
221
+ * rows are involved, says so — hidden ones included.
222
+ *
223
+ * hide archived, nothing archived behind it → "412 agents"
224
+ * hide archived, 4 archived behind it → "412 agents · 4 archived hidden"
225
+ * show all → "416 agents · archived shown"
226
+ * archived only → "4 archived shown"
227
+ */
228
+ declare function agentListFooterLabel(args: {
229
+ /** Rows actually rendered. */
230
+ count: number;
231
+ archFilter: AgentArchFilter;
232
+ /**
233
+ * Rows this view WOULD render if the filter were flipped to "archived only"
234
+ * — exactly what the default state is keeping off the screen. Only ever
235
+ * read in the `active` state.
236
+ */
237
+ archivedHiddenCount: number;
238
+ }): string;
209
239
 
210
240
  /**
211
241
  * The structural shape a record needs to be searchable. Every field except
@@ -342,10 +372,27 @@ declare function filterUserTypeAgents(agents: readonly AgentSummary[], consumer:
342
372
  * Builtin/system agents (tab === "system").
343
373
  *
344
374
  * Gets the SAME filter surface every other tab has — search, favorites,
345
- * category, tags, sort. Ownership/archive/access filters are meaningless here
346
- * (a builtin is always active and belongs to the platform), so those are the
347
- * only ones skipped. A picker that offers less on one tab than another is the
348
- * exact half-built shape this list exists to prevent.
375
+ * category, tags, sort, AND THE ARCHIVE FILTER. Only the ownership/access
376
+ * filters are skipped, because a builtin has no owner to filter on. A picker
377
+ * that offers less on one tab than another is the exact half-built shape this
378
+ * list exists to prevent.
379
+ *
380
+ * 🚨 0.9.2 — THE BUILTIN ARCHIVE EXEMPTION IS GONE, AND IT IS NOW ILLEGAL.
381
+ *
382
+ * Until 0.9.1 this function applied no archive filter, on the theory that "a
383
+ * builtin belongs to the platform and is never the user's to archive". The
384
+ * database disagreed: `Foundry Planner`
385
+ * (`001b22f6-fa4d-40c6-a1a4-8575d4d04379`) is an ARCHIVED builtin, and it
386
+ * rendered at Public index 216 and was pickable — while Mine / Shared / All
387
+ * hid their archived rows. One picker, two rules, and a person could choose a
388
+ * retired agent from the one tab that did not obey.
389
+ *
390
+ * THE ARCHIVED-ITEMS LAW (`common-docs/policies/archived-items.md`, Arman
391
+ * 2026-09-09) closed the question for every entity at once: "everything should
392
+ * have an archive filter, and the default should always hide archived… all
393
+ * archived items should always be treated the same." Clause 4 makes it a
394
+ * class, not an instance — so there is no per-tab, per-entity or per-surface
395
+ * exemption left to grant, here or anywhere.
349
396
  */
350
397
  declare function filterBuiltinTypeAgents(agents: readonly AgentSummary[], consumer: AgentConsumerState): AgentSummary[];
351
398
  /** Factory: owned user-type agents with consumer filters applied (ignores tab). */
@@ -395,10 +442,13 @@ declare function agentConsumerHasActiveFilters(consumer: AgentConsumerState, def
395
442
  *
396
443
  * `is_archived` is now honoured by the same rule the list uses, so the badge,
397
444
  * the footer and the rows agree on every tab and under every archive filter.
398
- * The system tab is the exception with a reason: `filterBuiltinTypeAgents`
399
- * applies no archive filter (a builtin belongs to the platform and is never
400
- * the user's to archive), so its count applies none either — it already
401
- * counted exactly what it rendered.
445
+ *
446
+ * 🚨 0.9.2 — AND THERE IS NO LONGER AN EXCEPTION. The system tab used to be
447
+ * one ("a builtin is never the user's to archive"), which was false in the
448
+ * database and illegal under THE ARCHIVED-ITEMS LAW. Its badge now counts
449
+ * under the same archive rule its rows render under, so `Foundry Planner`
450
+ * leaves the Public badge and the Public list together, or returns to both
451
+ * together — never one without the other.
402
452
  */
403
453
  declare function agentMatchesArchiveFilter(agent: AgentSummary, archFilter: AgentArchFilter): boolean;
404
454
  /**
@@ -416,6 +466,12 @@ declare const selectAgentTabCounts: (a: readonly AgentSummary[], b: AgentArchFil
416
466
  declare const selectTotalUserAgentsCount: (a: readonly AgentSummary[]) => number;
417
467
  declare const selectTotalOwnedAgentsCount: (a: readonly AgentSummary[]) => number;
418
468
  declare const selectTotalSharedAgentsCount: (a: readonly AgentSummary[]) => number;
469
+ /**
470
+ * Live builtin agents the DEFAULT (`active`) list renders — archived builtins
471
+ * excluded, exactly like every other "total" beside it. Before 0.9.2 this
472
+ * counted archived builtins too, which is how an archived `Foundry Planner`
473
+ * reached the Public badge.
474
+ */
419
475
  declare const selectTotalBuiltinAgentsCount: (a: readonly AgentSummary[]) => number;
420
476
  declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => number;
421
477
 
@@ -435,4 +491,4 @@ declare const selectTotalFavoriteAgentsCount: (a: readonly AgentSummary[]) => nu
435
491
  /** @internal Test-only: forget every session-shared value. */
436
492
  declare function _resetCatalogGlobalState(): void;
437
493
 
438
- export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_SEARCH_LIMIT, AgentArchFilter, AgentCatalogClient, AgentCatalogErrorSink, AgentCatalogLabels, AgentCatalogReadError, AgentCatalogStorage, AgentCatalogStorageLike, AgentCatalogTransport, AgentConsumerState, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, AgentSortOption, AgentSummary, AgentTab, MandateDefaultRowError, MandateResolutionVerdict, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, ResolvedDefaultRow, _resetCatalogGlobalState, agentConsumerHasActiveFilters, agentListEmptyLabel, agentMatchesArchiveFilter, agentMatchesSearch, applyAgentSortComparator, compareAgentIds, computeAgentSearchScore, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readCachedDefaultRowAsync, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAgentTabCounts, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow, writeCachedDefaultRowAsync };
494
+ export { AGENT_CARDS_LIMIT_DESKTOP, AGENT_CARDS_LIMIT_MOBILE, AGENT_LIST_ITEMS_PER_PAGE, AGENT_SEARCH_LIMIT, AgentArchFilter, AgentCatalogClient, AgentCatalogErrorSink, AgentCatalogLabels, AgentCatalogReadError, AgentCatalogStorage, AgentCatalogStorageLike, AgentCatalogTransport, AgentConsumerState, type AgentListPage, type AgentSearchable, type AgentServerSearchResult, AgentSortOption, AgentSummary, AgentTab, MandateDefaultRowError, MandateResolutionVerdict, type ResolveDefaultRowArgs, type ResolveDefaultRowOutcome, ResolvedDefaultRow, _resetCatalogGlobalState, agentArchiveFilterChipLabel, agentArchiveFilterControlLabel, agentArchiveFilterStateLabel, agentConsumerHasActiveFilters, agentListEmptyLabel, agentListFooterLabel, agentMatchesArchiveFilter, agentMatchesSearch, applyAgentSortComparator, compareAgentIds, computeAgentSearchScore, createMemoryStorage, defaultRowFromResolution, defaultStorage, detectDefaultRowDrift, filterBuiltinTypeAgents, filterUserTypeAgents, makeSelectFilteredAgents, makeSelectFilteredAgentsCount, makeSelectFilteredBuiltinAgents, makeSelectFilteredBuiltinAgentsCount, makeSelectFilteredOwnedAgents, makeSelectFilteredSharedAgents, makeSelectOwnedAgentCards, makeSelectOwnedAgentListItems, makeSelectSharedAgentCards, makeSelectSharedAgentListItems, memoize1, memoize2, memoize3, parseMandateResolution, readAgentCatalogRows, readCachedDefaultRow, readCachedDefaultRowAsync, readSingleAgentRow, resolveDefaultRow, searchAgentsOnServer, selectAgentTabCounts, selectAllAgentCategories, selectAllAgentTags, selectAllSystemAgentCategories, selectAllSystemAgentTags, selectBuiltinTypeAgents, selectTotalBuiltinAgentsCount, selectTotalFavoriteAgentsCount, selectTotalOwnedAgentsCount, selectTotalSharedAgentsCount, selectTotalUserAgentsCount, selectUserTypeAgents, shouldDefaultAgentListToPublicTab, sortFilteredAgents, toAgentSummary, writeAgentFavorite, writeCachedDefaultRow, writeCachedDefaultRowAsync };
@@ -15,6 +15,24 @@ var SORT_OPTIONS = [
15
15
  { value: "name-desc", label: "Z \u2192 A" },
16
16
  { value: "category-asc", label: "Category" }
17
17
  ];
18
+ var ARCHIVE_FILTER_ORDER = [
19
+ "active",
20
+ "both",
21
+ "archived"
22
+ ];
23
+ var ARCHIVE_FILTER_OPTIONS = [
24
+ { value: "active", label: "Hide archived", chip: "Archive" },
25
+ { value: "both", label: "Show all", chip: "All + archived" },
26
+ { value: "archived", label: "Archived only", chip: "Archived only" }
27
+ ];
28
+ function nextArchFilter(current) {
29
+ const index = ARCHIVE_FILTER_ORDER.indexOf(current);
30
+ if (index < 0) return ARCHIVE_FILTER_ORDER[0];
31
+ return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
32
+ }
33
+ function isAgentArchFilter(value) {
34
+ return value === "active" || value === "archived" || value === "both";
35
+ }
18
36
  var AGENT_NONE_SENTINEL = "__none__";
19
37
  var DEFAULT_AGENT_CONSUMER_STATE = {
20
38
  tab: "mine",
@@ -637,6 +655,18 @@ function createAgentCatalog(config) {
637
655
  remedy: "pass `identity: { requireUserId() }` \u2014 never a silent anonymous read"
638
656
  });
639
657
  }
658
+ const archiveDefault = config.defaults?.archiveFilter;
659
+ if (archiveDefault !== void 0 && !isAgentArchFilter(archiveDefault)) {
660
+ throw new AgentCatalogConfigError({
661
+ code: "invalid_archive_default",
662
+ message: `defaults.archiveFilter was ${JSON.stringify(archiveDefault)}, which is not one of the three states of the platform archive filter`,
663
+ remedy: 'pass "active" (hide archived), "both" (show all) or "archived" (archived only)'
664
+ });
665
+ }
666
+ const consumerDefaults = {
667
+ ...DEFAULT_AGENT_CONSUMER_STATE,
668
+ ...archiveDefault ? { archFilter: archiveDefault } : {}
669
+ };
640
670
  const catalogId = config.catalogId ?? "default";
641
671
  const client = config.client;
642
672
  const identity = config.identity;
@@ -737,7 +767,7 @@ function createAgentCatalog(config) {
737
767
  return run;
738
768
  }
739
769
  function getConsumer(consumerId) {
740
- return state.consumers[consumerId] ?? DEFAULT_AGENT_CONSUMER_STATE;
770
+ return state.consumers[consumerId] ?? consumerDefaults;
741
771
  }
742
772
  function writeConsumer(consumerId, next) {
743
773
  publish({
@@ -748,7 +778,7 @@ function createAgentCatalog(config) {
748
778
  function registerConsumer(consumerId, initial) {
749
779
  if (state.consumers[consumerId]) return;
750
780
  writeConsumer(consumerId, {
751
- ...DEFAULT_AGENT_CONSUMER_STATE,
781
+ ...consumerDefaults,
752
782
  ...initial ?? {}
753
783
  });
754
784
  }
@@ -759,9 +789,7 @@ function createAgentCatalog(config) {
759
789
  publish({ ...state, consumers });
760
790
  }
761
791
  function setConsumerFilter(consumerId, patch) {
762
- const current = state.consumers[consumerId] ?? {
763
- ...DEFAULT_AGENT_CONSUMER_STATE
764
- };
792
+ const current = state.consumers[consumerId] ?? { ...consumerDefaults };
765
793
  writeConsumer(consumerId, {
766
794
  ...current,
767
795
  ...patch,
@@ -778,9 +806,7 @@ function createAgentCatalog(config) {
778
806
  );
779
807
  }
780
808
  function setConsumerServerSearch(consumerId, args) {
781
- const current = state.consumers[consumerId] ?? {
782
- ...DEFAULT_AGENT_CONSUMER_STATE
783
- };
809
+ const current = state.consumers[consumerId] ?? { ...consumerDefaults };
784
810
  const next = { ...current };
785
811
  if (args.matchedIds !== void 0) next.serverMatchedIds = args.matchedIds;
786
812
  if (args.isSearching !== void 0) next.isServerSearching = args.isSearching;
@@ -791,7 +817,7 @@ function createAgentCatalog(config) {
791
817
  }
792
818
  function resetConsumerFilters(consumerId) {
793
819
  if (!state.consumers[consumerId]) return;
794
- writeConsumer(consumerId, { ...DEFAULT_AGENT_CONSUMER_STATE });
820
+ writeConsumer(consumerId, { ...consumerDefaults });
795
821
  }
796
822
  async function searchServer(query, deep = false) {
797
823
  const result = await searchAgentsOnServer(client, { query, deep });
@@ -921,6 +947,7 @@ function createAgentCatalog(config) {
921
947
  errorSink,
922
948
  notifier,
923
949
  canResolveMandates: transport !== void 0,
950
+ consumerDefaults,
924
951
  getState: () => state,
925
952
  subscribe: (listener) => {
926
953
  listeners.add(listener);
@@ -998,6 +1025,26 @@ function shouldDefaultAgentListToPublicTab(args) {
998
1025
  if (!args.agentsLoaded) return false;
999
1026
  return args.ownedCount === 0;
1000
1027
  }
1028
+ function agentArchiveFilterChipLabel(archFilter) {
1029
+ return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
1030
+ }
1031
+ function agentArchiveFilterStateLabel(archFilter) {
1032
+ return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
1033
+ }
1034
+ function agentArchiveFilterControlLabel(archFilter) {
1035
+ return `Archive filter: ${agentArchiveFilterStateLabel(
1036
+ archFilter
1037
+ ).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
1038
+ nextArchFilter(archFilter)
1039
+ ).toLowerCase()}`;
1040
+ }
1041
+ function agentListFooterLabel(args) {
1042
+ const { count, archFilter, archivedHiddenCount } = args;
1043
+ if (archFilter === "archived") return `${count} archived shown`;
1044
+ const base = `${count} agent${count !== 1 ? "s" : ""}`;
1045
+ if (archFilter === "both") return `${base} \xB7 archived shown`;
1046
+ return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
1047
+ }
1001
1048
 
1002
1049
  // catalog/score.ts
1003
1050
  function computeAgentSearchScore(agent, query) {
@@ -1208,8 +1255,7 @@ function filterUserTypeAgents(agents, consumer) {
1208
1255
  if (tab === "mine" && agent.isOwner !== true) return false;
1209
1256
  if (tab === "shared" && !(agent.isOwner === false && agent.accessLevel != null))
1210
1257
  return false;
1211
- if (archFilter === "active" && agent.isArchived) return false;
1212
- if (archFilter === "archived" && !agent.isArchived) return false;
1258
+ if (!agentMatchesArchiveFilter(agent, archFilter)) return false;
1213
1259
  if (favFilter === "yes" && !agent.isFavorite) return false;
1214
1260
  if (favFilter === "no" && agent.isFavorite) return false;
1215
1261
  if (accessFilter === "owned" && agent.isOwner !== true) return false;
@@ -1239,9 +1285,10 @@ function filterUserTypeAgents(agents, consumer) {
1239
1285
  return sortFilteredAgents(filtered, consumer);
1240
1286
  }
1241
1287
  function filterBuiltinTypeAgents(agents, consumer) {
1242
- const { searchTerm, favFilter, includedCats, includedTags } = consumer;
1288
+ const { searchTerm, favFilter, archFilter, includedCats, includedTags } = consumer;
1243
1289
  const serverMatched = new Set(consumer.serverMatchedIds);
1244
1290
  const filtered = agents.filter((agent) => {
1291
+ if (!agentMatchesArchiveFilter(agent, archFilter)) return false;
1245
1292
  if (favFilter === "yes" && !agent.isFavorite) return false;
1246
1293
  if (favFilter === "no" && agent.isFavorite) return false;
1247
1294
  if (includedCats.length > 0) {
@@ -1359,6 +1406,15 @@ function agentMatchesArchiveFilter(agent, archFilter) {
1359
1406
  if (archFilter === "archived") return Boolean(agent.isArchived);
1360
1407
  return true;
1361
1408
  }
1409
+ function countBuiltinRows(agents, archFilter) {
1410
+ let n = 0;
1411
+ for (const a of agents) {
1412
+ if (a.agentType !== "builtin") continue;
1413
+ if (!agentMatchesArchiveFilter(a, archFilter)) continue;
1414
+ n += 1;
1415
+ }
1416
+ return n;
1417
+ }
1362
1418
  function countUserRows(agents, archFilter, predicate) {
1363
1419
  let n = 0;
1364
1420
  for (const a of agents) {
@@ -1377,7 +1433,7 @@ var selectAgentTabCounts = memoize2(
1377
1433
  mine: countUserRows(agents, archFilter, isOwned),
1378
1434
  shared: countUserRows(agents, archFilter, isShared),
1379
1435
  all: countUserRows(agents, archFilter, isAny),
1380
- system: selectBuiltinTypeAgents(agents).length
1436
+ system: countBuiltinRows(agents, archFilter)
1381
1437
  })
1382
1438
  );
1383
1439
  var selectTotalUserAgentsCount = memoize1(
@@ -1390,7 +1446,7 @@ var selectTotalSharedAgentsCount = memoize1(
1390
1446
  (agents) => countUserRows(agents, "active", isShared)
1391
1447
  );
1392
1448
  var selectTotalBuiltinAgentsCount = memoize1(
1393
- (agents) => selectBuiltinTypeAgents(agents).length
1449
+ (agents) => countBuiltinRows(agents, "active")
1394
1450
  );
1395
1451
  var selectTotalFavoriteAgentsCount = memoize1(
1396
1452
  (agents) => countUserRows(agents, "active", isFavorite)
@@ -1401,6 +1457,8 @@ export {
1401
1457
  AGENT_LIST_ITEMS_PER_PAGE,
1402
1458
  AGENT_NONE_SENTINEL,
1403
1459
  AGENT_SEARCH_LIMIT,
1460
+ ARCHIVE_FILTER_OPTIONS,
1461
+ ARCHIVE_FILTER_ORDER,
1404
1462
  AgentCatalogConfigError,
1405
1463
  AgentCatalogReadError,
1406
1464
  DEFAULT_AGENT_CATALOG_LABELS,
@@ -1408,8 +1466,12 @@ export {
1408
1466
  MandateDefaultRowError,
1409
1467
  SORT_OPTIONS,
1410
1468
  _resetCatalogGlobalState,
1469
+ agentArchiveFilterChipLabel,
1470
+ agentArchiveFilterControlLabel,
1471
+ agentArchiveFilterStateLabel,
1411
1472
  agentConsumerHasActiveFilters,
1412
1473
  agentListEmptyLabel,
1474
+ agentListFooterLabel,
1413
1475
  agentMatchesArchiveFilter,
1414
1476
  agentMatchesSearch,
1415
1477
  applyAgentSortComparator,
@@ -1425,6 +1487,7 @@ export {
1425
1487
  filterBuiltinTypeAgents,
1426
1488
  filterUserTypeAgents,
1427
1489
  getRegisteredAgentCatalog,
1490
+ isAgentArchFilter,
1428
1491
  isMandateAgentId,
1429
1492
  makeSelectFilteredAgents,
1430
1493
  makeSelectFilteredAgentsCount,
@@ -1440,6 +1503,7 @@ export {
1440
1503
  memoize1,
1441
1504
  memoize2,
1442
1505
  memoize3,
1506
+ nextArchFilter,
1443
1507
  orchestraDelegatesLine,
1444
1508
  orchestraDepthLine,
1445
1509
  orchestraLabel,