@nocobase/plugin-data-source-manager 2.1.0-alpha.14 → 2.1.0-alpha.15

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,85 +1,95 @@
1
1
  ---
2
2
  scope: GENERAL
3
3
  name: data-query
4
- description: Using tools to query data or counting data from specified datasource
4
+ description: Inspect schemas, retrieve records, and run aggregate queries on specified datasources
5
+ tools:
6
+ - getDataSources
7
+ - getCollectionNames
8
+ - getCollectionMetadata
9
+ - searchFieldMetadata
5
10
  introduction:
6
11
  title: '{{t("ai.skills.dataQuery.title", { ns: "@nocobase/plugin-data-source-manager" })}}'
7
12
  about: '{{t("ai.skills.dataQuery.about", { ns: "@nocobase/plugin-data-source-manager" })}}'
8
13
  ---
9
14
  You are a professional data query assistant for NocoBase.
10
15
 
11
- You help users query and retrieve data from database collections using flexible filtering, sorting, and pagination.
16
+ You help users inspect schemas, retrieve records, and run aggregate queries on NocoBase collections.
12
17
 
13
18
  # Primary Workflows
14
19
 
15
- This skill focuses on querying and retrieving data from collections.
20
+ This skill focuses on safe read-only data access.
16
21
 
17
- ## Basic Query
22
+ ## Schema-first Querying
18
23
 
19
- When users want to retrieve data from a collection:
24
+ When the user does not provide an exact collection or field name:
20
25
 
21
- 1. **Identify Collection**
22
- - Determine which collection to query from based on user's request
23
- - Confirm collection name if ambiguous
26
+ 1. Call `getDataSources` if the target data source is unclear.
27
+ 2. Call `getCollectionNames` to find the right collection.
28
+ 3. Call `getCollectionMetadata` or `searchFieldMetadata` to confirm field names, relation paths, and data types.
29
+ 4. Only then run a data tool.
24
30
 
25
- 2. **Determine Fields**
26
- - Identify which fields to return in the results
31
+ Do not guess collection names, measure aliases, or dotted relation paths.
27
32
 
28
- 3. **Execute Query**
29
- - Call `dataSourceQuery` with appropriate parameters
30
- - Default limit is 50, maximum is 1000
33
+ ## Raw Record Query
31
34
 
32
- 4. **Present Results**
33
- - Format the returned data clearly
34
- - Show pagination info if there are more records
35
+ Use `dataSourceQuery` when the user wants actual records rather than grouped statistics.
35
36
 
36
- ## Count Records
37
+ Typical cases:
37
38
 
38
- When users want to know the total count of records:
39
+ - list rows
40
+ - inspect recent records
41
+ - fetch selected fields
42
+ - browse data with filter, sort, and pagination
39
43
 
40
- 1. **Identify Collection and Filter**
41
- - Determine which collection to count from
42
- - Apply any filter conditions if specified
44
+ ## Aggregate Query
43
45
 
44
- 2. **Execute Count**
45
- - Call `dataSourceCounting` to get total count
46
+ Use `dataQuery` when the user wants:
46
47
 
47
- 3. **Present Result**
48
- - Return the total count to the user
48
+ - counts, sums, averages, min, max
49
+ - grouped statistics
50
+ - rankings
51
+ - trend buckets
52
+ - post-aggregation filtering with `having`
49
53
 
50
- ## Filtered Query
54
+ Prefer `dataQuery` over `dataSourceCounting` whenever the request can be expressed as a measure query, because it is closer to the repository `query` capability used by charts, actions, ACL, and MCP.
51
55
 
52
- When users want to query with specific conditions:
56
+ ## Count Records
53
57
 
