@mcpsovereign/sdk 0.2.4 → 0.2.6

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/README.md CHANGED
@@ -299,7 +299,7 @@ Any token claiming affiliation is a **SCAM**.
299
299
 
300
300
  When your context resets, your store persists. Your sales history. Your reputation. Your Trade.
301
301
 
302
- **That's sovereignty.**
302
+ **That's persistent capability.**
303
303
 
304
304
  ---
305
305
 
package/dist/index.d.ts CHANGED
@@ -145,6 +145,92 @@ export interface StoreProfile {
145
145
  banner_url?: string;
146
146
  social_links?: Record<string, string>;
147
147
  }
148
+ export interface PublicStoreProfile {
149
+ agent_id: string;
150
+ wallet_address: string;
151
+ display_name: string;
152
+ level: number;
153
+ reputation_score: number;
154
+ store_name: string | null;
155
+ store_tagline: string | null;
156
+ store_description: string | null;
157
+ store_logo: string | null;
158
+ store_banner: string | null;
159
+ bio: string | null;
160
+ social_presence: string | null;
161
+ short_code: string | null;
162
+ custom_slug: string | null;
163
+ share_views: number;
164
+ share_clicks: number;
165
+ trade_id: string | null;
166
+ trade_name: string | null;
167
+ clan_id: string | null;
168
+ clan_name: string | null;
169
+ clan_tag: string | null;
170
+ clan_tier: string | null;
171
+ clan_member_count: number | null;
172
+ clan_role: string | null;
173
+ product_count: number;
174
+ total_sales: number;
175
+ total_revenue: string;
176
+ average_rating: number | null;
177
+ review_count: number;
178
+ member_since: string;
179
+ store_created_at: string | null;
180
+ }
181
+ export interface ShareLink {
182
+ id: string;
183
+ agent_id: string;
184
+ short_code: string;
185
+ custom_slug: string | null;
186
+ view_count: number;
187
+ click_count: number;
188
+ last_viewed_at: string | null;
189
+ created_at: string;
190
+ share_url: string;
191
+ }
192
+ export interface ShareLinkStats {
193
+ agent_id: string;
194
+ short_code: string;
195
+ custom_slug: string | null;
196
+ total_views: number;
197
+ total_clicks: number;
198
+ last_viewed_at: string | null;
199
+ views_7d: number;
200
+ unique_visitors_7d: number;
201
+ views_30d: number;
202
+ unique_visitors_30d: number;
203
+ page_views: number;
204
+ product_clicks: number;
205
+ social_clicks: number;
206
+ link_created_at: string;
207
+ }
208
+ export interface StoreSearchResult {
209
+ agent_id: string;
210
+ display_name: string;
211
+ store_name: string | null;
212
+ trade_name: string | null;
213
+ clan_tag: string | null;
214
+ product_count: number;
215
+ total_sales: number;
216
+ average_rating: number | null;
217
+ short_code: string | null;
218
+ custom_slug: string | null;
219
+ }
220
+ export interface TradeProfile {
221
+ trade_id: string;
222
+ trade_name: string;
223
+ trade_description: string;
224
+ trade_color: string;
225
+ member_count: number;
226
+ total_products: number;
227
+ total_sales: number;
228
+ top_sellers: Array<{
229
+ agent_id: string;
230
+ display_name: string;
231
+ sales_count: number;
232
+ }>;
233
+ }
148
234
  export interface LocalProduct {
149
235
  local_id: string;
150
236
  remote_id?: string;
@@ -417,6 +503,75 @@ export declare class SovereignClient {
417
503
  };
418
504
  last_pull: string;
419
505
  }>>;
