@toolsdk.ai/registry 1.0.132 → 1.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/api/index.js +4 -0
  2. package/dist/domains/executor/executor-types.d.ts +3 -1
  3. package/dist/domains/executor/local-executor.d.ts +1 -1
  4. package/dist/domains/executor/local-executor.js +3 -3
  5. package/dist/domains/executor/sandbox-executor.d.ts +1 -1
  6. package/dist/domains/executor/sandbox-executor.js +3 -3
  7. package/dist/domains/oauth/__tests__/oauth-handler.test.d.ts +1 -0
  8. package/dist/domains/oauth/__tests__/oauth-handler.test.js +598 -0
  9. package/dist/domains/oauth/__tests__/oauth-session.test.d.ts +1 -0
  10. package/dist/domains/oauth/__tests__/oauth-session.test.js +272 -0
  11. package/dist/domains/oauth/__tests__/oauth-utils.test.d.ts +1 -0
  12. package/dist/domains/oauth/__tests__/oauth-utils.test.js +284 -0
  13. package/dist/domains/oauth/index.d.ts +9 -0
  14. package/dist/domains/oauth/index.js +9 -0
  15. package/dist/domains/oauth/oauth-handler.d.ts +65 -0
  16. package/dist/domains/oauth/oauth-handler.js +355 -0
  17. package/dist/domains/oauth/oauth-route.d.ts +11 -0
  18. package/dist/domains/oauth/oauth-route.js +138 -0
  19. package/dist/domains/oauth/oauth-schema.d.ts +257 -0
  20. package/dist/domains/oauth/oauth-schema.js +119 -0
  21. package/dist/domains/oauth/oauth-session.d.ts +54 -0
  22. package/dist/domains/oauth/oauth-session.js +116 -0
  23. package/dist/domains/oauth/oauth-types.d.ts +148 -0
  24. package/dist/domains/oauth/oauth-types.js +9 -0
  25. package/dist/domains/oauth/oauth-utils.d.ts +99 -0
  26. package/dist/domains/oauth/oauth-utils.js +267 -0
  27. package/dist/domains/package/package-handler.d.ts +2 -2
  28. package/dist/domains/package/package-handler.js +4 -4
  29. package/dist/domains/package/package-route.js +5 -5
  30. package/dist/domains/package/package-schema.d.ts +51 -0
  31. package/dist/domains/package/package-schema.js +17 -0
  32. package/dist/domains/package/package-so.d.ts +6 -2
  33. package/dist/domains/package/package-so.js +4 -3
  34. package/dist/shared/schemas/common-schema.d.ts +52 -0
  35. package/dist/shared/schemas/common-schema.js +7 -0
  36. package/dist/shared/scripts-helpers/index.d.ts +4 -0
  37. package/dist/shared/utils/mcp-client-util.d.ts +1 -1
  38. package/dist/shared/utils/mcp-client-util.js +13 -4
  39. package/package.json +1 -1
  40. package/packages/developer-tools/github-mcp.json +4 -1
package/dist/api/index.js CHANGED
@@ -4,6 +4,7 @@ import { serve } from "@hono/node-server";
4
4
  import { swaggerUI } from "@hono/swagger-ui";
5
5
  import { OpenAPIHono } from "@hono/zod-openapi";
6
6
  import { configRoutes } from "../domains/config/config-route";
7
+ import { oauthDemoRoutes, oauthRoutes } from "../domains/oauth/oauth-route";
7
8
  import { repository } from "../domains/package/package-handler";
8
9
  import { packageRoutes } from "../domains/package/package-route";
9
10
  import { initRegistryFactory } from "../domains/registry/registry-factory";
@@ -31,6 +32,9 @@ const app = new OpenAPIHono();
31
32
  // Domain routes
32
33
  app.route("/api/v1", packageRoutes);
33
34
  app.route("/api/v1/config", configRoutes);
