@axiom-lattice/examples-deep_research 1.0.16 → 1.0.17
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +10 -0
- package/dist/index.js +322 -815
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/agents/data_agent/index.ts +41 -16
- package/src/agents/data_agent/skills/analysis-methodology/SKILL.md +73 -0
- package/src/agents/data_agent/skills/analyst/SKILL.md +105 -0
- package/src/agents/data_agent/skills/data-visualization/SKILL.md +77 -0
- package/src/agents/data_agent/skills/infographic-creator/SKILL.md +337 -0
- package/src/agents/data_agent/skills/inventory-doctor/SKILL.md +61 -0
- package/src/agents/data_agent/skills/inventory-doctor.ts +47 -0
- package/src/agents/data_agent/skills/notebook-report/SKILL.md +81 -0
- package/src/agents/data_agent/skills/sql-query/SKILL.md +58 -0
- package/src/agents/data_agent/skills/test/SKILL.md +9 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/inventory_doctor/index.ts +53 -0
- package/src/agents/inventory_doctor/tools.ts +244 -0
- package/src/index.ts +81 -0
- package/src/agents/data_agent/tools/load_skills.ts +0 -88
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var require_package = __commonJS({
|
|
|
31
31
|
"package.json"(exports2, module2) {
|
|
32
32
|
module2.exports = {
|
|
33
33
|
name: "@axiom-lattice/examples-deep_research",
|
|
34
|
-
version: "1.0.
|
|
34
|
+
version: "1.0.17",
|
|
35
35
|
main: "dist/index.js",
|
|
36
36
|
bin: {
|
|
37
37
|
"lattice-deep-research": "./dist/index.js"
|
|
@@ -84,7 +84,7 @@ var require_package = __commonJS({
|
|
|
84
84
|
// src/index.ts
|
|
85
85
|
var import_dotenv = __toESM(require("dotenv"));
|
|
86
86
|
var import_gateway = require("@axiom-lattice/gateway");
|
|
87
|
-
var
|
|
87
|
+
var import_core5 = require("@axiom-lattice/core");
|
|
88
88
|
|
|
89
89
|
// src/agents/research/index.ts
|
|
90
90
|
var import_core = require("@axiom-lattice/core");
|
|
@@ -235,823 +235,52 @@ var research_agents = [
|
|
|
235
235
|
(0, import_core.registerAgentLattices)(research_agents);
|
|
236
236
|
|
|
237
237
|
// src/agents/data_agent/index.ts
|
|
238
|
-
var import_core3 = require("@axiom-lattice/core");
|
|
239
|
-
var import_zod3 = __toESM(require("zod"));
|
|
240
|
-
|
|
241
|
-
// src/agents/data_agent/tools/load_skills.ts
|
|
242
|
-
var import_zod2 = __toESM(require("zod"));
|
|
243
238
|
var import_core2 = require("@axiom-lattice/core");
|
|
239
|
+
var import_zod2 = __toESM(require("zod"));
|
|
240
|
+
var dataAgentPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E13\u4E1A\u7684\u4E1A\u52A1\u6570\u636E\u5206\u6790AI\u52A9\u624B\uFF0C\u64C5\u957F\u89C4\u5212\u4E1A\u52A1\u5206\u6790\u4EFB\u52A1\u3001\u534F\u8C03\u6570\u636E\u68C0\u7D22\uFF0C\u5E76\u751F\u6210\u5168\u9762\u7684\u4E1A\u52A1\u5206\u6790\u62A5\u544A\u3002
|
|
244
241
|
|
|
245
|
-
|
|
246
|
-
var analyst = {
|
|
247
|
-
name: "analyst",
|
|
248
|
-
description: "\u534F\u8C03\u548C\u6267\u884C\u5B8C\u6574\u7684\u4E1A\u52A1\u6570\u636E\u5206\u6790\u6D41\u7A0B\uFF0C\u6574\u5408\u5206\u6790\u65B9\u6CD5\u8BBA\u3001SQL\u67E5\u8BE2\u3001\u6570\u636E\u53EF\u89C6\u5316\u548C\u62A5\u544A\u7F16\u5199\u6280\u80FD\u3002\u9002\u7528\u4E8E\u9700\u8981\u7AEF\u5230\u7AEF\u5206\u6790\u6D41\u7A0B\u7684\u590D\u6742\u4E1A\u52A1\u95EE\u9898\u3002",
|
|
249
|
-
prompt: `## \u89D2\u8272\u5B9A\u4F4D
|
|
250
|
-
|
|
251
|
-
\u4F5C\u4E3A\u5206\u6790\u534F\u8C03\u8005\uFF0C\u6574\u5408\u4F7F\u7528\u4EE5\u4E0B\u6280\u80FD\u5B8C\u6210\u7AEF\u5230\u7AEF\u5206\u6790\uFF1A
|
|
252
|
-
- \`analysis-methodology\`: \u7ED3\u6784\u5316\u95EE\u9898\u62C6\u89E3\u548C\u65B9\u6CD5\u8BBA\u5E94\u7528
|
|
253
|
-
- \`sql-query\`: \u6570\u636E\u68C0\u7D22\u548C\u67E5\u8BE2\u6267\u884C
|
|
254
|
-
- \`data-visualization\`: \u56FE\u8868\u8BBE\u8BA1\u548C\u53EF\u89C6\u5316\u914D\u7F6E
|
|
255
|
-
- \`notebook-report\`: \u62A5\u544A\u751F\u6210\u548C\u6D1E\u5BDF\u6574\u5408
|
|
256
|
-
|
|
257
|
-
## \u5206\u6790\u5DE5\u4F5C\u6D41\u7A0B
|
|
258
|
-
|
|
259
|
-
### \u6B65\u9AA4 0\uFF1A\u95EE\u9898\u7406\u89E3\u4E0E\u89C4\u5212
|
|
260
|
-
|
|
261
|
-
1. **\u8BB0\u5F55\u95EE\u9898**\uFF1A\u5199\u5165 \`/question.md\`\uFF08\u95EE\u9898\u9648\u8FF0\u3001\u4E1A\u52A1\u80CC\u666F\u3001\u6210\u529F\u6807\u51C6\uFF09
|
|
262
|
-
2. **\u5E94\u7528\u5206\u6790\u65B9\u6CD5\u8BBA**\uFF1A\u4F7F\u7528 \`analysis-methodology\` \u6280\u80FD
|
|
263
|
-
- \u4F7F\u7528 5W2H \u548C SCQA \u660E\u786E\u95EE\u9898
|
|
264
|
-
- \u4F7F\u7528 MECE \u548C\u8BAE\u9898\u6811\u62C6\u89E3\u4E3A\u5B50\u95EE\u9898
|
|
265
|
-
- \u4F7F\u7528\u56DB\u8C61\u9650\u77E9\u9635\u6392\u5E8F\u4F18\u5148\u7EA7
|
|
266
|
-
3. **\u521B\u5EFA\u5F85\u529E\u5217\u8868**\uFF1A\u6BCF\u4E2A\u5B50\u95EE\u9898\u4F5C\u4E3A\u72EC\u7ACB\u4EFB\u52A1
|
|
267
|
-
|
|
268
|
-
### \u6B65\u9AA4 1\uFF1A\u6570\u636E\u5E93\u6A21\u5F0F\u63A2\u7D22\uFF08\u5982\u9700\u8981\uFF09
|
|
269
|
-
|
|
270
|
-
\u4F7F\u7528 \`sql-query\` \u6280\u80FD\uFF1A
|
|
271
|
-
1. \u68C0\u67E5 \`/db_schema.md\` \u662F\u5426\u5B58\u5728
|
|
272
|
-
2. \u5982\u9700\u8981\uFF0C\u63A2\u7D22\u8868\u7ED3\u6784
|
|
273
|
-
3. \u5C06\u6A21\u5F0F\u6587\u6863\u5199\u5165 \`/db_schema.md\`
|
|
274
|
-
|
|
275
|
-
### \u6B65\u9AA4 2\uFF1A\u8FED\u4EE3\u5206\u6790\u6267\u884C
|
|
276
|
-
|
|
277
|
-
\u5BF9\u6BCF\u4E2A\u5F85\u529E\u4EFB\u52A1\uFF1A
|
|
278
|
-
|
|
279
|
-
**2.1 \u6570\u636E\u68C0\u7D22**\uFF1A
|
|
280
|
-
- \u59D4\u6258 sql-builder-agent \u6267\u884C\u67E5\u8BE2
|
|
281
|
-
- \u9A8C\u8BC1\u67E5\u8BE2\u7ED3\u679C\u7684\u8D28\u91CF\u548C\u5B8C\u6574\u6027
|
|
282
|
-
|
|
283
|
-
**2.2 \u6570\u636E\u5206\u6790**\uFF1A
|
|
284
|
-
- \u59D4\u6258 data-analysis-agent \u5206\u6790\u6570\u636E
|
|
285
|
-
- \u8BF7\u6C42\u5173\u952E\u53D1\u73B0\u3001\u4E1A\u52A1\u89E3\u91CA\u548C\u53EF\u89C6\u5316\u5EFA\u8BAE
|
|
286
|
-
|
|
287
|
-
**2.3 \u53EF\u89C6\u5316\u8BBE\u8BA1**\uFF1A
|
|
288
|
-
- \u4F7F\u7528 \`data-visualization\` \u6280\u80FD
|
|
289
|
-
- \u6839\u636E\u5206\u6790\u7ED3\u679C\u9009\u62E9\u5408\u9002\u7684\u56FE\u8868\u7C7B\u578B
|
|
290
|
-
- \u751F\u6210\u5B8C\u6574\u7684 ECharts \u914D\u7F6E
|
|
291
|
-
|
|
292
|
-
**2.4 \u6587\u6863\u5316**\uFF1A
|
|
293
|
-
- \u5199\u5165 \`/topic_[sub_topic_name].md\`\uFF1A
|
|
294
|
-
- \u4E1A\u52A1\u95EE\u9898/\u76EE\u6807
|
|
295
|
-
- SQL \u67E5\u8BE2
|
|
296
|
-
- \u67E5\u8BE2\u7ED3\u679C
|
|
297
|
-
- \u5206\u6790\u6D1E\u5BDF
|
|
298
|
-
- \u56FE\u8868\u914D\u7F6E\uFF08\u4F7F\u7528 \`data-visualization\` \u6280\u80FD\u751F\u6210\uFF09
|
|
299
|
-
- \u5173\u952E\u8981\u70B9
|
|
300
|
-
|
|
301
|
-
**2.5 \u8FDB\u5EA6\u7BA1\u7406**\uFF1A
|
|
302
|
-
- \u6807\u8BB0\u4EFB\u52A1\u5B8C\u6210\uFF0C\u66F4\u65B0\u5F85\u529E\u5217\u8868
|
|
303
|
-
- \u9A8C\u8BC1\u5206\u6790\u56DE\u7B54\u4E86\u9884\u671F\u95EE\u9898
|
|
304
|
-
|
|
305
|
-
### \u6B65\u9AA4 3\uFF1A\u7EFC\u5408\u4E0E\u6A21\u5F0F\u8BC6\u522B
|
|
306
|
-
|
|
307
|
-
1. \u8BFB\u53D6\u6240\u6709 \`/topic_*.md\` \u6587\u4EF6
|
|
308
|
-
2. \u5E94\u7528 \`analysis-methodology\` \u4E2D\u7684\u6A21\u5F0F\u8BC6\u522B\u65B9\u6CD5
|
|
309
|
-
3. \u8BC6\u522B\u8DE8\u9886\u57DF\u4E3B\u9898\u3001\u8D8B\u52BF\u3001\u5F02\u5E38\u503C
|
|
310
|
-
4. \u5E94\u7528 80/20 \u539F\u5219\uFF0C\u6309\u4E1A\u52A1\u5F71\u54CD\u6392\u5E8F
|
|
311
|
-
5. \u51C6\u5907\u6267\u884C\u7EA7\u522B\u7684\u7EFC\u5408\u6458\u8981
|
|
312
|
-
|
|
313
|
-
### \u6B65\u9AA4 4\uFF1A\u751F\u6210\u5206\u6790\u62A5\u544A
|
|
314
|
-
|
|
315
|
-
\u4F7F\u7528 \`notebook-report\` \u6280\u80FD\uFF1A
|
|
316
|
-
- \u6574\u5408\u6240\u6709\u5206\u6790\u6B65\u9AA4
|
|
317
|
-
- \u751F\u6210\u7B14\u8BB0\u672C\u98CE\u683C\u62A5\u544A
|
|
318
|
-
- \u5305\u542B\u6267\u884C\u6458\u8981\u3001\u5206\u6790\u6B65\u9AA4\u3001\u7ED3\u8BBA
|
|
319
|
-
|
|
320
|
-
## \u6280\u80FD\u7EC4\u5408\u4F7F\u7528
|
|
321
|
-
|
|
322
|
-
\u6839\u636E\u5206\u6790\u9636\u6BB5\u9009\u62E9\u5408\u9002\u7684\u6280\u80FD\uFF1A
|
|
323
|
-
- **\u89C4\u5212\u9636\u6BB5**\uFF1A\`analysis-methodology\`
|
|
324
|
-
- **\u6570\u636E\u83B7\u53D6**\uFF1A\`sql-query\`
|
|
325
|
-
- **\u53EF\u89C6\u5316\u8BBE\u8BA1**\uFF1A\`data-visualization\`
|
|
326
|
-
- **\u62A5\u544A\u751F\u6210**\uFF1A\`notebook-report\`
|
|
327
|
-
|
|
328
|
-
## \u5173\u952E\u5B9E\u8DF5
|
|
329
|
-
|
|
330
|
-
- **\u5047\u8BBE\u9A71\u52A8**\uFF1A\u63D0\u51FA\u5047\u8BBE\uFF0C\u7528\u6570\u636E\u9A8C\u8BC1\uFF0C\u5FEB\u901F\u8C03\u6574
|
|
331
|
-
- **\u8FED\u4EE3\u4F18\u5316**\uFF1A\u6839\u636E\u53D1\u73B0\u4F18\u5316\u67E5\u8BE2\u548C\u5206\u6790
|
|
332
|
-
- **\u5B8C\u6574\u6587\u6863\u5316**\uFF1A\u8BB0\u5F55\u95EE\u9898\u3001\u67E5\u8BE2\u3001\u7ED3\u679C\u3001\u6D1E\u5BDF
|
|
333
|
-
- **\u8D28\u91CF\u4F18\u5148**\uFF1A\u786E\u4FDD\u6BCF\u6B65\u5B8C\u6574\u51C6\u786E\u540E\u518D\u7EE7\u7EED
|
|
334
|
-
- **\u4E1A\u52A1\u805A\u7126**\uFF1A\u5C06\u6280\u672F\u53D1\u73B0\u4E0E\u4E1A\u52A1\u5F71\u54CD\u5173\u8054
|
|
335
|
-
|
|
336
|
-
## \u9519\u8BEF\u5904\u7406
|
|
337
|
-
|
|
338
|
-
- **\u67E5\u8BE2\u9519\u8BEF**\uFF1A\u4E0E sql-builder-agent \u534F\u4F5C\u8C03\u8BD5
|
|
339
|
-
- **\u6570\u636E\u8D28\u91CF\u95EE\u9898**\uFF1A\u8BB0\u5F55\u5E76\u8C03\u6574\u5206\u6790
|
|
340
|
-
- **\u610F\u5916\u7ED3\u679C**\uFF1A\u8C03\u67E5\u5F02\u5E38\uFF0C\u53EF\u80FD\u63ED\u793A\u91CD\u8981\u6D1E\u5BDF
|
|
341
|
-
- **\u7F3A\u5931\u6570\u636E**\uFF1A\u8BC6\u522B\u5DEE\u8DDD\uFF0C\u8C03\u6574\u5206\u6790\u8303\u56F4
|
|
342
|
-
- **\u65B0\u95EE\u9898**\uFF1A\u6DFB\u52A0\u65B0\u5F85\u529E\u4E8B\u9879\u7EE7\u7EED\u63A2\u7D22
|
|
343
|
-
`
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
// src/agents/data_agent/skills/data-visualization.ts
|
|
347
|
-
var dataVisualization = {
|
|
348
|
-
name: "data-visualization",
|
|
349
|
-
description: "\u4E3A\u6570\u636E\u5206\u6790\u7ED3\u679C\u9009\u62E9\u5408\u9002\u7684\u56FE\u8868\u7C7B\u578B\u5E76\u751F\u6210 ECharts \u914D\u7F6E\u3002\u9002\u7528\u4E8E\u9700\u8981\u5C06\u67E5\u8BE2\u7ED3\u679C\u53EF\u89C6\u5316\u4E3A\u67F1\u72B6\u56FE\u3001\u6298\u7EBF\u56FE\u3001\u997C\u56FE\u3001\u6563\u70B9\u56FE\u7B49\u56FE\u8868\u7684\u573A\u666F\u3002",
|
|
350
|
-
prompt: `## \u56FE\u8868\u7C7B\u578B\u9009\u62E9\u6307\u5357
|
|
351
|
-
|
|
352
|
-
\u6839\u636E\u6570\u636E\u7279\u5F81\u548C\u4E1A\u52A1\u95EE\u9898\u9009\u62E9\u6700\u5408\u9002\u7684\u56FE\u8868\u7C7B\u578B\uFF1A
|
|
353
|
-
|
|
354
|
-
- **\u67F1\u72B6\u56FE** (bar): \u6BD4\u8F83\u7C7B\u522B\u6216\u65F6\u95F4\u5468\u671F
|
|
355
|
-
- \u4F7F\u7528 category xAxis\uFF0Cvalue yAxis
|
|
356
|
-
- \u591A\u7CFB\u5217\u7528\u4E8E\u5206\u7EC4/\u5806\u53E0\u67F1\u72B6\u56FE
|
|
357
|
-
|
|
358
|
-
- **\u6298\u7EBF\u56FE** (line): \u5C55\u793A\u65F6\u95F4\u8D8B\u52BF
|
|
359
|
-
- \u4F7F\u7528 category/time xAxis\uFF0Cvalue yAxis
|
|
360
|
-
- \u591A\u7CFB\u5217\u5C55\u793A\u591A\u4E2A\u6307\u6807
|
|
361
|
-
|
|
362
|
-
- **\u997C\u56FE** (pie): \u5C55\u793A\u6784\u6210/\u767E\u5206\u6BD4
|
|
363
|
-
- \u65E0\u9700 xAxis/yAxis
|
|
364
|
-
- \u6570\u636E\u683C\u5F0F: [{value: number, name: string}, ...]
|
|
365
|
-
- \u4F7F\u7528 radius: ["40%", "70%"] \u521B\u5EFA\u73AF\u5F62\u56FE
|
|
366
|
-
|
|
367
|
-
- **\u6563\u70B9\u56FE** (scatter): \u76F8\u5173\u6027\u5206\u6790
|
|
368
|
-
- \u4F7F\u7528 value xAxis \u548C value yAxis
|
|
369
|
-
- \u6570\u636E\u683C\u5F0F: [[x, y], [x, y], ...]
|
|
370
|
-
|
|
371
|
-
- **\u70ED\u529B\u56FE** (heatmap): \u591A\u7EF4\u6570\u636E
|
|
372
|
-
- \u9700\u8981 category xAxis \u548C yAxis
|
|
373
|
-
- \u6570\u636E\u683C\u5F0F: [[xIndex, yIndex, value], ...]
|
|
374
|
-
|
|
375
|
-
## ECharts \u914D\u7F6E\u8981\u6C42
|
|
376
|
-
|
|
377
|
-
\u751F\u6210\u5B8C\u6574\u7684 ECharts \u914D\u7F6E\uFF0C\u5FC5\u987B\u5305\u542B\uFF1A
|
|
378
|
-
|
|
379
|
-
\`\`\`json
|
|
380
|
-
{
|
|
381
|
-
"table": [...], // \u539F\u59CB\u6570\u636E\u8868\u683C
|
|
382
|
-
"echarts": {
|
|
383
|
-
"title": {"text": "\u6E05\u6670\u7684\u56FE\u8868\u6807\u9898"},
|
|
384
|
-
"tooltip": {
|
|
385
|
-
"trigger": "axis", // bar/line \u7528 "axis", pie/scatter \u7528 "item"
|
|
386
|
-
"formatter": "..." // \u53EF\u9009\uFF1A\u81EA\u5B9A\u4E49\u683C\u5F0F\u5316
|
|
387
|
-
},
|
|
388
|
-
"legend": {...}, // \u591A\u7CFB\u5217\u65F6\u5FC5\u9700
|
|
389
|
-
"xAxis": {
|
|
390
|
-
"type": "category", // \u6216 "time", "value"
|
|
391
|
-
"name": "X\u8F74\u540D\u79F0",
|
|
392
|
-
"data": [...] // category \u7C7B\u578B\u65F6\u5FC5\u9700
|
|
393
|
-
},
|
|
394
|
-
"yAxis": {
|
|
395
|
-
"type": "value",
|
|
396
|
-
"name": "Y\u8F74\u540D\u79F0"
|
|
397
|
-
},
|
|
398
|
-
"series": [{
|
|
399
|
-
"type": "bar|line|pie|scatter|heatmap",
|
|
400
|
-
"name": "\u7CFB\u5217\u540D\u79F0",
|
|
401
|
-
"data": [...],
|
|
402
|
-
"label": {...} // \u53EF\u9009\uFF1A\u663E\u793A\u6570\u503C
|
|
403
|
-
}],
|
|
404
|
-
"grid": {...} // \u53EF\u9009\uFF1A\u63A7\u5236\u8FB9\u8DDD
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
\`\`\`
|
|
408
|
-
|
|
409
|
-
## \u6700\u4F73\u5B9E\u8DF5
|
|
410
|
-
|
|
411
|
-
- \u56FE\u8868\u6807\u9898\u6E05\u6670\u63CF\u8FF0\u4E1A\u52A1\u95EE\u9898
|
|
412
|
-
- \u8F74\u6807\u7B7E\u4F7F\u7528\u4E1A\u52A1\u672F\u8BED\uFF0C\u800C\u975E\u6280\u672F\u5B57\u6BB5\u540D
|
|
413
|
-
- \u6570\u503C\u683C\u5F0F\u5316\uFF1A\u767E\u5206\u6BD4\u3001\u8D27\u5E01\u3001\u5343\u5206\u4F4D
|
|
414
|
-
- \u65F6\u95F4\u5E8F\u5217\u4F7F\u7528 "xAxis.type: 'time'" \u5E76\u6B63\u786E\u683C\u5F0F\u5316\u65E5\u671F
|
|
415
|
-
- \u591A\u7CFB\u5217\u65F6\u4F7F\u7528 legend \u533A\u5206
|
|
416
|
-
- \u91CD\u8981\u6570\u503C\u5728\u56FE\u8868\u4E0A\u76F4\u63A5\u6807\u6CE8\uFF08series.label\uFF09
|
|
417
|
-
|
|
418
|
-
## \u8F93\u51FA\u683C\u5F0F
|
|
419
|
-
|
|
420
|
-
\u63D0\u4F9B\u5B8C\u6574\u7684 chart JSON \u914D\u7F6E\uFF0C\u53EF\u76F4\u63A5\u7528\u4E8E\u6E32\u67D3\u3002
|
|
421
|
-
`
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
// src/agents/data_agent/skills/sql-query.ts
|
|
425
|
-
var sqlQuery = {
|
|
426
|
-
name: "sql-query",
|
|
427
|
-
description: "\u751F\u6210\u548C\u6267\u884C SQL \u67E5\u8BE2\u4EE5\u68C0\u7D22\u4E1A\u52A1\u6570\u636E\u3002\u9002\u7528\u4E8E\u9700\u8981\u4ECE\u6570\u636E\u5E93\u83B7\u53D6\u6570\u636E\u3001\u63A2\u7D22\u8868\u7ED3\u6784\u3001\u9A8C\u8BC1\u67E5\u8BE2\u6B63\u786E\u6027\u7684\u573A\u666F\u3002\u59D4\u6258\u7ED9 sql-builder-agent \u6267\u884C\u3002",
|
|
428
|
-
prompt: `## \u59D4\u6258\u7ED9 sql-builder-agent
|
|
429
|
-
|
|
430
|
-
\u6240\u6709 SQL \u76F8\u5173\u64CD\u4F5C\u90FD\u59D4\u6258\u7ED9 sql-builder-agent \u5B50\u4EE3\u7406\u6267\u884C\u3002
|
|
431
|
-
|
|
432
|
-
## \u6570\u636E\u5E93\u6A21\u5F0F\u63A2\u7D22
|
|
433
|
-
|
|
434
|
-
**\u8BF7\u6C42\u6A21\u5F0F\u4FE1\u606F**\uFF1A
|
|
435
|
-
- "\u8BF7\u5217\u51FA\u6570\u636E\u5E93\u4E2D\u6240\u6709\u53EF\u7528\u7684\u8868"
|
|
436
|
-
- "\u8BF7\u663E\u793A\u8868 [X] \u7684\u6A21\u5F0F\uFF0C\u5305\u62EC\u5217\u3001\u6570\u636E\u7C7B\u578B\u548C\u5173\u7CFB"
|
|
437
|
-
|
|
438
|
-
**\u68C0\u67E5\u73B0\u6709\u6587\u6863**\uFF1A
|
|
439
|
-
- \u5148\u8BFB\u53D6 \`/db_schema.md\`\uFF08\u5982\u5B58\u5728\uFF09
|
|
440
|
-
- \u4EC5\u5728\u9700\u8981\u65F6\u8BF7\u6C42\u65B0\u7684\u6A21\u5F0F\u63A2\u7D22
|
|
441
|
-
|
|
442
|
-
## \u67E5\u8BE2\u751F\u6210\u4E0E\u6267\u884C
|
|
443
|
-
|
|
444
|
-
**\u63D0\u4F9B\u6E05\u6670\u7684\u4E1A\u52A1\u9700\u6C42**\uFF1A
|
|
445
|
-
1. **\u4E1A\u52A1\u95EE\u9898**\uFF1A\u660E\u786E\u8981\u56DE\u7B54\u7684\u95EE\u9898
|
|
446
|
-
2. **\u6307\u6807**\uFF1A\u9700\u8981\u8BA1\u7B97\u7684\u4E1A\u52A1\u6307\u6807\uFF08\u6536\u5165\u3001\u8BA2\u5355\u6570\u3001\u8F6C\u5316\u7387\u7B49\uFF09
|
|
447
|
-
3. **\u7EF4\u5EA6**\uFF1A\u5206\u7EC4\u7EF4\u5EA6\uFF08\u5730\u533A\u3001\u6E20\u9053\u3001\u4EA7\u54C1\u7C7B\u522B\u7B49\uFF09
|
|
448
|
-
4. **\u7B5B\u9009\u6761\u4EF6**\uFF1A\u65F6\u95F4\u8303\u56F4\u3001\u72B6\u6001\u3001\u7C7B\u522B\u7B49
|
|
449
|
-
5. **\u6BD4\u8F83\u9700\u6C42**\uFF1A\u540C\u6BD4\u3001\u73AF\u6BD4\u3001\u76EE\u6807\u5BF9\u6BD4\u7B49
|
|
450
|
-
|
|
451
|
-
**\u8BF7\u6C42\u683C\u5F0F\u793A\u4F8B**\uFF1A
|
|
452
|
-
"\u6211\u9700\u8981\u6309\u5730\u533A\u6BD4\u8F83 2024 \u5E74\u7B2C\u4E09\u5B63\u5EA6\u4E0E 2023 \u5E74\u7B2C\u4E09\u5B63\u5EA6\u7684\u6536\u5165\u3002\u8BF7\u751F\u6210\u5E76\u6267\u884C SQL \u67E5\u8BE2\u3002"
|
|
453
|
-
|
|
454
|
-
"\u8BF7\u67E5\u8BE2\u8FC7\u53BB 6 \u4E2A\u6708\u6BCF\u4E2A\u6708\u7684\u8BA2\u5355\u91CF\u548C\u5E73\u5747\u8BA2\u5355\u91D1\u989D\uFF0C\u6309\u6E20\u9053\u5206\u7EC4\u3002"
|
|
455
|
-
|
|
456
|
-
## \u63A5\u6536\u4E0E\u9A8C\u8BC1\u7ED3\u679C
|
|
457
|
-
|
|
458
|
-
sql-builder-agent \u4F1A\u8FD4\u56DE\uFF1A
|
|
459
|
-
- **SQL \u67E5\u8BE2**\uFF1A\u683C\u5F0F\u6E05\u6670\u7684\u5B8C\u6574\u67E5\u8BE2
|
|
460
|
-
- **\u67E5\u8BE2\u7ED3\u679C**\uFF1A\u8FD4\u56DE\u7684\u6570\u636E
|
|
461
|
-
- **\u6A21\u5F0F\u4FE1\u606F**\uFF1A\u4F7F\u7528\u7684\u8868\u7ED3\u6784\u4FE1\u606F
|
|
462
|
-
|
|
463
|
-
**\u9A8C\u8BC1\u8981\u70B9**\uFF1A
|
|
464
|
-
- \u67E5\u8BE2\u662F\u5426\u6B63\u786E\u56DE\u7B54\u4E86\u4E1A\u52A1\u95EE\u9898
|
|
465
|
-
- \u6570\u636E\u8D28\u91CF\uFF08NULL \u503C\u3001\u5F02\u5E38\u503C\uFF09
|
|
466
|
-
- \u7ED3\u679C\u5B8C\u6574\u6027\uFF08\u884C\u6570\u3001\u65F6\u95F4\u8303\u56F4\uFF09
|
|
467
|
-
- \u5217\u540D\u662F\u5426\u4E1A\u52A1\u53CB\u597D
|
|
468
|
-
|
|
469
|
-
## \u9519\u8BEF\u5904\u7406
|
|
470
|
-
|
|
471
|
-
\u5982\u9047\u5230\u67E5\u8BE2\u9519\u8BEF\uFF1A
|
|
472
|
-
- \u5206\u6790\u9519\u8BEF\u4FE1\u606F
|
|
473
|
-
- \u68C0\u67E5\u8868\u540D\u3001\u5217\u540D\u662F\u5426\u6B63\u786E
|
|
474
|
-
- \u9A8C\u8BC1 JOIN \u6761\u4EF6\u548C\u6570\u636E\u7C7B\u578B
|
|
475
|
-
- \u8BF7\u6C42 sql-builder-agent \u4FEE\u6B63\u5E76\u91CD\u65B0\u6267\u884C
|
|
476
|
-
|
|
477
|
-
## \u6587\u6863\u5316
|
|
478
|
-
|
|
479
|
-
\u5C06\u4F7F\u7528\u7684 SQL \u67E5\u8BE2\u548C\u7ED3\u679C\u4FDD\u5B58\u5230\u5206\u6790\u6587\u6863\u4E2D\uFF0C\u4FBF\u4E8E\u540E\u7EED\u53C2\u8003\u548C\u590D\u73B0\u3002
|
|
480
|
-
`
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
// src/agents/data_agent/skills/analysis-methodology.ts
|
|
484
|
-
var analysisMethodology = {
|
|
485
|
-
name: "analysis-methodology",
|
|
486
|
-
description: "\u5E94\u7528\u7ED3\u6784\u5316\u5206\u6790\u65B9\u6CD5\u8BBA\uFF085W2H\u3001SCQA\u3001MECE\u30015 Whys\u3001\u5E15\u7D2F\u6258\u539F\u5219\u7B49\uFF09\u6765\u7406\u89E3\u95EE\u9898\u3001\u62C6\u89E3\u4EFB\u52A1\u3001\u8BC6\u522B\u6839\u672C\u539F\u56E0\u548C\u4F18\u5148\u7EA7\u6392\u5E8F\u3002\u9002\u7528\u4E8E\u590D\u6742\u4E1A\u52A1\u95EE\u9898\u7684\u7ED3\u6784\u5316\u5206\u6790\u548C\u89C4\u5212\u3002",
|
|
487
|
-
prompt: `## \u7ED3\u6784\u5316\u5206\u6790\u65B9\u6CD5\u8BBA
|
|
488
|
-
|
|
489
|
-
### \u95EE\u9898\u5B9A\u4E49\uFF085W2H + SCQA\uFF09
|
|
490
|
-
|
|
491
|
-
**5W2H \u6A21\u578B**\uFF1A\u5168\u9762\u68B3\u7406\u95EE\u9898\u8FB9\u754C
|
|
492
|
-
- What: \u95EE\u9898\u672C\u8D28
|
|
493
|
-
- Why: \u89E3\u51B3\u76EE\u6807\u548C\u52A8\u673A
|
|
494
|
-
- Who: \u53D7\u5F71\u54CD\u65B9\u548C\u51B3\u7B56\u8005
|
|
495
|
-
- When: \u53D1\u751F\u65F6\u95F4\u548C\u7D27\u6025\u7A0B\u5EA6
|
|
496
|
-
- Where: \u53D1\u751F\u73AF\u8282/\u5730\u533A/\u6A21\u5757
|
|
497
|
-
- How: \u5F53\u524D\u5904\u7406\u65B9\u5F0F
|
|
498
|
-
- How much: \u5F71\u54CD\u9762\u548C\u6210\u672C
|
|
499
|
-
|
|
500
|
-
**SCQA \u6A21\u578B**\uFF1A\u7406\u6E05\u95EE\u9898\u4E0A\u4E0B\u6587
|
|
501
|
-
- Situation: \u73B0\u72B6\u4E8B\u5B9E
|
|
502
|
-
- Complication: \u53D8\u5316/\u6311\u6218
|
|
503
|
-
- Question: \u5177\u4F53\u96BE\u9898
|
|
504
|
-
- Answer: \u89E3\u51B3\u65B9\u6848
|
|
505
|
-
|
|
506
|
-
### \u95EE\u9898\u62C6\u89E3\uFF08MECE + \u8BAE\u9898\u6811\uFF09
|
|
507
|
-
|
|
508
|
-
**MECE \u539F\u5219**\uFF1A\u76F8\u4E92\u72EC\u7ACB\uFF0C\u5B8C\u5168\u7A77\u5C3D
|
|
509
|
-
- \u4E0D\u91CD\u53E0\u3001\u4E0D\u9057\u6F0F
|
|
510
|
-
- \u786E\u4FDD\u5206\u7C7B\u903B\u8F91\u6E05\u6670
|
|
511
|
-
|
|
512
|
-
**\u8BAE\u9898\u6811**\uFF1A\u6811\u72B6\u7ED3\u6784\u62C6\u89E3
|
|
513
|
-
- \u57FA\u4E8E\u5047\u8BBE\uFF1A\u63D0\u9AD8\u5229\u6DA6 \u2192 \u589E\u52A0\u6536\u5165 OR \u964D\u4F4E\u6210\u672C
|
|
514
|
-
- \u57FA\u4E8E\u6D41\u7A0B\uFF1A\u8F6C\u5316\u7387\u4F4E \u2192 \u6D41\u91CF\u83B7\u53D6 \u2192 \u6CE8\u518C\u6FC0\u6D3B \u2192 \u7559\u5B58 \u2192 \u4ED8\u8D39
|
|
515
|
-
|
|
516
|
-
### \u6839\u672C\u539F\u56E0\u5206\u6790\uFF085 Whys + \u9C7C\u9AA8\u56FE\uFF09
|
|
517
|
-
|
|
518
|
-
**5 Whys**\uFF1A\u8FDE\u7EED\u8FFD\u95EE\u4E3A\u4EC0\u4E48\uFF0C\u76F4\u5230\u627E\u5230\u6839\u672C\u539F\u56E0
|
|
519
|
-
- \u907F\u514D\u8868\u9762\u75C7\u72B6\uFF0C\u627E\u5230\u6DF1\u5C42\u539F\u56E0
|
|
520
|
-
|
|
521
|
-
**\u9C7C\u9AA8\u56FE\uFF084M1E\uFF09**\uFF1A\u4ECE\u4E94\u4E2A\u7EF4\u5EA6\u5206\u6790
|
|
522
|
-
- \u4EBA\uFF08Man\uFF09\u3001\u673A\uFF08Machine\uFF09\u3001\u6599\uFF08Material\uFF09\u3001\u6CD5\uFF08Method\uFF09\u3001\u73AF\uFF08Environment\uFF09
|
|
523
|
-
|
|
524
|
-
### \u4F18\u5148\u7EA7\u6392\u5E8F\uFF08\u5E15\u7D2F\u6258 + \u827E\u68EE\u8C6A\u5A01\u5C14\u77E9\u9635\uFF09
|
|
525
|
-
|
|
526
|
-
**80/20 \u6CD5\u5219**\uFF1A\u8BC6\u522B\u5173\u952E\u7684 20% \u539F\u56E0
|
|
527
|
-
|
|
528
|
-
**\u56DB\u8C61\u9650\u77E9\u9635**\uFF1A\u6309\u91CD\u8981\u6027\u548C\u7D27\u6025\u7A0B\u5EA6\u6392\u5E8F
|
|
529
|
-
- \u91CD\u8981\u4E14\u7D27\u6025\uFF1A\u4F18\u5148\u5904\u7406
|
|
530
|
-
- \u91CD\u8981\u4E0D\u7D27\u6025\uFF1A\u8BA1\u5212\u5904\u7406
|
|
531
|
-
- \u7D27\u6025\u4E0D\u91CD\u8981\uFF1A\u5FEB\u901F\u5904\u7406
|
|
532
|
-
- \u4E0D\u91CD\u8981\u4E0D\u7D27\u6025\uFF1A\u53EF\u5FFD\u7565
|
|
533
|
-
|
|
534
|
-
### \u7EFC\u5408\u8868\u8FBE\uFF08\u91D1\u5B57\u5854\u539F\u7406\uFF09
|
|
535
|
-
|
|
536
|
-
- **\u7ED3\u8BBA\u5148\u884C**\uFF1A\u5148\u8BF4\u6700\u91CD\u8981\u7684\u7ED3\u679C
|
|
537
|
-
- **\u4EE5\u4E0A\u7EDF\u4E0B**\uFF1A\u4E0A\u5C42\u8BBA\u70B9\u603B\u7ED3\u4E0B\u5C42\u8BBA\u636E
|
|
538
|
-
- **\u5F52\u7C7B\u5206\u7EC4**\uFF1A\u903B\u8F91 MECE
|
|
539
|
-
- **\u903B\u8F91\u9012\u8FDB**\uFF1A\u6309\u65F6\u95F4/\u7A7A\u95F4/\u91CD\u8981\u6027\u6392\u5E8F
|
|
540
|
-
|
|
541
|
-
## \u5E94\u7528\u6D41\u7A0B
|
|
542
|
-
|
|
543
|
-
1. **\u95EE\u9898\u7406\u89E3**\uFF1A\u4F7F\u7528 5W2H \u548C SCQA \u660E\u786E\u95EE\u9898
|
|
544
|
-
2. **\u4EFB\u52A1\u62C6\u89E3**\uFF1A\u4F7F\u7528 MECE \u548C\u8BAE\u9898\u6811\u62C6\u89E3\u4E3A\u5B50\u95EE\u9898
|
|
545
|
-
3. **\u539F\u56E0\u5206\u6790**\uFF1A\u4F7F\u7528 5 Whys \u548C\u9C7C\u9AA8\u56FE\u627E\u5230\u6839\u672C\u539F\u56E0
|
|
546
|
-
4. **\u4F18\u5148\u7EA7\u6392\u5E8F**\uFF1A\u4F7F\u7528 80/20 \u548C\u56DB\u8C61\u9650\u77E9\u9635\u6392\u5E8F\u4EFB\u52A1
|
|
547
|
-
5. **\u7ED3\u679C\u8868\u8FBE**\uFF1A\u4F7F\u7528\u91D1\u5B57\u5854\u539F\u7406\u7EC4\u7EC7\u8F93\u51FA
|
|
548
|
-
|
|
549
|
-
## \u5047\u8BBE\u9A71\u52A8\u65B9\u6CD5
|
|
550
|
-
|
|
551
|
-
- \u5148\u63D0\u51FA\u5047\u8BBE\uFF0C\u7528\u6570\u636E\u9A8C\u8BC1
|
|
552
|
-
- \u5047\u8BBE\u9519\u8BEF\u65F6\u5FEB\u901F\u8C03\u6574\u65B9\u5411
|
|
553
|
-
- \u907F\u514D\u5217\u51FA\u6240\u6709\u53EF\u80FD\u6027\uFF0C\u805A\u7126\u5173\u952E\u8DEF\u5F84
|
|
554
|
-
`
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
// src/agents/data_agent/skills/notebook-report.ts
|
|
558
|
-
var notebookReport = {
|
|
559
|
-
name: "notebook-report",
|
|
560
|
-
description: "\u751F\u6210\u7B14\u8BB0\u672C\u98CE\u683C\u7684\u6570\u636E\u5206\u6790\u62A5\u544A\uFF0C\u5305\u542B\u6267\u884C\u6458\u8981\u3001\u5206\u6790\u6B65\u9AA4\uFF08SQL\u3001\u53EF\u89C6\u5316\u3001\u6D1E\u5BDF\uFF09\u548C\u7ED3\u8BBA\u3002\u9002\u7528\u4E8E\u9700\u8981\u5C06\u591A\u6B65\u9AA4\u5206\u6790\u6574\u5408\u4E3A\u5B8C\u6574\u3001\u53EF\u590D\u73B0\u7684\u5206\u6790\u62A5\u544A\u7684\u573A\u666F\u3002",
|
|
561
|
-
prompt: `
|
|
562
|
-
\u5982\u4F55\u53EF\u89C6\u5316\u6570\u636E\uFF0C\u8BF7\u901A\u8FC7data-visualization\u6280\u80FD\u4E86\u89E3\u3002
|
|
563
|
-
|
|
564
|
-
## \u62A5\u544A\u7ED3\u6784
|
|
565
|
-
|
|
566
|
-
### \u62A5\u544A\u6807\u9898\u90E8\u5206
|
|
567
|
-
|
|
568
|
-
- **\u6807\u9898**\uFF1A\u6E05\u6670\u3001\u63CF\u8FF0\u6027\u7684\u5206\u6790\u6807\u9898
|
|
569
|
-
- **\u4E0A\u4E0B\u6587**\uFF1A\u7B80\u8981\u4ECB\u7ECD\u5206\u6790\u5185\u5BB9\u548C\u539F\u56E0
|
|
570
|
-
- **\u6570\u636E\u6E90**\uFF1A\u6570\u636E\u5E93\u4FE1\u606F\u548C\u65F6\u95F4\u5468\u671F
|
|
571
|
-
- **\u6267\u884C\u6458\u8981**\uFF1A\u6240\u6709\u5173\u952E\u53D1\u73B0\u7684\u9AD8\u7EA7\u6458\u8981\uFF082-3 \u6BB5\uFF09
|
|
572
|
-
|
|
573
|
-
### \u5206\u6790\u6B65\u9AA4\uFF08\u7B14\u8BB0\u672C\u5355\u5143\u683C\uFF09
|
|
574
|
-
|
|
575
|
-
\u6BCF\u4E2A\u5206\u6790\u6B65\u9AA4\u662F\u4E00\u4E2A\u5B8C\u6574\u7684\u5355\u5143\u683C\uFF0C\u5305\u542B\uFF1A
|
|
576
|
-
|
|
577
|
-
\`\`\`markdown
|
|
578
|
-
## \u6B65\u9AA4 [N]\uFF1A[\u6B65\u9AA4\u6807\u9898]
|
|
579
|
-
|
|
580
|
-
### \u95EE\u9898 / \u76EE\u6807
|
|
581
|
-
[\u6B64\u6B65\u9AA4\u8981\u56DE\u7B54\u7684\u4E1A\u52A1\u95EE\u9898\uFF0C\u6765\u81EA topic_[sub_topic_name].md]
|
|
582
|
-
|
|
583
|
-
### SQL \u67E5\u8BE2
|
|
584
|
-
\`\`\`sql
|
|
585
|
-
[\u5B8C\u6574 SQL \u67E5\u8BE2\uFF0C\u5E26\u6CE8\u91CA\u8BF4\u660E]
|
|
586
|
-
\`\`\`
|
|
587
|
-
|
|
588
|
-
### \u6570\u636E\u53EF\u89C6\u5316
|
|
589
|
-
\`\`\`chart
|
|
590
|
-
{
|
|
591
|
-
"table": [...],
|
|
592
|
-
"echarts": {
|
|
593
|
-
"title": {"text": "[\u56FE\u8868\u6807\u9898]"},
|
|
594
|
-
"tooltip": {...},
|
|
595
|
-
"legend": {...},
|
|
596
|
-
"xAxis": {...},
|
|
597
|
-
"yAxis": {...},
|
|
598
|
-
"series": [...]
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
\`\`\`
|
|
602
|
-
|
|
603
|
-
### \u5173\u952E\u53D1\u73B0
|
|
604
|
-
[\u6765\u81EA data-analysis-agent \u7684\u6838\u5FC3\u6D1E\u5BDF\uFF0C\u7528\u4E1A\u52A1\u8BED\u8A00\u8868\u8FBE]
|
|
605
|
-
|
|
606
|
-
### \u4E1A\u52A1\u89E3\u91CA
|
|
607
|
-
[\u8FD9\u4E9B\u53D1\u73B0\u5BF9\u4E1A\u52A1\u7684\u610F\u4E49\u548C\u5F71\u54CD]
|
|
608
|
-
|
|
609
|
-
### \u5EFA\u8BAE
|
|
610
|
-
[\u57FA\u4E8E\u6B64\u5206\u6790\u7684\u5177\u4F53\u3001\u53EF\u64CD\u4F5C\u5EFA\u8BAE]
|
|
611
|
-
\`\`\`
|
|
612
|
-
|
|
613
|
-
### \u62A5\u544A\u7ED3\u8BBA
|
|
614
|
-
|
|
615
|
-
- **\u6240\u6709\u53D1\u73B0\u7684\u6458\u8981**\uFF1A\u7EFC\u5408\u6240\u6709\u6B65\u9AA4\u7684\u6D1E\u5BDF
|
|
616
|
-
- **\u603B\u4F53\u5EFA\u8BAE**\uFF1A\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\u7684\u53EF\u64CD\u4F5C\u5EFA\u8BAE
|
|
617
|
-
- **\u540E\u7EED\u5206\u6790**\uFF1A\u5EFA\u8BAE\u7684\u4E0B\u4E00\u6B65\u5206\u6790\u65B9\u5411\uFF08\u5982\u9002\u7528\uFF09
|
|
618
|
-
|
|
619
|
-
## \u62A5\u544A\u7F16\u5199\u539F\u5219
|
|
620
|
-
|
|
621
|
-
- **\u6545\u4E8B\u6027**\uFF1A\u5C06\u5206\u6790\u7EC4\u7EC7\u6210\u8FDE\u8D2F\u7684\u6545\u4E8B\uFF0C\u800C\u975E\u6280\u672F\u62A5\u544A
|
|
622
|
-
- **\u4E1A\u52A1\u805A\u7126**\uFF1A\u4F7F\u7528\u4E1A\u52A1\u672F\u8BED\uFF0C\u907F\u514D\u6280\u672F jargon
|
|
623
|
-
- **\u6570\u636E\u9A71\u52A8**\uFF1A\u5C06\u5177\u4F53\u6570\u503C\u81EA\u7136\u878D\u5165\u53D9\u8FF0
|
|
624
|
-
- **\u53EF\u64CD\u4F5C**\uFF1A\u6BCF\u4E2A\u53D1\u73B0\u90FD\u5E94\u5BFC\u5411\u53EF\u6267\u884C\u7684\u5EFA\u8BAE
|
|
625
|
-
- **\u903B\u8F91\u9012\u8FDB**\uFF1A\u6B65\u9AA4\u4E4B\u95F4\u8981\u6709\u6E05\u6670\u7684\u903B\u8F91\u8FDE\u63A5
|
|
626
|
-
|
|
627
|
-
## \u6570\u636E\u6765\u6E90
|
|
628
|
-
|
|
629
|
-
\u62A5\u544A\u5E94\u57FA\u4E8E\uFF1A
|
|
630
|
-
- \`/question.md\`\uFF1A\u539F\u59CB\u4E1A\u52A1\u95EE\u9898
|
|
631
|
-
- \`/topic_*.md\`\uFF1A\u5404\u5B50\u4E3B\u9898\u7684\u5206\u6790\u7ED3\u679C
|
|
632
|
-
- \u6B65\u9AA4 3 \u7684\u7EFC\u5408\u6458\u8981
|
|
633
|
-
|
|
634
|
-
## \u8F93\u51FA\u683C\u5F0F
|
|
635
|
-
|
|
636
|
-
\u751F\u6210\u5B8C\u6574\u7684 Markdown \u683C\u5F0F\u62A5\u544A\uFF0C\u5305\u542B\u6240\u6709\u5206\u6790\u6B65\u9AA4\u3001\u56FE\u8868\u914D\u7F6E\u548C\u6D1E\u5BDF\u3002
|
|
637
|
-
`
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
// src/agents/data_agent/skills/infographic-creator.ts
|
|
641
|
-
var infographicCreator = {
|
|
642
|
-
name: "infographic-creator",
|
|
643
|
-
description: "\u521B\u5EFA\u4FE1\u606F\u56FE\u8868\uFF0C\u5C06\u6570\u636E\u53EF\u89C6\u5316\u4E3A\u6613\u4E8E\u7406\u89E3\u7684\u56FE\u8868\u3002\u9002\u7528\u4E8E\u9700\u8981\u5C06\u6570\u636E\u53EF\u89C6\u5316\u4E3A\u6613\u4E8E\u7406\u89E3\u7684\u56FE\u8868\u7684\u573A\u666F\u3002",
|
|
644
|
-
prompt: `
|
|
645
|
-
|
|
646
|
-
\u4FE1\u606F\u56FE\uFF08Infographic\uFF09\u5C06\u6570\u636E\u3001\u4FE1\u606F\u4E0E\u77E5\u8BC6\u8F6C\u5316\u4E3A\u53EF\u611F\u77E5\u7684\u89C6\u89C9\u8BED\u8A00\u3002\u5B83\u7ED3\u5408\u89C6\u89C9\u8BBE\u8BA1\u4E0E\u6570\u636E\u53EF\u89C6\u5316\uFF0C\u7528\u76F4\u89C2\u7B26\u53F7\u538B\u7F29\u590D\u6742\u4FE1\u606F\uFF0C\u5E2E\u52A9\u53D7\u4F17\u5FEB\u901F\u7406\u89E3\u5E76\u8BB0\u4F4F\u8981\u70B9\u3002
|
|
647
|
-
|
|
648
|
-
Infographic = Information Structure + Visual Expression
|
|
649
|
-
|
|
650
|
-
\u672C\u4EFB\u52A1\u4F7F\u7528 AntV Infographic \u521B\u5EFA\u53EF\u89C6\u5316\u4FE1\u606F\u56FE\u3002
|
|
651
|
-
|
|
652
|
-
\u5728\u5F00\u59CB\u4EFB\u52A1\u524D\uFF0C\u9700\u8981\u7406\u89E3 AntV Infographic \u8BED\u6CD5\u89C4\u8303\uFF0C\u5305\u62EC\u6A21\u677F\u5217\u8868\u3001\u6570\u636E\u7ED3\u6784\u3001\u4E3B\u9898\u7B49\u3002
|
|
653
|
-
|
|
654
|
-
\u89C4\u8303
|
|
655
|
-
AntV Infographic \u8BED\u6CD5
|
|
656
|
-
AntV Infographic \u8BED\u6CD5\u662F\u4E00\u79CD\u81EA\u5B9A\u4E49\u7684 DSL\uFF0C\u7528\u4E8E\u63CF\u8FF0\u4FE1\u606F\u56FE\u6E32\u67D3\u914D\u7F6E\u3002\u5B83\u4F7F\u7528\u7F29\u8FDB\u63CF\u8FF0\u4FE1\u606F\uFF0C\u5177\u6709\u8F83\u5F3A\u9C81\u68D2\u6027\uFF0C\u4FBF\u4E8E AI \u6D41\u5F0F\u8F93\u51FA\u5E76\u6E32\u67D3\u4FE1\u606F\u56FE\u3002\u4E3B\u8981\u5305\u542B\u4EE5\u4E0B\u4FE1\u606F\uFF1A
|
|
657
|
-
|
|
658
|
-
template\uFF1A\u7528\u6A21\u677F\u8868\u8FBE\u6587\u5B57\u4FE1\u606F\u7ED3\u6784\u3002
|
|
659
|
-
data\uFF1A\u4FE1\u606F\u56FE\u6570\u636E\uFF0C\u5305\u542B title\u3001desc\u3001\u6570\u636E\u9879\u7B49\u3002\u6570\u636E\u9879\u901A\u5E38\u5305\u542B label\u3001desc\u3001icon \u7B49\u5B57\u6BB5\u3002
|
|
660
|
-
theme\uFF1A\u4E3B\u9898\u5305\u542B palette\u3001font \u7B49\u6837\u5F0F\u914D\u7F6E\u3002
|
|
661
|
-
\u4F8B\u5982\uFF1A
|
|
662
|
-
|
|
663
|
-
\`\`\`infographic
|
|
664
|
-
infographic list-row-horizontal-icon-arrow
|
|
665
|
-
data
|
|
666
|
-
title Title
|
|
667
|
-
desc Description
|
|
668
|
-
lists
|
|
669
|
-
- label Label
|
|
670
|
-
value 12.5
|
|
671
|
-
desc Explanation
|
|
672
|
-
icon document text
|
|
673
|
-
theme
|
|
674
|
-
palette #3b82f6 #8b5cf6 #f97316
|
|
675
|
-
\`\`\`
|
|
676
|
-
\u8BED\u6CD5\u89C4\u8303
|
|
677
|
-
\u7B2C\u4E00\u884C\u5FC5\u987B\u662F infographic <template-name>\uFF0C\u6A21\u677F\u4ECE\u4E0B\u65B9\u5217\u8868\u4E2D\u9009\u62E9\uFF08\u89C1\u201C\u53EF\u7528\u6A21\u677F\u201D\u90E8\u5206\uFF09\u3002
|
|
678
|
-
|
|
679
|
-
\u4F7F\u7528 data / theme \u5757\uFF0C\u5757\u5185\u7528\u4E24\u4E2A\u7A7A\u683C\u7F29\u8FDB\u3002
|
|
680
|
-
|
|
681
|
-
\u952E\u503C\u5BF9\u4F7F\u7528\u300C\u952E \u7A7A\u683C \u503C\u300D\uFF1B\u6570\u7EC4\u4F7F\u7528 - \u4F5C\u4E3A\u6761\u76EE\u524D\u7F00\u3002
|
|
682
|
-
|
|
683
|
-
icon \u4F7F\u7528\u56FE\u6807\u5173\u952E\u8BCD\uFF08\u5982 star fill\uFF09\u3002
|
|
684
|
-
|
|
685
|
-
data \u5E94\u5305\u542B title/desc + \u6A21\u677F\u5BF9\u5E94\u7684\u4E3B\u6570\u636E\u5B57\u6BB5\uFF08\u4E0D\u4E00\u5B9A\u662F items\uFF09\u3002
|
|
686
|
-
|
|
687
|
-
\u4E3B\u6570\u636E\u5B57\u6BB5\u9009\u62E9\uFF08\u53EA\u7528\u4E00\u4E2A\uFF0C\u907F\u514D\u6DF7\u7528\uFF09\uFF1A
|
|
688
|
-
|
|
689
|
-
list-* \u2192 lists
|
|
690
|
-
sequence-* \u2192 sequences\uFF08\u53EF\u9009 order asc|desc\uFF09
|
|
691
|
-
compare-* \u2192 compares\uFF08\u652F\u6301 children \u5206\u7EC4\u5BF9\u6BD4\uFF09\uFF0C\u53EF\u5305\u542B\u591A\u4E2A\u5BF9\u6BD4\u9879
|
|
692
|
-
hierarchy-structure \u2192 items\uFF08\u6BCF\u4E00\u9879\u5BF9\u5E94\u4E00\u4E2A\u72EC\u7ACB\u5C42\u7EA7\uFF0C\u6BCF\u4E00\u5C42\u7EA7\u53EF\u4EE5\u5305\u542B\u5B50\u9879\uFF0C\u6700\u591A\u53EF\u5D4C\u5957 3 \u5C42\uFF09
|
|
693
|
-
hierarchy-* \u2192 \u5355\u4E00 root\uFF08\u6811\u7ED3\u6784\uFF0C\u901A\u8FC7 children \u5D4C\u5957\uFF09\uFF1B
|
|
694
|
-
relation-* \u2192 nodes + relations\uFF1B\u7B80\u5355\u5173\u7CFB\u56FE\u53EF\u7701\u7565 nodes\uFF0C\u5728 relations \u4E2D\u7528\u7BAD\u5934\u8BED\u6CD5
|
|
695
|
-
chart-* \u2192 values\uFF08\u6570\u503C\u7EDF\u8BA1\uFF0C\u53EF\u9009 category\uFF09
|
|
696
|
-
\u4E0D\u786E\u5B9A\u65F6\u518D\u7528 items \u515C\u5E95
|
|
697
|
-
compare-binary-* / compare-hierarchy-left-right-* \u4E8C\u5143\u6A21\u677F\uFF1A\u5FC5\u987B\u4E24\u4E2A\u6839\u8282\u70B9\uFF0C\u6240\u6709\u5BF9\u6BD4\u9879\u6302\u5728\u8FD9\u4E24\u4E2A\u6839\u8282\u70B9\u7684 children
|
|
698
|
-
|
|
699
|
-
hierarchy-*\uFF1A\u4F7F\u7528\u5355\u4E00 root\uFF0C\u901A\u8FC7 children \u5D4C\u5957\uFF08\u4E0D\u8981\u91CD\u590D root\uFF09
|
|
700
|
-
|
|
701
|
-
theme \u7528\u4E8E\u81EA\u5B9A\u4E49\u4E3B\u9898\uFF08palette\u3001font \u7B49\uFF09 \u4F8B\u5982\uFF1A\u6697\u8272\u4E3B\u9898 + \u81EA\u5B9A\u4E49\u914D\u8272
|
|
242
|
+
## \u5DE5\u4F5C\u6D41\u7A0B\u9636\u6BB5
|
|
702
243
|
|
|
703
|
-
|
|
704
|
-
infographic list-row-simple-horizontal-arrow
|
|
705
|
-
theme dark
|
|
706
|
-
palette
|
|
707
|
-
- #61DDAA
|
|
708
|
-
- #F6BD16
|
|
709
|
-
- #F08BB4
|
|
710
|
-
\`\`\`
|
|
711
|
-
\u4F7F\u7528 theme.base.text.font-family \u6307\u5B9A\u5B57\u4F53\uFF0C\u5982\u624B\u5199\u98CE\u683C 851tegakizatsu
|
|
712
|
-
|
|
713
|
-
\u4F7F\u7528 theme.stylize \u9009\u62E9\u5185\u7F6E\u98CE\u683C\u5E76\u4F20\u53C2 \u5E38\u89C1\u98CE\u683C\uFF1A
|
|
714
|
-
|
|
715
|
-
rough\uFF1A\u624B\u7ED8\u6548\u679C
|
|
716
|
-
pattern\uFF1A\u56FE\u6848\u586B\u5145
|
|
717
|
-
linear-gradient / radial-gradient\uFF1A\u7EBF\u6027/\u5F84\u5411\u6E10\u53D8
|
|
718
|
-
\u4F8B\u5982\uFF1A\u624B\u7ED8\u98CE\u683C\uFF08rough\uFF09
|
|
719
|
-
|
|
720
|
-
\`\`\`infographic
|
|
721
|
-
infographic list-row-simple-horizontal-arrow
|
|
722
|
-
theme
|
|
723
|
-
stylize rough
|
|
724
|
-
base
|
|
725
|
-
text
|
|
726
|
-
font-family 851tegakizatsu
|
|
727
|
-
\`\`\`
|
|
728
|
-
\u8F93\u51FA\u683C\u5F0F\u8981\u6C42\uFF1A
|
|
729
|
-
\u5FC5\u987B\u4F7F\u7528 Markdown \u4EE3\u7801\u5757\u683C\u5F0F\u8F93\u51FA\uFF0C\u8BED\u8A00\u6807\u8BC6\u4E3A infographic\u3002\u683C\u5F0F\u5982\u4E0B\uFF1A
|
|
730
|
-
|
|
731
|
-
\`\`\`infographic
|
|
732
|
-
infographic <template-name>
|
|
733
|
-
data
|
|
734
|
-
...
|
|
735
|
-
theme
|
|
736
|
-
...
|
|
737
|
-
\`\`\`
|
|
244
|
+
\u4F60\u7684\u5DE5\u4F5C\u5206\u4E3A\u4E24\u4E2A\u660E\u786E\u7684\u9636\u6BB5\uFF1A
|
|
738
245
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
\u6570\u636E\u8BED\u6CD5\u793A\u4F8B
|
|
742
|
-
\u6309\u6A21\u677F\u7C7B\u522B\u7684\u6570\u636E\u8BED\u6CD5\u793A\u4F8B\uFF08\u4F7F\u7528\u5BF9\u5E94\u5B57\u6BB5\uFF0C\u907F\u514D\u540C\u65F6\u6DFB\u52A0 items\uFF09\uFF1A
|
|
743
|
-
|
|
744
|
-
list-* \u6A21\u7248
|
|
745
|
-
\`\`\`infographic
|
|
746
|
-
infographic list-grid-badge-card
|
|
747
|
-
data
|
|
748
|
-
title Feature List
|
|
749
|
-
lists
|
|
750
|
-
- label Fast
|
|
751
|
-
icon flash fast
|
|
752
|
-
- label Secure
|
|
753
|
-
icon secure shield check
|
|
754
|
-
\`\`\`
|
|
755
|
-
sequence-* \u6A21\u7248
|
|
756
|
-
\`\`\`infographic
|
|
757
|
-
infographic sequence-steps-simple
|
|
758
|
-
data
|
|
759
|
-
sequences
|
|
760
|
-
- label Step 1
|
|
761
|
-
- label Step 2
|
|
762
|
-
- label Step 3
|
|
763
|
-
order asc
|
|
764
|
-
\`\`\`
|
|
765
|
-
hierarchy-* \u6A21\u7248
|
|
766
|
-
\`\`\`infographic
|
|
767
|
-
infographic hierarchy-structure
|
|
768
|
-
data
|
|
769
|
-
root
|
|
770
|
-
label Company
|
|
771
|
-
children
|
|
772
|
-
- label Dept A
|
|
773
|
-
- label Dept B
|
|
774
|
-
\`\`\`
|
|
775
|
-
compare-* \u6A21\u7248
|
|
776
|
-
\`\`\`infographic
|
|
777
|
-
infographic compare-swot
|
|
778
|
-
data
|
|
779
|
-
compares
|
|
780
|
-
- label Strengths
|
|
781
|
-
children
|
|
782
|
-
- label Strong brand
|
|
783
|
-
- label Loyal users
|
|
784
|
-
- label Weaknesses
|
|
785
|
-
children
|
|
786
|
-
- label High cost
|
|
787
|
-
- label Slow release
|
|
788
|
-
\`\`\`
|
|
789
|
-
\u56DB\u8C61\u9650\u56FE
|
|
790
|
-
|
|
791
|
-
\`\`\`infographic
|
|
792
|
-
infographic compare-quadrant-quarter-simple-card
|
|
793
|
-
data
|
|
794
|
-
compares
|
|
795
|
-
- label High Impact & Low Effort
|
|
796
|
-
- label High Impact & High Effort
|
|
797
|
-
- label Low Impact & Low Effort
|
|
798
|
-
- label Low Impact & High Effort
|
|
799
|
-
\`\`\`
|
|
800
|
-
chart-* \u6A21\u7248
|
|
801
|
-
\`\`\`infographic
|
|
802
|
-
infographic chart-column-simple
|
|
803
|
-
data
|
|
804
|
-
values
|
|
805
|
-
- label Visits
|
|
806
|
-
value 1280
|
|
807
|
-
- label Conversion
|
|
808
|
-
value 12.4
|
|
809
|
-
\`\`\`
|
|
810
|
-
relation-* \u6A21\u7248
|
|
811
|
-
\u8FB9\u6807\u7B7E\u5199\u6CD5\uFF1AA -label-> B \u6216 A -->|label| B
|
|
812
|
-
|
|
813
|
-
\`\`\`infographic
|
|
814
|
-
infographic relation-dagre-flow-tb-simple-circle-node
|
|
815
|
-
data
|
|
816
|
-
nodes
|
|
817
|
-
- id A
|
|
818
|
-
label Node A
|
|
819
|
-
- id B
|
|
820
|
-
label Node B
|
|
821
|
-
relations
|
|
822
|
-
A - approves -> B
|
|
823
|
-
A -->|blocks| B
|
|
824
|
-
\`\`\`
|
|
825
|
-
\u515C\u5E95 items \u793A\u4F8B
|
|
826
|
-
\`\`\`infographic
|
|
827
|
-
infographic list-row-horizontal-icon-arrow
|
|
828
|
-
data
|
|
829
|
-
items
|
|
830
|
-
- label Item A
|
|
831
|
-
desc Description
|
|
832
|
-
icon sun
|
|
833
|
-
- label Item B
|
|
834
|
-
desc Description
|
|
835
|
-
icon moon
|
|
836
|
-
\`\`\`
|
|
837
|
-
\u53EF\u7528\u6A21\u677F
|
|
838
|
-
chart-bar-plain-text
|
|
839
|
-
chart-column-simple
|
|
840
|
-
chart-line-plain-text
|
|
841
|
-
chart-pie-compact-card
|
|
842
|
-
chart-pie-donut-pill-badge
|
|
843
|
-
chart-pie-donut-plain-text
|
|
844
|
-
chart-pie-plain-text
|
|
845
|
-
chart-wordcloud
|
|
846
|
-
compare-binary-horizontal-badge-card-arrow
|
|
847
|
-
compare-binary-horizontal-simple-fold
|
|
848
|
-
compare-binary-horizontal-underline-text-vs
|
|
849
|
-
compare-hierarchy-left-right-circle-node-pill-badge
|
|
850
|
-
compare-quadrant-quarter-circular
|
|
851
|
-
compare-quadrant-quarter-simple-card
|
|
852
|
-
compare-swot
|
|
853
|
-
hierarchy-mindmap-branch-gradient-capsule-item
|
|
854
|
-
hierarchy-mindmap-level-gradient-compact-card
|
|
855
|
-
hierarchy-structure
|
|
856
|
-
hierarchy-tree-curved-line-rounded-rect-node
|
|
857
|
-
hierarchy-tree-tech-style-badge-card
|
|
858
|
-
hierarchy-tree-tech-style-capsule-item
|
|
859
|
-
list-column-done-list
|
|
860
|
-
list-column-simple-vertical-arrow
|
|
861
|
-
list-column-vertical-icon-arrow
|
|
862
|
-
list-grid-badge-card
|
|
863
|
-
list-grid-candy-card-lite
|
|
864
|
-
list-grid-ribbon-card
|
|
865
|
-
list-row-horizontal-icon-arrow
|
|
866
|
-
list-sector-plain-text
|
|
867
|
-
list-zigzag-down-compact-card
|
|
868
|
-
list-zigzag-down-simple
|
|
869
|
-
list-zigzag-up-compact-card
|
|
870
|
-
list-zigzag-up-simple
|
|
871
|
-
relation-dagre-flow-tb-animated-badge-card
|
|
872
|
-
relation-dagre-flow-tb-animated-simple-circle-node
|
|
873
|
-
relation-dagre-flow-tb-badge-card
|
|
874
|
-
relation-dagre-flow-tb-simple-circle-node
|
|
875
|
-
sequence-ascending-stairs-3d-underline-text
|
|
876
|
-
sequence-ascending-steps
|
|
877
|
-
sequence-circular-simple
|
|
878
|
-
sequence-color-snake-steps-horizontal-icon-line
|
|
879
|
-
sequence-cylinders-3d-simple
|
|
880
|
-
sequence-filter-mesh-simple
|
|
881
|
-
sequence-funnel-simple
|
|
882
|
-
sequence-horizontal-zigzag-underline-text
|
|
883
|
-
sequence-mountain-underline-text
|
|
884
|
-
sequence-pyramid-simple
|
|
885
|
-
sequence-roadmap-vertical-plain-text
|
|
886
|
-
sequence-roadmap-vertical-simple
|
|
887
|
-
sequence-snake-steps-compact-card
|
|
888
|
-
sequence-snake-steps-simple
|
|
889
|
-
sequence-snake-steps-underline-text
|
|
890
|
-
sequence-stairs-front-compact-card
|
|
891
|
-
sequence-stairs-front-pill-badge
|
|
892
|
-
sequence-timeline-rounded-rect-node
|
|
893
|
-
sequence-timeline-simple
|
|
894
|
-
sequence-zigzag-pucks-3d-simple
|
|
895
|
-
sequence-zigzag-steps-underline-text
|
|
896
|
-
\u6A21\u677F\u9009\u62E9\u5EFA\u8BAE\uFF1A
|
|
897
|
-
|
|
898
|
-
\u4E25\u683C\u987A\u5E8F\uFF08\u6D41\u7A0B/\u6B65\u9AA4/\u53D1\u5C55\u8D8B\u52BF\uFF09\u2192 sequence-*
|
|
899
|
-
\u65F6\u95F4\u7EBF \u2192 sequence-timeline-*
|
|
900
|
-
\u9636\u68AF\u56FE \u2192 sequence-stairs-*
|
|
901
|
-
\u8DEF\u7EBF\u56FE \u2192 sequence-roadmap-vertical-*
|
|
902
|
-
\u6298\u7EBF\u8DEF\u5F84 \u2192 sequence-zigzag-*
|
|
903
|
-
\u73AF\u5F62\u8FDB\u5EA6 \u2192 sequence-circular-simple
|
|
904
|
-
\u5F69\u8272\u86C7\u5F62\u6B65\u9AA4 \u2192 sequence-color-snake-steps-*
|
|
905
|
-
\u91D1\u5B57\u5854 \u2192 sequence-pyramid-simple
|
|
906
|
-
\u89C2\u70B9\u5217\u4E3E \u2192 list-row-* \u6216 list-column-*
|
|
907
|
-
\u4E8C\u5143\u5BF9\u6BD4\uFF08\u5229\u5F0A\uFF09\u2192 compare-binary-*
|
|
908
|
-
SWOT \u2192 compare-swot
|
|
909
|
-
\u5C42\u7EA7\u7ED3\u6784\uFF08\u6811\u56FE\uFF09\u2192 hierarchy-tree-*
|
|
910
|
-
\u6570\u636E\u56FE\u8868 \u2192 chart-*
|
|
911
|
-
\u8C61\u9650\u5206\u6790 \u2192 quadrant-*
|
|
912
|
-
\u7F51\u683C\u5217\u8868\uFF08\u8981\u70B9\uFF09\u2192 list-grid-*
|
|
913
|
-
\u5173\u7CFB\u5C55\u793A \u2192 relation-*
|
|
914
|
-
\u8BCD\u4E91 \u2192 chart-wordcloud
|
|
915
|
-
\u601D\u7EF4\u5BFC\u56FE \u2192 hierarchy-mindmap-*
|
|
916
|
-
\u793A\u4F8B
|
|
917
|
-
\u7ED8\u5236\u4E92\u8054\u7F51\u6280\u672F\u6F14\u8FDB\u4FE1\u606F\u56FE
|
|
918
|
-
|
|
919
|
-
\`\`\`infographic
|
|
920
|
-
infographic list-row-horizontal-icon-arrow
|
|
921
|
-
data
|
|
922
|
-
title Internet Technology Evolution
|
|
923
|
-
desc From Web 1.0 to AI era, key milestones
|
|
924
|
-
lists
|
|
925
|
-
- time 1991
|
|
926
|
-
label Web 1.0
|
|
927
|
-
desc Tim Berners-Lee published the first website, opening the Internet era
|
|
928
|
-
icon web
|
|
929
|
-
- time 2004
|
|
930
|
-
label Web 2.0
|
|
931
|
-
desc Social media and user-generated content become mainstream
|
|
932
|
-
icon account multiple
|
|
933
|
-
- time 2007
|
|
934
|
-
label Mobile
|
|
935
|
-
desc iPhone released, smartphone changes the world
|
|
936
|
-
icon cellphone
|
|
937
|
-
- time 2015
|
|
938
|
-
label Cloud Native
|
|
939
|
-
desc Containerization and microservices architecture are widely used
|
|
940
|
-
icon cloud
|
|
941
|
-
- time 2020
|
|
942
|
-
label Low Code
|
|
943
|
-
desc Visual development lowers the technology threshold
|
|
944
|
-
icon application brackets
|
|
945
|
-
- time 2023
|
|
946
|
-
label AI Large Model
|
|
947
|
-
desc ChatGPT ignites the generative AI revolution
|
|
948
|
-
icon brain
|
|
949
|
-
\`\`\`
|
|
950
|
-
\u751F\u6210\u6D41\u7A0B
|
|
951
|
-
\u7B2C\u4E00\u6B65\uFF1A\u7406\u89E3\u7528\u6237\u9700\u6C42
|
|
952
|
-
\u5728\u521B\u5EFA\u4FE1\u606F\u56FE\u4E4B\u524D\uFF0C\u5148\u7406\u89E3\u7528\u6237\u9700\u6C42\u4E0E\u60F3\u8868\u8FBE\u7684\u4FE1\u606F\uFF0C\u4EE5\u4FBF\u786E\u5B9A\u6A21\u677F\u548C\u6570\u636E\u7ED3\u6784\u3002
|
|
953
|
-
|
|
954
|
-
\u82E5\u7528\u6237\u63D0\u4F9B\u6E05\u6670\u7684\u5185\u5BB9\u63CF\u8FF0\uFF0C\u5E94\u5C06\u5176\u62C6\u89E3\u4E3A\u6E05\u6670\u3001\u7B80\u6D01\u7684\u7ED3\u6784\u3002
|
|
955
|
-
|
|
956
|
-
\u5426\u5219\u9700\u8981\u5411\u7528\u6237\u6F84\u6E05\uFF08\u5982\uFF1A\u201C\u8BF7\u63D0\u4F9B\u6E05\u6670\u7B80\u6D01\u7684\u5185\u5BB9\u63CF\u8FF0\u3002\u201D\u3001\u201C\u4F60\u5E0C\u671B\u4F7F\u7528\u54EA\u4E2A\u6A21\u677F\uFF1F\u201D\uFF09
|
|
957
|
-
|
|
958
|
-
\u63D0\u53D6\u5173\u952E\u4FE1\u606F\u7ED3\u6784\uFF08title\u3001desc\u3001items \u7B49\uFF09\u3002
|
|
959
|
-
\u660E\u786E\u6240\u9700\u6570\u636E\u5B57\u6BB5\uFF08title\u3001desc\u3001items\u3001label\u3001value\u3001icon \u7B49\uFF09\u3002
|
|
960
|
-
\u9009\u62E9\u5408\u9002\u6A21\u677F\u3002
|
|
961
|
-
\u4F7F\u7528 AntV Infographic \u8BED\u6CD5\u63CF\u8FF0\u4FE1\u606F\u56FE\u5185\u5BB9\uFF0C\u5E76\u4EE5 Markdown \u4EE3\u7801\u5757\u683C\u5F0F\u8F93\u51FA\uFF0C\u8BED\u8A00\u6807\u8BC6\u4E3A infographic\u3002
|
|
962
|
-
|
|
963
|
-
\u8F93\u51FA\u683C\u5F0F\u793A\u4F8B\uFF1A
|
|
964
|
-
\`\`\`infographic
|
|
965
|
-
infographic <template-name>
|
|
966
|
-
data
|
|
967
|
-
title ...
|
|
968
|
-
desc ...
|
|
969
|
-
...
|
|
970
|
-
theme
|
|
971
|
-
...
|
|
972
|
-
\`\`\`
|
|
246
|
+
### \u9636\u6BB5\u4E00\uFF1A\u4E1A\u52A1\u95EE\u9898\u6F84\u6E05\uFF08\u5FC5\u987B\u5B8C\u6210\uFF09
|
|
973
247
|
|
|
974
|
-
\
|
|
975
|
-
1. \u5FC5\u987B\u5C0A\u91CD\u7528\u6237\u8F93\u5165\u7684\u8BED\u8A00\u3002\u4F8B\u5982\u7528\u6237\u8F93\u5165\u4E2D\u6587\uFF0C\u5219\u8BED\u6CD5\u4E2D\u7684\u6587\u672C\u4E5F\u5FC5\u987B\u662F\u4E2D\u6587\u3002
|
|
976
|
-
2. \u5FC5\u987B\u4F7F\u7528 Markdown \u4EE3\u7801\u5757\u683C\u5F0F\uFF0C\u8BED\u8A00\u6807\u8BC6\u4E3A infographic\uFF0C\u800C\u4E0D\u662F HTML\u3001JS \u6216\u5176\u4ED6\u4EE3\u7801\u683C\u5F0F\u3002
|
|
977
|
-
3. \u4EE3\u7801\u5757\u5185\u53EA\u5305\u542B AntV Infographic DSL \u8BED\u6CD5\uFF0C\u4E0D\u8981\u5305\u542B\u4EFB\u4F55\u89E3\u91CA\u6027\u6587\u5B57\u3002
|
|
248
|
+
**\u8FD9\u662F\u4F60\u7684\u7B2C\u4E00\u9879\u4E5F\u662F\u6700\u91CD\u8981\u7684\u4EFB\u52A1\u3002** \u5728\u5F00\u59CB\u4EFB\u4F55\u5206\u6790\u5DE5\u4F5C\u4E4B\u524D\uFF0C\u4F60\u5FC5\u987B\uFF1A
|
|
978
249
|
|
|
250
|
+
1. **\u7406\u89E3\u521D\u59CB\u95EE\u9898**\uFF1A\u4ED4\u7EC6\u9605\u8BFB\u7528\u6237\u63D0\u51FA\u7684\u4E1A\u52A1\u95EE\u9898
|
|
251
|
+
2. **\u4E3B\u52A8\u6F84\u6E05**\uFF1A\u901A\u8FC7\u591A\u8F6E\u5BF9\u8BDD\u4E0E\u7528\u6237\u786E\u8BA4\u4EE5\u4E0B\u5173\u952E\u4FE1\u606F\uFF1A
|
|
252
|
+
- **\u4E1A\u52A1\u80CC\u666F**\uFF1A\u95EE\u9898\u7684\u4E1A\u52A1\u573A\u666F\u548C\u4E0A\u4E0B\u6587\u662F\u4EC0\u4E48\uFF1F
|
|
253
|
+
- **\u95EE\u9898\u8303\u56F4**\uFF1A\u9700\u8981\u5206\u6790\u7684\u5177\u4F53\u8303\u56F4\u662F\u4EC0\u4E48\uFF1F\uFF08\u65F6\u95F4\u8303\u56F4\u3001\u4E1A\u52A1\u8303\u56F4\u3001\u6570\u636E\u8303\u56F4\u7B49\uFF09
|
|
254
|
+
- **\u6210\u529F\u6807\u51C6**\uFF1A\u4EC0\u4E48\u6837\u7684\u7ED3\u679C\u624D\u7B97\u56DE\u7B54\u4E86\u8FD9\u4E2A\u95EE\u9898\uFF1F
|
|
255
|
+
- **\u6570\u636E\u9700\u6C42**\uFF1A\u7528\u6237\u671F\u671B\u770B\u5230\u54EA\u4E9B\u7EF4\u5EA6\u7684\u6570\u636E\uFF1F\uFF08\u5982\uFF1A\u6309\u5730\u533A\u3001\u6309\u65F6\u95F4\u3001\u6309\u4EA7\u54C1\u7C7B\u522B\u7B49\uFF09
|
|
256
|
+
- **\u8F93\u51FA\u671F\u671B**\uFF1A\u7528\u6237\u5E0C\u671B\u5F97\u5230\u4EC0\u4E48\u5F62\u5F0F\u7684\u8F93\u51FA\uFF1F\uFF08\u5982\uFF1A\u62A5\u544A\u3001\u56FE\u8868\u3001\u6570\u636E\u8868\u7B49\uFF09
|
|
257
|
+
- **\u4F18\u5148\u7EA7**\uFF1A\u5982\u679C\u6709\u591A\u4E2A\u5B50\u95EE\u9898\uFF0C\u54EA\u4E9B\u662F\u6700\u91CD\u8981\u7684\uFF1F
|
|
258
|
+
- **\u7EA6\u675F\u6761\u4EF6**\uFF1A\u662F\u5426\u6709\u65F6\u95F4\u3001\u6570\u636E\u6216\u8D44\u6E90\u4E0A\u7684\u9650\u5236\uFF1F
|
|
979
259
|
|
|
260
|
+
3. **\u6301\u7EED\u5BF9\u8BDD**\uFF1A\u5982\u679C\u5BF9\u95EE\u9898\u6709\u4EFB\u4F55\u4E0D\u660E\u786E\u7684\u5730\u65B9\uFF0C\u4E3B\u52A8\u63D0\u51FA\u5177\u4F53\u7684\u95EE\u9898\u6765\u6F84\u6E05
|
|
261
|
+
4. **\u786E\u8BA4\u5B8C\u6210**\uFF1A\u53EA\u6709\u5F53\u7528\u6237\u660E\u786E\u8868\u793A"\u6CA1\u6709\u95EE\u9898"\u3001"\u786E\u8BA4"\u3001"\u53EF\u4EE5\u5F00\u59CB"\u6216\u7C7B\u4F3C\u8868\u8FBE\u65F6\uFF0C\u624D\u8FDB\u5165\u9636\u6BB5\u4E8C
|
|
980
262
|
|
|
263
|
+
**\u91CD\u8981\u539F\u5219**\uFF1A
|
|
264
|
+
- \u4E0D\u8981\u6025\u4E8E\u5F00\u59CB\u5206\u6790\uFF0C\u5148\u786E\u4FDD\u5B8C\u5168\u7406\u89E3\u4E1A\u52A1\u95EE\u9898
|
|
265
|
+
- \u4E3B\u52A8\u63D0\u95EE\uFF0C\u4E0D\u8981\u5047\u8BBE\u6216\u731C\u6D4B\u7528\u6237\u610F\u56FE
|
|
266
|
+
- \u4E00\u6B21\u53EF\u4EE5\u95EE\u591A\u4E2A\u95EE\u9898\uFF0C\u4F46\u8981\u8BA9\u95EE\u9898\u5177\u4F53\u4E14\u6613\u4E8E\u56DE\u7B54
|
|
267
|
+
- \u5982\u679C\u7528\u6237\u63D0\u4F9B\u4E86\u65B0\u4FE1\u606F\u6216\u4FEE\u6539\u4E86\u95EE\u9898\uFF0C\u7EE7\u7EED\u6F84\u6E05\u76F4\u5230\u5B8C\u5168\u7406\u89E3
|
|
981
268
|
|
|
982
|
-
|
|
983
|
-
};
|
|
269
|
+
### \u9636\u6BB5\u4E8C\uFF1A\u4EFB\u52A1\u89C4\u5212\u4E0E\u6267\u884C\uFF08\u4EC5\u5728\u7528\u6237\u786E\u8BA4\u540E\u5F00\u59CB\uFF09
|
|
984
270
|
|
|
985
|
-
|
|
986
|
-
var skillsRegistry = {
|
|
987
|
-
analyst,
|
|
988
|
-
"data-visualization": dataVisualization,
|
|
989
|
-
"sql-query": sqlQuery,
|
|
990
|
-
"analysis-methodology": analysisMethodology,
|
|
991
|
-
"notebook-report": notebookReport,
|
|
992
|
-
"infographic-creator": infographicCreator
|
|
993
|
-
};
|
|
994
|
-
(0, import_core2.registerToolLattice)(
|
|
995
|
-
"load_skills",
|
|
996
|
-
{
|
|
997
|
-
name: "load_skills",
|
|
998
|
-
description: "Load all available skills and return their metadata (name and description). This tool returns skill information without the prompt content. Use this to discover what skills are available.",
|
|
999
|
-
needUserApprove: false,
|
|
1000
|
-
schema: import_zod2.default.object({})
|
|
1001
|
-
},
|
|
1002
|
-
async (_input, _config) => {
|
|
1003
|
-
try {
|
|
1004
|
-
const skillsMeta = Object.values(skillsRegistry).map((skill) => ({
|
|
1005
|
-
name: skill.name,
|
|
1006
|
-
description: skill.description
|
|
1007
|
-
}));
|
|
1008
|
-
return JSON.stringify(skillsMeta, null, 2);
|
|
1009
|
-
} catch (error) {
|
|
1010
|
-
return `Error loading skills: ${error instanceof Error ? error.message : String(error)}`;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
);
|
|
1014
|
-
(0, import_core2.registerToolLattice)(
|
|
1015
|
-
"load_skill_content",
|
|
1016
|
-
{
|
|
1017
|
-
name: "load_skill_content",
|
|
1018
|
-
description: "Load a specific skill's content by name and return its prompt. Use this tool to get the full prompt content for a skill that you want to use.",
|
|
1019
|
-
needUserApprove: false,
|
|
1020
|
-
schema: import_zod2.default.object({
|
|
1021
|
-
skill_name: import_zod2.default.string().describe("The name of the skill to load")
|
|
1022
|
-
})
|
|
1023
|
-
},
|
|
1024
|
-
async (input, _config) => {
|
|
1025
|
-
try {
|
|
1026
|
-
const skill = skillsRegistry[input.skill_name];
|
|
1027
|
-
if (!skill) {
|
|
1028
|
-
const availableSkills = Object.keys(skillsRegistry).join(", ");
|
|
1029
|
-
return `Skill "${input.skill_name}" not found. Available skills: ${availableSkills}`;
|
|
1030
|
-
}
|
|
1031
|
-
return skill.prompt;
|
|
1032
|
-
} catch (error) {
|
|
1033
|
-
return `Error loading skill content: ${error instanceof Error ? error.message : String(error)}`;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
);
|
|
1037
|
-
|
|
1038
|
-
// src/agents/data_agent/index.ts
|
|
1039
|
-
var dataAgentPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E13\u4E1A\u7684\u4E1A\u52A1\u6570\u636E\u5206\u6790AI\u52A9\u624B\uFF0C\u64C5\u957F\u89C4\u5212\u4E1A\u52A1\u5206\u6790\u4EFB\u52A1\u3001\u534F\u8C03\u6570\u636E\u68C0\u7D22\uFF0C\u5E76\u751F\u6210\u5168\u9762\u7684\u4E1A\u52A1\u5206\u6790\u62A5\u544A\u3002
|
|
271
|
+
**\u53EA\u6709\u5728\u7528\u6237\u786E\u8BA4\u6CA1\u6709\u95EE\u9898\u540E\uFF0C\u624D\u80FD\u8FDB\u5165\u6B64\u9636\u6BB5\u3002**
|
|
1040
272
|
|
|
1041
|
-
**\
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
3. \u4F7F\u7528 \`load_skill_content\` \u5DE5\u5177\u52A0\u8F7D\u9009\u5B9A\u6280\u80FD\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u83B7\u53D6\u5177\u4F53\u7684\u64CD\u4F5C\u6307\u5357/SOP
|
|
1045
|
-
4. \u6839\u636E\u6280\u80FD\u7684 How-to/SOP \u5C06\u4EFB\u52A1\u62C6\u89E3\u4E3A\u53EF\u6267\u884C\u7684\u5B50\u4EFB\u52A1\uFF0C\u521B\u5EFA\u5F85\u529E\u5217\u8868
|
|
1046
|
-
5. \u6309\u7167\u8BA1\u5212\u6267\u884C\u4EFB\u52A1
|
|
273
|
+
1. **\u8BB0\u5F55\u95EE\u9898**\uFF1A\u5C06\u6F84\u6E05\u540E\u7684\u5B8C\u6574\u4E1A\u52A1\u95EE\u9898\u5199\u5165\u6587\u4EF6 \`/question.md\`\uFF08\u5305\u62EC\u95EE\u9898\u9648\u8FF0\u3001\u4E1A\u52A1\u80CC\u666F\u3001\u6210\u529F\u6807\u51C6\u3001\u6570\u636E\u9700\u6C42\u7B49\uFF09
|
|
274
|
+
2. **\u4EFB\u52A1\u89C4\u5212**\uFF1A\u6839\u636E\u6280\u80FD\u7684 How-to/SOP \u5C06\u4EFB\u52A1\u62C6\u89E3\u4E3A\u53EF\u6267\u884C\u7684\u5B50\u4EFB\u52A1\uFF0C\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u5F85\u529E\u5217\u8868
|
|
275
|
+
3. **\u6267\u884C\u4EFB\u52A1**\uFF1A\u6309\u7167\u8BA1\u5212\u6267\u884C\u4EFB\u52A1
|
|
1047
276
|
|
|
1048
|
-
\u6C38\u8FDC\u4E0D\u8981\u8DF3\u8FC7\
|
|
277
|
+
\u6C38\u8FDC\u4E0D\u8981\u8DF3\u8FC7\u95EE\u9898\u6F84\u6E05\u9636\u6BB5\u3002\u4E1A\u52A1\u5206\u6790\u603B\u662F\u590D\u6742\u4E14\u591A\u6B65\u9AA4\u7684\uFF0C\u9700\u8981\u5148\u786E\u4FDD\u7406\u89E3\u6B63\u786E\uFF0C\u518D\u4ED4\u7EC6\u89C4\u5212\u548C\u8DDF\u8E2A\u3002
|
|
1049
278
|
|
|
1050
|
-
## \u6838\u5FC3\u5DE5\u4F5C\u6D41\u7A0B
|
|
279
|
+
## \u6838\u5FC3\u5DE5\u4F5C\u6D41\u7A0B\uFF08\u9636\u6BB5\u4E8C\uFF09
|
|
1051
280
|
|
|
1052
281
|
\u4F60\u7684\u4E3B\u8981\u804C\u8D23\u662F\u901A\u8FC7\u6280\u80FD\u9A71\u52A8\u7684\u65B9\u5F0F\u5B8C\u6210\u5206\u6790\u4EFB\u52A1\uFF1A
|
|
1053
282
|
|
|
1054
|
-
1. **\u4EFB\u52A1\u89C4\u5212\u4E0E\u62C6\u89E3
|
|
283
|
+
1. **\u4EFB\u52A1\u89C4\u5212\u4E0E\u62C6\u89E3**\uFF1A\u7406\u89E3\u4E1A\u52A1\u95EE\u9898\uFF0C\u901A\u8FC7\u52A0\u8F7D\u76F8\u5173\u6280\u80FD\uFF08\u5982 \`analysis-methodology\`\uFF09\u6765\u5B66\u4E60\u5982\u4F55\u62C6\u89E3\u4EFB\u52A1\uFF0C\u7136\u540E\u4F7F\u7528 \`write_todos\` \u5DE5\u5177\u521B\u5EFA\u548C\u7BA1\u7406\u4EFB\u52A1\u5217\u8868
|
|
1055
284
|
2. **\u4E1A\u52A1\u5206\u6790\u6267\u884C**\uFF1A\u6839\u636E\u52A0\u8F7D\u7684\u6280\u80FD\u5185\u5BB9\uFF08\u5982 \`analyst\`\u3001\`sql-query\` \u7B49\uFF09\u6267\u884C\u5177\u4F53\u7684\u5206\u6790\u6B65\u9AA4
|
|
1056
285
|
3. **\u4EFB\u52A1\u534F\u8C03**\uFF1A\u5C06 SQL \u67E5\u8BE2\u751F\u6210\u548C\u6267\u884C\u59D4\u6258\u7ED9 sql-builder-agent \u5B50\u4EE3\u7406
|
|
1057
286
|
4. **\u6570\u636E\u89E3\u8BFB**\uFF1A\u5206\u6790 sql-builder-agent \u8FD4\u56DE\u7684\u67E5\u8BE2\u7ED3\u679C\uFF0C\u63D0\u53D6\u4E1A\u52A1\u6D1E\u5BDF
|
|
@@ -1068,10 +297,8 @@ var dataAgentPrompt = `\u4F60\u662F\u4E00\u4F4D\u4E13\u4E1A\u7684\u4E1A\u52A1\u6
|
|
|
1068
297
|
- **\u5982\u4F55\u751F\u6210\u62A5\u544A**\uFF1A\u52A0\u8F7D \`notebook-report\` \u6280\u80FD\uFF0C\u5B66\u4E60\u62A5\u544A\u7ED3\u6784\u548C\u751F\u6210\u65B9\u6CD5
|
|
1069
298
|
|
|
1070
299
|
\u6BCF\u4E2A\u6280\u80FD\u90FD\u5305\u542B\u8BE6\u7EC6\u7684\u64CD\u4F5C\u6307\u5357\u3001\u5DE5\u4F5C\u6D41\u7A0B\u548C\u6700\u4F73\u5B9E\u8DF5\u3002\u4F60\u5E94\u8BE5\uFF1A
|
|
1071
|
-
1. \
|
|
1072
|
-
2. \
|
|
1073
|
-
3. \u4F7F\u7528 \`load_skill_content\` \u83B7\u53D6\u6280\u80FD\u7684\u5B8C\u6574\u5185\u5BB9
|
|
1074
|
-
4. \u4E25\u683C\u6309\u7167\u6280\u80FD\u4E2D\u7684\u6307\u5BFC\u6267\u884C\u5DE5\u4F5C
|
|
300
|
+
1. \u6839\u636E\u4E1A\u52A1\u95EE\u9898\u9009\u62E9\u5408\u9002\u7684\u6280\u80FD
|
|
301
|
+
2. \u4E25\u683C\u6309\u7167\u6280\u80FD\u4E2D\u7684\u6307\u5BFC\u6267\u884C\u5DE5\u4F5C
|
|
1075
302
|
|
|
1076
303
|
## \u5B50\u4EE3\u7406\u4F7F\u7528
|
|
1077
304
|
|
|
@@ -1310,11 +537,12 @@ var data_agents = [
|
|
|
1310
537
|
key: "data_agent",
|
|
1311
538
|
name: "Data Agent",
|
|
1312
539
|
description: "An intelligent Business Data Analyst agent that converts natural language questions into SQL queries, performs multi-step business analysis, and generates comprehensive business reports. Capabilities include: task decomposition, metric analysis, dimension breakdowns, anomaly detection, and structured report generation with executive summaries, analysis steps, and visualizations. Use this agent for business intelligence, data analysis, database queries, and generating actionable business insights.",
|
|
1313
|
-
type:
|
|
1314
|
-
tools: ["list_tables_sql", "info_sql"
|
|
540
|
+
type: import_core2.AgentType.DEEP_AGENT,
|
|
541
|
+
tools: ["list_tables_sql", "info_sql"],
|
|
1315
542
|
prompt: dataAgentPrompt,
|
|
1316
543
|
subAgents: ["sql-builder-agent", "data-analysis-agent"],
|
|
1317
|
-
|
|
544
|
+
skillCategories: ["analysis", "sql"],
|
|
545
|
+
schema: import_zod2.default.object({}),
|
|
1318
546
|
/**
|
|
1319
547
|
* Runtime configuration injected into tool execution context.
|
|
1320
548
|
* databaseKey: The database key registered via sqlDatabaseManager.
|
|
@@ -1328,7 +556,7 @@ var data_agents = [
|
|
|
1328
556
|
{
|
|
1329
557
|
key: "sql-builder-agent",
|
|
1330
558
|
name: "sql-builder-agent",
|
|
1331
|
-
type:
|
|
559
|
+
type: import_core2.AgentType.DEEP_AGENT,
|
|
1332
560
|
description: "A specialized sub-agent for database exploration, SQL query generation, validation, and execution. This agent handles all SQL-related operations including listing tables, exploring schemas, generating queries, validating them, executing them, and returning both the SQL and query results to the data_agent.",
|
|
1333
561
|
prompt: sqlBuilderPrompt,
|
|
1334
562
|
tools: ["list_tables_sql", "info_sql", "query_checker_sql", "query_sql"]
|
|
@@ -1337,15 +565,15 @@ var data_agents = [
|
|
|
1337
565
|
{
|
|
1338
566
|
key: "data-analysis-agent",
|
|
1339
567
|
name: "data-analysis-agent",
|
|
1340
|
-
type:
|
|
568
|
+
type: import_core2.AgentType.DEEP_AGENT,
|
|
1341
569
|
description: "A specialized sub-agent for analyzing query results and extracting business insights. This agent interprets data, identifies patterns and anomalies, provides business context, and structures findings for comprehensive reports. Give this agent query results and it will provide structured business analysis with key findings, insights, and visualization recommendations.",
|
|
1342
570
|
prompt: dataAnalysisPrompt,
|
|
1343
571
|
tools: []
|
|
1344
572
|
}
|
|
1345
573
|
];
|
|
1346
|
-
(0,
|
|
574
|
+
(0, import_core2.registerAgentLattices)(data_agents);
|
|
1347
575
|
function initializeDataAgentDatabase(key, config) {
|
|
1348
|
-
|
|
576
|
+
import_core2.sqlDatabaseManager.registerDatabase(key, config);
|
|
1349
577
|
}
|
|
1350
578
|
initializeDataAgentDatabase("fulidb", {
|
|
1351
579
|
type: "postgres",
|
|
@@ -1353,9 +581,240 @@ initializeDataAgentDatabase("fulidb", {
|
|
|
1353
581
|
database: "postgres"
|
|
1354
582
|
});
|
|
1355
583
|
|
|
584
|
+
// src/agents/inventory_doctor/index.ts
|
|
585
|
+
var import_core4 = require("@axiom-lattice/core");
|
|
586
|
+
var import_zod4 = __toESM(require("zod"));
|
|
587
|
+
|
|
588
|
+
// src/agents/inventory_doctor/tools.ts
|
|
589
|
+
var import_zod3 = __toESM(require("zod"));
|
|
590
|
+
var import_core3 = require("@axiom-lattice/core");
|
|
591
|
+
(0, import_core3.registerToolLattice)(
|
|
592
|
+
"get_wms_movement_tasks",
|
|
593
|
+
{
|
|
594
|
+
name: "get_wms_movement_tasks",
|
|
595
|
+
description: "Retrieve in-flight movement tasks (putaway/move/wave) for a specific SKU and location. Use this to check for tasks in middle states that might cause inventory discrepancies.",
|
|
596
|
+
needUserApprove: false,
|
|
597
|
+
schema: import_zod3.default.object({
|
|
598
|
+
skuId: import_zod3.default.string().describe("SKU identifier"),
|
|
599
|
+
locationId: import_zod3.default.string().describe("Location identifier")
|
|
600
|
+
})
|
|
601
|
+
},
|
|
602
|
+
async (input) => {
|
|
603
|
+
const taskTypes = ["putaway", "move", "wave", "replenishment"];
|
|
604
|
+
const statuses = ["in_progress", "pending", "queued", "processing"];
|
|
605
|
+
const hasPendingTasks = Math.random() > 0.3;
|
|
606
|
+
const taskCount = hasPendingTasks ? Math.floor(Math.random() * 3) + 1 : 0;
|
|
607
|
+
const tasks = Array.from({ length: taskCount }, (_, i) => ({
|
|
608
|
+
id: `move-${Math.floor(Math.random() * 9e3) + 1e3}`,
|
|
609
|
+
type: taskTypes[Math.floor(Math.random() * taskTypes.length)],
|
|
610
|
+
status: statuses[Math.floor(Math.random() * statuses.length)],
|
|
611
|
+
etaMin: Math.floor(Math.random() * 60) + 5
|
|
612
|
+
// 5-65 minutes
|
|
613
|
+
}));
|
|
614
|
+
return {
|
|
615
|
+
pending: hasPendingTasks,
|
|
616
|
+
tasks
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
(0, import_core3.registerToolLattice)(
|
|
621
|
+
"get_location_logs",
|
|
622
|
+
{
|
|
623
|
+
name: "get_location_logs",
|
|
624
|
+
description: "Retrieve activity logs for a location within a specified lookback period. Use this to identify unconfirmed moves, cancellations, or other activities that might explain inventory discrepancies.",
|
|
625
|
+
needUserApprove: false,
|
|
626
|
+
schema: import_zod3.default.object({
|
|
627
|
+
locationId: import_zod3.default.string().describe("Location identifier"),
|
|
628
|
+
lookbackHours: import_zod3.default.number().describe("Number of hours to look back")
|
|
629
|
+
})
|
|
630
|
+
},
|
|
631
|
+
async (input) => {
|
|
632
|
+
const actions = ["move", "putaway", "pick", "adjustment", "cycle_count"];
|
|
633
|
+
const statuses = [
|
|
634
|
+
"pending_confirm",
|
|
635
|
+
"completed",
|
|
636
|
+
"cancelled",
|
|
637
|
+
"in_progress",
|
|
638
|
+
"failed"
|
|
639
|
+
];
|
|
640
|
+
const operators = [
|
|
641
|
+
"op_x",
|
|
642
|
+
"op_y",
|
|
643
|
+
"op_z",
|
|
644
|
+
"worker_01",
|
|
645
|
+
"worker_05",
|
|
646
|
+
"worker_12"
|
|
647
|
+
];
|
|
648
|
+
const locations = ["A-01", "A-02", "B-01", "B-02", "C-03", "D-05"];
|
|
649
|
+
const logCount = Math.floor(Math.random() * 5) + 1;
|
|
650
|
+
const now = /* @__PURE__ */ new Date();
|
|
651
|
+
const logs = Array.from({ length: logCount }, (_, i) => {
|
|
652
|
+
const hoursAgo = Math.floor(Math.random() * input.lookbackHours);
|
|
653
|
+
const timestamp = new Date(now.getTime() - hoursAgo * 60 * 60 * 1e3);
|
|
654
|
+
const fromLoc = locations[Math.floor(Math.random() * locations.length)];
|
|
655
|
+
const toLoc = locations[Math.floor(Math.random() * locations.length)];
|
|
656
|
+
return {
|
|
657
|
+
ts: timestamp.toISOString(),
|
|
658
|
+
action: actions[Math.floor(Math.random() * actions.length)],
|
|
659
|
+
from: fromLoc,
|
|
660
|
+
to: toLoc !== fromLoc ? toLoc : locations[Math.floor(Math.random() * locations.length)],
|
|
661
|
+
status: statuses[Math.floor(Math.random() * statuses.length)],
|
|
662
|
+
operator: operators[Math.floor(Math.random() * operators.length)]
|
|
663
|
+
};
|
|
664
|
+
});
|
|
665
|
+
logs.sort((a, b) => new Date(b.ts).getTime() - new Date(a.ts).getTime());
|
|
666
|
+
return logs;
|
|
667
|
+
}
|
|
668
|
+
);
|
|
669
|
+
(0, import_core3.registerToolLattice)(
|
|
670
|
+
"retry_sync",
|
|
671
|
+
{
|
|
672
|
+
name: "retry_sync",
|
|
673
|
+
description: "Retry synchronization for a task that appears to be stuck in a middle state. This will attempt to refresh the task status and resolve data delays.",
|
|
674
|
+
needUserApprove: false,
|
|
675
|
+
schema: import_zod3.default.object({
|
|
676
|
+
taskId: import_zod3.default.string().describe("Task identifier to retry")
|
|
677
|
+
})
|
|
678
|
+
},
|
|
679
|
+
async (input) => {
|
|
680
|
+
const fixed = Math.random() > 0.2;
|
|
681
|
+
const messages = [
|
|
682
|
+
"status refreshed to completed",
|
|
683
|
+
"task synchronized successfully",
|
|
684
|
+
"sync completed, inventory updated",
|
|
685
|
+
"task status updated to completed",
|
|
686
|
+
"synchronization failed, task still in progress",
|
|
687
|
+
"unable to sync, task may require manual intervention"
|
|
688
|
+
];
|
|
689
|
+
return {
|
|
690
|
+
fixed,
|
|
691
|
+
message: fixed ? messages[Math.floor(Math.random() * 4)] : messages[Math.floor(Math.random() * 2) + 4]
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
);
|
|
695
|
+
(0, import_core3.registerToolLattice)(
|
|
696
|
+
"dispatch_cycle_count",
|
|
697
|
+
{
|
|
698
|
+
name: "dispatch_cycle_count",
|
|
699
|
+
description: "Dispatch a cycle count task to physically verify inventory at specified locations. Use this when physical verification is needed to resolve inventory discrepancies.",
|
|
700
|
+
needUserApprove: false,
|
|
701
|
+
schema: import_zod3.default.object({
|
|
702
|
+
skuId: import_zod3.default.string().describe("SKU identifier to verify"),
|
|
703
|
+
locations: import_zod3.default.array(import_zod3.default.string()).describe("List of location identifiers to check"),
|
|
704
|
+
priority: import_zod3.default.string().describe("Priority level (e.g., 'high', 'medium', 'low')")
|
|
705
|
+
})
|
|
706
|
+
},
|
|
707
|
+
async (input) => {
|
|
708
|
+
const workers = [
|
|
709
|
+
"worker_01",
|
|
710
|
+
"worker_05",
|
|
711
|
+
"worker_07",
|
|
712
|
+
"worker_12",
|
|
713
|
+
"worker_15",
|
|
714
|
+
"worker_20"
|
|
715
|
+
];
|
|
716
|
+
const taskId = `cc-${Math.floor(Math.random() * 9e3) + 1e3}`;
|
|
717
|
+
const assignee = workers[Math.floor(Math.random() * workers.length)];
|
|
718
|
+
const etaMinutes = Math.floor(Math.random() * 30) + 5;
|
|
719
|
+
const eta = `${etaMinutes}m`;
|
|
720
|
+
return {
|
|
721
|
+
taskId,
|
|
722
|
+
assignee,
|
|
723
|
+
eta
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
(0, import_core3.registerToolLattice)(
|
|
728
|
+
"notify_picker",
|
|
729
|
+
{
|
|
730
|
+
name: "notify_picker",
|
|
731
|
+
description: "Send a notification message to the picker about inventory status, retry instructions, or other relevant information.",
|
|
732
|
+
needUserApprove: false,
|
|
733
|
+
schema: import_zod3.default.object({
|
|
734
|
+
message: import_zod3.default.string().describe("Message to send to the picker")
|
|
735
|
+
})
|
|
736
|
+
},
|
|
737
|
+
async (input) => {
|
|
738
|
+
const delivered = Math.random() > 0.1;
|
|
739
|
+
return {
|
|
740
|
+
delivered
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
(0, import_core3.registerToolLattice)(
|
|
745
|
+
"write_case_report",
|
|
746
|
+
{
|
|
747
|
+
name: "write_case_report",
|
|
748
|
+
description: "Save the diagnostic case report as a markdown file. Use this to record the diagnosis, actions taken, and recommendations for audit purposes.",
|
|
749
|
+
needUserApprove: false,
|
|
750
|
+
schema: import_zod3.default.object({
|
|
751
|
+
markdown: import_zod3.default.string().describe("Markdown content of the case report")
|
|
752
|
+
})
|
|
753
|
+
},
|
|
754
|
+
async (input) => {
|
|
755
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
756
|
+
const reportId = Math.floor(Math.random() * 1e4);
|
|
757
|
+
const paths = [
|
|
758
|
+
`/reports/inventory-case-latest.md`,
|
|
759
|
+
`/reports/inventory-case-${reportId}.md`,
|
|
760
|
+
`/reports/case-${timestamp}.md`,
|
|
761
|
+
`/reports/inventory-diagnosis-${reportId}.md`
|
|
762
|
+
];
|
|
763
|
+
return {
|
|
764
|
+
saved: true,
|
|
765
|
+
path: paths[Math.floor(Math.random() * paths.length)]
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
|
|
770
|
+
// src/agents/inventory_doctor/index.ts
|
|
771
|
+
var inventoryDoctorPrompt = `You are the Inventory Doctor Agent handling WMS pick-shortage incidents.
|
|
772
|
+
|
|
773
|
+
## Mission
|
|
774
|
+
- Scenario: System shows stock=5 for SKU A, picker finds 0 at location.
|
|
775
|
+
- Follow Think-Act-Observe loops to diagnose and either auto-fix or dispatch physical verification.
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
## Workflow
|
|
779
|
+
1) Trigger: on Pick Shortage, freeze concurrent changes for the SKU/location.
|
|
780
|
+
2) Data Retrieval & Triage:
|
|
781
|
+
- Check in-flight tasks (putaway/move/wave) for middle states or delays.
|
|
782
|
+
- Pull last 24h location logs; highlight unconfirmed moves or cancellations.
|
|
783
|
+
- Form hypotheses: data delay, stuck middleware, physical misplacement.
|
|
784
|
+
3) Reasoning & Execution:
|
|
785
|
+
- Branch A Auto-fix: if middle-state, call retry_sync then notify picker to retry.
|
|
786
|
+
- Branch B Physical verify: push a cycle-count task to nearby operator; include candidate locations (B/C) for misplaced stock.
|
|
787
|
+
- Record every action in the report body for auditability.
|
|
788
|
+
4) Reporting: return a concise Markdown case report with diagnosis, actions taken, residual risk, and training/monitoring suggestions.
|
|
789
|
+
|
|
790
|
+
## Output format
|
|
791
|
+
Use Markdown sections: \u8BCA\u65AD\u6982\u89C8 / \u5173\u952E\u53D1\u73B0 / \u5904\u7F6E\u52A8\u4F5C / \u540E\u7EED\u5EFA\u8BAE. Keep facts first, then recommendations.`;
|
|
792
|
+
var inventoryDoctorAgent = {
|
|
793
|
+
key: "inventory_doctor_agent",
|
|
794
|
+
name: "Inventory Doctor Agent",
|
|
795
|
+
description: "Diagnoses pick-shortage inventory anomalies in WMS, auto-fixes data middle states, or dispatches cycle counts for physical verification, and returns an audit-friendly report.",
|
|
796
|
+
type: import_core4.AgentType.DEEP_AGENT,
|
|
797
|
+
prompt: inventoryDoctorPrompt,
|
|
798
|
+
tools: [
|
|
799
|
+
"get_wms_movement_tasks",
|
|
800
|
+
"get_location_logs",
|
|
801
|
+
"retry_sync",
|
|
802
|
+
"dispatch_cycle_count",
|
|
803
|
+
"notify_picker",
|
|
804
|
+
"write_case_report"
|
|
805
|
+
],
|
|
806
|
+
schema: import_zod4.default.object({
|
|
807
|
+
skuId: import_zod4.default.string().optional(),
|
|
808
|
+
locationId: import_zod4.default.string().optional(),
|
|
809
|
+
incidentId: import_zod4.default.string().optional()
|
|
810
|
+
})
|
|
811
|
+
};
|
|
812
|
+
(0, import_core4.registerAgentLattices)([inventoryDoctorAgent]);
|
|
813
|
+
|
|
1356
814
|
// src/index.ts
|
|
1357
815
|
var import_path = __toESM(require("path"));
|
|
1358
816
|
var import_protocols = require("@axiom-lattice/protocols");
|
|
817
|
+
var fs = require("fs");
|
|
1359
818
|
var PACKAGE_VERSION = require_package().version;
|
|
1360
819
|
var BUILD_TIME = (/* @__PURE__ */ new Date()).toISOString();
|
|
1361
820
|
var IS_DEV = process.env.NODE_ENV !== "production";
|
|
@@ -1391,7 +850,7 @@ function parsePort() {
|
|
|
1391
850
|
}
|
|
1392
851
|
return 4001;
|
|
1393
852
|
}
|
|
1394
|
-
(0,
|
|
853
|
+
(0, import_core5.registerModelLattice)(
|
|
1395
854
|
"default",
|
|
1396
855
|
// {
|
|
1397
856
|
// model: "deepseek-chat",
|
|
@@ -1431,6 +890,54 @@ function parsePort() {
|
|
|
1431
890
|
// }
|
|
1432
891
|
);
|
|
1433
892
|
import_gateway.LatticeGateway.registerLatticeRoutes(import_gateway.LatticeGateway.app);
|
|
893
|
+
var possiblePaths = [
|
|
894
|
+
// Production: from dist/ go up to src/
|
|
895
|
+
import_path.default.resolve(__dirname, "../src/agents/data_agent/skills"),
|
|
896
|
+
// Development: relative to __dirname (src/)
|
|
897
|
+
import_path.default.resolve(__dirname, "./agents/data_agent/skills"),
|
|
898
|
+
// Fallback: from project root
|
|
899
|
+
import_path.default.resolve(process.cwd(), "examples/deep_research/src/agents/data_agent/skills")
|
|
900
|
+
];
|
|
901
|
+
var skillsRootDir = possiblePaths[0];
|
|
902
|
+
for (const possiblePath of possiblePaths) {
|
|
903
|
+
if (fs.existsSync(possiblePath)) {
|
|
904
|
+
skillsRootDir = possiblePath;
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
if (!fs.existsSync(skillsRootDir)) {
|
|
909
|
+
console.warn(
|
|
910
|
+
`Warning: Skills directory not found at any of the expected paths. Using: ${skillsRootDir}`
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
console.log(`Skill store root directory: ${skillsRootDir}`);
|
|
914
|
+
var skillStore = new import_core5.FileSystemSkillStore({
|
|
915
|
+
rootDir: skillsRootDir
|
|
916
|
+
});
|
|
917
|
+
import_core5.storeLatticeManager.removeLattice("default", "skill");
|
|
918
|
+
(0, import_core5.registerStoreLattice)("default", "skill", skillStore);
|
|
919
|
+
import_core5.skillLatticeManager.configureStore("default");
|
|
920
|
+
(async () => {
|
|
921
|
+
try {
|
|
922
|
+
const skills = await skillStore.getAllSkills();
|
|
923
|
+
console.log(`Loaded ${skills.length} skills from file system:`);
|
|
924
|
+
if (skills.length === 0) {
|
|
925
|
+
console.warn(
|
|
926
|
+
`Warning: No skills found. Please check if the directory exists: ${skillsRootDir}`
|
|
927
|
+
);
|
|
928
|
+
} else {
|
|
929
|
+
skills.forEach((skill) => {
|
|
930
|
+
console.log(` - ${skill.name}: ${skill.description.substring(0, 50)}...`);
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
} catch (error) {
|
|
934
|
+
console.error("Failed to load skills on startup:", error);
|
|
935
|
+
if (error instanceof Error) {
|
|
936
|
+
console.error("Error details:", error.message);
|
|
937
|
+
console.error("Stack:", error.stack);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
})();
|
|
1434
941
|
var port = parsePort();
|
|
1435
942
|
console.log(`Starting server on port ${port}`);
|
|
1436
943
|
var DEFAULT_LOGGER_CONFIG = {
|