@livx.cc/agentx 0.99.56 → 0.99.57

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/dist/cli.js CHANGED
@@ -5168,6 +5168,10 @@ var Agent = class _Agent {
5168
5168
  args = tc.function.arguments;
5169
5169
  earlyError ??= `Error: invalid JSON arguments for ${tc.function.name}: ${String(e)}`;
5170
5170
  }
5171
+ if (!earlyError && tool && args && typeof args === "object") {
5172
+ const missing = (tool.parameters?.required ?? []).filter((k) => args[k] == null);
5173
+ if (missing.length) earlyError = `Error: ${tc.function.name} is missing required argument(s): ${missing.join(", ")} (got: ${Object.keys(args).join(", ") || "none"}). Re-call with the exact parameter names.`;
5174
+ }
5171
5175
  const hooks = this.activeHooks;
5172
5176
  const call = { name: tc.function.name, args };
5173
5177
  const meta = { id: tc.id };