@nexface/tools 0.1.21-alpha.2 → 0.1.21-alpha.4

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.
@@ -15,6 +15,7 @@ const reservedContextNames = new Set([
15
15
  ]);
16
16
  const reservedToolNames = new Set([
17
17
  ...reservedContextNames,
18
+ "nxf_showToolResults",
18
19
  "nxf_loadSkill",
19
20
  "nxf_beginOperation",
20
21
  "nxf_endOperation",
package/dist/react.d.ts CHANGED
@@ -40,7 +40,7 @@ export interface UseAgentToolDefaultOptions<TInput = unknown, TResult = unknown>
40
40
  /**
41
41
  * @experimental
42
42
  * @warning Experimental API. Its signature and behavior may change.
43
- * @remarks JSON-compatible results retain their types. Other results are unknown after serialization; void results are null.
43
+ * @remarks Renders a successful result when referenced in the final chat reply. JSON-compatible results retain their types; void becomes null and other results are unknown.
44
44
  * @beta
45
45
  */
46
46
  _render?: (context: {
package/dist/react.js CHANGED
@@ -56,13 +56,15 @@ function useAgentBinding(definition, execute, options) {
56
56
  const runtime = useInternalToolRuntime();
57
57
  const confirmation = options.requiresConfirmation;
58
58
  const confirmationProtocol = Boolean(options.confirm);
59
- const presentation = useMemo(() => options._render
60
- ? {
59
+ const presentation = useMemo(() => {
60
+ if (!options._render)
61
+ return undefined;
62
+ return {
61
63
  definition,
62
64
  ...(confirmationProtocol ? { confirmationProtocol: true } : {}),
63
65
  render: options._render,
64
- }
65
- : undefined, [definition, options._render, confirmationProtocol]);
66
+ };
67
+ }, [definition, options._render, confirmationProtocol]);
66
68
  const presentationRef = useRef(presentation);
67
69
  useLayoutEffect(() => {
68
70
  presentationRef.current = presentation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexface/tools",
3
- "version": "0.1.21-alpha.2",
3
+ "version": "0.1.21-alpha.4",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {