{"_id":"@becrafter/prompt-manager-core","_rev":"9-25b7394e86f10fa04017d14d292480e5","name":"@becrafter/prompt-manager-core","dist-tags":{"latest":"0.0.24"},"versions":{"0.0.17":{"name":"@becrafter/prompt-manager-core","version":"0.0.17","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.17","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"bb4e6bb7b27fec655dc9cbed84a08dfd4c5fb433","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.17.tgz","fileCount":15,"integrity":"sha512-3pgp70ybA8FtTRAXr3NZX0weOsvc5x0YudOI8szY7RzsIQhFiesmIlcGIJZyA/wbuZLZ8I8aba2C0IdeJ3fQ5A==","signatures":[{"sig":"MEUCIQCNjCs5plOvhxDxC18EQivnCddqGukcaqUz8skLAlsxywIgaDw7up69ecg69l2uMcU+iosILyDWwzAWDN7r/FzONyg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91887},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"4894875c8044f751135663ebf05b22203a2ba773","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"10.9.3","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"22.20.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.17_1762955372714_0.5953802026256554","host":"s3://npm-registry-packages-npm-production"}},"0.0.18":{"name":"@becrafter/prompt-manager-core","version":"0.0.18","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.18","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"2c0f7c882cc8c676f514c823b5cd4658af054364","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.18.tgz","fileCount":17,"integrity":"sha512-kS+FQXTPTp2teOsVbfCMnR0hqTW5J7/cPsdDLL32kgHMrAoSzxW+gmgcOa0tNZWsTZPBQSFUqGqf0DXwRci4nw==","signatures":[{"sig":"MEUCIQCSvij/Gk6EvRLS6sKajqoH142syfLi5FHIP6hs++iHgQIgA5yWD6FvO4PAJF8szgvx6Wm50pdk1RaKWrnyXUiTlsY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5709966},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"bfd2106e3cfa246e1a31508ea92e7972ddab9078","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"11.6.2","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"25.1.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.18_1763001651711_0.6186195586212444","host":"s3://npm-registry-packages-npm-production"}},"0.0.20":{"name":"@becrafter/prompt-manager-core","version":"0.0.20","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.20","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"ca98366ff2f9544e28eef3ee9818a843d56b0c59","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.20.tgz","fileCount":15,"integrity":"sha512-P/Ppjf8LNSFvBIPCBmRbs19imFPfR+Crp7yy1WCkhTfBY+8NiFLR5OTegIKKO8t6WJ/MhudIRsdJ8Tzba/8hlQ==","signatures":[{"sig":"MEUCIQCZTnj0QQzWYxeGD7WsHOdZmZacrsFkn/e6k4Z4+/aftgIgV6WvaGfDgUEkYSjb33g+6DV8igxhUHi57v2uAuwjNrc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":97912},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"53c75075a159b7e548ff986c76876c6d5fb5a521","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"11.6.2","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"25.1.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@electron/asar":"^4.0.1","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.20_1763021842524_0.3046552622212886","host":"s3://npm-registry-packages-npm-production"}},"0.0.21":{"name":"@becrafter/prompt-manager-core","version":"0.0.21","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.21","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"5fc966af623acb705afc4233730502858e32007a","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.21.tgz","fileCount":17,"integrity":"sha512-j0wfkTOU15PM4l1p0dkTd2QhBjUHfOm66VCDdmFl0s99Qtee7hc/MLk3/RMuPhEjIOgR8G+OpLVg6bb7RZijqw==","signatures":[{"sig":"MEQCIAcXCZA021S9lnMu3gKlK/RVslLLu9LF4psS6S4fjW0+AiBa/bDolTUmig5+js0wE8ZGAM8+Pl1yRurp5SOxM0ynEw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3356541},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"49017e3c7c965d908ecf1b75b678d36fff4497b6","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node --experimental-specifier-resolution=node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"11.6.2","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"25.1.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@electron/asar":"^4.0.1","http-proxy-middleware":"^3.0.5","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.21_1763120938263_0.3784181510559197","host":"s3://npm-registry-packages-npm-production"}},"0.0.22":{"name":"@becrafter/prompt-manager-core","version":"0.0.22","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.22","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"f9436a15658a7977a1745c54e79bb7ec20b2adf0","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.22.tgz","fileCount":21,"integrity":"sha512-gPCx1e7qfNr30bi5XtpiJrPzR7LK96NVBaej981KoOi70f+gVa8414l7kSvR8Jx6+CAVxwBRc7UlFViaoYpeow==","signatures":[{"sig":"MEQCICcAqoux5zxPyPHvA+AI9yp9GE1CFpY0QXKJ6i3mUIlXAiBAflMZeMU+95n3kuSE8XGh3y2JBFmQXgc9WIfNFMDpHg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3391401},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"f135c5811825c2863e6b048e69b91cdfd6ab6f51","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node --experimental-specifier-resolution=node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"11.6.2","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"25.1.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@electron/asar":"^4.0.1","http-proxy-middleware":"^3.0.5","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.22_1763384671103_0.6587257373782036","host":"s3://npm-registry-packages-npm-production"}},"0.0.23":{"name":"@becrafter/prompt-manager-core","version":"0.0.23","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","_id":"@becrafter/prompt-manager-core@0.0.23","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"dist":{"shasum":"04351844b755fb9f4a4d98e167ee68cac61f16c7","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.23.tgz","fileCount":26,"integrity":"sha512-0z0ZFJN0uQsBEU4OlyEPntHZbTkvujbVgAU38p282UOpXi0nsR3iSHSsYnydKCZEbf2zNxGB4kQK8WNEdPJxmw==","signatures":[{"sig":"MEUCIQCAT9XLnf3LIUATxt6tABtfgqhyTYj0NljL11kTYl42mQIgaMek2FCRaz+d6l23Pb5hBzpc7GejKUcZKxj8dX8VrbU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":174011},"main":"dist/index.js","type":"module","module":"index.js","gitHead":"3b6eafa4a54249d39af380a9b3ad2565a7ea3f1b","scripts":{"dev":"node --watch ./server.js","test":"node ./test.js","build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","start":"node ./server.js","example":"node --experimental-specifier-resolution=node ./example.js"},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"repository":{"url":"git+https://github.com/BeCrafter/prompt-manager.git","type":"git"},"_npmVersion":"11.6.2","description":"Core library for managing prompts with MCP protocol","directories":{},"_nodeVersion":"25.1.0","dependencies":{"zod":"^3.23.8","cors":"^2.8.5","yaml":"^2.4.1","dotenv":"^17.2.3","express":"^5.1.0","js-yaml":"^4.1.0","fs-extra":"^11.2.0","@electron/asar":"^4.0.1","http-proxy-middleware":"^3.0.5","@modelcontextprotocol/sdk":"^1.20.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/prompt-manager-core_0.0.23_1763530645857_0.06691029207092791","host":"s3://npm-registry-packages-npm-production"}},"0.0.24":{"name":"@becrafter/prompt-manager-core","version":"0.0.24","description":"Core library for managing prompts with MCP protocol","main":"dist/index.js","module":"index.js","type":"module","scripts":{"build":"esbuild ./index.js --bundle --outdir=dist --format=esm --platform=node --target=node18","dev":"node --watch ./server.js","start":"node ./server.js","example":"node --experimental-specifier-resolution=node ./example.js","test":"node ./test.js"},"keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"author":{"name":"BeCrafter"},"license":"MIT","dependencies":{"@electron/asar":"^4.0.1","@modelcontextprotocol/sdk":"^1.20.2","cors":"^2.8.5","dotenv":"^17.2.3","express":"^5.1.0","fs-extra":"^11.2.0","http-proxy-middleware":"^3.0.5","js-yaml":"^4.1.0","yaml":"^2.4.1","zod":"^3.23.8"},"devDependencies":{"esbuild":"^0.27.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/BeCrafter/prompt-manager.git"},"homepage":"https://github.com/BeCrafter/prompt-manager#readme","bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"gitHead":"7a3d135875e87f1be54b040fbcca90944c2d88c2","_id":"@becrafter/prompt-manager-core@0.0.24","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-ycZofXOfBMantkYRfm3WsOQ3yuPs83sb8Ob4kQSy/I+imVKSsqeEOrov4f+8xTfaNYjrsAZv1fZ2I8NNEEJ7aA==","shasum":"5049989ceebc0e989198657154ee11e041cee0fd","tarball":"https://registry.npmjs.org/@becrafter/prompt-manager-core/-/prompt-manager-core-0.0.24.tgz","fileCount":26,"unpackedSize":175925,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBOuOTOCpmtWDtQFn0K/sS/f6l57HsACH9qnmbfV6qk9AiB9XpGSQPa/50Sg5KNHIIJwTi/RLpNZcLIw15uwZ6nrgQ=="}]},"_npmUser":{"name":"kugouming","email":"kugouming@sina.com"},"directories":{},"maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prompt-manager-core_0.0.24_1763557993535_0.46622085675205693"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-12T13:49:32.603Z","modified":"2025-11-19T13:13:14.708Z","0.0.19":"2025-11-12T13:37:56.100Z","0.0.17":"2025-11-12T13:49:32.871Z","0.0.18":"2025-11-13T02:40:51.967Z","0.0.20":"2025-11-13T08:17:22.694Z","0.0.21":"2025-11-14T11:48:58.479Z","0.0.22":"2025-11-17T13:04:31.380Z","0.0.23":"2025-11-19T05:37:26.063Z","0.0.24":"2025-11-19T13:13:13.807Z"},"bugs":{"url":"https://github.com/BeCrafter/prompt-manager/issues"},"author":{"name":"BeCrafter"},"license":"MIT","homepage":"https://github.com/BeCrafter/prompt-manager#readme","keywords":["mcp","prompt","prompt-mcp","prompt-manager","library"],"repository":{"type":"git","url":"git+https://github.com/BeCrafter/prompt-manager.git"},"description":"Core library for managing prompts with MCP protocol","maintainers":[{"name":"kugouming","email":"kugouming@sina.com"}],"readme":"# @becrafter/prompt-manager-core\n\nCore library for managing prompts with MCP (Model Context Protocol) support.\n\n## Installation\n\n```bash\nnpm install @becrafter/prompt-manager-core\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport { startServer, stopServer, config } from '@becrafter/prompt-manager-core';\n\n// Start the server with default configuration\nconst server = await startServer();\n\nconsole.log('Server is running!');\n```\n\n### Advanced Usage with Configuration\n\n```javascript\nimport { startServer, stopServer, config } from '@becrafter/prompt-manager-core';\n\n// Start the server with custom configuration\nconst server = await startServer({\n  configOverrides: {\n    promptsDir: './my-prompts',\n    port: 3000,\n    adminEnable: true,\n    adminRequireAuth: false\n  }\n});\n\n// Stop the server when needed\n// await stopServer();\n```\n\n### Using the Express App Instance\n\n```javascript\nimport { app, config } from '@becrafter/prompt-manager-core';\n\n// You can use the app instance to add custom routes\napp.get('/custom-endpoint', (req, res) => {\n  res.json({ message: 'Hello from custom endpoint!' });\n});\n\n// Then start the server\nimport { startServer } from '@becrafter/prompt-manager-core';\nawait startServer();\n```\n\n### Accessing Prompt Manager\n\n```javascript\nimport { promptManager, util } from '@becrafter/prompt-manager-core';\n\n// Load prompts\nawait promptManager.loadPrompts();\n\n// Get all prompts\nconst prompts = promptManager.getPrompts();\nconsole.log('Loaded prompts:', prompts);\n\n// Get a specific prompt by ID\nconst prompt = promptManager.getPrompt('prompt-id');\nconsole.log('Prompt:', prompt);\n\n// Search prompts\nconst searchTerm = 'search term';\nconst searchResults = prompts.filter(prompt => \n  prompt.name.includes(searchTerm) || \n  (prompt.description && prompt.description.includes(searchTerm))\n);\n```\n\n## API Reference\n\n### Functions\n\n- `startServer(options = {})` - Starts the prompt manager server\n- `stopServer()` - Stops the prompt manager server\n- `getServerState()` - Gets the current server state\n- `getServerAddress()` - Gets the server address\n- `isServerRunning()` - Checks if the server is running\n\n### Objects\n\n- `app` - Express application instance\n- `config` - Configuration object\n- `logger` - Logger instance\n- `util` - Utility functions\n- `promptManager` - Prompt manager instance\n\n### MCP Related\n\n- `getMcpServer()` - Gets the MCP server instance\n- `handleGetPrompt`, `handleSearchPrompts`, `handleReloadPrompts` - MCP handlers\n\n### Routes\n\n- `adminRouter` - Admin API routes\n- `openRouter` - Open API routes\n\n### Middleware\n\n- `adminAuthMiddleware` - Admin authentication middleware\n\n## Configuration Options\n\nYou can override default configuration using the `configOverrides` option:\n\n```javascript\n{\n  promptsDir: './prompts',        // Directory for prompt files\n  port: 5621,                     // Server port\n  serverName: 'prompt-manager',   // Server name\n  serverVersion: '0.0.19',        // Server version\n  logLevel: 'info',               // Log level\n  maxPrompts: 1000,               // Max prompt count\n  recursiveScan: true,            // Recursive scan for prompts\n  adminEnable: true,              // Enable admin functionality\n  adminPath: '/admin',            // Admin path\n  adminRequireAuth: true,         // Require admin authentication\n  admins: [                       // Admin accounts\n    {\n      username: 'admin',\n      password: 'admin',\n      token: '...'\n    }\n  ]\n}\n```\n\n## License\n\nMIT","readmeFilename":"README.md"}