@jsonstudio/llms 0.4.5 → 0.4.6

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.
@@ -1,5 +1,8 @@
1
1
  // Unified tool governance API (标准)
2
2
  // Centralizes tool augmentation, guidance injection/refinement, and textual→tool_calls canonicalization
3
+ // canonicalizer 按需加载(避免在请求侧仅注入时引入不必要的模块)
4
+ // enforceChatBudget: 为避免在请求侧引入多余依赖,这里提供最小实现(保留形状,不裁剪)。
5
+ import { augmentOpenAITools } from '../../guidance/index.js';
3
6
  function isObject(v) { return !!v && typeof v === 'object' && !Array.isArray(v); }
4
7
  // Note: tool schema strict augmentation removed per alignment
5
8
  function enforceChatBudget(chat, _modelId) { return chat; }
@@ -63,6 +66,8 @@ export function processChatRequestTools(request, opts) {
63
66
  t.function = { ...fn, parameters: {} };
64
67
  }
65
68
  }
69
+ // 严格化工具 schema(apply_patch/shell/MCP 等)保持在唯一治理点,避免重复注入
70
+ out.tools = augmentOpenAITools(tools);
66
71
  }
67
72
  }
68
73
  catch { /* best-effort: 保持原样 */ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonstudio/llms",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",