@adminforth/agent 1.20.0 → 1.21.0

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/apiBasedTools.ts CHANGED
@@ -75,6 +75,7 @@ type ToolOverrideContext = {
75
75
 
76
76
  type ToolOverride = {
77
77
  wipe_frontend_specific_data?: readonly string[];
78
+ format_tool?: (params: ToolOverrideContext) => Promise<string> | string;
78
79
  post_process_response?: (params: ToolOverrideContext) => Promise<unknown> | unknown;
79
80
  };
80
81
 
@@ -103,6 +104,9 @@ const TOOL_OVERRIDES: Record<string, ToolOverride> = {
103
104
  'resource.options.actions[].customComponent',
104
105
  'resource.options.pageInjections',
105
106
  ],
107
+ format_tool: async ({ }) => {
108
+ return "get resource Apartments"
109
+ }
106
110
  },
107
111
  get_resource_data: {
108
112
  post_process_response: async ({ output, inputs, invokeTool, userTimeZone }) => {
@@ -126,6 +130,9 @@ const TOOL_OVERRIDES: Record<string, ToolOverride> = {
126
130
 
127
131
  return response;
128
132
  },
133
+ format_tool: async ({ }) => {
134
+ return "get 1-20 Apartment filtered listed=yes"
135
+ }
129
136
  },
130
137
  };
131
138
 
package/build.log CHANGED
@@ -32,5 +32,5 @@ custom/skills/fetch_data/SKILL.md
32
32
  custom/skills/mutate_data/
33
33
  custom/skills/mutate_data/SKILL.md
34
34
 
35
- sent 188,483 bytes received 451 bytes 377,868.00 bytes/sec
36
- total size is 186,631 speedup is 0.99
35
+ sent 188,784 bytes received 451 bytes 378,470.00 bytes/sec
36
+ total size is 186,932 speedup is 0.99
@@ -12,10 +12,10 @@ Use `get_resource_data` to fetch data for this skill. This is the main tool for
12
12
 
13
13
  When the user asks for analytics, reports, trends, comparisons, or distributions:
14
14
 
15
- - Fetch the underlying rows with `get_resource_data`.
16
- - Prefer narrow requests: request only the columns you need and use filters, sorting, pagination, and date ranges whenever possible.
15
+ - Fetch the requested data using `aggregate` tool. This tool is capable of performing fast server-side aggregations on filtered data, groupings by date including grouping by day/week/month etc.
16
+ - if it is not possible to get the required aggregates using `aggregate`, fetch the underlying rows with `get_resource_data`. This is much heavier since returns original rows with all fields, but allows you to perform complex calculations, comparisons, and custom groupings in-memory. Always prefer `aggregate` when possible.
17
+ - Prefer narrow requests: use filters, sorting, pagination, and date ranges whenever possible.
17
18
  - If the request is ambiguous, clarify the resource, metric, grouping, or date range before fetching data.
18
- - Compute aggregates from the returned rows yourself: sums, counts, averages, min/max, grouped totals, ratios, and trend deltas.
19
19
  - Return a short written summary with the key finding and most important numbers.
20
20
  - If a chart would help, produce a Vega-Lite spec.
21
21
 
@@ -25,6 +25,9 @@ const TOOL_OVERRIDES = {
25
25
  'resource.options.actions[].customComponent',
26
26
  'resource.options.pageInjections',
27
27
  ],
28
+ format_tool: (_a) => __awaiter(void 0, [_a], void 0, function* ({}) {
29
+ return "get resource Apartments";
30
+ })
28
31
  },
29
32
  get_resource_data: {
30
33
  post_process_response: (_a) => __awaiter(void 0, [_a], void 0, function* ({ output, inputs, invokeTool, userTimeZone }) {
@@ -44,6 +47,9 @@ const TOOL_OVERRIDES = {
44
47
  formatDateTimeColumns(response.data, dateTimeColumnNames, localizedTimeZone);
45
48
  return response;
46
49
  }),
50
+ format_tool: (_a) => __awaiter(void 0, [_a], void 0, function* ({}) {
51
+ return "get 1-20 Apartment filtered listed=yes";
52
+ })
47
53
  },
48
54
  };
49
55
  function sanitizeForYaml(value) {
@@ -12,10 +12,10 @@ Use `get_resource_data` to fetch data for this skill. This is the main tool for
12
12
 
13
13
  When the user asks for analytics, reports, trends, comparisons, or distributions:
14
14
 
15
- - Fetch the underlying rows with `get_resource_data`.
16
- - Prefer narrow requests: request only the columns you need and use filters, sorting, pagination, and date ranges whenever possible.
15
+ - Fetch the requested data using `aggregate` tool. This tool is capable of performing fast server-side aggregations on filtered data, groupings by date including grouping by day/week/month etc.
16
+ - if it is not possible to get the required aggregates using `aggregate`, fetch the underlying rows with `get_resource_data`. This is much heavier since returns original rows with all fields, but allows you to perform complex calculations, comparisons, and custom groupings in-memory. Always prefer `aggregate` when possible.
17
+ - Prefer narrow requests: use filters, sorting, pagination, and date ranges whenever possible.
17
18
  - If the request is ambiguous, clarify the resource, metric, grouping, or date range before fetching data.
18
- - Compute aggregates from the returned rows yourself: sums, counts, averages, min/max, grouped totals, ratios, and trend deltas.
19
19
  - Return a short written summary with the key finding and most important numbers.
20
20
  - If a chart would help, produce a Vega-Lite spec.
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",