@idealyst/mcp-server 1.2.128 → 1.2.129

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/dist/index.cjs CHANGED
@@ -7524,6 +7524,50 @@ function App() {
7524
7524
  "NetworkState { isConnected, isInternetReachable, type, effectiveType, cellularGeneration, downlink, rtt, isDataSaving }"
7525
7525
  ],
7526
7526
  relatedPackages: ["storage", "config"]
7527
+ },
7528
+ pdf: {
7529
+ name: "PDF",
7530
+ npmName: "@idealyst/pdf",
7531
+ description: "Cross-platform PDF viewer for React and React Native. Renders PDFs from URL, local file, or base64 with page navigation, zoom, and scroll.",
7532
+ category: "media",
7533
+ platforms: ["web", "native"],
7534
+ documentationStatus: "full",
7535
+ installation: "yarn add @idealyst/pdf",
7536
+ peerDependencies: [
7537
+ "pdfjs-dist (web)",
7538
+ "react-native-pdf (native)",
7539
+ "react-native-blob-util (native)"
7540
+ ],
7541
+ features: [
7542
+ "Render PDFs from URL, file path, or base64",
7543
+ "Page navigation (controlled or free scroll)",
7544
+ "Pinch-to-zoom with configurable limits",
7545
+ "Horizontal and vertical scroll modes",
7546
+ "Page indicator overlay",
7547
+ "Fit-to-width, fit-to-height, fit-both modes",
7548
+ "PDFViewerRef for imperative control (goToPage, setZoom)"
7549
+ ],
7550
+ quickStart: `import { PDFViewer } from '@idealyst/pdf';
7551
+
7552
+ function DocumentScreen() {
7553
+ return (
7554
+ <PDFViewer
7555
+ source="https://example.com/document.pdf"
7556
+ onLoad={({ totalPages }) => console.log('Pages:', totalPages)}
7557
+ onPageChange={(page, total) => console.log(page, '/', total)}
7558
+ style={{ flex: 1 }}
7559
+ />
7560
+ );
7561
+ }`,
7562
+ apiHighlights: [
7563
+ "PDFViewer component",
7564
+ "PDFViewerRef \u2014 goToPage(page), setZoom(level)",
7565
+ "PDFSource = string | { uri: string } | { base64: string }",
7566
+ "fitPolicy: 'width' | 'height' | 'both'",
7567
+ "direction: 'horizontal' | 'vertical'",
7568
+ "onLoad, onPageChange, onError callbacks"
7569
+ ],
7570
+ relatedPackages: ["components"]
7527
7571
  }
7528
7572
  };
7529
7573
  function getPackagesByCategory() {
@@ -10880,6 +10924,21 @@ var getNotificationsGuideDefinition = {
10880
10924
  required: ["topic"]
10881
10925
  }
10882
10926
  };
