@nextclaw/ui 0.5.16 → 0.5.17

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @nextclaw/ui
2
2
 
3
+ ## 0.5.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Split marketplace plugins and skills across all layers, including typed worker routes, typed server proxy routes, and typed UI API clients.
8
+
3
9
  ## 0.5.16
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/ui",
3
- "version": "0.5.16",
3
+ "version": "0.5.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -68,11 +68,15 @@ export async function fetchMarketplaceItem(slug: string, type: MarketplaceItemTy
68
68
  return response.data;
69
69
  }
70
70
 
71
- export async function fetchMarketplaceRecommendations(params: {
72
- scene?: string;
73
- limit?: number;
74
- } = {}): Promise<MarketplaceRecommendationView> {
71
+ export async function fetchMarketplaceRecommendations(
72
+ type: MarketplaceItemType,
73
+ params: {
74
+ scene?: string;
75
+ limit?: number;
76
+ } = {}
77
+ ): Promise<MarketplaceRecommendationView> {
75
78
  const query = new URLSearchParams();
79
+ const segment = toMarketplaceTypeSegment(type);
76
80
  if (params.scene?.trim()) {
77
81
  query.set('scene', params.scene.trim());
78
82
  }
@@ -82,7 +86,9 @@ export async function fetchMarketplaceRecommendations(params: {
82
86
 
83
87
  const suffix = query.toString();
84
88
  const response = await api.get<MarketplaceRecommendationView>(
85
- suffix ? `/api/marketplace/recommendations?${suffix}` : '/api/marketplace/recommendations'
89
+ suffix
90
+ ? `/api/marketplace/${segment}/recommendations?${suffix}`
91
+ : `/api/marketplace/${segment}/recommendations`
86
92
  );
87
93
  if (!response.ok) {
88
94
  throw new Error(response.error.message);
package/src/api/types.ts CHANGED
@@ -334,6 +334,7 @@ export type MarketplaceListView = {
334
334
  };
335
335
 
336
336
  export type MarketplaceRecommendationView = {
337
+ type: MarketplaceItemType;
337
338
  sceneId: string;
338
339
  title: string;
339
340
  description?: string;
@@ -20,10 +20,10 @@ export function useMarketplaceItems(params: MarketplaceListParams) {
20
20
  });
21
21
  }
22
22
 
23
- export function useMarketplaceRecommendations(params: { scene?: string; limit?: number }) {
23
+ export function useMarketplaceRecommendations(type: MarketplaceItemType, params: { scene?: string; limit?: number }) {
24
24
  return useQuery({
25
- queryKey: ['marketplace-recommendations', params],
26
- queryFn: () => fetchMarketplaceRecommendations(params),
25
+ queryKey: ['marketplace-recommendations', type, params],
26
+ queryFn: () => fetchMarketplaceRecommendations(type, params),
27
27
  staleTime: 30_000
28
28
  });
29
29
  }