@igstack/app-catalog-frontend-core 6.14.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/esm/api/infra/trpc.d.ts +36 -0
  2. package/dist/esm/index.d.ts +1 -1
  3. package/dist/esm/internal.d.ts +1 -0
  4. package/dist/esm/internal.js +2 -0
  5. package/dist/esm/internal.js.map +1 -1
  6. package/dist/esm/lib/externalLink.d.ts +8 -0
  7. package/dist/esm/lib/externalLink.js +9 -0
  8. package/dist/esm/lib/externalLink.js.map +1 -0
  9. package/dist/esm/modules/appCatalog/context/AppCatalogContext.d.ts +3 -1
  10. package/dist/esm/modules/appCatalog/context/AppCatalogContext.js +2 -0
  11. package/dist/esm/modules/appCatalog/context/AppCatalogContext.js.map +1 -1
  12. package/dist/esm/modules/appCatalog/hooks/useUpdateApp.d.ts +36 -36
  13. package/dist/esm/modules/appCatalog/ui/components/SectionTabs.d.ts +2 -1
  14. package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js +11 -1
  15. package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js.map +1 -1
  16. package/dist/esm/modules/appCatalog/ui/components/SourcesList.d.ts +10 -0
  17. package/dist/esm/modules/appCatalog/ui/components/SourcesList.js +51 -0
  18. package/dist/esm/modules/appCatalog/ui/components/SourcesList.js.map +1 -0
  19. package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js +9 -52
  20. package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js.map +1 -1
  21. package/dist/esm/modules/appCatalog/ui/pages/ServiceDesksPage.js +12 -7
  22. package/dist/esm/modules/appCatalog/ui/pages/ServiceDesksPage.js.map +1 -1
  23. package/dist/esm/modules/communityTools/useCommunityTools.d.ts +6 -6
  24. package/dist/esm/modules/mcpCatalog/McpAccessLine.d.ts +5 -0
  25. package/dist/esm/modules/mcpCatalog/McpAccessLine.js +48 -0
  26. package/dist/esm/modules/mcpCatalog/McpAccessLine.js.map +1 -0
  27. package/dist/esm/modules/mcpCatalog/McpCatalogPage.d.ts +11 -0
  28. package/dist/esm/modules/mcpCatalog/McpCatalogPage.js +289 -0
  29. package/dist/esm/modules/mcpCatalog/McpCatalogPage.js.map +1 -0
  30. package/dist/esm/modules/mcpCatalog/McpInfoTiles.d.ts +5 -0
  31. package/dist/esm/modules/mcpCatalog/McpInfoTiles.js +88 -0
  32. package/dist/esm/modules/mcpCatalog/McpInfoTiles.js.map +1 -0
  33. package/dist/esm/modules/mcpCatalog/McpSafetyLines.d.ts +5 -0
  34. package/dist/esm/modules/mcpCatalog/McpSafetyLines.js +82 -0
  35. package/dist/esm/modules/mcpCatalog/McpSafetyLines.js.map +1 -0
  36. package/dist/esm/modules/mcpCatalog/McpSearchResult.d.ts +18 -0
  37. package/dist/esm/modules/mcpCatalog/McpSearchResult.js +150 -0
  38. package/dist/esm/modules/mcpCatalog/McpSearchResult.js.map +1 -0
  39. package/dist/esm/modules/mcpCatalog/McpServerDetail.d.ts +8 -0
  40. package/dist/esm/modules/mcpCatalog/McpServerDetail.js +116 -0
  41. package/dist/esm/modules/mcpCatalog/McpServerDetail.js.map +1 -0
  42. package/dist/esm/modules/mcpCatalog/McpServerRow.d.ts +10 -0
  43. package/dist/esm/modules/mcpCatalog/McpServerRow.js +75 -0
  44. package/dist/esm/modules/mcpCatalog/McpServerRow.js.map +1 -0
  45. package/dist/esm/modules/mcpCatalog/McpToolsTable.d.ts +5 -0
  46. package/dist/esm/modules/mcpCatalog/McpToolsTable.js +24 -0
  47. package/dist/esm/modules/mcpCatalog/McpToolsTable.js.map +1 -0
  48. package/dist/esm/modules/mcpCatalog/Triad.d.ts +13 -0
  49. package/dist/esm/modules/mcpCatalog/Triad.js +175 -0
  50. package/dist/esm/modules/mcpCatalog/Triad.js.map +1 -0
  51. package/dist/esm/modules/mcpCatalog/cart/McpCart.d.ts +15 -0
  52. package/dist/esm/modules/mcpCatalog/cart/McpCart.js +156 -0
  53. package/dist/esm/modules/mcpCatalog/cart/McpCart.js.map +1 -0
  54. package/dist/esm/modules/mcpCatalog/cart/useMcpCart.d.ts +11 -0
  55. package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js +48 -0
  56. package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js.map +1 -0
  57. package/dist/esm/modules/mcpCatalog/install/InstallButton.d.ts +12 -0
  58. package/dist/esm/modules/mcpCatalog/install/InstallButton.js +126 -0
  59. package/dist/esm/modules/mcpCatalog/install/InstallButton.js.map +1 -0
  60. package/dist/esm/modules/mcpCatalog/install/InstallMenu.d.ts +14 -0
  61. package/dist/esm/modules/mcpCatalog/install/InstallMenu.js +139 -0
  62. package/dist/esm/modules/mcpCatalog/install/InstallMenu.js.map +1 -0
  63. package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.d.ts +10 -0
  64. package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js +161 -0
  65. package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js.map +1 -0
  66. package/dist/esm/modules/mcpCatalog/install/installOptions.d.ts +40 -0
  67. package/dist/esm/modules/mcpCatalog/install/installOptions.js +204 -0
  68. package/dist/esm/modules/mcpCatalog/install/installOptions.js.map +1 -0
  69. package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.d.ts +14 -0
  70. package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js +39 -0
  71. package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js.map +1 -0
  72. package/dist/esm/modules/mcpCatalog/searchMcpServers.d.ts +25 -0
  73. package/dist/esm/modules/mcpCatalog/searchMcpServers.js +44 -0
  74. package/dist/esm/modules/mcpCatalog/searchMcpServers.js.map +1 -0
  75. package/dist/esm/modules/mcpCatalog/signIn.d.ts +13 -0
  76. package/dist/esm/modules/mcpCatalog/signIn.js +29 -0
  77. package/dist/esm/modules/mcpCatalog/signIn.js.map +1 -0
  78. package/dist/esm/modules/mcpCatalog/useHasMcpServers.d.ts +8 -0
  79. package/dist/esm/modules/mcpCatalog/useHasMcpServers.js +13 -0
  80. package/dist/esm/modules/mcpCatalog/useHasMcpServers.js.map +1 -0
  81. package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.d.ts +7 -0
  82. package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js +16 -0
  83. package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js.map +1 -0
  84. package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js +3 -3
  85. package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +1 -1
  86. package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js +1 -1
  87. package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +2 -2
  88. package/dist/esm/routeTree.gen.d.ts +43 -17
  89. package/dist/esm/routeTree.gen.js +15 -3
  90. package/dist/esm/routeTree.gen.js.map +1 -1
  91. package/dist/esm/routes/_layout/community.$slug.d.ts +3 -3
  92. package/dist/esm/routes/_layout/community.d.ts +3 -3
  93. package/dist/esm/routes/_layout/mcp.$slug.d.ts +9 -0
  94. package/dist/esm/routes/_layout/mcp._slug.js +8 -0
  95. package/dist/esm/routes/_layout/mcp._slug.js.map +1 -0
  96. package/dist/esm/routes/_layout/mcp.d.ts +5 -1
  97. package/dist/esm/routes/_layout/mcp.js +45 -5
  98. package/dist/esm/routes/_layout/mcp.js.map +1 -1
  99. package/dist/esm/types/uiSettings.d.ts +10 -0
  100. package/dist/esm/ui/button.d.ts +1 -1
  101. package/dist/esm/ui/components/header/Header.js +1 -5
  102. package/dist/esm/ui/components/header/Header.js.map +1 -1
  103. package/dist/esm/ui/empty.d.ts +1 -1
  104. package/dist/esm/ui/item.d.ts +1 -1
  105. package/dist/esm/userDb/AcDb.d.ts +10 -0
  106. package/dist/esm/userDb/AcDb.js +6 -0
  107. package/dist/esm/userDb/AcDb.js.map +1 -1
  108. package/package.json +4 -4
  109. package/src/__tests__/modules/communityTools/timeAgo.test.ts +16 -0
  110. package/src/index.tsx +6 -1
  111. package/src/internal.ts +1 -0
  112. package/src/lib/externalLink.ts +10 -0
  113. package/src/modules/appCatalog/context/AppCatalogContext.tsx +5 -0
  114. package/src/modules/appCatalog/ui/components/SectionTabs.tsx +14 -1
  115. package/src/modules/appCatalog/ui/components/SourcesList.tsx +62 -0
  116. package/src/modules/appCatalog/ui/detail/AppDetails.tsx +6 -52
  117. package/src/modules/appCatalog/ui/pages/ServiceDesksPage.tsx +18 -3
  118. package/src/modules/mcpCatalog/McpAccessLine.tsx +54 -0
  119. package/src/modules/mcpCatalog/McpCatalogPage.tsx +324 -0
  120. package/src/modules/mcpCatalog/McpInfoTiles.tsx +112 -0
  121. package/src/modules/mcpCatalog/McpSafetyLines.tsx +89 -0
  122. package/src/modules/mcpCatalog/McpSearchResult.tsx +173 -0
  123. package/src/modules/mcpCatalog/McpServerDetail.tsx +145 -0
  124. package/src/modules/mcpCatalog/McpServerRow.tsx +78 -0
  125. package/src/modules/mcpCatalog/McpToolsTable.tsx +36 -0
  126. package/src/modules/mcpCatalog/Triad.tsx +213 -0
  127. package/src/modules/mcpCatalog/cart/McpCart.tsx +171 -0
  128. package/src/modules/mcpCatalog/cart/useMcpCart.ts +64 -0
  129. package/src/modules/mcpCatalog/install/InstallButton.tsx +154 -0
  130. package/src/modules/mcpCatalog/install/InstallMenu.tsx +160 -0
  131. package/src/modules/mcpCatalog/install/WhatHappensDialog.tsx +199 -0
  132. package/src/modules/mcpCatalog/install/installOptions.tsx +266 -0
  133. package/src/modules/mcpCatalog/install/useMcpPrefs.ts +55 -0
  134. package/src/modules/mcpCatalog/searchMcpServers.ts +84 -0
  135. package/src/modules/mcpCatalog/signIn.ts +34 -0
  136. package/src/modules/mcpCatalog/useHasMcpServers.ts +22 -0
  137. package/src/modules/mcpCatalog/useMcpCatalogConfig.ts +20 -0
  138. package/src/routeTree.gen.ts +36 -5
  139. package/src/routes/_layout/mcp.$slug.tsx +10 -0
  140. package/src/routes/_layout/mcp.tsx +63 -3
  141. package/src/types/uiSettings.ts +11 -0
  142. package/src/ui/components/header/Header.tsx +1 -7
  143. package/src/userDb/AcDb.ts +13 -0
  144. package/dist/esm/modules/appCatalog/ui/pages/McpPage.d.ts +0 -11
  145. package/dist/esm/modules/appCatalog/ui/pages/McpPage.js +0 -227
  146. package/dist/esm/modules/appCatalog/ui/pages/McpPage.js.map +0 -1
  147. package/dist/esm/modules/appCatalog/utils/fetchMcpTools.d.ts +0 -32
  148. package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js +0 -79
  149. package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js.map +0 -1
  150. package/src/modules/appCatalog/ui/pages/McpPage.tsx +0 -275
  151. package/src/modules/appCatalog/utils/fetchMcpTools.ts +0 -140