10927
+ var getPdfGuideDefinition = {
10928
+ name: "get_pdf_guide",
10929
+ description: "Get documentation for @idealyst/pdf cross-platform PDF viewer package. Covers PDFViewer component, PDFViewerRef imperative methods, and examples.",
10930
+ inputSchema: {
10931
+ type: "object",
10932
+ properties: {
10933
+ topic: {
10934
+ type: "string",
10935
+ description: "Topic to get docs for: 'overview', 'api', 'examples'",
10936
+ enum: ["overview", "api", "examples"]
10937
+ }
10938
+ },
10939
+ required: ["topic"]
10940
+ }
10941
+ };
10883
10942
  var listPackagesDefinition = {
10884
10943
  name: "list_packages",
10885
10944
  description: "List all available Idealyst packages with descriptions, categories, and documentation status. Use this to discover what packages are available in the framework.",
@@ -11070,6 +11129,7 @@ var toolDefinitions = [
11070
11129
  getNotificationsGuideDefinition,
11071
11130
  getLiveActivityGuideDefinition,
11072
11131
  getNetworkGuideDefinition,
11132
+ getPdfGuideDefinition,
11073
11133
  // Package tools
11074
11134
  listPackagesDefinition,
11075
11135
  getPackageDocsDefinition,
@@ -19335,6 +19395,305 @@ async function quickHealthCheck() {
19335
19395
  `
19336
19396
  };
19337
19397
 
19398
+ // src/data/pdf-guides.ts
19399
+ var pdfGuides = {
19400
+ "idealyst://pdf/overview": `# @idealyst/pdf
19401
+
19402
+ Cross-platform PDF viewer for React and React Native.
19403
+
19404
+ ## Installation
19405
+
19406
+ \`\`\`bash
19407
+ yarn add @idealyst/pdf
19408
+ \`\`\`
19409
+
19410
+ ### Platform peer dependencies
19411
+
19412
+ | Platform | Peer Dependency | Install |
19413
+ |----------|----------------|---------|
19414
+ | Web | \`pdfjs-dist\` | \`yarn add pdfjs-dist\` |
19415
+ | Native | \`react-native-pdf\` | \`yarn add react-native-pdf react-native-blob-util\` |
19416
+
19417
+ **Web**: Uses Mozilla PDF.js to render PDF pages to canvas.
19418
+ **Native**: Uses react-native-pdf (PDFKit on iOS, PdfRenderer on Android).
19419
+
19420
+ ## Key Exports
19421
+
19422
+ | Export | Type | Description |
19423
+ |--------|------|-------------|
19424
+ | \`PDFViewer\` | Component | PDF viewer with zoom, page nav, scroll |
19425
+ | \`PDFViewerRef\` | Ref type | Imperative: \`goToPage()\`, \`setZoom()\` |
19426
+ | \`PDFSource\` | Type | \`string \\| { uri: string } \\| { base64: string }\` |
19427
+ | \`PDFDocumentInfo\` | Type | \`{ totalPages: number }\` |
19428
+ | \`FitPolicy\` | Type | \`'width' \\| 'height' \\| 'both'\` |
19429
+ | \`PDFDirection\` | Type | \`'horizontal' \\| 'vertical'\` |
19430
+
19431
+ ## Quick Start
19432
+
19433
+ \`\`\`tsx
19434
+ import { PDFViewer } from '@idealyst/pdf';
19435
+
19436
+ function DocumentScreen() {
19437
+ return (
19438
+ <PDFViewer
19439
+ source="https://example.com/document.pdf"
19440
+ onLoad={({ totalPages }) => console.log('Pages:', totalPages)}
19441
+ onPageChange={(page, total) => console.log(page, '/', total)}
19442
+ style={{ flex: 1 }}
19443
+ />
19444
+ );
19445
+ }
19446
+ \`\`\`
19447
+
19448
+ ## Common Mistakes
19449
+
19450
+ 1. **Forgetting peer deps** \u2014 Web needs \`pdfjs-dist\`, native needs \`react-native-pdf\` + \`react-native-blob-util\`
19451
+ 2. **PDF.js worker not configured** \u2014 On web, the worker URL is auto-configured from CDN. If using a custom bundler setup, set \`pdfjs.GlobalWorkerOptions.workerSrc\` before rendering.
19452
+ 3. **page is 1-indexed** \u2014 First page is \`1\`, not \`0\`
19453
+ 4. **fitPolicy is a string** \u2014 Use \`'width'\`, \`'height'\`, or \`'both'\` (NOT numeric values)
19454
+ 5. **base64 source** \u2014 Use \`{ base64: 'JVBERi...' }\` without the data URI prefix
19455
+ `,
19456
+ "idealyst://pdf/api": `# @idealyst/pdf \u2014 API Reference
19457
+
19458
+ ## PDFViewerProps
19459
+
19460
+ \`\`\`typescript
19461
+ interface PDFViewerProps {
19462
+ /** PDF source \u2014 URL string, { uri } object, or { base64 } data */
19463
+ source: PDFSource;
19464
+
19465
+ /** Current page (1-indexed). Default: 1 */
19466
+ page?: number;
19467
+
19468
+ /** Called when page changes */
19469
+ onPageChange?: (page: number, totalPages: number) => void;
19470
+
19471
+ /** Called when document loads */
19472
+ onLoad?: (info: PDFDocumentInfo) => void;
19473
+
19474
+ /** Called on error */
19475
+ onError?: (error: Error) => void;
19476
+
19477
+ /** Enable zoom. Default: true */
19478
+ zoomEnabled?: boolean;
19479
+
19480
+ /** Min zoom. Default: 1 */
19481
+ minZoom?: number;
19482
+
19483
+ /** Max zoom. Default: 5 */
19484
+ maxZoom?: number;
19485
+
19486
+ /** Scroll direction. Default: 'vertical' */
19487
+ direction?: PDFDirection;
19488
+
19489
+ /** Show page indicator. Default: true */
19490
+ showPageIndicator?: boolean;
19491
+
19492
+ /** Fit policy. Default: 'width' */
19493
+ fitPolicy?: FitPolicy;
19494
+
19495
+ /** Container style */
19496
+ style?: ViewStyle;
19497
+
19498
+ /** Test ID */
19499
+ testID?: string;
19500
+ }
19501
+ \`\`\`
19502
+
19503
+ ## Types
19504
+
19505
+ \`\`\`typescript
19506
+ type PDFSource = string | { uri: string } | { base64: string };
19507
+
19508
+ type FitPolicy = 'width' | 'height' | 'both';
19509
+
19510
+ type PDFDirection = 'horizontal' | 'vertical';
19511
+
19512
+ interface PDFDocumentInfo {
19513
+ totalPages: number;
19514
+ }
19515
+ \`\`\`
19516
+
19517
+ ## PDFViewerRef (Imperative)
19518
+
19519
+ \`\`\`typescript
19520
+ interface PDFViewerRef {
19521
+ /** Navigate to page (1-indexed) */
19522
+ goToPage: (page: number) => void;
19523
+
19524
+ /** Set zoom level */
19525
+ setZoom: (level: number) => void;
19526
+ }
19527
+ \`\`\`
19528
+
19529
+ Usage:
19530
+ \`\`\`tsx
19531
+ const pdfRef = useRef<PDFViewerRef>(null);
19532
+
19533
+ <PDFViewer ref={pdfRef} source="..." />
19534
+
19535
+ pdfRef.current?.goToPage(5);
19536
+ pdfRef.current?.setZoom(2);
19537
+ \`\`\`
19538
+ `,
19539
+ "idealyst://pdf/examples": `# @idealyst/pdf \u2014 Examples
19540
+
19541
+ ## Basic URL Viewer
19542
+
19543
+ \`\`\`tsx
19544
+ import { PDFViewer } from '@idealyst/pdf';
19545
+ import { View } from '@idealyst/components';
19546
+
19547
+ function BasicPDFScreen() {
19548
+ return (
19549
+ <View style={{ flex: 1 }}>
19550
+ <PDFViewer
19551
+ source="https://example.com/document.pdf"
19552
+ style={{ flex: 1 }}
19553
+ />
19554
+ </View>
19555
+ );
19556
+ }
19557
+ \`\`\`
19558
+
19559
+ ## With Page Navigation Controls
19560
+
19561
+ \`\`\`tsx
19562
+ import { useRef, useState } from 'react';
19563
+ import { PDFViewer, PDFViewerRef } from '@idealyst/pdf';
19564
+ import { View, Text, Button } from '@idealyst/components';
19565
+
19566
+ function PDFWithControls() {
19567
+ const pdfRef = useRef<PDFViewerRef>(null);
19568
+ const [currentPage, setCurrentPage] = useState(1);
19569
+ const [totalPages, setTotalPages] = useState(0);
19570
+
19571
+ return (
19572
+ <View style={{ flex: 1 }}>
19573
+ <PDFViewer
19574
+ ref={pdfRef}
19575
+ source="https://example.com/document.pdf"
19576
+ onLoad={({ totalPages: total }) => setTotalPages(total)}
19577
+ onPageChange={(page) => setCurrentPage(page)}
19578
+ showPageIndicator={false}
19579
+ style={{ flex: 1 }}
19580
+ />
19581
+ <View direction="row" justify="center" align="center" gap="md" padding="md">
19582
+ <Button
19583
+ label="Previous"
19584
+ size="sm"
19585
+ onPress={() => pdfRef.current?.goToPage(Math.max(1, currentPage - 1))}
19586
+ />
19587
+ <Text>{currentPage} / {totalPages}</Text>
19588
+ <Button
19589
+ label="Next"
19590
+ size="sm"
19591
+ onPress={() => pdfRef.current?.goToPage(Math.min(totalPages, currentPage + 1))}
19592
+ />
19593
+ </View>
19594
+ </View>
19595
+ );
19596
+ }
19597
+ \`\`\`
19598
+
19599
+ ## Base64 Source
19600
+
19601
+ \`\`\`tsx
19602
+ import { PDFViewer } from '@idealyst/pdf';
19603
+
19604
+ function Base64PDF({ base64Data }: { base64Data: string }) {
19605
+ return (
19606
+ <PDFViewer
19607
+ source={{ base64: base64Data }}
19608
+ fitPolicy="both"
19609
+ style={{ flex: 1 }}
19610
+ />
19611
+ );
19612
+ }
19613
+ \`\`\`
19614
+
19615
+ ## Horizontal Mode
19616
+
19617
+ \`\`\`tsx
19618
+ import { PDFViewer } from '@idealyst/pdf';
19619
+
19620
+ function HorizontalPDF() {
19621
+ return (
19622
+ <PDFViewer
19623
+ source="https://example.com/slides.pdf"
19624
+ direction="horizontal"
19625
+ fitPolicy="both"
19626
+ style={{ flex: 1 }}
19627
+ />
19628
+ );
19629
+ }
19630
+ \`\`\`
19631
+
19632
+ ## With Error Handling
19633
+
19634
+ \`\`\`tsx
19635
+ import { useState } from 'react';
19636
+ import { PDFViewer } from '@idealyst/pdf';
19637
+ import { View, Text } from '@idealyst/components';
19638
+
19639
+ function SafePDFViewer({ url }: { url: string }) {
19640
+ const [error, setError] = useState<string | null>(null);
19641
+
19642
+ if (error) {
19643
+ return (
19644
+ <View style={{ flex: 1 }} align="center" justify="center">
19645
+ <Text intent="danger">Failed to load PDF: {error}</Text>
19646
+ </View>
19647
+ );
19648
+ }
19649
+
19650
+ return (
19651
+ <PDFViewer
19652
+ source={url}
19653
+ onError={(err) => setError(err.message)}
19654
+ style={{ flex: 1 }}
19655
+ />
19656
+ );
19657
+ }
19658
+ \`\`\`
19659
+
19660
+ ## Zoom Controls
19661
+
19662
+ \`\`\`tsx
19663
+ import { useRef, useState } from 'react';
19664
+ import { PDFViewer, PDFViewerRef } from '@idealyst/pdf';
19665
+ import { View, Button } from '@idealyst/components';
19666
+
19667
+ function ZoomablePDF() {
19668
+ const pdfRef = useRef<PDFViewerRef>(null);
19669
+ const [zoom, setZoom] = useState(1);
19670
+
19671
+ const handleZoom = (level: number) => {
19672
+ setZoom(level);
19673
+ pdfRef.current?.setZoom(level);
19674
+ };
19675
+
19676
+ return (
19677
+ <View style={{ flex: 1 }}>
19678
+ <PDFViewer
19679
+ ref={pdfRef}
19680
+ source="https://example.com/document.pdf"
19681
+ minZoom={0.5}
19682
+ maxZoom={4}
19683
+ style={{ flex: 1 }}
19684
+ />
19685
+ <View direction="row" justify="center" gap="sm" padding="sm">
19686
+ <Button label="50%" size="sm" onPress={() => handleZoom(0.5)} />
19687
+ <Button label="100%" size="sm" onPress={() => handleZoom(1)} />
19688
+ <Button label="200%" size="sm" onPress={() => handleZoom(2)} />
19689
+ </View>
19690
+ </View>
19691
+ );
19692
+ }
19693
+ \`\`\`
19694
+ `
19695
+ };
19696
+
19338
19697
  // src/data/install-guides.ts
19339
19698
  var installGuides = {
19340
19699
  // ============================================================================
@@ -20587,6 +20946,79 @@ function Test() {
20587
20946
  solution: "Check that you're running on a supported platform (iOS 16.2+ or Android API 24+). On web, Live Activities are not supported and will always return not_supported."
20588
20947
  }
20589
20948
  ]
20949
+ },
20950
+ // =====================================================================
20951
+ // MEDIA PACKAGES — PDF
20952
+ // =====================================================================
20953
+ pdf: {
20954
+ packageName: "PDF",
20955
+ npmName: "@idealyst/pdf",
20956
+ description: "Cross-platform PDF viewer using pdfjs-dist (web) and react-native-pdf (native)",
20957
+ platforms: ["web", "native"],
20958
+ complexity: "moderate",
20959
+ installation: {
20960
+ yarn: "yarn add @idealyst/pdf",
20961
+ npm: "npm install @idealyst/pdf"
20962
+ },
20963
+ peerDependencies: [
20964
+ {
20965
+ name: "pdfjs-dist",
20966
+ required: true,
20967
+ platforms: ["web"],
20968
+ note: "Mozilla PDF.js for web rendering"
20969
+ },
20970
+ {
20971
+ name: "react-native-pdf",
20972
+ required: true,
20973
+ platforms: ["native"],
20974
+ note: "Native PDF renderer (PDFKit on iOS, PdfRenderer on Android)"
20975
+ },
20976
+ {
20977
+ name: "react-native-blob-util",
20978
+ required: true,
20979
+ platforms: ["native"],
20980
+ note: "Required peer dependency of react-native-pdf for file handling"
20981
+ }
20982
+ ],
20983
+ ios: {
20984
+ podInstallRequired: true,
20985
+ additionalSteps: [
20986
+ "cd ios && pod install",
20987
+ "Ensure minimum iOS deployment target is 13.0 or higher"
20988
+ ]
20989
+ },
20990
+ android: {
20991
+ permissions: [],
20992
+ additionalSteps: [
20993
+ "No special permissions required for PDF viewing",
20994
+ "Ensure minSdkVersion is 21 or higher"
20995
+ ]
20996
+ },
20997
+ web: {
20998
+ additionalDependencies: ["pdfjs-dist"],
20999
+ notes: [
21000
+ "The pdfjs-dist worker is auto-configured from CDN by default.",
21001
+ "For custom setups: set pdfjs.GlobalWorkerOptions.workerSrc before rendering PDFViewer.",
21002
+ "For Vite: import pdfjs-dist/build/pdf.worker.min.mjs and set as workerSrc."
21003
+ ]
21004
+ },
21005
+ verification: `import { PDFViewer } from '@idealyst/pdf';
21006
+ // Should render without errors:
21007
+ <PDFViewer source="https://example.com/sample.pdf" style={{ flex: 1 }} />`,
21008
+ troubleshooting: [
21009
+ {
21010
+ issue: "PDF.js worker not found on web",
21011
+ solution: "Set pdfjs.GlobalWorkerOptions.workerSrc to the correct worker URL before rendering PDFViewer. The package sets a CDN default, but custom bundler setups may need manual configuration."
21012
+ },
21013
+ {
21014
+ issue: "react-native-pdf not linking on iOS",
21015
+ solution: "Run cd ios && pod install and rebuild the project. Ensure minimum deployment target is iOS 13.0+."
21016
+ },
21017
+ {
21018
+ issue: "Blank screen on Android",
21019
+ solution: "Ensure minSdkVersion is 21+ in android/build.gradle. Also check that react-native-blob-util is installed as a peer of react-native-pdf."
21020
+ }
21021
+ ]
20590
21022
  }
20591
21023
  };
20592
21024
  function getInstallGuide(packageName) {
@@ -71569,6 +72001,17 @@ function getNetworkGuide(args) {
71569
72001
  }
71570
72002
  return textResponse(guide);
71571
72003
  }
72004
+ function getPdfGuide(args) {
72005
+ const topic = args.topic;
72006
+ const uri = `idealyst://pdf/${topic}`;
72007
+ const guide = pdfGuides[uri];
72008
+ if (!guide) {
72009
+ return textResponse(
72010
+ `Topic "${topic}" not found. Available topics: overview, api, examples`
72011
+ );
72012
+ }
72013
+ return textResponse(guide);
72014
+ }
71572
72015
  function listPackages(args = {}) {
71573
72016
  const category = args.category;
71574
72017
  if (category) {
@@ -71820,6 +72263,7 @@ var toolHandlers = {
71820
72263
  get_notifications_guide: getNotificationsGuide,
71821
72264
  get_live_activity_guide: getLiveActivityGuide,
71822
72265
  get_network_guide: getNetworkGuide,
72266
+ get_pdf_guide: getPdfGuide,
71823
72267
  list_packages: listPackages,
71824
72268
  get_package_docs: getPackageDocs,
71825
72269
  search_packages: searchPackages2,