{"_id":"@br1j/windsweeper-sdk","name":"@br1j/windsweeper-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@br1j/windsweeper-sdk","version":"0.1.0","description":"Node.js SDK for Windsweeper MCP","main":"dist/index.js","types":"dist/index.d.ts","bin":{"windsweeper":"dist/cli.js"},"scripts":{"build":"tsc","test":"jest","lint":"eslint src --ext .ts","clean":"rm -rf dist node_modules","prepare":"npm run build && chmod +x dist/cli.js"},"keywords":["windsweeper","mcp","sdk","api"],"author":{"name":"Windsweeper Team"},"license":"MIT","dependencies":{"node-fetch":"^2.6.7","commander":"^10.0.0"},"devDependencies":{"@types/jest":"^29.5.1","@types/node":"^16.11.7","@types/node-fetch":"^2.6.3","@windsweeper/eslint-config":"*","@windsweeper/tsconfig":"*","jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.2.2"},"_id":"@br1j/windsweeper-sdk@0.1.0","gitHead":"9b825b0fa589006ebe0156fc65cf05dc4e72917a","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-8xfHbpd959biIwFYfn5Agfmhpoz43vq23qK815s4i97FIW38ycYV0gCYWYK+afAtEmcSuOT28DBVvYPExfRA9g==","shasum":"f7e6b7341b7119b5c3245d323c3bd80bce4882b0","tarball":"https://registry.npmjs.org/@br1j/windsweeper-sdk/-/windsweeper-sdk-0.1.0.tgz","fileCount":27,"unpackedSize":97887,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDIGAvvj5jL0XxZf0CkoOkqXFTINnKzHSA5hugRdle8xwIhANZaQdHk36nlG7BwB3h/rLAtxhILgKb5Nk2/uUjNjJIY"}]},"_npmUser":{"name":"br1j","email":"saulweiloveman@gmail.com"},"directories":{},"maintainers":[{"name":"br1j","email":"saulweiloveman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/windsweeper-sdk_0.1.0_1747604333729_0.19169153747059475"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-18T21:38:53.636Z","0.1.0":"2025-05-18T21:38:53.950Z","modified":"2025-05-18T21:38:54.216Z"},"maintainers":[{"name":"br1j","email":"saulweiloveman@gmail.com"}],"description":"Node.js SDK for Windsweeper MCP","keywords":["windsweeper","mcp","sdk","api"],"author":{"name":"Windsweeper Team"},"license":"MIT","readme":"# Windsweeper SDK for Node.js\n\nThis package provides a client for interacting with the Windsweeper MCP (Model Control Protocol) server. It allows you to validate rules and code, apply templates, generate content, and manage resources.\n\n## Installation\n\n```bash\nnpm install windsweeper-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { createClient } from 'windsweeper-sdk';\n\n// Create a client\nconst client = createClient({ \n  serverUrl: 'http://localhost:9001',\n  apiKey: 'your-api-key' // Optional\n});\n\n// Check server health\nconst isHealthy = await client.checkHealth();\nconsole.log(`Server is ${isHealthy ? 'healthy' : 'unhealthy'}`);\n\n// List resources\nconst resources = await client.listResources('my-server');\nconsole.log(`Found ${resources.resources.length} resources`);\n\n// Validate a rule\nconst validationResult = await client.validateRule('your-rule-content');\nif (validationResult.valid) {\n  console.log('Rule is valid!');\n} else {\n  console.log('Rule validation failed:', validationResult.issues);\n}\n```\n\n## API Reference\n\n### `createClient(options)`\n\nCreates a new Windsweeper client instance.\n\n**Parameters:**\n- `options` - Configuration options\n  - `serverUrl` - URL of the Windsweeper MCP server\n  - `apiKey` - Optional API key for authentication\n  - `timeout` - Request timeout in milliseconds (default: 30000)\n\n**Returns:** A configured `WindsweeperClient` instance\n\n### Client Methods\n\n#### `checkHealth()`\n\nChecks if the server is healthy.\n\n**Returns:** `Promise<boolean>` - True if the server is healthy\n\n#### `listResources(serverName, cursor?)`\n\nLists resources from the MCP server.\n\n**Parameters:**\n- `serverName` - Name of the server to list resources from\n- `cursor` - Optional pagination cursor\n\n**Returns:** `Promise<{ resources: Resource[]; nextCursor?: string }>` - List of resources and optional next page cursor\n\n#### `getResource<T>(serverName, resourceId)`\n\nGets a specific resource from the MCP server.\n\n**Parameters:**\n- `serverName` - Name of the server to get the resource from\n- `resourceId` - ID of the resource to get\n\n**Returns:** `Promise<T>` - The requested resource\n\n#### `validateRule(content, options?)`\n\nValidates a rule definition.\n\n**Parameters:**\n- `content` - Rule content to validate\n- `options` - Additional validation options\n  - `languageId` - Language of the rule content (default: 'yaml')\n  - `uri` - Optional URI of the rule\n\n**Returns:** `Promise<ValidationResult>` - Validation result\n\n#### `validateCode(code, ruleIds, languageId)`\n\nValidates code against multiple rules.\n\n**Parameters:**\n- `code` - Code to validate\n- `ruleIds` - IDs of rules to validate against\n- `languageId` - Language of the code\n\n**Returns:** `Promise<Record<string, ValidationResult>>` - Map of rule IDs to validation results\n\n#### `applyTemplate(templateId, variables)`\n\nApplies a template.\n\n**Parameters:**\n- `templateId` - ID of the template to apply\n- `variables` - Variables to use in the template\n\n**Returns:** `Promise<string>` - Generated content\n\n#### `generate(prompt, options?)`\n\nGenerates content.\n\n**Parameters:**\n- `prompt` - Prompt to generate from\n- `options` - Generation options\n  - `mode` - Generation mode\n  - `format` - Output format\n  - `temperature` - Temperature for generation\n  - `maxTokens` - Maximum tokens to generate\n  - `includeSources` - Whether to include sources in the response\n\n**Returns:** `Promise<string>` - Generated content\n\n## Types\n\nThe following TypeScript interfaces are exported:\n\n- `ValidationIssue` - Issue found during validation\n- `ValidationResult` - Result of a validation operation\n- `Resource` - A resource from the MCP server\n- `GenerateOptions` - Options for generation requests\n- `WindsweeperClientOptions` - Options for creating a client\n\n## Development\n\n### Building\n\n```bash\nnpm run build\n```\n\n### Testing\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-68d375c52ea7187ff462904ea38f60ad"}