@@ -253,6 +253,18 @@ declare const TRPCProvider: import('react').FunctionComponent<{
253
253
  meta: object;
254
254
  }>;
255
255
  }>>;
256
+ mcpCatalog: import('@trpc/server').TRPCBuiltRouter<{
257
+ ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
258
+ meta: object;
259
+ errorShape: import('@trpc/server').TRPCDefaultErrorShape;
260
+ transformer: false;
261
+ }, import('@trpc/server').TRPCDecorateCreateRouterOptions<{
262
+ config: import('@trpc/server').TRPCQueryProcedure<{
263
+ input: void;
264
+ output: import('@igstack/app-catalog-backend-core').McpCatalogConfigResponse;
265
+ meta: object;
266
+ }>;
267
+ }>>;
256
268
  auth: import('@trpc/server').TRPCBuiltRouter<{
257
269
  ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
258
270
  meta: {};
@@ -539,6 +551,18 @@ declare const TRPCProvider: import('react').FunctionComponent<{
539
551
  meta: object;
540
552
  }>;
541
553
  }>>;
554
+ mcpCatalog: import('@trpc/server').TRPCBuiltRouter<{
555
+ ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
556
+ meta: object;
557
+ errorShape: import('@trpc/server').TRPCDefaultErrorShape;
558
+ transformer: false;
559
+ }, import('@trpc/server').TRPCDecorateCreateRouterOptions<{
560
+ config: import('@trpc/server').TRPCQueryProcedure<{
561
+ input: void;
562
+ output: import('@igstack/app-catalog-backend-core').McpCatalogConfigResponse;
563
+ meta: object;
564
+ }>;
565
+ }>>;
542
566
  auth: import('@trpc/server').TRPCBuiltRouter<{
543
567
  ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
544
568
  meta: {};
@@ -824,6 +848,18 @@ declare const TRPCProvider: import('react').FunctionComponent<{
824
848
  meta: object;
825
849
  }>;
826
850
  }>>;
