mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-27 16:28:15 -05:00
Compare commits
6 Commits
binary-npx
...
twishabans
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8f47ce4f8 | ||
|
|
3aa1b79c13 | ||
|
|
09f21ad5b8 | ||
|
|
d8ae1f257c | ||
|
|
58b5c9951c | ||
|
|
941ed689b4 |
@@ -23,6 +23,13 @@ To connect to the database to explore and query data, search the MCP store for t
|
||||
|
||||
In the Antigravity MCP Store, click the "Install" button.
|
||||
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt alloydb-postgres-admin```.
|
||||
|
||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -62,7 +69,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"alloydb-admin": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "alloydb-postgres-admin", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "alloydb-postgres-admin", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@ For AlloyDB infrastructure management, search the MCP store for the AlloyDB for
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt alloydb-postgres```.
|
||||
|
||||
2. Add the required inputs for your [cluster](https://docs.cloud.google.com/alloydb/docs/cluster-list) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -83,7 +89,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"alloydb-postgres": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "alloydb-postgres", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "alloydb-postgres", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ An editor configured to use the BigQuery MCP server can use its AI capabilities
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt bigquery```.
|
||||
|
||||
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -78,7 +84,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"bigquery": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "bigquery", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "bigquery", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ To connect to the database to explore and query data, search the MCP store for t
|
||||
|
||||
In the Antigravity MCP Store, click the "Install" button.
|
||||
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mssql-admin```.
|
||||
|
||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -59,7 +66,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-sqlserver-admin": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mssql-admin", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mssql-admin", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,12 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mssql```.
|
||||
|
||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/sqlserver/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -70,7 +76,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-mssql": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mssql", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mssql", "--stdio"],
|
||||
"env": {
|
||||
"CLOUD_SQL_MSSQL_PROJECT": "your-project-id",
|
||||
"CLOUD_SQL_MSSQL_REGION": "your-region",
|
||||
|
||||
@@ -23,6 +23,13 @@ To connect to the database to explore and query data, search the MCP store for t
|
||||
|
||||
In the Antigravity MCP Store, click the "Install" button.
|
||||
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mysql-admin```.
|
||||
|
||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -58,7 +65,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-mysql-admin": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mysql-admin", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mysql-admin", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-mysql```.
|
||||
|
||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/mysql/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -76,7 +82,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-mysql": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-mysql", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-mysql", "--stdio"],
|
||||
"env": {
|
||||
"CLOUD_SQL_MYSQL_PROJECT": "your-project-id",
|
||||
"CLOUD_SQL_MYSQL_REGION": "your-region",
|
||||
|
||||
@@ -23,6 +23,13 @@ To connect to the database to explore and query data, search the MCP store for t
|
||||
|
||||
In the Antigravity MCP Store, click the "Install" button.
|
||||
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-postgres-admin```.
|
||||
|
||||
You'll now be able to see all enabled tools in the "Tools" tab.
|
||||
|
||||
> [!NOTE]
|
||||
@@ -58,7 +65,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-postgres-admin": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-postgres-admin", "--stdio"]
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-postgres-admin", "--stdio"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ For Cloud SQL infrastructure management, search the MCP store for the Cloud SQL
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt cloud-sql-postgres```.
|
||||
|
||||
2. Add the required inputs for your [instance](https://cloud.google.com/sql/docs/postgres/instance-info) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -88,7 +94,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"cloud-sql-postgres": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "cloud-sql-postgres", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "cloud-sql-postgres", "--stdio"],
|
||||
"env": {
|
||||
"CLOUD_SQL_POSTGRES_PROJECT": "your-project-id",
|
||||
"CLOUD_SQL_POSTGRES_REGION": "your-region",
|
||||
|
||||
@@ -20,6 +20,12 @@ An editor configured to use the Dataplex MCP server can use its AI capabilities
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt dataplex```.
|
||||
|
||||
2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -60,7 +66,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"dataplex": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "dataplex", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "dataplex", "--stdio"],
|
||||
"env": {
|
||||
"DATAPLEX_PROJECT": "your-project-id"
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ An editor configured to use the Looker MCP server can use its AI capabilities to
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt looker```.
|
||||
|
||||
2. Add the required inputs for your [instance](https://docs.cloud.google.com/looker/docs/set-up-and-administer-looker) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -76,7 +82,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"looker": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "looker", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "looker", "--stdio"],
|
||||
"env": {
|
||||
"LOOKER_BASE_URL": "https://your.looker.instance.com",
|
||||
"LOOKER_CLIENT_ID": "your-client-id",
|
||||
|
||||
@@ -21,6 +21,12 @@ An editor configured to use the Cloud Spanner MCP server can use its AI capabili
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the "Install" button.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version> --prebuilt spanner```.
|
||||
|
||||
2. Add the required inputs for your [instance](https://docs.cloud.google.com/spanner/docs/instances) in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.
|
||||
|
||||
@@ -66,7 +72,7 @@ Add the following configuration to your MCP client (e.g., `settings.json` for Ge
|
||||
"mcpServers": {
|
||||
"spanner": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--prebuilt", "spanner", "--stdio"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--prebuilt", "spanner", "--stdio"],
|
||||
"env": {
|
||||
"SPANNER_PROJECT": "your-project-id",
|
||||
"SPANNER_INSTANCE": "your-instance-id",
|
||||
|
||||
@@ -12,10 +12,16 @@ The MCP Toolbox for Databases Server gives AI-powered development tools the abil
|
||||
## Install & Configuration
|
||||
|
||||
1. In the Antigravity MCP Store, click the **Install** button. A configuration window will appear.
|
||||
> [!NOTE]
|
||||
> Installation automatically uses the latest
|
||||
> [toolbox server package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
> This keeps you up-to-date, but if you need a specific version, you can
|
||||
> run the server manually with command
|
||||
> ```npx -y @toolbox-sdk/server@<version>```.
|
||||
|
||||
2. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
|
||||
3. Create your [`tools.yaml` configuration file](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
|
||||
|
||||
3. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
|
||||
4. In the configuration window, enter the full absolute path to your `tools.yaml` file and click **Save**.
|
||||
|
||||
> [!NOTE]
|
||||
> If you encounter issues with Windows Defender blocking the execution, you may need to configure an allowlist. See [Configure exclusions for Microsoft Defender Antivirus](https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-exclusions-microsoft-defender-antivirus?view=o365-worldwide) for more details.
|
||||
@@ -31,7 +37,7 @@ Interact with your custom tools using natural language.
|
||||
"mcpServers": {
|
||||
"mcp-toolbox": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "@toolbox-sdk/server", "--tools-file", "your-tool-file.yaml"],
|
||||
"args": ["-y", "@toolbox-sdk/server@latest", "--tools-file", "your-tool-file.yaml"],
|
||||
"env": {
|
||||
"ENV_VAR_NAME": "ENV_VAR_VALUE",
|
||||
}
|
||||
|
||||
@@ -24,12 +24,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@dabh/diagnostics": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
|
||||
"integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
|
||||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.8.tgz",
|
||||
"integrity": "sha512-R4MSXTVnuMzGD7bzHdW2ZhhdPC/igELENcq5IjEverBvq5hn1SXCWcsi6eSsdWP0/Ur+SItRRjAktmdoX/8R/Q==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"colorspace": "1.1.x",
|
||||
"@so-ric/colorspace": "^1.1.6",
|
||||
"enabled": "2.0.x",
|
||||
"kuler": "^2.0.0"
|
||||
}
|
||||
@@ -578,9 +579,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@google-cloud/firestore": {
|
||||
"version": "7.11.3",
|
||||
"resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.3.tgz",
|
||||
"integrity": "sha512-qsM3/WHpawF07SRVvEJJVRwhYzM7o9qtuksyuqnrMig6fxIrwWnsezECWsG/D5TyYru51Fv5c/RTqNDQ2yU+4w==",
|
||||
"version": "7.11.6",
|
||||
"resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.11.6.tgz",
|
||||
"integrity": "sha512-EW/O8ktzwLfyWBOsNuhRoMi8lrC3clHM5LVFhGvO1HCsLozCOOXRAlHrYBoE6HL42Sc8yYMuCb2XqcnJ4OOEpw==",
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
@@ -2887,6 +2889,17 @@
|
||||
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
|
||||
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
|
||||
},
|
||||
"node_modules/@so-ric/colorspace": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@so-ric/colorspace/-/colorspace-1.1.6.tgz",
|
||||
"integrity": "sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"color": "^5.0.2",
|
||||
"text-hex": "1.0.x"
|
||||
}
|
||||
},
|
||||
"node_modules/@toolbox-sdk/core": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/core/-/core-0.1.2.tgz",
|
||||
@@ -3515,38 +3528,53 @@
|
||||
}
|
||||
},
|
||||
"node_modules/color": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
|
||||
"integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-5.0.3.tgz",
|
||||
"integrity": "sha512-ezmVcLR3xAVp8kYOm4GS45ZLLgIE6SPAFoduLr6hTDajwb3KZ2F46gulK3XpcwRFb5KKGCSezCBAY4Dw4HsyXA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.3",
|
||||
"color-string": "^1.6.0"
|
||||
"color-convert": "^3.1.3",
|
||||
"color-string": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.3.tgz",
|
||||
"integrity": "sha512-fasDH2ont2GqF5HpyO4w0+BcewlhHEZOFn9c1ckZdHpJ56Qb7MHhH/IcJZbBGgvdtwdwNbLvxiBEdg336iA9Sg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"color-name": "1.1.3"
|
||||
"color-name": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.6"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"optional": true
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-2.1.0.tgz",
|
||||
"integrity": "sha512-1bPaDNFm0axzE4MEAzKPuqKWeRaT43U/hyxKPBdqTfmPF+d6n7FSoTFxLVULUJOmiLp01KjhIPPH+HrXZJN4Rg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
}
|
||||
},
|
||||
"node_modules/color-string": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
|
||||
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-string/-/color-string-2.1.4.tgz",
|
||||
"integrity": "sha512-Bb6Cq8oq0IjDOe8wJmi4JeNn763Xs9cfrBcaylK1tPypWzyoy2G3l90v9k64kjphl/ZJjPIShFztenRomi8WTg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"color-name": "^1.0.0",
|
||||
"simple-swizzle": "^0.2.2"
|
||||
"color-name": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/colorette": {
|
||||
@@ -3554,16 +3582,6 @@
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
||||
},
|
||||
"node_modules/colorspace": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
|
||||
"integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"color": "^3.1.3",
|
||||
"text-hex": "1.0.x"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
@@ -4968,12 +4986,6 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-arrayish": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.16.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
|
||||
@@ -5114,13 +5126,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jsonwebtoken/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==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"jwa": "^1.4.1",
|
||||
"jwa": "^1.4.2",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
@@ -5153,11 +5166,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jws": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
|
||||
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
|
||||
"integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^2.0.0",
|
||||
"jwa": "^2.0.1",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
@@ -5424,9 +5438,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz",
|
||||
"integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==",
|
||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -6038,15 +6053,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
"integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"is-arrayish": "^0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
@@ -6233,6 +6239,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
|
||||
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/thriftrw": {
|
||||
@@ -6416,13 +6423,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/winston": {
|
||||
"version": "3.17.0",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz",
|
||||
"integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==",
|
||||
"version": "3.19.0",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.19.0.tgz",
|
||||
"integrity": "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@colors/colors": "^1.6.0",
|
||||
"@dabh/diagnostics": "^2.0.2",
|
||||
"@dabh/diagnostics": "^2.0.8",
|
||||
"async": "^3.2.3",
|
||||
"is-stream": "^2.0.0",
|
||||
"logform": "^2.7.0",
|
||||
|
||||
@@ -27,7 +27,7 @@ description: >
|
||||
| | `--ui` | Launches the Toolbox UI web server. | |
|
||||
| | `--allowed-origins` | Specifies a list of origins permitted to access this server for CORs access. | `*` |
|
||||
| | `--allowed-hosts` | Specifies a list of hosts permitted to access this server to prevent DNS rebinding attacks. | `*` |
|
||||
| | `--user-agent-extra` | Appends additional metadata to the User-Agent. | |
|
||||
| | `--user-agent-metadata` | Appends additional metadata to the User-Agent. | |
|
||||
| `-v` | `--version` | version for toolbox | |
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
cd server-darwin-arm64
|
||||
npm pack .
|
||||
npm publish --access public
|
||||
|
||||
cd ../server-darwin-x64
|
||||
npm pack .
|
||||
npm publish --access public
|
||||
|
||||
cd ../server-linux-x64
|
||||
npm pack .
|
||||
npm publish --access public
|
||||
|
||||
cd ../server-win32-x64
|
||||
npm pack .
|
||||
npm publish --access public
|
||||
|
||||
cd ..
|
||||
@@ -1,7 +0,0 @@
|
||||
cd server
|
||||
npm install --package-lock-only
|
||||
git add package.json package-lock.json
|
||||
git commit -m "update dep versions"
|
||||
|
||||
npm pack .
|
||||
npm publish --access public
|
||||
@@ -1,6 +0,0 @@
|
||||
# @toolbox-sdk/server-darwin-arm64
|
||||
|
||||
Platform-specific binary for the `toolbox` package on Darwin arm64.
|
||||
This package is automatically installed by the main `@toolbox-sdk/server` package and is not intended to be installed directly.
|
||||
|
||||
For more information, visit the [toolbox npm package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
19
packages/server-darwin-arm64/package-lock.json
generated
19
packages/server-darwin-arm64/package-lock.json
generated
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-darwin-arm64",
|
||||
"version": "0.26.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@toolbox-sdk/server-darwin-arm64",
|
||||
"version": "0.26.0",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-darwin-arm64",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Google LLC",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"main": "bin/toolbox",
|
||||
"repository": "googleapis/genai-toolbox",
|
||||
"scripts": {
|
||||
"prepack": "node scripts/downloadBinary.js darwin arm64"
|
||||
},
|
||||
"files": [
|
||||
"bin/toolbox"
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// 1. Configuration
|
||||
const PLATFORM_MAP = {
|
||||
'linux': 'linux',
|
||||
'darwin': 'darwin',
|
||||
'win32': 'windows'
|
||||
};
|
||||
|
||||
const ARCH_MAP = {
|
||||
'x64': 'amd64',
|
||||
'arm64': 'arm64'
|
||||
};
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length < 2) {
|
||||
console.error("Usage: node download-binary.js <platform> <arch>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const [targetPlatform, targetArch] = args;
|
||||
|
||||
// 2. Determine Version
|
||||
const version = fs.readFileSync(path.join(process.cwd(), 'version.txt'), 'utf8').trim();
|
||||
|
||||
// 3. Construct URL
|
||||
const gcsPlatform = PLATFORM_MAP[targetPlatform];
|
||||
const gcsArch = ARCH_MAP[targetArch];
|
||||
|
||||
if (!gcsPlatform || !gcsArch) {
|
||||
console.error(`Unsupported platform/arch: ${targetPlatform}/${targetArch}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const extension = targetPlatform === 'win32' ? '.exe' : '';
|
||||
const binaryName = `toolbox${extension}`;
|
||||
const url = `https://storage.googleapis.com/genai-toolbox/v${version}/${gcsPlatform}/${gcsArch}/${binaryName}`;
|
||||
|
||||
// 4. Prepare Output
|
||||
const binDir = path.join(process.cwd(), 'bin');
|
||||
if (!fs.existsSync(binDir)) {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
}
|
||||
const destPath = path.join(binDir, binaryName);
|
||||
|
||||
if (fs.existsSync(destPath)) {
|
||||
console.log(`[Skipped] Binary already exists at ${destPath}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log(`[Prepack] Downloading ${binaryName} for ${targetPlatform}/${targetArch}...`);
|
||||
console.log(`[Source] ${url}`);
|
||||
|
||||
// 5. Download Function
|
||||
const file = fs.createWriteStream(destPath);
|
||||
https.get(url, function(response) {
|
||||
if (response.statusCode !== 200) {
|
||||
console.error(`❌ Failed to download. Status Code: ${response.statusCode}`);
|
||||
fs.unlink(destPath, () => {}); // Delete partial file
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
response.pipe(file);
|
||||
|
||||
file.on('finish', () => {
|
||||
file.close(() => {
|
||||
// 6. Make executable (Unix only)
|
||||
if (targetPlatform !== 'win32') {
|
||||
try {
|
||||
execSync(`chmod +x "${destPath}"`);
|
||||
} catch (err) {
|
||||
console.warn("⚠️ Could not set executable permissions (chmod failed).");
|
||||
}
|
||||
}
|
||||
console.log(`✅ Success! Binary saved to ${destPath}`);
|
||||
});
|
||||
});
|
||||
}).on('error', function(err) {
|
||||
fs.unlink(destPath, () => {});
|
||||
console.error(`❌ Download Error: ${err.message}`);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
0.26.0
|
||||
@@ -1,6 +0,0 @@
|
||||
# @toolbox-sdk/server-darwin-x64
|
||||
|
||||
Platform-specific binary for the `toolbox` package on Darwin x64.
|
||||
This package is automatically installed by the main `@toolbox-sdk/server` package and is not intended to be installed directly.
|
||||
|
||||
For more information, visit the [toolbox npm package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
19
packages/server-darwin-x64/package-lock.json
generated
19
packages/server-darwin-x64/package-lock.json
generated
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-darwin-x64",
|
||||
"version": "0.26.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@toolbox-sdk/server-darwin-x64",
|
||||
"version": "0.26.0",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-darwin-x64",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Google LLC",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "bin/toolbox",
|
||||
"repository": "googleapis/genai-toolbox",
|
||||
"scripts": {
|
||||
"prepack": "node scripts/downloadBinary.js darwin x64"
|
||||
},
|
||||
"files": [
|
||||
"bin/toolbox"
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// 1. Configuration
|
||||
const PLATFORM_MAP = {
|
||||
'linux': 'linux',
|
||||
'darwin': 'darwin',
|
||||
'win32': 'windows'
|
||||
};
|
||||
|
||||
const ARCH_MAP = {
|
||||
'x64': 'amd64',
|
||||
'arm64': 'arm64'
|
||||
};
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length < 2) {
|
||||
console.error("Usage: node download-binary.js <platform> <arch>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const [targetPlatform, targetArch] = args;
|
||||
|
||||
// 2. Determine Version
|
||||
const version = fs.readFileSync(path.join(process.cwd(), 'version.txt'), 'utf8').trim();
|
||||
|
||||
// 3. Construct URL
|
||||
const gcsPlatform = PLATFORM_MAP[targetPlatform];
|
||||
const gcsArch = ARCH_MAP[targetArch];
|
||||
|
||||
if (!gcsPlatform || !gcsArch) {
|
||||
console.error(`Unsupported platform/arch: ${targetPlatform}/${targetArch}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const extension = targetPlatform === 'win32' ? '.exe' : '';
|
||||
const binaryName = `toolbox${extension}`;
|
||||
const url = `https://storage.googleapis.com/genai-toolbox/v${version}/${gcsPlatform}/${gcsArch}/${binaryName}`;
|
||||
|
||||
// 4. Prepare Output
|
||||
const binDir = path.join(process.cwd(), 'bin');
|
||||
if (!fs.existsSync(binDir)) {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
}
|
||||
const destPath = path.join(binDir, binaryName);
|
||||
|
||||
if (fs.existsSync(destPath)) {
|
||||
console.log(`[Skipped] Binary already exists at ${destPath}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log(`[Prepack] Downloading ${binaryName} for ${targetPlatform}/${targetArch}...`);
|
||||
console.log(`[Source] ${url}`);
|
||||
|
||||
// 5. Download Function
|
||||
const file = fs.createWriteStream(destPath);
|
||||
https.get(url, function(response) {
|
||||
if (response.statusCode !== 200) {
|
||||
console.error(`❌ Failed to download. Status Code: ${response.statusCode}`);
|
||||
fs.unlink(destPath, () => {}); // Delete partial file
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
response.pipe(file);
|
||||
|
||||
file.on('finish', () => {
|
||||
file.close(() => {
|
||||
// 6. Make executable (Unix only)
|
||||
if (targetPlatform !== 'win32') {
|
||||
try {
|
||||
execSync(`chmod +x "${destPath}"`);
|
||||
} catch (err) {
|
||||
console.warn("⚠️ Could not set executable permissions (chmod failed).");
|
||||
}
|
||||
}
|
||||
console.log(`✅ Success! Binary saved to ${destPath}`);
|
||||
});
|
||||
});
|
||||
}).on('error', function(err) {
|
||||
fs.unlink(destPath, () => {});
|
||||
console.error(`❌ Download Error: ${err.message}`);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
0.26.0
|
||||
@@ -1,7 +0,0 @@
|
||||
# @toolbox-sdk/server-linux-x64
|
||||
|
||||
Platform-specific binary for the `toolbox` package on Linux x64.
|
||||
This package is automatically installed by the main `@toolbox-sdk/server` package and is not intended to be installed directly.
|
||||
|
||||
For more information, visit the [toolbox npm package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
|
||||
19
packages/server-linux-x64/package-lock.json
generated
19
packages/server-linux-x64/package-lock.json
generated
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-linux-x64",
|
||||
"version": "0.26.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@toolbox-sdk/server-linux-x64",
|
||||
"version": "0.26.0",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-linux-x64",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Google LLC",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "bin/toolbox",
|
||||
"repository": "googleapis/genai-toolbox",
|
||||
"scripts": {
|
||||
"prepack": "node scripts/downloadBinary.js linux x64"
|
||||
},
|
||||
"files": [
|
||||
"bin/toolbox"
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// 1. Configuration
|
||||
const PLATFORM_MAP = {
|
||||
'linux': 'linux',
|
||||
'darwin': 'darwin',
|
||||
'win32': 'windows'
|
||||
};
|
||||
|
||||
const ARCH_MAP = {
|
||||
'x64': 'amd64',
|
||||
'arm64': 'arm64'
|
||||
};
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length < 2) {
|
||||
console.error("Usage: node download-binary.js <platform> <arch>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const [targetPlatform, targetArch] = args;
|
||||
|
||||
// 2. Determine Version
|
||||
const version = fs.readFileSync(path.join(process.cwd(), 'version.txt'), 'utf8').trim();
|
||||
|
||||
// 3. Construct URL
|
||||
const gcsPlatform = PLATFORM_MAP[targetPlatform];
|
||||
const gcsArch = ARCH_MAP[targetArch];
|
||||
|
||||
if (!gcsPlatform || !gcsArch) {
|
||||
console.error(`Unsupported platform/arch: ${targetPlatform}/${targetArch}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const extension = targetPlatform === 'win32' ? '.exe' : '';
|
||||
const binaryName = `toolbox${extension}`;
|
||||
const url = `https://storage.googleapis.com/genai-toolbox/v${version}/${gcsPlatform}/${gcsArch}/${binaryName}`;
|
||||
|
||||
// 4. Prepare Output
|
||||
const binDir = path.join(process.cwd(), 'bin');
|
||||
if (!fs.existsSync(binDir)) {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
}
|
||||
const destPath = path.join(binDir, binaryName);
|
||||
|
||||
if (fs.existsSync(destPath)) {
|
||||
console.log(`[Skipped] Binary already exists at ${destPath}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log(`[Prepack] Downloading ${binaryName} for ${targetPlatform}/${targetArch}...`);
|
||||
console.log(`[Source] ${url}`);
|
||||
|
||||
// 5. Download Function
|
||||
const file = fs.createWriteStream(destPath);
|
||||
https.get(url, function(response) {
|
||||
if (response.statusCode !== 200) {
|
||||
console.error(`❌ Failed to download. Status Code: ${response.statusCode}`);
|
||||
fs.unlink(destPath, () => {}); // Delete partial file
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
response.pipe(file);
|
||||
|
||||
file.on('finish', () => {
|
||||
file.close(() => {
|
||||
// 6. Make executable (Unix only)
|
||||
if (targetPlatform !== 'win32') {
|
||||
try {
|
||||
execSync(`chmod +x "${destPath}"`);
|
||||
} catch (err) {
|
||||
console.warn("⚠️ Could not set executable permissions (chmod failed).");
|
||||
}
|
||||
}
|
||||
console.log(`✅ Success! Binary saved to ${destPath}`);
|
||||
});
|
||||
});
|
||||
}).on('error', function(err) {
|
||||
fs.unlink(destPath, () => {});
|
||||
console.error(`❌ Download Error: ${err.message}`);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
0.26.0
|
||||
@@ -1,7 +0,0 @@
|
||||
# @toolbox-sdk/server-win32-x64
|
||||
|
||||
Platform-specific binary for the `toolbox` package on Windows x64.
|
||||
This package is automatically installed by the main `@toolbox-sdk/server` package and is not intended to be installed directly.
|
||||
|
||||
For more information, visit the [toolbox npm package](https://www.npmjs.com/package/@toolbox-sdk/server).
|
||||
|
||||
19
packages/server-win32-x64/package-lock.json
generated
19
packages/server-win32-x64/package-lock.json
generated
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-win32-x64",
|
||||
"version": "0.26.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@toolbox-sdk/server-win32-x64",
|
||||
"version": "0.26.0",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server-win32-x64",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Google LLC",
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "bin/toolbox.exe",
|
||||
"repository": "googleapis/genai-toolbox",
|
||||
"scripts": {
|
||||
"prepack": "node scripts/downloadBinary.js win32 x64"
|
||||
},
|
||||
"files": [
|
||||
"bin/toolbox.exe"
|
||||
]
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// 1. Configuration
|
||||
const PLATFORM_MAP = {
|
||||
'linux': 'linux',
|
||||
'darwin': 'darwin',
|
||||
'win32': 'windows'
|
||||
};
|
||||
|
||||
const ARCH_MAP = {
|
||||
'x64': 'amd64',
|
||||
'arm64': 'arm64'
|
||||
};
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
if (args.length < 2) {
|
||||
console.error("Usage: node download-binary.js <platform> <arch>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const [targetPlatform, targetArch] = args;
|
||||
|
||||
// 2. Determine Version
|
||||
const version = fs.readFileSync(path.join(process.cwd(), 'version.txt'), 'utf8').trim();
|
||||
|
||||
// 3. Construct URL
|
||||
const gcsPlatform = PLATFORM_MAP[targetPlatform];
|
||||
const gcsArch = ARCH_MAP[targetArch];
|
||||
|
||||
if (!gcsPlatform || !gcsArch) {
|
||||
console.error(`Unsupported platform/arch: ${targetPlatform}/${targetArch}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const extension = targetPlatform === 'win32' ? '.exe' : '';
|
||||
const binaryName = `toolbox${extension}`;
|
||||
const url = `https://storage.googleapis.com/genai-toolbox/v${version}/${gcsPlatform}/${gcsArch}/${binaryName}`;
|
||||
|
||||
// 4. Prepare Output
|
||||
const binDir = path.join(process.cwd(), 'bin');
|
||||
if (!fs.existsSync(binDir)) {
|
||||
fs.mkdirSync(binDir, { recursive: true });
|
||||
}
|
||||
const destPath = path.join(binDir, binaryName);
|
||||
|
||||
if (fs.existsSync(destPath)) {
|
||||
console.log(`[Skipped] Binary already exists at ${destPath}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log(`[Prepack] Downloading ${binaryName} for ${targetPlatform}/${targetArch}...`);
|
||||
console.log(`[Source] ${url}`);
|
||||
|
||||
// 5. Download Function
|
||||
const file = fs.createWriteStream(destPath);
|
||||
https.get(url, function(response) {
|
||||
if (response.statusCode !== 200) {
|
||||
console.error(`❌ Failed to download. Status Code: ${response.statusCode}`);
|
||||
fs.unlink(destPath, () => {}); // Delete partial file
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
response.pipe(file);
|
||||
|
||||
file.on('finish', () => {
|
||||
file.close(() => {
|
||||
// 6. Make executable (Unix only)
|
||||
if (targetPlatform !== 'win32') {
|
||||
try {
|
||||
execSync(`chmod +x "${destPath}"`);
|
||||
} catch (err) {
|
||||
console.warn("⚠️ Could not set executable permissions (chmod failed).");
|
||||
}
|
||||
}
|
||||
console.log(`✅ Success! Binary saved to ${destPath}`);
|
||||
});
|
||||
});
|
||||
}).on('error', function(err) {
|
||||
fs.unlink(destPath, () => {});
|
||||
console.error(`❌ Download Error: ${err.message}`);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
0.26.0
|
||||
@@ -1,69 +0,0 @@
|
||||
# Toolbox
|
||||
|
||||
A CLI tool for running a toolbox server.
|
||||
|
||||
## Installation
|
||||
|
||||
You can install the toolbox globally:
|
||||
|
||||
```bash
|
||||
npm install -g @toolbox-sdk/server
|
||||
```
|
||||
|
||||
Or run it directly using npx:
|
||||
|
||||
```bash
|
||||
npx @toolbox-sdk/server
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The toolbox requires a `tools.yaml` file in the current working directory to define sources, tools, and prompts.
|
||||
|
||||
### Example `tools.yaml`
|
||||
|
||||
```yaml
|
||||
sources:
|
||||
my-pg-source:
|
||||
kind: postgres
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
database: toolbox_db
|
||||
user: postgres
|
||||
password: password
|
||||
tools:
|
||||
search-hotels-by-name:
|
||||
kind: postgres-sql
|
||||
source: my-pg-source
|
||||
description: Search for hotels based on name.
|
||||
parameters:
|
||||
- name: name
|
||||
type: string
|
||||
description: The name of the hotel.
|
||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||
prompts:
|
||||
code-review:
|
||||
description: "Asks the LLM to analyze code quality and suggest improvements."
|
||||
messages:
|
||||
- role: "user"
|
||||
content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
||||
arguments:
|
||||
- name: "code"
|
||||
description: "The code to review"
|
||||
required: true
|
||||
```
|
||||
|
||||
To learn more on how to configure your toolbox, visit the [official docsite](https://googleapis.github.io/genai-toolbox/getting-started/configure/).
|
||||
|
||||
## Platform Support
|
||||
|
||||
The toolbox automatically handles platform-specific binaries. Supported platforms include:
|
||||
- macOS (arm64, x64)
|
||||
- Linux (x64)
|
||||
- Windows (x64)
|
||||
|
||||
## Resources
|
||||
|
||||
For more information, visit the
|
||||
- [MCP Toolbox repository](https://github.com/googleapis/genai-toolbox)
|
||||
- [Official Documentation](https://googleapis.github.io/genai-toolbox/getting-started/introduction/)
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const { spawn } = require('child_process');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
|
||||
const PLATFORMS = {
|
||||
'darwin-arm64': '@toolbox-sdk/server-darwin-arm64',
|
||||
'darwin-x64': '@toolbox-sdk/server-darwin-x64',
|
||||
'linux-x64': '@toolbox-sdk/server-linux-x64',
|
||||
'win32-x64': '@toolbox-sdk/server-win32-x64'
|
||||
};
|
||||
|
||||
const currentKey = `${os.platform()}-${os.arch()}`;
|
||||
const pkgName = PLATFORMS[currentKey];
|
||||
|
||||
if (!pkgName) {
|
||||
console.error(`Unsupported platform: ${currentKey}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let binPath;
|
||||
try {
|
||||
const pkgJsonPath = require.resolve(`${pkgName}/package.json`);
|
||||
const pkgDir = path.dirname(pkgJsonPath);
|
||||
const binName = os.platform() === 'win32' ? 'toolbox.exe' : 'toolbox';
|
||||
binPath = path.join(pkgDir, 'bin', binName);
|
||||
} catch (e) {
|
||||
console.error(`Binary for ${currentKey} not found. Installation failed?`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (os.platform() !== 'win32') {
|
||||
try {
|
||||
fs.chmodSync(binPath, 0o755);
|
||||
if (os.platform() === 'darwin') {
|
||||
const { execSync } = require('child_process');
|
||||
try {
|
||||
execSync(`xattr -d com.apple.quarantine "${binPath}"`, { stdio: 'ignore' });
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`Could not set execute permissions on ${binPath}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
spawn(binPath, process.argv.slice(2), { stdio: 'inherit' })
|
||||
.on('exit', process.exit);
|
||||
74
packages/server/package-lock.json
generated
74
packages/server/package-lock.json
generated
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server",
|
||||
"version": "0.26.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@toolbox-sdk/server",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"toolbox": "bin/run.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@toolbox-sdk/server-darwin-arm64": "0.26.0",
|
||||
"@toolbox-sdk/server-darwin-x64": "0.26.0",
|
||||
"@toolbox-sdk/server-linux-x64": "0.26.0",
|
||||
"@toolbox-sdk/server-win32-x64": "0.26.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@toolbox-sdk/server-darwin-arm64": {
|
||||
"version": "0.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/server-darwin-arm64/-/server-darwin-arm64-0.26.0.tgz",
|
||||
"integrity": "sha512-NvyTc/PtRYM9QRpgxLeQNAPUD9dbwbyFzLiS/haaqAKrLdYBTmDiN5eJ8GwWyO3mhCEUqbneuY8J/9V8Vs0VWg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@toolbox-sdk/server-darwin-x64": {
|
||||
"version": "0.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/server-darwin-x64/-/server-darwin-x64-0.26.0.tgz",
|
||||
"integrity": "sha512-ThYS3iEx6C8Obn7CgD5N8raAXFe7WnU39cjgD9GnLWlodQ+PYXKponWOgZVjqYyfVorPbQ53XOU0pXomb5xIUQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@toolbox-sdk/server-linux-x64": {
|
||||
"version": "0.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/server-linux-x64/-/server-linux-x64-0.26.0.tgz",
|
||||
"integrity": "sha512-nLDH5uXEpCJK4hJA4Z880kT87SAy0Y6Ql60n7myKKZalIpkPTKay8Fai2puSk+LXU249mv1jP9fQlCNEIdgG5Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@toolbox-sdk/server-win32-x64": {
|
||||
"version": "0.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@toolbox-sdk/server-win32-x64/-/server-win32-x64-0.26.0.tgz",
|
||||
"integrity": "sha512-sez/lrIUvoh2pN9BIruYMohfACGNgVF42Wze0+57ub3bMKl5d2aE8dtMJOneedLyF/3i729KVWuNUDSfE2ni8w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "@toolbox-sdk/server",
|
||||
"version": "0.26.0",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Google LLC",
|
||||
"bin": {
|
||||
"toolbox": "./bin/run.js"
|
||||
},
|
||||
"files": [
|
||||
"bin/run.js"
|
||||
],
|
||||
"repository": "googleapis/genai-toolbox",
|
||||
"optionalDependencies": {
|
||||
"@toolbox-sdk/server-darwin-arm64": "0.26.0",
|
||||
"@toolbox-sdk/server-darwin-x64": "0.26.0",
|
||||
"@toolbox-sdk/server-linux-x64": "0.26.0",
|
||||
"@toolbox-sdk/server-win32-x64": "0.26.0"
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
# How to test on different platforms
|
||||
|
||||
1. Create a local test registry. We are using Verdaccio. During the actual process, we publish to npm instead.
|
||||
```sh
|
||||
# install
|
||||
npm install -g verdaccio
|
||||
|
||||
# start server
|
||||
verdaccio
|
||||
```
|
||||
|
||||
The output will show the config file location and the URL. Open your browser to:
|
||||
http://localhost:4873
|
||||
|
||||
> Note: You can use `npm unpublish @toolbox-sdk/server --force --registry http://localhost:4873` to unpublish the package.
|
||||
|
||||
2. Pack all 4 packages and publish them to the local registry. Go in each package (eg. server-darwin-arm64) and run
|
||||
```sh
|
||||
npm ci --force
|
||||
npm pack .
|
||||
```
|
||||
|
||||
Then publish to the local registry
|
||||
```sh
|
||||
npm publish --registry http://localhost:4873
|
||||
```
|
||||
|
||||
3. Go to the server package and run
|
||||
```sh
|
||||
npm ci --force
|
||||
npm pack .
|
||||
npm publish --registry http://localhost:4873
|
||||
```
|
||||
|
||||
Now, you have published your package.
|
||||
|
||||
4. Now create a new folder (let's call it testing.) Add a tools.yaml file to the folder. It should look like this:
|
||||
```yaml
|
||||
sources:
|
||||
my-pg-source:
|
||||
kind: postgres
|
||||
host: 127.0.0.1
|
||||
port: 5432
|
||||
database: toolbox_db
|
||||
user: postgres
|
||||
password: password
|
||||
tools:
|
||||
search-hotels-by-name:
|
||||
kind: postgres-sql
|
||||
source: my-pg-source
|
||||
description: Search for hotels based on name.
|
||||
parameters:
|
||||
- name: name
|
||||
type: string
|
||||
description: The name of the hotel.
|
||||
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
|
||||
prompts:
|
||||
code-review:
|
||||
description: "Asks the LLM to analyze code quality and suggest improvements."
|
||||
messages:
|
||||
- role: "user"
|
||||
content: "Please review the following code for quality, correctness, and potential improvements: \n\n{{.code}}"
|
||||
arguments:
|
||||
- name: "code"
|
||||
description: "The code to review"
|
||||
required: true
|
||||
```
|
||||
|
||||
Note: Do not test this directly to the server folder. The registry might pick up local packages instead of global installation.
|
||||
Use a separate testing folder outside the server folder for this testing.
|
||||
|
||||
6. From the testing folder, run
|
||||
```sh
|
||||
npx --registry=http://localhost:4873/ -y @toolbox-sdk/server
|
||||
```
|
||||
|
||||
This should start up the toolbox server with the tools.yaml file.
|
||||
|
||||
7. Run the command to verify that the tools are available:
|
||||
|
||||
```sh
|
||||
curl --location 'http://127.0.0.1:5000/mcp' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "tools/list",
|
||||
"params": {},
|
||||
"id": 1
|
||||
}'
|
||||
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
cd server-darwin-arm64
|
||||
npm install --force
|
||||
rm -rf bin/
|
||||
git add version.txt package.json package-lock.json
|
||||
|
||||
cd ../server-darwin-x64
|
||||
npm install --force
|
||||
rm -rf bin/
|
||||
git add version.txt package.json package-lock.json
|
||||
|
||||
|
||||
cd ../server-linux-x64
|
||||
npm install --force
|
||||
rm -rf bin/
|
||||
git add version.txt package.json package-lock.json
|
||||
|
||||
|
||||
cd ../server-win32-x64
|
||||
npm install --force
|
||||
rm -rf bin/
|
||||
git add version.txt package.json package-lock.json
|
||||
|
||||
cd ..
|
||||
Reference in New Issue
Block a user