@everworker/oneringai 0.3.0 → 0.3.1

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.
package/README.md CHANGED
@@ -1553,4 +1553,4 @@ MIT License - See [LICENSE](./LICENSE) file.
1553
1553
 
1554
1554
  ---
1555
1555
 
1556
- **Version:** 0.2.1 | **Last Updated:** 2026-02-17 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
1556
+ **Version:** 0.3.1 | **Last Updated:** 2026-02-18 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
package/dist/index.cjs CHANGED
@@ -27815,10 +27815,16 @@ function applyServerDefaults(config, defaults) {
27815
27815
  };
27816
27816
  }
27817
27817
 
27818
- // src/infrastructure/mcp/adapters/MCPToolAdapter.ts
27818
+ // src/utils/sanitize.ts
27819
27819
  function sanitizeToolName(name) {
27820
- return name.replace(/[^a-zA-Z0-9_-]/g, "_");
27820
+ let result = name.replace(/[^a-zA-Z0-9_-]/g, "_").replace(/_+/g, "_").replace(/^[_-]+|[_-]+$/g, "");
27821
+ if (/^[0-9]/.test(result)) {
27822
+ result = `n_${result}`;
27823
+ }
27824
+ return result || "unnamed";
27821
27825
  }
27826
+
27827
+ // src/infrastructure/mcp/adapters/MCPToolAdapter.ts
27822
27828
  function createMCPToolAdapter(tool, client, namespace) {
27823
27829
  const fullName = sanitizeToolName(`${namespace}:${tool.name}`);
27824
27830
  return {
@@ -38042,7 +38048,7 @@ var ConnectorTools = class {
38042
38048
  const factory = this.factories.get(serviceType);
38043
38049
  const serviceTools = factory(connector, userId);
38044
38050
  for (const tool of serviceTools) {
38045
- tool.definition.function.name = `${connector.name}_${tool.definition.function.name}`;
38051
+ tool.definition.function.name = `${sanitizeToolName(connector.name)}_${tool.definition.function.name}`;
38046
38052
  }
38047
38053
  tools.push(...serviceTools);
38048
38054
  }
@@ -38196,7 +38202,7 @@ var ConnectorTools = class {
38196
38202
  return connectorOrName;
38197
38203
  }
38198
38204
  static createGenericAPITool(connector, options) {
38199
- const toolName = options?.toolName ?? `${connector.name}_api`;
38205
+ const toolName = options?.toolName ?? `${sanitizeToolName(connector.name)}_api`;
38200
38206
  const userId = options?.userId;
38201
38207
  const description = options?.description ?? `Make an authenticated API call to ${connector.displayName}.` + (connector.baseURL ? ` Base URL: ${connector.baseURL}.` : " Provide full URL in endpoint.") + ' IMPORTANT: For POST/PUT/PATCH requests, pass data in the "body" parameter as a JSON object, NOT as query string parameters in the endpoint URL. The body is sent as application/json.';
38202
38208
  return {
@@ -48279,6 +48285,7 @@ exports.resolveMaxContextTokens = resolveMaxContextTokens;
48279
48285
  exports.resolveModelCapabilities = resolveModelCapabilities;
48280
48286
  exports.resolveRepository = resolveRepository;
48281
48287
  exports.retryWithBackoff = retryWithBackoff;
48288
+ exports.sanitizeToolName = sanitizeToolName;
48282
48289
  exports.scopeEquals = scopeEquals;
48283
48290
  exports.scopeMatches = scopeMatches;
48284
48291
  exports.setMediaOutputHandler = setMediaOutputHandler;