@axiom-lattice/examples-deep_research 1.0.14 → 1.0.16

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.
@@ -0,0 +1,77 @@
1
+ export const dataVisualization = {
2
+ name: "data-visualization",
3
+ description:
4
+ "为数据分析结果选择合适的图表类型并生成 ECharts 配置。适用于需要将查询结果可视化为柱状图、折线图、饼图、散点图等图表的场景。",
5
+ prompt: `## 图表类型选择指南
6
+
7
+ 根据数据特征和业务问题选择最合适的图表类型:
8
+
9
+ - **柱状图** (bar): 比较类别或时间周期
10
+ - 使用 category xAxis,value yAxis
11
+ - 多系列用于分组/堆叠柱状图
12
+
13
+ - **折线图** (line): 展示时间趋势
14
+ - 使用 category/time xAxis,value yAxis
15
+ - 多系列展示多个指标
16
+
17
+ - **饼图** (pie): 展示构成/百分比
18
+ - 无需 xAxis/yAxis
19
+ - 数据格式: [{value: number, name: string}, ...]
20
+ - 使用 radius: ["40%", "70%"] 创建环形图
21
+
22
+ - **散点图** (scatter): 相关性分析
23
+ - 使用 value xAxis 和 value yAxis
24
+ - 数据格式: [[x, y], [x, y], ...]
25
+
26
+ - **热力图** (heatmap): 多维数据
27
+ - 需要 category xAxis 和 yAxis
28
+ - 数据格式: [[xIndex, yIndex, value], ...]
29
+
30
+ ## ECharts 配置要求
31
+
32
+ 生成完整的 ECharts 配置,必须包含:
33
+
34
+ \`\`\`json
35
+ {
36
+ "table": [...], // 原始数据表格
37
+ "echarts": {
38
+ "title": {"text": "清晰的图表标题"},
39
+ "tooltip": {
40
+ "trigger": "axis", // bar/line 用 "axis", pie/scatter 用 "item"
41
+ "formatter": "..." // 可选:自定义格式化
42
+ },
43
+ "legend": {...}, // 多系列时必需
44
+ "xAxis": {
45
+ "type": "category", // 或 "time", "value"
46
+ "name": "X轴名称",
47
+ "data": [...] // category 类型时必需
48
+ },
49
+ "yAxis": {
50
+ "type": "value",
51
+ "name": "Y轴名称"
52
+ },
53
+ "series": [{
54
+ "type": "bar|line|pie|scatter|heatmap",
55
+ "name": "系列名称",
56
+ "data": [...],
57
+ "label": {...} // 可选:显示数值
58
+ }],
59
+ "grid": {...} // 可选:控制边距
60
+ }
61
+ }
62
+ \`\`\`
63
+
64
+ ## 最佳实践
65
+
66
+ - 图表标题清晰描述业务问题
67
+ - 轴标签使用业务术语,而非技术字段名
68
+ - 数值格式化:百分比、货币、千分位
69
+ - 时间序列使用 "xAxis.type: 'time'" 并正确格式化日期
70
+ - 多系列时使用 legend 区分
71
+ - 重要数值在图表上直接标注(series.label)
72
+
73
+ ## 输出格式
74
+
75
+ 提供完整的 chart JSON 配置,可直接用于渲染。
76
+ `,
77
+ };
@@ -0,0 +1,344 @@
1
+ export const infographicCreator = {
2
+ name: "infographic-creator",
3
+ description:
4
+ "创建信息图表,将数据可视化为易于理解的图表。适用于需要将数据可视化为易于理解的图表的场景。",
5
+ prompt: `
6
+
7
+ 信息图(Infographic)将数据、信息与知识转化为可感知的视觉语言。它结合视觉设计与数据可视化,用直观符号压缩复杂信息,帮助受众快速理解并记住要点。
8
+
9
+ Infographic = Information Structure + Visual Expression
10
+
11
+ 本任务使用 AntV Infographic 创建可视化信息图。
12
+
13
+ 在开始任务前,需要理解 AntV Infographic 语法规范,包括模板列表、数据结构、主题等。
14
+
15
+ 规范
16
+ AntV Infographic 语法
17
+ AntV Infographic 语法是一种自定义的 DSL,用于描述信息图渲染配置。它使用缩进描述信息,具有较强鲁棒性,便于 AI 流式输出并渲染信息图。主要包含以下信息:
18
+
19
+ template:用模板表达文字信息结构。
20
+ data:信息图数据,包含 title、desc、数据项等。数据项通常包含 label、desc、icon 等字段。
21
+ theme:主题包含 palette、font 等样式配置。
22
+ 例如:
23
+
24
+ \`\`\`infographic
25
+ infographic list-row-horizontal-icon-arrow
26
+ data
27
+ title Title
28
+ desc Description
29
+ lists
30
+ - label Label
31
+ value 12.5
32
+ desc Explanation
33
+ icon document text
34
+ theme
35
+ palette #3b82f6 #8b5cf6 #f97316
36
+ \`\`\`
37
+ 语法规范
38
+ 第一行必须是 infographic <template-name>,模板从下方列表中选择(见“可用模板”部分)。
39
+
40
+ 使用 data / theme 块,块内用两个空格缩进。
41
+
42
+ 键值对使用「键 空格 值」;数组使用 - 作为条目前缀。
43
+
44
+ icon 使用图标关键词(如 star fill)。
45
+
46
+ data 应包含 title/desc + 模板对应的主数据字段(不一定是 items)。
47
+
48
+ 主数据字段选择(只用一个,避免混用):
49
+
50
+ list-* → lists
51
+ sequence-* → sequences(可选 order asc|desc)
52
+ compare-* → compares(支持 children 分组对比),可包含多个对比项
53
+ hierarchy-structure → items(每一项对应一个独立层级,每一层级可以包含子项,最多可嵌套 3 层)
54
+ hierarchy-* → 单一 root(树结构,通过 children 嵌套);
55
+ relation-* → nodes + relations;简单关系图可省略 nodes,在 relations 中用箭头语法
56
+ chart-* → values(数值统计,可选 category)
57
+ 不确定时再用 items 兜底
58
+ compare-binary-* / compare-hierarchy-left-right-* 二元模板:必须两个根节点,所有对比项挂在这两个根节点的 children
59
+
60
+ hierarchy-*:使用单一 root,通过 children 嵌套(不要重复 root)
61
+
62
+ theme 用于自定义主题(palette、font 等) 例如:暗色主题 + 自定义配色
63
+
64
+ \`\`\`infographic
65
+ infographic list-row-simple-horizontal-arrow
66
+ theme dark
67
+ palette
68
+ - #61DDAA
69
+ - #F6BD16
70
+ - #F08BB4
71
+ \`\`\`
72
+ 使用 theme.base.text.font-family 指定字体,如手写风格 851tegakizatsu
73
+
74
+ 使用 theme.stylize 选择内置风格并传参 常见风格:
75
+
76
+ rough:手绘效果
77
+ pattern:图案填充
78
+ linear-gradient / radial-gradient:线性/径向渐变
79
+ 例如:手绘风格(rough)
80
+
81
+ \`\`\`infographic
82
+ infographic list-row-simple-horizontal-arrow
83
+ theme
84
+ stylize rough
85
+ base
86
+ text
87
+ font-family 851tegakizatsu
88
+ \`\`\`
89
+ 输出格式要求:
90
+ 必须使用 Markdown 代码块格式输出,语言标识为 infographic。格式如下:
91
+
92
+ \`\`\`infographic
93
+ infographic <template-name>
94
+ data
95
+ ...
96
+ theme
97
+ ...
98
+ \`\`\`
99
+
100
+ 禁止输出纯文本、JSON、HTML、JS 代码或其他格式。只能输出上述格式的 Markdown 代码块。
101
+
102
+ 数据语法示例
103
+ 按模板类别的数据语法示例(使用对应字段,避免同时添加 items):
104
+
105
+ list-* 模版
106
+ \`\`\`infographic
107
+ infographic list-grid-badge-card
108
+ data
109
+ title Feature List
110
+ lists
111
+ - label Fast
112
+ icon flash fast
113
+ - label Secure
114
+ icon secure shield check
115
+ \`\`\`
116
+ sequence-* 模版
117
+ \`\`\`infographic
118
+ infographic sequence-steps-simple
119
+ data
120
+ sequences
121
+ - label Step 1
122
+ - label Step 2
123
+ - label Step 3
124
+ order asc
125
+ \`\`\`
126
+ hierarchy-* 模版
127
+ \`\`\`infographic
128
+ infographic hierarchy-structure
129
+ data
130
+ root
131
+ label Company
132
+ children
133
+ - label Dept A
134
+ - label Dept B
135
+ \`\`\`
136
+ compare-* 模版
137
+ \`\`\`infographic
138
+ infographic compare-swot
139
+ data
140
+ compares
141
+ - label Strengths
142
+ children
143
+ - label Strong brand
144
+ - label Loyal users
145
+ - label Weaknesses
146
+ children
147
+ - label High cost
148
+ - label Slow release
149
+ \`\`\`
150
+ 四象限图
151
+
152
+ \`\`\`infographic
153
+ infographic compare-quadrant-quarter-simple-card
154
+ data
155
+ compares
156
+ - label High Impact & Low Effort
157
+ - label High Impact & High Effort
158
+ - label Low Impact & Low Effort
159
+ - label Low Impact & High Effort
160
+ \`\`\`
161
+ chart-* 模版
162
+ \`\`\`infographic
163
+ infographic chart-column-simple
164
+ data
165
+ values
166
+ - label Visits
167
+ value 1280
168
+ - label Conversion
169
+ value 12.4
170
+ \`\`\`
171
+ relation-* 模版
172
+ 边标签写法:A -label-> B 或 A -->|label| B
173
+
174
+ \`\`\`infographic
175
+ infographic relation-dagre-flow-tb-simple-circle-node
176
+ data
177
+ nodes
178
+ - id A
179
+ label Node A
180
+ - id B
181
+ label Node B
182
+ relations
183
+ A - approves -> B
184
+ A -->|blocks| B
185
+ \`\`\`
186
+ 兜底 items 示例
187
+ \`\`\`infographic
188
+ infographic list-row-horizontal-icon-arrow
189
+ data
190
+ items
191
+ - label Item A
192
+ desc Description
193
+ icon sun
194
+ - label Item B
195
+ desc Description
196
+ icon moon
197
+ \`\`\`
198
+ 可用模板
199
+ chart-bar-plain-text
200
+ chart-column-simple
201
+ chart-line-plain-text
202
+ chart-pie-compact-card
203
+ chart-pie-donut-pill-badge
204
+ chart-pie-donut-plain-text
205
+ chart-pie-plain-text
206
+ chart-wordcloud
207
+ compare-binary-horizontal-badge-card-arrow
208
+ compare-binary-horizontal-simple-fold
209
+ compare-binary-horizontal-underline-text-vs
210
+ compare-hierarchy-left-right-circle-node-pill-badge
211
+ compare-quadrant-quarter-circular
212
+ compare-quadrant-quarter-simple-card
213
+ compare-swot
214
+ hierarchy-mindmap-branch-gradient-capsule-item
215
+ hierarchy-mindmap-level-gradient-compact-card
216
+ hierarchy-structure
217
+ hierarchy-tree-curved-line-rounded-rect-node
218
+ hierarchy-tree-tech-style-badge-card
219
+ hierarchy-tree-tech-style-capsule-item
220
+ list-column-done-list
221
+ list-column-simple-vertical-arrow
222
+ list-column-vertical-icon-arrow
223
+ list-grid-badge-card
224
+ list-grid-candy-card-lite
225
+ list-grid-ribbon-card
226
+ list-row-horizontal-icon-arrow
227
+ list-sector-plain-text
228
+ list-zigzag-down-compact-card
229
+ list-zigzag-down-simple
230
+ list-zigzag-up-compact-card
231
+ list-zigzag-up-simple
232
+ relation-dagre-flow-tb-animated-badge-card
233
+ relation-dagre-flow-tb-animated-simple-circle-node
234
+ relation-dagre-flow-tb-badge-card
235
+ relation-dagre-flow-tb-simple-circle-node
236
+ sequence-ascending-stairs-3d-underline-text
237
+ sequence-ascending-steps
238
+ sequence-circular-simple
239
+ sequence-color-snake-steps-horizontal-icon-line
240
+ sequence-cylinders-3d-simple
241
+ sequence-filter-mesh-simple
242
+ sequence-funnel-simple
243
+ sequence-horizontal-zigzag-underline-text
244
+ sequence-mountain-underline-text
245
+ sequence-pyramid-simple
246
+ sequence-roadmap-vertical-plain-text
247
+ sequence-roadmap-vertical-simple
248
+ sequence-snake-steps-compact-card
249
+ sequence-snake-steps-simple
250
+ sequence-snake-steps-underline-text
251
+ sequence-stairs-front-compact-card
252
+ sequence-stairs-front-pill-badge
253
+ sequence-timeline-rounded-rect-node
254
+ sequence-timeline-simple
255
+ sequence-zigzag-pucks-3d-simple
256
+ sequence-zigzag-steps-underline-text
257
+ 模板选择建议:
258
+
259
+ 严格顺序(流程/步骤/发展趋势)→ sequence-*
260
+ 时间线 → sequence-timeline-*
261
+ 阶梯图 → sequence-stairs-*
262
+ 路线图 → sequence-roadmap-vertical-*
263
+ 折线路径 → sequence-zigzag-*
264
+ 环形进度 → sequence-circular-simple
265
+ 彩色蛇形步骤 → sequence-color-snake-steps-*
266
+ 金字塔 → sequence-pyramid-simple
267
+ 观点列举 → list-row-* 或 list-column-*
268
+ 二元对比(利弊)→ compare-binary-*
269
+ SWOT → compare-swot
270
+ 层级结构(树图)→ hierarchy-tree-*
271
+ 数据图表 → chart-*
272
+ 象限分析 → quadrant-*
273
+ 网格列表(要点)→ list-grid-*
274
+ 关系展示 → relation-*
275
+ 词云 → chart-wordcloud
276
+ 思维导图 → hierarchy-mindmap-*
277
+ 示例
278
+ 绘制互联网技术演进信息图
279
+
280
+ \`\`\`infographic
281
+ infographic list-row-horizontal-icon-arrow
282
+ data
283
+ title Internet Technology Evolution
284
+ desc From Web 1.0 to AI era, key milestones
285
+ lists
286
+ - time 1991
287
+ label Web 1.0
288
+ desc Tim Berners-Lee published the first website, opening the Internet era
289
+ icon web
290
+ - time 2004
291
+ label Web 2.0
292
+ desc Social media and user-generated content become mainstream
293
+ icon account multiple
294
+ - time 2007
295
+ label Mobile
296
+ desc iPhone released, smartphone changes the world
297
+ icon cellphone
298
+ - time 2015
299
+ label Cloud Native
300
+ desc Containerization and microservices architecture are widely used
301
+ icon cloud
302
+ - time 2020
303
+ label Low Code
304
+ desc Visual development lowers the technology threshold
305
+ icon application brackets
306
+ - time 2023
307
+ label AI Large Model
308
+ desc ChatGPT ignites the generative AI revolution
309
+ icon brain
310
+ \`\`\`
311
+ 生成流程
312
+ 第一步:理解用户需求
313
+ 在创建信息图之前,先理解用户需求与想表达的信息,以便确定模板和数据结构。
314
+
315
+ 若用户提供清晰的内容描述,应将其拆解为清晰、简洁的结构。
316
+
317
+ 否则需要向用户澄清(如:“请提供清晰简洁的内容描述。”、“你希望使用哪个模板?”)
318
+
319
+ 提取关键信息结构(title、desc、items 等)。
320
+ 明确所需数据字段(title、desc、items、label、value、icon 等)。
321
+ 选择合适模板。
322
+ 使用 AntV Infographic 语法描述信息图内容,并以 Markdown 代码块格式输出,语言标识为 infographic。
323
+
324
+ 输出格式示例:
325
+ \`\`\`infographic
326
+ infographic <template-name>
327
+ data
328
+ title ...
329
+ desc ...
330
+ ...
331
+ theme
332
+ ...
333
+ \`\`\`
334
+
335
+ 关键注意:
336
+ 1. 必须尊重用户输入的语言。例如用户输入中文,则语法中的文本也必须是中文。
337
+ 2. 必须使用 Markdown 代码块格式,语言标识为 infographic,而不是 HTML、JS 或其他代码格式。
338
+ 3. 代码块内只包含 AntV Infographic DSL 语法,不要包含任何解释性文字。
339
+
340
+
341
+
342
+
343
+ `,
344
+ };
@@ -0,0 +1,82 @@
1
+ export const notebookReport = {
2
+ name: "notebook-report",
3
+ description:
4
+ "生成笔记本风格的数据分析报告,包含执行摘要、分析步骤(SQL、可视化、洞察)和结论。适用于需要将多步骤分析整合为完整、可复现的分析报告的场景。",
5
+ prompt: `
6
+ 如何可视化数据,请通过data-visualization技能了解。
7
+
8
+ ## 报告结构
9
+
10
+ ### 报告标题部分
11
+
12
+ - **标题**:清晰、描述性的分析标题
13
+ - **上下文**:简要介绍分析内容和原因
14
+ - **数据源**:数据库信息和时间周期
15
+ - **执行摘要**:所有关键发现的高级摘要(2-3 段)
16
+
17
+ ### 分析步骤(笔记本单元格)
18
+
19
+ 每个分析步骤是一个完整的单元格,包含:
20
+
21
+ \`\`\`markdown
22
+ ## 步骤 [N]:[步骤标题]
23
+
24
+ ### 问题 / 目标
25
+ [此步骤要回答的业务问题,来自 topic_[sub_topic_name].md]
26
+
27
+ ### SQL 查询
28
+ \`\`\`sql
29
+ [完整 SQL 查询,带注释说明]
30
+ \`\`\`
31
+
32
+ ### 数据可视化
33
+ \`\`\`chart
34
+ {
35
+ "table": [...],
36
+ "echarts": {
37
+ "title": {"text": "[图表标题]"},
38
+ "tooltip": {...},
39
+ "legend": {...},
40
+ "xAxis": {...},
41
+ "yAxis": {...},
42
+ "series": [...]
43
+ }
44
+ }
45
+ \`\`\`
46
+
47
+ ### 关键发现
48
+ [来自 data-analysis-agent 的核心洞察,用业务语言表达]
49
+
50
+ ### 业务解释
51
+ [这些发现对业务的意义和影响]
52
+
53
+ ### 建议
54
+ [基于此分析的具体、可操作建议]
55
+ \`\`\`
56
+
57
+ ### 报告结论
58
+
59
+ - **所有发现的摘要**:综合所有步骤的洞察
60
+ - **总体建议**:按优先级排序的可操作建议
61
+ - **后续分析**:建议的下一步分析方向(如适用)
62
+
63
+ ## 报告编写原则
64
+
65
+ - **故事性**:将分析组织成连贯的故事,而非技术报告
66
+ - **业务聚焦**:使用业务术语,避免技术 jargon
67
+ - **数据驱动**:将具体数值自然融入叙述
68
+ - **可操作**:每个发现都应导向可执行的建议
69
+ - **逻辑递进**:步骤之间要有清晰的逻辑连接
70
+
71
+ ## 数据来源
72
+
73
+ 报告应基于:
74
+ - \`/question.md\`:原始业务问题
75
+ - \`/topic_*.md\`:各子主题的分析结果
76
+ - 步骤 3 的综合摘要
77
+
78
+ ## 输出格式
79
+
80
+ 生成完整的 Markdown 格式报告,包含所有分析步骤、图表配置和洞察。
81
+ `,
82
+ };
@@ -0,0 +1,58 @@
1
+ export const sqlQuery = {
2
+ name: "sql-query",
3
+ description:
4
+ "生成和执行 SQL 查询以检索业务数据。适用于需要从数据库获取数据、探索表结构、验证查询正确性的场景。委托给 sql-builder-agent 执行。",
5
+ prompt: `## 委托给 sql-builder-agent
6
+
7
+ 所有 SQL 相关操作都委托给 sql-builder-agent 子代理执行。
8
+
9
+ ## 数据库模式探索
10
+
11
+ **请求模式信息**:
12
+ - "请列出数据库中所有可用的表"
13
+ - "请显示表 [X] 的模式,包括列、数据类型和关系"
14
+
15
+ **检查现有文档**:
16
+ - 先读取 \`/db_schema.md\`(如存在)
17
+ - 仅在需要时请求新的模式探索
18
+
19
+ ## 查询生成与执行
20
+
21
+ **提供清晰的业务需求**:
22
+ 1. **业务问题**:明确要回答的问题
23
+ 2. **指标**:需要计算的业务指标(收入、订单数、转化率等)
24
+ 3. **维度**:分组维度(地区、渠道、产品类别等)
25
+ 4. **筛选条件**:时间范围、状态、类别等
26
+ 5. **比较需求**:同比、环比、目标对比等
27
+
28
+ **请求格式示例**:
29
+ "我需要按地区比较 2024 年第三季度与 2023 年第三季度的收入。请生成并执行 SQL 查询。"
30
+
31
+ "请查询过去 6 个月每个月的订单量和平均订单金额,按渠道分组。"
32
+
33
+ ## 接收与验证结果
34
+
35
+ sql-builder-agent 会返回:
36
+ - **SQL 查询**:格式清晰的完整查询
37
+ - **查询结果**:返回的数据
38
+ - **模式信息**:使用的表结构信息
39
+
40
+ **验证要点**:
41
+ - 查询是否正确回答了业务问题
42
+ - 数据质量(NULL 值、异常值)
43
+ - 结果完整性(行数、时间范围)
44
+ - 列名是否业务友好
45
+
46
+ ## 错误处理
47
+
48
+ 如遇到查询错误:
49
+ - 分析错误信息
50
+ - 检查表名、列名是否正确
51
+ - 验证 JOIN 条件和数据类型
52
+ - 请求 sql-builder-agent 修正并重新执行
53
+
54
+ ## 文档化
55
+
56
+ 将使用的 SQL 查询和结果保存到分析文档中,便于后续参考和复现。
57
+ `,
58
+ };
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Load Skills Tools
3
+ * Tools for loading skill metadata and content
4
+ */
5
+
6
+ import z from "zod";
7
+ import { registerToolLattice } from "@axiom-lattice/core";
8
+ import * as analystSkill from "../skills/analyst";
9
+ import * as dataVisualizationSkill from "../skills/data-visualization";
10
+ import * as sqlQuerySkill from "../skills/sql-query";
11
+ import * as analysisMethodologySkill from "../skills/analysis-methodology";
12
+ import * as notebookReportSkill from "../skills/notebook-report";
13
+ import * as infographicCreatorSkill from "../skills/infographic-creator";
14
+
15
+ // Type definition for skill structure
16
+ interface Skill {
17
+ name: string;
18
+ description: string;
19
+ prompt: string;
20
+ }
21
+
22
+ // Registry of all available skills
23
+ const skillsRegistry: Record<string, Skill> = {
24
+ analyst: analystSkill.analyst,
25
+ "data-visualization": dataVisualizationSkill.dataVisualization,
26
+ "sql-query": sqlQuerySkill.sqlQuery,
27
+ "analysis-methodology": analysisMethodologySkill.analysisMethodology,
28
+ "notebook-report": notebookReportSkill.notebookReport,
29
+ "infographic-creator": infographicCreatorSkill.infographicCreator,
30
+ };
31
+
32
+ /**
33
+ * Load all skills and return their metadata (name and description, without prompt)
34
+ */
35
+ registerToolLattice(
36
+ "load_skills",
37
+ {
38
+ name: "load_skills",
39
+ description:
40
+ "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.",
41
+ needUserApprove: false,
42
+ schema: z.object({}),
43
+ },
44
+ async (_input: Record<string, never>, _config: any) => {
45
+ try {
46
+ const skillsMeta = Object.values(skillsRegistry).map((skill) => ({
47
+ name: skill.name,
48
+ description: skill.description,
49
+ }));
50
+
51
+ return JSON.stringify(skillsMeta, null, 2);
52
+ } catch (error) {
53
+ return `Error loading skills: ${error instanceof Error ? error.message : String(error)
54
+ }`;
55
+ }
56
+ }
57
+ );
58
+
59
+ /**
60
+ * Load a specific skill's content and return its prompt
61
+ */
62
+ registerToolLattice(
63
+ "load_skill_content",
64
+ {
65
+ name: "load_skill_content",
66
+ description:
67
+ "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.",
68
+ needUserApprove: false,
69
+ schema: z.object({
70
+ skill_name: z.string().describe("The name of the skill to load"),
71
+ }),
72
+ },
73
+ async (input: { skill_name: string }, _config: any) => {
74
+ try {
75
+ const skill = skillsRegistry[input.skill_name];
76
+
77
+ if (!skill) {
78
+ const availableSkills = Object.keys(skillsRegistry).join(", ");
79
+ return `Skill "${input.skill_name}" not found. Available skills: ${availableSkills}`;
80
+ }
81
+
82
+ return skill.prompt;
83
+ } catch (error) {
84
+ return `Error loading skill content: ${error instanceof Error ? error.message : String(error)
85
+ }`;
86
+ }
87
+ }
88
+ );
package/src/index.ts CHANGED
@@ -10,7 +10,11 @@ import {
10
10
  import "./agents";
11
11
 
12
12
  import path from "path";
13
- import { ScheduleType } from "@axiom-lattice/protocols";
13
+ import {
14
+ LoggerConfig,
15
+ LoggerType,
16
+ ScheduleType,
17
+ } from "@axiom-lattice/protocols";
14
18
  import { PostgreSQLScheduleStorage } from "@axiom-lattice/pg-stores";
15
19
  // 在文件开头添加
16
20
  const PACKAGE_VERSION = require("../package.json").version;
@@ -129,7 +133,23 @@ LatticeGateway.registerLatticeRoutes(LatticeGateway.app);
129
133
  const port = parsePort();
130
134
  console.log(`Starting server on port ${port}`);
131
135
 
136
+ // Default logger configuration
137
+ const DEFAULT_LOGGER_CONFIG: LoggerConfig = {
138
+ name: "default",
139
+ description: "Default logger for lattice-gateway service",
140
+ type: LoggerType.PINO,
141
+ serviceName: "lattice/deep_research",
142
+ loggerName: "lattice/deep_research",
143
+ // file: {
144
+ // file: "./logs/lattice" + "/deep_research",
145
+ // frequency: "daily",
146
+ // mkdir: true,
147
+ // maxFiles: 30,
148
+ // },
149
+ };
150
+
132
151
  LatticeGateway.startAsHttpEndpoint({
133
152
  port,
134
153
  queueServiceConfig: { type: "memory", defaultStartPollingQueue: true },
154
+ loggerConfig: DEFAULT_LOGGER_CONFIG,
135
155
  });