851
+ mcpCatalog: import('@trpc/server').TRPCBuiltRouter<{
852
+ ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
853
+ meta: object;
854
+ errorShape: import('@trpc/server').TRPCDefaultErrorShape;
855
+ transformer: false;
856
+ }, import('@trpc/server').TRPCDecorateCreateRouterOptions<{
857
+ config: import('@trpc/server').TRPCQueryProcedure<{
858
+ input: void;
859
+ output: import('@igstack/app-catalog-backend-core').McpCatalogConfigResponse;
860
+ meta: object;
861
+ }>;
862
+ }>>;
827
863
  auth: import('@trpc/server').TRPCBuiltRouter<{
828
864
  ctx: import('@igstack/app-catalog-backend-core').AcTrpcContext;
829
865
  meta: {};
@@ -3,7 +3,7 @@ export type { AppPropsFactoryOptions } from './appPropsFactory.js';
3
3
  export type { AcRouterContext, AcRouterInitParams } from './types/types.js';
4
4
  export { App } from './App.js';
5
5
  export type { AppProps } from './App.js';
6
- export type { AreaIcon, AreasSettings, UiSettings } from './types/uiSettings.js';
6
+ export type { AreaIcon, AreasSettings, ServiceDesksSettings, UiSettings, } from './types/uiSettings.js';
7
7
  export { DAY_TO_DAY_AREA_KEY, DAY_TO_DAY_TAG, } from './modules/appCatalog/utils/areaGrouping.js';
8
8
  export { PwaAutoUpdateProvider, usePwaAutoUpdate } from './modules/pwa/index.js';
9
9
  export type { PwaAutoUpdateOptions, PwaUpdateHandle } from './modules/pwa/index.js';
@@ -19,3 +19,4 @@ export { AcDb, dbCacheDbKeys } from './userDb/AcDb.js';
19
19
  export type { CommunityToolsConfig } from './userDb/AcDb.js';
20
20
  export { SEARCH_STORAGE_KEY, clearSessionState, seedSessionState, } from './modules/appCatalog/hooks/useSessionSyncedState.js';
21
21
  export { preloadAppDetailPanel } from './modules/appCatalog/ui/pages/AppCatalogPage.js';
22
+ export { externalLink } from './lib/externalLink.js';
@@ -2,12 +2,14 @@ import { App } from "./App.js";
2
2
  import { AcDb, dbCacheDbKeys } from "./userDb/AcDb.js";
3
3
  import { SEARCH_STORAGE_KEY, clearSessionState, seedSessionState } from "./modules/appCatalog/hooks/useSessionSyncedState.js";
4
4
  import { preloadAppDetailPanel } from "./modules/appCatalog/ui/pages/AppCatalogPage.js";
5
+ import { externalLink } from "./lib/externalLink.js";
5
6
  export {
6
7
  AcDb,
7
8
  App,
8
9
  SEARCH_STORAGE_KEY,
9
10
  clearSessionState,
10
11
  dbCacheDbKeys,
12
+ externalLink,
11
13
  preloadAppDetailPanel,
12
14
  seedSessionState
13
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"internal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Leaves the page for a URL another app handles (`vscode://`, `cursor://`).
3
+ * An object rather than a bare function so a test can record the URL: jsdom
4
+ * cannot follow a custom scheme, and `window.location` cannot be stubbed.
5
+ */
6
+ export declare const externalLink: {
7
+ open(url: string): void;
8
+ };
@@ -0,0 +1,9 @@
1
+ const externalLink = {
2
+ open(url) {
3
+ window.location.href = url;
4
+ }
5
+ };
6
+ export {
7
+ externalLink
8
+ };
9
+ //# sourceMappingURL=externalLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"externalLink.js","sources":["../../../src/lib/externalLink.ts"],"sourcesContent":["/**\n * Leaves the page for a URL another app handles (`vscode://`, `cursor://`).\n * An object rather than a bare function so a test can record the URL: jsdom\n * cannot follow a custom scheme, and `window.location` cannot be stubbed.\n */\nexport const externalLink = {\n open(url: string): void {\n window.location.href = url\n },\n}\n"],"names":[],"mappings":"AAKO,MAAM,eAAe;AAAA,EAC1B,KAAK,KAAmB;AACtB,WAAO,SAAS,OAAO;AAAA,EACzB;AACF;"}
@@ -1,7 +1,9 @@
1
- import { AppApprovalMethod, AppVersionInfo, Group, GroupingTagDefinition, Person, Resource } from '@igstack/app-catalog-backend-core';
1
+ import { AppApprovalMethod, AppVersionInfo, CatalogMcpServer, Group, GroupingTagDefinition, Person, Resource } from '@igstack/app-catalog-backend-core';
2
2
  import { ReactNode } from 'react';
3
3
  export interface AppCatalogContextIface {
4
4
  resources: Resource[];
5
+ /** Optional for code that builds a context by hand; the provider always sets it. */
6
+ mcpServers?: CatalogMcpServer[];
5
7
  isLoadingApps: boolean;
6
8
  tagsDefinitions: GroupingTagDefinition[];
7
9
  approvalMethods: AppApprovalMethod[];
@@ -14,6 +14,7 @@ function AppCatalogProvider({ children }) {
14
14
  const contextValue = useMemo(
15
15
  () => ({
16
16
  resources: (data == null ? void 0 : data.resources) ?? [],
17
+ mcpServers: (data == null ? void 0 : data.mcpServers) ?? [],
17
18
  isLoadingApps,
18
19
  tagsDefinitions: (data == null ? void 0 : data.tagsDefinitions) ?? [],
19
20
  approvalMethods: (data == null ? void 0 : data.approvalMethods) ?? [],
@@ -27,6 +28,7 @@ function AppCatalogProvider({ children }) {
27
28
  [
28
29
  data == null ? void 0 : data.approvalMethods,
29
30
  data == null ? void 0 : data.resources,
31
+ data == null ? void 0 : data.mcpServers,
30
32
  data == null ? void 0 : data.tagsDefinitions,
31
33
  data == null ? void 0 : data.persons,
32
34
  data == null ? void 0 : data.groups,
@@ -1 +1 @@
1
- {"version":3,"file":"AppCatalogContext.js","sources":["../../../../../src/modules/appCatalog/context/AppCatalogContext.tsx"],"sourcesContent":["import type {\n AppApprovalMethod,\n AppVersionInfo,\n Group,\n GroupingTagDefinition,\n Person,\n Resource,\n} from '@igstack/app-catalog-backend-core'\nimport { useQuery } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { createContext, use, useEffect, useMemo } from 'react'\nimport { ApiQueryMagazineAppCatalog } from '~/modules/appCatalog'\nimport { useUiSettings } from '~/context/UiSettingsContext'\nimport { mergeFrontendBuildId } from '~/modules/appCatalog/context/mergeFrontendBuildId'\n\nexport interface AppCatalogContextIface {\n resources: Resource[]\n isLoadingApps: boolean\n tagsDefinitions: GroupingTagDefinition[]\n approvalMethods: AppApprovalMethod[]\n persons: Person[]\n groups: Group[]\n versions?: AppVersionInfo\n}\n\nexport const AppCatalogContext = createContext<\n AppCatalogContextIface | undefined\n>(undefined)\n\ninterface AppCatalogProviderProps {\n children: ReactNode\n}\n\nexport function AppCatalogProvider({ children }: AppCatalogProviderProps) {\n const { data, isLoading: isLoadingApps } = useQuery(\n ApiQueryMagazineAppCatalog.getAppCatalog(),\n )\n const uiSettings = useUiSettings()\n\n const contextValue = useMemo<AppCatalogContextIface>(\n () => ({\n resources: data?.resources ?? [],\n isLoadingApps,\n tagsDefinitions: data?.tagsDefinitions ?? [],\n approvalMethods: data?.approvalMethods ?? [],\n persons: data?.persons ?? [],\n groups: data?.groups ?? [],\n versions: mergeFrontendBuildId(\n data?.versions ?? {},\n uiSettings.frontendBuildId,\n ),\n }),\n [\n data?.approvalMethods,\n data?.resources,\n data?.tagsDefinitions,\n data?.persons,\n data?.groups,\n data?.versions,\n uiSettings.frontendBuildId,\n isLoadingApps,\n ],\n )\n\n // Update document title based on backend version\n useEffect(() => {\n if (data?.versions?.backend?.displayName === 'local') {\n document.title = 'Local'\n } else {\n document.title = 'App Catalog'\n }\n }, [data?.versions?.backend?.displayName])\n\n return <AppCatalogContext value={contextValue}>{children}</AppCatalogContext>\n}\n\nexport function useAppCatalogContext(): AppCatalogContextIface {\n const context = use(AppCatalogContext)\n if (!context) {\n throw new Error(\n 'useAppCatalogContext must be used within AppCatalogProvider',\n )\n }\n return context\n}\n\n/**\n * The catalog, for a deployment that owns its own routes.\n *\n * A deployment composing its own route tree has to resolve its own path params\n * against the catalog — `/app/$slug/…/$account` means nothing until `$account`\n * is matched to a resource. It needs the resources to do that, and the loading\n * flag to tell \"still fetching\" from \"no such resource\", which is the\n * difference between a spinner and a redirect.\n *\n * Deliberately narrower than `useAppCatalogContext`: persons, groups, tags and\n * approval methods are the core's own rendering concerns, and publishing them\n * would make every one of them part of the supported surface.\n */\nexport function useCatalogResources(): {\n resources: Resource[]\n isLoading: boolean\n} {\n const { resources, isLoadingApps } = useAppCatalogContext()\n return { resources, isLoading: isLoadingApps }\n}\n"],"names":["_b","_a"],"mappings":";;;;;;AAyBO,MAAM,oBAAoB,cAE/B,MAAS;AAMJ,SAAS,mBAAmB,EAAE,YAAqC;;AACxE,QAAM,EAAE,MAAM,WAAW,cAAA,IAAkB;AAAA,IACzC,2BAA2B,cAAA;AAAA,EAAc;AAE3C,QAAM,aAAa,cAAA;AAEnB,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL,YAAW,6BAAM,cAAa,CAAA;AAAA,MAC9B;AAAA,MACA,kBAAiB,6BAAM,oBAAmB,CAAA;AAAA,MAC1C,kBAAiB,6BAAM,oBAAmB,CAAA;AAAA,MAC1C,UAAS,6BAAM,YAAW,CAAA;AAAA,MAC1B,SAAQ,6BAAM,WAAU,CAAA;AAAA,MACxB,UAAU;AAAA,SACR,6BAAM,aAAY,CAAA;AAAA,QAClB,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF;AAAA,MACE,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IAAA;AAAA,EACF;AAIF,YAAU,MAAM;;AACd,UAAIA,OAAAC,MAAA,6BAAM,aAAN,gBAAAA,IAAgB,YAAhB,gBAAAD,IAAyB,iBAAgB,SAAS;AACpD,eAAS,QAAQ;AAAA,IACnB,OAAO;AACL,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,EAAC,wCAAM,aAAN,mBAAgB,YAAhB,mBAAyB,WAAW,CAAC;AAEzC,SAAO,oBAAC,mBAAA,EAAkB,OAAO,cAAe,SAAA,CAAS;AAC3D;AAEO,SAAS,uBAA+C;AAC7D,QAAM,UAAU,IAAI,iBAAiB;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO;AACT;AAeO,SAAS,sBAGd;AACA,QAAM,EAAE,WAAW,cAAA,IAAkB,qBAAA;AACrC,SAAO,EAAE,WAAW,WAAW,cAAA;AACjC;"}
1
+ {"version":3,"file":"AppCatalogContext.js","sources":["../../../../../src/modules/appCatalog/context/AppCatalogContext.tsx"],"sourcesContent":["import type {\n AppApprovalMethod,\n AppVersionInfo,\n CatalogMcpServer,\n Group,\n GroupingTagDefinition,\n Person,\n Resource,\n} from '@igstack/app-catalog-backend-core'\nimport { useQuery } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { createContext, use, useEffect, useMemo } from 'react'\nimport { ApiQueryMagazineAppCatalog } from '~/modules/appCatalog'\nimport { useUiSettings } from '~/context/UiSettingsContext'\nimport { mergeFrontendBuildId } from '~/modules/appCatalog/context/mergeFrontendBuildId'\n\nexport interface AppCatalogContextIface {\n resources: Resource[]\n /** Optional for code that builds a context by hand; the provider always sets it. */\n mcpServers?: CatalogMcpServer[]\n isLoadingApps: boolean\n tagsDefinitions: GroupingTagDefinition[]\n approvalMethods: AppApprovalMethod[]\n persons: Person[]\n groups: Group[]\n versions?: AppVersionInfo\n}\n\nexport const AppCatalogContext = createContext<\n AppCatalogContextIface | undefined\n>(undefined)\n\ninterface AppCatalogProviderProps {\n children: ReactNode\n}\n\nexport function AppCatalogProvider({ children }: AppCatalogProviderProps) {\n const { data, isLoading: isLoadingApps } = useQuery(\n ApiQueryMagazineAppCatalog.getAppCatalog(),\n )\n const uiSettings = useUiSettings()\n\n const contextValue = useMemo<AppCatalogContextIface>(\n () => ({\n resources: data?.resources ?? [],\n mcpServers: data?.mcpServers ?? [],\n isLoadingApps,\n tagsDefinitions: data?.tagsDefinitions ?? [],\n approvalMethods: data?.approvalMethods ?? [],\n persons: data?.persons ?? [],\n groups: data?.groups ?? [],\n versions: mergeFrontendBuildId(\n data?.versions ?? {},\n uiSettings.frontendBuildId,\n ),\n }),\n [\n data?.approvalMethods,\n data?.resources,\n data?.mcpServers,\n data?.tagsDefinitions,\n data?.persons,\n data?.groups,\n data?.versions,\n uiSettings.frontendBuildId,\n isLoadingApps,\n ],\n )\n\n // Update document title based on backend version\n useEffect(() => {\n if (data?.versions?.backend?.displayName === 'local') {\n document.title = 'Local'\n } else {\n document.title = 'App Catalog'\n }\n }, [data?.versions?.backend?.displayName])\n\n return <AppCatalogContext value={contextValue}>{children}</AppCatalogContext>\n}\n\nexport function useAppCatalogContext(): AppCatalogContextIface {\n const context = use(AppCatalogContext)\n if (!context) {\n throw new Error(\n 'useAppCatalogContext must be used within AppCatalogProvider',\n )\n }\n return context\n}\n\n/**\n * The catalog, for a deployment that owns its own routes.\n *\n * A deployment composing its own route tree has to resolve its own path params\n * against the catalog — `/app/$slug/…/$account` means nothing until `$account`\n * is matched to a resource. It needs the resources to do that, and the loading\n * flag to tell \"still fetching\" from \"no such resource\", which is the\n * difference between a spinner and a redirect.\n *\n * Deliberately narrower than `useAppCatalogContext`: persons, groups, tags and\n * approval methods are the core's own rendering concerns, and publishing them\n * would make every one of them part of the supported surface.\n */\nexport function useCatalogResources(): {\n resources: Resource[]\n isLoading: boolean\n} {\n const { resources, isLoadingApps } = useAppCatalogContext()\n return { resources, isLoading: isLoadingApps }\n}\n"],"names":["_b","_a"],"mappings":";;;;;;AA4BO,MAAM,oBAAoB,cAE/B,MAAS;AAMJ,SAAS,mBAAmB,EAAE,YAAqC;;AACxE,QAAM,EAAE,MAAM,WAAW,cAAA,IAAkB;AAAA,IACzC,2BAA2B,cAAA;AAAA,EAAc;AAE3C,QAAM,aAAa,cAAA;AAEnB,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,MACL,YAAW,6BAAM,cAAa,CAAA;AAAA,MAC9B,aAAY,6BAAM,eAAc,CAAA;AAAA,MAChC;AAAA,MACA,kBAAiB,6BAAM,oBAAmB,CAAA;AAAA,MAC1C,kBAAiB,6BAAM,oBAAmB,CAAA;AAAA,MAC1C,UAAS,6BAAM,YAAW,CAAA;AAAA,MAC1B,SAAQ,6BAAM,WAAU,CAAA;AAAA,MACxB,UAAU;AAAA,SACR,6BAAM,aAAY,CAAA;AAAA,QAClB,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF;AAAA,MACE,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,6BAAM;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IAAA;AAAA,EACF;AAIF,YAAU,MAAM;;AACd,UAAIA,OAAAC,MAAA,6BAAM,aAAN,gBAAAA,IAAgB,YAAhB,gBAAAD,IAAyB,iBAAgB,SAAS;AACpD,eAAS,QAAQ;AAAA,IACnB,OAAO;AACL,eAAS,QAAQ;AAAA,IACnB;AAAA,EACF,GAAG,EAAC,wCAAM,aAAN,mBAAgB,YAAhB,mBAAyB,WAAW,CAAC;AAEzC,SAAO,oBAAC,mBAAA,EAAkB,OAAO,cAAe,SAAA,CAAS;AAC3D;AAEO,SAAS,uBAA+C;AAC7D,QAAM,UAAU,IAAI,iBAAiB;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO;AACT;AAeO,SAAS,sBAGd;AACA,QAAM,EAAE,WAAW,cAAA,IAAkB,qBAAA;AACrC,SAAO,EAAE,WAAW,WAAW,cAAA;AACjC;"}
@@ -10,23 +10,53 @@ export interface UpdateAppVariables {
10
10
  };
11
11
  }
12
12
  export declare function useUpdateApp(): import('@tanstack/react-query').UseMutationResult<{
13
- slug: string;
14
13
  displayName: string;
14
+ slug: string;
15
15
  id: string;
16
+ abbreviation?: string | undefined;
17
+ nicknames?: string[] | undefined;
18
+ aliases?: string[] | undefined;
19
+ tags?: string[] | undefined;
20
+ teams?: string[] | undefined;
21
+ description?: string | undefined;
22
+ type?: string | undefined;
23
+ sources?: string[] | {
24
+ url: string;
25
+ sourceSlug?: string | undefined;
26
+ parseDate?: string | null | undefined;
27
+ schedule?: {
28
+ lastCheckedAt?: string | null | undefined;
29
+ nextCheckAfter?: string | null | undefined;
30
+ lastContentChangeAt?: string | null | undefined;
31
+ checkIntervalHours?: number | null | undefined;
32
+ changeHistory?: {
33
+ date: string;
34
+ changed: boolean;
35
+ }[] | null | undefined;
36
+ } | undefined;
37
+ pulse?: {
38
+ lastCheckedAt: string | null;
39
+ lastContentChangeAt: string | null;
40
+ checks: {
41
+ date: string;
42
+ changed: boolean;
43
+ }[];
44
+ state: import('@igstack/app-catalog-backend-core').SourcePulseState;
45
+ intervalHours: number | null;
46
+ cadence: import('@igstack/app-catalog-backend-core').SourceCadence | null;
47
+ dueAt: string | null;
48
+ contentChangeIsLowerBound: boolean;
49
+ } | undefined;
50
+ }[] | undefined;
16
51
  deprecated?: {
17
52
  comment: string;
18
53
  type?: "deprecated" | "discouraged" | undefined;
19
54
  replacementSlug?: string | undefined;
20
55
  } | undefined;
21
56
  createdAt?: string | undefined;
22
- type?: string | undefined;
23
57
  lastCheckedAt?: string | null | undefined;
24
58
  nextCheckAfter?: string | null | undefined;
25
59
  lastContentChangeAt?: string | null | undefined;
26
- abbreviation?: string | undefined;
27
- nicknames?: string[] | undefined;
28
- description?: string | undefined;
29
- teams?: string[] | undefined;
30
60
  accessRequest?: {
31
61
  approvalMethodSlug: string;
32
62
  comments?: string | undefined;
@@ -45,7 +75,6 @@ export declare function useUpdateApp(): import('@tanstack/react-query').UseMutat
45
75
  } | undefined;
46
76
  notes?: string | undefined;
47
77
  background?: string | undefined;
48
- tags?: string[] | undefined;
49
78
  appUrl?: string | undefined;
50
79
  links?: {
51
80
  url: string;
@@ -94,39 +123,10 @@ export declare function useUpdateApp(): import('@tanstack/react-query').UseMutat
94
123
  childrenLabel?: string | undefined;
95
124
  parentSlug?: string | undefined;
96
125
  tier?: string | undefined;
97
- aliases?: string[] | undefined;
98
126
  ownerPersonSlug?: string | undefined;
99
127
  approverSlugs?: string[] | undefined;
100
128
  accessComments?: string | undefined;
101
129
  extra?: Record<string, unknown> | undefined;
102
- sources?: string[] | {
103
- url: string;
104
- sourceSlug?: string | undefined;
105
- parseDate?: string | null | undefined;
106
- schedule?: {
107
- lastCheckedAt?: string | null | undefined;
108
- nextCheckAfter?: string | null | undefined;
109
- lastContentChangeAt?: string | null | undefined;
110
- checkIntervalHours?: number | null | undefined;
111
- changeHistory?: {
112
- date: string;
113
- changed: boolean;
114
- }[] | null | undefined;
115
- } | undefined;
116
- pulse?: {
117
- lastCheckedAt: string | null;
118
- lastContentChangeAt: string | null;
119
- checks: {
120
- date: string;
121
- changed: boolean;
122
- }[];
123
- state: import('@igstack/app-catalog-backend-core').SourcePulseState;
124
- intervalHours: number | null;
125
- cadence: import('@igstack/app-catalog-backend-core').SourceCadence | null;
126
- dueAt: string | null;
127
- contentChangeIsLowerBound: boolean;
128
- } | undefined;
129
- }[] | undefined;
130
130
  freshness?: {
131
131
  lastCheckedAt: string | null;
132
132
  lastContentChangeAt: string | null;
@@ -3,6 +3,7 @@
3
3
  * deep-linkable. The active tab is derived from the pathname rather than an
4
4
  * exact-match Link, because Catalog must stay active on the app-detail routes
5
5
  * (`/app/<slug>`, #23) and on `/catalog/apps`, which renders the same page.
6
- * Community tools is hidden until the server says the feature is on.
6
+ * Community tools is hidden until the server says the feature is on, and MCP
7
+ * servers until the catalog lists at least one.
7
8
  */
8
9
  export declare function SectionTabs(): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,11 @@ import { useRouterState, Link } from "@tanstack/react-router";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  import { useTRPC } from "../../../../api/infra/trpc.js";
5
5
  import { cn } from "../../../../lib/utils.js";
6
+ import { useAppCatalogContext } from "../../context/AppCatalogContext.js";
6
7
  function SectionTabs() {
7
8
  const pathname = useRouterState({ select: (s) => s.location.pathname });
8
9
  const trpc = useTRPC();
10
+ const { mcpServers = [] } = useAppCatalogContext();
9
11
  const { data: communityConfig } = useQuery(
10
12
  trpc.communityTools.config.queryOptions()
11
13
  );
@@ -29,7 +31,15 @@ function SectionTabs() {
29
31
  title: "Service Desks",
30
32
  caption: "Where to file a ticket",
31
33
  active: pathname.startsWith("/service-desks")
32
- }
34
+ },
35
+ ...mcpServers.length > 0 ? [
36
+ {
37
+ to: "/mcp",
38
+ title: "MCP servers",
39
+ caption: "Plug company systems into your AI",
40
+ active: pathname.startsWith("/mcp")
41
+ }
42
+ ] : []
33
43
  ];
34
44
  return /* @__PURE__ */ jsx(
35
45
  "div",
@@ -1 +1 @@
1
- {"version":3,"file":"SectionTabs.js","sources":["../../../../../../src/modules/appCatalog/ui/components/SectionTabs.tsx"],"sourcesContent":["import { Link, useRouterState } from '@tanstack/react-router'\nimport { useQuery } from '@tanstack/react-query'\nimport { useTRPC } from '~/api/infra/trpc'\nimport { cn } from '~/lib/utils'\n\n/**\n * The header's section tabs: one captioned link per section, so each is\n * deep-linkable. The active tab is derived from the pathname rather than an\n * exact-match Link, because Catalog must stay active on the app-detail routes\n * (`/app/<slug>`, #23) and on `/catalog/apps`, which renders the same page.\n * Community tools is hidden until the server says the feature is on.\n */\nexport function SectionTabs() {\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n const trpc = useTRPC()\n const { data: communityConfig } = useQuery(\n trpc.communityTools.config.queryOptions(),\n )\n\n const tabs = [\n {\n to: '/',\n title: 'Catalog',\n caption: 'Official company apps',\n active:\n pathname === '/' ||\n pathname.startsWith('/app/') ||\n pathname.startsWith('/catalog/'),\n },\n ...(communityConfig?.enabled\n ? [\n {\n to: '/community',\n title: 'Community tools',\n caption: 'Built by colleagues',\n active: pathname.startsWith('/community'),\n } as const,\n ]\n : []),\n {\n to: '/service-desks',\n title: 'Service Desks',\n caption: 'Where to file a ticket',\n active: pathname.startsWith('/service-desks'),\n },\n ] as const\n\n return (\n <div\n role=\"tablist\"\n aria-label=\"Sections\"\n data-testid=\"section-tabs\"\n className=\"flex items-stretch gap-2\"\n >\n {tabs.map((tab) => (\n <Link\n key={tab.to}\n to={tab.to}\n aria-current={tab.active ? 'page' : undefined}\n className={cn(\n 'flex flex-col items-start rounded-sm border-b-2 px-3.5 py-1.5 transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring',\n tab.active\n ? 'border-primary text-foreground'\n : 'border-transparent text-foreground/90 hover:text-primary',\n )}\n >\n <span className=\"text-base font-semibold\">{tab.title}</span>\n <span\n className={cn(\n 'text-xs',\n tab.active ? 'text-muted-foreground' : 'text-foreground/80',\n )}\n >\n {tab.caption}\n </span>\n </Link>\n ))}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;AAYO,SAAS,cAAc;AAC5B,QAAM,WAAW,eAAe,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU;AACtE,QAAM,OAAO,QAAA;AACb,QAAM,EAAE,MAAM,gBAAA,IAAoB;AAAA,IAChC,KAAK,eAAe,OAAO,aAAA;AAAA,EAAa;AAG1C,QAAM,OAAO;AAAA,IACX;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QACE,aAAa,OACb,SAAS,WAAW,OAAO,KAC3B,SAAS,WAAW,WAAW;AAAA,IAAA;AAAA,IAEnC,IAAI,mDAAiB,WACjB;AAAA,MACE;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ,SAAS,WAAW,YAAY;AAAA,MAAA;AAAA,IAC1C,IAEF,CAAA;AAAA,IACJ;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ,SAAS,WAAW,gBAAgB;AAAA,IAAA;AAAA,EAC9C;AAGF,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAU;AAAA,MAET,UAAA,KAAK,IAAI,CAAC,QACT;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,IAAI,IAAI;AAAA,UACR,gBAAc,IAAI,SAAS,SAAS;AAAA,UACpC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA,IAAI,SACA,mCACA;AAAA,UAAA;AAAA,UAGN,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAK,WAAU,2BAA2B,UAAA,IAAI,OAAM;AAAA,YACrD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,IAAI,SAAS,0BAA0B;AAAA,gBAAA;AAAA,gBAGxC,UAAA,IAAI;AAAA,cAAA;AAAA,YAAA;AAAA,UACP;AAAA,QAAA;AAAA,QAnBK,IAAI;AAAA,MAAA,CAqBZ;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"SectionTabs.js","sources":["../../../../../../src/modules/appCatalog/ui/components/SectionTabs.tsx"],"sourcesContent":["import { Link, useRouterState } from '@tanstack/react-router'\nimport { useQuery } from '@tanstack/react-query'\nimport { useTRPC } from '~/api/infra/trpc'\nimport { cn } from '~/lib/utils'\nimport { useAppCatalogContext } from '../../context/AppCatalogContext'\n\n/**\n * The header's section tabs: one captioned link per section, so each is\n * deep-linkable. The active tab is derived from the pathname rather than an\n * exact-match Link, because Catalog must stay active on the app-detail routes\n * (`/app/<slug>`, #23) and on `/catalog/apps`, which renders the same page.\n * Community tools is hidden until the server says the feature is on, and MCP\n * servers until the catalog lists at least one.\n */\nexport function SectionTabs() {\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n const trpc = useTRPC()\n const { mcpServers = [] } = useAppCatalogContext()\n const { data: communityConfig } = useQuery(\n trpc.communityTools.config.queryOptions(),\n )\n\n const tabs = [\n {\n to: '/',\n title: 'Catalog',\n caption: 'Official company apps',\n active:\n pathname === '/' ||\n pathname.startsWith('/app/') ||\n pathname.startsWith('/catalog/'),\n },\n ...(communityConfig?.enabled\n ? [\n {\n to: '/community',\n title: 'Community tools',\n caption: 'Built by colleagues',\n active: pathname.startsWith('/community'),\n } as const,\n ]\n : []),\n {\n to: '/service-desks',\n title: 'Service Desks',\n caption: 'Where to file a ticket',\n active: pathname.startsWith('/service-desks'),\n },\n ...(mcpServers.length > 0\n ? [\n {\n to: '/mcp',\n title: 'MCP servers',\n caption: 'Plug company systems into your AI',\n active: pathname.startsWith('/mcp'),\n } as const,\n ]\n : []),\n ] as const\n\n return (\n <div\n role=\"tablist\"\n aria-label=\"Sections\"\n data-testid=\"section-tabs\"\n className=\"flex items-stretch gap-2\"\n >\n {tabs.map((tab) => (\n <Link\n key={tab.to}\n to={tab.to}\n aria-current={tab.active ? 'page' : undefined}\n className={cn(\n 'flex flex-col items-start rounded-sm border-b-2 px-3.5 py-1.5 transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring',\n tab.active\n ? 'border-primary text-foreground'\n : 'border-transparent text-foreground/90 hover:text-primary',\n )}\n >\n <span className=\"text-base font-semibold\">{tab.title}</span>\n <span\n className={cn(\n 'text-xs',\n tab.active ? 'text-muted-foreground' : 'text-foreground/80',\n )}\n >\n {tab.caption}\n </span>\n </Link>\n ))}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;AAcO,SAAS,cAAc;AAC5B,QAAM,WAAW,eAAe,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU;AACtE,QAAM,OAAO,QAAA;AACb,QAAM,EAAE,aAAa,GAAC,IAAM,qBAAA;AAC5B,QAAM,EAAE,MAAM,gBAAA,IAAoB;AAAA,IAChC,KAAK,eAAe,OAAO,aAAA;AAAA,EAAa;AAG1C,QAAM,OAAO;AAAA,IACX;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QACE,aAAa,OACb,SAAS,WAAW,OAAO,KAC3B,SAAS,WAAW,WAAW;AAAA,IAAA;AAAA,IAEnC,IAAI,mDAAiB,WACjB;AAAA,MACE;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ,SAAS,WAAW,YAAY;AAAA,MAAA;AAAA,IAC1C,IAEF,CAAA;AAAA,IACJ;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ,SAAS,WAAW,gBAAgB;AAAA,IAAA;AAAA,IAE9C,GAAI,WAAW,SAAS,IACpB;AAAA,MACE;AAAA,QACE,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ,SAAS,WAAW,MAAM;AAAA,MAAA;AAAA,IACpC,IAEF,CAAA;AAAA,EAAC;AAGP,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAU;AAAA,MAET,UAAA,KAAK,IAAI,CAAC,QACT;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,IAAI,IAAI;AAAA,UACR,gBAAc,IAAI,SAAS,SAAS;AAAA,UACpC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA,IAAI,SACA,mCACA;AAAA,UAAA;AAAA,UAGN,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAK,WAAU,2BAA2B,UAAA,IAAI,OAAM;AAAA,YACrD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,IAAI,SAAS,0BAA0B;AAAA,gBAAA;AAAA,gBAGxC,UAAA,IAAI;AAAA,cAAA;AAAA,YAAA;AAAA,UACP;AAAA,QAAA;AAAA,QAnBK,IAAI;AAAA,MAAA,CAqBZ;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -0,0 +1,10 @@
1
+ import { SourceReference } from '@igstack/app-catalog-backend-core';
2
+ interface SourcesListProps {
3
+ sources: (string | SourceReference)[];
4
+ }
5
+ export declare function useSourceUrlsWithPulse(sources: (string | SourceReference)[]): {
6
+ urls: string[];
7
+ pulseByUrl: Map<string, import('@igstack/app-catalog-backend-core').SourcePulse>;
8
+ };
9
+ export declare function SourcesList({ sources }: SourcesListProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,51 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { ExternalLink } from "lucide-react";
3
+ import React__default from "react";
4
+ import { SourcePulse } from "./SourcePulse.js";
5
+ import { displayUrl } from "../../utils/displayUrl.js";
6
+ function useSourceUrlsWithPulse(sources) {
7
+ const urls = sources.map((s) => typeof s === "string" ? s : s.url);
8
+ const pulseByUrl = React__default.useMemo(() => {
9
+ const byUrl = /* @__PURE__ */ new Map();
10
+ for (const source of sources) {
11
+ if (typeof source !== "string" && source.pulse) {
12
+ byUrl.set(source.url, source.pulse);
13
+ }
14
+ }
15
+ return byUrl;
16
+ }, [sources]);
17
+ return { urls, pulseByUrl };
18
+ }
19
+ function SourcesList({ sources }) {
20
+ const { urls: sourceUrls, pulseByUrl } = useSourceUrlsWithPulse(sources);
21
+ return /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: sourceUrls.map((url, index) => (
22
+ // `group` so hovering anywhere on the row fades that source's
23
+ // track in — the mark sits in a right-hand column, and row
24
+ // hover is what ties the two ends of a wide row together.
25
+ /* @__PURE__ */ jsxs("li", { className: "group flex items-center gap-2 text-xs", children: [
26
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: [
27
+ index + 1,
28
+ "."
29
+ ] }),
30
+ url ? /* @__PURE__ */ jsxs(
31
+ "a",
32
+ {
33
+ href: url,
34
+ target: "_blank",
35
+ rel: "noopener noreferrer",
36
+ className: "hover:text-primary inline-flex min-w-0 items-center gap-1 truncate",
37
+ children: [
38
+ displayUrl(url),
39
+ /* @__PURE__ */ jsx(ExternalLink, { className: "size-3 shrink-0" })
40
+ ]
41
+ }
42
+ ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "—" }),
43
+ pulseByUrl.has(url) && /* @__PURE__ */ jsx(SourcePulse, { pulse: pulseByUrl.get(url), className: "ml-auto" })
44
+ ] }, index)
45
+ )) });
46
+ }
47
+ export {
48
+ SourcesList,
49
+ useSourceUrlsWithPulse
50
+ };
51
+ //# sourceMappingURL=SourcesList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SourcesList.js","sources":["../../../../../../src/modules/appCatalog/ui/components/SourcesList.tsx"],"sourcesContent":["import type { SourceReference } from '@igstack/app-catalog-backend-core'\nimport { ExternalLink } from 'lucide-react'\nimport React from 'react'\nimport { SourcePulse } from './SourcePulse'\nimport { displayUrl } from '~/modules/appCatalog/utils/displayUrl'\n\ninterface SourcesListProps {\n sources: (string | SourceReference)[]\n}\n\nexport function useSourceUrlsWithPulse(sources: (string | SourceReference)[]) {\n const urls: string[] = sources.map((s) => (typeof s === 'string' ? s : s.url))\n // The list renders bare URLs (they are editable as text), so the pulse has to\n // be looked up rather than carried alongside. Absent until the autoupdate loop\n // has seen the source — a freshly added one simply gets no mark.\n const pulseByUrl = React.useMemo(() => {\n const byUrl = new Map<string, NonNullable<SourceReference['pulse']>>()\n for (const source of sources) {\n if (typeof source !== 'string' && source.pulse) {\n byUrl.set(source.url, source.pulse)\n }\n }\n return byUrl\n }, [sources])\n\n return { urls, pulseByUrl }\n}\n\nexport function SourcesList({ sources }: SourcesListProps) {\n const { urls: sourceUrls, pulseByUrl } = useSourceUrlsWithPulse(sources)\n\n return (\n <ul className=\"space-y-2\">\n {sourceUrls.map((url, index) => (\n // `group` so hovering anywhere on the row fades that source's\n // track in — the mark sits in a right-hand column, and row\n // hover is what ties the two ends of a wide row together.\n <li key={index} className=\"group flex items-center gap-2 text-xs\">\n <span className=\"text-muted-foreground shrink-0 tabular-nums\">\n {index + 1}.\n </span>\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hover:text-primary inline-flex min-w-0 items-center gap-1 truncate\"\n >\n {displayUrl(url)}\n <ExternalLink className=\"size-3 shrink-0\" />\n </a>\n ) : (\n <span className=\"text-muted-foreground\">—</span>\n )}\n {pulseByUrl.has(url) && (\n <SourcePulse pulse={pulseByUrl.get(url)!} className=\"ml-auto\" />\n )}\n </li>\n ))}\n </ul>\n )\n}\n"],"names":["React"],"mappings":";;;;;AAUO,SAAS,uBAAuB,SAAuC;AAC5E,QAAM,OAAiB,QAAQ,IAAI,CAAC,MAAO,OAAO,MAAM,WAAW,IAAI,EAAE,GAAI;AAI7E,QAAM,aAAaA,eAAM,QAAQ,MAAM;AACrC,UAAM,4BAAY,IAAA;AAClB,eAAW,UAAU,SAAS;AAC5B,UAAI,OAAO,WAAW,YAAY,OAAO,OAAO;AAC9C,cAAM,IAAI,OAAO,KAAK,OAAO,KAAK;AAAA,MACpC;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO,EAAE,MAAM,WAAA;AACjB;AAEO,SAAS,YAAY,EAAE,WAA6B;AACzD,QAAM,EAAE,MAAM,YAAY,WAAA,IAAe,uBAAuB,OAAO;AAEvE,6BACG,MAAA,EAAG,WAAU,aACX,UAAA,WAAW,IAAI,CAAC,KAAK;AAAA;AAAA;AAAA;AAAA,IAIpB,qBAAC,MAAA,EAAe,WAAU,yCACxB,UAAA;AAAA,MAAA,qBAAC,QAAA,EAAK,WAAU,+CACb,UAAA;AAAA,QAAA,QAAQ;AAAA,QAAE;AAAA,MAAA,GACb;AAAA,MACC,MACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA,UAET,UAAA;AAAA,YAAA,WAAW,GAAG;AAAA,YACf,oBAAC,cAAA,EAAa,WAAU,kBAAA,CAAkB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,IAG5C,oBAAC,QAAA,EAAK,WAAU,yBAAwB,UAAA,KAAC;AAAA,MAE1C,WAAW,IAAI,GAAG,KACjB,oBAAC,aAAA,EAAY,OAAO,WAAW,IAAI,GAAG,GAAI,WAAU,UAAA,CAAU;AAAA,IAAA,EAAA,GAlBzD,KAoBT;AAAA,GACD,GACH;AAEJ;"}
@@ -16,6 +16,7 @@ import { InlineEditableField } from "../components/InlineEditableField.js";
16
16
  import { MarkdownText } from "../components/MarkdownText.js";
17
17
  import { ScreenshotGallery } from "../components/ScreenshotGallery.js";
18
18
  import { SourcePulse } from "../components/SourcePulse.js";
19
+ import { useSourceUrlsWithPulse, SourcesList } from "../components/SourcesList.js";
19
20
  import { useUpdateApp } from "../../hooks/useUpdateApp.js";
20
21
  import { useAppCatalogContext } from "../../context/AppCatalogContext.js";
21
22
  import { useAppClickHistory } from "../../hooks/useAppClickHistory.js";
@@ -89,7 +90,7 @@ function AppDetails({
89
90
  app,
90
91
  onAppClick
91
92
  }) {
92
- var _a, _b, _c, _d, _e, _f, _g;
93
+ var _a, _b, _c, _d, _e, _f;
93
94
  const [isGalleryOpen, setIsGalleryOpen] = React__default.useState(false);
94
95
  const [galleryInitialIndex, setGalleryInitialIndex] = React__default.useState(0);
95
96
  const { approvalMethods, resources: allResources } = useAppCatalogContext();
@@ -126,17 +127,10 @@ function AppDetails({
126
127
  const search = useSearch({ strict: false });
127
128
  const subSlug = search.sub;
128
129
  const displayTags = (app.tags ?? []).filter((tag) => !tag.includes(":"));
129
- const sourceUrls = ((_d = app.sources) == null ? void 0 : _d.map((s) => typeof s === "string" ? s : s.url)) ?? [];
130
+ const { urls: sourceUrls, pulseByUrl } = useSourceUrlsWithPulse(
131
+ app.sources ?? []
132
+ );
130
133
  const displaySources = draftSource !== null ? [...sourceUrls, draftSource] : sourceUrls;
131
- const pulseByUrl = React__default.useMemo(() => {
132
- const byUrl = /* @__PURE__ */ new Map();
133
- for (const source of app.sources ?? []) {
134
- if (typeof source !== "string" && source.pulse) {
135
- byUrl.set(source.url, source.pulse);
136
- }
137
- }
138
- return byUrl;
139
- }, [app.sources]);
140
134
  const children = React__default.useMemo(
141
135
  () => getChildResources(allResources, app.slug),
142
136
  [allResources, app.slug]
@@ -173,14 +167,14 @@ function AppDetails({
173
167
  setGalleryInitialIndex(index);
174
168
  setIsGalleryOpen(true);
175
169
  };
176
- const replacementApp = ((_e = app.deprecated) == null ? void 0 : _e.replacementSlug) ? allResources.find((a) => {
170
+ const replacementApp = ((_d = app.deprecated) == null ? void 0 : _d.replacementSlug) ? allResources.find((a) => {
177
171
  var _a2;
178
172
  return a.slug === ((_a2 = app.deprecated) == null ? void 0 : _a2.replacementSlug);
179
173
  }) : null;
180
174
  const access = accessTabLabel(app, approvalMethods);
181
- const hasResourcesTab = children.length > 0 || (((_f = app.tiers) == null ? void 0 : _f.length) ?? 0) > 0;
175
+ const hasResourcesTab = children.length > 0 || (((_e = app.tiers) == null ? void 0 : _e.length) ?? 0) > 0;
182
176
  const resourcesLabel = children.length ? app.childrenLabel ?? "Resources" : "Environments";
183
- const hasDocumentationTab = (((_g = app.links) == null ? void 0 : _g.length) ?? 0) > 0 || !!app.background;
177
+ const hasDocumentationTab = (((_f = app.links) == null ? void 0 : _f.length) ?? 0) > 0 || !!app.background;
184
178
  const tabs = [
185
179
  {
186
180
  id: TAB.overview,
@@ -393,44 +387,7 @@ function AppDetails({
393
387
  ]
394
388
  }
395
389
  )
396
- ] }) : /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: sourceUrls.map((url, index) => (
397
- // `group` so hovering anywhere on the row fades that source's
398
- // track in — the mark sits in a right-hand column, and row
399
- // hover is what ties the two ends of a wide row together.
400
- /* @__PURE__ */ jsxs(
401
- "li",
402
- {
403
- className: "group flex items-center gap-2 text-xs",
404
- children: [
405
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: [
406
- index + 1,
407
- "."
408
- ] }),
409
- url ? /* @__PURE__ */ jsxs(
410
- "a",
411
- {
412
- href: url,
413
- target: "_blank",
414
- rel: "noopener noreferrer",
415
- className: "hover:text-primary inline-flex min-w-0 items-center gap-1 truncate",
416
- children: [
417
- displayUrl(url),
418
- /* @__PURE__ */ jsx(ExternalLink, { className: "size-3 shrink-0" })
419
- ]
420
- }
421
- ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "—" }),
422
- pulseByUrl.has(url) && /* @__PURE__ */ jsx(
423
- SourcePulse,
424
- {
425
- pulse: pulseByUrl.get(url),
426
- className: "ml-auto"
427
- }
428
- )
429
- ]
430
- },
431
- index
432
- )
433
- )) }),
390
+ ] }) : /* @__PURE__ */ jsx(SourcesList, { sources: app.sources ?? [] }),
434
391
  datesLine && /* @__PURE__ */ jsx("p", { className: "behind-dates", title: datesTitle, children: datesLine })
435
392
  ] }),
436
393
  (app.aiPrompt || app.aiMemory) && /* @__PURE__ */ jsxs(Group, { title: "How the AI maintains this card", children: [