@adminforth/agent 1.49.1 → 1.49.3

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,9 +1,6 @@
1
1
  import { tool } from "langchain";
2
2
  import { z } from "zod";
3
- import {
4
- serializeApiBasedTool,
5
- type ApiBasedTool,
6
- } from "../../apiBasedTools.js";
3
+ import type { ApiBasedTool } from "../../apiBasedTools.js";
7
4
 
8
5
  const fetchToolSchemaSchema = z.object({
9
6
  toolName: z
@@ -34,7 +31,7 @@ export async function createFetchToolSchemaTool(
34
31
  {
35
32
  status: 200,
36
33
  name: toolName,
37
- ...serializeApiBasedTool(toolDefinition),
34
+ loaded: true,
38
35
  },
39
36
  null,
40
37
  2,
package/apiBasedTools.ts CHANGED
@@ -175,7 +175,6 @@ export type ApiBasedToolCallParams = {
175
175
  export type ApiBasedTool = {
176
176
  description?: string;
177
177
  input_schema?: unknown;
178
- output_schema?: unknown;
179
178
  call: (params?: ApiBasedToolCallParams) => Promise<string>;
180
179
  };
181
180
 
@@ -616,7 +615,6 @@ export function prepareApiBasedTools(
616
615
  apiBasedTools[toolName] = {
617
616
  description: schema.description,
618
617
  input_schema: schema.request_schema,
619
- output_schema: schema.response_schema,
620
618
  call: async ({ adminUser, adminuser, abortSignal, inputs, userTimeZone, acceptLanguage } = {}) => {
621
619
  if (isHiddenResourceCall(hiddenResourceIdSet, inputs)) {
622
620
  return YAML.stringify({
@@ -652,16 +650,3 @@ export function prepareApiBasedTools(
652
650
 
653
651
  return apiBasedTools;
654
652
  }
655
-
656
- export function serializeApiBasedTool(tool: ApiBasedTool | undefined) {
657
- if (!tool) {
658
- return null;
659
- }
660
-
661
- return {
662
- description: tool.description,
663
- input_schema: tool.input_schema,
664
- output_schema: tool.output_schema,
665
- call: '[Function]',
666
- };
667
- }
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type ApiBasedTool } from "../../apiBasedTools.js";
2
+ import type { ApiBasedTool } from "../../apiBasedTools.js";
3
3
  export declare function createFetchToolSchemaTool(apiBasedTools: Record<string, ApiBasedTool>): Promise<import("langchain").DynamicStructuredTool<z.ZodObject<{
4
4
  toolName: z.ZodString;
5
5
  }, z.core.$strip>, {
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { tool } from "langchain";
11
11
  import { z } from "zod";
12
- import { serializeApiBasedTool, } from "../../apiBasedTools.js";
13
12
  const fetchToolSchemaSchema = z.object({
14
13
  toolName: z
15
14
  .string()
@@ -26,7 +25,11 @@ export function createFetchToolSchemaTool(apiBasedTools) {
26
25
  message: `Tool "${toolName}" not found.`,
27
26
  }, null, 2);
28
27
  }
29
- return JSON.stringify(Object.assign({ status: 200, name: toolName }, serializeApiBasedTool(toolDefinition)), null, 2);
28
+ return JSON.stringify({
29
+ status: 200,
30
+ name: toolName,
31
+ loaded: true,
32
+ }, null, 2);
30
33
  }), {
31
34
  name: "fetch_tool_schema",
32
35
  description: "Fetch the schema for an API-based AdminForth tool by name and load it for later use. Use this right after fetch_skill when the skill mentions non-base tools.",
@@ -10,7 +10,6 @@ export type ApiBasedToolCallParams = {
10
10
  export type ApiBasedTool = {
11
11
  description?: string;
12
12
  input_schema?: unknown;
13
- output_schema?: unknown;
14
13
  call: (params?: ApiBasedToolCallParams) => Promise<string>;
15
14
  };
16
15
  export declare function formatApiBasedToolCall(params: {
@@ -21,9 +20,3 @@ export declare function formatApiBasedToolCall(params: {
21
20
  userTimeZone?: string;
22
21
  }): Promise<string | undefined>;
23
22
  export declare function prepareApiBasedTools(adminforth: IAdminForth, hiddenResourceIds?: Iterable<string>): Record<string, ApiBasedTool>;
24
- export declare function serializeApiBasedTool(tool: ApiBasedTool | undefined): {
25
- description: string | undefined;
26
- input_schema: unknown;
27
- output_schema: unknown;
28
- call: string;
29
- } | null;
@@ -410,7 +410,6 @@ export function prepareApiBasedTools(adminforth, hiddenResourceIds = []) {
410
410
  apiBasedTools[toolName] = {
411
411
  description: schema.description,
412
412
  input_schema: schema.request_schema,
413
- output_schema: schema.response_schema,
414
413
  call: (...args_1) => __awaiter(this, [...args_1], void 0, function* ({ adminUser, adminuser, abortSignal, inputs, userTimeZone, acceptLanguage } = {}) {
415
414
  if (isHiddenResourceCall(hiddenResourceIdSet, inputs)) {
416
415
  return YAML.stringify({
@@ -442,14 +441,3 @@ export function prepareApiBasedTools(adminforth, hiddenResourceIds = []) {
442
441
  }
443
442
  return apiBasedTools;
444
443
  }
445
- export function serializeApiBasedTool(tool) {
446
- if (!tool) {
447
- return null;
448
- }
449
- return {
450
- description: tool.description,
451
- input_schema: tool.input_schema,
452
- output_schema: tool.output_schema,
453
- call: '[Function]',
454
- };
455
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.49.1",
3
+ "version": "1.49.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "@langchain/core": "^1.1.40",
34
34
  "@langchain/langgraph": "^1.2.8",
35
35
  "@langchain/langgraph-checkpoint": "^1.0.1",
36
- "adminforth": "^2.60.0",
36
+ "adminforth": "2.70.0",
37
37
  "dayjs": "^1.11.20",
38
38
  "langchain": "^1.3.3",
39
39
  "multer": "^2.1.1",