@ai-matrx/agents 0.8.0 → 0.9.1

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.
@@ -0,0 +1,2838 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // catalog/native/index.ts
21
+ var native_exports = {};
22
+ __export(native_exports, {
23
+ AgentCatalogProvider: () => AgentCatalogProvider,
24
+ AgentDetailCard: () => AgentDetailCard,
25
+ AgentFilterBar: () => AgentFilterBar,
26
+ AgentIcon: () => AgentIcon,
27
+ AgentListContent: () => AgentListContent,
28
+ AgentListInlinePicker: () => AgentListInlinePicker,
29
+ AgentListSheet: () => AgentListSheet,
30
+ AgentListTabs: () => AgentListTabs,
31
+ AgentPickerBody: () => AgentPickerBody,
32
+ AgentRow: () => AgentRow,
33
+ AgentSubView: () => AgentSubView,
34
+ CheckRow: () => CheckRow,
35
+ DEFAULT_AGENT_CATALOG_NATIVE_THEME: () => DEFAULT_AGENT_CATALOG_NATIVE_THEME,
36
+ FavoriteAgentButton: () => FavoriteAgentButton,
37
+ FilterChip: () => FilterChip,
38
+ HOVER_GRACE_MS: () => HOVER_GRACE_MS,
39
+ LIGHT_AGENT_CATALOG_NATIVE_THEME: () => LIGHT_AGENT_CATALOG_NATIVE_THEME,
40
+ OptionRow: () => OptionRow,
41
+ SearchInput: () => SearchInput,
42
+ SidePanelHeader: () => SidePanelHeader,
43
+ _resetNativeIconState: () => _resetNativeIconState,
44
+ announceMissingSvgOnce: () => announceMissingSvgOnce,
45
+ coerceVisibleTab: () => coerceVisibleTab,
46
+ orchestraDelegatesLine: () => orchestraDelegatesLine,
47
+ orchestraDepthLine: () => orchestraDepthLine,
48
+ orchestraLabel: () => orchestraLabel,
49
+ orchestraModeLabel: () => orchestraModeLabel,
50
+ resolveAgentCatalogNativeTheme: () => resolveAgentCatalogNativeTheme,
51
+ resolveSvgModule: () => resolveSvgModule,
52
+ useAgentCatalog: () => useAgentCatalog,
53
+ useAgentCatalogNativeTheme: () => useAgentCatalogNativeTheme,
54
+ useAgentCatalogRows: () => useAgentCatalogRows,
55
+ useAgentCatalogState: () => useAgentCatalogState,
56
+ useAgentCatalogUiPorts: () => useAgentCatalogUiPorts,
57
+ useAgentConsumer: () => useAgentConsumer,
58
+ useAgentListCore: () => useAgentListCore
59
+ });
60
+ module.exports = __toCommonJS(native_exports);
61
+
62
+ // catalog/native/context.tsx
63
+ var import_react2 = require("react");
64
+ var import_react_native = require("react-native");
65
+
66
+ // catalog/shared/context.tsx
67
+ var import_react = require("react");
68
+ var import_jsx_runtime = require("react/jsx-runtime");
69
+ var AgentCatalogContext = (0, import_react.createContext)(null);
70
+ function AgentCatalogProviderCore({
71
+ catalog,
72
+ platform,
73
+ children,
74
+ ...ports
75
+ }) {
76
+ const value = (0, import_react.useMemo)(
77
+ () => ({ catalog, platform, ...ports }),
78
+ // The ports are plain values a host declares once; re-binding on identity
79
+ // change is correct and cheap.
80
+ [
81
+ catalog,
82
+ platform,
83
+ ports.navigate,
84
+ ports.LinkComponent,
85
+ ports.renderModelRef,
86
+ ports.openPeek,
87
+ ports.popoverContainer
88
+ ]
89
+ );
90
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AgentCatalogContext.Provider, { value, children });
91
+ }
92
+ function useBinding() {
93
+ const binding = (0, import_react.useContext)(AgentCatalogContext);
94
+ if (!binding) {
95
+ throw new Error(
96
+ "@ai-matrx/agents/catalog: no <AgentCatalogProvider> is mounted above this component. Create the catalog once with createAgentCatalog({ client, identity }) and mount <AgentCatalogProvider catalog={catalog}> at the top of your tree."
97
+ );
98
+ }
99
+ return binding;
100
+ }
101
+ function useAgentCatalog() {
102
+ return useBinding().catalog;
103
+ }
104
+ function useAgentCatalogUiPorts() {
105
+ const binding = useBinding();
106
+ const hostNavigate = binding.navigate;
107
+ const platformNavigate = binding.platform.navigate;
108
+ const navigate = (0, import_react.useCallback)(
109
+ (href) => {
110
+ if (hostNavigate) {
111
+ hostNavigate(href);
112
+ return;
113
+ }
114
+ platformNavigate(href);
115
+ },
116
+ [hostNavigate, platformNavigate]
117
+ );
118
+ return {
119
+ navigate,
120
+ LinkComponent: binding.LinkComponent ?? binding.platform.LinkComponent,
121
+ renderModelRef: binding.renderModelRef ?? binding.platform.renderModelRef,
122
+ openPeek: binding.openPeek,
123
+ popoverContainer: binding.popoverContainer
124
+ };
125
+ }
126
+ function useAgentCatalogState(select) {
127
+ const catalog = useAgentCatalog();
128
+ const getSnapshot = (0, import_react.useCallback)(
129
+ () => select(catalog.getState()),
130
+ [catalog, select]
131
+ );
132
+ return (0, import_react.useSyncExternalStore)(catalog.subscribe, getSnapshot, getSnapshot);
133
+ }
134
+ function useAgentCatalogRows() {
135
+ return useAgentCatalogState(selectRows);
136
+ }
137
+ var selectRows = (state) => state.rows;
138
+
139
+ // catalog/native/theme.ts
140
+ var DEFAULT_AGENT_CATALOG_NATIVE_THEME = {
141
+ colors: {
142
+ background: "#0b0b0f",
143
+ surface: "#17171d",
144
+ surfacePressed: "#22222b",
145
+ text: "#f5f5f7",
146
+ textMuted: "#9b9ba5",
147
+ textFaint: "#6e6e78",
148
+ border: "#2a2a33",
149
+ primary: "#3b82f6",
150
+ primaryForeground: "#ffffff",
151
+ primarySoft: "#1c2a44",
152
+ // The web sheet's dark value for --matrx-agent-favorite.
153
+ favorite: "#fbbf24",
154
+ driftBackground: "#451a03",
155
+ driftForeground: "#fcd34d",
156
+ driftBorder: "#78350f"
157
+ },
158
+ radius: { sm: 4, md: 8, lg: 12 },
159
+ spacing: { xs: 4, sm: 8, md: 12, lg: 16 },
160
+ fontSize: { xs: 10, sm: 11, md: 13, lg: 15 }
161
+ };
162
+ var LIGHT_AGENT_CATALOG_NATIVE_THEME = {
163
+ ...DEFAULT_AGENT_CATALOG_NATIVE_THEME,
164
+ colors: {
165
+ background: "#ffffff",
166
+ surface: "#f4f4f6",
167
+ surfacePressed: "#e9e9ee",
168
+ text: "#0b0b0f",
169
+ textMuted: "#61616b",
170
+ textFaint: "#8c8c96",
171
+ border: "#e2e2e8",
172
+ primary: "#2563eb",
173
+ primaryForeground: "#ffffff",
174
+ primarySoft: "#e5edfd",
175
+ favorite: "#f59e0b",
176
+ driftBackground: "#fef3c7",
177
+ driftForeground: "#92400e",
178
+ driftBorder: "#fcd34d"
179
+ }
180
+ };
181
+ function resolveAgentCatalogNativeTheme(override, base = DEFAULT_AGENT_CATALOG_NATIVE_THEME) {
182
+ if (!override) return base;
183
+ return {
184
+ colors: { ...base.colors, ...override.colors ?? {} },
185
+ radius: { ...base.radius, ...override.radius ?? {} },
186
+ spacing: { ...base.spacing, ...override.spacing ?? {} },
187
+ fontSize: { ...base.fontSize, ...override.fontSize ?? {} }
188
+ };
189
+ }
190
+
191
+ // catalog/native/context.tsx
192
+ var import_jsx_runtime2 = require("react/jsx-runtime");
193
+ var ThemeContext = (0, import_react2.createContext)(
194
+ DEFAULT_AGENT_CATALOG_NATIVE_THEME
195
+ );
196
+ function useAgentCatalogNativeTheme() {
197
+ return (0, import_react2.useContext)(ThemeContext);
198
+ }
199
+ var NativeLink = ({ children, onClick, title }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
200
+ import_react_native.Pressable,
201
+ {
202
+ accessibilityRole: "link",
203
+ ...title ? { accessibilityLabel: title } : {},
204
+ onPress: () => onClick?.({
205
+ preventDefault: () => {
206
+ },
207
+ stopPropagation: () => {
208
+ }
209
+ }),
210
+ children
211
+ }
212
+ );
213
+ var nativeRenderModelRef = ({ modelId }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.Text, { children: modelId });
214
+ function AgentCatalogProvider({
215
+ catalog,
216
+ theme,
217
+ children,
218
+ ...ports
219
+ }) {
220
+ const resolvedTheme = (0, import_react2.useMemo)(
221
+ () => resolveAgentCatalogNativeTheme(theme),
222
+ // A theme object is declared once by a host; re-resolving on identity
223
+ // change is correct and cheap.
224
+ [theme]
225
+ );
226
+ const platform = (0, import_react2.useMemo)(
227
+ () => ({
228
+ /**
229
+ * 🚨 THE NATIVE `navigate` DEFAULT. There is no `window.location` to
230
+ * assign, and there is no router this package may assume — Expo Router,
231
+ * React Navigation and a custom stack all differ. So the default is a
232
+ * no-op that REPORTS, with the remedy, through the catalog's own
233
+ * errorSink. It never fails silently, and it never pretends to have
234
+ * navigated. A host that wants working links passes `navigate`.
235
+ */
236
+ navigate: (href) => {
237
+ catalog.errorSink({
238
+ code: "native_navigate_not_bound",
239
+ message: "the agent picker was asked to navigate, but this native host bound no `navigate` port, so nothing moved.",
240
+ context: {
241
+ href,
242
+ remedy: "pass navigate={(href) => router.push(href)} (Expo Router) or your navigator's equivalent to <AgentCatalogProvider>"
243
+ }
244
+ });
245
+ },
246
+ LinkComponent: NativeLink,
247
+ renderModelRef: nativeRenderModelRef
248
+ }),
249
+ [catalog]
250
+ );
251
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ThemeContext.Provider, { value: resolvedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
252
+ AgentCatalogProviderCore,
253
+ {
254
+ catalog,
255
+ platform,
256
+ ...ports,
257
+ children
258
+ }
259
+ ) });
260
+ }
261
+
262
+ // catalog/native/AgentListSheet.tsx
263
+ var import_react_native12 = require("react-native");
264
+
265
+ // catalog/native/AgentPickerBody.tsx
266
+ var import_react6 = require("react");
267
+ var import_react_native11 = require("react-native");
268
+
269
+ // catalog/shared/useAgentListCore.ts
270
+ var import_react4 = require("react");
271
+
272
+ // catalog/shared/useAgentConsumer.ts
273
+ var import_react3 = require("react");
274
+
275
+ // catalog/types.ts
276
+ function isMandateAgentId(id) {
277
+ return id.startsWith("mandate:");
278
+ }
279
+ var SORT_OPTIONS = [
280
+ { value: "updated-desc", label: "Recent" },
281
+ { value: "created-desc", label: "Created" },
282
+ { value: "name-asc", label: "A \u2192 Z" },
283
+ { value: "name-desc", label: "Z \u2192 A" },
284
+ { value: "category-asc", label: "Category" }
285
+ ];
286
+ var AGENT_NONE_SENTINEL = "__none__";
287
+ var DEFAULT_AGENT_CONSUMER_STATE = {
288
+ tab: "mine",
289
+ sortBy: "updated-desc",
290
+ searchTerm: "",
291
+ includedCats: [],
292
+ includedTags: [],
293
+ favFilter: "all",
294
+ archFilter: "active",
295
+ accessFilter: "any",
296
+ favoritesFirst: true,
297
+ listPage: 1,
298
+ sharedPage: 1,
299
+ serverMatchedIds: [],
300
+ isServerSearching: false,
301
+ deepSearch: false
302
+ };
303
+
304
+ // catalog/shared/useAgentConsumer.ts
305
+ var DEBOUNCE_MS = 250;
306
+ var MIN_QUERY_LENGTH = 2;
307
+ function useAgentConsumer(consumerId, options) {
308
+ const catalog = useAgentCatalog();
309
+ const selectConsumer = (0, import_react3.useCallback)(
310
+ (state) => state.consumers[consumerId] ?? DEFAULT_AGENT_CONSUMER_STATE,
311
+ [consumerId]
312
+ );
313
+ const consumer = useAgentCatalogState(selectConsumer);
314
+ const optionsRef = (0, import_react3.useRef)(options);
315
+ optionsRef.current = options;
316
+ (0, import_react3.useEffect)(() => {
317
+ const opts = optionsRef.current;
318
+ catalog.registerConsumer(
319
+ consumerId,
320
+ opts?.initialTab ? { tab: opts.initialTab } : void 0
321
+ );
322
+ return () => {
323
+ if (optionsRef.current?.unregisterOnUnmount) {
324
+ catalog.unregisterConsumer(consumerId);
325
+ }
326
+ };
327
+ }, [consumerId, catalog]);
328
+ const setSearchTerm = (0, import_react3.useCallback)(
329
+ (value) => catalog.setConsumerFilter(consumerId, { searchTerm: value }),
330
+ [consumerId, catalog]
331
+ );
332
+ const setDeepSearch = (0, import_react3.useCallback)(
333
+ (value) => catalog.setConsumerFilter(consumerId, { deepSearch: value }),
334
+ [consumerId, catalog]
335
+ );
336
+ const setSortBy = (0, import_react3.useCallback)(
337
+ (value) => catalog.setConsumerFilter(consumerId, { sortBy: value }),
338
+ [consumerId, catalog]
339
+ );
340
+ const setTab = (0, import_react3.useCallback)(
341
+ (value) => catalog.setConsumerFilter(consumerId, { tab: value }),
342
+ [consumerId, catalog]
343
+ );
344
+ const setFavFilter = (0, import_react3.useCallback)(
345
+ (value) => catalog.setConsumerFilter(consumerId, { favFilter: value }),
346
+ [consumerId, catalog]
347
+ );
348
+ const setArchFilter = (0, import_react3.useCallback)(
349
+ (value) => catalog.setConsumerFilter(consumerId, { archFilter: value }),
350
+ [consumerId, catalog]
351
+ );
352
+ const setAccessFilter = (0, import_react3.useCallback)(
353
+ (value) => catalog.setConsumerFilter(consumerId, { accessFilter: value }),
354
+ [consumerId, catalog]
355
+ );
356
+ const toggleCategory = (0, import_react3.useCallback)(
357
+ (cat) => {
358
+ const current = catalog.getConsumer(consumerId).includedCats;
359
+ const next = current.includes(cat) ? current.filter((c) => c !== cat) : [...current, cat];
360
+ catalog.setConsumerFilter(consumerId, { includedCats: next });
361
+ },
362
+ [consumerId, catalog]
363
+ );
364
+ const toggleTag = (0, import_react3.useCallback)(
365
+ (tag) => {
366
+ const current = catalog.getConsumer(consumerId).includedTags;
367
+ const next = current.includes(tag) ? current.filter((t) => t !== tag) : [...current, tag];
368
+ catalog.setConsumerFilter(consumerId, { includedTags: next });
369
+ },
370
+ [consumerId, catalog]
371
+ );
372
+ const setIncludedCats = (0, import_react3.useCallback)(
373
+ (next) => catalog.setConsumerFilter(consumerId, { includedCats: next }),
374
+ [consumerId, catalog]
375
+ );
376
+ const setIncludedTags = (0, import_react3.useCallback)(
377
+ (next) => catalog.setConsumerFilter(consumerId, { includedTags: next }),
378
+ [consumerId, catalog]
379
+ );
380
+ const toggleFavoritesFirst = (0, import_react3.useCallback)(
381
+ () => catalog.setConsumerFilter(consumerId, {
382
+ favoritesFirst: !catalog.getConsumer(consumerId).favoritesFirst
383
+ }),
384
+ [consumerId, catalog]
385
+ );
386
+ const loadMoreList = (0, import_react3.useCallback)(
387
+ () => catalog.setConsumerPage(
388
+ consumerId,
389
+ "list",
390
+ catalog.getConsumer(consumerId).listPage + 1
391
+ ),
392
+ [consumerId, catalog]
393
+ );
394
+ const loadMoreShared = (0, import_react3.useCallback)(
395
+ () => catalog.setConsumerPage(
396
+ consumerId,
397
+ "shared",
398
+ catalog.getConsumer(consumerId).sharedPage + 1
399
+ ),
400
+ [consumerId, catalog]
401
+ );
402
+ const resetFilters = (0, import_react3.useCallback)(
403
+ () => catalog.resetConsumerFilters(consumerId),
404
+ [consumerId, catalog]
405
+ );
406
+ const [isSearching, setIsSearching] = (0, import_react3.useState)(false);
407
+ const [matchedIds, setMatchedIds] = (0, import_react3.useState)(null);
408
+ const requestSeq = (0, import_react3.useRef)(0);
409
+ const query = consumer.searchTerm;
410
+ const deep = consumer.deepSearch;
411
+ (0, import_react3.useEffect)(() => {
412
+ const q = query.trim();
413
+ if (q.length < MIN_QUERY_LENGTH) {
414
+ setIsSearching(false);
415
+ setMatchedIds(null);
416
+ return void 0;
417
+ }
418
+ const seq = ++requestSeq.current;
419
+ setIsSearching(true);
420
+ const timer = setTimeout(() => {
421
+ void catalog.searchServer(q, deep).then((ids) => {
422
+ if (seq !== requestSeq.current) return;
423
+ setMatchedIds(ids);
424
+ setIsSearching(false);
425
+ }).catch((e) => {
426
+ if (seq !== requestSeq.current) return;
427
+ catalog.errorSink({
428
+ code: "server_search_failed",
429
+ message: `agent search failed: ${e instanceof Error ? e.message : String(e)}`,
430
+ context: { query: q, deep }
431
+ });
432
+ setIsSearching(false);
433
+ });
434
+ }, DEBOUNCE_MS);
435
+ return () => clearTimeout(timer);
436
+ }, [query, deep, catalog]);
437
+ (0, import_react3.useEffect)(() => {
438
+ catalog.setConsumerServerSearch(consumerId, {
439
+ matchedIds: matchedIds ?? [],
440
+ isSearching
441
+ });
442
+ }, [consumerId, catalog, matchedIds, isSearching]);
443
+ const hasActiveFilters = consumer.searchTerm !== "" || consumer.includedCats.length > 0 || consumer.includedTags.length > 0 || consumer.favFilter !== "all" || consumer.archFilter !== "active" || consumer.accessFilter !== "any" || !consumer.favoritesFirst;
444
+ return {
445
+ tab: consumer.tab,
446
+ sortBy: consumer.sortBy,
447
+ searchTerm: consumer.searchTerm,
448
+ includedCats: consumer.includedCats,
449
+ includedTags: consumer.includedTags,
450
+ favFilter: consumer.favFilter,
451
+ archFilter: consumer.archFilter,
452
+ accessFilter: consumer.accessFilter,
453
+ favoritesFirst: consumer.favoritesFirst,
454
+ listPage: consumer.listPage,
455
+ sharedPage: consumer.sharedPage,
456
+ state: consumer,
457
+ hasActiveFilters,
458
+ deepSearch: consumer.deepSearch,
459
+ isServerSearching: consumer.isServerSearching,
460
+ setSearchTerm,
461
+ setDeepSearch,
462
+ setSortBy,
463
+ setTab,
464
+ setFavFilter,
465
+ setArchFilter,
466
+ setAccessFilter,
467
+ toggleCategory,
468
+ toggleTag,
469
+ setIncludedCats,
470
+ setIncludedTags,
471
+ toggleFavoritesFirst,
472
+ loadMoreList,
473
+ loadMoreShared,
474
+ resetFilters
475
+ };
476
+ }
477
+
478
+ // catalog/labels.ts
479
+ function agentListEmptyLabel(tab, labels) {
480
+ switch (tab) {
481
+ case "system":
482
+ return labels.emptySystem;
483
+ case "shared":
484
+ return labels.emptyShared;
485
+ default:
486
+ return labels.emptyDefault;
487
+ }
488
+ }
489
+ function shouldDefaultAgentListToPublicTab(args) {
490
+ if (!args.userId) return true;
491
+ if (!args.agentsLoaded) return false;
492
+ return args.ownedCount === 0;
493
+ }
494
+
495
+ // catalog/score.ts
496
+ function computeAgentSearchScore(agent, query) {
497
+ const q = query.trim().toLowerCase();
498
+ if (!q) return 0;
499
+ let score = 0;
500
+ const name = (agent.name ?? "").toLowerCase();
501
+ const desc = (agent.description ?? "").toLowerCase();
502
+ if (name === q) score += 1e4;
503
+ else if (name.startsWith(q)) score += 5e3;
504
+ else if (matchesWholeWord(name, q)) score += 3e3;
505
+ else if (name.includes(q)) score += 2e3;
506
+ if (desc === q) score += 1e3;
507
+ else if (desc.includes(q)) score += 500;
508
+ if (agent.category?.toLowerCase().includes(q)) score += 300;
509
+ if (agent.tags?.some((t) => t.toLowerCase().includes(q))) score += 300;
510
+ if (agent.modelId?.toLowerCase().includes(q)) score += 100;
511
+ if (agent.agentType?.toLowerCase().includes(q)) score += 100;
512
+ if (agent.outputFormat?.toLowerCase().includes(q)) score += 100;
513
+ const id = agent.id.toLowerCase();
514
+ if (id === q) score += 1e5;
515
+ else if (id.includes(q)) score += 5e3;
516
+ if (agent.sharedByEmail?.toLowerCase().includes(q)) score += 200;
517
+ if (score === 0 && q.includes(" ")) {
518
+ const terms = q.split(/\s+/).filter(Boolean);
519
+ let hits = 0;
520
+ let termScore = 0;
521
+ for (const term of terms) {
522
+ const inName = name.includes(term);
523
+ const matched = inName || desc.includes(term) || (agent.category?.toLowerCase().includes(term) ?? false) || (agent.tags?.some((t) => t.toLowerCase().includes(term)) ?? false);
524
+ if (matched) {
525
+ hits += 1;
526
+ termScore += inName ? 400 : 100;
527
+ }
528
+ }
529
+ if (hits === terms.length) score += termScore;
530
+ }
531
+ return score;
532
+ }
533
+ function matchesWholeWord(haystack, q) {
534
+ const escaped = q.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
535
+ return new RegExp(`\\b${escaped}\\b`).test(haystack);
536
+ }
537
+ function agentMatchesSearch(agent, query) {
538
+ return computeAgentSearchScore(agent, query) > 0;
539
+ }
540
+
541
+ // catalog/selectors.ts
542
+ function memoize1(fn) {
543
+ let lastA;
544
+ let last;
545
+ let has = false;
546
+ return (a) => {
547
+ if (!has || lastA !== a) {
548
+ last = fn(a);
549
+ lastA = a;
550
+ has = true;
551
+ }
552
+ return last;
553
+ };
554
+ }
555
+ function memoize2(fn) {
556
+ let lastA;
557
+ let lastB;
558
+ let last;
559
+ let has = false;
560
+ return (a, b) => {
561
+ if (!has || lastA !== a || lastB !== b) {
562
+ last = fn(a, b);
563
+ lastA = a;
564
+ lastB = b;
565
+ has = true;
566
+ }
567
+ return last;
568
+ };
569
+ }
570
+ function compareAgentIds(a, b) {
571
+ const idA = a.id ?? "";
572
+ const idB = b.id ?? "";
573
+ if (idA < idB) return -1;
574
+ if (idA > idB) return 1;
575
+ return 0;
576
+ }
577
+ function applyAgentSortComparator(a, b, sortBy) {
578
+ const primary = compareAgentSortKey(a, b, sortBy);
579
+ if (!Number.isFinite(primary) || primary === 0) return compareAgentIds(a, b);
580
+ return primary;
581
+ }
582
+ function compareAgentSortKey(a, b, sortBy) {
583
+ switch (sortBy) {
584
+ case "name-asc":
585
+ return (a.name ?? "").localeCompare(b.name ?? "");
586
+ case "name-desc":
587
+ return (b.name ?? "").localeCompare(a.name ?? "");
588
+ case "created-desc":
589
+ return +new Date(b.createdAt ?? 0) - +new Date(a.createdAt ?? 0);
590
+ case "category-asc":
591
+ return (a.category ?? "").localeCompare(b.category ?? "");
592
+ case "updated-desc":
593
+ default:
594
+ return +new Date(b.updatedAt ?? 0) - +new Date(a.updatedAt ?? 0);
595
+ }
596
+ }
597
+ var selectAllAgentCategories = memoize1(
598
+ (agents) => {
599
+ const cats = /* @__PURE__ */ new Set();
600
+ for (const a of agents) {
601
+ if (a.agentType === "user" && a.category) cats.add(a.category);
602
+ }
603
+ return Array.from(cats).sort();
604
+ }
605
+ );
606
+ var selectAllSystemAgentCategories = memoize1(
607
+ (agents) => {
608
+ const cats = /* @__PURE__ */ new Set();
609
+ for (const a of agents) {
610
+ if (a.agentType === "builtin" && a.category) cats.add(a.category);
611
+ }
612
+ return Array.from(cats).sort();
613
+ }
614
+ );
615
+ var selectAllAgentTags = memoize1(
616
+ (agents) => {
617
+ const tags = /* @__PURE__ */ new Set();
618
+ for (const a of agents) {
619
+ if (a.agentType === "user") a.tags?.forEach((t) => tags.add(t));
620
+ }
621
+ return Array.from(tags).sort();
622
+ }
623
+ );
624
+ var selectAllSystemAgentTags = memoize1(
625
+ (agents) => {
626
+ const tags = /* @__PURE__ */ new Set();
627
+ for (const a of agents) {
628
+ if (a.agentType === "builtin") a.tags?.forEach((t) => tags.add(t));
629
+ }
630
+ return Array.from(tags).sort();
631
+ }
632
+ );
633
+ var selectUserTypeAgents = memoize1(
634
+ (agents) => agents.filter((a) => a.agentType === "user")
635
+ );
636
+ var selectBuiltinTypeAgents = memoize1(
637
+ (agents) => agents.filter((a) => a.agentType === "builtin")
638
+ );
639
+ function sortFilteredAgents(filtered, consumer) {
640
+ const { searchTerm, sortBy, favFilter, favoritesFirst } = consumer;
641
+ if (searchTerm) {
642
+ const scores = /* @__PURE__ */ new Map();
643
+ filtered.forEach((a) => {
644
+ scores.set(a.id, computeAgentSearchScore(a, searchTerm));
645
+ });
646
+ const serverRank = /* @__PURE__ */ new Map();
647
+ consumer.serverMatchedIds.forEach((id, i) => serverRank.set(id, i));
648
+ return [...filtered].sort((a, b) => {
649
+ const sa = scores.get(a.id) ?? 0;
650
+ const sb = scores.get(b.id) ?? 0;
651
+ if (sb !== sa) return sb - sa;
652
+ if (sa === 0) {
653
+ const ra = serverRank.get(a.id);
654
+ const rb = serverRank.get(b.id);
655
+ if (ra !== void 0 && rb !== void 0 && ra !== rb) return ra - rb;
656
+ }
657
+ return applyAgentSortComparator(a, b, sortBy);
658
+ });
659
+ }
660
+ return [...filtered].sort((a, b) => {
661
+ if (favoritesFirst && favFilter === "all") {
662
+ const aFav = a.isFavorite ? 1 : 0;
663
+ const bFav = b.isFavorite ? 1 : 0;
664
+ if (bFav !== aFav) return bFav - aFav;
665
+ }
666
+ return applyAgentSortComparator(a, b, sortBy);
667
+ });
668
+ }
669
+ function filterUserTypeAgents(agents, consumer) {
670
+ const {
671
+ searchTerm,
672
+ includedCats,
673
+ includedTags,
674
+ favFilter,
675
+ archFilter,
676
+ accessFilter,
677
+ tab
678
+ } = consumer;
679
+ const serverMatched = new Set(consumer.serverMatchedIds);
680
+ const filtered = agents.filter((agent) => {
681
+ if (tab === "mine" && agent.isOwner !== true) return false;
682
+ if (tab === "shared" && !(agent.isOwner === false && agent.accessLevel != null))
683
+ return false;
684
+ if (archFilter === "active" && agent.isArchived) return false;
685
+ if (archFilter === "archived" && !agent.isArchived) return false;
686
+ if (favFilter === "yes" && !agent.isFavorite) return false;
687
+ if (favFilter === "no" && agent.isFavorite) return false;
688
+ if (accessFilter === "owned" && agent.isOwner !== true) return false;
689
+ if (accessFilter === "shared" && agent.isOwner !== false) return false;
690
+ if (accessFilter === "editable" && agent.accessLevel !== "owner" && agent.accessLevel !== "admin" && agent.accessLevel !== "editor")
691
+ return false;
692
+ if (includedCats.length > 0) {
693
+ const category = agent.category;
694
+ if (!category) {
695
+ if (!includedCats.includes(AGENT_NONE_SENTINEL)) return false;
696
+ } else if (!includedCats.includes(category)) {
697
+ return false;
698
+ }
699
+ }
700
+ if (includedTags.length > 0) {
701
+ const isUntagged = !agent.tags?.length;
702
+ if (isUntagged) {
703
+ if (!includedTags.includes(AGENT_NONE_SENTINEL)) return false;
704
+ } else if (!agent.tags?.some((t) => includedTags.includes(t))) {
705
+ return false;
706
+ }
707
+ }
708
+ if (searchTerm && !agentMatchesSearch(agent, searchTerm) && !serverMatched.has(agent.id))
709
+ return false;
710
+ return true;
711
+ });
712
+ return sortFilteredAgents(filtered, consumer);
713
+ }
714
+ function filterBuiltinTypeAgents(agents, consumer) {
715
+ const { searchTerm, favFilter, includedCats, includedTags } = consumer;
716
+ const serverMatched = new Set(consumer.serverMatchedIds);
717
+ const filtered = agents.filter((agent) => {
718
+ if (favFilter === "yes" && !agent.isFavorite) return false;
719
+ if (favFilter === "no" && agent.isFavorite) return false;
720
+ if (includedCats.length > 0) {
721
+ const category = agent.category;
722
+ if (!category) {
723
+ if (!includedCats.includes(AGENT_NONE_SENTINEL)) return false;
724
+ } else if (!includedCats.includes(category)) {
725
+ return false;
726
+ }
727
+ }
728
+ if (includedTags.length > 0) {
729
+ const isUntagged = !agent.tags?.length;
730
+ if (isUntagged) {
731
+ if (!includedTags.includes(AGENT_NONE_SENTINEL)) return false;
732
+ } else if (!agent.tags?.some((t) => includedTags.includes(t))) {
733
+ return false;
734
+ }
735
+ }
736
+ if (searchTerm && !agentMatchesSearch(agent, searchTerm) && !serverMatched.has(agent.id))
737
+ return false;
738
+ return true;
739
+ });
740
+ return sortFilteredAgents(filtered, consumer);
741
+ }
742
+ var makeSelectFilteredAgents = (includeSystemInAll = false) => memoize2(
743
+ (agents, consumer) => {
744
+ const userAgents = selectUserTypeAgents(agents);
745
+ const builtinAgents = selectBuiltinTypeAgents(agents);
746
+ if (consumer.tab === "system") {
747
+ return filterBuiltinTypeAgents(builtinAgents, consumer);
748
+ }
749
+ if (includeSystemInAll && consumer.tab === "all") {
750
+ return [
751
+ ...filterUserTypeAgents(userAgents, consumer),
752
+ ...filterBuiltinTypeAgents(builtinAgents, consumer)
753
+ ];
754
+ }
755
+ return filterUserTypeAgents(userAgents, consumer);
756
+ }
757
+ );
758
+ function agentMatchesArchiveFilter(agent, archFilter) {
759
+ if (archFilter === "active") return !agent.isArchived;
760
+ if (archFilter === "archived") return Boolean(agent.isArchived);
761
+ return true;
762
+ }
763
+ function countUserRows(agents, archFilter, predicate) {
764
+ let n = 0;
765
+ for (const a of agents) {
766
+ if (a.agentType !== "user") continue;
767
+ if (!agentMatchesArchiveFilter(a, archFilter)) continue;
768
+ if (predicate(a)) n += 1;
769
+ }
770
+ return n;
771
+ }
772
+ var isOwned = (a) => a.isOwner === true;
773
+ var isShared = (a) => a.isOwner === false && a.accessLevel != null;
774
+ var isAny = () => true;
775
+ var isFavorite = (a) => Boolean(a.isFavorite);
776
+ var selectAgentTabCounts = memoize2(
777
+ (agents, archFilter) => ({
778
+ mine: countUserRows(agents, archFilter, isOwned),
779
+ shared: countUserRows(agents, archFilter, isShared),
780
+ all: countUserRows(agents, archFilter, isAny),
781
+ system: selectBuiltinTypeAgents(agents).length
782
+ })
783
+ );
784
+ var selectTotalUserAgentsCount = memoize1(
785
+ (agents) => countUserRows(agents, "active", isAny)
786
+ );
787
+ var selectTotalOwnedAgentsCount = memoize1(
788
+ (agents) => countUserRows(agents, "active", isOwned)
789
+ );
790
+ var selectTotalSharedAgentsCount = memoize1(
791
+ (agents) => countUserRows(agents, "active", isShared)
792
+ );
793
+ var selectTotalBuiltinAgentsCount = memoize1(
794
+ (agents) => selectBuiltinTypeAgents(agents).length
795
+ );
796
+ var selectTotalFavoriteAgentsCount = memoize1(
797
+ (agents) => countUserRows(agents, "active", isFavorite)
798
+ );
799
+
800
+ // catalog/shared/useAgentListCore.ts
801
+ var HOVER_GRACE_MS = 900;
802
+ function coerceVisibleTab(current, allowed, initialTab) {
803
+ if (allowed.length === 0) return null;
804
+ if (allowed.includes(current)) return null;
805
+ return initialTab && allowed.includes(initialTab) ? initialTab : allowed[0] ?? null;
806
+ }
807
+ var EMPTY_EXCLUDES = [];
808
+ function useAgentListCore({
809
+ consumerId,
810
+ onSelect,
811
+ navigateTo,
812
+ activeAgentIdOverride,
813
+ initialTab,
814
+ includeSystemInAll = false,
815
+ visibleTabs,
816
+ excludeAgentIds = EMPTY_EXCLUDES,
817
+ defaultMandateKey
818
+ }) {
819
+ const catalog = useAgentCatalog();
820
+ const { navigate } = useAgentCatalogUiPorts();
821
+ const hasFetchedRef = (0, import_react4.useRef)(false);
822
+ const [hoveredAgent, setHoveredAgent] = (0, import_react4.useState)(null);
823
+ const hoverLeaveTimerRef = (0, import_react4.useRef)(null);
824
+ const defaultTabAppliedRef = (0, import_react4.useRef)(false);
825
+ const consumer = useAgentConsumer(consumerId, { unregisterOnUnmount: true });
826
+ const rows = useAgentCatalogRows();
827
+ const userId = catalog.getUserIdOrNull();
828
+ const tabCountsForFilter = selectAgentTabCounts(rows, consumer.state.archFilter);
829
+ const ownedCount = tabCountsForFilter.mine;
830
+ const selectFiltered = (0, import_react4.useMemo)(
831
+ () => makeSelectFilteredAgents(includeSystemInAll),
832
+ [includeSystemInAll]
833
+ );
834
+ const filteredAgents = selectFiltered(rows, consumer.state);
835
+ const excludedAgentIds = (0, import_react4.useMemo)(
836
+ () => new Set(excludeAgentIds),
837
+ [excludeAgentIds]
838
+ );
839
+ const agents = excludedAgentIds.size === 0 ? filteredAgents : filteredAgents.filter((agent) => !excludedAgentIds.has(agent.id));
840
+ const status = useAgentCatalogState(selectStatus);
841
+ const activeAgentId = activeAgentIdOverride ?? null;
842
+ const pinnedAgent = activeAgentId ? catalog.getAgent(activeAgentId) : void 0;
843
+ const onSystemTab = consumer.tab === "system";
844
+ const allCategories = onSystemTab ? selectAllSystemAgentCategories(rows) : selectAllAgentCategories(rows);
845
+ const allTags = onSystemTab ? selectAllSystemAgentTags(rows) : selectAllAgentTags(rows);
846
+ const tabCounts = tabCountsForFilter;
847
+ const isLoading = status === "loading";
848
+ const agentsLoaded = status === "succeeded" || status === "failed";
849
+ const ensureLoaded = (0, import_react4.useCallback)(() => {
850
+ if (!hasFetchedRef.current) {
851
+ hasFetchedRef.current = true;
852
+ void catalog.ensureLoaded().catch(() => {
853
+ });
854
+ }
855
+ }, [catalog]);
856
+ const selectDefaultRow = (0, import_react4.useCallback)(
857
+ (state) => defaultMandateKey ? state.defaultRows[defaultMandateKey] : void 0,
858
+ [defaultMandateKey]
859
+ );
860
+ const defaultRow = useAgentCatalogState(selectDefaultRow);
861
+ (0, import_react4.useEffect)(() => {
862
+ if (!defaultMandateKey) return;
863
+ catalog.ensureDefaultRow(defaultMandateKey);
864
+ }, [catalog, defaultMandateKey]);
865
+ (0, import_react4.useEffect)(() => {
866
+ if (defaultTabAppliedRef.current) return;
867
+ if (initialTab) {
868
+ defaultTabAppliedRef.current = true;
869
+ if (consumer.tab !== initialTab) consumer.setTab(initialTab);
870
+ return;
871
+ }
872
+ if (consumer.tab !== "mine") {
873
+ defaultTabAppliedRef.current = true;
874
+ return;
875
+ }
876
+ const wantsPublic = shouldDefaultAgentListToPublicTab({
877
+ userId,
878
+ ownedCount,
879
+ agentsLoaded
880
+ });
881
+ if (!wantsPublic) {
882
+ if (!userId || agentsLoaded) {
883
+ defaultTabAppliedRef.current = true;
884
+ }
885
+ return;
886
+ }
887
+ consumer.setTab("system");
888
+ defaultTabAppliedRef.current = true;
889
+ }, [
890
+ userId,
891
+ ownedCount,
892
+ agentsLoaded,
893
+ initialTab,
894
+ consumer.tab,
895
+ consumer.setTab
896
+ ]);
897
+ const allowedTabsKey = visibleTabs ? visibleTabs.join(",") : "";
898
+ (0, import_react4.useEffect)(() => {
899
+ if (!allowedTabsKey) return;
900
+ const next = coerceVisibleTab(
901
+ consumer.tab,
902
+ allowedTabsKey.split(","),
903
+ initialTab
904
+ );
905
+ if (next) consumer.setTab(next);
906
+ }, [allowedTabsKey, initialTab, consumer.tab, consumer.setTab]);
907
+ (0, import_react4.useEffect)(() => {
908
+ ensureLoaded();
909
+ }, [ensureLoaded]);
910
+ const handleSelectAgent = (0, import_react4.useCallback)(
911
+ (agent) => {
912
+ if (onSelect) {
913
+ onSelect(agent.id);
914
+ } else if (navigateTo) {
915
+ navigate(navigateTo.replace("{id}", agent.id));
916
+ } else {
917
+ catalog.errorSink({
918
+ code: "select_has_nowhere_to_go",
919
+ message: "an agent was chosen but this picker was given neither onSelect nor navigateTo, so the choice went nowhere.",
920
+ context: { consumerId, agentId: agent.id }
921
+ });
922
+ }
923
+ },
924
+ [onSelect, navigateTo, navigate, catalog, consumerId]
925
+ );
926
+ const activeFilterCount = (consumer.sortBy !== "updated-desc" ? 1 : 0) + (consumer.includedCats.length > 0 ? 1 : 0) + (consumer.includedTags.length > 0 ? 1 : 0) + (consumer.favFilter !== "all" ? 1 : 0);
927
+ const handleAgentHover = (0, import_react4.useCallback)(
928
+ (agent, panelOpen) => {
929
+ if (panelOpen) return;
930
+ if (hoverLeaveTimerRef.current) {
931
+ clearTimeout(hoverLeaveTimerRef.current);
932
+ hoverLeaveTimerRef.current = null;
933
+ }
934
+ setHoveredAgent(agent);
935
+ },
936
+ []
937
+ );
938
+ const handleAgentHoverEnd = (0, import_react4.useCallback)(
939
+ (agent, onClear) => {
940
+ if (hoveredAgent?.id === agent.id) {
941
+ hoverLeaveTimerRef.current = setTimeout(() => {
942
+ setHoveredAgent(null);
943
+ onClear();
944
+ }, HOVER_GRACE_MS);
945
+ }
946
+ },
947
+ [hoveredAgent]
948
+ );
949
+ const handleDetailPanelMouseEnter = (0, import_react4.useCallback)(() => {
950
+ if (hoverLeaveTimerRef.current) {
951
+ clearTimeout(hoverLeaveTimerRef.current);
952
+ hoverLeaveTimerRef.current = null;
953
+ }
954
+ }, []);
955
+ const handleDetailPanelMouseLeave = (0, import_react4.useCallback)((onClear) => {
956
+ hoverLeaveTimerRef.current = setTimeout(() => {
957
+ setHoveredAgent(null);
958
+ onClear();
959
+ }, HOVER_GRACE_MS);
960
+ }, []);
961
+ (0, import_react4.useEffect)(
962
+ () => () => {
963
+ if (hoverLeaveTimerRef.current) clearTimeout(hoverLeaveTimerRef.current);
964
+ },
965
+ []
966
+ );
967
+ return {
968
+ agents,
969
+ isLoading,
970
+ activeAgentId,
971
+ pinnedAgent: pinnedAgent ?? null,
972
+ defaultRow: defaultRow ?? null,
973
+ allCategories,
974
+ allTags,
975
+ consumer,
976
+ tabCounts,
977
+ activeFilterCount,
978
+ hoveredAgent,
979
+ setHoveredAgent,
980
+ ensureLoaded,
981
+ handleSelectAgent,
982
+ handleAgentHover,
983
+ handleAgentHoverEnd,
984
+ handleDetailPanelMouseEnter,
985
+ handleDetailPanelMouseLeave
986
+ };
987
+ }
988
+ var selectStatus = (state) => state.status;
989
+
990
+ // catalog/native/AgentDetailCard.tsx
991
+ var import_react_native4 = require("react-native");
992
+
993
+ // catalog/orchestra.ts
994
+ var ORCHESTRA_MODE_LABEL = {
995
+ supervisor: "supervisor",
996
+ sequential: "in order",
997
+ parallel: "together",
998
+ dag: "custom flow"
999
+ };
1000
+ function orchestraModeLabel(mode) {
1001
+ return ORCHESTRA_MODE_LABEL[mode] ?? mode;
1002
+ }
1003
+ function orchestraLabel(badge) {
1004
+ const n = badge.memberCount;
1005
+ return `Orchestra \xB7 ${orchestraModeLabel(badge.mode)} \xB7 ${n} ${n === 1 ? "member" : "members"}`;
1006
+ }
1007
+ function orchestraDepthLine(badge) {
1008
+ const n = badge.depthBudget;
1009
+ if (typeof n !== "number" || n <= 0) return null;
1010
+ return `Team members can call helpers up to ${n} ${n === 1 ? "level" : "levels"} deep`;
1011
+ }
1012
+ function orchestraDelegatesLine(badge, limit = 3) {
1013
+ const titles = badge.memberTitles;
1014
+ if (titles.length === 0) return null;
1015
+ const shown = titles.slice(0, limit);
1016
+ const extra = titles.length - shown.length;
1017
+ return `Delegates to: ${shown.join(", ")}${extra > 0 ? ` +${extra} more` : ""}`;
1018
+ }
1019
+
1020
+ // catalog/native/icons.tsx
1021
+ var import_react_native2 = require("react-native");
1022
+
1023
+ // catalog/shared/icon-paths.ts
1024
+ var SHAPES = {
1025
+ star: {
1026
+ paths: [
1027
+ "M11.5 3.2a.6.6 0 0 1 1 0l2.3 4.7 5.2.8a.6.6 0 0 1 .3 1l-3.8 3.7.9 5.2a.6.6 0 0 1-.9.6L12 16.8l-4.6 2.4a.6.6 0 0 1-.9-.6l.9-5.2-3.8-3.7a.6.6 0 0 1 .3-1l5.2-.8Z"
1028
+ ],
1029
+ fillable: true
1030
+ },
1031
+ chevronRight: { paths: ["m9 18 6-6-6-6"] },
1032
+ chevronDown: { paths: ["m6 9 6 6 6-6"] },
1033
+ search: {
1034
+ paths: ["m21 21-4.3-4.3"],
1035
+ circles: [{ cx: 11, cy: 11, r: 8 }]
1036
+ },
1037
+ x: { paths: ["M18 6 6 18", "m6 6 12 12"] },
1038
+ check: { paths: ["M20 6 9 17l-5-5"] },
1039
+ arrowUpDown: {
1040
+ paths: ["m21 16-4 4-4-4", "M17 20V4", "m3 8 4-4 4 4", "M7 4v16"]
1041
+ },
1042
+ folder: {
1043
+ paths: [
1044
+ "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
1045
+ ]
1046
+ },
1047
+ tag: {
1048
+ paths: [
1049
+ "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"
1050
+ ],
1051
+ circles: [{ cx: 7.5, cy: 7.5, r: 0.5, filled: true }]
1052
+ },
1053
+ rotateCcw: {
1054
+ paths: [
1055
+ "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
1056
+ "M3 3v5h5"
1057
+ ]
1058
+ },
1059
+ loader: { paths: ["M21 12a9 9 0 1 1-6.219-8.56"] },
1060
+ alertTriangle: {
1061
+ paths: [
1062
+ "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
1063
+ "M12 9v4",
1064
+ "M12 17h.01"
1065
+ ]
1066
+ },
1067
+ /**
1068
+ * The Orchestra marker (Lucide `music-4`): the glyph the Workflow Studio's
1069
+ * picker used for a conductor, kept identical so the same agent wears the
1070
+ * same mark in every client.
1071
+ */
1072
+ music4: {
1073
+ paths: ["M9 18V5l12-2v13", "m9 9 12-2"],
1074
+ circles: [
1075
+ { cx: 6, cy: 18, r: 3 },
1076
+ { cx: 18, cy: 16, r: 3 }
1077
+ ]
1078
+ },
1079
+ clock: {
1080
+ paths: ["M12 6v6l4 2"],
1081
+ circles: [{ cx: 12, cy: 12, r: 10 }]
1082
+ },
1083
+ globe: {
1084
+ paths: ["M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", "M2 12h20"],
1085
+ circles: [{ cx: 12, cy: 12, r: 10 }]
1086
+ },
1087
+ users: {
1088
+ paths: [
1089
+ "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",
1090
+ "M22 21v-2a4 4 0 0 0-3-3.87",
1091
+ "M16 3.13a4 4 0 0 1 0 7.75"
1092
+ ],
1093
+ circles: [{ cx: 9, cy: 7, r: 4 }]
1094
+ },
1095
+ externalLink: {
1096
+ paths: [
1097
+ "M15 3h6v6",
1098
+ "M10 14 21 3",
1099
+ "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
1100
+ ]
1101
+ },
1102
+ messageCircle: { paths: ["M7.9 20A9 9 0 1 0 4 16.1L2 22Z"] },
1103
+ rocket: {
1104
+ paths: [
1105
+ "M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91 0",
1106
+ "m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2",
1107
+ "M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",
1108
+ "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"
1109
+ ]
1110
+ },
1111
+ circleCheck: {
1112
+ paths: ["m9 12 2 2 4-4"],
1113
+ circles: [{ cx: 12, cy: 12, r: 10 }]
1114
+ }
1115
+ };
1116
+ var ICON_PATHS = SHAPES;
1117
+ var ICON_NAMES = Object.keys(ICON_PATHS);
1118
+
1119
+ // catalog/native/icons.tsx
1120
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1121
+ var STATE_KEY = /* @__PURE__ */ Symbol.for("ai-matrx.agents.catalog.native.icons");
1122
+ function getIconsGlobalState() {
1123
+ const store = globalThis;
1124
+ const existing = store[STATE_KEY];
1125
+ if (existing) return existing;
1126
+ const created = { svg: void 0, announced: false };
1127
+ store[STATE_KEY] = created;
1128
+ return created;
1129
+ }
1130
+ function _resetNativeIconState(svg) {
1131
+ const state = getIconsGlobalState();
1132
+ state.svg = svg === void 0 ? void 0 : svg;
1133
+ state.announced = false;
1134
+ }
1135
+ function isSvgModule(value) {
1136
+ if (typeof value !== "object" || value === null) return false;
1137
+ const record = value;
1138
+ return Boolean(record["Path"] && record["Circle"] && record["default"]);
1139
+ }
1140
+ function resolveSvgModule() {
1141
+ const state = getIconsGlobalState();
1142
+ if (state.svg !== void 0) return state.svg;
1143
+ let resolved = null;
1144
+ try {
1145
+ const required = globalThis.require?.("react-native-svg");
1146
+ if (isSvgModule(required)) resolved = required;
1147
+ else {
1148
+ const viaModule = require("react-native-svg");
1149
+ if (isSvgModule(viaModule)) resolved = viaModule;
1150
+ }
1151
+ } catch {
1152
+ resolved = null;
1153
+ }
1154
+ state.svg = resolved;
1155
+ return resolved;
1156
+ }
1157
+ function announceMissingSvgOnce(report) {
1158
+ const state = getIconsGlobalState();
1159
+ if (state.announced) return;
1160
+ state.announced = true;
1161
+ report({
1162
+ code: "native_icons_degraded_to_text",
1163
+ message: "react-native-svg is not installed, so the agent picker is drawing its icons as text glyphs. Every control still works and every label is still correct \u2014 only the glyphs are plainer.",
1164
+ context: {
1165
+ remedy: "run `npx expo install react-native-svg` (it is an optional peer of @ai-matrx/agents) and reload to get the real icons"
1166
+ }
1167
+ });
1168
+ }
1169
+ var TEXT_GLYPHS = {
1170
+ star: "\u2605",
1171
+ chevronRight: "\u203A",
1172
+ chevronDown: "\u2304",
1173
+ search: "\u2315",
1174
+ x: "\u2715",
1175
+ check: "\u2713",
1176
+ arrowUpDown: "\u21C5",
1177
+ folder: "\u25A4",
1178
+ tag: "\u2317",
1179
+ rotateCcw: "\u21BA",
1180
+ loader: "\u25CC",
1181
+ alertTriangle: "\u26A0",
1182
+ music4: "\u266A",
1183
+ clock: "\u25F7",
1184
+ globe: "\u2295",
1185
+ users: "\u2687",
1186
+ externalLink: "\u2197",
1187
+ messageCircle: "\u2709",
1188
+ rocket: "\u27A4",
1189
+ circleCheck: "\u2713"
1190
+ };
1191
+ function AgentIcon({
1192
+ name,
1193
+ size = 14,
1194
+ color,
1195
+ filled = false,
1196
+ report
1197
+ }) {
1198
+ const svg = resolveSvgModule();
1199
+ if (!svg) {
1200
+ announceMissingSvgOnce(report);
1201
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1202
+ import_react_native2.Text,
1203
+ {
1204
+ accessible: false,
1205
+ style: { color, fontSize: size, lineHeight: size * 1.2 },
1206
+ children: TEXT_GLYPHS[name]
1207
+ }
1208
+ );
1209
+ }
1210
+ const Svg = svg.default;
1211
+ const Path = svg.Path;
1212
+ const Circle = svg.Circle;
1213
+ const shape = ICON_PATHS[name];
1214
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1215
+ Svg,
1216
+ {
1217
+ width: size,
1218
+ height: size,
1219
+ viewBox: "0 0 24 24",
1220
+ fill: "none",
1221
+ stroke: color,
1222
+ strokeWidth: 2,
1223
+ strokeLinecap: "round",
1224
+ strokeLinejoin: "round",
1225
+ children: [
1226
+ shape.paths.map((d, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1227
+ Path,
1228
+ {
1229
+ d,
1230
+ ...filled && shape.fillable ? { fill: color } : {}
1231
+ },
1232
+ `p${index}`
1233
+ )),
1234
+ (shape.circles ?? []).map((circle, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1235
+ Circle,
1236
+ {
1237
+ cx: circle.cx,
1238
+ cy: circle.cy,
1239
+ r: circle.r,
1240
+ ...circle.filled ? { fill: color } : {}
1241
+ },
1242
+ `c${index}`
1243
+ ))
1244
+ ]
1245
+ }
1246
+ );
1247
+ }
1248
+
1249
+ // catalog/native/FavoriteAgentButton.tsx
1250
+ var import_react5 = require("react");
1251
+ var import_react_native3 = require("react-native");
1252
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1253
+ function FavoriteAgentButton({
1254
+ id,
1255
+ size = 18,
1256
+ disabled
1257
+ }) {
1258
+ const catalog = useAgentCatalog();
1259
+ const theme = useAgentCatalogNativeTheme();
1260
+ const select = (0, import_react5.useCallback)((state) => state.byId[id], [id]);
1261
+ const record = useAgentCatalogState(select);
1262
+ const isFavorite2 = record?.isFavorite ?? false;
1263
+ const isOwner = record?.isOwner ?? true;
1264
+ const inert = Boolean(disabled) || !isOwner;
1265
+ const title = isOwner ? isFavorite2 ? "Remove from favorites" : "Add to favorites" : "Shared \u2014 cannot favorite";
1266
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1267
+ import_react_native3.Pressable,
1268
+ {
1269
+ onPress: () => {
1270
+ if (inert) return;
1271
+ void catalog.setFavorite(id, !isFavorite2).catch(() => {
1272
+ });
1273
+ },
1274
+ disabled: inert,
1275
+ hitSlop: 8,
1276
+ accessibilityRole: "button",
1277
+ accessibilityLabel: title,
1278
+ accessibilityState: { disabled: inert, selected: isFavorite2 },
1279
+ style: { opacity: inert ? 0.4 : 1 },
1280
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1281
+ AgentIcon,
1282
+ {
1283
+ name: "star",
1284
+ size,
1285
+ filled: isFavorite2,
1286
+ color: isFavorite2 ? theme.colors.favorite : theme.colors.textFaint,
1287
+ report: catalog.errorSink
1288
+ }
1289
+ )
1290
+ }
1291
+ );
1292
+ }
1293
+
1294
+ // catalog/native/AgentDetailCard.tsx
1295
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1296
+ function formatDate(value) {
1297
+ if (!value) return null;
1298
+ const date = new Date(value);
1299
+ if (Number.isNaN(date.getTime())) return null;
1300
+ return date.toLocaleDateString(void 0, {
1301
+ month: "short",
1302
+ day: "numeric",
1303
+ year: "numeric"
1304
+ });
1305
+ }
1306
+ function AgentDetailCard({ agent, onSelect }) {
1307
+ const { errorSink } = useAgentCatalog();
1308
+ const { renderModelRef, openPeek } = useAgentCatalogUiPorts();
1309
+ const theme = useAgentCatalogNativeTheme();
1310
+ const isDefaultRow = isMandateAgentId(agent.id);
1311
+ const updated = formatDate(agent.updatedAt);
1312
+ const created = formatDate(agent.createdAt);
1313
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.container, children: [
1314
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: [styles.header, { padding: theme.spacing.md }], children: [
1315
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: { flex: 1, minWidth: 0 }, children: [
1316
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1317
+ import_react_native4.Text,
1318
+ {
1319
+ numberOfLines: 2,
1320
+ style: {
1321
+ color: theme.colors.text,
1322
+ fontSize: theme.fontSize.lg,
1323
+ fontWeight: "600"
1324
+ },
1325
+ children: agent.name || "Untitled"
1326
+ }
1327
+ ),
1328
+ agent.isFavorite && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1329
+ import_react_native4.Text,
1330
+ {
1331
+ style: { color: theme.colors.favorite, fontSize: theme.fontSize.sm },
1332
+ children: "Pinned to favorites"
1333
+ }
1334
+ )
1335
+ ] }),
1336
+ !isDefaultRow && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FavoriteAgentButton, { id: agent.id })
1337
+ ] }),
1338
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.View, { style: { height: import_react_native4.StyleSheet.hairlineWidth, backgroundColor: theme.colors.border } }),
1339
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1340
+ import_react_native4.ScrollView,
1341
+ {
1342
+ style: styles.body,
1343
+ contentContainerStyle: { padding: theme.spacing.md, gap: theme.spacing.md },
1344
+ children: [
1345
+ agent.orchestra && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1346
+ import_react_native4.View,
1347
+ {
1348
+ style: [
1349
+ styles.orchestra,
1350
+ {
1351
+ borderColor: theme.colors.primary,
1352
+ backgroundColor: theme.colors.primarySoft,
1353
+ borderRadius: theme.radius.md,
1354
+ padding: theme.spacing.sm
1355
+ }
1356
+ ],
1357
+ children: [
1358
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1359
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1360
+ AgentIcon,
1361
+ {
1362
+ name: "music4",
1363
+ size: 14,
1364
+ color: theme.colors.primary,
1365
+ report: errorSink
1366
+ }
1367
+ ),
1368
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1369
+ import_react_native4.Text,
1370
+ {
1371
+ style: {
1372
+ color: theme.colors.primary,
1373
+ fontSize: theme.fontSize.sm,
1374
+ fontWeight: "600"
1375
+ },
1376
+ children: orchestraLabel(agent.orchestra)
1377
+ }
1378
+ )
1379
+ ] }),
1380
+ agent.orchestra.tagline && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: { color: theme.colors.text, fontSize: theme.fontSize.md }, children: agent.orchestra.tagline }),
1381
+ orchestraDelegatesLine(agent.orchestra) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1382
+ import_react_native4.Text,
1383
+ {
1384
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.sm },
1385
+ children: orchestraDelegatesLine(agent.orchestra)
1386
+ }
1387
+ ),
1388
+ orchestraDepthLine(agent.orchestra) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1389
+ import_react_native4.Text,
1390
+ {
1391
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.sm },
1392
+ children: orchestraDepthLine(agent.orchestra)
1393
+ }
1394
+ )
1395
+ ]
1396
+ }
1397
+ ),
1398
+ agent.description && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: { gap: 4 }, children: [
1399
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1400
+ import_react_native4.Text,
1401
+ {
1402
+ style: {
1403
+ color: theme.colors.textMuted,
1404
+ fontSize: theme.fontSize.sm,
1405
+ fontWeight: "600",
1406
+ textTransform: "uppercase"
1407
+ },
1408
+ children: "Description"
1409
+ }
1410
+ ),
1411
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: { color: theme.colors.text, fontSize: theme.fontSize.md }, children: agent.description })
1412
+ ] }),
1413
+ agent.category && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1414
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1415
+ AgentIcon,
1416
+ {
1417
+ name: "folder",
1418
+ size: 14,
1419
+ color: theme.colors.textMuted,
1420
+ report: errorSink
1421
+ }
1422
+ ),
1423
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: { color: theme.colors.text, fontSize: theme.fontSize.md }, children: agent.category })
1424
+ ] }),
1425
+ agent.tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: { gap: 6 }, children: [
1426
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1427
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1428
+ AgentIcon,
1429
+ {
1430
+ name: "tag",
1431
+ size: 14,
1432
+ color: theme.colors.textMuted,
1433
+ report: errorSink
1434
+ }
1435
+ ),
1436
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1437
+ import_react_native4.Text,
1438
+ {
1439
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.sm },
1440
+ children: "Tags"
1441
+ }
1442
+ )
1443
+ ] }),
1444
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.View, { style: styles.tagWrap, children: agent.tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1445
+ import_react_native4.Text,
1446
+ {
1447
+ style: {
1448
+ color: theme.colors.textMuted,
1449
+ backgroundColor: theme.colors.surface,
1450
+ borderRadius: theme.radius.sm,
1451
+ overflow: "hidden",
1452
+ paddingHorizontal: 6,
1453
+ paddingVertical: 2,
1454
+ fontSize: theme.fontSize.xs
1455
+ },
1456
+ children: tag
1457
+ },
1458
+ tag
1459
+ )) })
1460
+ ] }),
1461
+ agent.accessLevel && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1462
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1463
+ AgentIcon,
1464
+ {
1465
+ name: agent.isOwner === false ? "users" : "globe",
1466
+ size: 14,
1467
+ color: theme.colors.textMuted,
1468
+ report: errorSink
1469
+ }
1470
+ ),
1471
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { children: [
1472
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: { color: theme.colors.text, fontSize: theme.fontSize.md }, children: agent.accessLevel === "owner" ? "You own this" : `Shared \u2014 ${agent.accessLevel}` }),
1473
+ agent.sharedByEmail && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1474
+ import_react_native4.Text,
1475
+ {
1476
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.xs },
1477
+ children: [
1478
+ "by ",
1479
+ agent.sharedByEmail
1480
+ ]
1481
+ }
1482
+ )
1483
+ ] })
1484
+ ] }),
1485
+ agent.modelId && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.View, { children: renderModelRef({ modelId: agent.modelId }) }),
1486
+ (updated || created) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: { gap: 4 }, children: [
1487
+ updated && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1488
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1489
+ AgentIcon,
1490
+ {
1491
+ name: "clock",
1492
+ size: 13,
1493
+ color: theme.colors.textMuted,
1494
+ report: errorSink
1495
+ }
1496
+ ),
1497
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1498
+ import_react_native4.Text,
1499
+ {
1500
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.sm },
1501
+ children: [
1502
+ "Updated ",
1503
+ updated
1504
+ ]
1505
+ }
1506
+ )
1507
+ ] }),
1508
+ created && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: styles.inline, children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1510
+ AgentIcon,
1511
+ {
1512
+ name: "clock",
1513
+ size: 13,
1514
+ color: theme.colors.textFaint,
1515
+ report: errorSink
1516
+ }
1517
+ ),
1518
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1519
+ import_react_native4.Text,
1520
+ {
1521
+ style: { color: theme.colors.textFaint, fontSize: theme.fontSize.sm },
1522
+ children: [
1523
+ "Created ",
1524
+ created
1525
+ ]
1526
+ }
1527
+ )
1528
+ ] })
1529
+ ] })
1530
+ ]
1531
+ }
1532
+ ),
1533
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.View, { style: { height: import_react_native4.StyleSheet.hairlineWidth, backgroundColor: theme.colors.border } }),
1534
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native4.View, { style: [styles.footer, { padding: theme.spacing.sm }], children: [
1535
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1536
+ import_react_native4.Pressable,
1537
+ {
1538
+ onPress: onSelect,
1539
+ accessibilityRole: "button",
1540
+ accessibilityLabel: `Select ${agent.name || "Untitled"}`,
1541
+ style: ({ pressed }) => [
1542
+ styles.selectButton,
1543
+ {
1544
+ borderRadius: theme.radius.md,
1545
+ backgroundColor: theme.colors.primary,
1546
+ opacity: pressed ? 0.85 : 1
1547
+ }
1548
+ ],
1549
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1550
+ import_react_native4.Text,
1551
+ {
1552
+ style: {
1553
+ color: theme.colors.primaryForeground,
1554
+ fontSize: theme.fontSize.md,
1555
+ fontWeight: "600"
1556
+ },
1557
+ children: "Select"
1558
+ }
1559
+ )
1560
+ }
1561
+ ),
1562
+ openPeek && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1563
+ import_react_native4.Pressable,
1564
+ {
1565
+ onPress: () => openPeek(agent),
1566
+ accessibilityRole: "button",
1567
+ accessibilityLabel: "Sneak Peek",
1568
+ style: ({ pressed }) => [
1569
+ styles.iconButton,
1570
+ {
1571
+ borderRadius: theme.radius.md,
1572
+ borderColor: theme.colors.border,
1573
+ backgroundColor: pressed ? theme.colors.surfacePressed : theme.colors.surface
1574
+ }
1575
+ ],
1576
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1577
+ AgentIcon,
1578
+ {
1579
+ name: "rocket",
1580
+ size: 14,
1581
+ color: theme.colors.textMuted,
1582
+ report: errorSink
1583
+ }
1584
+ )
1585
+ }
1586
+ )
1587
+ ] })
1588
+ ] });
1589
+ }
1590
+ var styles = import_react_native4.StyleSheet.create({
1591
+ container: { flex: 1, minHeight: 0 },
1592
+ header: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
1593
+ body: { flex: 1, minHeight: 0 },
1594
+ inline: { flexDirection: "row", alignItems: "center", gap: 8 },
1595
+ orchestra: { borderWidth: import_react_native4.StyleSheet.hairlineWidth, gap: 4 },
1596
+ tagWrap: { flexDirection: "row", flexWrap: "wrap", gap: 4 },
1597
+ footer: { flexDirection: "row", alignItems: "center", gap: 8 },
1598
+ selectButton: {
1599
+ flex: 1,
1600
+ height: 40,
1601
+ alignItems: "center",
1602
+ justifyContent: "center"
1603
+ },
1604
+ iconButton: {
1605
+ width: 40,
1606
+ height: 40,
1607
+ alignItems: "center",
1608
+ justifyContent: "center",
1609
+ borderWidth: import_react_native4.StyleSheet.hairlineWidth
1610
+ }
1611
+ });
1612
+
1613
+ // catalog/native/AgentListContent.tsx
1614
+ var import_react_native9 = require("react-native");
1615
+
1616
+ // catalog/native/AgentFilterBar.tsx
1617
+ var import_react_native6 = require("react-native");
1618
+
1619
+ // catalog/native/primitives.tsx
1620
+ var import_react_native5 = require("react-native");
1621
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1622
+ function SearchInput({
1623
+ value,
1624
+ onChange,
1625
+ placeholder,
1626
+ autoFocus = false
1627
+ }) {
1628
+ const theme = useAgentCatalogNativeTheme();
1629
+ const { errorSink } = useAgentCatalog();
1630
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1631
+ import_react_native5.View,
1632
+ {
1633
+ style: [
1634
+ styles2.searchWrap,
1635
+ {
1636
+ backgroundColor: theme.colors.surface,
1637
+ borderColor: theme.colors.border,
1638
+ borderRadius: theme.radius.md,
1639
+ paddingHorizontal: theme.spacing.sm
1640
+ }
1641
+ ],
1642
+ children: [
1643
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1644
+ AgentIcon,
1645
+ {
1646
+ name: "search",
1647
+ size: 14,
1648
+ color: theme.colors.textMuted,
1649
+ report: errorSink
1650
+ }
1651
+ ),
1652
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1653
+ import_react_native5.TextInput,
1654
+ {
1655
+ value,
1656
+ onChangeText: onChange,
1657
+ placeholder,
1658
+ placeholderTextColor: theme.colors.textFaint,
1659
+ autoFocus,
1660
+ autoCorrect: false,
1661
+ autoCapitalize: "none",
1662
+ returnKeyType: "search",
1663
+ accessibilityLabel: placeholder,
1664
+ style: [styles2.searchInput, { color: theme.colors.text }]
1665
+ }
1666
+ ),
1667
+ value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1668
+ import_react_native5.Pressable,
1669
+ {
1670
+ onPress: () => onChange(""),
1671
+ accessibilityRole: "button",
1672
+ accessibilityLabel: "Clear search",
1673
+ hitSlop: 8,
1674
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1675
+ AgentIcon,
1676
+ {
1677
+ name: "x",
1678
+ size: 13,
1679
+ color: theme.colors.textMuted,
1680
+ report: errorSink
1681
+ }
1682
+ )
1683
+ }
1684
+ )
1685
+ ]
1686
+ }
1687
+ );
1688
+ }
1689
+ function FilterChip({
1690
+ icon,
1691
+ label,
1692
+ active,
1693
+ onPress
1694
+ }) {
1695
+ const theme = useAgentCatalogNativeTheme();
1696
+ const { errorSink } = useAgentCatalog();
1697
+ const tint = active ? theme.colors.primary : theme.colors.textMuted;
1698
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1699
+ import_react_native5.Pressable,
1700
+ {
1701
+ onPress,
1702
+ accessibilityRole: "button",
1703
+ accessibilityState: { selected: active },
1704
+ accessibilityLabel: label,
1705
+ style: ({ pressed }) => [
1706
+ styles2.chip,
1707
+ {
1708
+ borderRadius: theme.radius.sm,
1709
+ backgroundColor: active ? theme.colors.primarySoft : pressed ? theme.colors.surfacePressed : "transparent",
1710
+ borderColor: active ? theme.colors.primary : "transparent"
1711
+ }
1712
+ ],
1713
+ children: [
1714
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AgentIcon, { name: icon, size: 12, color: tint, report: errorSink }),
1715
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: { color: tint, fontSize: theme.fontSize.sm, fontWeight: "500" }, children: label })
1716
+ ]
1717
+ }
1718
+ );
1719
+ }
1720
+ function OptionRow({
1721
+ label,
1722
+ selected,
1723
+ onPress
1724
+ }) {
1725
+ const theme = useAgentCatalogNativeTheme();
1726
+ const { errorSink } = useAgentCatalog();
1727
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1728
+ import_react_native5.Pressable,
1729
+ {
1730
+ onPress,
1731
+ accessibilityRole: "button",
1732
+ accessibilityState: { selected },
1733
+ style: ({ pressed }) => [
1734
+ styles2.optionRow,
1735
+ {
1736
+ paddingHorizontal: theme.spacing.md,
1737
+ backgroundColor: pressed ? theme.colors.surfacePressed : "transparent"
1738
+ }
1739
+ ],
1740
+ children: [
1741
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1742
+ import_react_native5.Text,
1743
+ {
1744
+ style: {
1745
+ flex: 1,
1746
+ color: selected ? theme.colors.primary : theme.colors.text,
1747
+ fontSize: theme.fontSize.md,
1748
+ fontWeight: selected ? "600" : "400"
1749
+ },
1750
+ children: label
1751
+ }
1752
+ ),
1753
+ selected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1754
+ AgentIcon,
1755
+ {
1756
+ name: "check",
1757
+ size: 14,
1758
+ color: theme.colors.primary,
1759
+ report: errorSink
1760
+ }
1761
+ )
1762
+ ]
1763
+ }
1764
+ );
1765
+ }
1766
+ function CheckRow({
1767
+ label,
1768
+ checked,
1769
+ onPress
1770
+ }) {
1771
+ const theme = useAgentCatalogNativeTheme();
1772
+ const { errorSink } = useAgentCatalog();
1773
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1774
+ import_react_native5.Pressable,
1775
+ {
1776
+ onPress,
1777
+ accessibilityRole: "checkbox",
1778
+ accessibilityState: { checked },
1779
+ style: ({ pressed }) => [
1780
+ styles2.checkRow,
1781
+ {
1782
+ paddingHorizontal: theme.spacing.md,
1783
+ backgroundColor: pressed ? theme.colors.surfacePressed : "transparent"
1784
+ }
1785
+ ],
1786
+ children: [
1787
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1788
+ import_react_native5.View,
1789
+ {
1790
+ style: [
1791
+ styles2.checkBox,
1792
+ {
1793
+ borderRadius: theme.radius.sm,
1794
+ borderColor: checked ? theme.colors.primary : theme.colors.border,
1795
+ backgroundColor: checked ? theme.colors.primary : "transparent"
1796
+ }
1797
+ ],
1798
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1799
+ AgentIcon,
1800
+ {
1801
+ name: "check",
1802
+ size: 10,
1803
+ color: theme.colors.primaryForeground,
1804
+ report: errorSink
1805
+ }
1806
+ )
1807
+ }
1808
+ ),
1809
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1810
+ import_react_native5.Text,
1811
+ {
1812
+ numberOfLines: 1,
1813
+ style: { flex: 1, color: theme.colors.text, fontSize: theme.fontSize.md },
1814
+ children: label
1815
+ }
1816
+ )
1817
+ ]
1818
+ }
1819
+ );
1820
+ }
1821
+ function SidePanelHeader({
1822
+ title,
1823
+ onClose
1824
+ }) {
1825
+ const theme = useAgentCatalogNativeTheme();
1826
+ const { errorSink } = useAgentCatalog();
1827
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1828
+ import_react_native5.View,
1829
+ {
1830
+ style: [
1831
+ styles2.panelHeader,
1832
+ {
1833
+ paddingHorizontal: theme.spacing.md,
1834
+ borderBottomColor: theme.colors.border
1835
+ }
1836
+ ],
1837
+ children: [
1838
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1839
+ import_react_native5.Text,
1840
+ {
1841
+ style: {
1842
+ color: theme.colors.text,
1843
+ fontSize: theme.fontSize.md,
1844
+ fontWeight: "600"
1845
+ },
1846
+ children: title
1847
+ }
1848
+ ),
1849
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1850
+ import_react_native5.Pressable,
1851
+ {
1852
+ onPress: onClose,
1853
+ accessibilityRole: "button",
1854
+ accessibilityLabel: "Close",
1855
+ hitSlop: 8,
1856
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1857
+ AgentIcon,
1858
+ {
1859
+ name: "x",
1860
+ size: 14,
1861
+ color: theme.colors.textMuted,
1862
+ report: errorSink
1863
+ }
1864
+ )
1865
+ }
1866
+ )
1867
+ ]
1868
+ }
1869
+ );
1870
+ }
1871
+ var styles2 = import_react_native5.StyleSheet.create({
1872
+ searchWrap: {
1873
+ flexDirection: "row",
1874
+ alignItems: "center",
1875
+ gap: 6,
1876
+ height: 36,
1877
+ borderWidth: import_react_native5.StyleSheet.hairlineWidth
1878
+ },
1879
+ searchInput: {
1880
+ flex: 1,
1881
+ minWidth: 0,
1882
+ padding: 0,
1883
+ fontSize: 15
1884
+ },
1885
+ chip: {
1886
+ flexDirection: "row",
1887
+ alignItems: "center",
1888
+ gap: 4,
1889
+ height: 28,
1890
+ paddingHorizontal: 8,
1891
+ borderWidth: import_react_native5.StyleSheet.hairlineWidth
1892
+ },
1893
+ optionRow: {
1894
+ flexDirection: "row",
1895
+ alignItems: "center",
1896
+ paddingVertical: 10
1897
+ },
1898
+ checkRow: {
1899
+ flexDirection: "row",
1900
+ alignItems: "center",
1901
+ gap: 8,
1902
+ paddingVertical: 8
1903
+ },
1904
+ checkBox: {
1905
+ width: 18,
1906
+ height: 18,
1907
+ alignItems: "center",
1908
+ justifyContent: "center",
1909
+ borderWidth: 1
1910
+ },
1911
+ panelHeader: {
1912
+ flexDirection: "row",
1913
+ alignItems: "center",
1914
+ justifyContent: "space-between",
1915
+ paddingVertical: 10,
1916
+ borderBottomWidth: import_react_native5.StyleSheet.hairlineWidth
1917
+ }
1918
+ });
1919
+
1920
+ // catalog/native/AgentFilterBar.tsx
1921
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1922
+ function AgentFilterBar({
1923
+ consumer,
1924
+ allCategories,
1925
+ allTags,
1926
+ activeFilterCount,
1927
+ onFilterChipPress,
1928
+ onReset
1929
+ }) {
1930
+ const theme = useAgentCatalogNativeTheme();
1931
+ const { errorSink } = useAgentCatalog();
1932
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1933
+ import_react_native6.ScrollView,
1934
+ {
1935
+ horizontal: true,
1936
+ showsHorizontalScrollIndicator: false,
1937
+ contentContainerStyle: [
1938
+ styles3.bar,
1939
+ { paddingHorizontal: theme.spacing.sm }
1940
+ ],
1941
+ children: [
1942
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1943
+ FilterChip,
1944
+ {
1945
+ icon: "arrowUpDown",
1946
+ label: SORT_OPTIONS.find((o) => o.value === consumer.sortBy)?.label ?? "Sort",
1947
+ active: consumer.sortBy !== "updated-desc",
1948
+ onPress: () => onFilterChipPress("sort")
1949
+ }
1950
+ ),
1951
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1952
+ FilterChip,
1953
+ {
1954
+ icon: "star",
1955
+ label: consumer.favFilter === "no" ? "No Favs" : "Favs",
1956
+ active: consumer.favFilter !== "all",
1957
+ onPress: () => {
1958
+ const next = consumer.favFilter === "all" ? "yes" : consumer.favFilter === "yes" ? "no" : "all";
1959
+ consumer.setFavFilter(next);
1960
+ }
1961
+ }
1962
+ ),
1963
+ allCategories.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1964
+ FilterChip,
1965
+ {
1966
+ icon: "folder",
1967
+ label: consumer.includedCats.length > 0 ? `${consumer.includedCats.length}` : "Category",
1968
+ active: consumer.includedCats.length > 0,
1969
+ onPress: () => onFilterChipPress("categories")
1970
+ }
1971
+ ),
1972
+ allTags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1973
+ FilterChip,
1974
+ {
1975
+ icon: "tag",
1976
+ label: consumer.includedTags.length > 0 ? `${consumer.includedTags.length}` : "Tags",
1977
+ active: consumer.includedTags.length > 0,
1978
+ onPress: () => onFilterChipPress("tags")
1979
+ }
1980
+ ),
1981
+ activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1982
+ import_react_native6.Pressable,
1983
+ {
1984
+ onPress: onReset,
1985
+ accessibilityRole: "button",
1986
+ accessibilityLabel: "Reset filters",
1987
+ hitSlop: 8,
1988
+ style: ({ pressed }) => [
1989
+ styles3.reset,
1990
+ {
1991
+ borderRadius: theme.radius.sm,
1992
+ backgroundColor: pressed ? theme.colors.surfacePressed : "transparent"
1993
+ }
1994
+ ],
1995
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1996
+ AgentIcon,
1997
+ {
1998
+ name: "rotateCcw",
1999
+ size: 12,
2000
+ color: theme.colors.textMuted,
2001
+ report: errorSink
2002
+ }
2003
+ )
2004
+ }
2005
+ )
2006
+ ]
2007
+ }
2008
+ );
2009
+ }
2010
+ var styles3 = import_react_native6.StyleSheet.create({
2011
+ bar: { flexDirection: "row", alignItems: "center", gap: 4, paddingBottom: 6 },
2012
+ reset: {
2013
+ height: 28,
2014
+ paddingHorizontal: 8,
2015
+ alignItems: "center",
2016
+ justifyContent: "center"
2017
+ }
2018
+ });
2019
+
2020
+ // catalog/native/AgentListTabs.tsx
2021
+ var import_react_native7 = require("react-native");
2022
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2023
+ function AgentListTabs({
2024
+ consumer,
2025
+ tabCounts,
2026
+ visibleTabs,
2027
+ systemTabLabel
2028
+ }) {
2029
+ const { labels } = useAgentCatalog();
2030
+ const theme = useAgentCatalogNativeTheme();
2031
+ const tabs = [
2032
+ { value: "mine", label: "Mine", countKey: "mine" },
2033
+ { value: "shared", label: "Shared", countKey: "shared" },
2034
+ { value: "all", label: "All", countKey: "all" },
2035
+ { value: "system", label: labels.publicTab, countKey: "system" }
2036
+ ];
2037
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2038
+ import_react_native7.ScrollView,
2039
+ {
2040
+ horizontal: true,
2041
+ showsHorizontalScrollIndicator: false,
2042
+ accessibilityRole: "tablist",
2043
+ accessibilityLabel: "Agent ownership",
2044
+ contentContainerStyle: [
2045
+ styles4.strip,
2046
+ { paddingHorizontal: theme.spacing.sm }
2047
+ ],
2048
+ children: tabs.filter(({ value }) => !visibleTabs || visibleTabs.includes(value)).map(({ value, label: baseLabel, countKey }) => {
2049
+ const label = value === "system" ? systemTabLabel ?? baseLabel : baseLabel;
2050
+ const active = consumer.tab === value;
2051
+ const count = tabCounts[countKey];
2052
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2053
+ import_react_native7.Pressable,
2054
+ {
2055
+ onPress: () => consumer.setTab(value),
2056
+ accessibilityRole: "tab",
2057
+ accessibilityState: { selected: active },
2058
+ accessibilityLabel: `${label}, ${count}`,
2059
+ style: ({ pressed }) => [
2060
+ styles4.tab,
2061
+ {
2062
+ borderRadius: theme.radius.md,
2063
+ backgroundColor: active ? theme.colors.primary : pressed ? theme.colors.surfacePressed : "transparent"
2064
+ }
2065
+ ],
2066
+ children: [
2067
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2068
+ import_react_native7.Text,
2069
+ {
2070
+ style: {
2071
+ color: active ? theme.colors.primaryForeground : theme.colors.textMuted,
2072
+ fontSize: theme.fontSize.sm,
2073
+ fontWeight: "500"
2074
+ },
2075
+ children: label
2076
+ }
2077
+ ),
2078
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2079
+ import_react_native7.Text,
2080
+ {
2081
+ style: {
2082
+ color: active ? theme.colors.primaryForeground : theme.colors.textMuted,
2083
+ fontSize: theme.fontSize.sm,
2084
+ opacity: 0.8,
2085
+ fontVariant: ["tabular-nums"]
2086
+ },
2087
+ children: count
2088
+ }
2089
+ )
2090
+ ]
2091
+ },
2092
+ value
2093
+ );
2094
+ })
2095
+ }
2096
+ );
2097
+ }
2098
+ var styles4 = import_react_native7.StyleSheet.create({
2099
+ strip: { flexDirection: "row", alignItems: "center", gap: 4, paddingBottom: 6 },
2100
+ tab: {
2101
+ flexDirection: "row",
2102
+ alignItems: "center",
2103
+ gap: 4,
2104
+ paddingHorizontal: 10,
2105
+ paddingVertical: 6
2106
+ }
2107
+ });
2108
+
2109
+ // catalog/native/AgentRow.tsx
2110
+ var import_react_native8 = require("react-native");
2111
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2112
+ function AgentRow({
2113
+ agent,
2114
+ isActive,
2115
+ onPress,
2116
+ onDetailPress
2117
+ }) {
2118
+ const { labels, errorSink } = useAgentCatalog();
2119
+ const theme = useAgentCatalogNativeTheme();
2120
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2121
+ import_react_native8.View,
2122
+ {
2123
+ testID: `agent-row-${agent.id}`,
2124
+ style: [
2125
+ styles5.row,
2126
+ isActive ? { backgroundColor: theme.colors.primarySoft } : null
2127
+ ],
2128
+ children: [
2129
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2130
+ import_react_native8.Pressable,
2131
+ {
2132
+ onPress,
2133
+ accessibilityRole: "button",
2134
+ accessibilityState: { selected: isActive },
2135
+ accessibilityLabel: agent.name || "Untitled",
2136
+ style: ({ pressed }) => [
2137
+ styles5.main,
2138
+ {
2139
+ paddingHorizontal: theme.spacing.md,
2140
+ backgroundColor: pressed ? theme.colors.surfacePressed : "transparent"
2141
+ }
2142
+ ],
2143
+ children: [
2144
+ agent.isFavorite && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2145
+ AgentIcon,
2146
+ {
2147
+ name: "star",
2148
+ size: 12,
2149
+ filled: true,
2150
+ color: theme.colors.favorite,
2151
+ report: errorSink
2152
+ }
2153
+ ),
2154
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2155
+ import_react_native8.Text,
2156
+ {
2157
+ numberOfLines: 1,
2158
+ style: {
2159
+ flexShrink: 1,
2160
+ color: isActive ? theme.colors.primary : theme.colors.text,
2161
+ fontSize: theme.fontSize.md,
2162
+ fontWeight: "500"
2163
+ },
2164
+ children: agent.name || "Untitled"
2165
+ }
2166
+ ),
2167
+ agent.orchestra && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2168
+ import_react_native8.View,
2169
+ {
2170
+ accessibilityLabel: orchestraDelegatesLine(agent.orchestra) ?? orchestraLabel(agent.orchestra),
2171
+ style: [
2172
+ styles5.badge,
2173
+ {
2174
+ backgroundColor: theme.colors.primarySoft,
2175
+ borderRadius: theme.radius.sm
2176
+ }
2177
+ ],
2178
+ children: [
2179
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2180
+ AgentIcon,
2181
+ {
2182
+ name: "music4",
2183
+ size: 10,
2184
+ color: theme.colors.primary,
2185
+ report: errorSink
2186
+ }
2187
+ ),
2188
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2189
+ import_react_native8.Text,
2190
+ {
2191
+ style: { color: theme.colors.primary, fontSize: theme.fontSize.xs },
2192
+ children: agent.orchestra.memberCount
2193
+ }
2194
+ )
2195
+ ]
2196
+ }
2197
+ ),
2198
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native8.View, { style: styles5.spacer }),
2199
+ agent.agentType === "builtin" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2200
+ import_react_native8.Text,
2201
+ {
2202
+ style: [
2203
+ styles5.originBadge,
2204
+ {
2205
+ color: theme.colors.primary,
2206
+ backgroundColor: theme.colors.primarySoft,
2207
+ borderRadius: theme.radius.sm,
2208
+ fontSize: theme.fontSize.xs
2209
+ }
2210
+ ],
2211
+ children: labels.systemBadge
2212
+ }
2213
+ ) : agent.isOwner === false ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2214
+ import_react_native8.Text,
2215
+ {
2216
+ style: [
2217
+ styles5.originBadge,
2218
+ {
2219
+ color: theme.colors.textMuted,
2220
+ backgroundColor: theme.colors.surface,
2221
+ borderRadius: theme.radius.sm,
2222
+ fontSize: theme.fontSize.xs
2223
+ }
2224
+ ],
2225
+ children: "shared"
2226
+ }
2227
+ ) : null
2228
+ ]
2229
+ }
2230
+ ),
2231
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2232
+ import_react_native8.Pressable,
2233
+ {
2234
+ onPress: onDetailPress,
2235
+ accessibilityRole: "button",
2236
+ accessibilityLabel: `Show details for ${agent.name || "Untitled"}`,
2237
+ hitSlop: 6,
2238
+ style: ({ pressed }) => [
2239
+ styles5.detailButton,
2240
+ {
2241
+ backgroundColor: pressed ? theme.colors.surfacePressed : "transparent"
2242
+ }
2243
+ ],
2244
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2245
+ AgentIcon,
2246
+ {
2247
+ name: "chevronRight",
2248
+ size: 16,
2249
+ color: theme.colors.textFaint,
2250
+ report: errorSink
2251
+ }
2252
+ )
2253
+ }
2254
+ )
2255
+ ]
2256
+ }
2257
+ );
2258
+ }
2259
+ var styles5 = import_react_native8.StyleSheet.create({
2260
+ row: { flexDirection: "row", alignItems: "stretch" },
2261
+ main: {
2262
+ flex: 1,
2263
+ flexDirection: "row",
2264
+ alignItems: "center",
2265
+ gap: 6,
2266
+ paddingVertical: 10,
2267
+ minWidth: 0
2268
+ },
2269
+ spacer: { flex: 1 },
2270
+ badge: {
2271
+ flexDirection: "row",
2272
+ alignItems: "center",
2273
+ gap: 2,
2274
+ paddingHorizontal: 4,
2275
+ paddingVertical: 1
2276
+ },
2277
+ originBadge: {
2278
+ overflow: "hidden",
2279
+ paddingHorizontal: 4,
2280
+ paddingVertical: 1,
2281
+ fontWeight: "500"
2282
+ },
2283
+ detailButton: {
2284
+ width: 40,
2285
+ alignItems: "center",
2286
+ justifyContent: "center"
2287
+ }
2288
+ });
2289
+
2290
+ // catalog/native/AgentListContent.tsx
2291
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2292
+ function AgentListContent({
2293
+ agents,
2294
+ isLoading,
2295
+ consumer,
2296
+ activeAgentId,
2297
+ allCategories,
2298
+ allTags,
2299
+ onSelectAgent,
2300
+ onDetailPress,
2301
+ onFilterChipPress,
2302
+ onReset,
2303
+ activeFilterCount,
2304
+ tabCounts,
2305
+ visibleTabs,
2306
+ systemTabLabel,
2307
+ pinnedAgent = null,
2308
+ defaultRow = null,
2309
+ autoFocusSearch = false
2310
+ }) {
2311
+ const catalog = useAgentCatalog();
2312
+ const theme = useAgentCatalogNativeTheme();
2313
+ const { labels, errorSink } = catalog;
2314
+ const emptyLabel = agentListEmptyLabel(consumer.tab, labels);
2315
+ const defaultAgent = defaultRow?.row ?? null;
2316
+ const items = [];
2317
+ if (defaultAgent) {
2318
+ items.push({ key: "label-default", kind: "label", text: "Default" });
2319
+ items.push({
2320
+ key: `default-${defaultAgent.id}`,
2321
+ kind: "row",
2322
+ agent: defaultAgent,
2323
+ forceActive: defaultAgent.id === activeAgentId
2324
+ });
2325
+ items.push({ key: "divider-default", kind: "divider" });
2326
+ }
2327
+ if (pinnedAgent) {
2328
+ items.push({
2329
+ key: "label-pinned",
2330
+ kind: "label",
2331
+ text: labels.currentAgentHeading
2332
+ });
2333
+ items.push({
2334
+ key: `pinned-${pinnedAgent.id}`,
2335
+ kind: "row",
2336
+ agent: pinnedAgent,
2337
+ forceActive: true
2338
+ });
2339
+ items.push({ key: "divider-pinned", kind: "divider" });
2340
+ }
2341
+ for (const agent of agents) {
2342
+ items.push({
2343
+ key: agent.id,
2344
+ kind: "row",
2345
+ agent,
2346
+ forceActive: agent.id === activeAgentId
2347
+ });
2348
+ }
2349
+ const hairline = {
2350
+ height: import_react_native9.StyleSheet.hairlineWidth,
2351
+ backgroundColor: theme.colors.border
2352
+ };
2353
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native9.View, { style: [styles6.container, { backgroundColor: theme.colors.background }], children: [
2354
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: { paddingHorizontal: theme.spacing.sm, paddingBottom: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2355
+ SearchInput,
2356
+ {
2357
+ value: consumer.searchTerm,
2358
+ onChange: consumer.setSearchTerm,
2359
+ placeholder: labels.searchPlaceholder,
2360
+ autoFocus: autoFocusSearch
2361
+ }
2362
+ ) }),
2363
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2364
+ AgentListTabs,
2365
+ {
2366
+ consumer,
2367
+ tabCounts,
2368
+ visibleTabs,
2369
+ systemTabLabel
2370
+ }
2371
+ ),
2372
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2373
+ AgentFilterBar,
2374
+ {
2375
+ consumer,
2376
+ allCategories,
2377
+ allTags,
2378
+ activeFilterCount,
2379
+ onFilterChipPress,
2380
+ onReset
2381
+ }
2382
+ ),
2383
+ defaultRow?.drift && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2384
+ import_react_native9.View,
2385
+ {
2386
+ accessibilityRole: "alert",
2387
+ style: [
2388
+ styles6.banner,
2389
+ {
2390
+ marginHorizontal: theme.spacing.sm,
2391
+ borderRadius: theme.radius.md,
2392
+ backgroundColor: theme.colors.driftBackground,
2393
+ borderColor: theme.colors.driftBorder
2394
+ }
2395
+ ],
2396
+ children: [
2397
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2398
+ AgentIcon,
2399
+ {
2400
+ name: "alertTriangle",
2401
+ size: 14,
2402
+ color: theme.colors.driftForeground,
2403
+ report: errorSink
2404
+ }
2405
+ ),
2406
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2407
+ import_react_native9.Text,
2408
+ {
2409
+ style: {
2410
+ flex: 1,
2411
+ color: theme.colors.driftForeground,
2412
+ fontSize: theme.fontSize.sm
2413
+ },
2414
+ children: defaultRow.drift
2415
+ }
2416
+ ),
2417
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2418
+ import_react_native9.Pressable,
2419
+ {
2420
+ onPress: () => catalog.dismissDefaultRowDrift(defaultRow.mandateKey),
2421
+ accessibilityRole: "button",
2422
+ accessibilityLabel: "Dismiss",
2423
+ hitSlop: 8,
2424
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2425
+ AgentIcon,
2426
+ {
2427
+ name: "x",
2428
+ size: 12,
2429
+ color: theme.colors.driftForeground,
2430
+ report: errorSink
2431
+ }
2432
+ )
2433
+ }
2434
+ )
2435
+ ]
2436
+ }
2437
+ ),
2438
+ defaultRow?.error && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2439
+ import_react_native9.View,
2440
+ {
2441
+ accessibilityRole: "alert",
2442
+ style: [
2443
+ styles6.banner,
2444
+ {
2445
+ marginHorizontal: theme.spacing.sm,
2446
+ borderRadius: theme.radius.md,
2447
+ backgroundColor: theme.colors.driftBackground,
2448
+ borderColor: theme.colors.driftBorder
2449
+ }
2450
+ ],
2451
+ children: [
2452
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2453
+ AgentIcon,
2454
+ {
2455
+ name: "alertTriangle",
2456
+ size: 14,
2457
+ color: theme.colors.driftForeground,
2458
+ report: errorSink
2459
+ }
2460
+ ),
2461
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2462
+ import_react_native9.Text,
2463
+ {
2464
+ style: {
2465
+ flex: 1,
2466
+ color: theme.colors.driftForeground,
2467
+ fontSize: theme.fontSize.sm
2468
+ },
2469
+ children: defaultRow.error
2470
+ }
2471
+ )
2472
+ ]
2473
+ }
2474
+ ),
2475
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: hairline }),
2476
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native9.View, { style: styles6.centered, children: [
2477
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2478
+ AgentIcon,
2479
+ {
2480
+ name: "loader",
2481
+ size: 16,
2482
+ color: theme.colors.textMuted,
2483
+ report: errorSink
2484
+ }
2485
+ ),
2486
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.Text, { style: { color: theme.colors.textMuted, fontSize: theme.fontSize.md }, children: labels.loading })
2487
+ ] }) : items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: styles6.centered, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.Text, { style: { color: theme.colors.textMuted, fontSize: theme.fontSize.md }, children: emptyLabel }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2488
+ import_react_native9.FlatList,
2489
+ {
2490
+ style: styles6.list,
2491
+ data: items,
2492
+ keyExtractor: (item) => item.key,
2493
+ keyboardShouldPersistTaps: "handled",
2494
+ renderItem: ({ item }) => {
2495
+ if (item.kind === "divider") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: hairline });
2496
+ if (item.kind === "label") {
2497
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2498
+ import_react_native9.Text,
2499
+ {
2500
+ style: {
2501
+ color: theme.colors.textMuted,
2502
+ fontSize: theme.fontSize.xs,
2503
+ fontWeight: "600",
2504
+ textTransform: "uppercase",
2505
+ paddingHorizontal: theme.spacing.md,
2506
+ paddingTop: 8,
2507
+ paddingBottom: 2
2508
+ },
2509
+ children: item.text
2510
+ }
2511
+ );
2512
+ }
2513
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2514
+ AgentRow,
2515
+ {
2516
+ agent: item.agent,
2517
+ isActive: item.forceActive,
2518
+ onPress: () => onSelectAgent(item.agent),
2519
+ onDetailPress: () => onDetailPress(item.agent)
2520
+ }
2521
+ );
2522
+ },
2523
+ ListFooterComponent: agents.length === 0 && (pinnedAgent || defaultAgent) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: styles6.centered, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2524
+ import_react_native9.Text,
2525
+ {
2526
+ style: {
2527
+ color: theme.colors.textMuted,
2528
+ fontSize: theme.fontSize.md
2529
+ },
2530
+ children: emptyLabel
2531
+ }
2532
+ ) }) : null
2533
+ }
2534
+ ),
2535
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.View, { style: hairline }),
2536
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native9.View, { style: [styles6.footer, { paddingHorizontal: theme.spacing.md }], children: [
2537
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2538
+ import_react_native9.Text,
2539
+ {
2540
+ style: {
2541
+ color: theme.colors.textMuted,
2542
+ fontSize: theme.fontSize.xs,
2543
+ fontVariant: ["tabular-nums"]
2544
+ },
2545
+ children: [
2546
+ agents.length,
2547
+ " agent",
2548
+ agents.length !== 1 ? "s" : ""
2549
+ ]
2550
+ }
2551
+ ),
2552
+ consumer.searchTerm.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2553
+ import_react_native9.Pressable,
2554
+ {
2555
+ onPress: () => consumer.setSearchTerm(""),
2556
+ accessibilityRole: "button",
2557
+ accessibilityLabel: "Clear search",
2558
+ hitSlop: 8,
2559
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2560
+ import_react_native9.Text,
2561
+ {
2562
+ style: { color: theme.colors.textMuted, fontSize: theme.fontSize.xs },
2563
+ children: "Clear search"
2564
+ }
2565
+ )
2566
+ }
2567
+ )
2568
+ ] })
2569
+ ] });
2570
+ }
2571
+ var styles6 = import_react_native9.StyleSheet.create({
2572
+ container: { flex: 1, minHeight: 0 },
2573
+ list: { flex: 1, minHeight: 0 },
2574
+ banner: {
2575
+ flexDirection: "row",
2576
+ alignItems: "flex-start",
2577
+ gap: 8,
2578
+ marginBottom: 6,
2579
+ paddingHorizontal: 8,
2580
+ paddingVertical: 6,
2581
+ borderWidth: import_react_native9.StyleSheet.hairlineWidth
2582
+ },
2583
+ centered: {
2584
+ alignItems: "center",
2585
+ justifyContent: "center",
2586
+ gap: 8,
2587
+ paddingVertical: 32
2588
+ },
2589
+ footer: {
2590
+ flexDirection: "row",
2591
+ alignItems: "center",
2592
+ justifyContent: "space-between",
2593
+ paddingVertical: 8
2594
+ }
2595
+ });
2596
+
2597
+ // catalog/native/AgentSubView.tsx
2598
+ var import_react_native10 = require("react-native");
2599
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2600
+ function AgentSubView({
2601
+ view,
2602
+ consumer,
2603
+ allCategories,
2604
+ allTags,
2605
+ search,
2606
+ setSearch,
2607
+ onBack
2608
+ }) {
2609
+ const theme = useAgentCatalogNativeTheme();
2610
+ const title = view === "sort" ? "Sort" : view === "categories" ? "Categories" : "Tags";
2611
+ const values = view === "categories" ? allCategories : allTags;
2612
+ const included = view === "categories" ? consumer.includedCats : consumer.includedTags;
2613
+ const filtered = values.filter(
2614
+ (value) => !search || value.toLowerCase().includes(search.toLowerCase())
2615
+ );
2616
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native10.View, { style: styles7.container, children: [
2617
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidePanelHeader, { title, onClose: onBack }),
2618
+ view === "sort" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native10.ScrollView, { style: styles7.list, children: SORT_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2619
+ OptionRow,
2620
+ {
2621
+ label: option.label,
2622
+ selected: consumer.sortBy === option.value,
2623
+ onPress: () => {
2624
+ consumer.setSortBy(option.value);
2625
+ onBack();
2626
+ }
2627
+ },
2628
+ option.value
2629
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2630
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native10.View, { style: { paddingHorizontal: theme.spacing.sm, paddingVertical: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2631
+ SearchInput,
2632
+ {
2633
+ value: search,
2634
+ onChange: setSearch,
2635
+ placeholder: view === "categories" ? "Filter categories..." : "Filter tags..."
2636
+ }
2637
+ ) }),
2638
+ included.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2639
+ import_react_native10.Pressable,
2640
+ {
2641
+ onPress: () => view === "categories" ? consumer.setIncludedCats([]) : consumer.setIncludedTags([]),
2642
+ accessibilityRole: "button",
2643
+ accessibilityLabel: `Clear ${included.length} filters`,
2644
+ style: {
2645
+ marginHorizontal: theme.spacing.sm,
2646
+ marginBottom: 4,
2647
+ paddingVertical: 6
2648
+ },
2649
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2650
+ import_react_native10.Text,
2651
+ {
2652
+ style: {
2653
+ color: theme.colors.primary,
2654
+ fontSize: theme.fontSize.sm,
2655
+ fontWeight: "600"
2656
+ },
2657
+ children: [
2658
+ "Clear (",
2659
+ included.length,
2660
+ ")"
2661
+ ]
2662
+ }
2663
+ )
2664
+ }
2665
+ ),
2666
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native10.ScrollView, { style: styles7.list, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2667
+ import_react_native10.Text,
2668
+ {
2669
+ style: {
2670
+ color: theme.colors.textMuted,
2671
+ fontSize: theme.fontSize.md,
2672
+ textAlign: "center",
2673
+ paddingVertical: 24
2674
+ },
2675
+ children: view === "categories" ? "No categories" : "No tags"
2676
+ }
2677
+ ) : filtered.map((value) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2678
+ CheckRow,
2679
+ {
2680
+ label: value,
2681
+ checked: included.includes(value),
2682
+ onPress: () => view === "categories" ? consumer.toggleCategory(value) : consumer.toggleTag(value)
2683
+ },
2684
+ value
2685
+ )) })
2686
+ ] })
2687
+ ] });
2688
+ }
2689
+ var styles7 = import_react_native10.StyleSheet.create({
2690
+ container: { flex: 1, minHeight: 0 },
2691
+ list: { flex: 1, minHeight: 0 }
2692
+ });
2693
+
2694
+ // catalog/native/AgentPickerBody.tsx
2695
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2696
+ function AgentPickerBody({
2697
+ consumerId,
2698
+ onSelect,
2699
+ activeAgentId = null,
2700
+ autoFocusSearch = false,
2701
+ initialTab,
2702
+ includeSystemInAll = false,
2703
+ visibleTabs,
2704
+ systemTabLabel,
2705
+ showPinnedAgent = true,
2706
+ excludeAgentIds,
2707
+ defaultMandateKey,
2708
+ compact = false,
2709
+ onAfterSelect
2710
+ }) {
2711
+ const [detailAgent, setDetailAgent] = (0, import_react6.useState)(null);
2712
+ const [subView, setSubView] = (0, import_react6.useState)(null);
2713
+ const [panelSearch, setPanelSearch] = (0, import_react6.useState)("");
2714
+ const {
2715
+ agents,
2716
+ isLoading,
2717
+ allCategories,
2718
+ allTags,
2719
+ consumer,
2720
+ tabCounts,
2721
+ activeFilterCount,
2722
+ pinnedAgent,
2723
+ defaultRow,
2724
+ ensureLoaded,
2725
+ handleSelectAgent: coreSelectAgent
2726
+ } = useAgentListCore({
2727
+ consumerId,
2728
+ onSelect,
2729
+ activeAgentIdOverride: activeAgentId,
2730
+ ...initialTab ? { initialTab } : {},
2731
+ includeSystemInAll,
2732
+ // The restriction has to reach the CORE, not just the tab strip.
2733
+ ...visibleTabs ? { visibleTabs } : {},
2734
+ ...excludeAgentIds ? { excludeAgentIds } : {},
2735
+ ...defaultMandateKey ? { defaultMandateKey } : {}
2736
+ });
2737
+ (0, import_react6.useEffect)(() => {
2738
+ ensureLoaded();
2739
+ }, [ensureLoaded]);
2740
+ const selectAgent = (agent) => {
2741
+ coreSelectAgent(agent);
2742
+ setDetailAgent(null);
2743
+ setSubView(null);
2744
+ onAfterSelect?.();
2745
+ };
2746
+ if (detailAgent) {
2747
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native11.View, { style: styles8.fill, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2748
+ AgentDetailCard,
2749
+ {
2750
+ agent: detailAgent,
2751
+ onSelect: () => selectAgent(detailAgent)
2752
+ }
2753
+ ) });
2754
+ }
2755
+ if (subView) {
2756
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native11.View, { style: styles8.fill, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2757
+ AgentSubView,
2758
+ {
2759
+ view: subView,
2760
+ consumer,
2761
+ allCategories,
2762
+ allTags,
2763
+ search: panelSearch,
2764
+ setSearch: setPanelSearch,
2765
+ onBack: () => {
2766
+ setSubView(null);
2767
+ setPanelSearch("");
2768
+ }
2769
+ }
2770
+ ) });
2771
+ }
2772
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native11.View, { style: [styles8.fill, compact ? styles8.compact : null], children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2773
+ AgentListContent,
2774
+ {
2775
+ agents,
2776
+ isLoading,
2777
+ consumer,
2778
+ activeAgentId,
2779
+ allCategories,
2780
+ allTags,
2781
+ onSelectAgent: selectAgent,
2782
+ onDetailPress: setDetailAgent,
2783
+ onFilterChipPress: setSubView,
2784
+ onReset: consumer.resetFilters,
2785
+ activeFilterCount,
2786
+ tabCounts,
2787
+ ...visibleTabs ? { visibleTabs } : {},
2788
+ ...systemTabLabel ?? (includeSystemInAll ? "System" : void 0) ? {
2789
+ systemTabLabel: systemTabLabel ?? (includeSystemInAll ? "System" : void 0)
2790
+ } : {},
2791
+ pinnedAgent: showPinnedAgent ? pinnedAgent : null,
2792
+ defaultRow,
2793
+ autoFocusSearch
2794
+ }
2795
+ ) });
2796
+ }
2797
+ var styles8 = import_react_native11.StyleSheet.create({
2798
+ fill: { flex: 1, minHeight: 0 },
2799
+ compact: { paddingTop: 0 }
2800
+ });
2801
+
2802
+ // catalog/native/AgentListSheet.tsx
2803
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2804
+ function AgentListSheet({ title, ...props }) {
2805
+ const theme = useAgentCatalogNativeTheme();
2806
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native12.View, { style: [styles9.sheet, { backgroundColor: theme.colors.background }], children: [
2807
+ title ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2808
+ import_react_native12.Text,
2809
+ {
2810
+ accessibilityRole: "header",
2811
+ style: {
2812
+ color: theme.colors.text,
2813
+ fontSize: theme.fontSize.lg + 3,
2814
+ fontWeight: "700",
2815
+ paddingHorizontal: theme.spacing.md,
2816
+ paddingTop: theme.spacing.sm,
2817
+ paddingBottom: theme.spacing.sm
2818
+ },
2819
+ children: title
2820
+ }
2821
+ ) : null,
2822
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AgentPickerBody, { ...props })
2823
+ ] });
2824
+ }
2825
+ var styles9 = import_react_native12.StyleSheet.create({
2826
+ sheet: { flex: 1, minHeight: 0 }
2827
+ });
2828
+
2829
+ // catalog/native/AgentListInlinePicker.tsx
2830
+ var import_react_native13 = require("react-native");
2831
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2832
+ function AgentListInlinePicker(props) {
2833
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: styles10.fill, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AgentPickerBody, { ...props }) });
2834
+ }
2835
+ var styles10 = import_react_native13.StyleSheet.create({
2836
+ fill: { flex: 1, minHeight: 0 }
2837
+ });
2838
+ //# sourceMappingURL=index.cjs.map