@hedgehog-finance/hedgehog-plugin 1.0.21 → 1.0.23
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/dist/index.d.ts +4 -3
- package/dist/index.js +49 -6
- package/dist/index.js.map +1 -1
- package/dist/setup-api.d.ts +2 -0
- package/dist/setup-api.js +8 -0
- package/dist/setup-api.js.map +1 -0
- package/dist/src/channel.js +25 -23
- package/dist/src/channel.js.map +1 -1
- package/dist/src/core/database.js +449 -39
- package/dist/src/core/database.js.map +1 -1
- package/dist/src/dailyMorningBriefingCron.d.ts +46 -0
- package/dist/src/dailyMorningBriefingCron.js +82 -0
- package/dist/src/dailyMorningBriefingCron.js.map +1 -0
- package/dist/src/features/chartOutput.d.ts +2 -0
- package/dist/src/features/chartOutput.js +35 -0
- package/dist/src/features/chartOutput.js.map +1 -0
- package/dist/src/features/dailyMorningBriefing/schema.d.ts +56 -0
- package/dist/src/features/dailyMorningBriefing/schema.js +22 -0
- package/dist/src/features/dailyMorningBriefing/schema.js.map +1 -0
- package/dist/src/features/dailyMorningBriefing/tools.d.ts +12 -0
- package/dist/src/features/dailyMorningBriefing/tools.js +204 -0
- package/dist/src/features/dailyMorningBriefing/tools.js.map +1 -0
- package/dist/src/features/deepReasoning/schema.d.ts +43 -0
- package/dist/src/features/deepReasoning/schema.js +17 -0
- package/dist/src/features/deepReasoning/schema.js.map +1 -0
- package/dist/src/features/deepReasoning/tools.d.ts +12 -0
- package/dist/src/features/deepReasoning/tools.js +163 -0
- package/dist/src/features/deepReasoning/tools.js.map +1 -0
- package/dist/src/features/index.d.ts +2 -1
- package/dist/src/features/index.js +9 -1
- package/dist/src/features/index.js.map +1 -1
- package/dist/src/features/informationVerification/schema.d.ts +43 -0
- package/dist/src/features/informationVerification/schema.js +17 -0
- package/dist/src/features/informationVerification/schema.js.map +1 -0
- package/dist/src/features/informationVerification/tools.d.ts +12 -0
- package/dist/src/features/informationVerification/tools.js +162 -0
- package/dist/src/features/informationVerification/tools.js.map +1 -0
- package/dist/src/features/notes/schema.d.ts +136 -39
- package/dist/src/features/notes/schema.js +13 -10
- package/dist/src/features/notes/schema.js.map +1 -1
- package/dist/src/features/notes/tools.d.ts +1 -0
- package/dist/src/features/notes/tools.js +47 -14
- package/dist/src/features/notes/tools.js.map +1 -1
- package/dist/src/features/pluginInfo/schema.d.ts +79 -0
- package/dist/src/features/pluginInfo/schema.js +14 -0
- package/dist/src/features/pluginInfo/schema.js.map +1 -0
- package/dist/src/features/pluginInfo/tools.d.ts +1 -0
- package/dist/src/features/pluginInfo/tools.js +157 -2
- package/dist/src/features/pluginInfo/tools.js.map +1 -1
- package/dist/src/features/profileLibrary/schema.d.ts +34 -6
- package/dist/src/features/profileLibrary/schema.js +1 -1
- package/dist/src/features/profileLibrary/schema.js.map +1 -1
- package/dist/src/features/stockAnalysis/schema.d.ts +224 -31
- package/dist/src/features/stockAnalysis/schema.js +76 -12
- package/dist/src/features/stockAnalysis/schema.js.map +1 -1
- package/dist/src/features/stockAnalysis/tools.d.ts +6 -4
- package/dist/src/features/stockAnalysis/tools.js +389 -44
- package/dist/src/features/stockAnalysis/tools.js.map +1 -1
- package/dist/src/features/stockBasic/schema.d.ts +149 -0
- package/dist/src/features/stockBasic/schema.js +26 -0
- package/dist/src/features/stockBasic/schema.js.map +1 -0
- package/dist/src/features/stockBasic/tools.d.ts +12 -0
- package/dist/src/features/stockBasic/tools.js +124 -0
- package/dist/src/features/stockBasic/tools.js.map +1 -0
- package/dist/src/features/watchlist/logic.d.ts +3 -3
- package/dist/src/features/watchlist/logic.js +47 -46
- package/dist/src/features/watchlist/logic.js.map +1 -1
- package/dist/src/features/watchlist/schema.d.ts +89 -54
- package/dist/src/features/watchlist/schema.js +7 -4
- package/dist/src/features/watchlist/schema.js.map +1 -1
- package/dist/src/features/watchlist/tools.d.ts +106 -59
- package/dist/src/features/watchlist/tools.js +182 -104
- package/dist/src/features/watchlist/tools.js.map +1 -1
- package/dist/src/openclawConfig.d.ts +6 -0
- package/dist/src/openclawConfig.js +74 -0
- package/dist/src/openclawConfig.js.map +1 -0
- package/dist/src/openclawConstants.d.ts +4 -0
- package/dist/src/openclawConstants.js +10 -0
- package/dist/src/openclawConstants.js.map +1 -0
- package/dist/src/runtime.js +20 -0
- package/dist/src/runtime.js.map +1 -1
- package/index.ts +52 -5
- package/openclaw.plugin.json +24 -0
- package/package.json +20 -5
- package/setup-api.ts +10 -0
- package/src/channel.ts +26 -25
- package/src/core/database.ts +447 -40
- package/src/dailyMorningBriefingCron.ts +129 -0
- package/src/features/chartOutput.ts +35 -0
- package/src/features/dailyMorningBriefing/schema.ts +38 -0
- package/src/features/dailyMorningBriefing/tools.ts +246 -0
- package/src/features/deepReasoning/schema.ts +22 -0
- package/src/features/deepReasoning/tools.ts +182 -0
- package/src/features/index.ts +11 -2
- package/src/features/informationVerification/schema.ts +22 -0
- package/src/features/informationVerification/tools.ts +181 -0
- package/src/features/notes/schema.ts +17 -12
- package/src/features/notes/tools.ts +54 -17
- package/src/features/pluginInfo/schema.ts +19 -0
- package/src/features/pluginInfo/tools.ts +173 -2
- package/src/features/profileLibrary/schema.ts +1 -1
- package/src/features/stockAnalysis/schema.ts +99 -17
- package/src/features/stockAnalysis/tools.ts +447 -49
- package/src/features/stockBasic/schema.ts +33 -0
- package/src/features/stockBasic/tools.ts +157 -0
- package/src/features/watchlist/logic.ts +56 -53
- package/src/features/watchlist/schema.ts +11 -6
- package/src/features/watchlist/tools.ts +191 -106
- package/src/openclawConfig.ts +101 -0
- package/src/openclawConstants.ts +11 -0
- package/src/runtime.ts +19 -0
|
@@ -1,59 +1,141 @@
|
|
|
1
|
-
import { z } from "
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const AiAnalysisStatusSchema = z.enum(["generating", "completed", "failed"]);
|
|
4
|
+
|
|
5
|
+
export const BuildStockAiAnalysisMessageParamsSchema = z.object({
|
|
6
|
+
stock_code: z.string().trim().min(1).describe("股票代码"),
|
|
7
|
+
stock_name: z.string().trim().min(1).describe("股票名称"),
|
|
8
|
+
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN")
|
|
9
|
+
});
|
|
10
|
+
export type BuildStockAiAnalysisMessageParams = z.infer<typeof BuildStockAiAnalysisMessageParamsSchema>;
|
|
2
11
|
|
|
3
12
|
export const GetStockAiAnalysisParamsSchema = z.object({
|
|
4
|
-
|
|
13
|
+
stock_code: z.string().trim().min(1).describe("股票代码"),
|
|
5
14
|
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN")
|
|
6
15
|
});
|
|
7
16
|
export type GetStockAiAnalysisParams = z.infer<typeof GetStockAiAnalysisParamsSchema>;
|
|
8
17
|
|
|
18
|
+
export const GetStockAiAnalysisDetailParamsSchema = z.object({
|
|
19
|
+
id: z.string().trim().min(1).describe("分析记录 ID")
|
|
20
|
+
});
|
|
21
|
+
export type GetStockAiAnalysisDetailParams = z.infer<typeof GetStockAiAnalysisDetailParamsSchema>;
|
|
22
|
+
|
|
9
23
|
export const QueryStockAiAnalysisHistoryParamsSchema = z.object({
|
|
10
|
-
|
|
24
|
+
stock_code: z.string().trim().min(1).optional().describe("股票代码,不传则查询全部"),
|
|
11
25
|
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN"),
|
|
12
26
|
page: z.number().int().min(1).default(1).describe("页码"),
|
|
13
|
-
pageSize: z.number().int().min(1).max(50).default(
|
|
27
|
+
pageSize: z.number().int().min(1).max(50).default(10).describe("每页数量,默认 10")
|
|
14
28
|
});
|
|
15
29
|
export type QueryStockAiAnalysisHistoryParams = z.infer<typeof QueryStockAiAnalysisHistoryParamsSchema>;
|
|
16
30
|
|
|
31
|
+
export const QueryStockAiAnalysisStocksParamsSchema = z.object({
|
|
32
|
+
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN"),
|
|
33
|
+
page: z.number().int().min(1).default(1).describe("页码"),
|
|
34
|
+
pageSize: z.number().int().min(1).max(100).default(50).describe("每页数量,默认 50")
|
|
35
|
+
});
|
|
36
|
+
export type QueryStockAiAnalysisStocksParams = z.infer<typeof QueryStockAiAnalysisStocksParamsSchema>;
|
|
37
|
+
|
|
17
38
|
export const SaveStockAiAnalysisParamsSchema = z.object({
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
stock_code: z.string().trim().min(1).describe("股票代码"),
|
|
40
|
+
stock_name: z.string().trim().optional().default("").describe("股票名称;status=generating 时必须提供"),
|
|
20
41
|
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN"),
|
|
21
|
-
content: z.string().
|
|
42
|
+
content: z.string().default("").describe("AI 分析内容;status=generating 时为空,status=failed 时存入错误信息"),
|
|
43
|
+
status: AiAnalysisStatusSchema.default("completed").describe("保存状态:generating 生成中,completed 成功,failed 失败")
|
|
44
|
+
}).strict().refine((value) => {
|
|
45
|
+
if (value.status === "completed") return value.content.trim().length > 0;
|
|
46
|
+
return true;
|
|
47
|
+
}, {
|
|
48
|
+
message: "completed 状态必须提供 content"
|
|
49
|
+
}).refine((value) => {
|
|
50
|
+
if (value.status !== "generating") return true;
|
|
51
|
+
return value.stock_name.trim().length > 0;
|
|
52
|
+
}, {
|
|
53
|
+
message: "generating 状态必须提供 stock_name"
|
|
22
54
|
});
|
|
23
55
|
export type SaveStockAiAnalysisParams = z.infer<typeof SaveStockAiAnalysisParamsSchema>;
|
|
24
56
|
|
|
25
57
|
export interface StockAiAnalysis {
|
|
26
58
|
id: string;
|
|
27
|
-
|
|
28
|
-
|
|
59
|
+
stock_code: string;
|
|
60
|
+
stock_name: string;
|
|
29
61
|
market: string;
|
|
62
|
+
status: string;
|
|
30
63
|
content: string;
|
|
31
64
|
createdAt: string;
|
|
32
65
|
updatedAt: string;
|
|
33
66
|
}
|
|
34
67
|
|
|
35
|
-
export
|
|
68
|
+
export interface StockAiAnalysisStockSummary {
|
|
69
|
+
stock_code: string;
|
|
70
|
+
stock_name: string;
|
|
71
|
+
market: string;
|
|
72
|
+
latestAnalysisId: string;
|
|
73
|
+
latestStatus: string;
|
|
74
|
+
latestCreatedAt: string;
|
|
75
|
+
latestUpdatedAt: string;
|
|
76
|
+
analysisCount: number;
|
|
77
|
+
}
|
|
36
78
|
|
|
79
|
+
export const ArticleAiAnalysisKindSchema = z.enum(["verification", "deduction"]);
|
|
37
80
|
export const GetArticleAiAnalysisParamsSchema = z.object({
|
|
38
|
-
|
|
81
|
+
sourceId: z.string().trim().min(1).describe("文章来源 ID,例如 news-5、report-5、announce-5"),
|
|
39
82
|
analysisType: ArticleAiAnalysisKindSchema.describe("分析类型:verification 信息求证,deduction 深度推演"),
|
|
40
|
-
market: z.string().trim().min(1).default("CN").describe("
|
|
83
|
+
market: z.string().trim().min(1).default("CN").describe("市场类型;深度推演使用,信息求证忽略")
|
|
41
84
|
});
|
|
42
85
|
export type GetArticleAiAnalysisParams = z.infer<typeof GetArticleAiAnalysisParamsSchema>;
|
|
43
86
|
|
|
44
|
-
export const
|
|
45
|
-
id: z.string().trim().min(1).describe("文章来源 ID,例如 news-5、report-5、announce-5"),
|
|
87
|
+
export const QueryArticleAiAnalysisHistoryParamsSchema = z.object({
|
|
46
88
|
analysisType: ArticleAiAnalysisKindSchema.describe("分析类型:verification 信息求证,deduction 深度推演"),
|
|
47
|
-
market: z.string().trim().min(1).default("CN").describe("
|
|
48
|
-
|
|
89
|
+
market: z.string().trim().min(1).default("CN").describe("市场类型;深度推演使用,信息求证忽略"),
|
|
90
|
+
page: z.number().int().min(1).default(1).describe("页码"),
|
|
91
|
+
pageSize: z.number().int().min(1).max(50).default(10).describe("每页数量,默认 10")
|
|
92
|
+
});
|
|
93
|
+
export type QueryArticleAiAnalysisHistoryParams = z.infer<typeof QueryArticleAiAnalysisHistoryParamsSchema>;
|
|
94
|
+
|
|
95
|
+
export const SaveArticleAiAnalysisParamsSchema = z.object({
|
|
96
|
+
sourceId: z.string().trim().min(1).describe("新闻来源 ID,例如 news-5"),
|
|
97
|
+
sourceTitle: z.string().trim().optional().default("").describe("新闻标题;status=generating 时必须提供"),
|
|
98
|
+
content: z.string().default("").describe("AI 分析内容;status=generating 时为空,status=failed 时存入错误信息"),
|
|
99
|
+
status: AiAnalysisStatusSchema.default("completed").describe("保存状态:generating 生成中,completed 成功,failed 失败")
|
|
100
|
+
}).strict().refine((value) => {
|
|
101
|
+
if (value.status === "completed") return value.content.trim().length > 0;
|
|
102
|
+
return true;
|
|
103
|
+
}, {
|
|
104
|
+
message: "completed 状态必须提供 content"
|
|
105
|
+
}).refine((value) => {
|
|
106
|
+
if (value.status !== "generating") return true;
|
|
107
|
+
return value.sourceTitle.trim().length > 0;
|
|
108
|
+
}, {
|
|
109
|
+
message: "generating 状态必须提供 sourceTitle"
|
|
49
110
|
});
|
|
50
111
|
export type SaveArticleAiAnalysisParams = z.infer<typeof SaveArticleAiAnalysisParamsSchema>;
|
|
51
112
|
|
|
113
|
+
export const SaveArticleDeepReasoningParamsSchema = z.object({
|
|
114
|
+
sourceId: z.string().trim().min(1).describe("新闻来源 ID,例如 news-5"),
|
|
115
|
+
sourceTitle: z.string().trim().optional().default("").describe("新闻标题;status=generating 时必须提供"),
|
|
116
|
+
market: z.string().trim().min(1).default("CN").describe("市场类型,默认 CN"),
|
|
117
|
+
content: z.string().default("").describe("AI 分析内容;status=generating 时为空,status=failed 时存入错误信息"),
|
|
118
|
+
status: AiAnalysisStatusSchema.default("completed").describe("保存状态:generating 生成中,completed 成功,failed 失败")
|
|
119
|
+
}).strict().refine((value) => {
|
|
120
|
+
if (value.status === "completed") return value.content.trim().length > 0;
|
|
121
|
+
return true;
|
|
122
|
+
}, {
|
|
123
|
+
message: "completed 状态必须提供 content"
|
|
124
|
+
}).refine((value) => {
|
|
125
|
+
if (value.status !== "generating") return true;
|
|
126
|
+
return value.sourceTitle.trim().length > 0;
|
|
127
|
+
}, {
|
|
128
|
+
message: "generating 状态必须提供 sourceTitle"
|
|
129
|
+
});
|
|
130
|
+
export type SaveArticleDeepReasoningParams = z.infer<typeof SaveArticleDeepReasoningParamsSchema>;
|
|
131
|
+
|
|
52
132
|
export interface ArticleAiAnalysis {
|
|
53
133
|
id: string;
|
|
54
134
|
sourceId: string;
|
|
55
135
|
analysisType: GetArticleAiAnalysisParams["analysisType"];
|
|
56
|
-
|
|
136
|
+
sourceTitle?: string;
|
|
137
|
+
market?: string;
|
|
138
|
+
status: string;
|
|
57
139
|
content: string;
|
|
58
140
|
createdAt: string;
|
|
59
141
|
updatedAt: string;
|