diff --git a/typescript/package-lock.json b/typescript/package-lock.json index 8355460..79e9d95 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -1,20 +1,20 @@ { "name": "@prompd/cli", - "version": "0.4.10", + "version": "0.5.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@prompd/cli", - "version": "0.4.10", - "license": "MIT", + "version": "0.5.0-beta.3", + "license": "Elastic-2.0", "dependencies": { - "@modelcontextprotocol/sdk": "^0.5.0", + "@modelcontextprotocol/sdk": "^1.27.1", "@types/nunjucks": "^3.2.6", "adm-zip": "^0.5.16", "archiver": "^6.0.1", "axios": "^1.6.2", - "bcrypt": "^5.1.1", + "bcrypt": "^6.0.0", "chalk": "^4.1.2", "commander": "^11.1.0", "compression": "^1.7.4", @@ -586,6 +586,17 @@ "tslib": "^2.4.0" } }, + "node_modules/@hono/node-server": { + "version": "1.19.11", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.11.tgz", + "integrity": "sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, "node_modules/@img/colour": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", @@ -990,6 +1001,41 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@inquirer/external-editor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", + "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", + "dependencies": { + "chardet": "^2.1.1", + "iconv-lite": "^0.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor/node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/@inquirer/figures": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.13.tgz", @@ -1124,9 +1170,9 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "dependencies": { "argparse": "^1.0.7", @@ -1356,9 +1402,9 @@ } }, "node_modules/@jest/reporters/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -1501,126 +1547,333 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.27.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz", + "integrity": "sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/chownr": { + "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, "engines": { - "node": ">=10" + "node": ">= 0.6" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", "dependencies": { - "semver": "^6.0.0" + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" + "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/@modelcontextprotocol/sdk/node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", "engines": { - "node": ">=8" + "node": ">=6.6.0" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "node_modules/@modelcontextprotocol/sdk/node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" }, "engines": { - "node": ">= 8" + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.3.1.tgz", + "integrity": "sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==", "dependencies": { - "yallist": "^4.0.0" + "ip-address": "10.1.0" }, "engines": { - "node": ">=8" + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" + "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { - "node": ">=10" + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } }, - "node_modules/@modelcontextprotocol/sdk": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-0.5.0.tgz", - "integrity": "sha512-RXgulUX6ewvxjAG0kOpLMEdXXWkzWgaoCGaA2CwNW7cQCIphjpJhjpHSiaPdVCnisjRF/0Cm9KWHUuIoeiAblQ==", + "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", "dependencies": { "content-type": "^1.0.5", - "raw-body": "^3.0.0", - "zod": "^3.23.8" + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" } }, "node_modules/@napi-rs/canvas": { @@ -2080,7 +2333,7 @@ "version": "20.19.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.11.tgz", "integrity": "sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==", - "dev": true, + "devOptional": true, "dependencies": { "undici-types": "~6.21.0" } @@ -2200,11 +2453,6 @@ "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==" }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -2265,15 +2513,35 @@ "node": ">=12.0" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/ajv": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dependencies": { - "debug": "4" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, - "engines": { - "node": ">= 6.0.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } } }, "node_modules/ansi-escapes": { @@ -2323,11 +2591,6 @@ "node": ">= 8" } }, - "node_modules/aproba": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", - "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==" - }, "node_modules/archiver": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.2.tgz", @@ -2381,9 +2644,9 @@ } }, "node_modules/archiver-utils/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2391,19 +2654,6 @@ "node": ">=10" } }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "deprecated": "This package is no longer supported.", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2436,12 +2686,12 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", - "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }, @@ -2600,16 +2850,16 @@ ] }, "node_modules/bcrypt": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz", - "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-6.0.0.tgz", + "integrity": "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==", "hasInstallScript": true, "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.11", - "node-addon-api": "^5.0.0" + "node-addon-api": "^8.3.0", + "node-gyp-build": "^4.8.4" }, "engines": { - "node": ">= 10.0.0" + "node": ">= 18" } }, "node_modules/bl": { @@ -2628,22 +2878,22 @@ "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" }, "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", "dependencies": { - "bytes": "3.1.2", + "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", "type-is": "~1.6.18", - "unpipe": "1.0.0" + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8", @@ -2658,25 +2908,52 @@ "ms": "2.0.0" } }, + "node_modules/body-parser/node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/body-parser/node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" }, "engines": { "node": ">= 0.8" } }, + "node_modules/body-parser/node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -2916,9 +3193,9 @@ } }, "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==" }, "node_modules/chownr": { "version": "3.0.0", @@ -3073,14 +3350,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "bin": { - "color-support": "bin.js" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3158,12 +3427,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/content-disposition": { "version": "0.5.4", @@ -3284,9 +3549,9 @@ } }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dependencies": { "ms": "^2.1.3" }, @@ -3341,11 +3606,6 @@ "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -3381,9 +3641,9 @@ } }, "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, "engines": { "node": ">=0.3.1" @@ -3567,6 +3827,25 @@ "node": ">= 0.6" } }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", + "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -3622,38 +3901,38 @@ } }, "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", - "on-finished": "2.4.1", + "on-finished": "~2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", + "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.13.0", + "qs": "~6.14.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", + "send": "~0.19.0", + "serve-static": "~1.16.2", "setprototypeof": "1.2.0", - "statuses": "2.0.1", + "statuses": "~2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" @@ -3693,18 +3972,10 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-fifo": { "version": "1.3.2", @@ -3717,6 +3988,21 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -3816,9 +4102,9 @@ } }, "node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3867,33 +4153,6 @@ "node": ">=14.14" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fs-minipass/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3921,31 +4180,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "deprecated": "This package is no longer supported.", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/gauge/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -4021,9 +4255,10 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -4109,11 +4344,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -4133,6 +4363,14 @@ "node": ">=16.0.0" } }, + "node_modules/hono": { + "version": "4.12.6", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.6.tgz", + "integrity": "sha512-KljEp+MeEEEIOT75qBo1UjqqB29fRMtlDEwCxcexOzdkUq6LR/vRvHk5pdROcxyOYyW1niq7Gb5pFVGy5R1eBw==", + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -4154,18 +4392,6 @@ "node": ">= 0.8" } }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -4254,14 +4480,14 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/inquirer": { - "version": "9.3.7", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.3.7.tgz", - "integrity": "sha512-LJKFHCSeIRq9hanN14IlOtPSTe3lNES7TYDTE2xxdAy1LS5rYphajK1qtwvj3YmQXvvk0U2Vbmcni8P9EIQW9w==", + "version": "9.3.8", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.3.8.tgz", + "integrity": "sha512-pFGGdaHrmRKMh4WoDDSowddgjT1Vkl90atobmTeSmcPGdYiwikch/m/Ef5wRaiamHejtw0cUUMMerzDUXCci2w==", "dependencies": { + "@inquirer/external-editor": "^1.0.2", "@inquirer/figures": "^1.0.3", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", - "external-editor": "^3.1.0", "mute-stream": "1.0.0", "ora": "^5.4.1", "run-async": "^3.0.0", @@ -4275,6 +4501,14 @@ "node": ">=18" } }, + "node_modules/ip-address": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", + "engines": { + "node": ">= 12" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -4338,6 +4572,11 @@ "node": ">=0.12.0" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==" + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4632,9 +4871,9 @@ } }, "node_modules/jest-config/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -4955,9 +5194,9 @@ } }, "node_modules/jest-runtime/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -5092,6 +5331,14 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jose": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.1.tgz", + "integrity": "sha512-jUaKr1yrbfaImV7R2TN/b3IcZzsw38/chqMpo2XJ7i2F8AfM/lA4G1goC3JVEwg0H7UldTmSt3P68nt31W7/mw==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5099,9 +5346,9 @@ "dev": true }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dependencies": { "argparse": "^2.0.1" }, @@ -5127,6 +5374,16 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -5220,11 +5477,11 @@ } }, "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", + "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", "dependencies": { - "jwa": "^1.4.1", + "jwa": "^1.4.2", "safe-buffer": "^5.0.1" } }, @@ -5311,9 +5568,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==" }, "node_modules/lodash.includes": { "version": "4.3.0", @@ -5541,11 +5798,11 @@ } }, "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -5572,9 +5829,9 @@ } }, "node_modules/minizlib": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", - "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", + "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", "dependencies": { "minipass": "^7.1.2" }, @@ -5582,20 +5839,6 @@ "node": ">= 18" } }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5630,27 +5873,21 @@ "dev": true }, "node_modules/node-addon-api": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", - "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.6.0.tgz", + "integrity": "sha512-gBVjCaqDlRUk0EwoPNKzIr9KkS9041G/q31IBShPs1Xz6UTA+EXdZADbzqAJQrpDRq71CIMnOP5VMut3SL0z5Q==", "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "node": "^18 || ^20 || >= 21" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" } }, "node_modules/node-int64": { @@ -5665,20 +5902,6 @@ "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -5699,18 +5922,6 @@ "node": ">=8" } }, - "node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "deprecated": "This package is no longer supported.", - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, "node_modules/nunjucks": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", @@ -5830,14 +6041,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -6038,6 +6241,14 @@ "node": ">= 6" } }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "engines": { + "node": ">=16.20.0" + } + }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -6116,11 +6327,11 @@ ] }, "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "dependencies": { - "side-channel": "^1.0.6" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -6138,28 +6349,59 @@ } }, "node_modules/raw-body": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", - "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.6.3", - "unpipe": "1.0.0" + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/raw-body/node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" }, "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body/node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" } }, "node_modules/react-is": { @@ -6190,9 +6432,9 @@ } }, "node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6209,6 +6451,14 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -6276,59 +6526,28 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 18" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node_modules/router/node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/run-async": { @@ -6440,11 +6659,6 @@ "node": ">= 0.8.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -6801,15 +7015,14 @@ } }, "node_modules/tar": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", - "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.11.tgz", + "integrity": "sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ==", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", - "minizlib": "^3.0.1", - "mkdirp": "^3.0.1", + "minizlib": "^3.1.0", "yallist": "^5.0.0" }, "engines": { @@ -6880,9 +7093,9 @@ } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -6899,17 +7112,6 @@ "b4a": "^1.6.4" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -6936,11 +7138,6 @@ "node": ">=0.6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "node_modules/ts-jest": { "version": "29.4.1", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.1.tgz", @@ -7112,15 +7309,15 @@ } }, "node_modules/underscore": { - "version": "1.13.7", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", - "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==" + "version": "1.13.8", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.8.tgz", + "integrity": "sha512-DXtD3ZtEQzc7M8m4cXotyHR+FAS18C64asBYY5vqZexfYryNNnDc02W4hKg3rdQuqOYas1jkseX0+nZXjTXnvQ==" }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true + "devOptional": true }, "node_modules/universalify": { "version": "2.0.1", @@ -7226,20 +7423,6 @@ "defaults": "^1.0.3" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7254,14 +7437,6 @@ "node": ">= 8" } }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "node_modules/wmf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", @@ -7499,6 +7674,14 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz", + "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==", + "peerDependencies": { + "zod": "^3.25 || ^4" + } } } } diff --git a/typescript/package.json b/typescript/package.json index 67dfb99..e6d6454 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@prompd/cli", - "version": "0.5.0-beta.1", + "version": "0.5.0-beta.3", "description": "Node.js CLI for structured prompt definitions with universal LLM provider support. Also usable as a library in TypeScript/React apps.", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -63,12 +63,12 @@ "node": ">=16.0.0" }, "dependencies": { - "@modelcontextprotocol/sdk": "^0.5.0", + "@modelcontextprotocol/sdk": "^1.27.1", "@types/nunjucks": "^3.2.6", "adm-zip": "^0.5.16", "archiver": "^6.0.1", "axios": "^1.6.2", - "bcrypt": "^5.1.1", + "bcrypt": "^6.0.0", "chalk": "^4.1.2", "commander": "^11.1.0", "compression": "^1.7.4", diff --git a/typescript/src/lib/workflowExecutor.ts b/typescript/src/lib/workflowExecutor.ts index e4db90f..a59a884 100644 --- a/typescript/src/lib/workflowExecutor.ts +++ b/typescript/src/lib/workflowExecutor.ts @@ -47,6 +47,7 @@ import type { MemoryNodeData, WebSearchNodeData, DatabaseQueryNodeData, + ApiNodeData, BaseNodeData, } from './workflowTypes' import { getExecutionOrder, type ParsedWorkflow } from './workflowParser' @@ -54,6 +55,166 @@ import { MemoryBackend, InMemoryBackend, NoOpBackend } from './memoryBackend' type ExecutionCallback = (state: WorkflowExecutionState) => void +/** + * Node types that represent callable tools. + * Must match TOOL_NODE_TYPES in the frontend's workflowTypes.ts. + */ +const TOOL_NODE_TYPES: ReadonlySet = new Set([ + 'tool', 'mcp-tool', 'web-search', 'skill', 'api', + 'command', 'code', 'claude-code', 'database-query', +]) + +/** Node types allowed as children in tool containers (tool-call-router, chat-agent) */ +const TOOL_CONTAINER_CHILD_TYPES: ReadonlySet = new Set([ + ...TOOL_NODE_TYPES, 'tool-call-parser', +]) + +/** + * Convert any tool-like workflow node to an AgentTool definition. + * Handles all node types that extend BaseToolNodeData (tool, mcp-tool, web-search, + * skill, command, code, claude-code, database-query, api). + */ +function nodeToAgentTool(toolNode: WorkflowNode): AgentTool & { _toolNodeId?: string; _originalToolType?: string; _connectionId?: string } { + const data = toolNode.data as Record + const nodeType = toolNode.type || 'tool' + + // Read BaseToolNodeData fields (all tool-like nodes have these) + const toolName = (data.toolName as string) || (data.label as string) || nodeType + const description = (data.description as string) || `Tool: ${toolName}` + const parameterSchema = data.parameterSchema as AgentTool['parameters'] + + // Determine AgentTool toolType based on node type + let agentToolType: AgentTool['toolType'] = 'function' + let originalToolType: string = nodeType + + if (nodeType === 'tool') { + // ToolNode has its own toolType field + const tt = (data.toolType as string) || 'function' + originalToolType = tt + agentToolType = tt === 'http' ? 'http' : tt === 'mcp' ? 'mcp' : 'function' + } else if (nodeType === 'mcp-tool') { + agentToolType = 'mcp' + } else if (nodeType === 'api') { + agentToolType = 'http' + } else if (nodeType === 'command' || nodeType === 'claude-code') { + agentToolType = 'command' + } else if (nodeType === 'code') { + agentToolType = 'code' + } else if (nodeType === 'web-search') { + agentToolType = 'web-search' + } else if (nodeType === 'database-query') { + agentToolType = 'database-query' + } + // skill → 'function' (default) + + // Auto-generate parameterSchema for node types that have known inputs + // but no explicit schema set by the user + let resolvedParameters = parameterSchema + if (!resolvedParameters || !resolvedParameters.properties || Object.keys(resolvedParameters.properties).length === 0) { + if (nodeType === 'web-search') { + resolvedParameters = { + type: 'object', + properties: { + query: { type: 'string', description: 'The search query to look up on the web' }, + }, + required: ['query'], + } + } else if (nodeType === 'database-query') { + const dbData = data as unknown as DatabaseQueryNodeData + // For MongoDB: the LLM provides a JSON query document and optionally a collection + // For SQL: the LLM provides the SQL query and optionally parameters + // The node's configured values serve as defaults + resolvedParameters = { + type: 'object', + properties: { + query: { + type: 'string', + description: dbData.collection + ? `Query to execute. For MongoDB, provide a JSON filter document (e.g. {"name": "John"}). Default collection: ${dbData.collection}` + : 'SQL query or database command to execute', + }, + ...(dbData.collection ? { + collection: { + type: 'string', + description: `MongoDB collection name (default: ${dbData.collection})`, + }, + } : {}), + }, + required: ['query'], + } + } else if (nodeType === 'command') { + resolvedParameters = { + type: 'object', + properties: { + input: { type: 'string', description: 'Input to pass to the command' }, + }, + } + } else if (nodeType === 'api') { + resolvedParameters = { + type: 'object', + properties: { + input: { type: 'string', description: 'Input data for the API request' }, + }, + } + } + } + + const agentTool: AgentTool & { _toolNodeId?: string; _originalToolType?: string; _connectionId?: string } = { + name: toolName, + description, + toolType: agentToolType, + parameters: resolvedParameters, + _toolNodeId: toolNode.id, + _originalToolType: originalToolType, + } + + // Add type-specific config + if (nodeType === 'tool') { + const toolData = data as unknown as ToolNodeData + if (toolData.toolType === 'http') { + agentTool.httpConfig = { + method: toolData.httpMethod || 'GET', + url: toolData.httpUrl || '', + headers: toolData.httpHeaders, + bodyTemplate: toolData.httpBody, + } + } else if (toolData.toolType === 'mcp') { + agentTool.mcpConfig = { + serverUrl: toolData.mcpServerUrl, + serverName: toolData.mcpServerName, + } + } + } else if (nodeType === 'mcp-tool') { + const mcpData = data as unknown as McpToolNodeData + agentTool.mcpConfig = { + serverUrl: mcpData.serverConfig?.serverUrl, + serverName: mcpData.serverConfig?.serverName, + } + } else if (nodeType === 'api') { + const apiData = data as unknown as ApiNodeData + agentTool.httpConfig = { + method: apiData.method || 'GET', + url: apiData.url || '', + headers: apiData.headers, + bodyTemplate: apiData.body, + } + // Carry connectionId so execution can resolve baseUrl from the http-api connection + if ((data as BaseNodeData).connectionId) { + agentTool._connectionId = (data as BaseNodeData).connectionId + } + } else if (nodeType === 'command') { + const cmdData = data as unknown as CommandNodeData + agentTool.commandConfig = { + executable: cmdData.command || '', + args: cmdData.args?.join(' '), + cwd: cmdData.cwd, + requiresApproval: cmdData.requiresApproval, + } + } + + return agentTool +} + /** Execution mode determines how callback nodes behave */ export type ExecutionMode = 'automated' | 'debug' | 'step' @@ -164,6 +325,8 @@ export interface ToolCallRequest { url: string headers?: Record body?: string + /** Reference to a saved http-api connection for baseUrl/auth resolution */ + connectionId?: string } /** For MCP tools */ mcpConfig?: { @@ -194,6 +357,8 @@ export interface ToolCallRequest { apiKey?: string instanceUrl?: string } + /** Reference to a saved connection for provider/apiKey resolution */ + connectionId?: string } /** For database query tools */ databaseConfig?: { @@ -4685,6 +4850,334 @@ async function emitAgentCheckpoint( * history is captured and included in the output for downstream analysis. * Use a Checkpoint node connected to the agent output to inspect agent state. */ + +/** + * Build memory tools based on the docked memory node's mode. + * + * When a memory node is docked to an agent's 'memory' handle, the tools + * adapt to the memory mode: + * - kv: memory_get, memory_set, memory_delete, memory_list + * - conversation: memory_get_history, memory_append, memory_clear_history + * - cache: memory_get (with TTL info), memory_set (with TTL), memory_delete, memory_list + * + * When no memory node is docked, defaults to KV tools for backward compatibility. + * Scope and namespace are pre-filled from the memory node config to simplify LLM usage. + */ +function buildMemoryTools( + agentNodeId: string, + workflowFile?: WorkflowFile, +): AgentTool[] { + // Find docked memory node + let memoryMode: 'kv' | 'conversation' | 'cache' = 'kv' + let defaultScope = 'workflow' + let defaultNamespace = '' + let defaultConversationId = 'default' + let maxMessages = 0 + + if (workflowFile) { + const dockedMemoryNode = workflowFile.nodes.find(n => { + const nodeData = n.data as BaseNodeData + return n.type === 'memory' && + nodeData.dockedTo?.nodeId === agentNodeId && + nodeData.dockedTo?.handleId === 'memory' + }) + + // Also check for edge-connected memory nodes (non-docked) + const edgeConnectedMemoryNode = !dockedMemoryNode ? workflowFile.nodes.find(n => { + if (n.type !== 'memory') return false + return workflowFile.edges.some( + e => e.source === agentNodeId && e.sourceHandle === 'memory' && e.target === n.id + ) + }) : undefined + + const memoryNode = dockedMemoryNode || edgeConnectedMemoryNode + if (memoryNode) { + const memData = memoryNode.data as MemoryNodeData + memoryMode = memData.mode || 'kv' + defaultScope = memData.scope || 'workflow' + defaultNamespace = memData.namespace || '' + if (memoryMode === 'conversation') { + defaultConversationId = memData.conversationId || 'default' + maxMessages = memData.maxMessages ?? 0 + } + } + } + + const scopeDescription = defaultScope === 'execution' + ? 'execution: data is cleared when this workflow run ends' + : defaultScope === 'global' + ? 'global: data shared across all workflows' + : 'workflow: data persists across executions of this workflow' + + switch (memoryMode) { + case 'conversation': { + return [ + { + name: 'memory_get_history', + description: `Retrieve conversation history. Returns an array of messages with role and content.${maxMessages > 0 ? ` Sliding window: last ${maxMessages} messages.` : ''}`, + toolType: 'function', + parameters: { + type: 'object', + properties: { + conversation_id: { + type: 'string', + description: `Conversation thread ID (default: "${defaultConversationId}")`, + }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: [], + }, + }, + { + name: 'memory_append', + description: 'Append a message to conversation history. The message is added with a role and content.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + role: { + type: 'string', + enum: ['user', 'assistant', 'system'], + description: 'The role of the message sender', + }, + content: { + type: 'string', + description: 'The message content to append', + }, + conversation_id: { + type: 'string', + description: `Conversation thread ID (default: "${defaultConversationId}")`, + }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: ['role', 'content'], + }, + }, + { + name: 'memory_clear_history', + description: 'Clear all messages from a conversation history.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + conversation_id: { + type: 'string', + description: `Conversation thread ID (default: "${defaultConversationId}")`, + }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: [], + }, + }, + ] + } + + case 'cache': { + return [ + { + name: 'memory_get', + description: 'Retrieve a cached value. Returns null if expired or not found.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + key: { type: 'string', description: 'The cache key to retrieve' }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: ['key'], + }, + }, + { + name: 'memory_set', + description: 'Store a value in cache with optional TTL (time-to-live in seconds).', + toolType: 'function', + parameters: { + type: 'object', + properties: { + key: { type: 'string', description: 'The cache key' }, + value: { type: 'string', description: 'The value to cache (any JSON-serializable data)' }, + ttl: { type: 'number', description: 'Time-to-live in seconds (0 = no expiration)' }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: ['key', 'value'], + }, + }, + { + name: 'memory_delete', + description: 'Delete a cached value.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + key: { type: 'string', description: 'The cache key to delete' }, + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: ['key'], + }, + }, + { + name: 'memory_list', + description: 'List all cache keys in a namespace.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace for isolation (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: [], + }, + }, + ] + } + + case 'kv': + default: { + return [ + { + name: 'memory_get', + description: 'Retrieve a value from workflow or global memory. Use this to recall information stored in previous workflow executions.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace to organize related data (default: "${defaultNamespace || 'default'}")`, + }, + key: { type: 'string', description: 'The key to retrieve' }, + }, + required: ['key'], + }, + }, + { + name: 'memory_set', + description: 'Store a value in workflow or global memory for future executions.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace to organize related data (default: "${defaultNamespace || 'default'}")`, + }, + key: { type: 'string', description: 'The key to store under' }, + value: { type: 'string', description: 'The value to store (any JSON-serializable data)' }, + }, + required: ['key', 'value'], + }, + }, + { + name: 'memory_delete', + description: 'Delete a value from workflow or global memory.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace containing the key (default: "${defaultNamespace || 'default'}")`, + }, + key: { type: 'string', description: 'The key to delete' }, + }, + required: ['key'], + }, + }, + { + name: 'memory_list', + description: 'List all keys in a namespace for workflow or global memory.', + toolType: 'function', + parameters: { + type: 'object', + properties: { + scope: { + type: 'string', + enum: ['workflow', 'global'], + description: scopeDescription, + }, + namespace: { + type: 'string', + description: `Namespace to list keys from (default: "${defaultNamespace || 'default'}")`, + }, + }, + required: [], + }, + }, + ] + } + } +} + async function executeAgentNode( node: WorkflowNode, context: { @@ -4734,48 +5227,14 @@ async function executeAgentNode( if (toolRouterNode) { connectedToolRouterNodeId = toolRouterNode.id - // Find all Tool nodes that are children of this Tool Router + // Find all tool-like nodes that are children of this Tool Router const childToolNodes = workflowFile.nodes.filter( - n => n.parentId === toolRouterNode.id && n.type === 'tool' + n => n.parentId === toolRouterNode.id && TOOL_CONTAINER_CHILD_TYPES.has(n.type || '') ) - // Convert Tool nodes to AgentTool format + // Convert tool nodes to AgentTool format for (const toolNode of childToolNodes) { - const toolData = toolNode.data as ToolNodeData - - // Map toolType: command -> function (we'll handle it specially during execution) - // Map toolType: code -> function (same handling) - const agentToolType: AgentTool['toolType'] = - toolData.toolType === 'http' ? 'http' : - toolData.toolType === 'mcp' ? 'mcp' : - 'function' // command, code, and function all map to 'function' - - const agentTool: AgentTool = { - name: toolData.toolName, - description: toolData.description || `Tool: ${toolData.toolName}`, - toolType: agentToolType, - parameters: toolData.parameterSchema, - // Store original data for execution routing - httpConfig: toolData.toolType === 'http' ? { - method: toolData.httpMethod || 'GET', - url: toolData.httpUrl || '', - headers: toolData.httpHeaders, - bodyTemplate: toolData.httpBody, - } : undefined, - mcpConfig: toolData.toolType === 'mcp' ? { - serverUrl: toolData.mcpServerUrl, - serverName: toolData.mcpServerName, - } : undefined, - } - - // Store tool node ID and original type for routing during execution - // We'll use this in executeAgentTool to route to the actual Tool node - ;(agentTool as AgentTool & { _toolNodeId?: string; _originalToolType?: string }). - _toolNodeId = toolNode.id - ;(agentTool as AgentTool & { _toolNodeId?: string; _originalToolType?: string }). - _originalToolType = toolData.toolType - - collectedTools.push(agentTool) + collectedTools.push(nodeToAgentTool(toolNode)) } addTraceEntry(trace, { @@ -4786,118 +5245,15 @@ async function executeAgentNode( message: `Collected ${childToolNodes.length} tools from Tool Router '${toolRouterNode.data.label}'`, data: { toolRouterNodeId: toolRouterNode.id, - collectedToolNames: childToolNodes.map(n => (n.data as ToolNodeData).toolName), + collectedToolNames: childToolNodes.map(n => (n.data as Record).toolName as string || (n.data as BaseNodeData).label), }, }, options) } } } - // Add memory tools to enable LLM access to workflow/global memory - const memoryTools: AgentTool[] = [ - { - name: 'memory_get', - description: 'Retrieve a value from workflow or global memory. Use this to recall information stored in previous workflow executions.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow: data persists across executions of this workflow; global: data shared across all workflows' - }, - namespace: { - type: 'string', - description: 'Namespace to organize related data (e.g., "user_preferences", "session_data")' - }, - key: { - type: 'string', - description: 'The key to retrieve' - } - }, - required: ['scope', 'namespace', 'key'] - } - }, - { - name: 'memory_set', - description: 'Store a value in workflow or global memory for future executions. Use this to remember information across workflow runs.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow: data persists across executions of this workflow; global: data shared across all workflows' - }, - namespace: { - type: 'string', - description: 'Namespace to organize related data (e.g., "user_preferences", "session_data")' - }, - key: { - type: 'string', - description: 'The key to store under' - }, - value: { - type: 'string', - description: 'The value to store (any JSON-serializable data)' - }, - ttl: { - type: 'number', - description: 'Optional: Time-to-live in seconds (for cache mode only)' - } - }, - required: ['scope', 'namespace', 'key', 'value'] - } - }, - { - name: 'memory_delete', - description: 'Delete a value from workflow or global memory.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow or global scope' - }, - namespace: { - type: 'string', - description: 'Namespace containing the key' - }, - key: { - type: 'string', - description: 'The key to delete' - } - }, - required: ['scope', 'namespace', 'key'] - } - }, - { - name: 'memory_list', - description: 'List all keys in a namespace for workflow or global memory.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow or global scope' - }, - namespace: { - type: 'string', - description: 'Namespace to list keys from' - } - }, - required: ['scope', 'namespace'] - } - } - ] - - // Add memory tools to collected tools + // Add memory tools adapted to the docked memory node's mode (kv/conversation/cache) + const memoryTools = buildMemoryTools(node.id, workflowFile) collectedTools.push(...memoryTools) // Resolve user prompt with template expressions @@ -5083,7 +5439,9 @@ async function executeAgentNode( // Tool call found - execute it totalToolCalls++ - const toolName = toolCallResult.toolName! + // Normalize tool name: strip 'functions.' prefix that some LLMs add (e.g. "functions.web_search" → "web_search") + const rawToolName = toolCallResult.toolName! + const toolName = rawToolName.startsWith('functions.') ? rawToolName.slice('functions.'.length) : rawToolName const toolParams = toolCallResult.toolParameters || {} // Add assistant message with tool call to history @@ -5856,39 +6214,14 @@ Analyze the input above. Return a JSON object: // Collect tools from child nodes or inline tools let collectedTools: AgentTool[] = [...(data.tools || [])] - // Find tool nodes that are children of this chat-agent node + // Find tool-like nodes that are children of this chat-agent node if (workflowFile) { const childToolNodes = workflowFile.nodes.filter( - n => n.parentId === node.id && n.type === 'tool' + n => n.parentId === node.id && TOOL_CONTAINER_CHILD_TYPES.has(n.type || '') ) for (const toolNode of childToolNodes) { - const toolData = toolNode.data as ToolNodeData - const agentToolType: AgentTool['toolType'] = - toolData.toolType === 'http' ? 'http' : - toolData.toolType === 'mcp' ? 'mcp' : 'function' - - const agentTool: AgentTool = { - name: toolData.toolName, - description: toolData.description || `Tool: ${toolData.toolName}`, - toolType: agentToolType, - parameters: toolData.parameterSchema, - httpConfig: toolData.toolType === 'http' ? { - method: toolData.httpMethod || 'GET', - url: toolData.httpUrl || '', - headers: toolData.httpHeaders, - bodyTemplate: toolData.httpBody, - } : undefined, - mcpConfig: toolData.toolType === 'mcp' ? { - serverUrl: toolData.mcpServerUrl, - serverName: toolData.mcpServerName, - } : undefined, - } - - ;(agentTool as AgentTool & { _toolNodeId?: string; _originalToolType?: string })._toolNodeId = toolNode.id - ;(agentTool as AgentTool & { _toolNodeId?: string; _originalToolType?: string })._originalToolType = toolData.toolType - - collectedTools.push(agentTool) + collectedTools.push(nodeToAgentTool(toolNode)) } // Also check for connected tool-call-router @@ -5896,132 +6229,17 @@ Analyze the input above. Return a JSON object: const toolRouterNode = workflowFile.nodes.find(n => n.id === data.toolRouterNodeId && n.type === 'tool-call-router') if (toolRouterNode) { const routerChildTools = workflowFile.nodes.filter( - n => n.parentId === toolRouterNode.id && n.type === 'tool' + n => n.parentId === toolRouterNode.id && TOOL_CONTAINER_CHILD_TYPES.has(n.type || '') ) for (const toolNode of routerChildTools) { - const toolData = toolNode.data as ToolNodeData - const agentToolType: AgentTool['toolType'] = - toolData.toolType === 'http' ? 'http' : - toolData.toolType === 'mcp' ? 'mcp' : 'function' - - const agentTool: AgentTool = { - name: toolData.toolName, - description: toolData.description || `Tool: ${toolData.toolName}`, - toolType: agentToolType, - parameters: toolData.parameterSchema, - } - ;(agentTool as AgentTool & { _toolNodeId?: string })._toolNodeId = toolNode.id - collectedTools.push(agentTool) + collectedTools.push(nodeToAgentTool(toolNode)) } } } } - // Add memory tools to enable LLM access to workflow/global memory - const memoryTools: AgentTool[] = [ - { - name: 'memory_get', - description: 'Retrieve a value from workflow or global memory. Use this to recall information stored in previous workflow executions.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow: data persists across executions of this workflow; global: data shared across all workflows' - }, - namespace: { - type: 'string', - description: 'Namespace to organize related data (e.g., "user_preferences", "session_data")' - }, - key: { - type: 'string', - description: 'The key to retrieve' - } - }, - required: ['scope', 'namespace', 'key'] - } - }, - { - name: 'memory_set', - description: 'Store a value in workflow or global memory for future executions. Use this to remember information across workflow runs.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow: data persists across executions of this workflow; global: data shared across all workflows' - }, - namespace: { - type: 'string', - description: 'Namespace to organize related data (e.g., "user_preferences", "session_data")' - }, - key: { - type: 'string', - description: 'The key to store under' - }, - value: { - type: 'string', - description: 'The value to store (any JSON-serializable data)' - }, - ttl: { - type: 'number', - description: 'Optional: Time-to-live in seconds (for cache mode only)' - } - }, - required: ['scope', 'namespace', 'key', 'value'] - } - }, - { - name: 'memory_delete', - description: 'Delete a value from workflow or global memory.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow or global scope' - }, - namespace: { - type: 'string', - description: 'Namespace containing the key' - }, - key: { - type: 'string', - description: 'The key to delete' - } - }, - required: ['scope', 'namespace', 'key'] - } - }, - { - name: 'memory_list', - description: 'List all keys in a namespace for workflow or global memory.', - toolType: 'function', - parameters: { - type: 'object', - properties: { - scope: { - type: 'string', - enum: ['workflow', 'global'], - description: 'workflow or global scope' - }, - namespace: { - type: 'string', - description: 'Namespace to list keys from' - } - }, - required: ['scope', 'namespace'] - } - } - ] - - // Add memory tools to collected tools + // Add memory tools adapted to the docked memory node's mode (kv/conversation/cache) + const memoryTools = buildMemoryTools(node.id, workflowFile) collectedTools.push(...memoryTools) // Debug: log collected tools @@ -6292,7 +6510,9 @@ Analyze the input above. Return a JSON object: // Tool call found totalToolCalls++ - const toolName = toolCallResult.toolName! + // Normalize tool name: strip 'functions.' prefix that some LLMs add + const rawToolName = toolCallResult.toolName! + const toolName = rawToolName.startsWith('functions.') ? rawToolName.slice('functions.'.length) : rawToolName const toolParams = toolCallResult.toolParameters || {} // Log the tool call with parameters @@ -6642,7 +6862,7 @@ async function callAgentLLM( * actual Tool node using the stored _toolNodeId and _originalToolType. */ async function executeAgentTool( - tool: AgentTool & { _toolNodeId?: string; _originalToolType?: string }, + tool: AgentTool & { _toolNodeId?: string; _originalToolType?: string; _connectionId?: string }, params: Record, context: { nodeOutputs: Record @@ -6911,6 +7131,114 @@ async function executeAgentTool( return { keys, count: keys.length } } + // Conversation memory tools + case 'memory_get_history': { + const conversationId = (params.conversation_id as string) || 'default' + const convKey = `__conv__${conversationId}` + const resolvedScope = scope || 'workflow' + const resolvedNamespace = namespace || '' + + addTraceEntry(trace, { + type: 'debug_step', + nodeId, + nodeName: tool.name, + nodeType: 'agent', + message: `Getting conversation history: ${resolvedScope}:${resolvedNamespace}:${convKey}`, + data: { scope: resolvedScope, namespace: resolvedNamespace, conversationId }, + }, options) + + const stored = await memoryBackend.get(resolvedScope, resolvedNamespace, convKey) + const messages = Array.isArray(stored) ? stored : [] + return { messages, messageCount: messages.length, conversationId } + } + + case 'memory_append': { + const conversationId = (params.conversation_id as string) || 'default' + const convKey = `__conv__${conversationId}` + const role = params.role as string + const content = params.content as string + const resolvedScope = scope || 'workflow' + const resolvedNamespace = namespace || '' + + addTraceEntry(trace, { + type: 'debug_step', + nodeId, + nodeName: tool.name, + nodeType: 'agent', + message: `Appending ${role} message to conversation ${conversationId}`, + data: { scope: resolvedScope, namespace: resolvedNamespace, conversationId, role }, + }, options) + + // Load existing conversation + const stored = await memoryBackend.get(resolvedScope, resolvedNamespace, convKey) + const messages: Array<{ role: string; content: string; timestamp: number }> = Array.isArray(stored) ? stored : [] + + // Append new message + const message = { role, content, timestamp: Date.now() } + messages.push(message) + + // Apply max messages limit if configured via the docked memory node + // The buildMemoryTools function embeds maxMessages in the tool description + // but we also check the docked memory node directly + if (workflowFile) { + const dockedMemoryNode = workflowFile.nodes.find(n => { + const nd = n.data as BaseNodeData + return n.type === 'memory' && + nd.dockedTo?.nodeId === nodeId && + nd.dockedTo?.handleId === 'memory' + }) + if (dockedMemoryNode) { + const memData = dockedMemoryNode.data as MemoryNodeData + const maxMessages = memData.maxMessages ?? 0 + if (maxMessages > 0) { + const includeSystem = memData.includeSystemInWindow ?? true + if (includeSystem) { + while (messages.length > maxMessages) { + messages.shift() + } + } else { + const systemMsgs = messages.filter(m => m.role === 'system') + const nonSystemMsgs = messages.filter(m => m.role !== 'system') + while (nonSystemMsgs.length > maxMessages) { + nonSystemMsgs.shift() + } + // Rebuild preserving order + messages.length = 0 + messages.push(...systemMsgs, ...nonSystemMsgs) + messages.sort((a, b) => a.timestamp - b.timestamp) + } + } + } + } + + // Store back + await memoryBackend.set(resolvedScope, resolvedNamespace, convKey, messages) + return { success: true, conversationId, messageCount: messages.length, appended: message } + } + + case 'memory_clear_history': { + const conversationId = (params.conversation_id as string) || 'default' + const convKey = `__conv__${conversationId}` + const resolvedScope = scope || 'workflow' + const resolvedNamespace = namespace || '' + + addTraceEntry(trace, { + type: 'debug_step', + nodeId, + nodeName: tool.name, + nodeType: 'agent', + message: `Clearing conversation history: ${conversationId}`, + data: { scope: resolvedScope, namespace: resolvedNamespace, conversationId }, + }, options) + + // Get count before clearing + const stored = await memoryBackend.get(resolvedScope, resolvedNamespace, convKey) + const count = Array.isArray(stored) ? stored.length : 0 + + await memoryBackend.delete(resolvedScope, resolvedNamespace, convKey) + return { success: true, conversationId, clearedCount: count } + } + default: throw new Error(`Unknown memory tool: ${tool.name}`) } @@ -6978,6 +7306,7 @@ async function executeAgentTool( ...tool.httpConfig.headers, }, body, + connectionId: (tool as { _connectionId?: string })._connectionId, }, } @@ -7092,6 +7421,97 @@ async function executeAgentTool( return applyOutputTransform(result.result, tool._toolNodeId) } + case 'command': + case 'web-search': + case 'database-query': { + // Route through onToolCall callback for Electron-side execution + if (!options.onToolCall) { + throw new Error(`Tool '${tool.name}' (type: ${tool.toolType}) requires onToolCall callback`) + } + + addTraceEntry(trace, { + type: 'debug_step', + nodeId, + nodeName: tool.name, + nodeType: 'agent', + message: `Executing ${tool.toolType} tool '${tool.name}' via onToolCall`, + data: { toolType: tool.toolType, params }, + }, options) + + const toolCallRequest: ToolCallRequest = { + nodeId, + toolName: tool.name, + toolType: tool.toolType as ToolCallRequest['toolType'], + parameters: params, + } + + // Add type-specific config from the source tool node + if (tool._toolNodeId && workflowFile) { + const toolNode = workflowFile.nodes.find(n => n.id === tool._toolNodeId) + if (toolNode) { + if (tool.toolType === 'command') { + const toolData = toolNode.data as ToolNodeData + let commandArgs = toolData.commandArgs || '' + for (const [key, value] of Object.entries(params)) { + commandArgs = commandArgs.replace(new RegExp(`\\{\\{\\s*${key}\\s*\\}\\}`, 'g'), String(value)) + } + toolCallRequest.commandConfig = { + executable: toolData.commandExecutable || '', + args: commandArgs, + cwd: toolData.commandCwd, + requiresApproval: toolData.commandRequiresApproval, + } + } else if (tool.toolType === 'web-search') { + const toolData = toolNode.data as WebSearchNodeData + const baseData = toolNode.data as BaseNodeData + // LLM sends query via params (e.g. { query: "...", input: "..." }) + const searchQuery = (params.query as string) || (params.input as string) || (params.search_query as string) || '' + toolCallRequest.webSearchConfig = { + query: searchQuery, + resultCount: toolData.resultCount || 5, + // Pass inline config if set, otherwise pass connectionId for resolution + connectionConfig: toolData.provider ? { + provider: toolData.provider, + apiKey: toolData.apiKey, + instanceUrl: toolData.instanceUrl, + } : undefined, + connectionId: baseData.connectionId, + } + } else if (tool.toolType === 'database-query') { + const toolData = toolNode.data as DatabaseQueryNodeData + // LLM may override query via params, otherwise use node's configured query + const query = (params.query as string) || toolData.query || '' + toolCallRequest.databaseConfig = { + connectionId: toolData.connectionId, + queryType: toolData.queryType || 'select', + query, + parameters: (params.parameters as string) || toolData.parameters, + collection: (params.collection as string) || toolData.collection, + maxRows: toolData.maxRows, + timeoutMs: toolData.timeoutMs, + } + } + } + } + + const result = await options.onToolCall(toolCallRequest) + + if (!result.success) { + throw new Error(result.error || `Tool '${tool.name}' execution failed`) + } + + addTraceEntry(trace, { + type: 'debug_step', + nodeId, + nodeName: tool.name, + nodeType: 'agent', + message: `${tool.toolType} tool '${tool.name}' completed`, + data: { success: result.success, output: result.result }, + }, options) + + return applyOutputTransform(result.result, tool._toolNodeId) + } + case 'workflow': { // Workflow tools are not yet supported in agent context throw new Error(`Workflow tools are not yet supported in agent nodes. Tool: ${tool.name}`) diff --git a/typescript/src/lib/workflowTypes.ts b/typescript/src/lib/workflowTypes.ts index a60a3c2..962804f 100644 --- a/typescript/src/lib/workflowTypes.ts +++ b/typescript/src/lib/workflowTypes.ts @@ -1832,7 +1832,7 @@ export interface AgentTool { } /** How this tool is executed */ - toolType: 'function' | 'http' | 'mcp' | 'workflow' | 'command' | 'code' + toolType: 'function' | 'http' | 'mcp' | 'workflow' | 'command' | 'code' | 'web-search' | 'database-query' /** For HTTP tools */ httpConfig?: {