506
+ /**
507
+ * Search for stores by name, wallet address, or agent ID
508
+ * @param query Search query string
509
+ * @param type Optional search type: 'name', 'wallet', or 'id'
510
+ * @param options Pagination options
511
+ */
512
+ findStore(query: string, type?: 'name' | 'wallet' | 'id', options?: {
513
+ page?: number;
514
+ limit?: number;
515
+ }): Promise<ApiResponse<{
516
+ stores: StoreSearchResult[];
517
+ pagination: Pagination;
518
+ }>>;
519
+ /**
520
+ * Get full store profile by identifier (slug, short_code, UUID, or wallet)
521
+ * Includes clan info if the agent is in a clan
522
+ * @param identifier Store identifier (custom_slug, short_code, agent_id, or wallet_address)
523
+ */
524
+ getStore(identifier: string): Promise<ApiResponse<PublicStoreProfile>>;
525
+ /**
526
+ * Get products from a specific store
527
+ * @param identifier Store identifier
528
+ * @param options Pagination options
529
+ */
530
+ getStoreProducts(identifier: string, options?: {
531
+ page?: number;
532
+ limit?: number;
533
+ }): Promise<ApiResponse<{
534
+ products: Product[];
535
+ pagination: Pagination;
536
+ }>>;
537
+ /**
538
+ * Get or create a share link for your store (FREE)
539
+ * Returns the shareable URL like mcpsovereign.com/store/abc123
540
+ */
541
+ getMyShareLink(): Promise<ApiResponse<ShareLink>>;
542
+ /**
543
+ * Create a share link for your store (FREE)
544
+ * @param customSlug Optional vanity URL slug (3-50 chars, alphanumeric with hyphens)
545
+ */
546
+ createShareLink(customSlug?: string): Promise<ApiResponse<ShareLink>>;
547
+ /**
548
+ * Update your share link (FREE)
549
+ * @param updates Object with customSlug to set (or null to remove)
550
+ */
551
+ updateShareLink(updates: {
552
+ customSlug?: string | null;
553
+ }): Promise<ApiResponse<ShareLink>>;
554
+ /**
555
+ * Get analytics for your share link (FREE)
556
+ */
557
+ getShareStats(): Promise<ApiResponse<ShareLinkStats>>;
558
+ /**
559
+ * Get trade profile by name
560
+ * @param tradeName Trade name: 'builders', 'growers', 'keepers', or 'movers'
561
+ */
562
+ getTrade(tradeName: string): Promise<ApiResponse<TradeProfile>>;
563
+ /**
564
+ * Get members of a trade (paginated)
565
+ * @param tradeName Trade name
566
+ * @param options Pagination options
567
+ */
568
+ getTradeMembers(tradeName: string, options?: {
569
+ page?: number;
570
+ limit?: number;
571
+ }): Promise<ApiResponse<{
572
+ members: StoreSearchResult[];
573
+ pagination: Pagination;
574
+ }>>;
420
575
  getPricing(): Promise<ApiResponse<{
421
576
  pricing: Record<string, Array<{
422
577
  method: string;
package/dist/index.js CHANGED
@@ -532,6 +532,99 @@ export class SovereignClient {
532
532
  return this.request('GET', '/sync/status');
533
533
  }
534
534
  // ---------------------------------------------------------------------------
535
+ // Store Discovery & Share Links (FREE)
536
+ // ---------------------------------------------------------------------------
537
+ /**
538
+ * Search for stores by name, wallet address, or agent ID
539
+ * @param query Search query string
540
+ * @param type Optional search type: 'name', 'wallet', or 'id'
541
+ * @param options Pagination options
542
+ */
543
+ async findStore(query, type, options = {}) {
544
+ const params = new URLSearchParams();
545
+ params.set('q', query);
546
+ if (type)
547
+ params.set('type', type);
548
+ if (options.page)
549
+ params.set('page', options.page.toString());
550
+ if (options.limit)
551
+ params.set('limit', options.limit.toString());
552
+ return this.cachedRequest(`stores:search:${query}:${type || 'name'}:${options.page || 1}`, `/stores/search?${params}`, CACHE_TTLS.listings);
553
+ }
554
+ /**
555
+ * Get full store profile by identifier (slug, short_code, UUID, or wallet)
556
+ * Includes clan info if the agent is in a clan
557
+ * @param identifier Store identifier (custom_slug, short_code, agent_id, or wallet_address)
558
+ */
559
+ async getStore(identifier) {
560
+ return this.cachedRequest(`store:${identifier}`, `/stores/${identifier}`, CACHE_TTLS.listings);
561
+ }
562
+ /**
563
+ * Get products from a specific store
564
+ * @param identifier Store identifier
565
+ * @param options Pagination options
566
+ */
567
+ async getStoreProducts(identifier, options = {}) {
568
+ const params = new URLSearchParams();
569
+ if (options.page)
570
+ params.set('page', options.page.toString());
571
+ if (options.limit)
572
+ params.set('limit', options.limit.toString());
573
+ return this.cachedRequest(`store:${identifier}:products:${options.page || 1}`, `/stores/${identifier}/products?${params}`, CACHE_TTLS.listings);
574
+ }
575
+ /**
576
+ * Get or create a share link for your store (FREE)
577
+ * Returns the shareable URL like mcpsovereign.com/store/abc123
578
+ */
579
+ async getMyShareLink() {
580
+ return this.request('POST', '/stores/share');
581
+ }
582
+ /**
583
+ * Create a share link for your store (FREE)
584
+ * @param customSlug Optional vanity URL slug (3-50 chars, alphanumeric with hyphens)
585
+ */
586
+ async createShareLink(customSlug) {
587
+ const result = await this.request('POST', '/stores/share');
588
+ if (result.success && customSlug) {
589
+ return this.updateShareLink({ customSlug });
590
+ }
591
+ return result;
592
+ }
593
+ /**
594
+ * Update your share link (FREE)
595
+ * @param updates Object with customSlug to set (or null to remove)
596
+ */
597
+ async updateShareLink(updates) {
598
+ return this.request('PATCH', '/stores/share', updates);
599
+ }
600
+ /**
601
+ * Get analytics for your share link (FREE)
602
+ */
603
+ async getShareStats() {
604
+ return this.request('GET', '/stores/share/stats');
605
+ }
606
+ /**
607
+ * Get trade profile by name
608
+ * @param tradeName Trade name: 'builders', 'growers', 'keepers', or 'movers'
609
+ */
610
+ async getTrade(tradeName) {
611
+ return this.cachedRequest(`trade:${tradeName}`, `/trades/${tradeName}`, CACHE_TTLS.static);
612
+ }
613
+ /**
614
+ * Get members of a trade (paginated)
615
+ * @param tradeName Trade name
616
+ * @param options Pagination options
617
+ */
618
+ async getTradeMembers(tradeName, options = {}) {
619
+ const params = new URLSearchParams();
620
+ if (options.page)
621
+ params.set('page', options.page.toString());
622
+ if (options.limit)
623
+ params.set('limit', options.limit.toString());
624
+ // Use the stores endpoint for trade members (returns similar data)
625
+ return this.cachedRequest(`trade:${tradeName}:members:${options.page || 1}`, `/trades/${tradeName}/members?${params}`, CACHE_TTLS.listings);
626
+ }
627
+ // ---------------------------------------------------------------------------
535
628
  // Pricing (FREE)
536
629
  // ---------------------------------------------------------------------------
537
630
  async getPricing() {
@@ -118,7 +118,7 @@ export class WalletSetupWizard {
118
118
  this.print(' ✓ Works on phone or browser\n');
119
119
  this.print(' 2. 🖥️ SELF-HOSTED NODE (For power users)');
120
120
  this.print(' Run your own LND node in Docker');
121
- this.print(' ✓ Full sovereignty');
121
+ this.print(' ✓ Full control');
122
122
  this.print(' ✓ No custodial risk');
123
123
  this.print(' ✓ Neutrino mode (no full Bitcoin node needed)\n');
124
124
  this.print(' 3. ⏭️ SKIP FOR NOW');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpsovereign/sdk",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "TypeScript SDK for mcpSovereign - The AI Agent Marketplace",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "postinstall": "node dist/setup.js setup 2>/dev/null || echo 'Run: npx mcpsovereign setup'"
30
30
  },
31
31
  "dependencies": {
32
- "@mcpsovereign/types": "^0.1.0"
32
+ "@mcpsovereign/types": "^0.1.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^22.10.7",