fix: use native fetch instead of node-fetch dependency
- Removed unnecessary node-fetch import from bin/brainy.js - Removed node-fetch import from brainy-mcp-server.js - Native fetch available since Node 18, brainy requires Node 24.4.0+ - Reduces dependencies by 6 packages - Avoids indirect deprecation warning from boolean package - No impact on browser compatibility (CLI is Node-only, core library unaffected) Architecture notes: - Brain Cloud integration remains as augmentation option - Users can choose: local (free), Brain Cloud (9/mo), or self-host - Clean separation maintained: brainy (MIT) vs Brain Cloud (proprietary) - TODO: Consider extracting Brain Cloud specific URLs to config
This commit is contained in:
parent
664bef2eae
commit
a1621cc5c6
4 changed files with 4 additions and 106 deletions
|
|
@ -14,8 +14,7 @@ import { readFileSync } from 'fs'
|
|||
import { dirname, join } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
// Import fetch for API calls
|
||||
import fetch from 'node-fetch'
|
||||
// Use native fetch (available in Node.js 18+)
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const packageJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
ListToolsRequestSchema,
|
||||
Tool,
|
||||
} from '@modelcontextprotocol/sdk/types.js';
|
||||
import fetch from 'node-fetch';
|
||||
// Use native fetch (available in Node.js 18+)
|
||||
|
||||
// Configuration from environment
|
||||
const CUSTOMER_ID = process.env.CUSTOMER_ID || 'demo-test-auto';
|
||||
|
|
|
|||
103
package-lock.json
generated
103
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@soulcraft/brainy",
|
||||
"version": "0.59.0",
|
||||
"version": "0.59.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@soulcraft/brainy",
|
||||
"version": "0.59.0",
|
||||
"version": "0.59.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.540.0",
|
||||
|
|
@ -18,7 +18,6 @@
|
|||
"commander": "^11.1.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"inquirer": "^12.9.1",
|
||||
"node-fetch": "^3.3.2",
|
||||
"ora": "^8.0.1",
|
||||
"prompts": "^2.4.2",
|
||||
"uuid": "^9.0.1"
|
||||
|
|
@ -48,7 +47,6 @@
|
|||
"express": "^5.1.0",
|
||||
"happy-dom": "^18.0.1",
|
||||
"jsdom": "^26.1.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"process": "^0.11.10",
|
||||
"puppeteer": "^22.15.0",
|
||||
"standard-version": "^9.5.0",
|
||||
|
|
@ -7502,30 +7500,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-blob": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
||||
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-domexception": "^1.0.0",
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/fflate": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
|
||||
|
|
@ -7680,19 +7654,6 @@
|
|||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/formdata-polyfill": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fetch-blob": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
|
|
@ -9636,56 +9597,6 @@
|
|||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
|
||||
"deprecated": "Use your platform's native DOMException instead",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
|
||||
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"fetch-blob": "^3.1.4",
|
||||
"formdata-polyfill": "^4.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch/node_modules/data-uri-to-buffer": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
|
||||
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/normalize-package-data": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz",
|
||||
|
|
@ -12582,16 +12493,6 @@
|
|||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
|
||||
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/whatwg-encoding": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
|
||||
|
|
|
|||
|
|
@ -201,7 +201,6 @@
|
|||
"express": "^5.1.0",
|
||||
"happy-dom": "^18.0.1",
|
||||
"jsdom": "^26.1.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"process": "^0.11.10",
|
||||
"puppeteer": "^22.15.0",
|
||||
"standard-version": "^9.5.0",
|
||||
|
|
@ -220,7 +219,6 @@
|
|||
"commander": "^11.1.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"inquirer": "^12.9.1",
|
||||
"node-fetch": "^3.3.2",
|
||||
"ora": "^8.0.1",
|
||||
"prompts": "^2.4.2",
|
||||
"uuid": "^9.0.1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue