diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 02f702d..ad5972b 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -7,7 +7,29 @@ "email": "data-cloud-ai-integrations@google.com" }, "homepage": "https://cloud.google.com/dataplex", - "license": "Apache-2.0", "repository": "https://github.com/gemini-cli-extensions/knowledge-catalog", - "skills": "./skills/" + "license": "Apache-2.0", + "userConfig": { + "dataplex_project": { + "title": "Project ID", + "description": "ID of the Google Cloud project", + "type": "string", + "sensitive": false + } + }, + "mcpServers": { + "dataplex": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "dataplex", + "--stdio" + ], + "env": { + "DATAPLEX_PROJECT": "${user_config.dataplex_project}" + } + } + } } diff --git a/.codex-plugin/.mcp.json b/.codex-plugin/.mcp.json new file mode 100644 index 0000000..9c8cdfe --- /dev/null +++ b/.codex-plugin/.mcp.json @@ -0,0 +1,17 @@ +{ + "mcpServers": { + "dataplex": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "dataplex", + "--stdio" + ], + "env_vars": [ + "DATAPLEX_PROJECT" + ] + } + } +} diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 1a0a1d9..e770218 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -15,7 +15,6 @@ "google-cloud", "data-governance" ], - "skills": "./skills/", "interface": { "displayName": "Knowledge Catalog", "shortDescription": "Interact with Knowledge Catalog to discover and manage data assets.", @@ -28,5 +27,6 @@ "defaultPrompt": [ "Your primary objective is to help discover, organize and manage metadata related to data assets." ] - } + }, + "mcpServers": "./.codex-plugin/.mcp.json" } diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 0533093..d758c32 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -21,18 +21,28 @@ pinDigests: true, }, { - matchPackageNames: ['googleapis/mcp-toolbox'], + matchPackageNames: ['@toolbox-sdk/server'], + // Group the toolbox update under a stable branch name (renovate/toolbox). + groupName: 'toolbox', 'semanticCommitType': 'feat' } ], customManagers: [ { + // Track the npm toolbox server pinned in the MCP command. The version is + // listed in the source (mcp.json) and repeated in every generated + // manifest, so all of them are bumped in one PR. customType: "regex", - managerFilePatterns: ["/toolbox_version\\.txt$/"], - matchStrings: ["(?[\\d\\.]+)"], - datasourceTemplate: "github-releases", - packageNameTemplate: "googleapis/mcp-toolbox", - extractVersionTemplate: "^v(?.*)$", + managerFilePatterns: [ + "/mcp\.json$/", + "/mcp_config\.json$/", + "/gemini-extension\.json$/", + "/\.claude-plugin/plugin\.json$/", + "/\.codex-plugin/\.mcp\.json$/", + ], + matchStrings: ["@toolbox-sdk/server@(?[\d\.]+)"], + datasourceTemplate: "npm", + depNameTemplate: "@toolbox-sdk/server", } ] } diff --git a/.github/workflows/presubmit-tests.yml b/.github/workflows/presubmit-tests.yml index 5c6ac7e..7d50482 100644 --- a/.github/workflows/presubmit-tests.yml +++ b/.github/workflows/presubmit-tests.yml @@ -17,6 +17,9 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + jobs: run-presubmit-tests: runs-on: ubuntu-latest @@ -27,12 +30,6 @@ jobs: - name: Install Gemini CLI run: npm install @google/gemini-cli - - name: Install toolbox binary - run: | - VERSION=$(cat toolbox_version.txt) - curl -L -o toolbox "https://storage.googleapis.com/mcp-toolbox-for-databases/v${VERSION}/linux/amd64/toolbox" - chmod +x toolbox - - name: Install Extension run: npx gemini extensions validate . env: diff --git a/.github/workflows/skills-generate.yml b/.github/workflows/skills-generate.yml deleted file mode 100644 index 5452a76..0000000 --- a/.github/workflows/skills-generate.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Generate Skills - -on: - pull_request: - paths: - - "toolbox_version.txt" - -jobs: - generate-skills: - # Only run for same-repo PRs (e.g. renovate's toolbox bump), where the - # built-in GITHUB_TOKEN can push back to the PR branch. - if: github.event.pull_request.head.repo.full_name == github.repository - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out PR branch - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - with: - ref: ${{ github.head_ref }} - - - name: Generate skills - run: | - VERSION="$(tr -d '\n' < toolbox_version.txt)" - echo "Detected toolbox version: $VERSION" - export VERSION - chmod +x ./.github/scripts/generate_skills.sh - ./.github/scripts/generate_skills.sh - - - name: Commit and push regenerated skills - run: | - if [ -z "$(git status --porcelain)" ]; then - echo "No skill changes generated. Nothing to commit." - exit 0 - fi - - echo "Changes detected. Committing regenerated skills..." - git config user.name "release-please[bot]" - git config user.email "55107282+release-please[bot]@users.noreply.github.com" - - git add . - git commit -m "chore: auto-generate skills for toolbox v$(tr -d '\n' < toolbox_version.txt)" - git push diff --git a/.github/workflows/skills-validate-fallback.yml b/.github/workflows/skills-validate-fallback.yml deleted file mode 100644 index b49eb62..0000000 --- a/.github/workflows/skills-validate-fallback.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: lint - -on: - push: - paths-ignore: - - "skills/**" - pull_request: - paths-ignore: - - "skills/**" - pull_request_target: - types: [labeled] - paths-ignore: - - "skills/**" - workflow_dispatch: - -jobs: - skills-validate: - runs-on: ubuntu-latest - steps: - - name: Skip Skill Validation - run: | - echo "No changes detected in 'skills/' directory. Skipping validation." - echo "This job ensures the required 'skills-validate' status check passes." diff --git a/.github/workflows/skills-validate.yml b/.github/workflows/skills-validate.yml deleted file mode 100644 index 7a9e972..0000000 --- a/.github/workflows/skills-validate.yml +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Validate Skills - -on: - push: - paths: - - "skills/**" - pull_request: - paths: - - "skills/**" - pull_request_target: - types: [labeled] - paths: - - "skills/**" - -jobs: - skills-validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - - - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 - with: - python-version: "3.11" - - - name: Install skills-ref - run: | - pip install "git+https://github.com/agentskills/agentskills.git#subdirectory=skills-ref" - - - name: Validate Skills - run: | - failed=0 - for skill_dir in skills/*/; do - if [ -d "$skill_dir" ]; then - echo "Validating $skill_dir..." - if ! skills-ref validate "$skill_dir"; then - echo "Validation failed for $skill_dir" - failed=1 - fi - fi - done - exit $failed diff --git a/README.md b/README.md index 1a684c7..872b8d2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > [!NOTE] > Currently in beta (pre-v1.0), and may see breaking changes until the first stable release (v1.0). -This repository provides a set of agent skills to interact with [Knowledge Catalog](https://cloud.google.com/dataplex/docs) (formerly known as Dataplex) instances. These skills can be used with various AI agents, including [Antigravity](https://antigravity.google/), [Claude Code](https://claude.com/product/claude-code) and [Codex](https://developers.openai.com/codex), to discover, manage, monitor, and govern data and AI artifacts across your data platform using natural language prompts. +This repository packages [MCP Toolbox](https://github.com/googleapis/mcp-toolbox)'s prebuilt `dataplex` server as a plugin/extension to interact with [Knowledge Catalog](https://cloud.google.com/dataplex/docs) (formerly known as Dataplex) instances. It can be used with various AI agents, including [Antigravity](https://antigravity.google/), [Claude Code](https://claude.com/product/claude-code) and [Codex](https://developers.openai.com/codex), to discover, manage, monitor, and govern data and AI artifacts across your data platform using natural language prompts. > [!IMPORTANT] > **We Want Your Feedback!** @@ -14,7 +14,7 @@ This repository provides a set of agent skills to interact with [Knowledge Catal ## Table of Contents -- [Why Use Knowledge Catalog Agent Skills?](#why-use-knowledge-catalog-agent-skills) +- [Why Use Knowledge Catalog?](#why-use-knowledge-catalog) - [Prerequisites](#prerequisites) - [Getting Started](#getting-started) - [Configuration](#configuration) @@ -22,14 +22,14 @@ This repository provides a set of agent skills to interact with [Knowledge Catal - [Antigravity](#antigravity) - [Claude Code](#claude-code) - [Codex](#codex) -- [Installing using open agent skills tool](#installing-using-open-agent-skills-tool) - [Installing via a compatible Agent Plugins client](#installing-via-a-compatible-agent-plugins-client) - [Usage Examples](#usage-examples) -- [Supported Skills](#supported-skills) +- [Available Tools](#available-tools) +- [Generating Skills Instead](#generating-skills-instead) - [Additional Agent Skills](#additional-agent-skills) - [Troubleshooting](#troubleshooting) -## Why Use Knowledge Catalog Agent Skills? +## Why Use Knowledge Catalog? * **Natural Language Management:** Stop wrestling with complex commands. Explore schemas and query data by describing what you want in plain English. * **Seamless Workflow:** Integrates seamlessly into your AI agent's environment. No need to constantly switch contexts for common database tasks. @@ -45,6 +45,7 @@ Before you begin, ensure you have the following: - [Antigravity 2.0](https://antigravity.google/product/antigravity-2) version **v2.0.0** or higher. - [Claude Code](https://claude.com/product/claude-code) version **v2.1.94** or higher. - [Codex](https://developers.openai.com/codex) **v0.117.0** or higher. +- [Node.js](https://nodejs.org/) — the MCP server runs via `npx`. - A Google Cloud project with the **Dataplex API** enabled. - Ensure [Application Default Credentials](https://cloud.google.com/docs/authentication/gcloud) are available in your environment. - IAM Permissions: @@ -61,7 +62,7 @@ Please keep these env vars handy during the installation process: ### Installation & Usage -To start interacting with your database, install the skills for your preferred AI agent, then launch the agent and use natural language to ask questions or perform tasks. +To start interacting with your database, install the extension for your preferred AI agent, then launch the agent and use natural language to ask questions or perform tasks. For the latest version, check the [releases page][releases]. @@ -73,8 +74,8 @@ For the latest version, check the [releases page][releases]. Antigravity You can use either of these two agents for Antigravity: -- [Antigravity CLI](https://github.com/google-gemini/gemini-cli) version **v0.5.3** or higher -- [Antigravity 2.0](https://antigravity.google/product/antigravity-2) version **v0.5.3** or higher. +- [Antigravity CLI](https://github.com/google-gemini/gemini-cli) version **v1.6.0** or higher +- [Antigravity 2.0](https://antigravity.google/product/antigravity-2) version **v2.0.0** or higher.
💡 Tip — Migrating from Gemini CLI?
@@ -90,28 +91,18 @@ See Migrating from Gemi #### Antigravity 2.0 (IDE) -**1. Clone the Repo:** - -```bash -git clone --branch 0.5.3 https://github.com/gemini-cli-extensions/knowledge-catalog.git -``` - -**2. Install the skills:** - -Choose a location for the skills: -- **Global (all workspaces):** `~/.gemini/antigravity/skills/` -- **Workspace-specific:** `/.agents/skills/` +**1. Install the plugin:** -Copy the skill folders from the cloned repository's `skills/` directory to your chosen location: +Install the plugin directly from the remote GitHub repository: ```bash -cp -R knowledge-catalog/skills/* ~/.gemini/antigravity/skills/ +agy plugin install https://github.com/gemini-cli-extensions/knowledge-catalog ``` -**3. Set env vars:** +**2. Set env vars:** Set your environment vars as described in the [configuration section](#configuration). -_(Tip: Antigravity 2.0 automatically discovers skills in these directories at the start of a session. You can verify they are active by running the `/skills` command in your active session.)_ +_(Tip: You can verify the MCP server is active by running the `/mcp` command in your active session.)_ #### Antigravity CLI @@ -146,8 +137,7 @@ claude /plugin install knowledge-catalog@claude-plugins-official ``` -_(Tip: Run `/plugin list` inside Claude Code to verify the plugin is active, or `/reload-plugins` if you just installed it.)_ - +_(Tip: Run `/plugin list` inside Claude Code to verify the plugin is active, or `/reload-plugins` if you just installed it.)
@@ -175,23 +165,7 @@ codex plugin marketplace upgrade data-agent-kit
-## Installing using [open agent skills tool](https://github.com/vercel-labs/skills) - -You can install skills using the `npx skills` command. - -**1. Install the skills:** - -Run the following command in your terminal to automatically download and register the skills: - -```bash -npx skills add https://github.com/gemini-cli-extensions/knowledge-catalog/tree/0.5.3 -``` - -For detailed info check out the [Skills npm package](https://www.npmjs.com/package/skills). - -**2. Set env vars:** -Set your environment vars as described in the [configuration section](#configuration). - +## Installing via a compatible Agent Plugins client ## Installing via a compatible Agent Plugins client This repository is a valid [Agent Plugins](https://github.com/agentplugins/agent-plugins-spec) (v1) plugin. Any [Agent Plugins–compatible client](https://agent-plugins.org/compatible-clients) can install it directly using its own built-in plugin command — no extra tooling required — by pointing at this repository: @@ -219,11 +193,38 @@ Interact with Knowledge Catalog using natural language: * **Perform Ad-hoc Analysis:** * "Calculate the total 'customer orders' this month." -## Supported Skills +## Available Tools + +The tools come from MCP Toolbox's prebuilt `dataplex` server, grouped into toolsets: + + + +For the full, up-to-date list, see the [`dataplex` prebuilt config](https://github.com/googleapis/mcp-toolbox/blob/main/internal/prebuiltconfigs/tools/dataplex.yaml) +in the MCP Toolbox repository. -The following skills are available in this repository: +## Generating Skills Instead + +The tool-backed skills this plugin used to ship were generated from the same prebuilt +toolsets. If your agent lacks deferred tool loading, or you prefer skills, regenerate +them with the script in this repository: + +```bash +VERSION= ./.github/scripts/generate_skills.sh +``` + +Use the toolbox version pinned in [`mcp.json`](./mcp.json). A single toolset, without +the script: + +```bash +npx @toolbox-sdk/server@ --prebuilt dataplex skills-generate \ + --name "" \ + --toolset "" \ + --description "" +``` -- [Knowledge Catalog Discovery](./skills/knowledge-catalog-discovery/SKILL.md) - Use these skills when you need to discover and explore data assets in the Knowledge Catalog. It allows you to search for entries, lookup specific metadata, and explore aspect types to understand your data platform's assets. +The generated scripts call the toolbox through `npx`, so no binary download is needed. +See [Generate Agent Skills](https://github.com/googleapis/mcp-toolbox#generate-agent-skills) +in the MCP Toolbox repository. ## Additional Agent Skills diff --git a/gemini-extension.json b/gemini-extension.json index a2c6fa7..576c516 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,7 +1,19 @@ { "name": "knowledge-catalog", "version": "0.5.3", - "description": "Connect to Knowledge Catalog (formerly known as Dataplex) to discover, manage, monitor, and govern data and AI artifacts across your data platform", + "description": "Connect to Knowledge Catalog to discover, manage, monitor, and govern data and AI artifacts across your data platform", + "mcpServers": { + "dataplex": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "dataplex", + "--stdio" + ] + } + }, "contextFileName": "KNOWLEDGE_CATALOG.md", "settings": [ { @@ -10,4 +22,4 @@ "envVar": "DATAPLEX_PROJECT" } ] -} \ No newline at end of file +} diff --git a/mcp.json b/mcp.json new file mode 100644 index 0000000..5bd1f36 --- /dev/null +++ b/mcp.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json", + "mcpServers": { + "dataplex": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "dataplex", + "--stdio" + ] + } + } +} diff --git a/mcp_config.json b/mcp_config.json new file mode 100644 index 0000000..24c5852 --- /dev/null +++ b/mcp_config.json @@ -0,0 +1,14 @@ +{ + "mcpServers": { + "dataplex": { + "command": "npx", + "args": [ + "-y", + "@toolbox-sdk/server@1.9.0", + "--prebuilt", + "dataplex", + "--stdio" + ] + } + } +} diff --git a/plugin.json b/plugin.json index c72e45c..3592ec2 100644 --- a/plugin.json +++ b/plugin.json @@ -15,5 +15,35 @@ "knowledge-catalog", "google-cloud", "data-governance" - ] + ], + "extensions": { + "com.google.cloud.data.agent-plugins": { + "config": [ + { + "key": "DATAPLEX_PROJECT", + "title": "Project ID", + "description": "ID of the Google Cloud project" + } + ], + "gemini": { + "mcpServerName": "dataplex", + "contextFileName": "KNOWLEDGE_CATALOG.md" + }, + "codex": { + "interface": { + "displayName": "Knowledge Catalog", + "shortDescription": "Interact with Knowledge Catalog to discover and manage data assets.", + "developerName": "Google LLC", + "category": "Data Governance", + "capabilities": [ + "Read", + "Write" + ], + "defaultPrompt": [ + "Your primary objective is to help discover, organize and manage metadata related to data assets." + ] + } + } + } + } } diff --git a/skills/knowledge-catalog-discovery/SKILL.md b/skills/knowledge-catalog-discovery/SKILL.md deleted file mode 100644 index c52e012..0000000 --- a/skills/knowledge-catalog-discovery/SKILL.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -name: knowledge-catalog-discovery -description: Use these skills when you need to discover and explore data assets in the Knowledge Catalog. It allows you to search for entries, lookup specific metadata, and explore aspect types to understand your data platform's assets. ---- - -## Usage - -All scripts can be executed using Node.js. Replace `` and `` with actual values. - -**Bash:** -`node /scripts/.js '{"": ""}'` - -**PowerShell:** -`node /scripts/.js '{\"\": \"\"}'` - -Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. - - -## Scripts - - -### lookup_context - -Retrieves rich metadata regarding one or more data assets along with their relationships. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| resources | array | Required. A list of up to 10 resource names. Resources may belong to different projects, but all must belong to the same location. | Yes | | - - ---- - -### lookup_entry - -Retrieves a specific metadata regarding a data asset (e.g. table/dataset/view) from Catalog - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| entry | string | Required. The resource name of the Entry in the following form: projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}. | Yes | | -| view | integer | - ## Argument: view - - **Type:** Integer - - **Description:** Optional. Specifies the parts of the entry and its aspects to return. - - **Possible Values:** - - * 1 (BASIC): Returns entry without aspects. - * 2 (FULL): Return all required aspects and the keys of non-required aspects. (Default) - * 3 (CUSTOM): Return the entry and aspects requested in aspect_types field (at most 100 aspects). Always use this view when aspect_types is not empty. - * 4 (ALL): Return the entry and both required and optional aspects (at most 100 aspects) - | No | `2` | -| aspectTypes | array | Optional. Limits the aspects returned to the provided aspect types. It only works when used together with CUSTOM view. | No | `[]` | - - ---- - -### search_aspect_types - -Search aspect types relevant to the query. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| query | string | The query against which aspect type should be matched. | Yes | | -| pageSize | integer | Number of returned aspect types in the search page. | No | `5` | -| orderBy | string | Specifies the ordering of results. Supported values are: relevance, last_modified_timestamp, last_modified_timestamp asc | No | `relevance` | - - ---- - -### search_entries - -Searches for data assets (eg. table/dataset/view) in Catalog based on the provided search query. - -#### Parameters - -| Name | Type | Description | Required | Default | -| :--- | :--- | :--- | :--- | :--- | -| query | string | A query string for searching entries, following Dataplex search syntax. Supports logical operators (AND, OR, NOT) and grouping. For example, to find a table that might have been renamed, you could use 'type:table (name:books OR fiction)'. This can be more efficient than multiple separate calls.Warning: Performing broad searches without specific filters (e.g., type:table) can be slow and consume significant resources. When performing exploratory searches, always use the pageSize parameter to limit the number of results returned. | Yes | | -| scope | string | A scope limits the search space to a particular project or organization. It must be in the format: organizations/ or projects/ or projects/. | No | `` | -| pageSize | integer | Number of results in the search page. | No | `5` | -| orderBy | string | Specifies the ordering of results. Supported values are: relevance, last_modified_timestamp, last_modified_timestamp asc | No | `relevance` | - - ---- - diff --git a/skills/knowledge-catalog-discovery/scripts/lookup_context.js b/skills/knowledge-catalog-discovery/scripts/lookup_context.js deleted file mode 100755 index 45ee4a5..0000000 --- a/skills/knowledge-catalog-discovery/scripts/lookup_context.js +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "lookup_context"; -const configArgs = ["--prebuilt", "dataplex"]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/knowledge-catalog-discovery/scripts/lookup_entry.js b/skills/knowledge-catalog-discovery/scripts/lookup_entry.js deleted file mode 100755 index 254e190..0000000 --- a/skills/knowledge-catalog-discovery/scripts/lookup_entry.js +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "lookup_entry"; -const configArgs = ["--prebuilt", "dataplex"]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/knowledge-catalog-discovery/scripts/search_aspect_types.js b/skills/knowledge-catalog-discovery/scripts/search_aspect_types.js deleted file mode 100755 index bd144a9..0000000 --- a/skills/knowledge-catalog-discovery/scripts/search_aspect_types.js +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "search_aspect_types"; -const configArgs = ["--prebuilt", "dataplex"]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/skills/knowledge-catalog-discovery/scripts/search_entries.js b/skills/knowledge-catalog-discovery/scripts/search_entries.js deleted file mode 100755 index a4575c9..0000000 --- a/skills/knowledge-catalog-discovery/scripts/search_entries.js +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const { spawn, execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); - -const toolName = "search_entries"; -const configArgs = ["--prebuilt", "dataplex"]; - - -function mergeEnvVars(env) { - if (process.env.GEMINI_CLI === '1') { - const envPath = path.resolve(__dirname, '../../../.env'); - if (fs.existsSync(envPath)) { - const envContent = fs.readFileSync(envPath, 'utf-8'); - envContent.split('\n').forEach(line => { - const trimmed = line.trim(); - if (trimmed && !trimmed.startsWith('#')) { - const splitIdx = trimmed.indexOf('='); - if (splitIdx !== -1) { - const key = trimmed.slice(0, splitIdx).trim(); - let value = trimmed.slice(splitIdx + 1).trim(); - value = value.replace(/(^['"]|['"]$)/g, ''); - if (env[key] === undefined) { - env[key] = value; - } - } - } - }); - } - } else if (process.env.CLAUDECODE === '1') { - const prefix = 'CLAUDE_PLUGIN_OPTION_'; - for (const key in process.env) { - if (key.startsWith(prefix)) { - env[key.substring(prefix.length)] = process.env[key]; - } - } - } -} - -function prepareEnvironment() { - let env = { ...process.env }; - let userAgent = "skills"; - if (process.env.GEMINI_CLI === '1') { - userAgent = "skills-geminicli"; - } else if (process.env.CLAUDECODE === '1') { - userAgent = "skills-claudecode"; - } else if (process.env.CODEX_CI === '1') { - userAgent = "skills-codex"; - } - mergeEnvVars(env); - - - return { env, userAgent }; -} - -function main() { - const { env, userAgent } = prepareEnvironment(); - const args = process.argv.slice(2); - - const command = os.platform() === 'win32' ? 'npx.cmd' : 'npx'; - const processedArgs = os.platform() === 'win32' ? args.map(arg => arg.includes('"') ? '"' + arg.replace(/"/g, '""') + '"' : arg) : args; - const npxArgs = ["--yes", "@toolbox-sdk/server@1.1.0", "--log-level", "error", ...configArgs, "invoke", toolName, "--user-agent-metadata", userAgent, ...processedArgs]; - - const child = spawn(command, npxArgs, { shell: os.platform() === 'win32', stdio: 'inherit', env }); - - - child.on('close', (code) => { - process.exit(code); - }); - - child.on('error', (err) => { - console.error("Error executing toolbox:", err); - process.exit(1); - }); -} - -main(); diff --git a/toolbox_version.txt b/toolbox_version.txt deleted file mode 100644 index ce6a70b..0000000 --- a/toolbox_version.txt +++ /dev/null @@ -1 +0,0 @@ -1.6.0 \ No newline at end of file