tpmjs/packages/tools/registryExecute
Ajax Davis ee825aa97c feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages
- Create @tpmjs/registrySearch package for searching tool registry
- Create @tpmjs/registryExecute package for executing tools via sandbox
- Support self-hosted registries via TPMJS_API_URL and TPMJS_EXECUTOR_URL env vars
- Add /sdk documentation page with usage examples and architecture
- Add SDK link to navigation menu
- Include design doc for registry SDK architecture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 07:29:06 +10:00
..
src feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages 2025-12-12 07:29:06 +10:00
package.json feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages 2025-12-12 07:29:06 +10:00
README.md feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages 2025-12-12 07:29:06 +10:00
tsconfig.json feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages 2025-12-12 07:29:06 +10:00

@tpmjs/registryExecute

Execute tools from the TPMJS registry in any AI SDK agent. Tools run in a secure sandbox - no local installation required.

Installation

npm install @tpmjs/registryExecute
# or
pnpm add @tpmjs/registryExecute

Usage

import { Agent } from 'ai';
import { registrySearchTool } from '@tpmjs/registrySearch';
import { registryExecuteTool } from '@tpmjs/registryExecute';

const agent = new Agent({
  model: 'anthropic/claude-sonnet-4-20250514',
  tools: {
    registrySearch: registrySearchTool,
    registryExecute: registryExecuteTool,
  },
});

// The agent can now:
// 1. Search for tools: registrySearch({ query: "web scraping" })
// 2. Execute found tools: registryExecute({ toolId: "@firecrawl/ai-sdk::scrapeTool", params: { url: "..." } })

Tool: registryExecuteTool

Execute a tool from the TPMJS registry by its toolId.

Parameters

Name Type Required Description
toolId string Yes Tool identifier (format: package::exportName)
params object Yes Parameters to pass to the tool
env object No Environment variables (API keys) if required

Example

// Execute a web search tool
const result = await registryExecuteTool.execute({
  toolId: '@exalabs/ai-sdk::webSearch',
  params: { query: 'latest AI news' },
  env: { EXA_API_KEY: 'your-api-key' },
});

// Result:
// {
//   toolId: '@exalabs/ai-sdk::webSearch',
//   executionTimeMs: 1234,
//   output: { results: [...] }
// }

Returns

{
  "toolId": "@exalabs/ai-sdk::webSearch",
  "executionTimeMs": 1234,
  "output": { ... }
}

Environment Variables

Variable Default Description
TPMJS_API_URL https://tpmjs.com Base URL for the registry API
TPMJS_EXECUTOR_URL https://executor.tpmjs.com URL for the sandbox executor

Self-Hosted Registry

To use your own TPMJS registry and executor:

export TPMJS_API_URL=https://registry.mycompany.com
export TPMJS_EXECUTOR_URL=https://executor.mycompany.com

Security

  • All tools run in a sandboxed Deno environment on Railway
  • API keys are passed per-request, never stored
  • Only registered tools can be executed (no arbitrary code)

License

MIT