koishi-plugin-aka-sa-caller 0.0.1

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/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Context, Schema } from 'koishi';
2
+ export declare const name = "aka-sa-caller";
3
+ export interface Config {
4
+ }
5
+ export declare const Config: Schema<Config>;
6
+ export declare function apply(ctx: Context): void;
package/lib/index.js ADDED
@@ -0,0 +1,39 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name2 in all)
8
+ __defProp(target, name2, { get: all[name2], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ Config: () => Config,
24
+ apply: () => apply,
25
+ name: () => name
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+ var import_koishi = require("koishi");
29
+ var name = "aka-sa-caller";
30
+ var Config = import_koishi.Schema.object({});
31
+ function apply(ctx) {
32
+ }
33
+ __name(apply, "apply");
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ Config,
37
+ apply,
38
+ name
39
+ });
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "koishi-plugin-aka-sa-caller",
3
+ "description": "",
4
+ "version": "0.0.1",
5
+ "main": "lib/index.js",
6
+ "typings": "lib/index.d.ts",
7
+ "files": [
8
+ "lib",
9
+ "dist",
10
+ "readme.md"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "Baka_Akari",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/BakaAkari/aka-sa-caller.git"
17
+ },
18
+ "keywords": [
19
+ "chatbot",
20
+ "koishi",
21
+ "plugin",
22
+ "stock",
23
+ "stock-analysis",
24
+ "finance"
25
+ ],
26
+ "scripts": {
27
+ "build": "yakumo build",
28
+ "compile": "tsc"
29
+ },
30
+ "peerDependencies": {
31
+ "koishi": "^4.18.9"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^20.0.0",
35
+ "typescript": "^5.0.0"
36
+ },
37
+ "koishi": {
38
+ "description": {
39
+ "en": "",
40
+ "zh": ""
41
+ },
42
+ "service": {
43
+ "required": [],
44
+ "optional": []
45
+ }
46
+ }
47
+ }
package/readme.md ADDED
@@ -0,0 +1,73 @@
1
+ # koishi-plugin-aka-sa-caller
2
+
3
+ Koishi 插件,用于集成 Stock Advisor 服务,实现股票分析功能。
4
+
5
+ ## 功能特性
6
+
7
+ - 🔄 **动态股票指令**:根据 Stock Advisor 中的股票列表自动创建指令
8
+ - 📊 **异步分析**:提交分析任务并自动轮询结果
9
+ - 📋 **股票列表**:查看所有可用的股票代码
10
+ - 🔄 **实时更新**:刷新股票列表以获取最新添加的股票
11
+ - ⚠️ **错误处理**:完整的错误提示和超时处理
12
+
13
+ ## 安装
14
+
15
+ 在 Koishi 插件市场搜索 `aka-sa-caller` 或使用以下命令安装:
16
+
17
+ ```bash
18
+ npm install koishi-plugin-aka-sa-caller
19
+ ```
20
+
21
+ ## 配置
22
+
23
+ | 配置项 | 默认值 | 说明 |
24
+ |--------|--------|------|
25
+ | `apiUrl` | `http://localhost:2380` | Stock Advisor API 地址 |
26
+ | `pollInterval` | `2000` | 轮询间隔(毫秒) |
27
+ | `maxPollAttempts` | `60` | 最大轮询次数(约2分钟) |
28
+
29
+ ## 使用方法
30
+
31
+ ### 1. 查看可用股票代码
32
+
33
+ ```
34
+ 代码
35
+ ```
36
+
37
+ 返回所有可用的股票代码列表。
38
+
39
+ ### 2. 分析股票
40
+
41
+ 直接输入股票代码即可触发分析:
42
+
43
+ ```
44
+ NVDA
45
+ ```
46
+
47
+ 插件会:
48
+ 1. 提交分析任务到 Stock Advisor
49
+ 2. 显示"正在分析..."提示
50
+ 3. 自动轮询任务状态
51
+ 4. 返回完整的分析结果
52
+
53
+ ### 3. 更新股票列表
54
+
55
+ 当在 Stock Advisor 中添加新股票后,使用此指令刷新:
56
+
57
+ ```
58
+ 更新股票代码
59
+ ```
60
+
61
+ ## 前置条件
62
+
63
+ 1. Stock Advisor 服务需要运行(默认 `http://localhost:2380`)
64
+ 2. Stock Advisor 已配置好 API 和股票列表
65
+ 3. 确保网络连接正常
66
+
67
+ ## 许可证
68
+
69
+ MIT
70
+
71
+ ## 作者
72
+
73
+ Baka_Akari