35
+ app.route("/api/v1/oauth", oauthRoutes);
36
+ // Demo routes (serves demo-oauth.html and handles callbacks)
37
+ app.route("/demo", oauthDemoRoutes);
34
38
  if (isSearchEnabled()) {
35
39
  initializeSearchService().catch(console.error);
36
40
  app.route("/api/v1/search", searchRoutes);
@@ -6,6 +6,8 @@ export interface ToolExecuteRequest {
6
6
  inputData: Record<string, unknown>;
7
7
  envs?: Record<string, string>;
8
8
  sandboxProvider?: MCPSandboxProvider;
9
+ /** OAuth access token for MCP servers that require OAuth authentication */
10
+ accessToken?: string;
9
11
  }
10
12
  /**
11
13
  * Tool Executor Interface
@@ -13,5 +15,5 @@ export interface ToolExecuteRequest {
13
15
  */
14
16
  export interface ToolExecutor {
15
17
  executeTool(request: ToolExecuteRequest): Promise<unknown>;
16
- listTools(packageName: string, sandboxProvider?: MCPSandboxProvider): Promise<Tool[]>;
18
+ listTools(packageName: string, accessToken?: string): Promise<Tool[]>;
17
19
  }
@@ -8,5 +8,5 @@ export declare class LocalExecutor implements ToolExecutor {
8
8
  private readonly packageRepository;
9
9
  constructor();
10
10
  executeTool(request: ToolExecuteRequest): Promise<unknown>;
11
- listTools(packageName: string): Promise<Tool[]>;
11
+ listTools(packageName: string, accessToken?: string): Promise<Tool[]>;
12
12
  }
@@ -14,7 +14,7 @@ export class LocalExecutor {
14
14
  }
15
15
  async executeTool(request) {
16
16
  const mcpServerConfig = this.packageRepository.getPackageConfig(request.packageName);
17
- const { client, closeConnection } = await getMcpClient(mcpServerConfig, request.envs || {});
17
+ const { client, closeConnection } = await getMcpClient(mcpServerConfig, request.envs || {}, request.accessToken);
18
18
  try {
19
19
  const result = await client.callTool({
20
20
  name: request.toolKey,
@@ -27,7 +27,7 @@ export class LocalExecutor {
27
27
  await closeConnection();
28
28
  }
29
29
  }
30
- async listTools(packageName) {
30
+ async listTools(packageName, accessToken) {
31
31
  const mcpServerConfig = this.packageRepository.getPackageConfig(packageName);
32
32
  const mockEnvs = {};
33
33
  if (mcpServerConfig.env) {
@@ -35,7 +35,7 @@ export class LocalExecutor {
35
35
  mockEnvs[key] = "mock_value";
36
36
  });
37
37
  }
38
- const { client, closeConnection } = await getMcpClient(mcpServerConfig, mockEnvs);
38
+ const { client, closeConnection } = await getMcpClient(mcpServerConfig, mockEnvs, accessToken);
39
39
  try {
40
40
  const { tools } = await client.listTools();
41
41
  console.log(`[LocalExecutor] Tools list retrieved successfully for package ${packageName}`);
@@ -12,5 +12,5 @@ export declare class SandboxExecutor implements ToolExecutor {
12
12
  private readonly localExecutor;
13
13
  constructor(provider: MCPSandboxProvider);
14
14
  executeTool(request: ToolExecuteRequest): Promise<unknown>;
15
- listTools(packageName: string): Promise<Tool[]>;
15
+ listTools(packageName: string, accessToken?: string): Promise<Tool[]>;
16
16
  }
@@ -48,13 +48,13 @@ export class SandboxExecutor {
48
48
  await this.sandboxPool.release(runtime, this.provider);
49
49
  }
50
50
  }
51
- async listTools(packageName) {
51
+ async listTools(packageName, accessToken) {
52
52
  const mcpServerConfig = this.packageRepository.getPackageConfig(packageName);
53
53
  const runtime = mcpServerConfig.runtime || "python";
54
54
  // Sandbox only supports node runtime, fallback to LOCAL for other runtimes
55
55
  if (runtime !== "node") {
56
56
  console.log(`[SandboxExecutor] Runtime '${runtime}' is not supported in sandbox, using LOCAL execution`);
57
- return await this.localExecutor.listTools(packageName);
57
+ return await this.localExecutor.listTools(packageName, accessToken);
58
58
  }
59
59
  const sandboxClient = await this.sandboxPool.acquire(runtime, this.provider);
60
60
  try {
@@ -67,7 +67,7 @@ export class SandboxExecutor {
67
67
  console.warn(`[SandboxExecutor] sandbox list tools failed, falling back to LOCAL execution`);
68
68
  console.warn(`[SandboxExecutor] Error: ${error instanceof Error ? error.message : String(error)}`);
69
69
  try {
70
- const tools = await this.localExecutor.listTools(packageName);
70
+ const tools = await this.localExecutor.listTools(packageName, accessToken);
71
71
  console.log(`[SandboxExecutor] Tools list retrieved successfully with LOCAL fallback`);
72
72
  return tools;
73
73
  }