tickflow-assist 0.3.4 → 0.3.5
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 +29 -5
- package/dist/config/env.d.ts +17 -0
- package/dist/config/env.js +30 -0
- package/dist/config/normalize.js +25 -12
- package/dist/dev/tickflow-assist-cli.js +83 -17
- package/dist/services/analysis-service.js +4 -3
- package/dist/services/jin10-mcp-service.js +3 -2
- package/dist/services/mx-search-service.js +3 -2
- package/openclaw.plugin.json +51 -23
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,9 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
基于 [OpenClaw](https://openclaw.ai) 的 A 股监控与分析插件。它使用 [TickFlow](https://tickflow.org/auth/register?ref=BUJ54JEDGE) 获取行情与财务数据,并可选接入 [金十数据 MCP](https://mcp.jin10.com/app/) 快讯流,结合 LLM 生成技术面、基本面、资讯面的综合判断,并把结果持久化到本地 LanceDB。
|
|
4
4
|
|
|
5
|
-
最近更新:`v0.3.4`
|
|
5
|
+
最近更新:`v0.3.5` 对齐 OpenClaw `2026.4.11` metadata 与社区安装提示,修复源码升级时本地链接扫描 `node_modules` 失败的问题,并支持通过环境变量回退 TickFlow / LLM / MX / Jin10 配置。完整发布记录见 <https://github.com/robinspt/tickflow-assist/blob/main/CHANGELOG.md>。
|
|
6
6
|
|
|
7
|
-
当前主线按 OpenClaw `v2026.3.31+` 对齐,并已验证社区安装在 `v2026.4.
|
|
7
|
+
当前主线按 OpenClaw `v2026.3.31+` 对齐,并已验证社区安装在 `v2026.4.11` 上兼容。
|
|
8
|
+
|
|
9
|
+
## 安装前准备
|
|
10
|
+
|
|
11
|
+
在执行社区安装前,建议先确认你已经准备好以下配置:
|
|
12
|
+
|
|
13
|
+
- 核心必需:`tickflowApiKey`、`llmApiKey`、`llmBaseUrl`、`llmModel`
|
|
14
|
+
- 告警投递:`alertChannel`、`alertTarget`、`alertAccount`
|
|
15
|
+
- 可选增强:`mxSearchApiKey`、`jin10ApiToken`
|
|
16
|
+
|
|
17
|
+
其中,`configure-openclaw` 会把上述配置写入 `~/.openclaw/openclaw.json` 的 `plugins.entries["tickflow-assist"].config`,插件启用后会在本地 `databasePath` 下持久化 LanceDB 数据,并运行监控 / 日更等后台服务。
|
|
18
|
+
如果你不想把密钥写进配置文件,运行时也支持环境变量回退,优先级是 `openclaw.json / local.config.json` > 环境变量 > 默认值。
|
|
19
|
+
常用环境变量:`TICKFLOW_ASSIST_TICKFLOW_API_KEY` / `TICKFLOW_API_KEY`、`TICKFLOW_ASSIST_LLM_API_KEY` / `LLM_API_KEY`、`TICKFLOW_ASSIST_LLM_BASE_URL` / `LLM_BASE_URL`、`TICKFLOW_ASSIST_LLM_MODEL` / `LLM_MODEL`、`TICKFLOW_ASSIST_MX_SEARCH_API_KEY` / `MX_SEARCH_API_KEY` / `MX_APIKEY`、`TICKFLOW_ASSIST_JIN10_API_TOKEN` / `JIN10_API_TOKEN`。
|
|
8
20
|
|
|
9
21
|
## 安装
|
|
10
22
|
|
|
@@ -19,8 +31,8 @@ openclaw config validate
|
|
|
19
31
|
openclaw gateway restart
|
|
20
32
|
```
|
|
21
33
|
|
|
22
|
-
安装阶段允许先落插件,再通过第二条命令写入 `tickflowApiKey`、`llmApiKey` 等正式配置。
|
|
23
|
-
`configure-openclaw` 会写入 `~/.openclaw/openclaw.json` 中的 `plugins.entries["tickflow-assist"].config`,并打印后续建议执行的命令;它不再自动执行 `openclaw`、`uv`
|
|
34
|
+
安装阶段允许先落插件,再通过第二条命令写入 `tickflowApiKey`、`llmApiKey`、`llmBaseUrl`、`llmModel` 等正式配置。
|
|
35
|
+
`configure-openclaw` 会写入 `~/.openclaw/openclaw.json` 中的 `plugins.entries["tickflow-assist"].config`,并打印后续建议执行的命令;它不再自动执行 `openclaw`、`uv` 或系统包安装命令,也不会重新执行插件安装;如果你已经设置了环境变量,密钥项可留空,输入 `-` 可主动清空已有配置并切回环境变量。
|
|
24
36
|
如果检测到 `plugins.installs["tickflow-assist"]` 来自 `clawhub`,向导还会把被旧版本钉死的 `spec` 归一化为 `clawhub:tickflow-assist`,避免后续升级继续锁在旧版本。
|
|
25
37
|
|
|
26
38
|
如果你希望先审阅配置,再只打印最少的后续步骤,可使用:
|
|
@@ -84,6 +96,18 @@ plugins.entries["tickflow-assist"].config
|
|
|
84
96
|
- 能力补充:`mxSearchApiKey`、`jin10ApiToken`
|
|
85
97
|
|
|
86
98
|
其中,`mxSearchApiKey` 用于 `mx_search`、`mx_select_stock` 以及非 `Expert` 财务链路的 lite 补充;`jin10ApiToken` 用于 24 小时金十数据快讯监控;`jin10FlashNightAlert` 默认 `false`(开启夜间静默),设为 `true` 可恢复 24 小时快讯告警;`alertTarget`、`alertAccount` 建议在准备启用 `test_alert`、实时监控告警、金十数据快讯告警和定时通知前一并配好,避免配置不完整导致功能缺失。
|
|
99
|
+
如果你使用环境变量,运行时支持以下回退:
|
|
100
|
+
|
|
101
|
+
- `tickflowApiUrl`:`TICKFLOW_ASSIST_TICKFLOW_API_URL` / `TICKFLOW_API_URL`
|
|
102
|
+
- `tickflowApiKey`:`TICKFLOW_ASSIST_TICKFLOW_API_KEY` / `TICKFLOW_API_KEY`
|
|
103
|
+
- `tickflowApiKeyLevel`:`TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL` / `TICKFLOW_API_KEY_LEVEL`
|
|
104
|
+
- `llmBaseUrl`:`TICKFLOW_ASSIST_LLM_BASE_URL` / `LLM_BASE_URL`
|
|
105
|
+
- `llmApiKey`:`TICKFLOW_ASSIST_LLM_API_KEY` / `LLM_API_KEY`
|
|
106
|
+
- `llmModel`:`TICKFLOW_ASSIST_LLM_MODEL` / `LLM_MODEL`
|
|
107
|
+
- `mxSearchApiUrl`:`TICKFLOW_ASSIST_MX_SEARCH_API_URL` / `MX_SEARCH_API_URL`
|
|
108
|
+
- `mxSearchApiKey`:`TICKFLOW_ASSIST_MX_SEARCH_API_KEY` / `MX_SEARCH_API_KEY` / `MX_APIKEY`
|
|
109
|
+
- `jin10McpUrl`:`TICKFLOW_ASSIST_JIN10_MCP_URL` / `JIN10_MCP_URL`
|
|
110
|
+
- `jin10ApiToken`:`TICKFLOW_ASSIST_JIN10_API_TOKEN` / `JIN10_API_TOKEN`
|
|
87
111
|
|
|
88
112
|
## 功能
|
|
89
113
|
|
|
@@ -107,4 +131,4 @@ plugins.entries["tickflow-assist"].config
|
|
|
107
131
|
|
|
108
132
|
## 仓库
|
|
109
133
|
|
|
110
|
-
- GitHub:
|
|
134
|
+
- GitHub: [robinspt/tickflow-assist](https://github.com/robinspt/tickflow-assist)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CONFIG_ENV_FALLBACKS: {
|
|
2
|
+
readonly tickflowApiUrl: readonly ["TICKFLOW_ASSIST_TICKFLOW_API_URL", "TICKFLOW_API_URL"];
|
|
3
|
+
readonly tickflowApiKey: readonly ["TICKFLOW_ASSIST_TICKFLOW_API_KEY", "TICKFLOW_API_KEY"];
|
|
4
|
+
readonly tickflowApiKeyLevel: readonly ["TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL", "TICKFLOW_API_KEY_LEVEL"];
|
|
5
|
+
readonly mxSearchApiUrl: readonly ["TICKFLOW_ASSIST_MX_SEARCH_API_URL", "MX_SEARCH_API_URL"];
|
|
6
|
+
readonly mxSearchApiKey: readonly ["TICKFLOW_ASSIST_MX_SEARCH_API_KEY", "MX_SEARCH_API_KEY", "MX_APIKEY"];
|
|
7
|
+
readonly jin10McpUrl: readonly ["TICKFLOW_ASSIST_JIN10_MCP_URL", "JIN10_MCP_URL"];
|
|
8
|
+
readonly jin10ApiToken: readonly ["TICKFLOW_ASSIST_JIN10_API_TOKEN", "JIN10_API_TOKEN"];
|
|
9
|
+
readonly llmBaseUrl: readonly ["TICKFLOW_ASSIST_LLM_BASE_URL", "LLM_BASE_URL"];
|
|
10
|
+
readonly llmApiKey: readonly ["TICKFLOW_ASSIST_LLM_API_KEY", "LLM_API_KEY"];
|
|
11
|
+
readonly llmModel: readonly ["TICKFLOW_ASSIST_LLM_MODEL", "LLM_MODEL"];
|
|
12
|
+
};
|
|
13
|
+
export type EnvBackedConfigKey = keyof typeof CONFIG_ENV_FALLBACKS;
|
|
14
|
+
export declare function getEnvFallbackValue(names: readonly string[], env?: NodeJS.ProcessEnv): string;
|
|
15
|
+
export declare function getConfigEnvFallback(key: EnvBackedConfigKey, env?: NodeJS.ProcessEnv): string;
|
|
16
|
+
export declare function hasConfigEnvFallback(key: EnvBackedConfigKey, env?: NodeJS.ProcessEnv): boolean;
|
|
17
|
+
export declare function formatConfigEnvFallback(key: EnvBackedConfigKey): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const CONFIG_ENV_FALLBACKS = {
|
|
2
|
+
tickflowApiUrl: ["TICKFLOW_ASSIST_TICKFLOW_API_URL", "TICKFLOW_API_URL"],
|
|
3
|
+
tickflowApiKey: ["TICKFLOW_ASSIST_TICKFLOW_API_KEY", "TICKFLOW_API_KEY"],
|
|
4
|
+
tickflowApiKeyLevel: ["TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL", "TICKFLOW_API_KEY_LEVEL"],
|
|
5
|
+
mxSearchApiUrl: ["TICKFLOW_ASSIST_MX_SEARCH_API_URL", "MX_SEARCH_API_URL"],
|
|
6
|
+
mxSearchApiKey: ["TICKFLOW_ASSIST_MX_SEARCH_API_KEY", "MX_SEARCH_API_KEY", "MX_APIKEY"],
|
|
7
|
+
jin10McpUrl: ["TICKFLOW_ASSIST_JIN10_MCP_URL", "JIN10_MCP_URL"],
|
|
8
|
+
jin10ApiToken: ["TICKFLOW_ASSIST_JIN10_API_TOKEN", "JIN10_API_TOKEN"],
|
|
9
|
+
llmBaseUrl: ["TICKFLOW_ASSIST_LLM_BASE_URL", "LLM_BASE_URL"],
|
|
10
|
+
llmApiKey: ["TICKFLOW_ASSIST_LLM_API_KEY", "LLM_API_KEY"],
|
|
11
|
+
llmModel: ["TICKFLOW_ASSIST_LLM_MODEL", "LLM_MODEL"],
|
|
12
|
+
};
|
|
13
|
+
export function getEnvFallbackValue(names, env = process.env) {
|
|
14
|
+
for (const name of names) {
|
|
15
|
+
const value = env[name];
|
|
16
|
+
if (typeof value === "string" && value.trim()) {
|
|
17
|
+
return value.trim();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
export function getConfigEnvFallback(key, env = process.env) {
|
|
23
|
+
return getEnvFallbackValue(CONFIG_ENV_FALLBACKS[key], env);
|
|
24
|
+
}
|
|
25
|
+
export function hasConfigEnvFallback(key, env = process.env) {
|
|
26
|
+
return Boolean(getConfigEnvFallback(key, env));
|
|
27
|
+
}
|
|
28
|
+
export function formatConfigEnvFallback(key) {
|
|
29
|
+
return CONFIG_ENV_FALLBACKS[key].join(" / ");
|
|
30
|
+
}
|
package/dist/config/normalize.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { getConfigEnvFallback } from "./env.js";
|
|
2
3
|
import { normalizeTickflowApiKeyLevel } from "./tickflow-access.js";
|
|
3
4
|
import { DEFAULT_PLUGIN_CONFIG } from "./schema.js";
|
|
4
5
|
function normalizeString(value, fallback = "") {
|
|
@@ -10,6 +11,10 @@ function normalizeString(value, fallback = "") {
|
|
|
10
11
|
}
|
|
11
12
|
return String(value).trim();
|
|
12
13
|
}
|
|
14
|
+
function normalizeStringWithFallback(value, fallback = "") {
|
|
15
|
+
const normalized = normalizeString(value);
|
|
16
|
+
return normalized || fallback;
|
|
17
|
+
}
|
|
13
18
|
function normalizeInteger(value, fallback) {
|
|
14
19
|
const parsed = Number(value ?? fallback);
|
|
15
20
|
return Number.isFinite(parsed) ? Math.max(1, Math.trunc(parsed)) : fallback;
|
|
@@ -40,22 +45,30 @@ function normalizeBoolean(value, fallback) {
|
|
|
40
45
|
}
|
|
41
46
|
export function normalizePluginConfig(input) {
|
|
42
47
|
const raw = (input ?? {});
|
|
43
|
-
const
|
|
44
|
-
const
|
|
48
|
+
const envTickflowApiUrl = getConfigEnvFallback("tickflowApiUrl");
|
|
49
|
+
const envTickflowApiKey = getConfigEnvFallback("tickflowApiKey");
|
|
50
|
+
const envTickflowApiKeyLevel = getConfigEnvFallback("tickflowApiKeyLevel");
|
|
51
|
+
const envMxSearchApiUrl = getConfigEnvFallback("mxSearchApiUrl");
|
|
52
|
+
const envMxSearchApiKey = getConfigEnvFallback("mxSearchApiKey");
|
|
53
|
+
const envJin10McpUrl = getConfigEnvFallback("jin10McpUrl");
|
|
54
|
+
const envJin10ApiToken = getConfigEnvFallback("jin10ApiToken");
|
|
55
|
+
const envLlmBaseUrl = getConfigEnvFallback("llmBaseUrl");
|
|
56
|
+
const envLlmApiKey = getConfigEnvFallback("llmApiKey");
|
|
57
|
+
const envLlmModel = getConfigEnvFallback("llmModel");
|
|
45
58
|
return {
|
|
46
|
-
tickflowApiUrl:
|
|
47
|
-
tickflowApiKey:
|
|
48
|
-
tickflowApiKeyLevel: normalizeTickflowApiKeyLevel(raw.tickflowApiKeyLevel, DEFAULT_PLUGIN_CONFIG.tickflowApiKeyLevel),
|
|
49
|
-
mxSearchApiUrl:
|
|
50
|
-
mxSearchApiKey:
|
|
51
|
-
jin10McpUrl:
|
|
52
|
-
jin10ApiToken:
|
|
59
|
+
tickflowApiUrl: normalizeStringWithFallback(raw.tickflowApiUrl, envTickflowApiUrl || DEFAULT_PLUGIN_CONFIG.tickflowApiUrl),
|
|
60
|
+
tickflowApiKey: normalizeStringWithFallback(raw.tickflowApiKey, envTickflowApiKey),
|
|
61
|
+
tickflowApiKeyLevel: normalizeTickflowApiKeyLevel(normalizeStringWithFallback(raw.tickflowApiKeyLevel, envTickflowApiKeyLevel), DEFAULT_PLUGIN_CONFIG.tickflowApiKeyLevel),
|
|
62
|
+
mxSearchApiUrl: normalizeStringWithFallback(raw.mxSearchApiUrl, envMxSearchApiUrl || DEFAULT_PLUGIN_CONFIG.mxSearchApiUrl),
|
|
63
|
+
mxSearchApiKey: normalizeStringWithFallback(raw.mxSearchApiKey, envMxSearchApiKey || DEFAULT_PLUGIN_CONFIG.mxSearchApiKey),
|
|
64
|
+
jin10McpUrl: normalizeStringWithFallback(raw.jin10McpUrl, envJin10McpUrl || DEFAULT_PLUGIN_CONFIG.jin10McpUrl),
|
|
65
|
+
jin10ApiToken: normalizeStringWithFallback(raw.jin10ApiToken, envJin10ApiToken),
|
|
53
66
|
jin10FlashPollInterval: normalizeInteger(raw.jin10FlashPollInterval, DEFAULT_PLUGIN_CONFIG.jin10FlashPollInterval),
|
|
54
67
|
jin10FlashRetentionDays: normalizeInteger(raw.jin10FlashRetentionDays, DEFAULT_PLUGIN_CONFIG.jin10FlashRetentionDays),
|
|
55
68
|
jin10FlashNightAlert: normalizeBoolean(raw.jin10FlashNightAlert, DEFAULT_PLUGIN_CONFIG.jin10FlashNightAlert),
|
|
56
|
-
llmBaseUrl:
|
|
57
|
-
llmApiKey:
|
|
58
|
-
llmModel:
|
|
69
|
+
llmBaseUrl: normalizeStringWithFallback(raw.llmBaseUrl, envLlmBaseUrl || DEFAULT_PLUGIN_CONFIG.llmBaseUrl),
|
|
70
|
+
llmApiKey: normalizeStringWithFallback(raw.llmApiKey, envLlmApiKey),
|
|
71
|
+
llmModel: normalizeStringWithFallback(raw.llmModel, envLlmModel || DEFAULT_PLUGIN_CONFIG.llmModel),
|
|
59
72
|
databasePath: normalizeString(raw.databasePath, DEFAULT_PLUGIN_CONFIG.databasePath),
|
|
60
73
|
calendarFile: normalizeString(raw.calendarFile, DEFAULT_PLUGIN_CONFIG.calendarFile),
|
|
61
74
|
requestInterval: normalizeInteger(raw.requestInterval, DEFAULT_PLUGIN_CONFIG.requestInterval),
|
|
@@ -6,6 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { createInterface } from "node:readline/promises";
|
|
8
8
|
import JSON5 from "json5";
|
|
9
|
+
import { formatConfigEnvFallback, hasConfigEnvFallback, } from "../config/env.js";
|
|
9
10
|
const PLUGIN_ID = "tickflow-assist";
|
|
10
11
|
const DEFAULT_CONFIG_PATH = path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
11
12
|
const DEFAULTS = {
|
|
@@ -59,6 +60,14 @@ Options:
|
|
|
59
60
|
--alert-account <name>
|
|
60
61
|
--alert-target <target>
|
|
61
62
|
-h, --help Show this help
|
|
63
|
+
|
|
64
|
+
Environment fallback:
|
|
65
|
+
tickflowApiKey ${formatConfigEnvFallback("tickflowApiKey")}
|
|
66
|
+
llmApiKey ${formatConfigEnvFallback("llmApiKey")}
|
|
67
|
+
llmBaseUrl ${formatConfigEnvFallback("llmBaseUrl")}
|
|
68
|
+
llmModel ${formatConfigEnvFallback("llmModel")}
|
|
69
|
+
mxSearchApiKey ${formatConfigEnvFallback("mxSearchApiKey")}
|
|
70
|
+
jin10ApiToken ${formatConfigEnvFallback("jin10ApiToken")}
|
|
62
71
|
`);
|
|
63
72
|
}
|
|
64
73
|
function parseArgs(argv) {
|
|
@@ -390,7 +399,7 @@ async function promptAlertChannel(rl, configPath, defaultChannel) {
|
|
|
390
399
|
choices.push({ value: "__manual__", label: "手动输入其他通道" });
|
|
391
400
|
selectedChannel = await promptSelect(rl, "检测到 openclaw.json 中已有配置,请选择推送通道", choices, defaultChannel);
|
|
392
401
|
if (selectedChannel === "__manual__") {
|
|
393
|
-
selectedChannel = await promptString(rl, "Alert Channel", defaultChannel, true);
|
|
402
|
+
selectedChannel = await promptString(rl, "Alert Channel", defaultChannel, { required: true });
|
|
394
403
|
}
|
|
395
404
|
}
|
|
396
405
|
else {
|
|
@@ -467,15 +476,29 @@ async function promptForConfig(options, existing, pluginDir, configPath) {
|
|
|
467
476
|
console.log(`OpenClaw 配置文件: ${configPath}`);
|
|
468
477
|
console.log(`插件目录: ${pluginDir}`);
|
|
469
478
|
console.log("");
|
|
470
|
-
|
|
479
|
+
console.log("为避免后续运行时反复补配置,下面这些字段建议一次性填完整。");
|
|
480
|
+
console.log("");
|
|
481
|
+
seed.tickflowApiKey = await promptString(rl, buildEnvAwarePromptLabel("TickFlow API Key", "tickflowApiKey", seed.tickflowApiKey), seed.tickflowApiKey, {
|
|
482
|
+
required: !hasConfigEnvFallback("tickflowApiKey"),
|
|
483
|
+
maskDefault: true,
|
|
484
|
+
allowClear: true,
|
|
485
|
+
});
|
|
471
486
|
seed.tickflowApiKeyLevel = normalizeApiKeyLevel(await promptSelect(rl, "TickFlow 订阅等级", [
|
|
472
487
|
{ value: "Free", label: "Free" },
|
|
473
488
|
{ value: "Start", label: "Start" },
|
|
474
489
|
{ value: "Pro", label: "Pro" },
|
|
475
490
|
{ value: "Expert", label: "Expert" },
|
|
476
491
|
], seed.tickflowApiKeyLevel));
|
|
477
|
-
seed.mxSearchApiKey = await promptString(rl, "MX Search API Key
|
|
478
|
-
|
|
492
|
+
seed.mxSearchApiKey = await promptString(rl, buildEnvAwarePromptLabel("MX Search API Key(建议填写)", "mxSearchApiKey", seed.mxSearchApiKey), seed.mxSearchApiKey, {
|
|
493
|
+
required: false,
|
|
494
|
+
maskDefault: true,
|
|
495
|
+
allowClear: true,
|
|
496
|
+
});
|
|
497
|
+
seed.jin10ApiToken = await promptString(rl, buildEnvAwarePromptLabel("Jin10 API Token(建议填写)", "jin10ApiToken", seed.jin10ApiToken), seed.jin10ApiToken, {
|
|
498
|
+
required: false,
|
|
499
|
+
maskDefault: true,
|
|
500
|
+
allowClear: true,
|
|
501
|
+
});
|
|
479
502
|
seed.jin10FlashPollInterval = await promptInteger(rl, "Jin10 快讯轮询间隔(秒)", seed.jin10FlashPollInterval, 10);
|
|
480
503
|
seed.jin10FlashRetentionDays = await promptInteger(rl, "Jin10 快讯保留天数", seed.jin10FlashRetentionDays, 1);
|
|
481
504
|
const nightAlertChoice = await promptSelect(rl, "Jin10 夜间静默", [
|
|
@@ -483,21 +506,31 @@ async function promptForConfig(options, existing, pluginDir, configPath) {
|
|
|
483
506
|
{ value: "false", label: "开启夜间静默(22:00~06:00 不告警)" },
|
|
484
507
|
], seed.jin10FlashNightAlert ? "true" : "false");
|
|
485
508
|
seed.jin10FlashNightAlert = nightAlertChoice === "true";
|
|
486
|
-
seed.llmBaseUrl = await promptString(rl, "LLM Base URL", seed.llmBaseUrl,
|
|
487
|
-
|
|
488
|
-
|
|
509
|
+
seed.llmBaseUrl = await promptString(rl, buildEnvAwarePromptLabel("LLM Base URL", "llmBaseUrl", seed.llmBaseUrl), seed.llmBaseUrl, {
|
|
510
|
+
required: true,
|
|
511
|
+
allowClear: hasConfigEnvFallback("llmBaseUrl"),
|
|
512
|
+
});
|
|
513
|
+
seed.llmApiKey = await promptString(rl, buildEnvAwarePromptLabel("LLM API Key", "llmApiKey", seed.llmApiKey), seed.llmApiKey, {
|
|
514
|
+
required: !hasConfigEnvFallback("llmApiKey"),
|
|
515
|
+
maskDefault: true,
|
|
516
|
+
allowClear: true,
|
|
517
|
+
});
|
|
518
|
+
seed.llmModel = await promptString(rl, buildEnvAwarePromptLabel("LLM Model", "llmModel", seed.llmModel), seed.llmModel, {
|
|
519
|
+
required: true,
|
|
520
|
+
allowClear: hasConfigEnvFallback("llmModel"),
|
|
521
|
+
});
|
|
489
522
|
console.log("");
|
|
490
523
|
const alertResult = await promptAlertChannel(rl, configPath, seed.alertChannel);
|
|
491
524
|
seed.alertChannel = alertResult.channel;
|
|
492
525
|
seed.alertAccount = alertResult.account;
|
|
493
526
|
let targetLabel = "Alert Target";
|
|
494
527
|
if (seed.alertAccount) {
|
|
495
|
-
targetLabel = `已选通道 [${seed.alertChannel}] 及账号 [${seed.alertAccount}],请输入 Alert Target
|
|
528
|
+
targetLabel = `已选通道 [${seed.alertChannel}] 及账号 [${seed.alertAccount}],请输入 Alert Target(建议填写)`;
|
|
496
529
|
}
|
|
497
530
|
else {
|
|
498
|
-
targetLabel = `已选通道 [${seed.alertChannel}],请输入 Alert Target
|
|
531
|
+
targetLabel = `已选通道 [${seed.alertChannel}],请输入 Alert Target(建议填写)`;
|
|
499
532
|
}
|
|
500
|
-
seed.alertTarget = await promptString(rl, targetLabel, seed.alertTarget, false);
|
|
533
|
+
seed.alertTarget = await promptString(rl, targetLabel, seed.alertTarget, { required: false });
|
|
501
534
|
seed.requestInterval = await promptInteger(rl, "Request Interval (seconds)", seed.requestInterval, 5);
|
|
502
535
|
seed.dailyUpdateNotify = await promptBoolean(rl, "Daily Update Notify", seed.dailyUpdateNotify);
|
|
503
536
|
}
|
|
@@ -507,12 +540,17 @@ async function promptForConfig(options, existing, pluginDir, configPath) {
|
|
|
507
540
|
assertRequired(seed);
|
|
508
541
|
return seed;
|
|
509
542
|
}
|
|
510
|
-
async function promptString(rl, label, defaultValue,
|
|
543
|
+
async function promptString(rl, label, defaultValue, options) {
|
|
511
544
|
while (true) {
|
|
512
|
-
const suffix = defaultValue
|
|
545
|
+
const suffix = defaultValue
|
|
546
|
+
? options.maskDefault ? " [已存在]" : ` [${defaultValue}]`
|
|
547
|
+
: "";
|
|
513
548
|
const answer = (await rl.question(`${label}${suffix}: `)).trim();
|
|
549
|
+
if (options.allowClear && answer === "-") {
|
|
550
|
+
return "";
|
|
551
|
+
}
|
|
514
552
|
const value = answer || defaultValue;
|
|
515
|
-
if (!required || value) {
|
|
553
|
+
if (!options.required || value) {
|
|
516
554
|
return value;
|
|
517
555
|
}
|
|
518
556
|
console.error(`${label} 不能为空`);
|
|
@@ -544,11 +582,11 @@ async function promptBoolean(rl, label, defaultValue) {
|
|
|
544
582
|
}
|
|
545
583
|
}
|
|
546
584
|
function assertRequired(config) {
|
|
547
|
-
if (!config.tickflowApiKey) {
|
|
548
|
-
throw new Error(
|
|
585
|
+
if (!config.tickflowApiKey && !hasConfigEnvFallback("tickflowApiKey")) {
|
|
586
|
+
throw new Error(`tickflowApiKey is required (or set ${formatConfigEnvFallback("tickflowApiKey")})`);
|
|
549
587
|
}
|
|
550
|
-
if (!config.llmApiKey) {
|
|
551
|
-
throw new Error(
|
|
588
|
+
if (!config.llmApiKey && !hasConfigEnvFallback("llmApiKey")) {
|
|
589
|
+
throw new Error(`llmApiKey is required (or set ${formatConfigEnvFallback("llmApiKey")})`);
|
|
552
590
|
}
|
|
553
591
|
}
|
|
554
592
|
function normalizeCommunityInstallSpec(root) {
|
|
@@ -806,6 +844,7 @@ async function configureOpenClaw(options) {
|
|
|
806
844
|
if (normalizedInstallSpec) {
|
|
807
845
|
console.log(`Community install spec normalized: clawhub:${PLUGIN_ID}`);
|
|
808
846
|
}
|
|
847
|
+
printActiveEnvFallbacks(config);
|
|
809
848
|
printNextSteps(options, config);
|
|
810
849
|
}
|
|
811
850
|
async function main() {
|
|
@@ -823,3 +862,30 @@ async function main() {
|
|
|
823
862
|
}
|
|
824
863
|
}
|
|
825
864
|
void main();
|
|
865
|
+
function buildEnvAwarePromptLabel(label, key, currentValue) {
|
|
866
|
+
if (!hasConfigEnvFallback(key)) {
|
|
867
|
+
return label;
|
|
868
|
+
}
|
|
869
|
+
const fallback = formatConfigEnvFallback(key);
|
|
870
|
+
if (currentValue) {
|
|
871
|
+
return `${label}(留空保留当前值;输入 - 清空并改用环境变量 ${fallback})`;
|
|
872
|
+
}
|
|
873
|
+
return `${label}(留空则使用环境变量 ${fallback})`;
|
|
874
|
+
}
|
|
875
|
+
function printActiveEnvFallbacks(config) {
|
|
876
|
+
const activeFallbacks = [
|
|
877
|
+
{ key: "tickflowApiKey", label: "TickFlow API Key", value: config.tickflowApiKey },
|
|
878
|
+
{ key: "mxSearchApiKey", label: "MX Search API Key", value: config.mxSearchApiKey },
|
|
879
|
+
{ key: "jin10ApiToken", label: "Jin10 API Token", value: config.jin10ApiToken },
|
|
880
|
+
{ key: "llmBaseUrl", label: "LLM Base URL", value: config.llmBaseUrl },
|
|
881
|
+
{ key: "llmApiKey", label: "LLM API Key", value: config.llmApiKey },
|
|
882
|
+
{ key: "llmModel", label: "LLM Model", value: config.llmModel },
|
|
883
|
+
].filter(({ key, value }) => !value && hasConfigEnvFallback(key));
|
|
884
|
+
if (activeFallbacks.length === 0) {
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
console.log("Active env fallback:");
|
|
888
|
+
for (const entry of activeFallbacks) {
|
|
889
|
+
console.log(` ${entry.label}: ${formatConfigEnvFallback(entry.key)}`);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatConfigEnvFallback } from "../config/env.js";
|
|
1
2
|
export class AnalysisService {
|
|
2
3
|
llmBaseUrl;
|
|
3
4
|
llmApiKey;
|
|
@@ -14,13 +15,13 @@ export class AnalysisService {
|
|
|
14
15
|
}
|
|
15
16
|
getConfigurationError() {
|
|
16
17
|
if (!this.llmBaseUrl.trim()) {
|
|
17
|
-
return
|
|
18
|
+
return `LLM 未配置接口地址,请设置 llmBaseUrl 或环境变量 ${formatConfigEnvFallback("llmBaseUrl")}`;
|
|
18
19
|
}
|
|
19
20
|
if (!this.llmApiKey.trim()) {
|
|
20
|
-
return
|
|
21
|
+
return `LLM 未配置 API Key,请设置 llmApiKey 或环境变量 ${formatConfigEnvFallback("llmApiKey")}`;
|
|
21
22
|
}
|
|
22
23
|
if (!this.llmModel.trim()) {
|
|
23
|
-
return
|
|
24
|
+
return `LLM 未配置模型,请设置 llmModel 或环境变量 ${formatConfigEnvFallback("llmModel")}`;
|
|
24
25
|
}
|
|
25
26
|
return null;
|
|
26
27
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatConfigEnvFallback } from "../config/env.js";
|
|
1
2
|
export class Jin10McpService {
|
|
2
3
|
serverUrl;
|
|
3
4
|
apiToken;
|
|
@@ -14,10 +15,10 @@ export class Jin10McpService {
|
|
|
14
15
|
}
|
|
15
16
|
getConfigurationError() {
|
|
16
17
|
if (!this.serverUrl.trim()) {
|
|
17
|
-
return
|
|
18
|
+
return `Jin10 MCP 未配置接口地址,请设置 jin10McpUrl 或环境变量 ${formatConfigEnvFallback("jin10McpUrl")}`;
|
|
18
19
|
}
|
|
19
20
|
if (!this.apiToken.trim()) {
|
|
20
|
-
return
|
|
21
|
+
return `Jin10 MCP 未配置 API Token,请设置 jin10ApiToken 或环境变量 ${formatConfigEnvFallback("jin10ApiToken")}`;
|
|
21
22
|
}
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatConfigEnvFallback } from "../config/env.js";
|
|
1
2
|
export class MxSearchServiceError extends Error {
|
|
2
3
|
constructor(message) {
|
|
3
4
|
super(message);
|
|
@@ -16,10 +17,10 @@ export class MxApiService {
|
|
|
16
17
|
}
|
|
17
18
|
getConfigurationError() {
|
|
18
19
|
if (!this.apiBaseUrl.trim()) {
|
|
19
|
-
return
|
|
20
|
+
return `mx_search 未配置接口地址,请设置 mxSearchApiUrl 或环境变量 ${formatConfigEnvFallback("mxSearchApiUrl")}`;
|
|
20
21
|
}
|
|
21
22
|
if (!this.apiKey.trim()) {
|
|
22
|
-
return
|
|
23
|
+
return `mx_search 未配置 API Key,请设置插件配置 mxSearchApiKey 或环境变量 ${formatConfigEnvFallback("mxSearchApiKey")}`;
|
|
23
24
|
}
|
|
24
25
|
return null;
|
|
25
26
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "tickflow-assist",
|
|
3
3
|
"name": "TickFlow Assist",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"description": "A-share watchlist analysis, monitoring, and alert delivery powered by TickFlow and OpenClaw.",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills"
|
|
8
8
|
],
|
|
9
|
+
"activation": {
|
|
10
|
+
"onCapabilities": ["tool", "hook"]
|
|
11
|
+
},
|
|
12
|
+
"setup": {
|
|
13
|
+
"requiresRuntime": true
|
|
14
|
+
},
|
|
15
|
+
"configContracts": {
|
|
16
|
+
"secretInputs": {
|
|
17
|
+
"paths": [
|
|
18
|
+
{
|
|
19
|
+
"path": "tickflowApiKey",
|
|
20
|
+
"expected": "string"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "llmApiKey",
|
|
24
|
+
"expected": "string"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "mxSearchApiKey",
|
|
28
|
+
"expected": "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "jin10ApiToken",
|
|
32
|
+
"expected": "string"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
9
37
|
"configSchema": {
|
|
10
38
|
"type": "object",
|
|
11
39
|
"additionalProperties": false,
|
|
@@ -13,38 +41,38 @@
|
|
|
13
41
|
"tickflowApiUrl": {
|
|
14
42
|
"type": "string",
|
|
15
43
|
"default": "https://api.tickflow.org",
|
|
16
|
-
"description": "TickFlow API base URL."
|
|
44
|
+
"description": "TickFlow API base URL. Leave empty to use TICKFLOW_ASSIST_TICKFLOW_API_URL or TICKFLOW_API_URL."
|
|
17
45
|
},
|
|
18
46
|
"tickflowApiKey": {
|
|
19
47
|
"type": "string",
|
|
20
48
|
"minLength": 1,
|
|
21
|
-
"description": "TickFlow API key used for market and financial data.
|
|
49
|
+
"description": "TickFlow API key used for market and financial data. Leave empty to use TICKFLOW_ASSIST_TICKFLOW_API_KEY or TICKFLOW_API_KEY."
|
|
22
50
|
},
|
|
23
51
|
"tickflowApiKeyLevel": {
|
|
24
52
|
"type": "string",
|
|
25
53
|
"enum": ["Free", "Start", "Pro", "Expert"],
|
|
26
54
|
"default": "Free",
|
|
27
|
-
"description": "TickFlow subscription level. Pro and Expert enable intraday K-line fetching."
|
|
55
|
+
"description": "TickFlow subscription level. Pro and Expert enable intraday K-line fetching. Can also come from TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL or TICKFLOW_API_KEY_LEVEL."
|
|
28
56
|
},
|
|
29
57
|
"mxSearchApiUrl": {
|
|
30
58
|
"type": "string",
|
|
31
59
|
"default": "https://mkapi2.dfcfs.com/finskillshub/api/claw",
|
|
32
|
-
"description": "MX Search API base URL."
|
|
60
|
+
"description": "MX Search API base URL. Leave empty to use TICKFLOW_ASSIST_MX_SEARCH_API_URL or MX_SEARCH_API_URL."
|
|
33
61
|
},
|
|
34
62
|
"mxSearchApiKey": {
|
|
35
63
|
"type": "string",
|
|
36
64
|
"default": "",
|
|
37
|
-
"description": "
|
|
65
|
+
"description": "Configure this during setup if you want mx_search, mx_select_stock, and non-Expert financial fallback. Leave empty to use TICKFLOW_ASSIST_MX_SEARCH_API_KEY, MX_SEARCH_API_KEY, or MX_APIKEY."
|
|
38
66
|
},
|
|
39
67
|
"jin10McpUrl": {
|
|
40
68
|
"type": "string",
|
|
41
69
|
"default": "https://mcp.jin10.com/mcp",
|
|
42
|
-
"description": "Jin10 MCP server URL used for realtime flash monitoring."
|
|
70
|
+
"description": "Jin10 MCP server URL used for realtime flash monitoring. Leave empty to use TICKFLOW_ASSIST_JIN10_MCP_URL or JIN10_MCP_URL."
|
|
43
71
|
},
|
|
44
72
|
"jin10ApiToken": {
|
|
45
73
|
"type": "string",
|
|
46
74
|
"default": "",
|
|
47
|
-
"description": "
|
|
75
|
+
"description": "Configure this during setup to keep the managed Jin10 realtime flash monitor fully available. Leave empty to use TICKFLOW_ASSIST_JIN10_API_TOKEN or JIN10_API_TOKEN."
|
|
48
76
|
},
|
|
49
77
|
"jin10FlashPollInterval": {
|
|
50
78
|
"type": "integer",
|
|
@@ -66,17 +94,17 @@
|
|
|
66
94
|
"llmBaseUrl": {
|
|
67
95
|
"type": "string",
|
|
68
96
|
"default": "https://api.openai.com/v1",
|
|
69
|
-
"description": "OpenAI-compatible LLM API base URL."
|
|
97
|
+
"description": "OpenAI-compatible LLM API base URL. Leave empty to use TICKFLOW_ASSIST_LLM_BASE_URL or LLM_BASE_URL."
|
|
70
98
|
},
|
|
71
99
|
"llmApiKey": {
|
|
72
100
|
"type": "string",
|
|
73
101
|
"minLength": 1,
|
|
74
|
-
"description": "API key for the analysis model endpoint configured in llmBaseUrl.
|
|
102
|
+
"description": "API key for the analysis model endpoint configured in llmBaseUrl. Leave empty to use TICKFLOW_ASSIST_LLM_API_KEY or LLM_API_KEY."
|
|
75
103
|
},
|
|
76
104
|
"llmModel": {
|
|
77
105
|
"type": "string",
|
|
78
106
|
"default": "gpt-4o",
|
|
79
|
-
"description": "Model name used for analysis."
|
|
107
|
+
"description": "Model name used for analysis. Leave empty to use TICKFLOW_ASSIST_LLM_MODEL or LLM_MODEL."
|
|
80
108
|
},
|
|
81
109
|
"databasePath": {
|
|
82
110
|
"type": "string",
|
|
@@ -101,7 +129,7 @@
|
|
|
101
129
|
},
|
|
102
130
|
"alertChannel": {
|
|
103
131
|
"type": "string",
|
|
104
|
-
"description": "
|
|
132
|
+
"description": "Configure this during setup for alert delivery, e.g. telegram, qqbot, wecom.",
|
|
105
133
|
"default": "telegram"
|
|
106
134
|
},
|
|
107
135
|
"openclawCliBin": {
|
|
@@ -114,7 +142,7 @@
|
|
|
114
142
|
},
|
|
115
143
|
"alertTarget": {
|
|
116
144
|
"type": "string",
|
|
117
|
-
"description": "
|
|
145
|
+
"description": "Configure this during setup for test_alert, monitoring alerts, and scheduled notifications.",
|
|
118
146
|
"default": ""
|
|
119
147
|
},
|
|
120
148
|
"pythonBin": {
|
|
@@ -140,26 +168,26 @@
|
|
|
140
168
|
"uiHints": {
|
|
141
169
|
"tickflowApiKey": {
|
|
142
170
|
"label": "TickFlow API Key",
|
|
143
|
-
"help": "
|
|
171
|
+
"help": "Used for TickFlow market and financial data. Leave empty to use TICKFLOW_ASSIST_TICKFLOW_API_KEY or TICKFLOW_API_KEY.",
|
|
144
172
|
"sensitive": true
|
|
145
173
|
},
|
|
146
174
|
"tickflowApiKeyLevel": {
|
|
147
175
|
"label": "TickFlow API Key Level",
|
|
148
|
-
"help": "Set this to your actual TickFlow subscription level."
|
|
176
|
+
"help": "Set this to your actual TickFlow subscription level, or provide it via TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL / TICKFLOW_API_KEY_LEVEL."
|
|
149
177
|
},
|
|
150
178
|
"mxSearchApiKey": {
|
|
151
179
|
"label": "MX Search API Key",
|
|
152
|
-
"help": "
|
|
180
|
+
"help": "Configure this during setup if you want mx_search, mx_select_stock, and lite financial fallback, or use TICKFLOW_ASSIST_MX_SEARCH_API_KEY / MX_SEARCH_API_KEY / MX_APIKEY.",
|
|
153
181
|
"sensitive": true
|
|
154
182
|
},
|
|
155
183
|
"jin10McpUrl": {
|
|
156
184
|
"label": "Jin10 MCP URL",
|
|
157
|
-
"help": "
|
|
185
|
+
"help": "Configure this together with the Jin10 token for the managed flash monitor, or use TICKFLOW_ASSIST_JIN10_MCP_URL / JIN10_MCP_URL.",
|
|
158
186
|
"advanced": true
|
|
159
187
|
},
|
|
160
188
|
"jin10ApiToken": {
|
|
161
189
|
"label": "Jin10 API Token",
|
|
162
|
-
"help": "
|
|
190
|
+
"help": "Configure this during setup to keep the managed Jin10 flash monitor fully available, or use TICKFLOW_ASSIST_JIN10_API_TOKEN / JIN10_API_TOKEN.",
|
|
163
191
|
"sensitive": true
|
|
164
192
|
},
|
|
165
193
|
"jin10FlashPollInterval": {
|
|
@@ -179,24 +207,24 @@
|
|
|
179
207
|
},
|
|
180
208
|
"llmBaseUrl": {
|
|
181
209
|
"label": "LLM Base URL",
|
|
182
|
-
"help": "OpenAI-compatible analysis endpoint."
|
|
210
|
+
"help": "OpenAI-compatible analysis endpoint. Leave empty to use TICKFLOW_ASSIST_LLM_BASE_URL or LLM_BASE_URL."
|
|
183
211
|
},
|
|
184
212
|
"llmApiKey": {
|
|
185
213
|
"label": "LLM API Key",
|
|
186
|
-
"help": "
|
|
214
|
+
"help": "Used for analysis model requests. Leave empty to use TICKFLOW_ASSIST_LLM_API_KEY or LLM_API_KEY.",
|
|
187
215
|
"sensitive": true
|
|
188
216
|
},
|
|
189
217
|
"llmModel": {
|
|
190
218
|
"label": "LLM Model",
|
|
191
|
-
"help": "Model name used for stock analysis."
|
|
219
|
+
"help": "Model name used for stock analysis. Leave empty to use TICKFLOW_ASSIST_LLM_MODEL or LLM_MODEL."
|
|
192
220
|
},
|
|
193
221
|
"alertChannel": {
|
|
194
222
|
"label": "Alert Channel",
|
|
195
|
-
"help": "
|
|
223
|
+
"help": "Configure this during setup before enabling alert delivery."
|
|
196
224
|
},
|
|
197
225
|
"alertTarget": {
|
|
198
226
|
"label": "Alert Target",
|
|
199
|
-
"help": "
|
|
227
|
+
"help": "Configure this during setup for test_alert, monitoring alerts, and scheduled notifications."
|
|
200
228
|
},
|
|
201
229
|
"databasePath": {
|
|
202
230
|
"label": "Database Path",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tickflow-assist",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "面向 A 股投资与盯盘场景的 OpenClaw 智能股票插件,基于 TickFlow API 提供实时监控、收盘后复盘、多维综合分析、关键价位跟踪与告警能力。OpenClaw smart stock plugin for A-share investing and watchlist workflows, powered by TickFlow API for realtime monitoring, post-close review, multi-dimensional analysis, key level tracking, and alerts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
},
|
|
47
47
|
"openclaw": {
|
|
48
48
|
"build": {
|
|
49
|
-
"openclawVersion": "2026.4.
|
|
49
|
+
"openclawVersion": "2026.4.11"
|
|
50
50
|
},
|
|
51
51
|
"compat": {
|
|
52
52
|
"pluginApi": ">=2026.3.31",
|
|
53
53
|
"minGatewayVersion": "2026.3.31",
|
|
54
|
-
"builtWithOpenClawVersion": "2026.4.
|
|
54
|
+
"builtWithOpenClawVersion": "2026.4.11"
|
|
55
55
|
},
|
|
56
56
|
"extensions": [
|
|
57
57
|
"dist/plugin.js"
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^22.13.11",
|
|
72
|
-
"openclaw": "^2026.4.
|
|
72
|
+
"openclaw": "^2026.4.11",
|
|
73
73
|
"typescript": "^5.8.2"
|
|
74
74
|
},
|
|
75
|
-
"readme": "# TickFlow Assist\n\n基于 [OpenClaw](https://openclaw.ai) 的 A 股监控与分析插件。它使用 [TickFlow](https://tickflow.org/auth/register?ref=BUJ54JEDGE) 获取行情与财务数据,并可选接入 [金十数据 MCP](https://mcp.jin10.com/app/) 快讯流,结合 LLM 生成技术面、基本面、资讯面的综合判断,并把结果持久化到本地 LanceDB。\n\n最近更新:`v0.3.4`
|
|
75
|
+
"readme": "# TickFlow Assist\n\n基于 [OpenClaw](https://openclaw.ai) 的 A 股监控与分析插件。它使用 [TickFlow](https://tickflow.org/auth/register?ref=BUJ54JEDGE) 获取行情与财务数据,并可选接入 [金十数据 MCP](https://mcp.jin10.com/app/) 快讯流,结合 LLM 生成技术面、基本面、资讯面的综合判断,并把结果持久化到本地 LanceDB。\n\n最近更新:`v0.3.5` 对齐 OpenClaw `2026.4.11` metadata 与社区安装提示,修复源码升级时本地链接扫描 `node_modules` 失败的问题,并支持通过环境变量回退 TickFlow / LLM / MX / Jin10 配置。完整发布记录见 <https://github.com/robinspt/tickflow-assist/blob/main/CHANGELOG.md>。\n\n当前主线按 OpenClaw `v2026.3.31+` 对齐,并已验证社区安装在 `v2026.4.11` 上兼容。\n\n## 安装前准备\n\n在执行社区安装前,建议先确认你已经准备好以下配置:\n\n- 核心必需:`tickflowApiKey`、`llmApiKey`、`llmBaseUrl`、`llmModel`\n- 告警投递:`alertChannel`、`alertTarget`、`alertAccount`\n- 可选增强:`mxSearchApiKey`、`jin10ApiToken`\n\n其中,`configure-openclaw` 会把上述配置写入 `~/.openclaw/openclaw.json` 的 `plugins.entries[\"tickflow-assist\"].config`,插件启用后会在本地 `databasePath` 下持久化 LanceDB 数据,并运行监控 / 日更等后台服务。\n如果你不想把密钥写进配置文件,运行时也支持环境变量回退,优先级是 `openclaw.json / local.config.json` > 环境变量 > 默认值。\n常用环境变量:`TICKFLOW_ASSIST_TICKFLOW_API_KEY` / `TICKFLOW_API_KEY`、`TICKFLOW_ASSIST_LLM_API_KEY` / `LLM_API_KEY`、`TICKFLOW_ASSIST_LLM_BASE_URL` / `LLM_BASE_URL`、`TICKFLOW_ASSIST_LLM_MODEL` / `LLM_MODEL`、`TICKFLOW_ASSIST_MX_SEARCH_API_KEY` / `MX_SEARCH_API_KEY` / `MX_APIKEY`、`TICKFLOW_ASSIST_JIN10_API_TOKEN` / `JIN10_API_TOKEN`。\n\n## 安装\n\n社区安装:\n\n```bash\nopenclaw plugins install tickflow-assist\nnpx -y tickflow-assist configure-openclaw\ncd ~/.openclaw/extensions/tickflow-assist/python && uv sync\nopenclaw plugins enable tickflow-assist\nopenclaw config validate\nopenclaw gateway restart\n```\n\n安装阶段允许先落插件,再通过第二条命令写入 `tickflowApiKey`、`llmApiKey`、`llmBaseUrl`、`llmModel` 等正式配置。\n`configure-openclaw` 会写入 `~/.openclaw/openclaw.json` 中的 `plugins.entries[\"tickflow-assist\"].config`,并打印后续建议执行的命令;它不再自动执行 `openclaw`、`uv` 或系统包安装命令,也不会重新执行插件安装;如果你已经设置了环境变量,密钥项可留空,输入 `-` 可主动清空已有配置并切回环境变量。\n如果检测到 `plugins.installs[\"tickflow-assist\"]` 来自 `clawhub`,向导还会把被旧版本钉死的 `spec` 归一化为 `clawhub:tickflow-assist`,避免后续升级继续锁在旧版本。\n\n如果你希望先审阅配置,再只打印最少的后续步骤,可使用:\n\n```bash\nnpx -y tickflow-assist configure-openclaw --no-enable --no-restart\n```\n\n如果你在 Linux 或 macOS 上需要 PNG 告警卡正常显示中文,请额外手动安装 `fontconfig` 与 Noto CJK 一类中文字体,例如:\n\n```bash\n# Debian / Ubuntu\nsudo apt-get update\nsudo apt-get install -y fontconfig fonts-noto-cjk\nfc-cache -fv\n\n# RHEL / Fedora / Rocky / AlmaLinux\nsudo dnf install -y fontconfig google-noto-sans-cjk-ttc-fonts\nfc-cache -fv\n\n# Arch / Manjaro\nsudo pacman -Sy --noconfirm fontconfig noto-fonts-cjk\nfc-cache -fv\n\n# Alpine\nsudo apk add fontconfig font-noto-cjk\nfc-cache -fv\n\n# macOS (Homebrew)\nbrew install fontconfig\nbrew install --cask font-noto-sans-cjk\nfc-cache -fv\n```\n\n社区安装后的升级方式:\n\n```bash\nopenclaw plugins update tickflow-assist\nopenclaw gateway restart\n```\n\n## 配置\n\n插件正式运行读取:\n\n```text\n~/.openclaw/openclaw.json\n```\n\n配置路径:\n\n```text\nplugins.entries[\"tickflow-assist\"].config\n```\n\n建议按完整功能显式填写以下字段,不要只填 API Key:\n\n- 核心运行:`tickflowApiKey`、`llmApiKey`、`llmBaseUrl`、`llmModel`\n- 本地数据:`databasePath`、`calendarFile`\n- 告警投递:`alertChannel`、`alertTarget`、`alertAccount`\n- 能力补充:`mxSearchApiKey`、`jin10ApiToken`\n\n其中,`mxSearchApiKey` 用于 `mx_search`、`mx_select_stock` 以及非 `Expert` 财务链路的 lite 补充;`jin10ApiToken` 用于 24 小时金十数据快讯监控;`jin10FlashNightAlert` 默认 `false`(开启夜间静默),设为 `true` 可恢复 24 小时快讯告警;`alertTarget`、`alertAccount` 建议在准备启用 `test_alert`、实时监控告警、金十数据快讯告警和定时通知前一并配好,避免配置不完整导致功能缺失。\n如果你使用环境变量,运行时支持以下回退:\n\n- `tickflowApiUrl`:`TICKFLOW_ASSIST_TICKFLOW_API_URL` / `TICKFLOW_API_URL`\n- `tickflowApiKey`:`TICKFLOW_ASSIST_TICKFLOW_API_KEY` / `TICKFLOW_API_KEY`\n- `tickflowApiKeyLevel`:`TICKFLOW_ASSIST_TICKFLOW_API_KEY_LEVEL` / `TICKFLOW_API_KEY_LEVEL`\n- `llmBaseUrl`:`TICKFLOW_ASSIST_LLM_BASE_URL` / `LLM_BASE_URL`\n- `llmApiKey`:`TICKFLOW_ASSIST_LLM_API_KEY` / `LLM_API_KEY`\n- `llmModel`:`TICKFLOW_ASSIST_LLM_MODEL` / `LLM_MODEL`\n- `mxSearchApiUrl`:`TICKFLOW_ASSIST_MX_SEARCH_API_URL` / `MX_SEARCH_API_URL`\n- `mxSearchApiKey`:`TICKFLOW_ASSIST_MX_SEARCH_API_KEY` / `MX_SEARCH_API_KEY` / `MX_APIKEY`\n- `jin10McpUrl`:`TICKFLOW_ASSIST_JIN10_MCP_URL` / `JIN10_MCP_URL`\n- `jin10ApiToken`:`TICKFLOW_ASSIST_JIN10_API_TOKEN` / `JIN10_API_TOKEN`\n\n## 功能\n\n- 自选股管理、日 K / 分钟 K 抓取与指标计算\n- 技术面、财务面、资讯面的综合分析\n- 实时监控、定时日更、收盘后复盘\n- 金十数据 24 小时快讯监控与自选关联提醒\n- 本地 LanceDB 数据留痕与分析结果查看\n\n## 运行说明\n\n- 插件会在本地 `databasePath` 下持久化 LanceDB 数据。\n- 后台服务会按配置执行定时日更、实时监控与金十数据快讯监控。\n- Python 子模块仅用于技术指标计算,不承担主业务流程。\n\n## 依赖与可选能力\n\n- [TickFlow](https://tickflow.org/auth/register?ref=BUJ54JEDGE):提供日线、分钟线、实时行情与财务数据接口。\n- [金十数据 MCP](https://mcp.jin10.com/app/):可选,用于 24 小时快讯流接入、自选关联筛选与事件驱动告警。\n- [东方财富妙想 Skills](https://marketing.dfcfs.com/views/finskillshub/):可选,用于 `mx_search`、`mx_select_stock` 与非 `Expert` 财务链路的 lite 补充。\n\n## 仓库\n\n- GitHub: [robinspt/tickflow-assist](https://github.com/robinspt/tickflow-assist)\n",
|
|
76
76
|
"readmeFilename": "README.md"
|
|
77
77
|
}
|