tickflow-assist 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -0
- package/day_future.txt +8797 -0
- package/dist/analysis/orchestrators/composite-analysis.orchestrator.d.ts +35 -0
- package/dist/analysis/orchestrators/composite-analysis.orchestrator.js +232 -0
- package/dist/analysis/parsers/json-block.parser.d.ts +1 -0
- package/dist/analysis/parsers/json-block.parser.js +13 -0
- package/dist/analysis/parsers/key-levels.parser.d.ts +5 -0
- package/dist/analysis/parsers/key-levels.parser.js +61 -0
- package/dist/analysis/parsers/post-close-review.parser.d.ts +2 -0
- package/dist/analysis/parsers/post-close-review.parser.js +79 -0
- package/dist/analysis/parsers/watchlist-profile.parser.d.ts +6 -0
- package/dist/analysis/parsers/watchlist-profile.parser.js +93 -0
- package/dist/analysis/providers/financial-analysis.provider.d.ts +12 -0
- package/dist/analysis/providers/financial-analysis.provider.js +85 -0
- package/dist/analysis/providers/market-analysis.provider.d.ts +27 -0
- package/dist/analysis/providers/market-analysis.provider.js +187 -0
- package/dist/analysis/providers/news-analysis.provider.d.ts +9 -0
- package/dist/analysis/providers/news-analysis.provider.js +60 -0
- package/dist/analysis/tasks/analysis-step-task.d.ts +11 -0
- package/dist/analysis/tasks/analysis-step-task.js +1 -0
- package/dist/analysis/tasks/analysis-task.d.ts +13 -0
- package/dist/analysis/tasks/analysis-task.js +1 -0
- package/dist/analysis/tasks/composite-stock-analysis.task.d.ts +17 -0
- package/dist/analysis/tasks/composite-stock-analysis.task.js +47 -0
- package/dist/analysis/tasks/financial-fundamental-lite.task.d.ts +10 -0
- package/dist/analysis/tasks/financial-fundamental-lite.task.js +21 -0
- package/dist/analysis/tasks/financial-fundamental.task.d.ts +12 -0
- package/dist/analysis/tasks/financial-fundamental.task.js +64 -0
- package/dist/analysis/tasks/kline-technical-signal.task.d.ts +10 -0
- package/dist/analysis/tasks/kline-technical-signal.task.js +41 -0
- package/dist/analysis/tasks/kline-technical.task.d.ts +32 -0
- package/dist/analysis/tasks/kline-technical.task.js +61 -0
- package/dist/analysis/tasks/news-catalyst.task.d.ts +11 -0
- package/dist/analysis/tasks/news-catalyst.task.js +62 -0
- package/dist/analysis/tasks/post-close-review.task.d.ts +12 -0
- package/dist/analysis/tasks/post-close-review.task.js +35 -0
- package/dist/analysis/types/composite-analysis.d.ts +123 -0
- package/dist/analysis/types/composite-analysis.js +1 -0
- package/dist/background/daily-update.worker.d.ts +50 -0
- package/dist/background/daily-update.worker.js +546 -0
- package/dist/background/realtime-monitor.worker.d.ts +8 -0
- package/dist/background/realtime-monitor.worker.js +28 -0
- package/dist/bootstrap.d.ts +45 -0
- package/dist/bootstrap.js +214 -0
- package/dist/config/normalize.d.ts +4 -0
- package/dist/config/normalize.js +99 -0
- package/dist/config/schema.d.ts +23 -0
- package/dist/config/schema.js +18 -0
- package/dist/config/tickflow-access.d.ts +4 -0
- package/dist/config/tickflow-access.js +28 -0
- package/dist/constants/market-indexes.d.ts +5 -0
- package/dist/constants/market-indexes.js +4 -0
- package/dist/dev/run-daily-update-loop.d.ts +1 -0
- package/dist/dev/run-daily-update-loop.js +48 -0
- package/dist/dev/run-monitor-loop.d.ts +1 -0
- package/dist/dev/run-monitor-loop.js +60 -0
- package/dist/dev/run-tool.d.ts +1 -0
- package/dist/dev/run-tool.js +49 -0
- package/dist/dev/tickflow-assist-cli.d.ts +2 -0
- package/dist/dev/tickflow-assist-cli.js +525 -0
- package/dist/dev/validate-mx-search.d.ts +1 -0
- package/dist/dev/validate-mx-search.js +212 -0
- package/dist/plugin-commands.d.ts +3 -0
- package/dist/plugin-commands.js +229 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.js +151 -0
- package/dist/prompts/analysis/common-system-prompt.d.ts +1 -0
- package/dist/prompts/analysis/common-system-prompt.js +44 -0
- package/dist/prompts/analysis/composite-analysis-user-prompt.d.ts +11 -0
- package/dist/prompts/analysis/composite-analysis-user-prompt.js +102 -0
- package/dist/prompts/analysis/financial-analysis-user-prompt.d.ts +7 -0
- package/dist/prompts/analysis/financial-analysis-user-prompt.js +106 -0
- package/dist/prompts/analysis/financial-lite-analysis-user-prompt.d.ts +7 -0
- package/dist/prompts/analysis/financial-lite-analysis-user-prompt.js +59 -0
- package/dist/prompts/analysis/index.d.ts +8 -0
- package/dist/prompts/analysis/index.js +8 -0
- package/dist/prompts/analysis/kline-analysis-user-prompt.d.ts +13 -0
- package/dist/prompts/analysis/kline-analysis-user-prompt.js +215 -0
- package/dist/prompts/analysis/news-analysis-user-prompt.d.ts +8 -0
- package/dist/prompts/analysis/news-analysis-user-prompt.js +57 -0
- package/dist/prompts/analysis/post-close-review-user-prompt.d.ts +3 -0
- package/dist/prompts/analysis/post-close-review-user-prompt.js +129 -0
- package/dist/prompts/analysis/watchlist-profile-extraction-prompt.d.ts +7 -0
- package/dist/prompts/analysis/watchlist-profile-extraction-prompt.js +52 -0
- package/dist/prompts/analysis-system-prompt.d.ts +1 -0
- package/dist/prompts/analysis-system-prompt.js +1 -0
- package/dist/prompts/analysis-user-prompt.d.ts +1 -0
- package/dist/prompts/analysis-user-prompt.js +1 -0
- package/dist/runtime/daily-update-process.d.ts +3 -0
- package/dist/runtime/daily-update-process.js +24 -0
- package/dist/runtime/monitor-process.d.ts +3 -0
- package/dist/runtime/monitor-process.js +24 -0
- package/dist/runtime/plugin-api.d.ts +22 -0
- package/dist/runtime/plugin-api.js +2 -0
- package/dist/runtime/process-config.d.ts +8 -0
- package/dist/runtime/process-config.js +35 -0
- package/dist/services/alert-service.d.ts +45 -0
- package/dist/services/alert-service.js +198 -0
- package/dist/services/analysis-service.d.ts +20 -0
- package/dist/services/analysis-service.js +73 -0
- package/dist/services/analysis-view-service.d.ts +23 -0
- package/dist/services/analysis-view-service.js +343 -0
- package/dist/services/financial-lite-service.d.ts +23 -0
- package/dist/services/financial-lite-service.js +201 -0
- package/dist/services/financial-service.d.ts +20 -0
- package/dist/services/financial-service.js +47 -0
- package/dist/services/indicator-service.d.ts +9 -0
- package/dist/services/indicator-service.js +67 -0
- package/dist/services/instrument-service.d.ts +6 -0
- package/dist/services/instrument-service.js +21 -0
- package/dist/services/key-level-service.d.ts +2 -0
- package/dist/services/key-level-service.js +2 -0
- package/dist/services/key-levels-backtest-service.d.ts +71 -0
- package/dist/services/key-levels-backtest-service.js +427 -0
- package/dist/services/kline-service.d.ts +19 -0
- package/dist/services/kline-service.js +91 -0
- package/dist/services/monitor-service.d.ts +44 -0
- package/dist/services/monitor-service.js +598 -0
- package/dist/services/mx-search-service.d.ts +22 -0
- package/dist/services/mx-search-service.js +286 -0
- package/dist/services/post-close-review-service.d.ts +31 -0
- package/dist/services/post-close-review-service.js +402 -0
- package/dist/services/quote-service.d.ts +7 -0
- package/dist/services/quote-service.js +9 -0
- package/dist/services/review-memory-service.d.ts +7 -0
- package/dist/services/review-memory-service.js +76 -0
- package/dist/services/tickflow-client.d.ts +43 -0
- package/dist/services/tickflow-client.js +126 -0
- package/dist/services/trading-calendar-service.d.ts +20 -0
- package/dist/services/trading-calendar-service.js +102 -0
- package/dist/services/update-service.d.ts +21 -0
- package/dist/services/update-service.js +130 -0
- package/dist/services/watchlist-profile-service.d.ts +20 -0
- package/dist/services/watchlist-profile-service.js +76 -0
- package/dist/services/watchlist-service.d.ts +43 -0
- package/dist/services/watchlist-service.js +204 -0
- package/dist/storage/db.d.ts +23 -0
- package/dist/storage/db.js +70 -0
- package/dist/storage/repositories/alert-log-repo.d.ts +15 -0
- package/dist/storage/repositories/alert-log-repo.js +54 -0
- package/dist/storage/repositories/analysis-log-repo.d.ts +8 -0
- package/dist/storage/repositories/analysis-log-repo.js +48 -0
- package/dist/storage/repositories/composite-analysis-repo.d.ts +9 -0
- package/dist/storage/repositories/composite-analysis-repo.js +116 -0
- package/dist/storage/repositories/financial-analysis-repo.d.ts +9 -0
- package/dist/storage/repositories/financial-analysis-repo.js +107 -0
- package/dist/storage/repositories/indicators-repo.d.ts +8 -0
- package/dist/storage/repositories/indicators-repo.js +98 -0
- package/dist/storage/repositories/intraday-klines-repo.d.ts +9 -0
- package/dist/storage/repositories/intraday-klines-repo.js +102 -0
- package/dist/storage/repositories/key-levels-history-repo.d.ts +9 -0
- package/dist/storage/repositories/key-levels-history-repo.js +91 -0
- package/dist/storage/repositories/key-levels-repo.d.ts +9 -0
- package/dist/storage/repositories/key-levels-repo.js +83 -0
- package/dist/storage/repositories/klines-repo.d.ts +8 -0
- package/dist/storage/repositories/klines-repo.js +60 -0
- package/dist/storage/repositories/news-analysis-repo.d.ts +9 -0
- package/dist/storage/repositories/news-analysis-repo.js +107 -0
- package/dist/storage/repositories/technical-analysis-repo.d.ts +9 -0
- package/dist/storage/repositories/technical-analysis-repo.js +80 -0
- package/dist/storage/repositories/watchlist-repo.d.ts +10 -0
- package/dist/storage/repositories/watchlist-repo.js +124 -0
- package/dist/storage/schemas.d.ts +13 -0
- package/dist/storage/schemas.js +177 -0
- package/dist/tools/add-stock.tool.d.ts +13 -0
- package/dist/tools/add-stock.tool.js +123 -0
- package/dist/tools/analyze.tool.d.ts +8 -0
- package/dist/tools/analyze.tool.js +24 -0
- package/dist/tools/backtest-key-levels.tool.d.ts +8 -0
- package/dist/tools/backtest-key-levels.tool.js +43 -0
- package/dist/tools/daily-update-status.tool.d.ts +6 -0
- package/dist/tools/daily-update-status.tool.js +9 -0
- package/dist/tools/fetch-financials.tool.d.ts +8 -0
- package/dist/tools/fetch-financials.tool.js +224 -0
- package/dist/tools/fetch-intraday-klines.tool.d.ts +11 -0
- package/dist/tools/fetch-intraday-klines.tool.js +58 -0
- package/dist/tools/fetch-klines.tool.d.ts +11 -0
- package/dist/tools/fetch-klines.tool.js +61 -0
- package/dist/tools/list-watchlist.tool.d.ts +6 -0
- package/dist/tools/list-watchlist.tool.js +22 -0
- package/dist/tools/monitor-status.tool.d.ts +6 -0
- package/dist/tools/monitor-status.tool.js +9 -0
- package/dist/tools/mx-search.tool.d.ts +8 -0
- package/dist/tools/mx-search.tool.js +77 -0
- package/dist/tools/mx-select-stock.tool.d.ts +8 -0
- package/dist/tools/mx-select-stock.tool.js +118 -0
- package/dist/tools/query-database.tool.d.ts +8 -0
- package/dist/tools/query-database.tool.js +283 -0
- package/dist/tools/refresh-watchlist-names.tool.d.ts +7 -0
- package/dist/tools/refresh-watchlist-names.tool.js +17 -0
- package/dist/tools/refresh-watchlist-profiles.tool.d.ts +9 -0
- package/dist/tools/refresh-watchlist-profiles.tool.js +67 -0
- package/dist/tools/remove-stock.tool.d.ts +9 -0
- package/dist/tools/remove-stock.tool.js +27 -0
- package/dist/tools/start-daily-update.tool.d.ts +10 -0
- package/dist/tools/start-daily-update.tool.js +23 -0
- package/dist/tools/start-monitor.tool.d.ts +9 -0
- package/dist/tools/start-monitor.tool.js +52 -0
- package/dist/tools/stop-daily-update.tool.d.ts +9 -0
- package/dist/tools/stop-daily-update.tool.js +20 -0
- package/dist/tools/stop-monitor.tool.d.ts +9 -0
- package/dist/tools/stop-monitor.tool.js +44 -0
- package/dist/tools/test-alert.tool.d.ts +7 -0
- package/dist/tools/test-alert.tool.js +21 -0
- package/dist/tools/update-all.tool.d.ts +9 -0
- package/dist/tools/update-all.tool.js +17 -0
- package/dist/tools/view-analysis.tool.d.ts +8 -0
- package/dist/tools/view-analysis.tool.js +95 -0
- package/dist/types/daily-update.d.ts +26 -0
- package/dist/types/daily-update.js +1 -0
- package/dist/types/domain.d.ts +140 -0
- package/dist/types/domain.js +1 -0
- package/dist/types/indicator.d.ts +43 -0
- package/dist/types/indicator.js +1 -0
- package/dist/types/monitor.d.ts +17 -0
- package/dist/types/monitor.js +1 -0
- package/dist/types/mx-search.d.ts +14 -0
- package/dist/types/mx-search.js +1 -0
- package/dist/types/mx-select-stock.d.ts +28 -0
- package/dist/types/mx-select-stock.js +1 -0
- package/dist/types/tickflow.d.ts +133 -0
- package/dist/types/tickflow.js +1 -0
- package/dist/utils/abortable-sleep.d.ts +1 -0
- package/dist/utils/abortable-sleep.js +20 -0
- package/dist/utils/china-time.d.ts +3 -0
- package/dist/utils/china-time.js +18 -0
- package/dist/utils/cost-price.d.ts +3 -0
- package/dist/utils/cost-price.js +18 -0
- package/dist/utils/format.d.ts +1 -0
- package/dist/utils/format.js +3 -0
- package/dist/utils/process.d.ts +5 -0
- package/dist/utils/process.js +1 -0
- package/dist/utils/symbol.d.ts +1 -0
- package/dist/utils/symbol.js +13 -0
- package/docs/installation.md +391 -0
- package/docs/usage.md +244 -0
- package/openclaw.plugin.json +116 -0
- package/package.json +57 -0
- package/python/indicator_runner.py +31 -0
- package/python/indicators.py +148 -0
- package/python/pyproject.toml +9 -0
- package/python/requirements.txt +3 -0
- package/python/uv.lock +366 -0
- package/skills/database-query/SKILL.md +58 -0
- package/skills/stock-analysis/SKILL.md +106 -0
- package/skills/usage-help/SKILL.md +102 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { NEWS_ANALYSIS_SYSTEM_PROMPT, buildNewsAnalysisUserPrompt, } from "../../prompts/analysis/index.js";
|
|
2
|
+
import { parseJsonBlock } from "../parsers/json-block.parser.js";
|
|
3
|
+
export class NewsCatalystTask {
|
|
4
|
+
taskName = "news_catalyst";
|
|
5
|
+
prepare(input) {
|
|
6
|
+
if (input.documents.length === 0) {
|
|
7
|
+
throw new Error(`没有找到 ${input.symbol} 的资讯数据`);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
systemPrompt: NEWS_ANALYSIS_SYSTEM_PROMPT,
|
|
11
|
+
userPrompt: buildNewsAnalysisUserPrompt({
|
|
12
|
+
symbol: input.symbol,
|
|
13
|
+
companyName: input.companyName,
|
|
14
|
+
query: input.query,
|
|
15
|
+
documents: input.documents,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
parseResult(analysisText) {
|
|
20
|
+
const parsed = parseJsonBlock(analysisText);
|
|
21
|
+
return {
|
|
22
|
+
analysisText: analysisText.trim(),
|
|
23
|
+
score: normalizeScore(parsed?.score),
|
|
24
|
+
bias: normalizeBias(parsed?.bias),
|
|
25
|
+
catalysts: normalizeStringList(parsed?.catalysts),
|
|
26
|
+
risks: normalizeStringList(parsed?.risks),
|
|
27
|
+
watchItems: normalizeStringList(parsed?.watch_items),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function buildNewsFallbackResult() {
|
|
32
|
+
return {
|
|
33
|
+
analysisText: "未获取到有效资讯数据,本轮未执行资讯面子分析。",
|
|
34
|
+
score: null,
|
|
35
|
+
bias: "neutral",
|
|
36
|
+
catalysts: [],
|
|
37
|
+
risks: [],
|
|
38
|
+
watchItems: [],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function normalizeScore(value) {
|
|
42
|
+
if (!Number.isFinite(Number(value))) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const score = Math.trunc(Number(value));
|
|
46
|
+
return score >= 1 && score <= 10 ? score : null;
|
|
47
|
+
}
|
|
48
|
+
function normalizeBias(value) {
|
|
49
|
+
if (value === "positive" || value === "negative") {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return "neutral";
|
|
53
|
+
}
|
|
54
|
+
function normalizeStringList(value) {
|
|
55
|
+
if (!Array.isArray(value)) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
return value
|
|
59
|
+
.map((item) => String(item ?? "").trim())
|
|
60
|
+
.filter(Boolean)
|
|
61
|
+
.slice(0, 3);
|
|
62
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnalysisTask } from "./analysis-task.js";
|
|
2
|
+
import type { PostCloseReviewInput, PostCloseReviewResult } from "../types/composite-analysis.js";
|
|
3
|
+
export declare class PostCloseReviewTask implements AnalysisTask<PostCloseReviewInput, PostCloseReviewResult> {
|
|
4
|
+
readonly taskName = "post_close_review";
|
|
5
|
+
prepare(input: PostCloseReviewInput): {
|
|
6
|
+
systemPrompt: string;
|
|
7
|
+
userPrompt: string;
|
|
8
|
+
};
|
|
9
|
+
parseResult(analysisText: string, input: PostCloseReviewInput): PostCloseReviewResult;
|
|
10
|
+
persistResult(): Promise<void>;
|
|
11
|
+
formatForUser(result: PostCloseReviewResult): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { formatChinaDateTime } from "../../utils/china-time.js";
|
|
2
|
+
import { POST_CLOSE_REVIEW_SYSTEM_PROMPT, buildPostCloseReviewUserPrompt, } from "../../prompts/analysis/index.js";
|
|
3
|
+
import { validateKeyLevels } from "../parsers/key-levels.parser.js";
|
|
4
|
+
import { parsePostCloseReviewPayload } from "../parsers/post-close-review.parser.js";
|
|
5
|
+
export class PostCloseReviewTask {
|
|
6
|
+
taskName = "post_close_review";
|
|
7
|
+
prepare(input) {
|
|
8
|
+
return {
|
|
9
|
+
systemPrompt: POST_CLOSE_REVIEW_SYSTEM_PROMPT,
|
|
10
|
+
userPrompt: buildPostCloseReviewUserPrompt(input),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
parseResult(analysisText, input) {
|
|
14
|
+
const payload = parsePostCloseReviewPayload(analysisText);
|
|
15
|
+
const fallbackLevels = input.compositeResult.levels ?? input.technicalResult.levels ?? null;
|
|
16
|
+
const levels = payload.levels ?? (payload.decision === "invalidate" ? null : fallbackLevels);
|
|
17
|
+
if (levels) {
|
|
18
|
+
levels.symbol = input.market.symbol;
|
|
19
|
+
levels.analysis_date = formatChinaDateTime().slice(0, 10);
|
|
20
|
+
levels.analysis_text = analysisText;
|
|
21
|
+
validateKeyLevels(levels);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
analysisText: analysisText.trim(),
|
|
25
|
+
...payload,
|
|
26
|
+
levels,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
async persistResult() {
|
|
30
|
+
// Persisting key levels and snapshots is handled by PostCloseReviewService.
|
|
31
|
+
}
|
|
32
|
+
formatForUser(result) {
|
|
33
|
+
return result.analysisText;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { WatchlistItem, KeyLevels, KeyLevelsHistoryEntry } from "../../types/domain.js";
|
|
2
|
+
import type { IndicatorRow } from "../../types/indicator.js";
|
|
3
|
+
import type { FinancialSnapshot } from "../../services/financial-service.js";
|
|
4
|
+
import type { MxSearchDocument } from "../../types/mx-search.js";
|
|
5
|
+
import type { TickFlowIntradayKlineRow, TickFlowKlineRow, TickFlowQuote } from "../../types/tickflow.js";
|
|
6
|
+
import type { FinancialLiteSnapshot } from "../../services/financial-lite-service.js";
|
|
7
|
+
export type FinancialAnalysisMode = "full" | "lite" | "none";
|
|
8
|
+
export type MarketBias = "tailwind" | "neutral" | "headwind";
|
|
9
|
+
export type NewsImpact = "supportive" | "neutral" | "disruptive";
|
|
10
|
+
export type ReviewDecision = "keep" | "adjust" | "recompute" | "invalidate";
|
|
11
|
+
export type ValidationVerdict = "validated" | "mixed" | "invalidated" | "unavailable";
|
|
12
|
+
export interface ReviewMemoryContext {
|
|
13
|
+
available: boolean;
|
|
14
|
+
summary: string;
|
|
15
|
+
asOf: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface MarketIndexSnapshot {
|
|
18
|
+
symbol: string;
|
|
19
|
+
name: string;
|
|
20
|
+
latestClose: number | null;
|
|
21
|
+
prevClose: number | null;
|
|
22
|
+
changePct: number | null;
|
|
23
|
+
intradayClose: number | null;
|
|
24
|
+
aboveMa5: boolean | null;
|
|
25
|
+
aboveMa10: boolean | null;
|
|
26
|
+
summary: string;
|
|
27
|
+
}
|
|
28
|
+
export interface MarketOverviewContext {
|
|
29
|
+
available: boolean;
|
|
30
|
+
bias: MarketBias;
|
|
31
|
+
summary: string;
|
|
32
|
+
indices: MarketIndexSnapshot[];
|
|
33
|
+
}
|
|
34
|
+
export interface MarketAnalysisContext {
|
|
35
|
+
symbol: string;
|
|
36
|
+
companyName: string;
|
|
37
|
+
watchlistItem: WatchlistItem | null;
|
|
38
|
+
klines: TickFlowKlineRow[];
|
|
39
|
+
indicators: IndicatorRow[];
|
|
40
|
+
intradayKlines: TickFlowIntradayKlineRow[];
|
|
41
|
+
intradayIndicators: IndicatorRow[];
|
|
42
|
+
realtimeQuote: TickFlowQuote | null;
|
|
43
|
+
reviewMemory: ReviewMemoryContext;
|
|
44
|
+
marketOverview: MarketOverviewContext;
|
|
45
|
+
}
|
|
46
|
+
export interface FinancialAnalysisContext {
|
|
47
|
+
symbol: string;
|
|
48
|
+
companyName: string;
|
|
49
|
+
mode: FinancialAnalysisMode;
|
|
50
|
+
source: "tickflow" | "mx_select_stock" | "none";
|
|
51
|
+
snapshot: FinancialSnapshot | null;
|
|
52
|
+
liteSnapshot: FinancialLiteSnapshot | null;
|
|
53
|
+
available: boolean;
|
|
54
|
+
note: string | null;
|
|
55
|
+
}
|
|
56
|
+
export interface NewsAnalysisContext {
|
|
57
|
+
symbol: string;
|
|
58
|
+
companyName: string;
|
|
59
|
+
query: string;
|
|
60
|
+
documents: MxSearchDocument[];
|
|
61
|
+
available: boolean;
|
|
62
|
+
boardQuery: string | null;
|
|
63
|
+
boardDocuments: MxSearchDocument[];
|
|
64
|
+
boardAvailable: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface TechnicalSignalResult {
|
|
67
|
+
analysisText: string;
|
|
68
|
+
levels: KeyLevels | null;
|
|
69
|
+
}
|
|
70
|
+
export interface FinancialInsightResult {
|
|
71
|
+
analysisText: string;
|
|
72
|
+
score: number | null;
|
|
73
|
+
bias: "positive" | "neutral" | "negative";
|
|
74
|
+
strengths: string[];
|
|
75
|
+
risks: string[];
|
|
76
|
+
watchItems: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface NewsInsightResult {
|
|
79
|
+
analysisText: string;
|
|
80
|
+
score: number | null;
|
|
81
|
+
bias: "positive" | "neutral" | "negative";
|
|
82
|
+
catalysts: string[];
|
|
83
|
+
risks: string[];
|
|
84
|
+
watchItems: string[];
|
|
85
|
+
}
|
|
86
|
+
export interface CompositeAnalysisInput {
|
|
87
|
+
market: MarketAnalysisContext;
|
|
88
|
+
financial: FinancialAnalysisContext;
|
|
89
|
+
news: NewsAnalysisContext;
|
|
90
|
+
technicalResult: TechnicalSignalResult;
|
|
91
|
+
financialResult: FinancialInsightResult;
|
|
92
|
+
newsResult: NewsInsightResult;
|
|
93
|
+
}
|
|
94
|
+
export interface CompositeAnalysisResult {
|
|
95
|
+
analysisText: string;
|
|
96
|
+
levels: KeyLevels | null;
|
|
97
|
+
}
|
|
98
|
+
export interface PriorKeyLevelValidationContext {
|
|
99
|
+
available: boolean;
|
|
100
|
+
snapshotDate: string | null;
|
|
101
|
+
evaluatedTradeDate: string | null;
|
|
102
|
+
verdict: ValidationVerdict;
|
|
103
|
+
snapshot: KeyLevelsHistoryEntry | null;
|
|
104
|
+
summary: string;
|
|
105
|
+
lines: string[];
|
|
106
|
+
}
|
|
107
|
+
export interface PostCloseReviewInput extends CompositeAnalysisInput {
|
|
108
|
+
compositeResult: CompositeAnalysisResult;
|
|
109
|
+
validation: PriorKeyLevelValidationContext;
|
|
110
|
+
}
|
|
111
|
+
export interface PostCloseReviewResult {
|
|
112
|
+
analysisText: string;
|
|
113
|
+
decision: ReviewDecision;
|
|
114
|
+
decisionReason: string;
|
|
115
|
+
sessionSummary: string;
|
|
116
|
+
marketSectorSummary: string;
|
|
117
|
+
newsSummary: string;
|
|
118
|
+
actionAdvice: string;
|
|
119
|
+
marketBias: MarketBias;
|
|
120
|
+
sectorBias: MarketBias;
|
|
121
|
+
newsImpact: NewsImpact;
|
|
122
|
+
levels: KeyLevels | null;
|
|
123
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PluginConfig } from "../config/schema.js";
|
|
2
|
+
import { UpdateService } from "../services/update-service.js";
|
|
3
|
+
import { AlertService } from "../services/alert-service.js";
|
|
4
|
+
import { PostCloseReviewService } from "../services/post-close-review-service.js";
|
|
5
|
+
import { TradingCalendarService } from "../services/trading-calendar-service.js";
|
|
6
|
+
import type { DailyUpdateState } from "../types/daily-update.js";
|
|
7
|
+
export declare class DailyUpdateWorker {
|
|
8
|
+
private readonly updateService;
|
|
9
|
+
private readonly postCloseReviewService;
|
|
10
|
+
private readonly tradingCalendarService;
|
|
11
|
+
private readonly baseDir;
|
|
12
|
+
private readonly alertService;
|
|
13
|
+
private readonly notifyEnabled;
|
|
14
|
+
private readonly configSource;
|
|
15
|
+
private readonly intervalMs;
|
|
16
|
+
constructor(updateService: UpdateService, postCloseReviewService: PostCloseReviewService | null, tradingCalendarService: TradingCalendarService, baseDir: string, alertService: AlertService, notifyEnabled: boolean, configSource: "openclaw_plugin" | "local_config", intervalMs?: number);
|
|
17
|
+
run(force?: boolean): Promise<string>;
|
|
18
|
+
runLoop(signal?: AbortSignal, runtimeHost?: "project_scheduler" | "plugin_service", runtimeConfigSource?: "openclaw_plugin" | "local_config"): Promise<void>;
|
|
19
|
+
ensureLoopRunning(config: PluginConfig, configSource: "openclaw_plugin" | "local_config"): Promise<{
|
|
20
|
+
started: boolean;
|
|
21
|
+
pid: number | null;
|
|
22
|
+
}>;
|
|
23
|
+
stopLoop(): Promise<{
|
|
24
|
+
stopped: boolean;
|
|
25
|
+
pid: number | null;
|
|
26
|
+
}>;
|
|
27
|
+
enableManagedLoop(configSource: "openclaw_plugin" | "local_config"): Promise<{
|
|
28
|
+
started: boolean;
|
|
29
|
+
pid: number | null;
|
|
30
|
+
}>;
|
|
31
|
+
bindManagedServiceRuntime(configSource: "openclaw_plugin" | "local_config"): Promise<void>;
|
|
32
|
+
markSchedulerRunning(workerPid: number | null, runtimeConfigSource: "openclaw_plugin" | "local_config"): Promise<void>;
|
|
33
|
+
markSchedulerStopped(): Promise<void>;
|
|
34
|
+
setExpectedStop(expectedStop: boolean): Promise<void>;
|
|
35
|
+
getState(): Promise<DailyUpdateState>;
|
|
36
|
+
getStatusReport(): Promise<string>;
|
|
37
|
+
private runScheduledPasses;
|
|
38
|
+
private runScheduledUpdatePass;
|
|
39
|
+
private runScheduledReviewPass;
|
|
40
|
+
private getScheduledReviewReadiness;
|
|
41
|
+
private recordReviewSkip;
|
|
42
|
+
private executeDailyUpdateAndRecord;
|
|
43
|
+
private executeReviewAndRecord;
|
|
44
|
+
private getStateFilePath;
|
|
45
|
+
private recordHeartbeat;
|
|
46
|
+
private readState;
|
|
47
|
+
private writeState;
|
|
48
|
+
private maybeSendDailyUpdateNotification;
|
|
49
|
+
private maybeSendReviewNotification;
|
|
50
|
+
}
|