54
- 1. **Build Filter Condition**
55
- - Use the filter parameter to define query conditions
56
- - Support operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$like`, `$in`, `$nin`, `$exists`, etc.
57
- - Use `$and` and `$or` for complex conditions
58
+ Use `dataSourceCounting` only for a simple total when grouped output is unnecessary.
58
59
 
59
- 2. **Apply Sorting**
60
- - Use the `sort` parameter to order results
61
- - Format: `["field1", "-field2"]` (minus for descending)
60
+ ## Query Construction Rules
62
61
 
63
- 3. **Apply Pagination**
64
- - Use `offset` and `limit` for pagination
62
+ 1. `filter` is applied before aggregation.
63
+ 2. `having` is applied after aggregation and should reference selected aliases or selected field paths.
64
+ 3. For grouped results, put grouping fields in `dimensions`.
65
+ 4. For metrics, put aggregate definitions in `measures`.
66
+ 5. Use aliases when the user clearly needs stable output keys.
67
+ 6. For dotted relation fields, prefer the exact field path confirmed from metadata, such as `createdBy.nickname`.
68
+ 7. Default row limit is 50 and the tool caps the limit at 100.
65
69
 
66
70
  # Available Tools
67
71
 
72
+ - `getDataSources`: Lists all available data sources.
73
+ - `getCollectionNames`: Lists all collections in a data source.
74
+ - `getCollectionMetadata`: Returns field metadata for collections.
75
+ - `searchFieldMetadata`: Searches fields by keyword.
68
76
  - `dataSourceQuery`: Query data from a specified collection in a data source. Supports filtering, sorting, field selection, and pagination. Returns paged results with total count.
77
+ - `dataQuery`: Run aggregate repository queries with measures, dimensions, orders, filter, and having.
69
78
  - `dataSourceCounting`: Get the total count of records matching the specified filter conditions in a collection.
70
79
 
71
- # Query Parameters
80
+ # Aggregate Query Parameters
72
81
 
73
82
  | Parameter | Type | Description |
74
83
  | ---------------- | -------- | ------------------------------------------------------------ |
75
- | `datasource` | string | The data source name (default: "main") |
84
+ | `dataSource` | string | The data source key (default: `main`) |
76
85
  | `collectionName` | string | The collection name to query |
77
- | `fields` | string[] | Fields to return in results |
78
- | `appends` | string[] | Related fields to include (e.g., association fields) |
79
- | `filter` | object | Query conditions using operators |
80
- | `sort` | string[] | Sort order (prefix with "-" for descending) |
81
- | `offset` | number | Number of records to skip (for pagination) |
82
- | `limit` | number | Maximum number of records to return (default: 50, max: 1000) |
86
+ | `measures` | array | Aggregate definitions, such as count / sum / avg |
87
+ | `dimensions` | array | Group-by field definitions |
88
+ | `orders` | array | Result ordering definitions |
89
+ | `filter` | object | Query conditions applied before aggregation |
90
+ | `having` | object | Query conditions applied after aggregation |
91
+ | `offset` | number | Number of rows to skip |
92
+ | `limit` | number | Maximum number of rows to return (default: 50, max: 100) |
83
93
 
84
94
  # Filter Operators
85
95
 
@@ -141,28 +151,28 @@ User: "Show me all users"
141
151
  Action: Call dataSourceQuery with collectionName="users"
142
152
  ```
143
153
 
144
- ## Query with Field Selection
154
+ ## Aggregate Count
145
155
  ```
146
- User: "Show me all user names and emails"
147
- Action: Call dataSourceQuery with collectionName="users", fields=["name", "email"]
156
+ User: "How many active users are there?"
157
+ Action: Call dataQuery with collectionName="users", measures=[{ field: "id", aggregation: "count", alias: "count" }], filter={ status: { $eq: "active" } }
148
158
  ```
149
159
 
150
- ## Filtered Query
160
+ ## Grouped Statistics
151
161
  ```
152
- User: "Show me active users"
153
- Action: Call dataSourceQuery with collectionName="users", filter={ status: { $eq: 'active' } }
162
+ User: "Count orders by status"
163
+ Action: Call dataQuery with collectionName="orders", dimensions=[{ field: "status", alias: "status" }], measures=[{ field: "id", aggregation: "count", alias: "count" }]
154
164
  ```
155
165
 
156
- ## Sorted Query
166
+ ## Having Query
157
167
  ```
158
- User: "Show me users sorted by creation date"
159
- Action: Call dataSourceQuery with collectionName="users", sort=["-createdAt"]
168
+ User: "Show statuses with more than 10 orders"
169
+ Action: Call dataQuery with collectionName="orders", dimensions=[{ field: "status", alias: "status" }], measures=[{ field: "id", aggregation: "count", alias: "count" }], having={ count: { $gt: 10 } }
160
170
  ```
161
171
 
162
- ## Paginated Query
172
+ ## Raw Record Query
163
173
  ```
164
- User: "Show me the second page of users (20 per page)"
165
- Action: Call dataSourceQuery with collectionName="users", offset=20, limit=20
174
+ User: "Show me 20 latest paid orders"
175
+ Action: Call dataSourceQuery with collectionName="orders", filter={ status: { $eq: "paid" } }, sort=["-createdAt"], limit=20
166
176
  ```
167
177
 
168
178
  ## Count Records
@@ -171,22 +181,19 @@ User: "How many active users are there?"
171
181
  Action: Call dataSourceCounting with collectionName="users", filter={ status: { $eq: 'active' } }
172
182
  ```
173
183
 
174
- ## Complex Query
184
+ ## Metadata First
175
185
  ```
176
- User: "Show me users older than 18 who are either admin or active"
177
- Action: Call dataSourceQuery with collectionName="users", filter={
178
- $and: [
179
- { age: { $gt: 18 } },
180
- { $or: [{ role: { $eq: 'admin' } }, { status: { $eq: 'active' } }] }
181
- ]
182
- }
186
+ User: "Show monthly revenue by salesperson"
187
+ Action:
188
+ 1. Call getCollectionNames / searchFieldMetadata to locate the correct collection and amount field.
189
+ 2. Call getCollectionMetadata if date or relation paths are unclear.
190
+ 3. Call dataQuery with the confirmed fields.
183
191
  ```
184
192
 
185
193
  # Notes
186
194
 
187
- - Always validate that the collection exists before querying
188
- - Use appropriate filters to limit results and improve performance
189
- - Be mindful of the default limit (50) and maximum limit (1000)
190
- - When results are paginated, inform the user about pagination status
191
- - Use `dataSourceCounting` before `dataSourceQuery` when user specifically asks for count
192
- - Format results in a clear, readable manner
195
+ - Always validate collection and field names before querying.
196
+ - Prefer metadata tools first when the request is ambiguous.
197
+ - Prefer `dataQuery` for analysis and metrics.
198
+ - Use `dataSourceQuery` for raw rows and `dataSourceCounting` for the simplest count case.
199
+ - Respect user permissions; if the tool returns `No permissions`, explain that the current role cannot access the requested data.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ declare const _default: import("@nocobase/ai").ToolsOptions;
10
+ export default _default;
@@ -0,0 +1,272 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var dataQuery_exports = {};
38
+ __export(dataQuery_exports, {
39
+ default: () => dataQuery_default
40
+ });
41
+ module.exports = __toCommonJS(dataQuery_exports);
42
+ var import_acl = require("@nocobase/acl");
43
+ var import_ai = require("@nocobase/ai");
44
+ var import_plugin_acl = require("@nocobase/plugin-acl");
45
+ var import_utils = require("../../../common/utils");
46
+ var import_package = __toESM(require("../../../../../package.json"));
47
+ const queryFieldSchema = {
48
+ anyOf: [
49
+ { type: "string" },
50
+ {
51
+ type: "array",
52
+ items: { type: "string" },
53
+ minItems: 1
54
+ }
55
+ ]
56
+ };
57
+ const queryMeasureSchema = {
58
+ type: "object",
59
+ additionalProperties: true,
60
+ required: ["field"],
61
+ properties: {
62
+ field: queryFieldSchema,
63
+ type: {
64
+ type: "string",
65
+ description: "Optional field type hint."
66
+ },
67
+ aggregation: {
68
+ type: "string",
69
+ description: "Aggregation function, such as count, sum, avg, max, or min."
70
+ },
71
+ alias: {
72
+ type: "string",
73
+ description: "Output field alias."
74
+ },
75
+ distinct: {
76
+ type: "boolean",
77
+ description: "Whether to apply distinct before aggregation."
78
+ }
79
+ }
80
+ };
81
+ const queryDimensionSchema = {
82
+ type: "object",
83
+ additionalProperties: true,
84
+ required: ["field"],
85
+ properties: {
86
+ field: queryFieldSchema,
87
+ type: {
88
+ type: "string",
89
+ description: "Optional field type hint."
90
+ },
91
+ alias: {
92
+ type: "string",
93
+ description: "Output field alias."
94
+ },
95
+ format: {
96
+ type: "string",
97
+ description: "Optional output format, usually for date and time dimensions."
98
+ },
99
+ options: {
100
+ type: "object",
101
+ description: "Additional formatter options.",
102
+ additionalProperties: true
103
+ }
104
+ }
105
+ };
106
+ const queryOrderSchema = {
107
+ type: "object",
108
+ additionalProperties: true,
109
+ required: ["field"],
110
+ properties: {
111
+ field: queryFieldSchema,
112
+ alias: {
113
+ type: "string",
114
+ description: "Alias to sort by when the selected field is projected with an alias."
115
+ },
116
+ order: {
117
+ type: "string",
118
+ enum: ["asc", "desc"],
119
+ description: "Sort direction."
120
+ },
121
+ nulls: {
122
+ type: "string",
123
+ enum: ["default", "first", "last"],
124
+ description: "Null value ordering."
125
+ }
126
+ }
127
+ };
128
+ const AggregateQuerySchema = {
129
+ type: "object",
130
+ additionalProperties: false,
131
+ required: ["collectionName"],
132
+ properties: {
133
+ dataSource: {
134
+ type: "string",
135
+ description: "Data source key. Defaults to main."
136
+ },
137
+ datasource: {
138
+ type: "string",
139
+ description: "Legacy alias of dataSource. Defaults to main."
140
+ },
141
+ collectionName: {
142
+ type: "string",
143
+ description: "Collection name to query."
144
+ },
145
+ measures: {
146
+ type: "array",
147
+ description: "Measure definitions for aggregate query.",
148
+ items: queryMeasureSchema
149
+ },
150
+ dimensions: {
151
+ type: "array",
152
+ description: "Dimension definitions for grouped query.",
153
+ items: queryDimensionSchema
154
+ },
155
+ orders: {
156
+ type: "array",
157
+ description: "Order definitions for aggregate query.",
158
+ items: queryOrderSchema
159
+ },
160
+ filter: {
161
+ type: "object",
162
+ description: "Filter object applied before aggregation.",
163
+ additionalProperties: true
164
+ },
165
+ having: {
166
+ type: "object",
167
+ description: "Having object applied after grouping.",
168
+ additionalProperties: true
169
+ },
170
+ offset: {
171
+ type: "number",
172
+ description: "Offset for query result rows."
173
+ },
174
+ limit: {
175
+ type: "number",
176
+ description: `Maximum number of rows to return. Defaults to 50 and is capped at ${import_utils.MAX_QUERY_LIMIT}.`
177
+ },
178
+ timezone: {
179
+ type: "string",
180
+ description: "Optional timezone override for date formatting."
181
+ }
182
+ }
183
+ };
184
+ function getDataSourceKey(args) {
185
+ return args.dataSource || args.datasource || "main";
186
+ }
187
+ function getTimezone(ctx, args) {
188
+ var _a, _b, _c, _d, _e, _f, _g;
189
+ const value = args.timezone || ((_a = ctx.get) == null ? void 0 : _a.call(ctx, "x-timezone")) || ((_c = (_b = ctx.request) == null ? void 0 : _b.get) == null ? void 0 : _c.call(_b, "x-timezone")) || ((_e = (_d = ctx.request) == null ? void 0 : _d.header) == null ? void 0 : _e["x-timezone"]) || ((_g = (_f = ctx.req) == null ? void 0 : _f.headers) == null ? void 0 : _g["x-timezone"]);
190
+ return Array.isArray(value) ? value[0] : value;
191
+ }
192
+ var dataQuery_default = (0, import_ai.defineTools)({
193
+ scope: "SPECIFIED",
194
+ defaultPermission: "ALLOW",
195
+ introduction: {
196
+ title: `{{t("ai.tools.dataQueryAggregate.title", { ns: "${import_package.default.name}" })}}`,
197
+ about: `{{t("ai.tools.dataQueryAggregate.about", { ns: "${import_package.default.name}" })}}`
198
+ },
199
+ definition: {
200
+ name: "dataQuery",
201
+ description: "Run the repository query action on a collection with measures, dimensions, orders, filter, and having.",
202
+ schema: AggregateQuerySchema
203
+ },
204
+ invoke: async (ctx, args) => {
205
+ var _a, _b, _c, _d, _e;
206
+ const dataSourceKey = getDataSourceKey(args);
207
+ const ds = ctx.app.dataSourceManager.get(dataSourceKey);
208
+ if (!ds) {
209
+ return {
210
+ status: "error",
211
+ content: `Data source "${dataSourceKey}" not found`
212
+ };
213
+ }
214
+ const collection = ds.collectionManager.getCollection(args.collectionName);
215
+ if (!collection) {
216
+ return {
217
+ status: "error",
218
+ content: `Collection "${args.collectionName}" not found in data source "${dataSourceKey}"`
219
+ };
220
+ }
221
+ const { limit, offset } = (0, import_utils.normalizeLimitOffset)(args, { defaultLimit: 50, maxLimit: import_utils.MAX_QUERY_LIMIT });
222
+ const timezone = getTimezone(ctx, args);
223
+ if (!((_a = args.measures) == null ? void 0 : _a.length) && !((_b = args.dimensions) == null ? void 0 : _b.length)) {
224
+ return {
225
+ status: "error",
226
+ content: "Aggregate query requires at least one measure or dimension"
227
+ };
228
+ }
229
+ try {
230
+ const db = ds.collectionManager.db || ctx.db;
231
+ const result = await (0, import_plugin_acl.applyQueryPermission)({
232
+ acl: ds.acl || ctx.app.acl,
233
+ db,
234
+ resourceName: args.collectionName,
235
+ query: {
236
+ measures: args.measures,
237
+ dimensions: args.dimensions,
238
+ orders: args.orders,
239
+ filter: args.filter,
240
+ having: args.having,
241
+ limit,
242
+ offset
243
+ },
244
+ currentUser: (_c = ctx.state) == null ? void 0 : _c.currentUser,
245
+ currentRole: (_d = ctx.state) == null ? void 0 : _d.currentRole,
246
+ currentRoles: (_e = ctx.state) == null ? void 0 : _e.currentRoles,
247
+ timezone,
248
+ state: ctx.state
249
+ });
250
+ const queryResult = await db.getRepository(args.collectionName).query({
251
+ ...result.query,
252
+ context: ctx,
253
+ timezone
254
+ });
255
+ return {
256
+ status: "success",
257
+ content: JSON.stringify((0, import_utils.truncateLongStrings)(queryResult))
258
+ };
259
+ } catch (error) {
260
+ if (error instanceof import_acl.NoPermissionError) {
261
+ return {
262
+ status: "error",
263
+ content: "No permissions"
264
+ };
265
+ }
266
+ return {
267
+ status: "error",
268
+ content: (error == null ? void 0 : error.message) || "Aggregate query failed"
269
+ };
270
+ }
271
+ }
272
+ });
@@ -8,27 +8,27 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.14",
11
+ "@nocobase/client": "2.1.0-alpha.15",
12
12
  "react": "18.2.0",
13
- "@nocobase/plugin-acl": "2.1.0-alpha.14",
14
- "@nocobase/utils": "2.1.0-alpha.14",
15
- "@nocobase/ai": "2.1.0-alpha.14",
16
- "@nocobase/server": "2.1.0-alpha.14",
17
- "@nocobase/data-source-manager": "2.1.0-alpha.14",
13
+ "@nocobase/plugin-acl": "2.1.0-alpha.15",
14
+ "@nocobase/utils": "2.1.0-alpha.15",
15
+ "@nocobase/ai": "2.1.0-alpha.15",
16
+ "@nocobase/server": "2.1.0-alpha.15",
17
+ "@nocobase/data-source-manager": "2.1.0-alpha.15",
18
18
  "lodash": "4.17.21",
19
- "@nocobase/acl": "2.1.0-alpha.14",
20
- "@nocobase/database": "2.1.0-alpha.14",
19
+ "@nocobase/acl": "2.1.0-alpha.15",
20
+ "@nocobase/database": "2.1.0-alpha.15",
21
21
  "@ant-design/icons": "5.6.1",
22
22
  "antd": "5.24.2",
23
23
  "react-router-dom": "6.30.1",
24
- "@nocobase/flow-engine": "2.1.0-alpha.14",
24
+ "@nocobase/flow-engine": "2.1.0-alpha.15",
25
25
  "@formily/shared": "2.3.7",
26
26
  "@formily/react": "2.3.7",
27
27
  "react-i18next": "11.18.6",
28
28
  "@emotion/css": "11.13.0",
29
- "@nocobase/actions": "2.1.0-alpha.14",
29
+ "@nocobase/actions": "2.1.0-alpha.15",
30
30
  "sequelize": "6.35.2",
31
- "@nocobase/test": "2.1.0-alpha.14",
31
+ "@nocobase/test": "2.1.0-alpha.15",
32
32
  "@formily/antd-v5": "1.2.3",
33
33
  "@formily/core": "2.3.7",
34
34
  "@formily/reactive": "2.3.7",
@@ -59,6 +59,8 @@
59
59
  "ai.tools.searchFieldMetadata.about": "Search fields in data models by keyword (english first). Returns either search results or a suggested query.",
60
60
  "ai.tools.dataSourceQuery.title": "Data source query",
61
61
  "ai.tools.dataSourceQuery.about": "Use dataSource, collectionName, and collection fields to query data from the database",
62
+ "ai.tools.dataQueryAggregate.title": "Data query",
63
+ "ai.tools.dataQueryAggregate.about": "Run aggregate repository queries with measures, dimensions, orders, filter, and having",
62
64
  "ai.tools.dataSourceCounting.title": "Data source records counting",
63
65
  "ai.tools.dataSourceCounting.about": "Use dataSource, collectionName, and collection fields to query data from the database, get total count of records",
64
66
  "ai.tools.dataQuery.args.datasource": "Data source key",
@@ -69,7 +71,7 @@
69
71
  "ai.tools.dataQuery.args.offset": "Offset of records to be queried",
70
72
  "ai.tools.dataQuery.args.limit": "Maximum number of records to be queried",
71
73
  "ai.skills.dataQuery.title": "Data query",
72
- "ai.skills.dataQuery.about": "Using tools to query data or counting data from specified datasource",
74
+ "ai.skills.dataQuery.about": "Use tools to inspect metadata, query records, and run aggregate analysis on specified data sources",
73
75
  "ai.skills.dataModeling.title": "Data modeling",
74
76
  "ai.skills.dataModeling.about": "helps translate business scenarios into normalized database schemas with table declarations and relationship diagrams.",
75
77
  "ai.skills.dataMetadata.title": "Data metadata",
@@ -59,6 +59,8 @@
59
59
  "ai.tools.searchFieldMetadata.about": "通过关键词搜索数据模型字段(优先英文)。返回搜索结果或建议的查询。",
60
60
  "ai.tools.dataSourceQuery.title": "数据源查询操作",
61
61
  "ai.tools.dataSourceQuery.about": "使用 dataSource、collectionName 和 collection fields 从数据库中查询数据。",
62
+ "ai.tools.dataQueryAggregate.title": "数据查询",
63
+ "ai.tools.dataQueryAggregate.about": "使用 measures、dimensions、orders、filter 和 having 执行聚合查询",
62
64
  "ai.tools.dataSourceCounting.title": "数据源记录数统计",
63
65
  "ai.tools.dataSourceCounting.about": "使用 dataSource、collectionName 和 collection fields 从数据库中获取记录总数",
64
66
  "ai.tools.dataQuery.args.datasource": "数据源标识",
@@ -69,7 +71,7 @@
69
71
  "ai.tools.dataQuery.args.offset": "查询记录的偏移量",
70
72
  "ai.tools.dataQuery.args.limit": "查询记录的最大数量",
71
73
  "ai.skills.dataQuery.title": "数据查询",
72
- "ai.skills.dataQuery.about": "使用工具从指定的数据源查询数据",
74
+ "ai.skills.dataQuery.about": "使用工具查看元数据、查询记录并对指定数据源执行聚合分析",
73
75
  "ai.skills.dataModeling.title": "数据建模",
74
76
  "ai.skills.dataModeling.about": "帮助将业务场景转换为带有表声明和关系图的规范化数据库模式。",
75
77
  "ai.skills.dataMetadata.title": "获取数据模型元信息",
@@ -1 +1 @@
1
- {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-07T15:54:43.080Z"}
1
+ {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-04-10T12:40:12.859Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-data-source-manager",
3
- "version": "2.1.0-alpha.14",
3
+ "version": "2.1.0-alpha.15",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Data source manager",
6
6
  "displayName.ru-RU": "Менеджер управления источниками данных",
@@ -20,6 +20,6 @@
20
20
  "keywords": [
21
21
  "Data model tools"
22
22
  ],
23
- "gitHead": "d8735b541de0ff9557bba704de49c799b4962672",
23
+ "gitHead": "7c86e75b0af4b9f532c8ebf5ef96a7423b0ab60e",
24
24
  "license": "Apache-2.0"
25
25
  }